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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
52,022 | 09/09/2008 14:34:29 | 4,002 | 09/01/2008 09:28:22 | 58 | 5 | Getting a list of assemblies needed by application | Is there a way of getting all required assemblies (excluding the .net framework) for a .net project into a folder ready to be packaged into an [nsis][1] as setup file?
I've tried writing a small console app that uses reflection to get a list of dlls but have got stuck with finding a foolproof way of determining if a dll is from the .net framework or not.
The answer could be a simple switch in Visual Studio to output all dependencies, or a standalone app that can do it, or a plugin for Nsis, or some information on reflection that I've missed.
[1]: http://nsis.sourceforge.net/Main_Page | .net | reflection | dependencies | nsis | assemblies | null | open | Getting a list of assemblies needed by application
===
Is there a way of getting all required assemblies (excluding the .net framework) for a .net project into a folder ready to be packaged into an [nsis][1] as setup file?
I've tried writing a small console app that uses reflection to get a list of dlls but have got stuck with finding a foolproof way of determining if a dll is from the .net framework or not.
The answer could be a simple switch in Visual Studio to output all dependencies, or a standalone app that can do it, or a plugin for Nsis, or some information on reflection that I've missed.
[1]: http://nsis.sourceforge.net/Main_Page | 0 |
52,046 | 09/09/2008 14:40:34 | 5,421 | 09/09/2008 13:51:28 | 1 | 2 | Accessing a web service in a Flash CS3 AS3 project. | Since CS3 doesn't have a web service component, as previous versions had, is there a good, feature-complete, AS3-only (no Flex dependencies) library for accessing web services with AS3? | web-services | flash | actionscript-3 | null | null | null | open | Accessing a web service in a Flash CS3 AS3 project.
===
Since CS3 doesn't have a web service component, as previous versions had, is there a good, feature-complete, AS3-only (no Flex dependencies) library for accessing web services with AS3? | 0 |
52,059 | 09/09/2008 14:47:49 | 1,341 | 08/14/2008 15:30:17 | 411 | 14 | What is the best source for information on COM error codes? | I'm at a loss for where to get the best information about the meaning, likely causes, and possible solutions to resolve COM errors when all you have is the HRESULT.
Searching google for terms like '80004027' is just about useless as it sends you to random discussion groups where 90% of the time, the question 'What does 80004027 mean?' is not answered.
Does anyone have a good resource for this? Why isn't msdn the top google result? | windows | com | null | null | null | null | open | What is the best source for information on COM error codes?
===
I'm at a loss for where to get the best information about the meaning, likely causes, and possible solutions to resolve COM errors when all you have is the HRESULT.
Searching google for terms like '80004027' is just about useless as it sends you to random discussion groups where 90% of the time, the question 'What does 80004027 mean?' is not answered.
Does anyone have a good resource for this? Why isn't msdn the top google result? | 0 |
52,066 | 09/09/2008 14:50:20 | 3,993 | 09/01/2008 08:11:56 | 76 | 8 | Dynamic regex for date time formats | Is there an existing solution to create regular expressions dynamically out of given date time format pattern? Supported date time format pattern does not matter (Joda DateTimeFormat, java.text.SimpleDateTimeFormat or others). What I need is extracting date time information from a given text with a provided date time pattern.
i.e. "dd/MM/yyyy hh:mm". | regex | datetime | information-retrieval | null | null | null | open | Dynamic regex for date time formats
===
Is there an existing solution to create regular expressions dynamically out of given date time format pattern? Supported date time format pattern does not matter (Joda DateTimeFormat, java.text.SimpleDateTimeFormat or others). What I need is extracting date time information from a given text with a provided date time pattern.
i.e. "dd/MM/yyyy hh:mm". | 0 |
52,071 | 09/09/2008 14:50:57 | 5,380 | 09/09/2008 11:49:46 | 1 | 1 | .NET path manipulation library | Does anyone know of any good library that abstracts the problem of path manipulation in a nice way? I'd like to be able to combine and parse paths with arbitrary separators ('/' or ':' for example) without reinventing the wheel.
It's a shame that `System.IO.Path` isn't more reusable.
Thanks | .net | path | null | null | null | null | open | .NET path manipulation library
===
Does anyone know of any good library that abstracts the problem of path manipulation in a nice way? I'd like to be able to combine and parse paths with arbitrary separators ('/' or ':' for example) without reinventing the wheel.
It's a shame that `System.IO.Path` isn't more reusable.
Thanks | 0 |
52,072 | 09/09/2008 14:51:12 | 5,056 | 09/07/2008 15:43:17 | 258 | 32 | Inversion of Control Container for PHP? | I am trying to code TDD style in PHP and one of my biggest stumbling blocks (other than lack of a decent IDE) is that I have to make my own hacked together IoC container just to inject all my mock objects properly.
Has anyone used an Ioc container in php? All I've been able to find is [PHP IOC on the ever-annoying phpclasses.org][1] and it seems to have almost no documentation and not much of a following.
[1]: http://www.phpclasses.org/browse/package/3382.html | php | frameworks | null | null | null | null | open | Inversion of Control Container for PHP?
===
I am trying to code TDD style in PHP and one of my biggest stumbling blocks (other than lack of a decent IDE) is that I have to make my own hacked together IoC container just to inject all my mock objects properly.
Has anyone used an Ioc container in php? All I've been able to find is [PHP IOC on the ever-annoying phpclasses.org][1] and it seems to have almost no documentation and not much of a following.
[1]: http://www.phpclasses.org/browse/package/3382.html | 0 |
52,080 | 09/09/2008 14:55:10 | 115 | 08/02/2008 05:44:40 | 1,103 | 118 | How do I build a loop in JavaScript? | How can I build a loop in JavaScript? | javascript | loop | null | null | null | null | open | How do I build a loop in JavaScript?
===
How can I build a loop in JavaScript? | 0 |
52,084 | 09/09/2008 14:57:01 | 5,197 | 09/08/2008 12:42:51 | 36 | 1 | Querying XML columns in SQLServer 2005 | There is a field in my company's "Contacts" table. In that table, there is an XML type column. The column holds misc data about a particular contact. EG.
<contact>
<refno>123456</refno>
<special>a piece of custom data</special>
</contact>
The tags below `contact` can be different for each contact, and I must query these fragments
alongside the relational data columns in the same table.
I have been constructions like:
SELECT c.id AS ContactID,c.ContactName as ForeName,
c.xmlvaluesn.value('(contact/Ref)[1]', 'VARCHAR(40)') as ref,
INNER JOIN ParticipantContactMap pcm ON c.id=pcm.contactid
AND pcm.participantid=2140
WHERE xmlvaluesn.exist('/contact[Ref = "118985"]') = 1
This method works ok but, it's very time consuming.
I have also investigated using the nodes() function to parse the XML nodes and exist() to test if a nodes holds the value I'm searching for.
Does anyone know a better way to query XML columns?? | sql-server | xml | xquery | null | null | null | open | Querying XML columns in SQLServer 2005
===
There is a field in my company's "Contacts" table. In that table, there is an XML type column. The column holds misc data about a particular contact. EG.
<contact>
<refno>123456</refno>
<special>a piece of custom data</special>
</contact>
The tags below `contact` can be different for each contact, and I must query these fragments
alongside the relational data columns in the same table.
I have been constructions like:
SELECT c.id AS ContactID,c.ContactName as ForeName,
c.xmlvaluesn.value('(contact/Ref)[1]', 'VARCHAR(40)') as ref,
INNER JOIN ParticipantContactMap pcm ON c.id=pcm.contactid
AND pcm.participantid=2140
WHERE xmlvaluesn.exist('/contact[Ref = "118985"]') = 1
This method works ok but, it's very time consuming.
I have also investigated using the nodes() function to parse the XML nodes and exist() to test if a nodes holds the value I'm searching for.
Does anyone know a better way to query XML columns?? | 0 |
52,092 | 09/09/2008 15:00:13 | 5,056 | 09/07/2008 15:43:17 | 258 | 32 | Why the claim that c# guys don't get object-oriented programming? (vs class-oriented) | This caught my attention last night.
On the latest [ALT.NET Podcast][1] Scott Bellware discusses how as opposed to Ruby, languages like c#, java et al. are not truly object oriented rather opting for the phrase "class-oriented". They talk about this distinction in very vague terms without going into much detail or discussing the pros and cons much.
What is the real difference here and how much does it matter? What are other languages then are "object-oriented"? It sounded pretty interesting but I don't want to have to learn Ruby just to know what if anything I am missing.
[1]: http://altnetpodcast.com/episodes/10-oop-in-ruby | oop | languages | null | null | null | null | open | Why the claim that c# guys don't get object-oriented programming? (vs class-oriented)
===
This caught my attention last night.
On the latest [ALT.NET Podcast][1] Scott Bellware discusses how as opposed to Ruby, languages like c#, java et al. are not truly object oriented rather opting for the phrase "class-oriented". They talk about this distinction in very vague terms without going into much detail or discussing the pros and cons much.
What is the real difference here and how much does it matter? What are other languages then are "object-oriented"? It sounded pretty interesting but I don't want to have to learn Ruby just to know what if anything I am missing.
[1]: http://altnetpodcast.com/episodes/10-oop-in-ruby | 0 |
52,095 | 09/09/2008 15:00:53 | 4,949 | 09/06/2008 23:35:41 | 1 | 0 | Open source projects that are easy to contribute (code) to? | By easy to contribute to I mean things like:
* Well-written/relatively easy to understand codebase
* Easy to see what work needs to be done
* Developer documentation
* Likely to accept patches
etc | open-source | null | null | null | null | null | open | Open source projects that are easy to contribute (code) to?
===
By easy to contribute to I mean things like:
* Well-written/relatively easy to understand codebase
* Easy to see what work needs to be done
* Developer documentation
* Likely to accept patches
etc | 0 |
52,098 | 09/09/2008 15:02:51 | 1,943 | 08/19/2008 14:47:06 | 8 | 2 | How do you navigate out of a ComboBox on a Windows Mobile Device without a TAB key? | I'm developing an application for Windows Mobile Devices using Visual Studio .NET 2008 whose UI requires the use of a ComboBox control. Unfortunately, for devices with neither a hardware fullsize keyboard nor a touchscreen interface, there is no way to move (tab) from the ComboBox control to another control on the same form (say, specifying a product in the ComboBox and then moving to a text field to add a quantity).
I've tried creating an event handler for the ComboBox's KeyPress event and setting the focus to the next control manually whenever the user presses the Right or Left directional key but unfortunately the event handler does not capture those key presses.
Any ideas? I have a strong suspicion that this is being over-engineered and that there exists a better control more suited to what I need to do; I find it a bit inconceivable that tabbing out of a Combo Box control could be that difficult.
Thanks!
EDIT: Apparently I can capture the KeyDown and KeyUp events on the ComboBox, which allows me to set the focus or tab to the next control. Still over-engineered - still looking for ideas! | windows-mobile | null | null | null | null | null | open | How do you navigate out of a ComboBox on a Windows Mobile Device without a TAB key?
===
I'm developing an application for Windows Mobile Devices using Visual Studio .NET 2008 whose UI requires the use of a ComboBox control. Unfortunately, for devices with neither a hardware fullsize keyboard nor a touchscreen interface, there is no way to move (tab) from the ComboBox control to another control on the same form (say, specifying a product in the ComboBox and then moving to a text field to add a quantity).
I've tried creating an event handler for the ComboBox's KeyPress event and setting the focus to the next control manually whenever the user presses the Right or Left directional key but unfortunately the event handler does not capture those key presses.
Any ideas? I have a strong suspicion that this is being over-engineered and that there exists a better control more suited to what I need to do; I find it a bit inconceivable that tabbing out of a Combo Box control could be that difficult.
Thanks!
EDIT: Apparently I can capture the KeyDown and KeyUp events on the ComboBox, which allows me to set the focus or tab to the next control. Still over-engineered - still looking for ideas! | 0 |
52,103 | 09/09/2008 15:05:53 | 1,316 | 08/14/2008 13:56:20 | 21 | 4 | Can I use SQL Server Management Studio 2005 for 2008 DB? | I am looking to manage a SQL Server 2008 DB using Management Studio 2005. The reason for this is because our server is a 64-bit machine and we only have the 64-bit version of the software.
Is this possible?
How about managing a SQL Server 2005 DB using Management Studio 2008? | sqlserver | null | null | null | null | null | open | Can I use SQL Server Management Studio 2005 for 2008 DB?
===
I am looking to manage a SQL Server 2008 DB using Management Studio 2005. The reason for this is because our server is a 64-bit machine and we only have the 64-bit version of the software.
Is this possible?
How about managing a SQL Server 2005 DB using Management Studio 2008? | 0 |
52,105 | 09/09/2008 15:06:21 | 2,108 | 08/20/2008 12:00:42 | 85 | 11 | What is the best subversion client for Linux? | I like [Subclipse][2] when working within eclipse, but would like to find something better when working on files outside of Eclipse.
I'm currently using [RapidSVN][1]. Is there anything better?
[1]: http://rapidsvn.tigris.org/
[2]: http://subclipse.tigris.org/
| svn | linux | subversion | null | null | 09/16/2011 18:51:51 | not constructive | What is the best subversion client for Linux?
===
I like [Subclipse][2] when working within eclipse, but would like to find something better when working on files outside of Eclipse.
I'm currently using [RapidSVN][1]. Is there anything better?
[1]: http://rapidsvn.tigris.org/
[2]: http://subclipse.tigris.org/
| 4 |
52,108 | 09/09/2008 15:07:38 | 4,140 | 09/02/2008 01:10:54 | 347 | 33 | Does anyone know the shortcut to open a file within your solution |
In visual studio 2008 + Resharper?
Thanks! | visual-studio | resharper | keyboard-shortcuts | null | null | null | open | Does anyone know the shortcut to open a file within your solution
===
In visual studio 2008 + Resharper?
Thanks! | 0 |
52,112 | 09/09/2008 15:09:08 | 456,684 | 08/25/2008 20:11:03 | 1 | 1 | Extracting SVN data with Java | Does anyone know a good Java lib that will hook into SVN so I can extract the data? I want the SVN comments, author, path, etc... Hopefully with this data I can build a better time management tracking system. | java | svn | null | null | null | null | open | Extracting SVN data with Java
===
Does anyone know a good Java lib that will hook into SVN so I can extract the data? I want the SVN comments, author, path, etc... Hopefully with this data I can build a better time management tracking system. | 0 |
52,131 | 09/09/2008 15:16:26 | 2,171 | 08/20/2008 18:04:57 | 80 | 2 | Physical Sectors Used by File on Windows XP | If I write a file to disk on Windows XP, how can I get the physical sector (or sectors) that are used to store the file on disk?
Thanks,
Terry | windows | filesystems | null | null | null | null | open | Physical Sectors Used by File on Windows XP
===
If I write a file to disk on Windows XP, how can I get the physical sector (or sectors) that are used to store the file on disk?
Thanks,
Terry | 0 |
52,134 | 09/09/2008 15:18:14 | 4,002 | 09/01/2008 09:28:22 | 58 | 5 | Determining if an assembly is part of the .net framework | How can I tell from the assemblyName, or Assembly class (or others like it), whether an assembly is part of the .net framework (ie System.windows.Forms)?
So far I've considered the PublicKeyToken, and CodeBase properties, but these are not always the same for the whole framework. | .net | framework | assembly | reflection | null | null | open | Determining if an assembly is part of the .net framework
===
How can I tell from the assemblyName, or Assembly class (or others like it), whether an assembly is part of the .net framework (ie System.windows.Forms)?
So far I've considered the PublicKeyToken, and CodeBase properties, but these are not always the same for the whole framework. | 0 |
52,140 | 09/09/2008 15:20:26 | 2,077 | 08/20/2008 07:26:21 | 305 | 8 | What are the (technical) pros and cons of Flash vs AJAX/JS? | We provide a web application with a frontend completely developed in Adobe Flash. When we chose Flash 6 years ago, we did so for its large number of features for user interaction, like dragging stuff, opening and closing menus, tree navigation elements, popup dialogs etc.
Today it's obvious that AJAX/JS offers roughly the same possibilities and because of the number of frameworks that are readily available, it's very feasible to implement them.
Is there a technical reason one should choose either technology over the other? By "technical", I mean performance, security, portability/compatibility and the like. I don't mean aspects such as the very non-programmer way development is done in Flash or whether it makes sense to switch an app from one to the other.
As I just explained [in another question][1], it seems to me that JS is way ahead in terms of market share and I'm wondering whether we are missing some important point if we stick to Flash.
[1]: http://stackoverflow.com/questions/52094/which-ria-technology-has-the-biggest-market-share | ajax | flash | ria | null | null | null | open | What are the (technical) pros and cons of Flash vs AJAX/JS?
===
We provide a web application with a frontend completely developed in Adobe Flash. When we chose Flash 6 years ago, we did so for its large number of features for user interaction, like dragging stuff, opening and closing menus, tree navigation elements, popup dialogs etc.
Today it's obvious that AJAX/JS offers roughly the same possibilities and because of the number of frameworks that are readily available, it's very feasible to implement them.
Is there a technical reason one should choose either technology over the other? By "technical", I mean performance, security, portability/compatibility and the like. I don't mean aspects such as the very non-programmer way development is done in Flash or whether it makes sense to switch an app from one to the other.
As I just explained [in another question][1], it seems to me that JS is way ahead in terms of market share and I'm wondering whether we are missing some important point if we stick to Flash.
[1]: http://stackoverflow.com/questions/52094/which-ria-technology-has-the-biggest-market-share | 0 |
52,160 | 09/09/2008 15:29:16 | 1,111 | 08/12/2008 12:40:23 | 164 | 20 | VB6 Runtime Type Retrival | How can you obtain the Type (the name as a string is sufficient) of an Object in VB6 at runtime?
i.e. something like:
If Typeof(foobar) = "CommandButton" Then ... | vb6 | runtime | null | null | null | null | open | VB6 Runtime Type Retrival
===
How can you obtain the Type (the name as a string is sufficient) of an Object in VB6 at runtime?
i.e. something like:
If Typeof(foobar) = "CommandButton" Then ... | 0 |
52,165 | 09/09/2008 15:31:25 | 2,577 | 08/23/2008 03:18:09 | 116 | 6 | Is there a free webservice available for song and album information? | I'd like to write a program to clean up my music collection and it would be nice to be able to query a webservice for song and album information.
I'm not really thinking of a cddb/freedb type of situation where you hand them a hash based on the number of songs and the lengths, etc. I'm really thinking more of "hey, for this album from this artist what are the song titles?" - something like that. | web-services | mp3 | null | null | null | null | open | Is there a free webservice available for song and album information?
===
I'd like to write a program to clean up my music collection and it would be nice to be able to query a webservice for song and album information.
I'm not really thinking of a cddb/freedb type of situation where you hand them a hash based on the number of songs and the lengths, etc. I'm really thinking more of "hey, for this album from this artist what are the song titles?" - something like that. | 0 |
52,167 | 09/09/2008 15:32:16 | 3,631 | 08/29/2008 16:06:08 | 1,413 | 63 | BNF grammar test case generation | Does anyone have any experience with a tool that generates test strings from a BNF grammar that could then be fed into a unit test? | parser | unittest | null | null | null | null | open | BNF grammar test case generation
===
Does anyone have any experience with a tool that generates test strings from a BNF grammar that could then be fed into a unit test? | 0 |
52,168 | 09/09/2008 15:32:18 | 2,991 | 08/26/2008 10:42:06 | 1 | 1 | Operating system features | Let's say, in a perfect world where everything is possible. What features would you like to have in your operating system, IDE, Compiler or computer in general.
of course everybody wants reduced boot times and super faaaaaast processors, anything else?
I personally really would like to have human language recognition.
the question may sound a bit silly, but if you don't have a long distance goal you also don't know where to go now. | operating-system | features | future | null | null | 05/05/2012 13:29:31 | not constructive | Operating system features
===
Let's say, in a perfect world where everything is possible. What features would you like to have in your operating system, IDE, Compiler or computer in general.
of course everybody wants reduced boot times and super faaaaaast processors, anything else?
I personally really would like to have human language recognition.
the question may sound a bit silly, but if you don't have a long distance goal you also don't know where to go now. | 4 |
52,172 | 09/09/2008 15:32:44 | 2,171 | 08/20/2008 18:04:57 | 80 | 2 | Unmovable Files on Windows XP | When I defragment my XP machine I notice that there is a block of "Unmovable Files". Is there a file attribute I can use to make my own files unmovable?
Thanks,
Terry | windows | filesystems | null | null | null | null | open | Unmovable Files on Windows XP
===
When I defragment my XP machine I notice that there is a block of "Unmovable Files". Is there a file attribute I can use to make my own files unmovable?
Thanks,
Terry | 0 |
52,176 | 09/09/2008 15:33:58 | 5,413 | 09/09/2008 13:34:06 | 1 | 0 | What are the core mathematical concepts a good developer should know? | Since Graduating from a very small school in 2006 with a badly shaped & outdated program (I'm a foreigner & didnt know any better school at the time) i've come to realize that i missed a lot of basic concepts from a mathematical & software perspective that are mostly the foundations of other higher concepts.
i.e. i tried to listen/watch the open courseware from MIT on [Introduction to Algorithms](http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-046JFall-2005/CourseHome/) but quickly realized i was missing several mathematical concepts to better understand to course.
So what are the core mathematical concepts a good software engineer should know? and what are the possible books/sites you will recommend me? | language-agnostic | algorithm | books | math | null | 01/24/2012 07:58:58 | not constructive | What are the core mathematical concepts a good developer should know?
===
Since Graduating from a very small school in 2006 with a badly shaped & outdated program (I'm a foreigner & didnt know any better school at the time) i've come to realize that i missed a lot of basic concepts from a mathematical & software perspective that are mostly the foundations of other higher concepts.
i.e. i tried to listen/watch the open courseware from MIT on [Introduction to Algorithms](http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-046JFall-2005/CourseHome/) but quickly realized i was missing several mathematical concepts to better understand to course.
So what are the core mathematical concepts a good software engineer should know? and what are the possible books/sites you will recommend me? | 4 |
52,187 | 09/09/2008 15:36:19 | 445,087 | 09/02/2008 17:25:48 | 298 | 7 | Virtual Serial Port for Linux | I need to test a serial port application on Linux, however, my test machine only has one serial port.
**Is there a way to add a virtual serial port to Linux and test my application by emulating a device through a shell or script?**
Note: I cannot remap the port, it hard coded on ttys2 and I need to test the application as it is written. | linux | testing | hardware | serial-port | virtual-serial-port | null | open | Virtual Serial Port for Linux
===
I need to test a serial port application on Linux, however, my test machine only has one serial port.
**Is there a way to add a virtual serial port to Linux and test my application by emulating a device through a shell or script?**
Note: I cannot remap the port, it hard coded on ttys2 and I need to test the application as it is written. | 0 |
52,201 | 09/09/2008 15:40:40 | 4,786 | 09/05/2008 15:29:10 | 67 | 1 | MooTools/Cappuccino/SproutCore/Django/RubyOnRails/Pylons/jQuery/etc...too many..too much..what to do? | Help, too many buzzwords out there.I spend more time reading about them than actually having time to learn and use them...what to do? | framework | web2.0 | null | null | null | null | open | MooTools/Cappuccino/SproutCore/Django/RubyOnRails/Pylons/jQuery/etc...too many..too much..what to do?
===
Help, too many buzzwords out there.I spend more time reading about them than actually having time to learn and use them...what to do? | 0 |
52,213 | 09/09/2008 15:45:19 | 1,000 | 08/11/2008 12:41:19 | 387 | 25 | Browser refresh behaviour | When a user hits Refresh on their browser, it reloads the page but keeps the contents of form fields. While I can see this being a useful default, it can be annoying on some dynamic pages, leading to a broken user experience.
Is there a way, in HTTP headers or equivalents, to change this behaviour? | html | http | refresh | null | null | null | open | Browser refresh behaviour
===
When a user hits Refresh on their browser, it reloads the page but keeps the contents of form fields. While I can see this being a useful default, it can be annoying on some dynamic pages, leading to a broken user experience.
Is there a way, in HTTP headers or equivalents, to change this behaviour? | 0 |
52,234 | 09/09/2008 15:57:38 | 736 | 08/08/2008 13:06:17 | 326 | 20 | Creating a Patch with TFS | Creating a patch is very easy in SubVersion, With Tortoise, you right-click and select Create Patch. But for the life of me, I can't find this functionality in TFS. Is this possible?
If not, what's the standard way to submit patches in open source TFS hosted projects (a la CodePlex)? | open-source | version-control | tfs | patchgeneration | null | null | open | Creating a Patch with TFS
===
Creating a patch is very easy in SubVersion, With Tortoise, you right-click and select Create Patch. But for the life of me, I can't find this functionality in TFS. Is this possible?
If not, what's the standard way to submit patches in open source TFS hosted projects (a la CodePlex)? | 0 |
52,238 | 09/09/2008 15:58:37 | 3,920 | 08/31/2008 21:51:23 | 126 | 9 | How can I highlight a table row using Prototype? | How can I use the Prototype library and create unobtrusive javascript to inject the onmouseover and onmouseout events to each row, rather than putting the javascript in each table row tag?
An answer utilizing the Prototype library (instead of mootools, jQuery, etc) would be most helpful. | javascript | ajax | prototype | null | null | null | open | How can I highlight a table row using Prototype?
===
How can I use the Prototype library and create unobtrusive javascript to inject the onmouseover and onmouseout events to each row, rather than putting the javascript in each table row tag?
An answer utilizing the Prototype library (instead of mootools, jQuery, etc) would be most helpful. | 0 |
52,239 | 09/09/2008 15:58:37 | 673 | 08/07/2008 16:33:05 | 377 | 37 | Oracle lost sysdba password | We are working with an oracle database in which the person that set it up is "long gone" and thus do not know the sysdba password, but need it. We have root access to the box (its on linux). Is there any way to recover or change the sys passwords? | linux | oracle | passwords | null | null | null | open | Oracle lost sysdba password
===
We are working with an oracle database in which the person that set it up is "long gone" and thus do not know the sysdba password, but need it. We have root access to the box (its on linux). Is there any way to recover or change the sys passwords? | 0 |
52,248 | 09/09/2008 16:06:49 | 3,880 | 08/31/2008 15:48:19 | 309 | 15 | What's a good open-source ASP.NET ecommerce solution? | Does anyone have experience with a good, open-source ecommerce solution for ASP.NET? I know there are a ton out there for PHP and other languages, but I'd like to find one written in .NET (C# preferably).
I tried [dashCommerce][1] a few months ago and I found it to be very buggy. Maybe it's matured since then, but I would hesitate to try it again without a firm recommendation.
[1]: http://dashcommerce.org/ | asp.net | e-commerce | null | null | null | null | open | What's a good open-source ASP.NET ecommerce solution?
===
Does anyone have experience with a good, open-source ecommerce solution for ASP.NET? I know there are a ton out there for PHP and other languages, but I'd like to find one written in .NET (C# preferably).
I tried [dashCommerce][1] a few months ago and I found it to be very buggy. Maybe it's matured since then, but I would hesitate to try it again without a firm recommendation.
[1]: http://dashcommerce.org/ | 0 |
52,256 | 09/09/2008 16:09:23 | 95 | 08/01/2008 18:28:24 | 383 | 30 | How to check if a given user is a member of the built-in Administrators group? | I need to check programmatically (in .NET) whether a given user (domain account) is a member of the built-in Administrators group on a current computer (the one where the application gets executed).
Is it possible? | security | null | null | null | null | null | open | How to check if a given user is a member of the built-in Administrators group?
===
I need to check programmatically (in .NET) whether a given user (domain account) is a member of the built-in Administrators group on a current computer (the one where the application gets executed).
Is it possible? | 0 |
52,286 | 09/09/2008 16:27:56 | 5,330 | 09/09/2008 07:44:06 | 68 | 4 | iTunes warning message on quit due to scripting | Wrote the following in PowersHell as a quick iTunes demonstration:
$iTunes = New-Object -ComObject iTunes.Application
$LibrarySource = $iTunes.LibrarySource
foreach ($PList in $LibrarySource.Playlists)
{
write-host $PList.name
}
This works well and pulls back a list of playlist names.
However on trying to close iTunes a warning appears
> **One or more applications are using the iTunes scripting interface. Are you sure you want to quit?**
Obviously I can just ignore the message and press [Quit] or just wait the 20 seconds or so, but is there a clean way to tell iTunes that I've finished working with it? | itunes | powershell | null | null | null | null | open | iTunes warning message on quit due to scripting
===
Wrote the following in PowersHell as a quick iTunes demonstration:
$iTunes = New-Object -ComObject iTunes.Application
$LibrarySource = $iTunes.LibrarySource
foreach ($PList in $LibrarySource.Playlists)
{
write-host $PList.name
}
This works well and pulls back a list of playlist names.
However on trying to close iTunes a warning appears
> **One or more applications are using the iTunes scripting interface. Are you sure you want to quit?**
Obviously I can just ignore the message and press [Quit] or just wait the 20 seconds or so, but is there a clean way to tell iTunes that I've finished working with it? | 0 |
52,290 | 09/09/2008 16:28:27 | 4,144 | 09/02/2008 02:27:42 | 51 | 5 | Templates of Technical and Functional Specs | So basically I am looking for good templates for writing both technical and functional specs on a project or work request.
What do you guys use? How in depth do you get while writing the specs? Any additional general tips you could provide would be appreciated.
My company needs these badly. I work for a contractor and right now we do not use these documents at all. | specifications | specs | functional | technical | null | null | open | Templates of Technical and Functional Specs
===
So basically I am looking for good templates for writing both technical and functional specs on a project or work request.
What do you guys use? How in depth do you get while writing the specs? Any additional general tips you could provide would be appreciated.
My company needs these badly. I work for a contractor and right now we do not use these documents at all. | 0 |
52,311 | 09/09/2008 16:35:15 | 3,381 | 08/28/2008 11:39:48 | 672 | 66 | Determine size of page via HttpModule | Here's an easy one for you:
I'm currently logging request duration via an HttpModule and I'd like to find out the number of bytes each page is as well.
HttpContext.Current.Response.OutputStream.Length throws a NotSupportedException.
What's an easy way to do this? | asp.net | null | null | null | null | null | open | Determine size of page via HttpModule
===
Here's an easy one for you:
I'm currently logging request duration via an HttpModule and I'd like to find out the number of bytes each page is as well.
HttpContext.Current.Response.OutputStream.Length throws a NotSupportedException.
What's an easy way to do this? | 0 |
52,312 | 09/09/2008 16:36:09 | 4,541 | 09/04/2008 17:37:04 | 122 | 3 | What is the real overhead of try/catch in C#? | So, I know that try/catch does add some overhead and therefore isn't a good way of controlling process flow, but where does this overhead come from and what is it's actual impact? | c# | null | null | null | null | null | open | What is the real overhead of try/catch in C#?
===
So, I know that try/catch does add some overhead and therefore isn't a good way of controlling process flow, but where does this overhead come from and what is it's actual impact? | 0 |
52,313 | 09/09/2008 16:36:18 | 4,144 | 09/02/2008 02:27:42 | 61 | 5 | C# switch limitations | This question is kind of an add-on to this [question][1]
[1]: http://stackoverflow.com/questions/44905/c-switch-statement-limitations-why
In C#, a switch case cannot fall through to other cases, this causes a compilation error. In this case I am just adding some number to the month total for the selected month and each subsequent month thereafter. (simple example, not meant to be real)
switch (month)
{
case 0:
add something to month totals
case 1:
add something to month totals
case 2:
add something to month totals
default:
break;
}
Is there a logical alternative to this in C# without having to right out a ton of if statements?
if (month <= 0)
add something to month
if (month <= 1)
add something to month
if (month <= 2)
add something to month
.... etc
| c# | switch-statement | null | null | null | null | open | C# switch limitations
===
This question is kind of an add-on to this [question][1]
[1]: http://stackoverflow.com/questions/44905/c-switch-statement-limitations-why
In C#, a switch case cannot fall through to other cases, this causes a compilation error. In this case I am just adding some number to the month total for the selected month and each subsequent month thereafter. (simple example, not meant to be real)
switch (month)
{
case 0:
add something to month totals
case 1:
add something to month totals
case 2:
add something to month totals
default:
break;
}
Is there a logical alternative to this in C# without having to right out a ton of if statements?
if (month <= 0)
add something to month
if (month <= 1)
add something to month
if (month <= 2)
add something to month
.... etc
| 0 |
52,315 | 09/09/2008 16:39:17 | 5,202 | 09/08/2008 13:07:01 | 1 | 5 | T-SQL trim   (and other non-alphanumeric characters) | We have some input data that sometimes appears with   characters on the end.
The data comes in from the source system as varchar() and our attempts to cast as decimal fail b/c of these characters.
Ltrim and Rtrim don't remove the characters, so we're forced to do something like:
UPDATE myTable
SET myColumn = replace(myColumn,char(160),'')
WHERE charindex(char(160),myColumn) > 0
This works for the  , but is there a good way to do this for any non-alphanumeric (or in this case numeric) characters? | sql | sql-server | null | null | null | null | open | T-SQL trim   (and other non-alphanumeric characters)
===
We have some input data that sometimes appears with   characters on the end.
The data comes in from the source system as varchar() and our attempts to cast as decimal fail b/c of these characters.
Ltrim and Rtrim don't remove the characters, so we're forced to do something like:
UPDATE myTable
SET myColumn = replace(myColumn,char(160),'')
WHERE charindex(char(160),myColumn) > 0
This works for the  , but is there a good way to do this for any non-alphanumeric (or in this case numeric) characters? | 0 |
52,319 | 09/09/2008 16:40:16 | 2,684 | 08/24/2008 14:38:27 | 343 | 48 | Tablet PC SDK (1.7) Merge Module + VS2008 + Windows Vista? | I have a VS2005 deployment & setup project, that makes use of the Tablet PC SDK 1.7 Merge Module, so users of Windows XP can make use of the managed Microsoft.Ink.DLL library. Now that we've moved over to Vista/VS2008, do I still need to install the TPC SDK (to get the merge module) or can I make use of something that Vista has?
Google seems plagued with vague references. If I add the merge module for SDK 1.7, how will this affect current Vista users (which will have the Tablet PC capabilities built-in)?
Thanks in advance.
| visual-studio | windows-vista | windows-xp | sdk | tablet-pc | null | open | Tablet PC SDK (1.7) Merge Module + VS2008 + Windows Vista?
===
I have a VS2005 deployment & setup project, that makes use of the Tablet PC SDK 1.7 Merge Module, so users of Windows XP can make use of the managed Microsoft.Ink.DLL library. Now that we've moved over to Vista/VS2008, do I still need to install the TPC SDK (to get the merge module) or can I make use of something that Vista has?
Google seems plagued with vague references. If I add the merge module for SDK 1.7, how will this affect current Vista users (which will have the Tablet PC capabilities built-in)?
Thanks in advance.
| 0 |
52,321 | 09/09/2008 16:41:00 | 4,827 | 09/05/2008 19:46:57 | 1 | 0 | Updating Legacy Code from System.Web.Mail to System.Net.Mail in Visual Studio 2005: Problems sending E-Mail | Using the obsolete System.Web.Mail sending email works fine, here's the code snippet:
Public Shared Sub send(ByVal recipent As String, ByVal from As String, ByVal subject As String, ByVal body As String)
Try
Dim Message As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage
Message.To = recipent
Message.From = from
Message.Subject = subject
Message.Body = body
Message.BodyFormat = MailFormat.Html
Try
SmtpMail.SmtpServer = MAIL_SERVER
SmtpMail.Send(Message)
Catch ehttp As System.Web.HttpException
critical_error("Email sending failed, reason: " + ehttp.ToString)
End Try
Catch e As System.Exception
critical_error(e, "send() in Util_Email")
End Try
End Sub
and here's the updated version:
Dim mailMessage As New System.Net.Mail.MailMessage()
mailMessage.From = New System.Net.Mail.MailAddress(from)
mailMessage.To.Add(New System.Net.Mail.MailAddress(recipent))
mailMessage.Subject = subject
mailMessage.Body = body
mailMessage.IsBodyHtml = True
mailMessage.Priority = System.Net.Mail.MailPriority.Normal
Try
Dim smtp As New Net.Mail.SmtpClient(MAIL_SERVER)
smtp.Send(mailMessage)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
I have tried many different variations and nothing seems to work, I have a feeling it may have to do with the SmtpClient, is there something that changed in the underlying code between these versions?
There are no exceptions that are thrown back. | .net | email | visual-studio-2005 | null | null | null | open | Updating Legacy Code from System.Web.Mail to System.Net.Mail in Visual Studio 2005: Problems sending E-Mail
===
Using the obsolete System.Web.Mail sending email works fine, here's the code snippet:
Public Shared Sub send(ByVal recipent As String, ByVal from As String, ByVal subject As String, ByVal body As String)
Try
Dim Message As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage
Message.To = recipent
Message.From = from
Message.Subject = subject
Message.Body = body
Message.BodyFormat = MailFormat.Html
Try
SmtpMail.SmtpServer = MAIL_SERVER
SmtpMail.Send(Message)
Catch ehttp As System.Web.HttpException
critical_error("Email sending failed, reason: " + ehttp.ToString)
End Try
Catch e As System.Exception
critical_error(e, "send() in Util_Email")
End Try
End Sub
and here's the updated version:
Dim mailMessage As New System.Net.Mail.MailMessage()
mailMessage.From = New System.Net.Mail.MailAddress(from)
mailMessage.To.Add(New System.Net.Mail.MailAddress(recipent))
mailMessage.Subject = subject
mailMessage.Body = body
mailMessage.IsBodyHtml = True
mailMessage.Priority = System.Net.Mail.MailPriority.Normal
Try
Dim smtp As New Net.Mail.SmtpClient(MAIL_SERVER)
smtp.Send(mailMessage)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
I have tried many different variations and nothing seems to work, I have a feeling it may have to do with the SmtpClient, is there something that changed in the underlying code between these versions?
There are no exceptions that are thrown back. | 0 |
52,326 | 09/09/2008 16:45:06 | 5,182 | 09/08/2008 11:20:40 | 119 | 8 | How to validate an XML file against a schema using Visual Studio 2005 | Is it possible to validate an xml file against it's associated schema using Visual Studio 2005?
I could only see options to create a schema based on the current file, or show the XSLT output
![alt text][1]
[1]: http://farm4.static.flickr.com/3043/2843566028_28b36c943e_o.png
| visual-studio | xml | xslt | visual-studio-2005 | null | null | open | How to validate an XML file against a schema using Visual Studio 2005
===
Is it possible to validate an xml file against it's associated schema using Visual Studio 2005?
I could only see options to create a schema based on the current file, or show the XSLT output
![alt text][1]
[1]: http://farm4.static.flickr.com/3043/2843566028_28b36c943e_o.png
| 0 |
52,343 | 09/09/2008 17:00:43 | 1,650 | 08/17/2008 19:07:22 | 26 | 3 | What is causing a JVMTI_ERROR_NULL_POINTER? | I'm getting an error when my application starts. It appears to be after it's initialized its connection to the database. It also may be when it starts to spawn threads, but I haven't been able to cause it to happen on purpose.
The entire error message is:
FATAL ERROR in native method: JDWP NewGlobalRef, jvmtiError=JVMTI_ERROR_NULL_POINTER(100)
JDWP exit error JVMTI_ERROR_NULL_POINTER(100): NewGlobalRef | java | jvm | null | null | null | null | open | What is causing a JVMTI_ERROR_NULL_POINTER?
===
I'm getting an error when my application starts. It appears to be after it's initialized its connection to the database. It also may be when it starts to spawn threads, but I haven't been able to cause it to happen on purpose.
The entire error message is:
FATAL ERROR in native method: JDWP NewGlobalRef, jvmtiError=JVMTI_ERROR_NULL_POINTER(100)
JDWP exit error JVMTI_ERROR_NULL_POINTER(100): NewGlobalRef | 0 |
52,344 | 09/09/2008 17:01:00 | 4,906 | 09/06/2008 14:21:25 | 62 | 3 | How to detect (using .ASPX) if Javasript is enabled on browser | I'm thinking this might be a quick and easy way to lower the form spam on our site just a little bit. The idea being that (I have read) spammers aren't running with javascript enabled. (Or at least they are accessing your website without running javascript. I.e., they aren't browsing up to it in IE or FF.
I can use .asp or .aspx.
| asp.net | spam | null | null | null | null | open | How to detect (using .ASPX) if Javasript is enabled on browser
===
I'm thinking this might be a quick and easy way to lower the form spam on our site just a little bit. The idea being that (I have read) spammers aren't running with javascript enabled. (Or at least they are accessing your website without running javascript. I.e., they aren't browsing up to it in IE or FF.
I can use .asp or .aspx.
| 0 |
52,353 | 09/09/2008 17:07:03 | 5,074 | 09/07/2008 17:50:27 | 28 | 2 | In Java, what is the best way to determine the size of an object? | For example, let's say I have an application that can read in a CSV file with piles of data rows. I give the user a summary of the number of rows based on types of data, but I want to make sure that I don't read in too many rows of data and cause OutOfMemory Exceptions. Each row translates into an object. Is there an easy way to find out the size of that object programmatically or do I have to do that by hand? | java | memory | null | null | null | null | open | In Java, what is the best way to determine the size of an object?
===
For example, let's say I have an application that can read in a CSV file with piles of data rows. I give the user a summary of the number of rows based on types of data, but I want to make sure that I don't read in too many rows of data and cause OutOfMemory Exceptions. Each row translates into an object. Is there an easy way to find out the size of that object programmatically or do I have to do that by hand? | 0 |
52,356 | 09/09/2008 17:08:44 | 5,433 | 09/09/2008 15:02:32 | 1 | 1 | SQL 2005 copy single column between databases | I'm still fairly new to T-SQL and SQL 2005. I need to import a column of integers from a table in database1 to a identical table (only missing the column I need) in database2. Both are sql 2005 databases. I've tried the built in import command in Server Management Studio but it's forcing me to copy the entire table. This causes errors due to constraints and 'read-only' columns (whatever 'read-only' means in sql2005). I just want to grab a single column and copy it to a table. There must be a simple way of doing this.
Something like:
INSERT INTO database1.myTable columnINeed
SELECT columnINeed from database2.myTable | mssql | copy | row | transact | null | null | open | SQL 2005 copy single column between databases
===
I'm still fairly new to T-SQL and SQL 2005. I need to import a column of integers from a table in database1 to a identical table (only missing the column I need) in database2. Both are sql 2005 databases. I've tried the built in import command in Server Management Studio but it's forcing me to copy the entire table. This causes errors due to constraints and 'read-only' columns (whatever 'read-only' means in sql2005). I just want to grab a single column and copy it to a table. There must be a simple way of doing this.
Something like:
INSERT INTO database1.myTable columnINeed
SELECT columnINeed from database2.myTable | 0 |
52,357 | 09/09/2008 17:08:47 | 4,662 | 09/05/2008 02:39:27 | 1 | 1 | What is the point of clog? | I've been wondering, what is the point of clog? As near as I can tell, clog is the same as cerr but with buffering so it is more efficient. Usually stderr is the same as stdout, so clog is the same as cout. This seems pretty lame to me, so I figure I must be misunderstanding it. If I have log messages going out to the same place I have error messages going out to (perhaps something in /var/log/messages), then I probably am not writing too much out (so there isn't much lost by using non-buffered cerr). In my experience, I want my log messages up to date (not buffered) so I can help find a crash (so I don't want to be using the buffered clog). Apparently I should always be using cerr.
I'd like to be able to redirect clog inside my program. It would be useful to redirect cerr so that when I call a library routine I can control where cerr and clog go to. Can some compilers support this? I just checked DJGPP and stdout is defined as the address of a FILE struct, so it is illegal to do something like "stdout = freopen(...)".
- Is it possible to redirect clog, cerr, cout, stdin, stdout, and/or stderr?
- Is the only difference between clog and cerr the buffering?
- How should I implement (or find) a more robust logging facility (links please)? | c++ | null | null | null | null | null | open | What is the point of clog?
===
I've been wondering, what is the point of clog? As near as I can tell, clog is the same as cerr but with buffering so it is more efficient. Usually stderr is the same as stdout, so clog is the same as cout. This seems pretty lame to me, so I figure I must be misunderstanding it. If I have log messages going out to the same place I have error messages going out to (perhaps something in /var/log/messages), then I probably am not writing too much out (so there isn't much lost by using non-buffered cerr). In my experience, I want my log messages up to date (not buffered) so I can help find a crash (so I don't want to be using the buffered clog). Apparently I should always be using cerr.
I'd like to be able to redirect clog inside my program. It would be useful to redirect cerr so that when I call a library routine I can control where cerr and clog go to. Can some compilers support this? I just checked DJGPP and stdout is defined as the address of a FILE struct, so it is illegal to do something like "stdout = freopen(...)".
- Is it possible to redirect clog, cerr, cout, stdin, stdout, and/or stderr?
- Is the only difference between clog and cerr the buffering?
- How should I implement (or find) a more robust logging facility (links please)? | 0 |
52,359 | 09/09/2008 17:09:17 | 4,906 | 09/06/2008 14:21:25 | 64 | 3 | Simple & basic form spam reduction: checking for Javascript? | I'm trying to reduce the form spam on our website. (It's actually pretty recent).
I seem to remember reading somewhere that the spammers aren't executing the Javascript on the site.
Is that true?
And if so, then could you simply check for javascript being disabled and then figure it's *likely* that it's spam?
| spam | null | null | null | null | null | open | Simple & basic form spam reduction: checking for Javascript?
===
I'm trying to reduce the form spam on our website. (It's actually pretty recent).
I seem to remember reading somewhere that the spammers aren't executing the Javascript on the site.
Is that true?
And if so, then could you simply check for javascript being disabled and then figure it's *likely* that it's spam?
| 0 |
52,360 | 09/09/2008 17:10:12 | 2,141 | 08/20/2008 14:38:34 | 388 | 5 | .NET version | What are the different ways (programatically & otherwise) to determine what versions of .NET are running on a system? | .net | null | null | null | null | null | open | .NET version
===
What are the different ways (programatically & otherwise) to determine what versions of .NET are running on a system? | 0 |
52,398 | 09/09/2008 17:21:46 | 122 | 08/02/2008 07:56:07 | 4,089 | 187 | Ignore SVN ignore... possible? | So I have some files I want to ignore in a subversion repository, but I don't want my ignore patterns for this to be propagated to the repository.
In other words, I added some private files in my checkout that I want to keep, but they only exist for me and wouldn't make sense to be ignored for everyone, so if I use the svn:ignore, this will apply on the directory, and I either have to check that in (which I don't want to do), or see that this directory was modified every time I do an svn status.
So, ideally I would like something like a .svnignore file which I could then mark to ignore itself as well as some other files (I think this is a possibility in git for example, using a .gitignore file, or whatever the name is).
I'm guessing it might work to ignore the whole directory (maybe), but then I suspect I won't see any new files in that directory, which would also not be desirable.
So does anybody know a way to do this in subversion? | svn | ignore | null | null | null | null | open | Ignore SVN ignore... possible?
===
So I have some files I want to ignore in a subversion repository, but I don't want my ignore patterns for this to be propagated to the repository.
In other words, I added some private files in my checkout that I want to keep, but they only exist for me and wouldn't make sense to be ignored for everyone, so if I use the svn:ignore, this will apply on the directory, and I either have to check that in (which I don't want to do), or see that this directory was modified every time I do an svn status.
So, ideally I would like something like a .svnignore file which I could then mark to ignore itself as well as some other files (I think this is a possibility in git for example, using a .gitignore file, or whatever the name is).
I'm guessing it might work to ignore the whole directory (maybe), but then I suspect I won't see any new files in that directory, which would also not be desirable.
So does anybody know a way to do this in subversion? | 0 |
52,400 | 09/09/2008 17:22:31 | 2,820 | 08/25/2008 11:37:16 | 211 | 16 | Patterns for the overlap of two objects | I'm sure this has already been asked and answered so I apologize in advance for that but I'm not figuring out the correct keywords to search for. Searching for "Pattern" hits way too many Q & A's to be useful.
I'm working on a regression testing app. I'm displaying a form on the screen and according to which user is logged in to the app some of the fields should be read-only. So I can abstract a field object and I can abstract a user object but what pattern should I be looking at to describe the intersection of these two concepts? In other words how should I describe that for Field 1 and User A, the field should be read-only? It seems like read-only (or not) should be a property of the Field class but as I said, it depends on which user is looking at the form. I've considered a simple two-dimensional array (e. g. ReadOnly[Field,User] = True) but I want to make sure I've picked the most effective structure to represent this.
Are there any software design patterns regarding this kind of data structure? Am I overcomplicating things--would a two-dimensional array be the best way to go here? As I said if this has been asked and answered, I do apologize. I did search here and didn't find anything and a Google search failed to turn up anything either. | pattern | intersection | object | null | null | null | open | Patterns for the overlap of two objects
===
I'm sure this has already been asked and answered so I apologize in advance for that but I'm not figuring out the correct keywords to search for. Searching for "Pattern" hits way too many Q & A's to be useful.
I'm working on a regression testing app. I'm displaying a form on the screen and according to which user is logged in to the app some of the fields should be read-only. So I can abstract a field object and I can abstract a user object but what pattern should I be looking at to describe the intersection of these two concepts? In other words how should I describe that for Field 1 and User A, the field should be read-only? It seems like read-only (or not) should be a property of the Field class but as I said, it depends on which user is looking at the form. I've considered a simple two-dimensional array (e. g. ReadOnly[Field,User] = True) but I want to make sure I've picked the most effective structure to represent this.
Are there any software design patterns regarding this kind of data structure? Am I overcomplicating things--would a two-dimensional array be the best way to go here? As I said if this has been asked and answered, I do apologize. I did search here and didn't find anything and a Google search failed to turn up anything either. | 0 |
52,430 | 09/09/2008 17:33:28 | 5,201 | 09/08/2008 12:48:50 | 11 | 4 | SQL Server best way to calculate datediff between current row and next row? | I've got the following rough structure:
Object -> Object Revisions -> Data
The Data can be shared between several Objects.
What I'm trying to do is clean out old Object Revisions. I want to keep the first, active, and a spread of revisions so that the last change for a time period is kept. The Data might be changed a lot over the course of 2 days then left alone for months, so I want to keep the last revision before the changes started and the end change of the new set.
I'm currently using a cursor and temp table to hold the IDs and date between changes so I can select out the low hanging fruit to get rid of. This means using @LastID, @LastDate, updates and inserts to the temp table, etc...
Is there an easier/better way to calculate the date difference between the current row and the next row in my initial result set without using a cursor and temp table?
I'm on sql server 2000, but would be interested in any new features of 2005, 2008 that could help with this as well. | sql-server | datediff | null | null | null | null | open | SQL Server best way to calculate datediff between current row and next row?
===
I've got the following rough structure:
Object -> Object Revisions -> Data
The Data can be shared between several Objects.
What I'm trying to do is clean out old Object Revisions. I want to keep the first, active, and a spread of revisions so that the last change for a time period is kept. The Data might be changed a lot over the course of 2 days then left alone for months, so I want to keep the last revision before the changes started and the end change of the new set.
I'm currently using a cursor and temp table to hold the IDs and date between changes so I can select out the low hanging fruit to get rid of. This means using @LastID, @LastDate, updates and inserts to the temp table, etc...
Is there an easier/better way to calculate the date difference between the current row and the next row in my initial result set without using a cursor and temp table?
I'm on sql server 2000, but would be interested in any new features of 2005, 2008 that could help with this as well. | 0 |
52,431 | 09/09/2008 17:33:45 | 44,972 | 09/02/2008 10:00:56 | -7 | 0 | How do I draw text using OpenGL, SDL and C++? | I heard about SDL_TFF which I read about [here][1] but I don't understand how am I supposed to connect the TrueType2 library.
Maybe there is something better out there?
[1]: http://www.gamedev.net/reference/articles/article1953.asp | c++ | opengl | sdl | null | null | null | open | How do I draw text using OpenGL, SDL and C++?
===
I heard about SDL_TFF which I read about [here][1] but I don't understand how am I supposed to connect the TrueType2 library.
Maybe there is something better out there?
[1]: http://www.gamedev.net/reference/articles/article1953.asp | 0 |
52,438 | 09/09/2008 17:39:15 | 1,220 | 08/13/2008 13:44:48 | 1,445 | 110 | Literal hashes in c#? | I've been doing c# for a long time, and have never come across an easy way to just new up a hash.
I've recently become acquainted with the ruby syntax of hashes and wonder, does anyone know of a simple way to declare a hash as a literal, without doing all the add calls.
{ "whatever" => {i => 1}; "and then something else" => {j => 2}}; | ruby | hashtable | c# | literal | null | null | open | Literal hashes in c#?
===
I've been doing c# for a long time, and have never come across an easy way to just new up a hash.
I've recently become acquainted with the ruby syntax of hashes and wonder, does anyone know of a simple way to declare a hash as a literal, without doing all the add calls.
{ "whatever" => {i => 1}; "and then something else" => {j => 2}}; | 0 |
52,445 | 09/09/2008 17:44:26 | 572 | 08/06/2008 20:56:54 | 3,253 | 258 | Are there C library resources similar to C++'s Boost library? | I don't ever recall coming across anything for C that's as extensive as C++'s Boost library. | c | null | null | null | null | null | open | Are there C library resources similar to C++'s Boost library?
===
I don't ever recall coming across anything for C that's as extensive as C++'s Boost library. | 0 |
52,449 | 09/09/2008 17:46:33 | 4,140 | 09/02/2008 01:10:54 | 364 | 35 | IQuery NHibernate - does it HAVE to be a list? | Can I return it as an object if I'm doing a Select OneItem from Table Where OtherItem = "blah"?
Is there a better way to do this?
I'm building a constructor to return an object based on its name rather than its ID | c# | .net | nhibernate | null | null | null | open | IQuery NHibernate - does it HAVE to be a list?
===
Can I return it as an object if I'm doing a Select OneItem from Table Where OtherItem = "blah"?
Is there a better way to do this?
I'm building a constructor to return an object based on its name rather than its ID | 0 |
52,460 | 09/09/2008 17:51:36 | 829 | 08/09/2008 06:18:18 | 43 | 3 | How do I find and decouple entities from a certificate when upgrading MS-SQLServer editions? | While in the final throws of upgrading MS-SQL Server 2005 Express Edition to MS-SQL Server 2005 Enterprise Edition, I came across this error:
>The certificate cannot be dropped because one or more entities are either signed or encrypted using it. To continue, correct the problem...
So, **how do I find and decouple the entities signed/encrypted using this certificate so I can delete the certificate and proceed with the upgrade?**
I'm also kind of expecting/assuming that the upgrade setup will provide a new certificate and re-couple those former entities with it or I'll have to forcibly do so after the setup. | sql-server | upgrading | null | null | null | null | open | How do I find and decouple entities from a certificate when upgrading MS-SQLServer editions?
===
While in the final throws of upgrading MS-SQL Server 2005 Express Edition to MS-SQL Server 2005 Enterprise Edition, I came across this error:
>The certificate cannot be dropped because one or more entities are either signed or encrypted using it. To continue, correct the problem...
So, **how do I find and decouple the entities signed/encrypted using this certificate so I can delete the certificate and proceed with the upgrade?**
I'm also kind of expecting/assuming that the upgrade setup will provide a new certificate and re-couple those former entities with it or I'll have to forcibly do so after the setup. | 0 |
52,469 | 09/09/2008 17:55:39 | 4,636 | 09/04/2008 22:44:17 | 61 | 5 | Visual Web Developer Express and .NET, et al. | I'm coming from the open source world, and interested in giving ASP.NET a spin. But I'm having a little trouble separating the tools from the platform itself in regards to the licensing. I've downloaded Visual Web Developer 2008 Express, but not sure how different this is from one of the full-featured Visual Studio licenses -- and whether or not my Express license will prevent me from using all the features of ASP.NET.
Is a Visual Studio license just an IDE, or does it include pieces of .NET not available to the Express license? What about the other tools like IIS and SQL Server?
Thanks. | asp.net | visual-studio | licensing | null | null | null | open | Visual Web Developer Express and .NET, et al.
===
I'm coming from the open source world, and interested in giving ASP.NET a spin. But I'm having a little trouble separating the tools from the platform itself in regards to the licensing. I've downloaded Visual Web Developer 2008 Express, but not sure how different this is from one of the full-featured Visual Studio licenses -- and whether or not my Express license will prevent me from using all the features of ASP.NET.
Is a Visual Studio license just an IDE, or does it include pieces of .NET not available to the Express license? What about the other tools like IIS and SQL Server?
Thanks. | 0 |
52,485 | 09/09/2008 18:04:24 | 366 | 08/05/2008 06:49:49 | 142 | 4 | ASP.NET ObjectDataSource Binding Automatically to Repeater - Possible? | I have a Question class:
class Question {
public int QuestionNumber { get; set; }
public string Question { get; set; }
public string Answer { get; set; }
}
Now I make an ICollection of these available through an ObjectDataSource, and display them using a Repeater bound to the DataSource. I use **<%#Eval("Question")%>** to display the Question, and I use a TextBox and **<%#Bind("Answer")%>** to accept an answer.
If my ObjectDataSource returns three Question objects, then my Repeater displays the three questions with a TextBox following each question for the user to provide an answer.
So far it works great.
Now I want to take the user's response and put it back into the relevant Question classes, which I will then persist.
Surely the framework should take care of all of this for me? I've used the Bind method, I've specified a DataSourceID, I've specified an Update method in my ObjectDataSource class, but there seems no way to actually kickstart the whole thing.
I tried adding a Command button and in the code behind calling MyDataSource.Update(), but it attempts to call my Update method with no parameters, rather than the Question parameter it expects.
Surely there's an easy way to achieve all of this with little or no codebehind?
It seems like all the bits are there, but there's some glue missing to stick them all together.
Help!
Anthony | asp.net | repeater | bind | objectdatasource | null | null | open | ASP.NET ObjectDataSource Binding Automatically to Repeater - Possible?
===
I have a Question class:
class Question {
public int QuestionNumber { get; set; }
public string Question { get; set; }
public string Answer { get; set; }
}
Now I make an ICollection of these available through an ObjectDataSource, and display them using a Repeater bound to the DataSource. I use **<%#Eval("Question")%>** to display the Question, and I use a TextBox and **<%#Bind("Answer")%>** to accept an answer.
If my ObjectDataSource returns three Question objects, then my Repeater displays the three questions with a TextBox following each question for the user to provide an answer.
So far it works great.
Now I want to take the user's response and put it back into the relevant Question classes, which I will then persist.
Surely the framework should take care of all of this for me? I've used the Bind method, I've specified a DataSourceID, I've specified an Update method in my ObjectDataSource class, but there seems no way to actually kickstart the whole thing.
I tried adding a Command button and in the code behind calling MyDataSource.Update(), but it attempts to call my Update method with no parameters, rather than the Question parameter it expects.
Surely there's an easy way to achieve all of this with little or no codebehind?
It seems like all the bits are there, but there's some glue missing to stick them all together.
Help!
Anthony | 0 |
52,492 | 09/09/2008 18:08:44 | 4,872 | 09/06/2008 09:14:55 | 63 | 2 | What is the best way to avoid getting "Emacs Pinky"? | I just started using GNU Emacs as my text editor and I am concerned about getting afflicted with "[Emacs Pinky][1]" by having to constantly press the control key with my pinky finger as is required when using Emacs. How can I avoid potentially getting this type of repetitive strain injury?
[1]: http://en.wikipedia.org/wiki/GNU_Emacs#Emacs_Pinky | emacs | keyboard | null | null | null | null | open | What is the best way to avoid getting "Emacs Pinky"?
===
I just started using GNU Emacs as my text editor and I am concerned about getting afflicted with "[Emacs Pinky][1]" by having to constantly press the control key with my pinky finger as is required when using Emacs. How can I avoid potentially getting this type of repetitive strain injury?
[1]: http://en.wikipedia.org/wiki/GNU_Emacs#Emacs_Pinky | 0 |
52,506 | 09/09/2008 18:13:55 | 4,798 | 09/05/2008 16:50:46 | 417 | 39 | C++ Template Ambiguity | A friend and I were discussing C++ templates. He asked me what this should do:
#include <iostream>
template <bool>
struct A {
A(bool) { std::cout << "bool\n"; }
A(void*) { std::cout << "void*\n"; }
};
int main() {
A<true> *d = 0;
const int b = 2;
const int c = 1;
new A< b > (c) > (d);
}
The last line in main has two reasonable parses. Is 'b' the template argument or is "b > (c)" the template argument?
Although, it is trivial to compile this, and see what we get, we were wondering what resolves the ambiguity? | c++ | template | null | null | null | null | open | C++ Template Ambiguity
===
A friend and I were discussing C++ templates. He asked me what this should do:
#include <iostream>
template <bool>
struct A {
A(bool) { std::cout << "bool\n"; }
A(void*) { std::cout << "void*\n"; }
};
int main() {
A<true> *d = 0;
const int b = 2;
const int c = 1;
new A< b > (c) > (d);
}
The last line in main has two reasonable parses. Is 'b' the template argument or is "b > (c)" the template argument?
Although, it is trivial to compile this, and see what we get, we were wondering what resolves the ambiguity? | 0 |
52,520 | 09/09/2008 18:21:12 | 572 | 08/06/2008 20:56:54 | 3,283 | 261 | Is off-the-cloud desktop applications dead? | Although somewhat related to [this question][1], I have what I think is a different take on it.
Is a desktop app that has no connections to the "cloud" dead? I believe that some things are going to continue to be on the machine (operating systems obviously, browsers, some light-weight applications), but more and more things are moving to network-based applications (see Google Docs for office suites, GMail and other web-email clients for email, flickr for photo management, and more).
So other than the lightweight applications, is there anything that, in 5 to 10 years, will continue to be (either out of necessity or just demand) remain on the desktop and off the cloud?
[1]: http://stackoverflow.com/questions/4409/is-the-desktop-app-dead | desktop-applications | cloud | null | null | null | null | open | Is off-the-cloud desktop applications dead?
===
Although somewhat related to [this question][1], I have what I think is a different take on it.
Is a desktop app that has no connections to the "cloud" dead? I believe that some things are going to continue to be on the machine (operating systems obviously, browsers, some light-weight applications), but more and more things are moving to network-based applications (see Google Docs for office suites, GMail and other web-email clients for email, flickr for photo management, and more).
So other than the lightweight applications, is there anything that, in 5 to 10 years, will continue to be (either out of necessity or just demand) remain on the desktop and off the cloud?
[1]: http://stackoverflow.com/questions/4409/is-the-desktop-app-dead | 0 |
52,550 | 09/09/2008 18:34:09 | 2,064 | 08/20/2008 03:39:44 | 72 | 0 | What does the ',' operator do in C? | What does the ',' operator do in C? | c | operator | null | null | null | null | open | What does the ',' operator do in C?
===
What does the ',' operator do in C? | 0 |
52,557 | 09/09/2008 18:36:49 | 1,277,510 | 09/07/2008 10:45:49 | 21 | 1 | profile-guided optimization (C) | Anyone know how to use the most of the compilers? It seems GCC support that. What is the real gain? In which case it's good? Inner loops? | c++ | c | optimization | compiler | gcc | null | open | profile-guided optimization (C)
===
Anyone know how to use the most of the compilers? It seems GCC support that. What is the real gain? In which case it's good? Inner loops? | 0 |
52,561 | 09/09/2008 18:40:02 | 4,808 | 09/05/2008 17:41:47 | 41 | 4 | iPhone browser tag and optimized web site | What is iPhone's browser tag and how iPhone optimized web site is different from a usual mobile web site?
Thanks! | html | iphone | mobile | mobile-web | null | null | open | iPhone browser tag and optimized web site
===
What is iPhone's browser tag and how iPhone optimized web site is different from a usual mobile web site?
Thanks! | 0 |
52,563 | 09/09/2008 18:40:46 | 1,968 | 08/19/2008 15:59:21 | 3,242 | 203 | CSS: Textbox to Fill Parent Container | I'm trying to let an `<input type="text">` (henceforth referred to as “textbox”) fill a parent container by settings its `width` to `100%`. This works until I give the textbox a padding. This is then added to the content width and the input field overflows. Notice that in Firefox this only happens when rendering the content as standards compliant. In quirks mode, another box model seems to apply.
Here's a minimal code to reproduce the behaviour in all modern browsers.
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
>
<html>
<head xmlns="http://www.w3.org/1999/xhtml">
<title>Test</title>
<style type="text/css">
#x {
background: salmon;
padding: 1em;
}
#y {
background: red;
padding: 0 20px;
width: 100%;
}
input {
background: red;
padding: 0 20px;
width: 100%;
}
</style>
</head>
<body>
<div id="x">
<div id="y">x</div>
<input type="text"/>
</div>
</body>
</html>
My question: **How do I get the textbox to fit the container?**
*Notice*: for the `<div id="y">`, this is straightforward: simply set `width: auto`. However, if I try to do this for the textbox, the effect is different and the textbox takes its default row count as width (even if I set `display: block` for the textbox). | css | box-model | null | null | null | null | open | CSS: Textbox to Fill Parent Container
===
I'm trying to let an `<input type="text">` (henceforth referred to as “textbox”) fill a parent container by settings its `width` to `100%`. This works until I give the textbox a padding. This is then added to the content width and the input field overflows. Notice that in Firefox this only happens when rendering the content as standards compliant. In quirks mode, another box model seems to apply.
Here's a minimal code to reproduce the behaviour in all modern browsers.
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
>
<html>
<head xmlns="http://www.w3.org/1999/xhtml">
<title>Test</title>
<style type="text/css">
#x {
background: salmon;
padding: 1em;
}
#y {
background: red;
padding: 0 20px;
width: 100%;
}
input {
background: red;
padding: 0 20px;
width: 100%;
}
</style>
</head>
<body>
<div id="x">
<div id="y">x</div>
<input type="text"/>
</div>
</body>
</html>
My question: **How do I get the textbox to fit the container?**
*Notice*: for the `<div id="y">`, this is straightforward: simply set `width: auto`. However, if I try to do this for the textbox, the effect is different and the textbox takes its default row count as width (even if I set `display: block` for the textbox). | 0 |
52,566 | 09/09/2008 18:42:07 | 4,764 | 09/05/2008 14:05:10 | 106 | 6 | MSSQL Server 2000 - Debugging Deadlocks | I'm looking for suggestions on how to debug and chase down deadlock issues in an MSSQL Server 2000 database. I've had it recommended to me to use trace flags 1024 and 3605, which I have found give me the following:
1024 - this trace flag returns the type of locks participating in the deadlock and the current command affected.
3605 - this trace flag sends trace output to the error log.
The specific stored procedures, tables and indexes still need to be uncovered, so the goal is to use these trace flags to do so. And then from there I'll know better what indexes need tuning, locking hints for tuning queries, and potential sproc bugs to fix.
Any other suggestions or happy ending war stories on chasing down this all to common problem? | tsql | debugging | deadlock | sql2000 | null | null | open | MSSQL Server 2000 - Debugging Deadlocks
===
I'm looking for suggestions on how to debug and chase down deadlock issues in an MSSQL Server 2000 database. I've had it recommended to me to use trace flags 1024 and 3605, which I have found give me the following:
1024 - this trace flag returns the type of locks participating in the deadlock and the current command affected.
3605 - this trace flag sends trace output to the error log.
The specific stored procedures, tables and indexes still need to be uncovered, so the goal is to use these trace flags to do so. And then from there I'll know better what indexes need tuning, locking hints for tuning queries, and potential sproc bugs to fix.
Any other suggestions or happy ending war stories on chasing down this all to common problem? | 0 |
52,583 | 09/09/2008 18:48:21 | 1,085 | 08/12/2008 11:02:02 | 11 | 2 | Best tool for synchronizing MySQL databases | I'm on a little quest of merging the structure of two MySql databases. Is there a tool for this with the might of Red-Gate's SQL Compare? Are there any free alternatives? | mysql | synchronization | null | null | null | null | open | Best tool for synchronizing MySQL databases
===
I'm on a little quest of merging the structure of two MySql databases. Is there a tool for this with the might of Red-Gate's SQL Compare? Are there any free alternatives? | 0 |
52,591 | 09/09/2008 18:50:45 | 1,414 | 08/15/2008 15:07:31 | 1,020 | 79 | ASP.Net word count with a custom validator | A requirement for an ASP.Net 2.0 project I'm working on limits a certain field to a max of 10 words (not characters). I'm currently using a CustomValidator control with the following ServerValidate method:
Protected Sub TenWordsTextBoxValidator_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles TenWordsTextBoxValidator.ServerValidate
'' 10 words
args.IsValid = args.Value.Split(" ").Length <= 10
End Sub
Does anyone have a more thorough/accurate method of getting a word count? | asp.net | vb.net | .net-2.0 | form-validation | null | null | open | ASP.Net word count with a custom validator
===
A requirement for an ASP.Net 2.0 project I'm working on limits a certain field to a max of 10 words (not characters). I'm currently using a CustomValidator control with the following ServerValidate method:
Protected Sub TenWordsTextBoxValidator_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles TenWordsTextBoxValidator.ServerValidate
'' 10 words
args.IsValid = args.Value.Split(" ").Length <= 10
End Sub
Does anyone have a more thorough/accurate method of getting a word count? | 0 |
52,598 | 09/09/2008 18:51:38 | 4,530 | 09/04/2008 17:16:43 | 21 | 1 | Code Walkthrough vs. Code Review | How many of you use walkthroughs instead of reviews? Or in conjunction with Reviews? Or only use walkthroughs?
Are Walkthroughs beneficial and how have you all implemented code walkthroughs? | code-review | code-walkthrough | null | null | null | 05/26/2012 19:36:41 | not constructive | Code Walkthrough vs. Code Review
===
How many of you use walkthroughs instead of reviews? Or in conjunction with Reviews? Or only use walkthroughs?
Are Walkthroughs beneficial and how have you all implemented code walkthroughs? | 4 |
52,600 | 09/09/2008 18:52:52 | 3,619 | 08/29/2008 15:08:14 | 249 | 42 | What does the PDB get me while debugging and how do I know it's working? | I have to use a third-party component without source code. I have the release DLL and release PDB file. Let's call it 'CorporateComponent.dll'. My own code creates objects from this DLL and calls methods on these objects.
CorpObject o = new CorpObject();
Int32 result = o.DoSomethingLousy();
While debugging, the method 'DoSomethingLousy' throws an exception. What does the PDB file do for me? If it does something nice, how can I be sure I'm making use of it? | .net | debugging | pdb | null | null | null | open | What does the PDB get me while debugging and how do I know it's working?
===
I have to use a third-party component without source code. I have the release DLL and release PDB file. Let's call it 'CorporateComponent.dll'. My own code creates objects from this DLL and calls methods on these objects.
CorpObject o = new CorpObject();
Int32 result = o.DoSomethingLousy();
While debugging, the method 'DoSomethingLousy' throws an exception. What does the PDB file do for me? If it does something nice, how can I be sure I'm making use of it? | 0 |
52,608 | 09/09/2008 18:55:11 | 1,935 | 08/19/2008 14:31:00 | 56 | 9 | Is Subversion (Version Control) Necessary For A Small Development Group (1-2 programmers)? | I am trying to debate the point that version control is important for either 1 or 2 developers. More specifically, I work in a department in which there are typically two PHP developers, using a shared framework. He argues that there is no value added in us having subversion installed on our development system, whereas I argue that it is nice to occasionally be able to roll back to see previous code, especially when there are unexplainable errors occurring that are hard to pin-point in some of the classes. I think subversion offers the easiest way to create and track changes, for various reasons, including debugging. Would subversion save any time? | subversion | null | null | null | null | null | open | Is Subversion (Version Control) Necessary For A Small Development Group (1-2 programmers)?
===
I am trying to debate the point that version control is important for either 1 or 2 developers. More specifically, I work in a department in which there are typically two PHP developers, using a shared framework. He argues that there is no value added in us having subversion installed on our development system, whereas I argue that it is nice to occasionally be able to roll back to see previous code, especially when there are unexplainable errors occurring that are hard to pin-point in some of the classes. I think subversion offers the easiest way to create and track changes, for various reasons, including debugging. Would subversion save any time? | 0 |
52,626 | 09/09/2008 18:59:57 | 1,921 | 08/19/2008 14:17:41 | 417 | 44 | Automating DB Object Migrations from Source Control | I'm looking for some "Best Practices" for automating the deployment of Stored Procedures/Views/Functions/Table changes from source control. I'm using StarTeam & ANT so the labeling is taken care of; what I am looking for is how some of you have approached automating the pull of these objects from source - not necessarily StarTeam.
I'd like to end up with one script that can then be executed, checked in, and labeled.
I'm NOT asking for anyone to write that - just some ideas or approaches that have (or haven't) worked in the past.
I'm trying to clean up a mess and want to make sure I get this as close to "right" as I can.
We are storing the tables/views/functions etc. in individual files in StarTeam and our DB is SQL 2K5. | sql-server | version-control | build-automation | starteam | null | null | open | Automating DB Object Migrations from Source Control
===
I'm looking for some "Best Practices" for automating the deployment of Stored Procedures/Views/Functions/Table changes from source control. I'm using StarTeam & ANT so the labeling is taken care of; what I am looking for is how some of you have approached automating the pull of these objects from source - not necessarily StarTeam.
I'd like to end up with one script that can then be executed, checked in, and labeled.
I'm NOT asking for anyone to write that - just some ideas or approaches that have (or haven't) worked in the past.
I'm trying to clean up a mess and want to make sure I get this as close to "right" as I can.
We are storing the tables/views/functions etc. in individual files in StarTeam and our DB is SQL 2K5. | 0 |
52,634 | 09/09/2008 19:02:14 | 1,194 | 08/13/2008 12:27:52 | 122 | 10 | GridView will not update underlying data source | So I'm been pounding on this problem all day. I've got a LinqDataSource that points to my model and a GridView that consumes it. When I attempt to do an update on the GridView, it does not update the underlying data source. I thought it might have to do with the LinqDataSource, so I added a SqlDataSource and the same thing happens. The aspx is as follows (the code-behind page is empty):
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="Data Source=devsql32;Initial Catalog=Steam;Persist Security Info=True;"
ProviderName="System.Data.SqlClient"
SelectCommand="SELECT [LangID], [Code], [Name] FROM [Languages]" UpdateCommand="UPDATE [Languages] SET [Code]=@Code WHERE [LangID]=@LangId">
</asp:SqlDataSource>
<asp:GridView ID="_languageGridView" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="LangId"
DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="LangId" HeaderText="Id" ReadOnly="True" />
<asp:BoundField DataField="Code" HeaderText="Code" />
<asp:BoundField DataField="Name" HeaderText="Name" />
</Columns>
</asp:GridView>
<asp:LinqDataSource ID="_languageDataSource" ContextTypeName="GeneseeSurvey.SteamDatabaseDataContext" runat="server" TableName="Languages" EnableInsert="True" EnableUpdate="true" EnableDelete="true">
</asp:LinqDataSource>
What in the world am I missing here? This problem is driving me insane. | asp.net | linq-to-sql | data-binding | null | null | null | open | GridView will not update underlying data source
===
So I'm been pounding on this problem all day. I've got a LinqDataSource that points to my model and a GridView that consumes it. When I attempt to do an update on the GridView, it does not update the underlying data source. I thought it might have to do with the LinqDataSource, so I added a SqlDataSource and the same thing happens. The aspx is as follows (the code-behind page is empty):
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="Data Source=devsql32;Initial Catalog=Steam;Persist Security Info=True;"
ProviderName="System.Data.SqlClient"
SelectCommand="SELECT [LangID], [Code], [Name] FROM [Languages]" UpdateCommand="UPDATE [Languages] SET [Code]=@Code WHERE [LangID]=@LangId">
</asp:SqlDataSource>
<asp:GridView ID="_languageGridView" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="LangId"
DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="LangId" HeaderText="Id" ReadOnly="True" />
<asp:BoundField DataField="Code" HeaderText="Code" />
<asp:BoundField DataField="Name" HeaderText="Name" />
</Columns>
</asp:GridView>
<asp:LinqDataSource ID="_languageDataSource" ContextTypeName="GeneseeSurvey.SteamDatabaseDataContext" runat="server" TableName="Languages" EnableInsert="True" EnableUpdate="true" EnableDelete="true">
</asp:LinqDataSource>
What in the world am I missing here? This problem is driving me insane. | 0 |
52,646 | 09/09/2008 19:09:56 | 1,581 | 08/16/2008 20:39:26 | 40 | 1 | Best Practice: Legitimate Cross-Site Scripting | While cross-site scripting is generally regarded as negative, I've run into several situations where it's necessary.
I was recently working within the confines of a very limiting content management system. I needed to include database code within the page, but the hosting server didn't have anything usable available. I set up a couple barebones scripts on my own server, originally thinking that I could use AJAX to import the contents of my scripts directly into the template of the CMS (thus retaining dynamic images, menu items, CSS, etc.). I was wrong.
Due to the limitations of XMLHttpRequest objects, it's not possible to grab content from a different domain. So I thought "iFrame" - even though I'm not a fan of frames, I thought that I could create a frame that matched the width and height of the content, so that it would appear native. Again, I was blocked by cross-site scripting "protections." While I could indeed load a remote file into the iFrame, I couldn't execute JavaScript to modify its size on either the host page or inside the loaded page.
In this particular scenario, I wasn't able to point a subdomain to my server. I also couldn't create a script on the CMS server that could proxy content from my server, so my last thought was to use a remote JavaScript.
A remote JavaScript works. It breaks when the user has JavaScript disabled, which is a downside; but it works. The "problem" I was having with using a remote JavaScript was that I had to use the JS function document.write() to output any content. Any output that isn't JS causes script errors. In addition to using document.write() for every line, you also have to ensure that the content is escaped - or else you end up with more script errors.
My solution was as follows:
My script received a GET parameter ("page") and then looked for the file ({$page}.php), and read the contents into a variable. However, I had to use awkward buffering techniques in order to actually execute the included scripts (for things like database interaction) then strip the final content of all line break characters ("\n") followed by escaping all required characters. The end result is that my original script (which outputs JavaScript) accesses seemingly "standard" scripts on my server and converts their standard output to JavaScript for displaying within the CMS template.
While this solution works, it seems like there may be a better way to accomplish the same thing. What is the best way to make cross-site scripting work specifically for the purpose of including content from a completely different domain? | javascript | php | xss | null | null | null | open | Best Practice: Legitimate Cross-Site Scripting
===
While cross-site scripting is generally regarded as negative, I've run into several situations where it's necessary.
I was recently working within the confines of a very limiting content management system. I needed to include database code within the page, but the hosting server didn't have anything usable available. I set up a couple barebones scripts on my own server, originally thinking that I could use AJAX to import the contents of my scripts directly into the template of the CMS (thus retaining dynamic images, menu items, CSS, etc.). I was wrong.
Due to the limitations of XMLHttpRequest objects, it's not possible to grab content from a different domain. So I thought "iFrame" - even though I'm not a fan of frames, I thought that I could create a frame that matched the width and height of the content, so that it would appear native. Again, I was blocked by cross-site scripting "protections." While I could indeed load a remote file into the iFrame, I couldn't execute JavaScript to modify its size on either the host page or inside the loaded page.
In this particular scenario, I wasn't able to point a subdomain to my server. I also couldn't create a script on the CMS server that could proxy content from my server, so my last thought was to use a remote JavaScript.
A remote JavaScript works. It breaks when the user has JavaScript disabled, which is a downside; but it works. The "problem" I was having with using a remote JavaScript was that I had to use the JS function document.write() to output any content. Any output that isn't JS causes script errors. In addition to using document.write() for every line, you also have to ensure that the content is escaped - or else you end up with more script errors.
My solution was as follows:
My script received a GET parameter ("page") and then looked for the file ({$page}.php), and read the contents into a variable. However, I had to use awkward buffering techniques in order to actually execute the included scripts (for things like database interaction) then strip the final content of all line break characters ("\n") followed by escaping all required characters. The end result is that my original script (which outputs JavaScript) accesses seemingly "standard" scripts on my server and converts their standard output to JavaScript for displaying within the CMS template.
While this solution works, it seems like there may be a better way to accomplish the same thing. What is the best way to make cross-site scripting work specifically for the purpose of including content from a completely different domain? | 0 |
52,652 | 09/09/2008 19:11:45 | 473 | 08/06/2008 05:51:32 | 139 | 2 | Pretty graphs and charts in Python | What are the best libraries for creating pretty charts and graphs in a Python application? | python | graphics | null | null | null | 04/12/2012 14:40:44 | not constructive | Pretty graphs and charts in Python
===
What are the best libraries for creating pretty charts and graphs in a Python application? | 4 |
52,657 | 09/09/2008 19:13:59 | 5,189 | 09/08/2008 11:44:07 | 78 | 7 | How are people unit testing code that uses Linq to SQL | How are people unit testing code that uses Linq to SQL? | unit-testing | linq-to-sql | null | null | null | null | open | How are people unit testing code that uses Linq to SQL
===
How are people unit testing code that uses Linq to SQL? | 0 |
52,668 | 09/09/2008 19:18:40 | 4,808 | 09/05/2008 17:41:47 | 48 | 4 | ASP.NET MVC quick start - a one-stop tutorial? | There are many ASP.MVC blog post bits and pieces scattered over different web sites, as well as couple of resource questions here - [ASP.NET Model-view-controller (MVC) - where do I start from?][1] and [MVC Learning Resources][2]
I wonder if there was a one-stop tutorial posted yet on getting started with ASP.NET MVC?
Thank you!
[1]: http://stackoverflow.com/questions/14599/aspnet-model-view-controller-mvc-where-do-i-start-from
[2]: http://stackoverflow.com/questions/10425/mvc-learning-resources | asp.net-mvc | mvc | tutorials | null | null | null | open | ASP.NET MVC quick start - a one-stop tutorial?
===
There are many ASP.MVC blog post bits and pieces scattered over different web sites, as well as couple of resource questions here - [ASP.NET Model-view-controller (MVC) - where do I start from?][1] and [MVC Learning Resources][2]
I wonder if there was a one-stop tutorial posted yet on getting started with ASP.NET MVC?
Thank you!
[1]: http://stackoverflow.com/questions/14599/aspnet-model-view-controller-mvc-where-do-i-start-from
[2]: http://stackoverflow.com/questions/10425/mvc-learning-resources | 0 |
52,674 | 09/09/2008 19:21:23 | 3,279 | 08/27/2008 16:46:21 | 738 | 40 | Simplest way to reverse the order of strings in a make variable | Let's say you have a variable in a makefile fragment like the following:
MY_LIST=a b c d
How do I then reverse the order of that list? I need:
$(warning MY_LIST=${MY_LIST})
to show
MY_LIST=d c b a
Edit: the real problem is that
ld -r some_object.o ${MY_LIST}
produces an `a.out` with undefined symbols because the items in `MY_LIST` are actually archives, but in the wrong order. If the order of `MY_LIST` is reversed, it will link correctly (I think). If you know a smarter way to get the link order right, clue me in. | make | makefile | null | null | null | null | open | Simplest way to reverse the order of strings in a make variable
===
Let's say you have a variable in a makefile fragment like the following:
MY_LIST=a b c d
How do I then reverse the order of that list? I need:
$(warning MY_LIST=${MY_LIST})
to show
MY_LIST=d c b a
Edit: the real problem is that
ld -r some_object.o ${MY_LIST}
produces an `a.out` with undefined symbols because the items in `MY_LIST` are actually archives, but in the wrong order. If the order of `MY_LIST` is reversed, it will link correctly (I think). If you know a smarter way to get the link order right, clue me in. | 0 |
52,676 | 09/09/2008 19:22:18 | 672 | 08/07/2008 16:18:07 | 471 | 39 | Favorite Windows keyboard shortcuts | I'm a keyboard junkie. I love having a key sequence to do everything. What are your favorite keyboard shortcuts?
I'll start by naming a couple of mine:
1 - Alt-Space to access the windows menu for the current window
2 - F2 to rename a file in Windows Explorer | keyboard-shortcuts | null | null | null | null | null | open | Favorite Windows keyboard shortcuts
===
I'm a keyboard junkie. I love having a key sequence to do everything. What are your favorite keyboard shortcuts?
I'll start by naming a couple of mine:
1 - Alt-Space to access the windows menu for the current window
2 - F2 to rename a file in Windows Explorer | 0 |
52,698 | 09/09/2008 19:29:06 | 2,047 | 08/19/2008 23:53:14 | 101 | 13 | BlackBerry development using IntelliJ IDEA 7.0? | I know RIM has their own IDE (<a href="http://na.blackberry.com/eng/developers/downloads/jde.jsp">BlackBerry JDE</a>) for building BlackBerry apps, but does anyone know how to configure <a href="http://www.jetbrains.com/idea/index.html">IntelliJ IDEA</a> to build/debug BlackBerry apps? | java | intellij | blackberry | java-ide | null | null | open | BlackBerry development using IntelliJ IDEA 7.0?
===
I know RIM has their own IDE (<a href="http://na.blackberry.com/eng/developers/downloads/jde.jsp">BlackBerry JDE</a>) for building BlackBerry apps, but does anyone know how to configure <a href="http://www.jetbrains.com/idea/index.html">IntelliJ IDEA</a> to build/debug BlackBerry apps? | 0 |
52,701 | 09/09/2008 19:32:34 | 3,043 | 08/26/2008 13:24:14 | 1,541 | 157 | Building Apps for Motorola Cell Phone | I have an L6 phone from motorola, a usb cable to connect it to my computer, and the Tools for Phones software so I can do things like upload my own custom ringtones or download pictures from the phone's camera.
I have some ideas for programs I'd like to run on the phone, and it supports java, but I don't see anything in the software that I have for uploading them. Even if they did, I wouldn't know where to get started.
Does anyone have any info on how to get started building apps for this or similar phones? | java | mobile-phones | null | null | null | null | open | Building Apps for Motorola Cell Phone
===
I have an L6 phone from motorola, a usb cable to connect it to my computer, and the Tools for Phones software so I can do things like upload my own custom ringtones or download pictures from the phone's camera.
I have some ideas for programs I'd like to run on the phone, and it supports java, but I don't see anything in the software that I have for uploading them. Even if they did, I wouldn't know where to get started.
Does anyone have any info on how to get started building apps for this or similar phones? | 0 |
52,702 | 09/09/2008 19:32:41 | 4,764 | 09/05/2008 14:05:10 | 113 | 6 | SharePoint stream file for preview | I am looking to stream a file housed in a SharePoint 2003 document library down to the browser. Basically the idea is to open the file as a stream and then to "write" the file stream to the reponse, specifying the content type and content disposition headers. Content disposition is used to preserve the file name, content type of course to clue the browser about what app to open to view the file.
This works all good and fine in a development environment and UAT environment. However, in the production environment, things do not always work as expected,however only with IE6/IE7. FF works great in all environments.
Note that in the production environment SSL is enabled and generally used. (When SSL is not used in the production environment, file streams, is named as expected, and properly dislays.)
Here is a code snippet:
System.IO.FileStream fs = new System.IO.FileStream(Server.MapPath(".") + "\\" + "test.doc", System.IO.FileMode.Open);
long byteNum = fs.Length;
byte[] pdfBytes = new byte[byteNum];
fs.Read(pdfBytes, 0, (int)byteNum);
Response.AppendHeader("Content-disposition", "filename=Testme.doc");
Response.CacheControl = "no-cache";
Response.ContentType = "application/msword; charset=utf-8";
Response.Expires = -1;
Response.OutputStream.Write(pdfBytes, 0, pdfBytes.Length);
Response.Flush();
Response.Close();
fs.Close();
Like I said, this code snippet works fine on the dev machine and in the UAT environment. A dialog box opens and asks to save, view or cancel Testme.doc. But in production onnly when using SSL, IE 6 & IE7 don't use the name of the attachment. Instead it uses the name of the page that is sending the stream, testheader.apx and then an error is thrown.
IE does provide an advanced setting "Do not save encrypted pages to disk".
I suspect this is part of the problem, the server tells the browser not to cache the file, while IE has the "Do not save encrypted pages to disk" enabled.
Yes I am aware that for larger files, the code snippet above will be a major drag on memory and this implimentation will be problematic. So the real final solution will not open the entire file into a single byte array, but rather will open the file as a stream, and then send the file down to the client in bite size chunks (e.g. perhaps roughly 10K in size).
Anyone else have similar experience "streaming" binary files over ssl? Any suggestions or recommendations?
| asp.net | sharepoint | ssl | binary | streaming | null | open | SharePoint stream file for preview
===
I am looking to stream a file housed in a SharePoint 2003 document library down to the browser. Basically the idea is to open the file as a stream and then to "write" the file stream to the reponse, specifying the content type and content disposition headers. Content disposition is used to preserve the file name, content type of course to clue the browser about what app to open to view the file.
This works all good and fine in a development environment and UAT environment. However, in the production environment, things do not always work as expected,however only with IE6/IE7. FF works great in all environments.
Note that in the production environment SSL is enabled and generally used. (When SSL is not used in the production environment, file streams, is named as expected, and properly dislays.)
Here is a code snippet:
System.IO.FileStream fs = new System.IO.FileStream(Server.MapPath(".") + "\\" + "test.doc", System.IO.FileMode.Open);
long byteNum = fs.Length;
byte[] pdfBytes = new byte[byteNum];
fs.Read(pdfBytes, 0, (int)byteNum);
Response.AppendHeader("Content-disposition", "filename=Testme.doc");
Response.CacheControl = "no-cache";
Response.ContentType = "application/msword; charset=utf-8";
Response.Expires = -1;
Response.OutputStream.Write(pdfBytes, 0, pdfBytes.Length);
Response.Flush();
Response.Close();
fs.Close();
Like I said, this code snippet works fine on the dev machine and in the UAT environment. A dialog box opens and asks to save, view or cancel Testme.doc. But in production onnly when using SSL, IE 6 & IE7 don't use the name of the attachment. Instead it uses the name of the page that is sending the stream, testheader.apx and then an error is thrown.
IE does provide an advanced setting "Do not save encrypted pages to disk".
I suspect this is part of the problem, the server tells the browser not to cache the file, while IE has the "Do not save encrypted pages to disk" enabled.
Yes I am aware that for larger files, the code snippet above will be a major drag on memory and this implimentation will be problematic. So the real final solution will not open the entire file into a single byte array, but rather will open the file as a stream, and then send the file down to the client in bite size chunks (e.g. perhaps roughly 10K in size).
Anyone else have similar experience "streaming" binary files over ssl? Any suggestions or recommendations?
| 0 |
52,703 | 09/09/2008 19:32:54 | 2,745 | 08/24/2008 20:58:00 | 295 | 14 | php is_dir returns true for non-existent folder | Has anyone encountered this oddity?
I'm checking for the existence of a number of directories in one of my unit tests. <code>is_dir</code> is reporting true (1) in spite of the folder not existing at the time it is called. Code looks like this (with a few extraneous intermediate vars to ease debugging):
foreach($userfolders as $uf) {
$uf = sprintf($uf, $user_id);
$uf = ltrim($uf,'/');
$path = trim($base . '/' . $uf);
$res = is_dir($path); //returns false except last time returns 1
$this->assertFalse($res, $path);
}
Machine running Ubuntu Linux 8.04 with PHP Version 5.2.4-2ubuntu5.3
Things I have checked:
- Paths are full paths
- Same thing happens on two separate machines (both running Ubuntu)
- I have stepped through line by line in a debugger
- Paths genuinely don't exist at the point where is_dir is called
- While the code is paused on this line, I can actually drop to a shell and run the interactive php interpreter and get the correct result
- The paths are all WELL under 256 chars
- I can't imagine a permissions problem as the folder doesn't exist! The parent folder can't be causing permissions problems as the other folders in the loop are correctly reported as missing.
Comments on the PHP docs point to the odd issue with <code>is_dir</code> but not this particular one.
I'm not posting this as a "please help me fix" but in the hope that somebody encountering the same thing can search here and *hopefully* an answer from somebody else who as seen this! | php | null | null | null | null | null | open | php is_dir returns true for non-existent folder
===
Has anyone encountered this oddity?
I'm checking for the existence of a number of directories in one of my unit tests. <code>is_dir</code> is reporting true (1) in spite of the folder not existing at the time it is called. Code looks like this (with a few extraneous intermediate vars to ease debugging):
foreach($userfolders as $uf) {
$uf = sprintf($uf, $user_id);
$uf = ltrim($uf,'/');
$path = trim($base . '/' . $uf);
$res = is_dir($path); //returns false except last time returns 1
$this->assertFalse($res, $path);
}
Machine running Ubuntu Linux 8.04 with PHP Version 5.2.4-2ubuntu5.3
Things I have checked:
- Paths are full paths
- Same thing happens on two separate machines (both running Ubuntu)
- I have stepped through line by line in a debugger
- Paths genuinely don't exist at the point where is_dir is called
- While the code is paused on this line, I can actually drop to a shell and run the interactive php interpreter and get the correct result
- The paths are all WELL under 256 chars
- I can't imagine a permissions problem as the folder doesn't exist! The parent folder can't be causing permissions problems as the other folders in the loop are correctly reported as missing.
Comments on the PHP docs point to the odd issue with <code>is_dir</code> but not this particular one.
I'm not posting this as a "please help me fix" but in the hope that somebody encountering the same thing can search here and *hopefully* an answer from somebody else who as seen this! | 0 |
52,704 | 09/09/2008 19:33:59 | 4,883 | 09/06/2008 10:24:59 | 436 | 4 | How do you discard unstaged changes in git? | If some changes are added to the index and there are some changes that are not added to the index, how do I discard the changes in my working copy that are not added to the index yet? | git | null | null | null | null | null | open | How do you discard unstaged changes in git?
===
If some changes are added to the index and there are some changes that are not added to the index, how do I discard the changes in my working copy that are not added to the index yet? | 0 |
52,711 | 09/09/2008 19:36:57 | 3,475 | 08/28/2008 17:53:18 | 125 | 8 | What factors could cause the following SqlException: A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 1 - I/O Error detected in read/write operation) | I've started seeing this message intermittently for a few of the unit tests in my application (there are over 1100 unit & system tests). I'm using the test runner in ReSharper 4.1. | sql-server | unit-testing | resharper | null | null | null | open | What factors could cause the following SqlException: A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 1 - I/O Error detected in read/write operation)
===
I've started seeing this message intermittently for a few of the unit tests in my application (there are over 1100 unit & system tests). I'm using the test runner in ReSharper 4.1. | 0 |
52,714 | 09/09/2008 19:37:44 | 2,328 | 08/21/2008 16:45:54 | 557 | 28 | STL vector vs map erase | In the STL almost all containers have an erase function. The question I have is in a vector, the erase function returns an iterator pointing to the next element in the vector. The map container does not do this. Instead it returns a void. Anyone know why there is this inconsistancy? | c++ | stl | null | null | null | null | open | STL vector vs map erase
===
In the STL almost all containers have an erase function. The question I have is in a vector, the erase function returns an iterator pointing to the next element in the vector. The map container does not do this. Instead it returns a void. Anyone know why there is this inconsistancy? | 0 |
52,723 | 09/09/2008 19:40:41 | 2,581 | 08/23/2008 04:37:51 | 71 | 7 | SQL Pagination | I am trying to paginate the results of an SQL query for use on a web page. The language and the database backend are PHP and SQLite.
The code I'm using works something like this (page numbering starts at 0)
http://example.com/table?page=0
page = request(page)
per = 10 // results per page
offset = page * per
// take one extra record so we know if a next link is needed
resultset = query(select columns from table where conditions limit offset, per + 1)
if(page > 0) show a previous link
if(count(resultset) > per) show a next link
unset(resultset[per])
display results
Are there more efficient ways to do pagination than this?
One problem that I can see with my current method is that I must store all 10 (or however many) results in memory before I start displaying them. I do this because PDO does not guarantee that the rowcount will be available.
Is it more efficient to issue a COUNT(*) query to learn how many rows exist, then stream the results to the browser?
Is this one of those "it depends on the size of your table, and whether the count(*) query requires a full table scan in the database backend", "do some profiling yourself" kind of questions? | php | sql | sqlite | pdo | null | null | open | SQL Pagination
===
I am trying to paginate the results of an SQL query for use on a web page. The language and the database backend are PHP and SQLite.
The code I'm using works something like this (page numbering starts at 0)
http://example.com/table?page=0
page = request(page)
per = 10 // results per page
offset = page * per
// take one extra record so we know if a next link is needed
resultset = query(select columns from table where conditions limit offset, per + 1)
if(page > 0) show a previous link
if(count(resultset) > per) show a next link
unset(resultset[per])
display results
Are there more efficient ways to do pagination than this?
One problem that I can see with my current method is that I must store all 10 (or however many) results in memory before I start displaying them. I do this because PDO does not guarantee that the rowcount will be available.
Is it more efficient to issue a COUNT(*) query to learn how many rows exist, then stream the results to the browser?
Is this one of those "it depends on the size of your table, and whether the count(*) query requires a full table scan in the database backend", "do some profiling yourself" kind of questions? | 0 |
52,724 | 09/09/2008 19:41:33 | 4,913 | 09/06/2008 15:10:57 | 69 | 15 | Mirroring perforce with SVK? | Anyone know of a way to use SVK with perforce? The docs [seem to imply][1] it used to be possible, but some [mailing list messages][2] claim that is no longer the case?
[1]: http://svk.bestpractical.com/view/MirrorVCP
[2]: http://lists.bestpractical.com/pipermail/svk-devel/2007-February/000604.html | svn | perforce | svk | null | null | null | open | Mirroring perforce with SVK?
===
Anyone know of a way to use SVK with perforce? The docs [seem to imply][1] it used to be possible, but some [mailing list messages][2] claim that is no longer the case?
[1]: http://svk.bestpractical.com/view/MirrorVCP
[2]: http://lists.bestpractical.com/pipermail/svk-devel/2007-February/000604.html | 0 |
52,730 | 09/09/2008 19:45:03 | 2,047 | 08/19/2008 23:53:14 | 101 | 13 | Perform token replacements using VS post-build event command? | I would like to "post-process" my app.config file and perform some token replacements after the projects builds.
Is there an *easy* way to do this using a <a href="http://msdn.microsoft.com/en-us/library/42x5kfw4(VS.80).aspx">VS post-build event</a> command?
*(Yeah I know I could probably use NAnt or something, looking for something simple.)* | .net | vs2005 | vs2008 | null | null | null | open | Perform token replacements using VS post-build event command?
===
I would like to "post-process" my app.config file and perform some token replacements after the projects builds.
Is there an *easy* way to do this using a <a href="http://msdn.microsoft.com/en-us/library/42x5kfw4(VS.80).aspx">VS post-build event</a> command?
*(Yeah I know I could probably use NAnt or something, looking for something simple.)* | 0 |
52,732 | 09/09/2008 19:45:11 | 1,409 | 08/15/2008 13:18:51 | 551 | 41 | How do I dynamically create a Video object in AS2 and add it to a MovieClip? | I need to dynamically create a Video object in ActionScript 2 and add it to a movie clip. In AS3 I just do this:
var videoViewComp:UIComponent; // created elsewhere
videoView = new Video();
videoView.width = 400;
videoView.height = 400;
this.videoViewComp.addChild(videoView);
Unfortunately, I can't figure out how to accomplish this in AS2. Video isn't a child of MovieClip, so attachMovie() doesn't seem to be getting me anything. I don't see any equivalent to AS3's UIComponent.addChild() method either.
Is there any way to dynamically create a Video object in AS2 that actually shows up on the stage? | flash | video | actionscript-2 | null | null | null | open | How do I dynamically create a Video object in AS2 and add it to a MovieClip?
===
I need to dynamically create a Video object in ActionScript 2 and add it to a movie clip. In AS3 I just do this:
var videoViewComp:UIComponent; // created elsewhere
videoView = new Video();
videoView.width = 400;
videoView.height = 400;
this.videoViewComp.addChild(videoView);
Unfortunately, I can't figure out how to accomplish this in AS2. Video isn't a child of MovieClip, so attachMovie() doesn't seem to be getting me anything. I don't see any equivalent to AS3's UIComponent.addChild() method either.
Is there any way to dynamically create a Video object in AS2 that actually shows up on the stage? | 0 |
52,739 | 09/09/2008 19:49:48 | 2,577 | 08/23/2008 03:18:09 | 126 | 7 | Is there a way to infer what image format a file is, without reading the entire file? | Is there a good way to see what format an image is, without having to read the entire file into memory?
Obviously this would vary from format to format (I'm particularly interested in TIFF files) but what sort of procedure would be useful to determine what kind of image format a file is without having to read through the entire file? | image | tiff | null | null | null | null | open | Is there a way to infer what image format a file is, without reading the entire file?
===
Is there a good way to see what format an image is, without having to read the entire file into memory?
Obviously this would vary from format to format (I'm particularly interested in TIFF files) but what sort of procedure would be useful to determine what kind of image format a file is without having to read through the entire file? | 0 |
52,753 | 09/09/2008 19:53:21 | 5,392 | 09/09/2008 12:20:15 | 1 | 0 | Derive from Exception or ApplicationException in .NET | What is best practice when creating your exception classes in a .NET solution. To derive from System.Exception or from System.ApplicationException? | .net | exception | null | null | null | null | open | Derive from Exception or ApplicationException in .NET
===
What is best practice when creating your exception classes in a .NET solution. To derive from System.Exception or from System.ApplicationException? | 0 |
52,755 | 09/09/2008 19:54:16 | 672 | 08/07/2008 16:18:07 | 486 | 39 | What determines the monitor my app runs on? | I am using Windows, and I have two monitors.
Some applications will *always* start on my primary monitor, no matter where they were when I closed them.
Others will always start on the *secondary* monitor, no matter where they were when I closed them.
Is there a registry setting buried somewhere, which I can manipulate to control which monitor applications launch into by default? | multiple-monitors | null | null | null | null | null | open | What determines the monitor my app runs on?
===
I am using Windows, and I have two monitors.
Some applications will *always* start on my primary monitor, no matter where they were when I closed them.
Others will always start on the *secondary* monitor, no matter where they were when I closed them.
Is there a registry setting buried somewhere, which I can manipulate to control which monitor applications launch into by default? | 0 |
52,764 | 09/09/2008 19:59:10 | 1,583 | 08/16/2008 20:54:12 | 349 | 13 | XAML to SVG? | How would you go about converting XAML to SVG and vice versa?
My initial approach it to use xslt to map the different elements and attributes, but I don't know enough about both syntaxes to even guess about the plausibility of such an approach. | xaml | svg | null | null | null | null | open | XAML to SVG?
===
How would you go about converting XAML to SVG and vice versa?
My initial approach it to use xslt to map the different elements and attributes, but I don't know enough about both syntaxes to even guess about the plausibility of such an approach. | 0 |
52,778 | 09/09/2008 20:04:54 | 672 | 08/07/2008 16:18:07 | 496 | 39 | How do you handle making "clean" test builds? | In my current environment, we have a "clean" build machine, which has an exact copy of all committed changes, nothing more, nothing less.
And of course I have my own machine, with dozens of files in an "in-progress" state.
Often I need to build my application with only one change in place. For example, I've finished task ABC, and I want to build an EXE with *only* that change.
But of course I can't commit the change to the repository until it's tested.
Branching seems like overkill for this. What do you do in your environment to isolate changes for test builds and releases? | testing | version-control | build-process | null | null | null | open | How do you handle making "clean" test builds?
===
In my current environment, we have a "clean" build machine, which has an exact copy of all committed changes, nothing more, nothing less.
And of course I have my own machine, with dozens of files in an "in-progress" state.
Often I need to build my application with only one change in place. For example, I've finished task ABC, and I want to build an EXE with *only* that change.
But of course I can't commit the change to the repository until it's tested.
Branching seems like overkill for this. What do you do in your environment to isolate changes for test builds and releases? | 0 |
52,785 | 09/09/2008 20:07:56 | 2,490 | 08/22/2008 13:52:54 | 45 | 4 | How do I add a div and pick it up later | I think this is specific to IE 6.0 but...
In javascript I add a div to the dom...I assign an ID attribute. When I later try to pick up the Div by the ID all I get is null???
Any suggestions?
Example:
var newDiv = document.createElement("DIV");
newDiv.setAttribute("ID", "obj_1000");
document.appendChild(newDiv);
alert("Added:" + newDiv.getAttribute("ID") + ":" + newDiv.id + ":" + document.getElementById("obj_1000") );
Alert prints "::null"
Seems to work fine in Firefox 2.0+
| javascript | dhtml | dynamic-css | null | null | null | open | How do I add a div and pick it up later
===
I think this is specific to IE 6.0 but...
In javascript I add a div to the dom...I assign an ID attribute. When I later try to pick up the Div by the ID all I get is null???
Any suggestions?
Example:
var newDiv = document.createElement("DIV");
newDiv.setAttribute("ID", "obj_1000");
document.appendChild(newDiv);
alert("Added:" + newDiv.getAttribute("ID") + ":" + newDiv.id + ":" + document.getElementById("obj_1000") );
Alert prints "::null"
Seems to work fine in Firefox 2.0+
| 0 |
52,797 | 09/09/2008 20:12:28 | 5,056 | 09/07/2008 15:43:17 | 308 | 35 | C#: How do I get the path of the assembly the code is in? | Is there a way to get the path for the assembly in which the current code resides? I do not want the path of the calling assembly, just the one containing the code.
Basically my unit test needs to read some xml test files which are located relative to the dll. I want the path to always resolve correctly regardless of whether the testing dll is run from TestDriven.NET, the MbUnit GUI or something else. | c# | stl | null | null | null | null | open | C#: How do I get the path of the assembly the code is in?
===
Is there a way to get the path for the assembly in which the current code resides? I do not want the path of the calling assembly, just the one containing the code.
Basically my unit test needs to read some xml test files which are located relative to the dll. I want the path to always resolve correctly regardless of whether the testing dll is run from TestDriven.NET, the MbUnit GUI or something else. | 0 |
52,806 | 09/09/2008 20:18:07 | 5,030 | 09/07/2008 13:13:06 | 1 | 0 | Help me construct a complex SQL query (or queries). | As part of a larger web-app (using CakePHP), I'm putting together a simple blog system. The relationships are exceedingly simple: each User has a Blog, which has many Entries, which have many Comments.
An element I'd like to incorporate is a list of "Popular Entries." Popular Entries have been defined as those with the most Comments in the last month, and ultimately they need to be ordered by the number of recent Comments.
Ideally, I'd like the solution to stay within Cake's Model data-retrieval apparatus (Model->find(), etc.), but I'm not sanguine about this.
Anyone have a clever/elegant solution? I'm steeling myself for some wild SQL hacking to make this work... | php | cakephp | null | null | null | null | open | Help me construct a complex SQL query (or queries).
===
As part of a larger web-app (using CakePHP), I'm putting together a simple blog system. The relationships are exceedingly simple: each User has a Blog, which has many Entries, which have many Comments.
An element I'd like to incorporate is a list of "Popular Entries." Popular Entries have been defined as those with the most Comments in the last month, and ultimately they need to be ordered by the number of recent Comments.
Ideally, I'd like the solution to stay within Cake's Model data-retrieval apparatus (Model->find(), etc.), but I'm not sanguine about this.
Anyone have a clever/elegant solution? I'm steeling myself for some wild SQL hacking to make this work... | 0 |
52,808 | 09/09/2008 20:19:37 | 1,365 | 08/14/2008 18:28:56 | 103 | 8 | .NET Production Debugging | I've had a Windows app in production for a while now, and have it set up to send us error reports when it throws exceptions. Most of these are fairly descriptive and help me find the problem very quickly (I use the MS Application Exception Block).
On a few occasions I have reports that are issues that I can't reproduce, and seem to only happen on a few client machines.
I don't have physical access to these client machines, what are some strategies I can use for debugging? Would it be better to build some tracing into the code, or are there some other alternatives?
Thank you. | .net | debugging | null | null | null | null | open | .NET Production Debugging
===
I've had a Windows app in production for a while now, and have it set up to send us error reports when it throws exceptions. Most of these are fairly descriptive and help me find the problem very quickly (I use the MS Application Exception Block).
On a few occasions I have reports that are issues that I can't reproduce, and seem to only happen on a few client machines.
I don't have physical access to these client machines, what are some strategies I can use for debugging? Would it be better to build some tracing into the code, or are there some other alternatives?
Thank you. | 0 |
52,816 | 09/09/2008 20:23:55 | 380 | 08/05/2008 10:39:18 | 2,373 | 191 | Help on website optimization for iPhone | We re trying to work on making a mobile version for one of our asp.net web applications, however we would like to make iPhone specific.
Are there any resources out there which provide best practice guidelines:
* UI Guidelines, any .net control libraries which are iPhone specific.
* Security guidelines - anything special that the iPhone Browser (mobile safari) has.
* Usability Guidelines - navigation tips, button sizes, etc.
Anything else which will help us put together an app which looks native to iPhone. | asp.net | iphone | null | null | null | null | open | Help on website optimization for iPhone
===
We re trying to work on making a mobile version for one of our asp.net web applications, however we would like to make iPhone specific.
Are there any resources out there which provide best practice guidelines:
* UI Guidelines, any .net control libraries which are iPhone specific.
* Security guidelines - anything special that the iPhone Browser (mobile safari) has.
* Usability Guidelines - navigation tips, button sizes, etc.
Anything else which will help us put together an app which looks native to iPhone. | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.