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
20,731
08/21/2008 18:35:57
25
08/01/2008 12:15:23
933
59
In C++, how do you clear a stringstream variable?
I've tried several things already, std::stringstream m; m.empty(); m.clear(); both of which don't work.
c++
c
null
null
null
null
open
In C++, how do you clear a stringstream variable? === I've tried several things already, std::stringstream m; m.empty(); m.clear(); both of which don't work.
0
20,734
08/21/2008 18:37:15
2,286
08/21/2008 13:42:59
48
6
Red-Black Trees
I've seen binary trees and binary searching mentioned in several books I've read lately, but as I'm still at the beginning of my studies in Computer Science, I've yet to take a class that's really dealt with algorithms and data structures in a serious way. I've checked around the typical sources (Wikipedia, Google) and most descriptions of the usefulness and implementation of (in particular) Red-Black trees have come off as dense and difficult to understand. I'm sure for someone with the necessary background, it makes perfect sense, but at the moment it reads like a foreign language almost. So what makes binary trees useful in some of the common tasks you find yourself doing while programming? Beyond that, which trees do you prefer to use (please include a sample implementation) and why?
algorithms
binary-tree
null
null
null
null
open
Red-Black Trees === I've seen binary trees and binary searching mentioned in several books I've read lately, but as I'm still at the beginning of my studies in Computer Science, I've yet to take a class that's really dealt with algorithms and data structures in a serious way. I've checked around the typical sources (Wikipedia, Google) and most descriptions of the usefulness and implementation of (in particular) Red-Black trees have come off as dense and difficult to understand. I'm sure for someone with the necessary background, it makes perfect sense, but at the moment it reads like a foreign language almost. So what makes binary trees useful in some of the common tasks you find yourself doing while programming? Beyond that, which trees do you prefer to use (please include a sample implementation) and why?
0
20,735
08/21/2008 18:37:31
2,328
08/21/2008 16:45:54
61
2
Useful Vim features
Vim is my editor of choice, and I feel I am above average is my use of it. I do recognize, though, that the feature list of vim is huge. With this in mind, I was wondering what features you vim users out there use on a regular basis.
softwaretools
vim
text-editor
vimtips
null
null
open
Useful Vim features === Vim is my editor of choice, and I feel I am above average is my use of it. I do recognize, though, that the feature list of vim is huge. With this in mind, I was wondering what features you vim users out there use on a regular basis.
0
20,744
08/21/2008 18:42:14
1,215
08/13/2008 13:32:36
31
1
SQL Reporting Services viewer for webpage - can you move the View Report button?
Using the viewer control for display of SQL Reporting Services reports on web page (Microsoft.ReportViewer.WebForms), can you move the View Report button? It defaults to the very right side of the report, which means you have to scroll all the way across before the button is visible. Not a problem for reports that fit the window width, but on very wide reports that is quickly an issue.
asp.net
reportviewer
sqlreportingservices
null
null
null
open
SQL Reporting Services viewer for webpage - can you move the View Report button? === Using the viewer control for display of SQL Reporting Services reports on web page (Microsoft.ReportViewer.WebForms), can you move the View Report button? It defaults to the very right side of the report, which means you have to scroll all the way across before the button is visible. Not a problem for reports that fit the window width, but on very wide reports that is quickly an issue.
0
20,762
08/21/2008 18:47:49
2,029
08/19/2008 21:21:52
16
5
How do you remove invalid hexedecimal characters from an XML-based data source prior to constructing an XmlReader or XPathDocument that uses the data?
Is there any easy/general way to clean an XML based data source prior to using it in an XmlReader so that I can gracefully consume XML data that is non-conformant to the hexadecimal character restrictions placed on XML? *Background:* I need to consume an XML-based data source that conforms to a specific format (think Atom or RSS feeds), but want to be able to consume data sources that have been published which contain invalid hexadecimal characters per the XML specification. In .NET if you have a Stream that represents the XML data source, and then attempt to parse it using an XmlReader and/or XPathDocument, an exception is raised due to the inclusion of invalid hexadecimal characters in the XML data. My current attempt to resolve this issue is to parse the Stream as a string and use a regular expression to remove and/or replace the invalid hexadecimal characters, but I am looking for a more performant solution.
xml
null
null
null
null
null
open
How do you remove invalid hexedecimal characters from an XML-based data source prior to constructing an XmlReader or XPathDocument that uses the data? === Is there any easy/general way to clean an XML based data source prior to using it in an XmlReader so that I can gracefully consume XML data that is non-conformant to the hexadecimal character restrictions placed on XML? *Background:* I need to consume an XML-based data source that conforms to a specific format (think Atom or RSS feeds), but want to be able to consume data sources that have been published which contain invalid hexadecimal characters per the XML specification. In .NET if you have a Stream that represents the XML data source, and then attempt to parse it using an XmlReader and/or XPathDocument, an exception is raised due to the inclusion of invalid hexadecimal characters in the XML data. My current attempt to resolve this issue is to parse the Stream as a string and use a regular expression to remove and/or replace the invalid hexadecimal characters, but I am looking for a more performant solution.
0
20,765
08/21/2008 18:49:01
1,194
08/13/2008 12:27:52
83
9
XRef Relationships in dbml
So I have a database schema like this: **Users**<br> UserId **RoleUserXRef**<br> RoleUserId<br> RoleId<br> UserId<br> **Roles**<br/> RoleId<br/> Name<br/> With foreign keys defined between User & RoleUserXRef and RoleUserXRef & Role. Basically, I have a one to many relationship between users and roles. How would I model this in dbml, such that the generated User class has a list of Roles that the user has assigned to them?
linq-to-sql
null
null
null
null
null
open
XRef Relationships in dbml === So I have a database schema like this: **Users**<br> UserId **RoleUserXRef**<br> RoleUserId<br> RoleId<br> UserId<br> **Roles**<br/> RoleId<br/> Name<br/> With foreign keys defined between User & RoleUserXRef and RoleUserXRef & Role. Basically, I have a one to many relationship between users and roles. How would I model this in dbml, such that the generated User class has a list of Roles that the user has assigned to them?
0
20,782
08/21/2008 18:55:15
1,360
08/14/2008 18:11:31
29
4
Call Project Server Interface web method from an msi installer
I'm using a Visual Studio web setup project to install an application that extends the functionality of Project Server. I want to call a method from the PSI (Project Server Interface) from one of the custom actions of my setup project, but every time a get a "401 Unauthorized access" error. What should I do to be able to access the PSI. The same code when used from a Console Application works without any issues.
msi
methods
action
null
null
null
open
Call Project Server Interface web method from an msi installer === I'm using a Visual Studio web setup project to install an application that extends the functionality of Project Server. I want to call a method from the PSI (Project Server Interface) from one of the custom actions of my setup project, but every time a get a "401 Unauthorized access" error. What should I do to be able to access the PSI. The same code when used from a Console Application works without any issues.
0
20,787
08/21/2008 18:57:59
381
08/05/2008 10:39:26
1,194
23
When to use stl bitsets instead of separate variables
In what situation would it be more appropriate for me to use a bitset (stl container) to manage a set of flags rather than having them declared as a number of separate (bool) variables ? Will I get a significant performance gain if I used a bitset for 50 flags rather than using 50 separate bool variables ?
c++
performance
stdlib
null
null
null
open
When to use stl bitsets instead of separate variables === In what situation would it be more appropriate for me to use a bitset (stl container) to manage a set of flags rather than having them declared as a number of separate (bool) variables ? Will I get a significant performance gain if I used a bitset for 50 flags rather than using 50 separate bool variables ?
0
20,788
08/21/2008 18:58:51
2,134
08/20/2008 13:58:24
94
8
What tools do you use for static code analysis?
[This question][1] on [Cyclomatic Complexity][2] made me think more about [static code analysis][3]. Analyzing code complexity and consistency is occasionally useful, and I'd like to start doing it more. What tools do you recommend (per language) for such analysis? [Wikipedia][4] has a large list of tools, but which ones have people tried before? [1]: http://stackoverflow.com/questions/20702/whats-youra-good-limit-for-cyclomatic-complexity [2]: http://en.wikipedia.org/wiki/Cyclomatic_complexity [3]: http://en.wikipedia.org/wiki/Static_code_analysis [4]: http://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis
complexity
code-analysis
null
null
null
null
open
What tools do you use for static code analysis? === [This question][1] on [Cyclomatic Complexity][2] made me think more about [static code analysis][3]. Analyzing code complexity and consistency is occasionally useful, and I'd like to start doing it more. What tools do you recommend (per language) for such analysis? [Wikipedia][4] has a large list of tools, but which ones have people tried before? [1]: http://stackoverflow.com/questions/20702/whats-youra-good-limit-for-cyclomatic-complexity [2]: http://en.wikipedia.org/wiki/Cyclomatic_complexity [3]: http://en.wikipedia.org/wiki/Static_code_analysis [4]: http://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis
0
20,791
08/21/2008 19:00:04
2,348
08/21/2008 19:00:04
1
0
How do I set up a test cert for an SSL connection in .NET?
I would like to create an SSL connection for generic TCP communication. I think I figured out how to do it in the code, using the info here: http://msdn.microsoft.com/en-us/library/system.net.security.sslstream.aspx What I'm having trouble with is creating a cert so I can test this out. I tried makecert.exe testCert, and that created a cert, but apparently it doesn't have a private key associated with it. So what I'm looking for is the simplest procedure to create a cert and get the connection to work.
.net
null
null
null
null
null
open
How do I set up a test cert for an SSL connection in .NET? === I would like to create an SSL connection for generic TCP communication. I think I figured out how to do it in the code, using the info here: http://msdn.microsoft.com/en-us/library/system.net.security.sslstream.aspx What I'm having trouble with is creating a cert so I can test this out. I tried makecert.exe testCert, and that created a cert, but apparently it doesn't have a private key associated with it. So what I'm looking for is the simplest procedure to create a cert and get the connection to work.
0
20,794
08/21/2008 19:00:52
1,892
08/19/2008 06:17:29
92
7
Find broken symlinks with Python.
If I call os.stat() on a broken symlink, python throws an OSError exception. This makes it useful for finding them. However, there are a few other reasons that os.stat() might throw a similar exception. Is there a more precise way of detecting broken symlinks with Python under Linux?
python
linux
null
null
null
null
open
Find broken symlinks with Python. === If I call os.stat() on a broken symlink, python throws an OSError exception. This makes it useful for finding them. However, there are a few other reasons that os.stat() might throw a similar exception. Is there a more precise way of detecting broken symlinks with Python under Linux?
0
20,797
08/21/2008 19:01:28
1,048
08/11/2008 19:34:31
40
8
How to split a byte array
I have a byte array in memory, read from a file. I would like to split the byte array at a certain point(index) without having to just create a new byte array and copy each byte at a time, increasing the in memory foot print of the operation. What I would like is something like this: >byte[] largeBytes = [1,2,3,4,5,6,7,8,9]; byte[] smallPortion; smallPortion = split(largeBytes, 3); >smallPortion would equal 1,2,3,4 largeBytes would equal 5,6,7,8,9 Thank you, Keith
array
split
null
null
null
null
open
How to split a byte array === I have a byte array in memory, read from a file. I would like to split the byte array at a certain point(index) without having to just create a new byte array and copy each byte at a time, increasing the in memory foot print of the operation. What I would like is something like this: >byte[] largeBytes = [1,2,3,4,5,6,7,8,9]; byte[] smallPortion; smallPortion = split(largeBytes, 3); >smallPortion would equal 1,2,3,4 largeBytes would equal 5,6,7,8,9 Thank you, Keith
0
20,811
08/21/2008 19:05:20
1,340
08/14/2008 15:25:59
11
2
Automate Syncing Oracle Tables With MySQL Tables
The university I work at uses Oracle for the database system. We currently have programs we run at night to download what we need into some local Access tables for our testing needs. Access is getting to small for this now and we need something bigger. Also, the nightly jobs require constant maintance to keep working (because of network issues, table changes, bad code :) ) and I would like to eliminate them to free us up for more important things. I am most familiar with MySQL so I setup a test MySQL server. What is the best way to automate copying the needed tables from Oracle to MySQL?
database
mysql
oracle
null
null
null
open
Automate Syncing Oracle Tables With MySQL Tables === The university I work at uses Oracle for the database system. We currently have programs we run at night to download what we need into some local Access tables for our testing needs. Access is getting to small for this now and we need something bigger. Also, the nightly jobs require constant maintance to keep working (because of network issues, table changes, bad code :) ) and I would like to eliminate them to free us up for more important things. I am most familiar with MySQL so I setup a test MySQL server. What is the best way to automate copying the needed tables from Oracle to MySQL?
0
20,814
08/21/2008 19:05:34
1,490
08/15/2008 21:35:24
123
22
How to move a item from one menu to another?
In the Visual Studio designer, how do you move a menu item from one menu to another? I would assume DnD would work, but it seems to only work within a menu for me. I usually resort to editing the .Designer.cs files by hand.
c#
winforms
vs2005
null
null
null
open
How to move a item from one menu to another? === In the Visual Studio designer, how do you move a menu item from one menu to another? I would assume DnD would work, but it seems to only work within a menu for me. I usually resort to editing the .Designer.cs files by hand.
0
20,821
08/21/2008 19:08:01
1,363
08/14/2008 18:24:19
38
2
SQL 2005 Reporting Services custom controls - what are the limits?
Reading MSDN (and other sources) about custom controls for reporting services 2005. It looks like I'm limited to generating a bitmap. Not even with some mapping overlay for detecting mouse clicks on it. Is there away to go around this? There are two things I would like to do: - Embed HTML directly into the report, to format dynamic text. - Embed flash (swf) control in the report. This could be done with HTML if the previous point is possible. But maybe there is another way Any suggestions? What am I missing?
mssql
reporting-services
sqlreportingservices
null
null
null
open
SQL 2005 Reporting Services custom controls - what are the limits? === Reading MSDN (and other sources) about custom controls for reporting services 2005. It looks like I'm limited to generating a bitmap. Not even with some mapping overlay for detecting mouse clicks on it. Is there away to go around this? There are two things I would like to do: - Embed HTML directly into the report, to format dynamic text. - Embed flash (swf) control in the report. This could be done with HTML if the previous point is possible. But maybe there is another way Any suggestions? What am I missing?
0
20,840
08/21/2008 19:12:59
357
08/05/2008 01:29:23
887
59
SQL Server - Dirty Reads Pros & Cons
Why should I or shouldn't I use dirty reads: set transaction isolation level read uncommitted in SQL Server?
sql
sql-server
null
null
null
null
open
SQL Server - Dirty Reads Pros & Cons === Why should I or shouldn't I use dirty reads: set transaction isolation level read uncommitted in SQL Server?
0
20,841
08/21/2008 19:13:00
179
08/03/2008 02:38:27
89
5
DCOM: CoCreateInstanceEx returns E_ACCESSDENIED
I'm working on a DCOM application with the server and client on two machines, both of which are running WinXP with Service Pack 2. On both machines, I'm logged in with the same username and password. When the client on one machine calls CoCreateInstanceEx, asking the other machine to start up the server application, it returns E_ACCESSDENIED. I tried going into the server app's component properties in dcomcnfg and giving full permisions to everyone for everything, but that didn't help. What do I need to do to allow this call to succeed?
dcom
security
winxp
null
null
null
open
DCOM: CoCreateInstanceEx returns E_ACCESSDENIED === I'm working on a DCOM application with the server and client on two machines, both of which are running WinXP with Service Pack 2. On both machines, I'm logged in with the same username and password. When the client on one machine calls CoCreateInstanceEx, asking the other machine to start up the server application, it returns E_ACCESSDENIED. I tried going into the server app's component properties in dcomcnfg and giving full permisions to everyone for everything, but that didn't help. What do I need to do to allow this call to succeed?
0
20,850
08/21/2008 19:16:27
1,120
08/12/2008 13:45:53
241
13
How to Stop NTFS volume auto-mounting on OS X
I'm a bit newbieish when it comes to the deeper parts of OSX configuration and am having to put up with a fairly irritating niggle which while I can put up with it, I know under Windows I could have sorted in minutes. Basically, I have an external disk with two volumes: One is an HFS+ volume which I use for TimeMachine backups. The other, an NTFS volume that I use for general file copying etc on Mac and Windows boxes. So what happens is that whenever I plug in the disk into my Mac USB, OSX goes off and mounts both volumes and shows an icon on the desktop for each. The thing is that to remove the disk you have to eject the volume and in this case do it for both volumes, which causes an annoying warning dialog to be shown every time. What I'd prefer is some way to prevent the NTFS volume from auto-mounting altogether. I've done some hefty googling and here's a list of things I've tried so far: - I've tried going through options in Disk Utility - I've tried setting AutoMount to No in /etc/hostconfig but that is a bit too global for my liking. - I've also tried the suggested approach to putting settings in fstab but it appears the OSX (10.5) is ignoring these settings. Any other suggestions would be welcomed. Just a little dissapointed that I can't just tick a box somewhere (or untick).
osx
hardware
null
null
null
null
open
How to Stop NTFS volume auto-mounting on OS X === I'm a bit newbieish when it comes to the deeper parts of OSX configuration and am having to put up with a fairly irritating niggle which while I can put up with it, I know under Windows I could have sorted in minutes. Basically, I have an external disk with two volumes: One is an HFS+ volume which I use for TimeMachine backups. The other, an NTFS volume that I use for general file copying etc on Mac and Windows boxes. So what happens is that whenever I plug in the disk into my Mac USB, OSX goes off and mounts both volumes and shows an icon on the desktop for each. The thing is that to remove the disk you have to eject the volume and in this case do it for both volumes, which causes an annoying warning dialog to be shown every time. What I'd prefer is some way to prevent the NTFS volume from auto-mounting altogether. I've done some hefty googling and here's a list of things I've tried so far: - I've tried going through options in Disk Utility - I've tried setting AutoMount to No in /etc/hostconfig but that is a bit too global for my liking. - I've also tried the suggested approach to putting settings in fstab but it appears the OSX (10.5) is ignoring these settings. Any other suggestions would be welcomed. Just a little dissapointed that I can't just tick a box somewhere (or untick).
0
20,852
08/21/2008 19:16:51
1,164,871
08/17/2008 19:40:24
11
5
Cross platform file-access tracking
I'd like to be able to track file read/writes of specific program invocations. No information about the actual transactions is required, just the file names involved. Is there a cross platform solution to this? What are various platform specific methods? On linux I know there's strace/ptrace (if there are faster methods that'd be good too). I think on mac os there's ktrace. What about windows? Also, it would be amazing if it would be possible to block (stall out) file accesses until some later time. Thanks!
filesystems
crossplatform
ptrace
null
null
null
open
Cross platform file-access tracking === I'd like to be able to track file read/writes of specific program invocations. No information about the actual transactions is required, just the file names involved. Is there a cross platform solution to this? What are various platform specific methods? On linux I know there's strace/ptrace (if there are faster methods that'd be good too). I think on mac os there's ktrace. What about windows? Also, it would be amazing if it would be possible to block (stall out) file accesses until some later time. Thanks!
0
20,853
08/21/2008 19:16:55
2,260
08/21/2008 11:39:22
47
4
DarwinPorts or Fink?
Which do you use? I am just in the process of installing sqlite3 from DarwinPorts (mac version is 3.1.3 and python 2.5 seems to be linked to a newer version, fileformat is new...) and have to download all the tools I'm sure fink allready knows about *again* = so far I have allways found everything with fink... Which of the two do you use? Both? Are there any problems with using both side by side?
mac
osx
null
null
null
null
open
DarwinPorts or Fink? === Which do you use? I am just in the process of installing sqlite3 from DarwinPorts (mac version is 3.1.3 and python 2.5 seems to be linked to a newer version, fileformat is new...) and have to download all the tools I'm sure fink allready knows about *again* = so far I have allways found everything with fink... Which of the two do you use? Both? Are there any problems with using both side by side?
0
20,856
08/21/2008 19:18:05
459
08/05/2008 21:54:42
58
12
How do you recommend implementing tags or tagging
I've heard of a few ways to implement tagging; using a mapping table between TagID and ItemID (makes sense to me, but does it scale?), adding a fixed number of possible TagID columns to ItemID (seems like a bad idea), Keeping tags in a text column that's comma separated (sounds crazy but could work). I've even heard someone recommend a sparse matrix, but then how do the tag names grow gracefully? Am I missing a best practice for tags?
tags
null
null
null
null
null
open
How do you recommend implementing tags or tagging === I've heard of a few ways to implement tagging; using a mapping table between TagID and ItemID (makes sense to me, but does it scale?), adding a fixed number of possible TagID columns to ItemID (seems like a bad idea), Keeping tags in a text column that's comma separated (sounds crazy but could work). I've even heard someone recommend a sparse matrix, but then how do the tag names grow gracefully? Am I missing a best practice for tags?
0
20,861
08/21/2008 19:19:47
1,436
08/15/2008 15:43:19
380
19
Automated Web Service Testing
I would like to do some integration testing of my web services from NUnit or MBUnit. I haven't delved into this too deeply yet, but the problem seems to be that I would have to spin up WebDev.WebServer.exe within the "unit test" to do this. (I know it's not really a unit test). I can test the underlying objects the web service uses on their own, but what I am interested in testing in this cases is making sure the proxies are all working as expected, etc. Any advice?
unittesting
integration-testing
webservices
null
null
null
open
Automated Web Service Testing === I would like to do some integration testing of my web services from NUnit or MBUnit. I haven't delved into this too deeply yet, but the problem seems to be that I would have to spin up WebDev.WebServer.exe within the "unit test" to do this. (I know it's not really a unit test). I can test the underlying objects the web service uses on their own, but what I am interested in testing in this cases is making sure the proxies are all working as expected, etc. Any advice?
0
20,880
08/21/2008 19:26:44
75
08/01/2008 15:54:25
310
22
Java JPanel redraw issues
I have a Java swing application with a panel that contains three JComboBoxes that do not draw properly. The combox boxes just show up as the down arrow on the right side, but without the label of the currently selected value. The boxes will redraw correctly if the window is resized either bigger or smaller by even one pixel. All of my googling has pointed to calling revalidate() on the JPanel to fix this, but that hasn't worked for me. Calling updateUI() on the JPanel has changed it from always displaying incorrectly to displaying incorrectly half of the time. Has anyone else seen this and found a different way to force a redraw of the combo boxes? The code displays this error when the client JRE is either Windows JRE 1.6.0_06 or Windows JRE 1.6.0_07 but it works if the client is Linux JRE 1.6.0_06 or Windows JRE 1.5.0_15, which leads me to believe that this may just be a bug in the JRE, but I'm hoping that's not the case.
java
swing
null
null
null
null
open
Java JPanel redraw issues === I have a Java swing application with a panel that contains three JComboBoxes that do not draw properly. The combox boxes just show up as the down arrow on the right side, but without the label of the currently selected value. The boxes will redraw correctly if the window is resized either bigger or smaller by even one pixel. All of my googling has pointed to calling revalidate() on the JPanel to fix this, but that hasn't worked for me. Calling updateUI() on the JPanel has changed it from always displaying incorrectly to displaying incorrectly half of the time. Has anyone else seen this and found a different way to force a redraw of the combo boxes? The code displays this error when the client JRE is either Windows JRE 1.6.0_06 or Windows JRE 1.6.0_07 but it works if the client is Linux JRE 1.6.0_06 or Windows JRE 1.5.0_15, which leads me to believe that this may just be a bug in the JRE, but I'm hoping that's not the case.
0
20,882
08/21/2008 19:26:48
1,946
08/19/2008 14:53:06
86
3
How do I interpret 'netstat -a' output
Some things look strange to me: - What is the distinction between 0.0.0.0, 127.0.0.1, and [::]? - How should each part of the foreign address be read (part1:part2)? - What does a state Time_Wait, Close_Wait mean? - etc. Could someone give a quick overview of how to interpret these results?
netstat
networking
administration
null
null
null
open
How do I interpret 'netstat -a' output === Some things look strange to me: - What is the distinction between 0.0.0.0, 127.0.0.1, and [::]? - How should each part of the foreign address be read (part1:part2)? - What does a state Time_Wait, Close_Wait mean? - etc. Could someone give a quick overview of how to interpret these results?
0
20,899
08/21/2008 19:29:47
1,042
08/11/2008 18:02:48
259
32
My VMware ESX server console volume went readonly. How can I save my VMs?
Two RAID volumes, VMware kernel/console running on a RAID1, vmdks live on a RAID5. Entering a login at the console just results in SCSI errors, no password prompt. Praise be, the VMs are actually still running. We're thinking, though, that upon reboot the kernel may not start again and the VMs will be down. We have database and disk backups of the VMs, but not backups of the vmdks themselves. What are my options? Our current best idea is 1. Use VMware Converter to create live vmdks from the running VMs, as if it was a P2V migration. 2. Reboot host server and run RAID diagnostics, figure out what in the "h" happened 3. Attempt to start ESX again, possibly after rebuilding its RAID volume 4. Possibly have to re-install ESX on its volume and re-attach VMs 5. If that doesn't work, attach the "live" vmdks created in step 1 to a different VM host.
vmware
recovery
esx
null
null
null
open
My VMware ESX server console volume went readonly. How can I save my VMs? === Two RAID volumes, VMware kernel/console running on a RAID1, vmdks live on a RAID5. Entering a login at the console just results in SCSI errors, no password prompt. Praise be, the VMs are actually still running. We're thinking, though, that upon reboot the kernel may not start again and the VMs will be down. We have database and disk backups of the VMs, but not backups of the vmdks themselves. What are my options? Our current best idea is 1. Use VMware Converter to create live vmdks from the running VMs, as if it was a P2V migration. 2. Reboot host server and run RAID diagnostics, figure out what in the "h" happened 3. Attempt to start ESX again, possibly after rebuilding its RAID volume 4. Possibly have to re-install ESX on its volume and re-attach VMs 5. If that doesn't work, attach the "live" vmdks created in step 1 to a different VM host.
0
20,910
08/21/2008 19:34:00
1,226
08/13/2008 13:55:55
91
8
Silverlight vs Flex
My company develops several types of applications. A lot of our business comes from doing multimedia-type apps, typically done in Flash. However, now that side of the house is starting to migrate towards doing Flex development. Most of our other development is done using .NET. I'm trying to make a push towards doing Silverlight development instead, since it would take better advantage of the .NET developers on staff. So here's my question: If I'm going to go into a meeting to praise Silverlight, why would a company want to go with Silverlight instead of Flex?
silverlight
flex
.net
c#
flash
null
open
Silverlight vs Flex === My company develops several types of applications. A lot of our business comes from doing multimedia-type apps, typically done in Flash. However, now that side of the house is starting to migrate towards doing Flex development. Most of our other development is done using .NET. I'm trying to make a push towards doing Silverlight development instead, since it would take better advantage of the .NET developers on staff. So here's my question: If I'm going to go into a meeting to praise Silverlight, why would a company want to go with Silverlight instead of Flex?
0
20,912
08/21/2008 19:34:47
1,372
08/14/2008 21:03:27
1
1
Veritas Backup Exec 11d RALUS Communications Error
I'm trying to do a file system backup of a RedHat Enterprise Linux v4 server using Symantec Backup Exec 11d (Rev 7170). The backup server is Windows Server 2003. I can browse the target server to create a selection list, and when I do a test run it completes successfully. However, when I run a real backup, the job fails immediately during the "processing" phase with the error: *e000fe30 - A communications failure has occured.* I've tried opening ports (10000, 1025-9999), etc. But no joy. Any ideas?
backup
backupexec
redhat
symantec
null
null
open
Veritas Backup Exec 11d RALUS Communications Error === I'm trying to do a file system backup of a RedHat Enterprise Linux v4 server using Symantec Backup Exec 11d (Rev 7170). The backup server is Windows Server 2003. I can browse the target server to create a selection list, and when I do a test run it completes successfully. However, when I run a real backup, the job fails immediately during the "processing" phase with the error: *e000fe30 - A communications failure has occured.* I've tried opening ports (10000, 1025-9999), etc. But no joy. Any ideas?
0
20,922
08/21/2008 19:39:43
1,782
08/18/2008 14:30:58
329
27
Do you comment your code?
I usually comment "ifs" and write in "human language" what it means, like "checks if it's A or B". I find it's better for junior programmers that read teh code to read what it means first and then analyse the statement (also for me when I'm checking old code) What do you do? What about other scenarios? Pros? Cons?
comments
null
null
null
null
null
open
Do you comment your code? === I usually comment "ifs" and write in "human language" what it means, like "checks if it's A or B". I find it's better for junior programmers that read teh code to read what it means first and then analyse the statement (also for me when I'm checking old code) What do you do? What about other scenarios? Pros? Cons?
0
20,923
08/21/2008 19:39:44
636
08/07/2008 12:32:33
278
22
VBScript/IIS - How do I automatically set ASP.NET version for a particular website
I need to script the creation of app pools and websites on IIS 6.0. I have been able to create these using adsutil.vbs and iisweb.vbs, but don't know how to set the version of ASP.NET for the sites I have just created to 2.0.50727.0. Ideally I would like to adsutil.vbs to update the metabase. How do I do this?
iis
aspnet
vbscript
sysadmin
administration
null
open
VBScript/IIS - How do I automatically set ASP.NET version for a particular website === I need to script the creation of app pools and websites on IIS 6.0. I have been able to create these using adsutil.vbs and iisweb.vbs, but don't know how to set the version of ASP.NET for the sites I have just created to 2.0.50727.0. Ideally I would like to adsutil.vbs to update the metabase. How do I do this?
0
20,926
08/21/2008 19:41:07
2,078
08/20/2008 08:00:36
43
8
Nesting HTML- anchor tags
Today I was working on a tab navigation for a webpage. I tried the [Sliding Doors][1] approach which worked fine. Then I realized that I must include an option to delete a tab (usually a small X in the right corner of each tab). I wanted to use a nested anchor, which didn't work because it is [not][2] allowed. Then I saw the tab- navigation at [Pageflakes][3], which was actually working (including nested hyperlinks). Why? [1]: http://www.alistapart.com/d/slidingdoors2/ [2]: http://www.w3.org/TR/html4/struct/links.html#h-12.2.2 [3]: http://www.pageflakes.com
html
anchor
tabs
null
null
null
open
Nesting HTML- anchor tags === Today I was working on a tab navigation for a webpage. I tried the [Sliding Doors][1] approach which worked fine. Then I realized that I must include an option to delete a tab (usually a small X in the right corner of each tab). I wanted to use a nested anchor, which didn't work because it is [not][2] allowed. Then I saw the tab- navigation at [Pageflakes][3], which was actually working (including nested hyperlinks). Why? [1]: http://www.alistapart.com/d/slidingdoors2/ [2]: http://www.w3.org/TR/html4/struct/links.html#h-12.2.2 [3]: http://www.pageflakes.com
0
20,927
08/21/2008 19:41:57
1,914
08/19/2008 14:10:15
61
6
updating an auto_now DateTimeField in a parent model w/ Django
I've got two models: Message and Attachment. Each attachment is attached to a specific message, using a ForeignKey on the Attachment model. Both models have an auto_now DateTimeField called updated. I'm trying to make it so that when any attachment is saved, it also sets the updated field on the associated message to now. Here's my code: def save(self): super(Attachment, self).save() self.message.updated = self.updated Will this work, and if you can explain it to me, why? If not, how would I accomplish this?
database
orm
django
null
null
null
open
updating an auto_now DateTimeField in a parent model w/ Django === I've got two models: Message and Attachment. Each attachment is attached to a specific message, using a ForeignKey on the Attachment model. Both models have an auto_now DateTimeField called updated. I'm trying to make it so that when any attachment is saved, it also sets the updated field on the associated message to now. Here's my code: def save(self): super(Attachment, self).save() self.message.updated = self.updated Will this work, and if you can explain it to me, why? If not, how would I accomplish this?
0
20,952
08/21/2008 19:49:31
2,338
08/21/2008 17:23:25
1
0
Is there a way to get a System.Configuration.Configuration instance based on arbitrary xml?
I'm trying to unit test a custom ConfigurationSection I've written, and I'd like to load some arbitrary configuration XML into a [System.Configuration.Configuration](http://msdn.microsoft.com/en-us/library/system.configuration.configuration.aspx) for each test (rather than put the test configuration xml in the Tests.dll.config file. That is, I'd like to do something like this: Configuration testConfig = new Configuration("<?xml version=\"1.0\"?><configuration>...</configuration>"); MyCustomConfigSection section = testConfig.GetSection("mycustomconfigsection"); Assert.That(section != null); However, it looks like [ConfigurationManager](http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.aspx) will only give you Configuration instances that are associated with an EXE file or a machine config. Is there a way to load arbitrary XML into a Configuration instance?
c#
.net
testing
configuration
configurationmanager
null
open
Is there a way to get a System.Configuration.Configuration instance based on arbitrary xml? === I'm trying to unit test a custom ConfigurationSection I've written, and I'd like to load some arbitrary configuration XML into a [System.Configuration.Configuration](http://msdn.microsoft.com/en-us/library/system.configuration.configuration.aspx) for each test (rather than put the test configuration xml in the Tests.dll.config file. That is, I'd like to do something like this: Configuration testConfig = new Configuration("<?xml version=\"1.0\"?><configuration>...</configuration>"); MyCustomConfigSection section = testConfig.GetSection("mycustomconfigsection"); Assert.That(section != null); However, it looks like [ConfigurationManager](http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.aspx) will only give you Configuration instances that are associated with an EXE file or a machine config. Is there a way to load arbitrary XML into a Configuration instance?
0
20,958
08/21/2008 19:50:42
437
08/05/2008 18:13:45
1,356
42
List of standard lengths for database fields
I'm designing a database table and once again asking myself the same stupid question: **How long should the firstname field be?** Does anyone have a list of reasonable lengths for the most common fields, such as first name, last name, and email address?
database
standards
null
null
null
null
open
List of standard lengths for database fields === I'm designing a database table and once again asking myself the same stupid question: **How long should the firstname field be?** Does anyone have a list of reasonable lengths for the most common fields, such as first name, last name, and email address?
0
20,959
08/21/2008 19:50:44
1,490
08/15/2008 21:35:24
123
22
Determine Loaded Assemblies
How can I determine all of the assemblies that my .NET desktop application has loaded? I'd like to put them in the about box so I can query customers over the phone to determine what version of XYZ they have on their PC. It would be nice to see both managed and unmanaged assemblies. I realize the list will get long but I plat to slap an incremental search on it.
.net
winforms
dll
assembly
null
null
open
Determine Loaded Assemblies === How can I determine all of the assemblies that my .NET desktop application has loaded? I'd like to put them in the about box so I can query customers over the phone to determine what version of XYZ they have on their PC. It would be nice to see both managed and unmanaged assemblies. I realize the list will get long but I plat to slap an incremental search on it.
0
20,981
08/21/2008 19:56:58
2,134
08/20/2008 13:58:24
124
9
How many lines of code is too many?
One thing that occasionally drives me crazy is reading another person's functions that span 5 vertical monitor lengths, or .cpp files that are over 2000 lines long. For readability, wouldn't it be better to break a 1000 line function into many smaller sub-functions called by one function? Shouldn't a class implementation not span an inordinately huge number of lines? When should you start breaking functionality up into sub-classes or utility classes? Is it unreasonable for me to be so put off by excessively large files/functions? And, if I am not in the wrong, how should I approach a colleague to convince them to refactor their code?
codingstyle
bestpractices
language-agnostic
rant
null
06/26/2011 18:36:15
not constructive
How many lines of code is too many? === One thing that occasionally drives me crazy is reading another person's functions that span 5 vertical monitor lengths, or .cpp files that are over 2000 lines long. For readability, wouldn't it be better to break a 1000 line function into many smaller sub-functions called by one function? Shouldn't a class implementation not span an inordinately huge number of lines? When should you start breaking functionality up into sub-classes or utility classes? Is it unreasonable for me to be so put off by excessively large files/functions? And, if I am not in the wrong, how should I approach a colleague to convince them to refactor their code?
4
20,993
08/21/2008 19:59:57
1,610
08/17/2008 14:28:50
1
0
Storing logged in user details
When creating a web application, and lets say you have a User object denoting a single user, what do you think is the best way to store that the user has logged in? Two ways I've thought about have been: * Stored the user database id in a session variable * Stored the entire user object in a session variable Any better suggestions, any issues with using the above ways? Perhaps security issues or memory issues, etc, etc.
bestpractices
web-application
null
null
null
null
open
Storing logged in user details === When creating a web application, and lets say you have a User object denoting a single user, what do you think is the best way to store that the user has logged in? Two ways I've thought about have been: * Stored the user database id in a session variable * Stored the entire user object in a session variable Any better suggestions, any issues with using the above ways? Perhaps security issues or memory issues, etc, etc.
0
20,998
08/21/2008 20:00:59
76
08/01/2008 15:56:38
86
6
Cannot Add a Sql Server Login
When I try to create a SQL Server Login by saying CREATE LOGIN [ourdomain\SQLAccessGroup] FROM WINDOWS; I get this error The server principal 'ourdomain\SQLAccessGroup' already exists. However, when I try this code DROP LOGIN [ourdomain\SQLAccessGroup] I get this error Cannot drop the login 'ourdomain\SQLAccessGroup', because it does not exist or you do not have permission. The user that I am executing this code as is a sysadmin. Additionally, the user ourdomain\SQLAccessGroup does not show up in this query select * from sys.server_principals Does anyone have any ideas?
sql-server-2005
administration
null
null
null
null
open
Cannot Add a Sql Server Login === When I try to create a SQL Server Login by saying CREATE LOGIN [ourdomain\SQLAccessGroup] FROM WINDOWS; I get this error The server principal 'ourdomain\SQLAccessGroup' already exists. However, when I try this code DROP LOGIN [ourdomain\SQLAccessGroup] I get this error Cannot drop the login 'ourdomain\SQLAccessGroup', because it does not exist or you do not have permission. The user that I am executing this code as is a sysadmin. Additionally, the user ourdomain\SQLAccessGroup does not show up in this query select * from sys.server_principals Does anyone have any ideas?
0
21,027
08/21/2008 20:07:59
2,277
08/21/2008 12:56:17
1
1
Changing ctrl+tab behavior for moving between document in Visual Studio
Is it possible to change how **ctrl+tab** and **shift+ctrl+tab** work in Visual Studio? I have disabled the popup navigator window because I only want to switch between items in the tab control. My problem is the inconsistency of what switching to the next and previous document do. Every other program that uses a tab control for open document I have seen uses **ctrl+tab** to move from left to right and **shift+ctrl+tab** to go right to left. Visual Studio breaks this with it's jump to the last tab selected. You can never know what document you will end up on and it is never the same way twice. It is very counter intuitive. Is this a subtle way to encourage everyone to only ever have two document open at once?
visual-studio
workenvironment
null
null
null
null
open
Changing ctrl+tab behavior for moving between document in Visual Studio === Is it possible to change how **ctrl+tab** and **shift+ctrl+tab** work in Visual Studio? I have disabled the popup navigator window because I only want to switch between items in the tab control. My problem is the inconsistency of what switching to the next and previous document do. Every other program that uses a tab control for open document I have seen uses **ctrl+tab** to move from left to right and **shift+ctrl+tab** to go right to left. Visual Studio breaks this with it's jump to the last tab selected. You can never know what document you will end up on and it is never the same way twice. It is very counter intuitive. Is this a subtle way to encourage everyone to only ever have two document open at once?
0
21,052
08/21/2008 20:20:22
392
08/05/2008 12:29:07
546
32
"using" namespace equivalent in ASP.NET markup
When I'm working with DataBound controls in ASP.NET 2.0 such as a Repeater, I know the fastest way to retrieve a property of a bound object (instead of using Reflection with the Eval() function) is to cast the DataItem object to the type it is and then use that object natively, like the following: <%#((MyType)Container.DataItem).PropertyOfMyType%> The problem is, if this type is in a namespace (which is the case 99.99% of the time) then this single statement because a lot longer due to the fact that the ASP page has no concept of class scope so all of my types need to be fully qualified. <%#((RootNamespace.SubNamespace1.SubNamspace2.SubNamespace3.MyType)Container.DataItem).PropertyOfMyType%> Is there any kind of "using" directive or some equivalent I could place somewhere in an ASP.NET page so I don't need to use the full namespace every time?
asp.net
null
null
null
null
null
open
"using" namespace equivalent in ASP.NET markup === When I'm working with DataBound controls in ASP.NET 2.0 such as a Repeater, I know the fastest way to retrieve a property of a bound object (instead of using Reflection with the Eval() function) is to cast the DataItem object to the type it is and then use that object natively, like the following: <%#((MyType)Container.DataItem).PropertyOfMyType%> The problem is, if this type is in a namespace (which is the case 99.99% of the time) then this single statement because a lot longer due to the fact that the ASP page has no concept of class scope so all of my types need to be fully qualified. <%#((RootNamespace.SubNamespace1.SubNamspace2.SubNamespace3.MyType)Container.DataItem).PropertyOfMyType%> Is there any kind of "using" directive or some equivalent I could place somewhere in an ASP.NET page so I don't need to use the full namespace every time?
0
21,060
08/21/2008 20:22:50
1,782
08/18/2008 14:30:58
364
30
Is there any way to configure windows to not change the focus?
I'm tired of being typing something, having a pop-up with a question appear, and hitting enter before reading it... (it also happens with some windows that are not pop-ups) Do you know if there's some setting I could touch for this not to happen?
windows
tips-and-tricks
null
null
null
null
open
Is there any way to configure windows to not change the focus? === I'm tired of being typing something, having a pop-up with a question appear, and hitting enter before reading it... (it also happens with some windows that are not pop-ups) Do you know if there's some setting I could touch for this not to happen?
0
21,078
08/21/2008 20:27:15
2,358
08/21/2008 20:22:15
1
0
What's the best string concatenation method using C#?
What's the most efficient way to concatenate strings?
c#
efficiency
concatenation
null
null
null
open
What's the best string concatenation method using C#? === What's the most efficient way to concatenate strings?
0
21,091
08/21/2008 20:29:48
1,793
08/18/2008 15:34:34
198
3
Do you use MDA/MDD/MDSD, any kind of model-driven approach? Will it be the future?
Programming languages had several (r)evolutionary steps in their history. Some people argue that model-driven approaches will be The Next Big Thing. There are tools like openArchitectureWare, AndroMDA, Sculptor/Fornax Platform etc. that promise incredible productivity boosts. However, I made the experience that it is either rather easy in the beginning to get started but as well to get stuck at some point when you try something that was unanticipated or pretty hard to find enough information that tells you how to start your project because there may be a lot of things to consider. I think an important insight to get anything out of model-driven something is to understand that the model is not necessarily a set of nice pictures or tree model or UML, but may as well be a textual description (e.g. a state machine, business rules etc.). What do you think and what does your experience tell you? Is there a future for model-driven development (or whatever you may want to call it)?
paradigms
model-driven
null
null
null
null
open
Do you use MDA/MDD/MDSD, any kind of model-driven approach? Will it be the future? === Programming languages had several (r)evolutionary steps in their history. Some people argue that model-driven approaches will be The Next Big Thing. There are tools like openArchitectureWare, AndroMDA, Sculptor/Fornax Platform etc. that promise incredible productivity boosts. However, I made the experience that it is either rather easy in the beginning to get started but as well to get stuck at some point when you try something that was unanticipated or pretty hard to find enough information that tells you how to start your project because there may be a lot of things to consider. I think an important insight to get anything out of model-driven something is to understand that the model is not necessarily a set of nice pictures or tree model or UML, but may as well be a textual description (e.g. a state machine, business rules etc.). What do you think and what does your experience tell you? Is there a future for model-driven development (or whatever you may want to call it)?
0
21,133
08/21/2008 20:40:38
305
08/04/2008 14:04:19
446
33
Simplest way to profile a PHP script
What's the easiest way to profile a PHP script? I'd love tacking something on that shows me a dump of all function calls and how long they took but I'm also OK with putting something around specific functions. I tried experimenting with the [microtime](http://us3.php.net/manual/en/function.microtime.php) function: $then = microtime(); myFunc(); $now = microtime(); echo sprintf("Elapsed: %f", $now-$then); but that sometimes gives me negative results. Plus it's a lot of trouble to sprinkle that all over my code.
profiling
php
null
null
null
null
open
Simplest way to profile a PHP script === What's the easiest way to profile a PHP script? I'd love tacking something on that shows me a dump of all function calls and how long they took but I'm also OK with putting something around specific functions. I tried experimenting with the [microtime](http://us3.php.net/manual/en/function.microtime.php) function: $then = microtime(); myFunc(); $now = microtime(); echo sprintf("Elapsed: %f", $now-$then); but that sometimes gives me negative results. Plus it's a lot of trouble to sprinkle that all over my code.
0
21,137
08/21/2008 20:43:29
1,875
08/19/2008 02:23:09
195
15
ASP.Net MVC and nUnit
- I have nUnit installed. - I have VS2008 Team Edition installed. - I have ASP.Net MVC Preview 4 (Codeplex) installed. How do make Visual Studio show me nUnit as a testing framework when creating a new MVC project? At this point I still only have the Microsoft Testing Framework as a choice.
asp.net-mvc
nunit
visual-studio
null
null
null
open
ASP.Net MVC and nUnit === - I have nUnit installed. - I have VS2008 Team Edition installed. - I have ASP.Net MVC Preview 4 (Codeplex) installed. How do make Visual Studio show me nUnit as a testing framework when creating a new MVC project? At this point I still only have the Microsoft Testing Framework as a choice.
0
21,174
08/21/2008 21:01:52
1,759
08/18/2008 12:54:01
85
3
FOSS tools for Flash development
I'm looking into doing some development for Flash. Do I need to buy expensive commercial tools or are there some FOSS tools out there I can get started with?
flash
actionscript
opensource
null
null
null
open
FOSS tools for Flash development === I'm looking into doing some development for Flash. Do I need to buy expensive commercial tools or are there some FOSS tools out there I can get started with?
0
21,184
08/21/2008 21:03:39
83
08/01/2008 16:31:56
808
70
How do I use Linq for paging a generic collection?
I've got a System.Generic.Collections.List(Of MyCustomClass) type object. Given integer varaibles pagesize and pagenumber, how can I query only any single page of MyCustomClass objects?
linq
.net
paging
null
null
null
open
How do I use Linq for paging a generic collection? === I've got a System.Generic.Collections.List(Of MyCustomClass) type object. Given integer varaibles pagesize and pagenumber, how can I query only any single page of MyCustomClass objects?
0
21,207
08/21/2008 21:12:01
1,562
08/16/2008 17:21:33
1
0
db4o experiences
I'm currently trying out db4o (the java version) and I pretty much like what I see. But I cannot help wondering how it does perform in a real live (web-)environment. Does anyone have any experiences (good or bad) to share about running db4o?
java
db4o
null
null
null
null
open
db4o experiences === I'm currently trying out db4o (the java version) and I pretty much like what I see. But I cannot help wondering how it does perform in a real live (web-)environment. Does anyone have any experiences (good or bad) to share about running db4o?
0
21,211
08/21/2008 21:13:37
2,197
08/20/2008 20:58:04
11
6
Get application name from Windows XP cut and paste?
This is a bit of a long shot, but if anyone can figure it out, you guys can... In Windows XP, is there any meta-data that comes with a cut and paste action, from which I can ascertain the application that provided the clipboard contents? Bonus question... if there is such information, is there any way I can access it through a Java app? Thank you!
windows-xp
null
null
null
null
null
open
Get application name from Windows XP cut and paste? === This is a bit of a long shot, but if anyone can figure it out, you guys can... In Windows XP, is there any meta-data that comes with a cut and paste action, from which I can ascertain the application that provided the clipboard contents? Bonus question... if there is such information, is there any way I can access it through a Java app? Thank you!
0
21,229
08/21/2008 21:28:20
1,344
08/14/2008 16:03:00
719
54
Visual Web Developer (Express): Setting Document Root for Dev Environment
I'm developing a site in Visual Web Dev Express, and when I run/debug, I'd like to be able to set my application's document root so that I can use safer paths, like "/css/style.css' instead of "css/style.css". How would I accomplish this?
c#
asp.net
serverconfiguration
visual-web-developer
null
null
open
Visual Web Developer (Express): Setting Document Root for Dev Environment === I'm developing a site in Visual Web Dev Express, and when I run/debug, I'd like to be able to set my application's document root so that I can use safer paths, like "/css/style.css' instead of "css/style.css". How would I accomplish this?
0
21,232
08/21/2008 21:30:21
83
08/01/2008 16:31:56
808
70
How do I page a generic collection without Linq?
I've got a System.Generic.Collections.List(Of MyCustomClass) type object. Given integer varaibles pagesize and pagenumber, how can I collect only any single page of MyCustomClass objects? This is what I've got. How can I improve it? 'my given collection and paging parameters Dim AllOfMyCustomClassObjects As System.Collections.Generic.List(Of MyCustomClass) = GIVEN Dim pagesize As Integer = GIVEN Dim pagenumber As Integer = GIVEN 'collect current page objects Dim PageObjects As New System.Collections.Generic.List(Of MyCustomClass) Dim objcount As Integer = 1 For Each obj As MyCustomClass In AllOfMyCustomClassObjects If objcount > pagesize * (pagenumber - 1) And count <= pagesize * pagenumber Then PageObjects.Add(obj) End If objcount = objcount + 1 Next 'find total page count Dim totalpages As Integer = CInt(Math.Floor(objcount / pagesize)) If objcount Mod pagesize > 0 Then totalpages = totalpages + 1 End If
.net
collections
vb
paging
null
null
open
How do I page a generic collection without Linq? === I've got a System.Generic.Collections.List(Of MyCustomClass) type object. Given integer varaibles pagesize and pagenumber, how can I collect only any single page of MyCustomClass objects? This is what I've got. How can I improve it? 'my given collection and paging parameters Dim AllOfMyCustomClassObjects As System.Collections.Generic.List(Of MyCustomClass) = GIVEN Dim pagesize As Integer = GIVEN Dim pagenumber As Integer = GIVEN 'collect current page objects Dim PageObjects As New System.Collections.Generic.List(Of MyCustomClass) Dim objcount As Integer = 1 For Each obj As MyCustomClass In AllOfMyCustomClassObjects If objcount > pagesize * (pagenumber - 1) And count <= pagesize * pagenumber Then PageObjects.Add(obj) End If objcount = objcount + 1 Next 'find total page count Dim totalpages As Integer = CInt(Math.Floor(objcount / pagesize)) If objcount Mod pagesize > 0 Then totalpages = totalpages + 1 End If
0
21,243
08/21/2008 21:38:43
484
08/06/2008 09:04:41
10
2
Anyone have a link to a technical discussion of anything akin to the Facebook news feed system?
I'm looking for a presentation, PDF, blog post, or whitepaper discussing the technical details of how to filter down and display massive amounts of information for individual users in an intelligent (possibly machine learning) kind of way. I've had coworkers hear presentations on the Facebook news feed but I can't find anything published anywhere that goes into the dirty details. Searches seem to just turn up the controversy of the system. Maybe I'm not searching for the right keywords...
facebook
information
whitepaper
null
null
null
open
Anyone have a link to a technical discussion of anything akin to the Facebook news feed system? === I'm looking for a presentation, PDF, blog post, or whitepaper discussing the technical details of how to filter down and display massive amounts of information for individual users in an intelligent (possibly machine learning) kind of way. I've had coworkers hear presentations on the Facebook news feed but I can't find anything published anywhere that goes into the dirty details. Searches seem to just turn up the controversy of the system. Maybe I'm not searching for the right keywords...
0
21,262
08/21/2008 21:46:07
1,692
08/18/2008 01:51:48
1
0
How do I create a mapping table in SQL Server Management Studio?
I'm learning about table design in SQL and I'm wonder how to create a mapping table in order to establish a many-to-many relationship between two other tables? I think the mapping table needs two primary keys - but I can't see how to create that as it appears there can only be 1 primary key column? I'm using the Database Diagrams feature to create my tables and relationships.
sql-server-2005
null
null
null
null
null
open
How do I create a mapping table in SQL Server Management Studio? === I'm learning about table design in SQL and I'm wonder how to create a mapping table in order to establish a many-to-many relationship between two other tables? I think the mapping table needs two primary keys - but I can't see how to create that as it appears there can only be 1 primary key column? I'm using the Database Diagrams feature to create my tables and relationships.
0
21,265
08/21/2008 21:47:24
2,328
08/21/2008 16:45:54
115
4
Comparing IEEE floats and doubles for equality
What is the best method for comparing IEEE floats and doubles for equality? I have heard of several methods, but I wanted to see what the community thought.
floating-point
variables
inequality
null
null
null
open
Comparing IEEE floats and doubles for equality === What is the best method for comparing IEEE floats and doubles for equality? I have heard of several methods, but I wanted to see what the community thought.
0
21,280
08/21/2008 21:54:56
2,147
08/20/2008 15:14:13
56
12
Am I missing something about LINQ?
I seem to be missing something about LINQ. To me, it looks like it's taking some of the elements of SQL that I like the least and moving them into the C# language and using them for other things. I mean, I could see the benefit of using SQL-like statements on things other than databases. But if I wanted to write SQL, well, why not just write SQL and keep it out of C#? What am I missing here?
c#
sql
null
null
null
null
open
Am I missing something about LINQ? === I seem to be missing something about LINQ. To me, it looks like it's taking some of the elements of SQL that I like the least and moving them into the C# language and using them for other things. I mean, I could see the benefit of using SQL-like statements on things other than databases. But if I wanted to write SQL, well, why not just write SQL and keep it out of C#? What am I missing here?
0
21,294
08/21/2008 21:59:31
1,341
08/14/2008 15:30:17
120
9
How can you (reliably) dynamically load a javascript file? (Like C's #include)
How can you reliably and dynamically load a javascript file? Basically what I want to accomplish is implement a module or component that when you 'initialize' the component it will dynamically load all needed javascript library scripts on demand. So the client that uses the component isn't required to load all the library script files (and manually insert <script> tags into their web page) that implement my component - just the 'main' component script file. How do mainstream javascript libraries accomplish? I guess they have tools that merge multiple javascript files into a single redistributable 'build' version of a script file? Is Rhino one of these tools?
javascript
null
null
null
null
null
open
How can you (reliably) dynamically load a javascript file? (Like C's #include) === How can you reliably and dynamically load a javascript file? Basically what I want to accomplish is implement a module or component that when you 'initialize' the component it will dynamically load all needed javascript library scripts on demand. So the client that uses the component isn't required to load all the library script files (and manually insert <script> tags into their web page) that implement my component - just the 'main' component script file. How do mainstream javascript libraries accomplish? I guess they have tools that merge multiple javascript files into a single redistributable 'build' version of a script file? Is Rhino one of these tools?
0
21,303
08/21/2008 22:02:58
1,556
08/16/2008 16:41:03
301
11
In C++ constructor and destructor can be inline function?
VC++ makes function which are implemented within class declaration as inline function. If I declared Foo class as following, then is CONSTRUCTOR and DESTRUCTOR inline function? class Foo { int* p; public: Foo() { p = new char[0x00100000]; } ~Foo() { delete [] p; } }; { Foo f; (f); }
c++
constructor
destructor
null
null
null
open
In C++ constructor and destructor can be inline function? === VC++ makes function which are implemented within class declaration as inline function. If I declared Foo class as following, then is CONSTRUCTOR and DESTRUCTOR inline function? class Foo { int* p; public: Foo() { p = new char[0x00100000]; } ~Foo() { delete [] p; } }; { Foo f; (f); }
0
21,306
08/21/2008 22:04:04
2,362
08/21/2008 20:46:43
1
0
Generic design for packaging of user changes for deployment
OK a real question - I'd like to add the ability for users of a system I developed to make package a set of changes together so that they can deploy their package of changes to an acceptance testing environment, do their testing, and then at a later point (if testing was successful) deploy that package of changes to a live environment. The system in this case is J2EE webapp updating relational database records, but it kinda seems like this package and deploy capability shouldn't really need to be specific to my app and could be reuseable pluggable functionality if I go about it the right way. Anyone know of any existing solutions that might apply or got any advice on how to best to go about it? Thanks!
design
deployment
packaging
null
null
null
open
Generic design for packaging of user changes for deployment === OK a real question - I'd like to add the ability for users of a system I developed to make package a set of changes together so that they can deploy their package of changes to an acceptance testing environment, do their testing, and then at a later point (if testing was successful) deploy that package of changes to a live environment. The system in this case is J2EE webapp updating relational database records, but it kinda seems like this package and deploy capability shouldn't really need to be specific to my app and could be reuseable pluggable functionality if I go about it the right way. Anyone know of any existing solutions that might apply or got any advice on how to best to go about it? Thanks!
0
21,347
08/21/2008 22:28:59
2,313
08/21/2008 15:27:23
6
0
windowsmobile
Is therу broad way to handle Bluetooth [Audio/Video Remote Control Profile (AVRCP)][1] events on WM device? I especialy interested in Comact Framework way but would be happy with just simple P/Invoke API. [1]: http://en.wikipedia.org/wiki/Bluetooth_profile#Audio.2FVideo_Remote_Control_Profile_.28AVRCP.29
windows-mobile
null
null
null
null
null
open
windowsmobile === Is therу broad way to handle Bluetooth [Audio/Video Remote Control Profile (AVRCP)][1] events on WM device? I especialy interested in Comact Framework way but would be happy with just simple P/Invoke API. [1]: http://en.wikipedia.org/wiki/Bluetooth_profile#Audio.2FVideo_Remote_Control_Profile_.28AVRCP.29
0
21,353
08/21/2008 22:36:15
708
08/08/2008 06:10:02
333
12
Batch file to "Script" a Database
Is it possible to somehow use a .bat file to script the schema and/or content of a SQL Server database? I can do this via the wizard, but would like to streamline the creation of this file for source control purposes. I would like to avoid the use of 3rd party tools - just limiting myself to the tools that come with SQL Server.
sql-server
script
batch-file
null
null
null
open
Batch file to "Script" a Database === Is it possible to somehow use a .bat file to script the schema and/or content of a SQL Server database? I can do this via the wizard, but would like to streamline the creation of this file for source control purposes. I would like to avoid the use of 3rd party tools - just limiting myself to the tools that come with SQL Server.
0
21,355
08/21/2008 22:38:06
2,313
08/21/2008 15:27:23
6
0
Mocking and IQueriable<T>
I've ran into a problem while trying to test following IRepository<T> based on NHibernate: public class NHibernateRepository<T>: Disposable, IRepository<T> where T : IdentifiableObject { ... public IQueryable<T> Query() { return NHibernateSession.Linq<T>(); } } How on the Hell to mock returning IQueryable<T> out in the way that it returns given collection in exchange certain expression. I feel I have some misunderstanding of IQueryable<T>...
linq
null
null
null
null
null
open
Mocking and IQueriable<T> === I've ran into a problem while trying to test following IRepository<T> based on NHibernate: public class NHibernateRepository<T>: Disposable, IRepository<T> where T : IdentifiableObject { ... public IQueryable<T> Query() { return NHibernateSession.Linq<T>(); } } How on the Hell to mock returning IQueryable<T> out in the way that it returns given collection in exchange certain expression. I feel I have some misunderstanding of IQueryable<T>...
0
21,388
08/21/2008 23:01:30
2,363
08/21/2008 20:55:49
21
3
Represent Ordering in a Relational Database
I have a collection of objects in a database. Images in a photo gallery, products in a catalog, chapters in a book, etc. Each object is represented as a row. I want to be able to arbitrarily order these images, storing that ordering in the database so when I display the objects, they will be in the right order. For example, let's say I'm writing a book, and each chapter is an object. I write my book, and put the chapters in the following order: > Introduction, Accessibility, Form vs. Function, Errors, Consistency, Conclusion, Index It goes to the editor, and comes back with the following suggested order: > Introduction, Form, Function, Accessibility, Consistency, Errors, Conclusion, Index How can I store this ordering in the database in a robust, efficient way? I've had the following ideas, but I'm not thrilled with any of them: 1. Array. Each row has an ordering ID, when order is changed (via a removal followed by an insertion), the order IDs are updated. This makes retrieval easy, since it's just `ORDER BY`, but it seems easy to break. >`// REMOVAL` >`UPDATE ... SET orderingID=NULL WHERE orderingID=removedID` >`UPDATE ... SET orderingID=orderingID-1 WHERE orderingID > removedID` >`// INSERTION` >`UPDATE ... SET orderingID=orderingID+1 WHERE orderingID > insertionID` >`UPDATE ... SET orderID=insertionID WHERE ID=addedID` 2. Linked list. Each row has a column for the id of the next row in the ordering. Traversal seems costly here, though there may by some way to use `ORDER BY` that I'm not thinking of. 3. Spaced array. Set the orderingID (as used in #1) to be large, so the first object is 100, the second is 200, etc. Then when an insertion happens, you just place it at `(objectBefore + objectAfter)/2`. Of course, this would need to be rebalanced occasionally, so you don't have things too close together (even with floats, you'd eventually run into rounding errors). None of these seem particularly elegant to me. Does anyone have a better way to do it?
sql
db
null
null
null
null
open
Represent Ordering in a Relational Database === I have a collection of objects in a database. Images in a photo gallery, products in a catalog, chapters in a book, etc. Each object is represented as a row. I want to be able to arbitrarily order these images, storing that ordering in the database so when I display the objects, they will be in the right order. For example, let's say I'm writing a book, and each chapter is an object. I write my book, and put the chapters in the following order: > Introduction, Accessibility, Form vs. Function, Errors, Consistency, Conclusion, Index It goes to the editor, and comes back with the following suggested order: > Introduction, Form, Function, Accessibility, Consistency, Errors, Conclusion, Index How can I store this ordering in the database in a robust, efficient way? I've had the following ideas, but I'm not thrilled with any of them: 1. Array. Each row has an ordering ID, when order is changed (via a removal followed by an insertion), the order IDs are updated. This makes retrieval easy, since it's just `ORDER BY`, but it seems easy to break. >`// REMOVAL` >`UPDATE ... SET orderingID=NULL WHERE orderingID=removedID` >`UPDATE ... SET orderingID=orderingID-1 WHERE orderingID > removedID` >`// INSERTION` >`UPDATE ... SET orderingID=orderingID+1 WHERE orderingID > insertionID` >`UPDATE ... SET orderID=insertionID WHERE ID=addedID` 2. Linked list. Each row has a column for the id of the next row in the ordering. Traversal seems costly here, though there may by some way to use `ORDER BY` that I'm not thinking of. 3. Spaced array. Set the orderingID (as used in #1) to be large, so the first object is 100, the second is 200, etc. Then when an insertion happens, you just place it at `(objectBefore + objectAfter)/2`. Of course, this would need to be rebalanced occasionally, so you don't have things too close together (even with floats, you'd eventually run into rounding errors). None of these seem particularly elegant to me. Does anyone have a better way to do it?
0
21,404
08/21/2008 23:13:05
1,747
08/18/2008 12:12:28
101
5
Source Control in Visual Studio Isolated Shell
I am developing an **Isolated Shell** that caters to "**designers/special content creators**" performing specific tasks, using the Shell. As they operate on files, they need to be able to use TFS for source control. This is mainly due to the fact that Developers will also operate on the same files from TFS but using Visual studio 2008. After looking and searching I still could not find Team Explorer to be available to Shell. Asking on MSDN forums, lead me to the answer that "this is not supported yet in the Isolated Shell". Well, then the whole point of giving away a shell is not justified, if you want to use a source control system for your files. The idea is not to recreate everything and develop tool windows etc using the TFS provider API. The [Visual Studio Extensibility book by Keyven Nayyeri][1] has an example, which only goes so far into this problem of adding a sc provider. Has anyone worked on developing **Visual Studio 2008 Isolated Shell** applications/environment? Please provide comments, questions - anything that you have to share apart from the following threads, which I've already participated in. Threads from MSDN forums: - [Team Explorer for Isolated Shell][2] - [Is it possible to use Team Explorer in VS Shell Isolated?][3] [1]: http://nayyeri.net/blog/professional-visual-studio-extensibility-finally-released/ [2]: http://forums.msdn.microsoft.com/en-US/vsx/thread/34347f72-853a-43cb-ba9e-9d6df718ca13/ [3]: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3382221&SiteID=1
visual-studio
visualstudioextensibility
vsx
null
null
null
open
Source Control in Visual Studio Isolated Shell === I am developing an **Isolated Shell** that caters to "**designers/special content creators**" performing specific tasks, using the Shell. As they operate on files, they need to be able to use TFS for source control. This is mainly due to the fact that Developers will also operate on the same files from TFS but using Visual studio 2008. After looking and searching I still could not find Team Explorer to be available to Shell. Asking on MSDN forums, lead me to the answer that "this is not supported yet in the Isolated Shell". Well, then the whole point of giving away a shell is not justified, if you want to use a source control system for your files. The idea is not to recreate everything and develop tool windows etc using the TFS provider API. The [Visual Studio Extensibility book by Keyven Nayyeri][1] has an example, which only goes so far into this problem of adding a sc provider. Has anyone worked on developing **Visual Studio 2008 Isolated Shell** applications/environment? Please provide comments, questions - anything that you have to share apart from the following threads, which I've already participated in. Threads from MSDN forums: - [Team Explorer for Isolated Shell][2] - [Is it possible to use Team Explorer in VS Shell Isolated?][3] [1]: http://nayyeri.net/blog/professional-visual-studio-extensibility-finally-released/ [2]: http://forums.msdn.microsoft.com/en-US/vsx/thread/34347f72-853a-43cb-ba9e-9d6df718ca13/ [3]: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3382221&SiteID=1
0
21,411
08/21/2008 23:17:41
1,693
08/18/2008 02:25:37
344
14
PHP sleep() silently hogs CPU
I'm running Apache on Linux within VMWare. One of the PHP pages I'm requesting does a sleep(), and I find that if I attempt to request a second page whilst the first page is sleep()'ing, the second page hangs, waiting for the sleep() from the first page to finish. Has anyone else seen this behaviour? I know that PHP isn't multi-threaded, but this seems like gross mishandling of the CPU. Edit: I should've mentioned that the CPU usage doesn't spike. What I mean by CPU "hogging" is that no other PHP page seems able to use the CPU whilst the page is sleep()'ing.
php
performance
hang
sleep
null
null
open
PHP sleep() silently hogs CPU === I'm running Apache on Linux within VMWare. One of the PHP pages I'm requesting does a sleep(), and I find that if I attempt to request a second page whilst the first page is sleep()'ing, the second page hangs, waiting for the sleep() from the first page to finish. Has anyone else seen this behaviour? I know that PHP isn't multi-threaded, but this seems like gross mishandling of the CPU. Edit: I should've mentioned that the CPU usage doesn't spike. What I mean by CPU "hogging" is that no other PHP page seems able to use the CPU whilst the page is sleep()'ing.
0
21,422
08/21/2008 23:23:52
2,050
08/20/2008 00:32:49
11
1
How to address semantic issues with tag-based web sites?
Tag-based web sites often suffer from the delicacy of language such as synonyms, homonyms, etc. For programmers looking for information, say on SO, concrete examples are: - Subversion or SVN (or svn, with case-sensitive tags) - .NET or Mono - [Will add more] The problem is that we *do* want to preserver our delicacy of language and make the machine deal with it as good as possible. A site like del.icio.us sees its tag base grow a lot, thus probably hindering usage or search. Searching for SVN-related entries will probably list a majority of entries with both subversion and svn tags, but I can think of three issues: 1. A search is incomplete as many entries may not have both tags (which are 'synonyms'). 2. A search is less useful as Q/A often lead to more Qs! Notably for newbies on a given topic. 3. Tagging a question (note: or an answer separately, sounds useful) becomes philosophical: 'Did I Tag the Right Way?' One way to address these issues is to create semantic links between tags, so that subversion and svn are automatically bound by the system, not by poor users. *Is it an approach that sounds good/feasible/attractive/useful? How to implement it efficiently?*
stackoverflow
tags
del.icio.us
null
null
null
open
How to address semantic issues with tag-based web sites? === Tag-based web sites often suffer from the delicacy of language such as synonyms, homonyms, etc. For programmers looking for information, say on SO, concrete examples are: - Subversion or SVN (or svn, with case-sensitive tags) - .NET or Mono - [Will add more] The problem is that we *do* want to preserver our delicacy of language and make the machine deal with it as good as possible. A site like del.icio.us sees its tag base grow a lot, thus probably hindering usage or search. Searching for SVN-related entries will probably list a majority of entries with both subversion and svn tags, but I can think of three issues: 1. A search is incomplete as many entries may not have both tags (which are 'synonyms'). 2. A search is less useful as Q/A often lead to more Qs! Notably for newbies on a given topic. 3. Tagging a question (note: or an answer separately, sounds useful) becomes philosophical: 'Did I Tag the Right Way?' One way to address these issues is to create semantic links between tags, so that subversion and svn are automatically bound by the system, not by poor users. *Is it an approach that sounds good/feasible/attractive/useful? How to implement it efficiently?*
0
21,437
08/21/2008 23:36:14
1,975
08/19/2008 16:30:04
46
11
Preventing a visitor from saving an image from my site.
What are some effective strategies for preventing the use of my proprietary images? I'm talking about saving them, direct linking to them etc... Presently I have a watermark on the image, but I'd rather not. .NET platform preferred, but if there's a strategy that's on another platform that integrates with my existing application that'd be a bonus.
image
null
null
null
null
null
open
Preventing a visitor from saving an image from my site. === What are some effective strategies for preventing the use of my proprietary images? I'm talking about saving them, direct linking to them etc... Presently I have a watermark on the image, but I'd rather not. .NET platform preferred, but if there's a strategy that's on another platform that integrates with my existing application that'd be a bonus.
0
21,448
08/21/2008 23:42:39
2,375
08/21/2008 22:37:01
1
0
Accessing Excel data source running SSIS package on 64 bit server
I have an SSIS package that exports data to a couple of Excel files for transfer to a third party. To get this to run as a scheduled job on a 64 bit server I understand that I need to set the step up as a CmdExec type and call the 32 bit version of DTExec. But I don't seem be able to get the command right to pass in the connection string for the Excel files. So far I have this: DTExec.exe /SQL \PackageName /SERVER OUR2005SQLSERVER /CONNECTION LETTER_Excel_File;\""Provider=Microsoft.Jet.OLEDB.4.0";"Data Source=""C:\Temp\BaseFiles\LETTER.xls";"Extended Properties=""Excel 8.0;HDR=Yes"" /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING E which gives me and error: Option "Properties=Excel 8.0;HDR=Yes" is not valid. I've tried a few variations with the Quotation marks but have not been able to get it right yet. Does anyone know how to do it? Cheers Nige
excel
ssis
sql-server
connection-manager
null
null
open
Accessing Excel data source running SSIS package on 64 bit server === I have an SSIS package that exports data to a couple of Excel files for transfer to a third party. To get this to run as a scheduled job on a 64 bit server I understand that I need to set the step up as a CmdExec type and call the 32 bit version of DTExec. But I don't seem be able to get the command right to pass in the connection string for the Excel files. So far I have this: DTExec.exe /SQL \PackageName /SERVER OUR2005SQLSERVER /CONNECTION LETTER_Excel_File;\""Provider=Microsoft.Jet.OLEDB.4.0";"Data Source=""C:\Temp\BaseFiles\LETTER.xls";"Extended Properties=""Excel 8.0;HDR=Yes"" /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING E which gives me and error: Option "Properties=Excel 8.0;HDR=Yes" is not valid. I've tried a few variations with the Quotation marks but have not been able to get it right yet. Does anyone know how to do it? Cheers Nige
0
21,449
08/21/2008 23:42:44
2,045
08/19/2008 23:50:05
1
0
Types of endianness
What is the difference between the following types of endianness? - byte (8b) invariant big and little endianness - half-word (16b) invariant big and little endianness - word (32b) invariant big and little endianness - double-word (64b) invariant big and little endianness Are there other types/variations?
endian
null
null
null
null
null
open
Types of endianness === What is the difference between the following types of endianness? - byte (8b) invariant big and little endianness - half-word (16b) invariant big and little endianness - word (32b) invariant big and little endianness - double-word (64b) invariant big and little endianness Are there other types/variations?
0
21,454
08/21/2008 23:48:08
2,019
08/19/2008 20:18:31
146
13
Specifying a mySQL ENUM in a Django model
The title more or less says it all. How do I go about specifying and using an ENUM in a Django model?
mysql
django
null
null
null
null
open
Specifying a mySQL ENUM in a Django model === The title more or less says it all. How do I go about specifying and using an ENUM in a Django model?
0
21,460
08/21/2008 23:51:10
2,019
08/19/2008 20:18:31
146
13
Does Hostmonster support Django
I know Hostmonster allows Python. Has anyone successfully run Django on there? Any problems?
django
hostmonster
null
null
null
null
open
Does Hostmonster support Django === I know Hostmonster allows Python. Has anyone successfully run Django on there? Any problems?
0
21,461
08/21/2008 23:51:23
1,343
08/14/2008 15:46:01
189
18
What Predefined #if symbos does c# have?
#if SYMBOL //code #endif what values does C# predefine for use?
c#
null
null
null
null
null
open
What Predefined #if symbos does c# have? === #if SYMBOL //code #endif what values does C# predefine for use?
0
21,464
08/21/2008 23:53:36
2,305
08/21/2008 15:05:48
1
0
Recommended iPhone Development Resources
This is my first post here and I wanted to get some input from people doing iPhone development. Other than the Apple DevCenter, where are there good sites to learn iPhone developement? I know Apple has a tough NDA but there has to be people talking about writing applications for the iPhone. Thank you, Rob Bazinet
iphone
null
null
null
null
null
open
Recommended iPhone Development Resources === This is my first post here and I wanted to get some input from people doing iPhone development. Other than the Apple DevCenter, where are there good sites to learn iPhone developement? I know Apple has a tough NDA but there has to be people talking about writing applications for the iPhone. Thank you, Rob Bazinet
0
21,489
08/22/2008 00:13:06
2,281
08/21/2008 13:07:52
21
3
Grouping runs of data
SQL Experts, Is there an efficient way to group runs of data together using SQL? Or is it going to be more efficient to process the data in code. For example if I have the following data: ID|Name 01|Harry Johns 02|Adam Taylor 03|John Smith 04|John Smith 05|Bill Manning 06|John Smith I need to display this: Harry Johns Adam Taylor John Smith (2) Bill Manning John Smith
sql
null
null
null
null
null
open
Grouping runs of data === SQL Experts, Is there an efficient way to group runs of data together using SQL? Or is it going to be more efficient to process the data in code. For example if I have the following data: ID|Name 01|Harry Johns 02|Adam Taylor 03|John Smith 04|John Smith 05|Bill Manning 06|John Smith I need to display this: Harry Johns Adam Taylor John Smith (2) Bill Manning John Smith
0
21,514
08/22/2008 00:29:05
2,383
08/22/2008 00:17:14
1
0
Enumerate Windows user group members on remote system using c#
Within c#, I need to be able to - Connect to a remote system, specifying username/password as appropriate - List the members of a localgroup on that system - Fetch the results back to the executing computer So for example I would connect to \\SOMESYSTEM with appropriate creds, and fetch back a list of local administrators including SOMESYSTEM\Administrator, SOMESYSTEM\Bob, DOMAIN\AlanH, "DOMAIN\Domain Administrators". I've tried this with system.directoryservices.accountmanagement but am running into problems with authentication. Sometimes I get: *Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again. (Exception from HRESULT: 0x800704C3)* The above is trying because there will be situations where I simply cannot unmap existing drives or UNC connections. Other times my program gets UNKNOWN ERROR and the security log on the remote system reports an error 675, code 0x19 which is KDC_ERR_PREAUTH_REQUIRED. I need a simpler and less error prone way to do this!
c#
windows
user
groups
usersgroup
null
open
Enumerate Windows user group members on remote system using c# === Within c#, I need to be able to - Connect to a remote system, specifying username/password as appropriate - List the members of a localgroup on that system - Fetch the results back to the executing computer So for example I would connect to \\SOMESYSTEM with appropriate creds, and fetch back a list of local administrators including SOMESYSTEM\Administrator, SOMESYSTEM\Bob, DOMAIN\AlanH, "DOMAIN\Domain Administrators". I've tried this with system.directoryservices.accountmanagement but am running into problems with authentication. Sometimes I get: *Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again. (Exception from HRESULT: 0x800704C3)* The above is trying because there will be situations where I simply cannot unmap existing drives or UNC connections. Other times my program gets UNKNOWN ERROR and the security log on the remote system reports an error 675, code 0x19 which is KDC_ERR_PREAUTH_REQUIRED. I need a simpler and less error prone way to do this!
0
21,547
08/22/2008 00:58:55
369
08/05/2008 08:33:43
284
27
In MSSQL, how do I generate a CREATE TABLE statement for a given table?
I've spent a good amount of time coming up with solution to this problem, so in the spirit of [this post][1], I'm posting it here, since I think it might be useful to others. If anyone has a better script, or anything to add, please post it. [1]: http://stackoverflow.com/questions/21245/questions-vs-conveying-information
mssql
dynamicsql
scripting
null
null
null
open
In MSSQL, how do I generate a CREATE TABLE statement for a given table? === I've spent a good amount of time coming up with solution to this problem, so in the spirit of [this post][1], I'm posting it here, since I think it might be useful to others. If anyone has a better script, or anything to add, please post it. [1]: http://stackoverflow.com/questions/21245/questions-vs-conveying-information
0
21,558
08/22/2008 01:13:15
1,556
08/16/2008 16:41:03
315
11
In C++ virtual base class?
I think you might dislike C++ crappy features but I just want to know what is virtual base class and what it means: Let me show an example: class Foo { public: void DoSomething() { /* ... */ } }; class Bar : public virtual Foo { public: void DoSpecific() { /* ... */ } }; Please teach me!
c++
null
null
null
null
null
open
In C++ virtual base class? === I think you might dislike C++ crappy features but I just want to know what is virtual base class and what it means: Let me show an example: class Foo { public: void DoSomething() { /* ... */ } }; class Bar : public virtual Foo { public: void DoSpecific() { /* ... */ } }; Please teach me!
0
21,560
08/22/2008 01:16:26
1,630
08/17/2008 17:03:19
445
42
How to enable multisampling for a wxWidgets OpenGL application?
**[Multisampling][1]** is a way of applying **full screen anti-aliasing** (FSAA) in 3D applications. I need to use multisampling in my OpenGL application, which is currently embedded in a **wxWidgets** GUI. Is there a way to do this? Please respond only if you know the detailed steps to achieve this. I'm aware that of enabling multisampling using **[WGL][2]** (Win32 extensions to OpenGL). However, since my OpenGL application isn't written in MFC (and I want the code to be multi-platform portable), that's not an option for me. [1]: http://en.wikipedia.org/wiki/Multisample_anti-aliasing [2]: http://is.gd/1Opr
opengl
wxwidgets
multisampling
null
null
null
open
How to enable multisampling for a wxWidgets OpenGL application? === **[Multisampling][1]** is a way of applying **full screen anti-aliasing** (FSAA) in 3D applications. I need to use multisampling in my OpenGL application, which is currently embedded in a **wxWidgets** GUI. Is there a way to do this? Please respond only if you know the detailed steps to achieve this. I'm aware that of enabling multisampling using **[WGL][2]** (Win32 extensions to OpenGL). However, since my OpenGL application isn't written in MFC (and I want the code to be multi-platform portable), that's not an option for me. [1]: http://en.wikipedia.org/wiki/Multisample_anti-aliasing [2]: http://is.gd/1Opr
0
21,564
08/22/2008 01:24:34
156
08/02/2008 17:36:27
143
8
Is there a Unix utility to prepend timestamps to lines of text?
I ended up writing a quick little script for this in Python, but I was wondering if there was a utility you could feed text into which would prepend each line with some text -- in my specific case, a timestamp. Ideally, the use would be something like: $ cat somefile.txt | prepend-timestamp (Before you answer sed, I tried this: $ cat somefile.txt | sed "s/^/`date`/" but that only evaluates the date command once when sed is executed, so the same timestamp is incorrectly prepended to each line.)
unix
shell
sed
null
null
null
open
Is there a Unix utility to prepend timestamps to lines of text? === I ended up writing a quick little script for this in Python, but I was wondering if there was a utility you could feed text into which would prepend each line with some text -- in my specific case, a timestamp. Ideally, the use would be something like: $ cat somefile.txt | prepend-timestamp (Before you answer sed, I tried this: $ cat somefile.txt | sed "s/^/`date`/" but that only evaluates the date command once when sed is executed, so the same timestamp is incorrectly prepended to each line.)
0
21,574
08/22/2008 01:32:54
757
08/08/2008 15:38:57
1
2
What is the difference between Ruby 1.8 and Ruby 1.9
I'm not clear on the differences between the "current" version of Ruby (1.8) and the "new" version (1.9). Is there an "easy" or a "simple" explanation of the differences and why it is so different?
ruby
language
null
null
null
null
open
What is the difference between Ruby 1.8 and Ruby 1.9 === I'm not clear on the differences between the "current" version of Ruby (1.8) and the "new" version (1.9). Is there an "easy" or a "simple" explanation of the differences and why it is so different?
0
21,583
08/22/2008 01:35:33
1,266
08/14/2008 06:27:57
128
18
Unit-Testing Databases
This past summer I was developing a basic ASP.NET/SQL Server CRUD app, and unit testing was one of the requirements. I ran into some trouble when I tried to test against the database. To my understanding, unit tests should be: * stateless * independent from each other * repeatable with the same results i.e. no persisting changes These requirements seem to be at odds with each other when developing for a database. For example, I can't test Insert() without making sure the rows to be inserted aren't there yet, thus I need to call the Delete() first. But, what if they aren't already there? Then I would need to call the Exists() function first. My eventual solution involved very large setup functions (yuck!) and an empty test case which would run first and indicate that the setup ran without problems. This is sacrificing on the independence of the tests while maintaining their statelessness. Another solution I found is to wrap the function calls in a transaction which can be easily rolled back, like [Roy Osherove's XtUnit][1]. This work, but it involves another library, another dependency, and it seems a little too heavy of a solution for the problem at hand. So, what has the SO community done when confronted with this situation? [1]: http://weblogs.asp.net/rosherove/archive/2004/10/05/238201.aspx
database
unit-testing
transactions
xtunit
null
null
open
Unit-Testing Databases === This past summer I was developing a basic ASP.NET/SQL Server CRUD app, and unit testing was one of the requirements. I ran into some trouble when I tried to test against the database. To my understanding, unit tests should be: * stateless * independent from each other * repeatable with the same results i.e. no persisting changes These requirements seem to be at odds with each other when developing for a database. For example, I can't test Insert() without making sure the rows to be inserted aren't there yet, thus I need to call the Delete() first. But, what if they aren't already there? Then I would need to call the Exists() function first. My eventual solution involved very large setup functions (yuck!) and an empty test case which would run first and indicate that the setup ran without problems. This is sacrificing on the independence of the tests while maintaining their statelessness. Another solution I found is to wrap the function calls in a transaction which can be easily rolled back, like [Roy Osherove's XtUnit][1]. This work, but it involves another library, another dependency, and it seems a little too heavy of a solution for the problem at hand. So, what has the SO community done when confronted with this situation? [1]: http://weblogs.asp.net/rosherove/archive/2004/10/05/238201.aspx
0
21,589
08/22/2008 01:39:05
1,328
08/14/2008 14:38:29
39
3
Is it possible to share a transaction between a .Net application and a COM+ object?
I did some tests a while ago and never figured out how to make this work. The ingredients: - COM+ transactional object (developed in VB6) - .Net web application (with transaction) that... makes a call to the COM+ component updates a row in a SQL database Testing: Run the .Net application and force an exception. Result: The update made from the .Net application rolls back. The update made by the COM+ object does not roll back. If I call the COM+ object from an old ASP page the rollback works. I know some people may be thinking "what?! COM+ and .Net you must be out of your mind!", but there are some places in this world where there still are a lot of COM+ components. I was just curious if someone ever faced this and if you figured out how to make this work.
.net
com
null
null
null
null
open
Is it possible to share a transaction between a .Net application and a COM+ object? === I did some tests a while ago and never figured out how to make this work. The ingredients: - COM+ transactional object (developed in VB6) - .Net web application (with transaction) that... makes a call to the COM+ component updates a row in a SQL database Testing: Run the .Net application and force an exception. Result: The update made from the .Net application rolls back. The update made by the COM+ object does not roll back. If I call the COM+ object from an old ASP page the rollback works. I know some people may be thinking "what?! COM+ and .Net you must be out of your mind!", but there are some places in this world where there still are a lot of COM+ components. I was just curious if someone ever faced this and if you figured out how to make this work.
0
21,593
08/22/2008 01:40:06
2,399
08/22/2008 01:36:28
1
0
what is the difference between #include <filename> and #include "filename"
in the programming language C, what is the difference between #include <filename> and #include "filename"
c
include
difference
null
null
null
open
what is the difference between #include <filename> and #include "filename" === in the programming language C, what is the difference between #include <filename> and #include "filename"
0
21,635
08/22/2008 02:13:38
361
08/05/2008 04:20:27
245
13
Pushing out MSI files
I have a product which has been traditionally shipped as an MSI file. It is deployed through some sort of SMS push to thousands of desktops by our various clients. The software we use to create these installers is getting long in the tooth and we are looking to replace it. We have already standardized on InstallAnywhere for most of our products as we support many operating systems. Unfortunately InstallAnywhere cannot produce MSI files. I am wondering if it is required that SMS use MSI files or if it can handle other installer types (.exe). If not, are there any open source programmes for creating MSI files?
deployment
installer
msi
null
null
null
open
Pushing out MSI files === I have a product which has been traditionally shipped as an MSI file. It is deployed through some sort of SMS push to thousands of desktops by our various clients. The software we use to create these installers is getting long in the tooth and we are looking to replace it. We have already standardized on InstallAnywhere for most of our products as we support many operating systems. Unfortunately InstallAnywhere cannot produce MSI files. I am wondering if it is required that SMS use MSI files or if it can handle other installer types (.exe). If not, are there any open source programmes for creating MSI files?
0
21,640
08/22/2008 02:18:28
4,258
09/02/2008 14:41:31
1
1
.NET - Get protocol, host, and port
Is there a simple way in .NET to quickly get the current protocol, host, and port? For example, if I'm on the following URL: http://www.mywebsite.com:80/pages/page1.aspx I need to return: http://www.mywebsite.com:80 I know I can use Request.Url.AbsoluteUri to get the complete URL, and I know I can use Request.Url.Authority to get the host and port, but I'm not sure of the best way to get the protocol without parsing out the URL string. Any suggestions?
.net
asp.net
url
uri
authority
null
open
.NET - Get protocol, host, and port === Is there a simple way in .NET to quickly get the current protocol, host, and port? For example, if I'm on the following URL: http://www.mywebsite.com:80/pages/page1.aspx I need to return: http://www.mywebsite.com:80 I know I can use Request.Url.AbsoluteUri to get the complete URL, and I know I can use Request.Url.Authority to get the host and port, but I'm not sure of the best way to get the protocol without parsing out the URL string. Any suggestions?
0
21,647
08/22/2008 02:21:07
1,630
08/17/2008 17:03:19
445
44
C++: Reading from text file until EOF repeats last line
The following **C++** code uses a **ifstream** object to read integers from a text file (which has one number per line) until it hits **EOF**. Why does it read the integer on the last line twice? How to fix this? **Code:** #include <iostream> #include <fstream> using namespace std; int main() { ifstream iFile("input.txt"); // input.txt has integers, one per line while (!iFile.eof()) { int x; iFile >> x; cerr << x << endl; } return 0; } **input.txt**: 10 20 30 **Output**: 10 20 30 30 **Note**: All unnecessary error checking code not included to keep the code snippet small. The above behaviour is seen on Windows (Visual C++), cygwin (gcc) and Linux (gcc).
c++
fstream
iostream
null
null
null
open
C++: Reading from text file until EOF repeats last line === The following **C++** code uses a **ifstream** object to read integers from a text file (which has one number per line) until it hits **EOF**. Why does it read the integer on the last line twice? How to fix this? **Code:** #include <iostream> #include <fstream> using namespace std; int main() { ifstream iFile("input.txt"); // input.txt has integers, one per line while (!iFile.eof()) { int x; iFile >> x; cerr << x << endl; } return 0; } **input.txt**: 10 20 30 **Output**: 10 20 30 30 **Note**: All unnecessary error checking code not included to keep the code snippet small. The above behaviour is seen on Windows (Visual C++), cygwin (gcc) and Linux (gcc).
0
21,651
08/22/2008 02:26:26
2,261
08/21/2008 11:41:31
1
2
Adobe AIR: Handling JSON objects from server
I have a script that retrieves objects from a remote server through an Ajax call. The server returns objects in JSON notation. However, in Adobe AIR, there is a restriction on using [eval()][1] for security reasons. So I'm able to get replies from the remote server, but can't turn them back into Javascript objects. Is there any workaround for this issue? I would like to use JSON for my Javascript objects, since it can be used almost immediately. Sidenote: I do understand the security implications for forcing the issue, but I will be doing some rapid application development for a competition, so the program would only be a quick prototype, and not used for production purposes. Nevertheless, it would be great if there's a better alternative to what I'm trying to do now [1]: http://labs.adobe.com/wiki/index.php/AIR:HTML_Security_FAQ#Why_restrict_eval.28.29_for_all_Application_content_if_there_are_legitimate_use_cases_for_using_it.3F
javascript
ajax
air
json
null
null
open
Adobe AIR: Handling JSON objects from server === I have a script that retrieves objects from a remote server through an Ajax call. The server returns objects in JSON notation. However, in Adobe AIR, there is a restriction on using [eval()][1] for security reasons. So I'm able to get replies from the remote server, but can't turn them back into Javascript objects. Is there any workaround for this issue? I would like to use JSON for my Javascript objects, since it can be used almost immediately. Sidenote: I do understand the security implications for forcing the issue, but I will be doing some rapid application development for a competition, so the program would only be a quick prototype, and not used for production purposes. Nevertheless, it would be great if there's a better alternative to what I'm trying to do now [1]: http://labs.adobe.com/wiki/index.php/AIR:HTML_Security_FAQ#Why_restrict_eval.28.29_for_all_Application_content_if_there_are_legitimate_use_cases_for_using_it.3F
0
21,652
08/22/2008 02:47:44
1,666
08/17/2008 21:07:18
273
20
Do you write your own specific Exceptions?
I have some code that gives a user id to a utility that then send email to that user. emailUtil.sendEmail(userId, "foo"); public void sendEmail(String userId, String message) throws MailException { /* ... logic that could throw a MailException */ } `MailException` could be thrown for a number of reasons, problems with the email address, problems with the mail template etc. My question is this: do you create a new Exception type for every one of these exceptions and then deal with them individually or do you create one MailException and then store something in the exception (something computer-readable, not the description text) that allows us to do different things based on what actually happened.
java
exception
null
null
null
null
open
Do you write your own specific Exceptions? === I have some code that gives a user id to a utility that then send email to that user. emailUtil.sendEmail(userId, "foo"); public void sendEmail(String userId, String message) throws MailException { /* ... logic that could throw a MailException */ } `MailException` could be thrown for a number of reasons, problems with the email address, problems with the mail template etc. My question is this: do you create a new Exception type for every one of these exceptions and then deal with them individually or do you create one MailException and then store something in the exception (something computer-readable, not the description text) that allows us to do different things based on what actually happened.
0
21,669
08/22/2008 03:02:34
1,448
08/15/2008 16:16:35
121
15
Complexity of Regex substitution
I didn't get the answer to this anywhere. What is the runtime complexity of a Regex substitution?
regex
complexity
null
null
null
null
open
Complexity of Regex substitution === I didn't get the answer to this anywhere. What is the runtime complexity of a Regex substitution?
0
21,697
08/22/2008 03:12:59
1,894
08/19/2008 07:05:25
66
7
How Do You Communicate Service Layer Messages/Errors to Higher Layers Using MVP?
I'm currently writing an ASP.Net app from the UI down. I'm implementing an MVP architecture because I'm sick of Winforms and wanted something that had a better separation of concerns. So with MVP, the Presenter handles events raised by the View. Here's some code that I have in place to deal with the creation of users: public class CreateMemberPresenter { private ICreateMemberView view; private IMemberTasks tasks; public CreateMemberPresenter(ICreateMemberView view) : this(view, new StubMemberTasks()) { } public CreateMemberPresenter(ICreateMemberView view, IMemberTasks tasks) { this.view = view; this.tasks = tasks; HookupEventHandlersTo(view); } private void HookupEventHandlersTo(ICreateMemberView view) { view.CreateMember += delegate { CreateMember(); }; } private void CreateMember() { if (!view.IsValid) return; try { int newUserId; tasks.CreateMember(view.NewMember, out newUserId); view.NewUserCode = newUserId; view.Notify(new NotificationDTO() { Type = NotificationType.Success }); } catch(Exception e) { this.LogA().Message(string.Format("Error Creating User: {0}", e.Message)); view.Notify(new NotificationDTO() { Type = NotificationType.Failure, Message = "There was an error creating a new member" }); } } } I have my main form validation done using the built in .Net Validation Controls, but now I need to verify that the data sufficiently satisfies the criteria for the Service Layer. Let's say the following Service Layer messages can show up: - E-mail account already exists (failure) - Refering user entered does not exist (failure) - Password length exceeds datastore allowed length (failure) - Member created successfully (success) Let's also say that more rules will be in the service layer that the UI cannot anticipate. Currently I'm having the service layer throw an exception if things didn't go as planned. Is that a sufficent strategy? Does this code smell to you guys? If I wrote a service layer like this would you be annoyed at having to write Presenters that use it in this way? Return codes seem too old school and a bool is just not informative enough.
c#
asp.net
exception
mvp
n-tier
null
open
How Do You Communicate Service Layer Messages/Errors to Higher Layers Using MVP? === I'm currently writing an ASP.Net app from the UI down. I'm implementing an MVP architecture because I'm sick of Winforms and wanted something that had a better separation of concerns. So with MVP, the Presenter handles events raised by the View. Here's some code that I have in place to deal with the creation of users: public class CreateMemberPresenter { private ICreateMemberView view; private IMemberTasks tasks; public CreateMemberPresenter(ICreateMemberView view) : this(view, new StubMemberTasks()) { } public CreateMemberPresenter(ICreateMemberView view, IMemberTasks tasks) { this.view = view; this.tasks = tasks; HookupEventHandlersTo(view); } private void HookupEventHandlersTo(ICreateMemberView view) { view.CreateMember += delegate { CreateMember(); }; } private void CreateMember() { if (!view.IsValid) return; try { int newUserId; tasks.CreateMember(view.NewMember, out newUserId); view.NewUserCode = newUserId; view.Notify(new NotificationDTO() { Type = NotificationType.Success }); } catch(Exception e) { this.LogA().Message(string.Format("Error Creating User: {0}", e.Message)); view.Notify(new NotificationDTO() { Type = NotificationType.Failure, Message = "There was an error creating a new member" }); } } } I have my main form validation done using the built in .Net Validation Controls, but now I need to verify that the data sufficiently satisfies the criteria for the Service Layer. Let's say the following Service Layer messages can show up: - E-mail account already exists (failure) - Refering user entered does not exist (failure) - Password length exceeds datastore allowed length (failure) - Member created successfully (success) Let's also say that more rules will be in the service layer that the UI cannot anticipate. Currently I'm having the service layer throw an exception if things didn't go as planned. Is that a sufficent strategy? Does this code smell to you guys? If I wrote a service layer like this would you be annoyed at having to write Presenters that use it in this way? Return codes seem too old school and a bool is just not informative enough.
0
21,698
08/22/2008 03:13:07
1,306
08/14/2008 13:22:40
11
3
What are the naming conventions of an AS3 class?
I'm trying to write a RegEx to determine a proper class or package name of an AS3 class. I know - Must start with a letter (capital or otherwise) - any other digit can be alphanumeric - cannot have spaces Is there anything else?
actionscript-3
convention
naming
null
null
null
open
What are the naming conventions of an AS3 class? === I'm trying to write a RegEx to determine a proper class or package name of an AS3 class. I know - Must start with a letter (capital or otherwise) - any other digit can be alphanumeric - cannot have spaces Is there anything else?
0
21,715
08/22/2008 03:25:09
1,965
08/19/2008 15:51:08
642
36
List<BusinessObject> or BusinessObjectCollection?
Prior to C# generics, everyone would code collections for their business objects by creating a collection base that implemented IEnumerable IE: public class CollectionBase : IEnumerable and then would derive their Business Object collections from that. public class BusinessObjectCollection : CollectionBase Now with the generic list class, does anyone just use that instead? I've found that I use a compromise of the two techniques: public class BusinessObjectCollection : List<BusinessObject> I do this because I like to have strongly typed names instead of just passing Lists around. What is **your** approach?
c#
collections
generics
null
null
null
open
List<BusinessObject> or BusinessObjectCollection? === Prior to C# generics, everyone would code collections for their business objects by creating a collection base that implemented IEnumerable IE: public class CollectionBase : IEnumerable and then would derive their Business Object collections from that. public class BusinessObjectCollection : CollectionBase Now with the generic list class, does anyone just use that instead? I've found that I use a compromise of the two techniques: public class BusinessObjectCollection : List<BusinessObject> I do this because I like to have strongly typed names instead of just passing Lists around. What is **your** approach?
0
21,738
08/22/2008 03:43:41
1,471
08/15/2008 18:26:14
166
17
Problems running Swing application with IDEA 8M1
Is anyone else having trouble running Swing applications from IntelliJ IDEA 8 Milestone 1? Even the simplest application of showing an empty JFrame seems to crash the JVM. I don't get a stack trace or anything, it looks like the JVM itself crashes and Windows shows me a pop-up that says the usual "This process is no longer responding" message. Console applications work fine, and my Swing code works fine when launching from Netbeans or from the command line. I'm running Windows Vista x64 with the JDK 1.6 Update 10 beta, which may be a configuration the Jetbrains guys haven't run into yet.
java
ide
swing
ideas
jvm
null
open
Problems running Swing application with IDEA 8M1 === Is anyone else having trouble running Swing applications from IntelliJ IDEA 8 Milestone 1? Even the simplest application of showing an empty JFrame seems to crash the JVM. I don't get a stack trace or anything, it looks like the JVM itself crashes and Windows shows me a pop-up that says the usual "This process is no longer responding" message. Console applications work fine, and my Swing code works fine when launching from Netbeans or from the command line. I'm running Windows Vista x64 with the JDK 1.6 Update 10 beta, which may be a configuration the Jetbrains guys haven't run into yet.
0
21,749
08/22/2008 03:51:42
2,219
08/21/2008 00:28:05
1
0
Multiple form Delphi applications and dialogs
I have a Delphi application that has two views of a document (e.g. a WYSIWYG HTML edit might have a WYSIWYG view and a source view). They can be opened in separate windows, or docked into tabs in the main window. If I open a dialog from one of the separate forms, the main form is brought to the front, and is shown as the selected window in the windows taskbar. Say the main form is the WYSIWYG view, and the source view is poped out. You go to a particular point in the source view and insert an image tag. A dialog appears to allow you to select and enter the properties you want for the image. If the WYSIWYG view and the source view overlap, the WYSIWYG view will be brought to the front and the source view is hidden. Once the dialog is dismissed, the source view comes back into sight. I've tried setting the owner and the ParentWindow properties to the form it is related to: <blockquote><code>dialog := TDialogForm.Create( parentForm );<br> dialog.ParentWindow := parentForm.Handle; </code></blockquote> How can I fix this problem? What else should I be trying?
delphi
null
null
null
null
null
open
Multiple form Delphi applications and dialogs === I have a Delphi application that has two views of a document (e.g. a WYSIWYG HTML edit might have a WYSIWYG view and a source view). They can be opened in separate windows, or docked into tabs in the main window. If I open a dialog from one of the separate forms, the main form is brought to the front, and is shown as the selected window in the windows taskbar. Say the main form is the WYSIWYG view, and the source view is poped out. You go to a particular point in the source view and insert an image tag. A dialog appears to allow you to select and enter the properties you want for the image. If the WYSIWYG view and the source view overlap, the WYSIWYG view will be brought to the front and the source view is hidden. Once the dialog is dismissed, the source view comes back into sight. I've tried setting the owner and the ParentWindow properties to the form it is related to: <blockquote><code>dialog := TDialogForm.Create( parentForm );<br> dialog.ParentWindow := parentForm.Handle; </code></blockquote> How can I fix this problem? What else should I be trying?
0
21,753
08/22/2008 03:58:10
2,418
08/22/2008 03:32:43
1
0
How to use BITS to download from a UNC path?
Whats the best way to distribute files to users in remote offices, using [BITS][1] with a UNC path or BITS with HTTP? I have a VB.NET project which downloads from a HTTP path currently but there is added complexity involved (having a web server, etc). Or is there a better way to do this? Low bandwith usage is more important than speed of synching. [1]: http://en.wikipedia.org/wiki/Background_Intelligent_Transfer_Service "BITS"
vb.net
bits
null
null
null
null
open
How to use BITS to download from a UNC path? === Whats the best way to distribute files to users in remote offices, using [BITS][1] with a UNC path or BITS with HTTP? I have a VB.NET project which downloads from a HTTP path currently but there is added complexity involved (having a web server, etc). Or is there a better way to do this? Low bandwith usage is more important than speed of synching. [1]: http://en.wikipedia.org/wiki/Background_Intelligent_Transfer_Service "BITS"
0
21,766
08/22/2008 04:20:07
2,424
08/22/2008 04:09:40
1
0
Open source rules engine with decent interface for writing rules
I'm trying to locate an open source business rules engine that has a decent interface for building the rules. OR at least one that works well on the .Net platform and has been updated sometime in the past 12 months. Thanks,
ruleengine
null
null
null
null
null
open
Open source rules engine with decent interface for writing rules === I'm trying to locate an open source business rules engine that has a decent interface for building the rules. OR at least one that works well on the .Net platform and has been updated sometime in the past 12 months. Thanks,
0
21,817
08/22/2008 05:16:43
2,238
08/21/2008 05:51:27
33
3
Why can't I declare static methods in an interface?
The topic says the most of it - what is the reason for the fact that static methods can't be declared in an interface? public interface ITest { public static String test(); } The code above gives me the following error (in Eclipse, at least): "Illegal modifier for the interface method ITest.test(); only public & abstract are permitted".
java
interface
methods
static
null
null
open
Why can't I declare static methods in an interface? === The topic says the most of it - what is the reason for the fact that static methods can't be declared in an interface? public interface ITest { public static String test(); } The code above gives me the following error (in Eclipse, at least): "Illegal modifier for the interface method ITest.test(); only public & abstract are permitted".
0
21,848
08/22/2008 05:39:54
2,427
08/22/2008 05:39:54
1
0
Switch branch names in git
There may be more than one way to ask this question, so here's a desciption of the problem. I was working on master and committed some stuff and then decided I wanted to put that work on hold. I backed up a few commits and then branched from before I started my crap work. Practically this works fine, I just now have a different branch as my main development branch. I'm wondering how I could change things around so I'm working on master again but it doesn't have my junk work and said work is on a different branch. Some ways this could be asked/solved: How do I rename my master branch to something else and then rename something else to master? How do I back up master and then cause all commits I've backed up past to be on a different branch? Thanks!
git
branch
null
null
null
null
open
Switch branch names in git === There may be more than one way to ask this question, so here's a desciption of the problem. I was working on master and committed some stuff and then decided I wanted to put that work on hold. I backed up a few commits and then branched from before I started my crap work. Practically this works fine, I just now have a different branch as my main development branch. I'm wondering how I could change things around so I'm working on master again but it doesn't have my junk work and said work is on a different branch. Some ways this could be asked/solved: How do I rename my master branch to something else and then rename something else to master? How do I back up master and then cause all commits I've backed up past to be on a different branch? Thanks!
0
21,857
08/22/2008 05:47:10
2,056
08/20/2008 01:28:00
39
2
When do you know it's time to rewrite an application
This is humbling, but probably something most can relate to. I am currently adding functionality to a PHP application I wrote for a client 2 years ago. In the interest of full disclosure, this was the first "real" application I ever built from the ground up, in the sense that I actually met with clients to determine and write a spec. I then built the application by myself, learning SQL as I went (I had some prior rudimentary PHP experience). The client contacted me this week to make modifications to existing functionality as well as add new modules to the application. I realize now that I did a poor job of modularizing the application from the start to make additions easier. Currently, the code base is almost 20,000 lines of code (it is a fairly sophisticated, if narrow application). I'm struggling with whether or not to "rewrite" the application to make future changes easier and more efficient. I should point out that the nature of my agreement with the client is one in which I will be the only person making modifications in the future. They will not seek another developer for this app. The budding programmer in me always wants to do things in the cleanest and most efficient way in order to satisfy my own OCD, but I do intend to bill the client for any time I spend rewriting. Morally, I feel fine with this because the initial rate that I charged them was low - they got a stable, working app which has been performing without any intervention from me for 2 years, and I got my first real development project on my resume. My dilemma is about when to decide to rewrite an application for the sake of future development. Please weigh in with your thoughts. I'm sure I'm not the only one who has ever had this problem. If anybody has any questions for me that will help them with an answer, I'm now addicted to this site and will respond quickly :) Thanks, KN
php
mysql
rewrite
refactor
billing
null
open
When do you know it's time to rewrite an application === This is humbling, but probably something most can relate to. I am currently adding functionality to a PHP application I wrote for a client 2 years ago. In the interest of full disclosure, this was the first "real" application I ever built from the ground up, in the sense that I actually met with clients to determine and write a spec. I then built the application by myself, learning SQL as I went (I had some prior rudimentary PHP experience). The client contacted me this week to make modifications to existing functionality as well as add new modules to the application. I realize now that I did a poor job of modularizing the application from the start to make additions easier. Currently, the code base is almost 20,000 lines of code (it is a fairly sophisticated, if narrow application). I'm struggling with whether or not to "rewrite" the application to make future changes easier and more efficient. I should point out that the nature of my agreement with the client is one in which I will be the only person making modifications in the future. They will not seek another developer for this app. The budding programmer in me always wants to do things in the cleanest and most efficient way in order to satisfy my own OCD, but I do intend to bill the client for any time I spend rewriting. Morally, I feel fine with this because the initial rate that I charged them was low - they got a stable, working app which has been performing without any intervention from me for 2 years, and I got my first real development project on my resume. My dilemma is about when to decide to rewrite an application for the sake of future development. Please weigh in with your thoughts. I'm sure I'm not the only one who has ever had this problem. If anybody has any questions for me that will help them with an answer, I'm now addicted to this site and will respond quickly :) Thanks, KN
0
21,869
08/22/2008 06:04:43
861
08/09/2008 19:00:40
64
3
What skills do you need for proper UI/Interaction/Functional design in Web Apps?
When you to develop web applications from scratch, what are the skills needed, to produce usable and interaction-rich products? Do you do UI Prototype first? Do you use User Stories? Some agile methodology or best practice you'd recommend or actively advocate? In short: _**What skills make you transcend from requirements gathering to AmazingWebApp™?**_
bestpractices
project-management
web-applications
null
null
null
open
What skills do you need for proper UI/Interaction/Functional design in Web Apps? === When you to develop web applications from scratch, what are the skills needed, to produce usable and interaction-rich products? Do you do UI Prototype first? Do you use User Stories? Some agile methodology or best practice you'd recommend or actively advocate? In short: _**What skills make you transcend from requirements gathering to AmazingWebApp™?**_
0
21,870
08/22/2008 06:07:29
150
08/02/2008 16:09:34
446
12
System.Web.Caching vs. Enterprise Library Caching Block
For a .NET component that will be used in both web applications and rich client applications, there seem to be two obvious options for caching: System.Web.Caching or the Ent. Lib. Caching Block. - What do you use? - Why? ## [System.Web.Caching](http://msdn.microsoft.com/en-us/library/system.web.caching.aspx) Is this safe to use outside of web apps? I've seen mixed information, but I think the answer is maybe-kind-of-not-really. - [a KB article warning against 1.0 and 1.1 non web app use](http://support.microsoft.com/kb/917411) - The 2.0 page has a *comment* that indicates it's OK: <http://msdn.microsoft.com/en-us/library/system.web.caching.cache(VS.80).aspx> - [Scott Hanselman is creeped out by the notion](http://www.hanselman.com/blog/UsingTheASPNETCacheOutsideOfASPNET.aspx) - [The 3.5 page](http://msdn.microsoft.com/en-us/library/system.web.caching.cache.aspx) includes a warning against such use - Rob Howard [encouraged use outside of web apps](http://weblogs.asp.net/cschittko/archive/2004/07/04/172684.aspx) I don't expect to use one of its highlights, [SqlCacheDependency](http://msdn.microsoft.com/en-us/library/system.web.caching.sqlcachedependency.aspx), but the addition of [CacheItemUpdateCallback](http://msdn.microsoft.com/en-us/library/system.web.caching.cacheitemupdatecallback.aspx) in .NET 3.5 seems like a Really Good Thing. ## [Enterprise Library Caching Application Block](http://msdn.microsoft.com/en-us/library/aa480453.aspx) - other blocks are already in use so the dependency already exists - cache persistence isn't necessary; regenerating the cache on restart is OK Getting a callback *after* an item has been removed is not very convenient for cache items that ought to be available all the time. It looks like a client will have to just sleep and poll until the cache item is repopulated.
caching
.net-2.0
enterpriselibrary
null
null
null
open
System.Web.Caching vs. Enterprise Library Caching Block === For a .NET component that will be used in both web applications and rich client applications, there seem to be two obvious options for caching: System.Web.Caching or the Ent. Lib. Caching Block. - What do you use? - Why? ## [System.Web.Caching](http://msdn.microsoft.com/en-us/library/system.web.caching.aspx) Is this safe to use outside of web apps? I've seen mixed information, but I think the answer is maybe-kind-of-not-really. - [a KB article warning against 1.0 and 1.1 non web app use](http://support.microsoft.com/kb/917411) - The 2.0 page has a *comment* that indicates it's OK: <http://msdn.microsoft.com/en-us/library/system.web.caching.cache(VS.80).aspx> - [Scott Hanselman is creeped out by the notion](http://www.hanselman.com/blog/UsingTheASPNETCacheOutsideOfASPNET.aspx) - [The 3.5 page](http://msdn.microsoft.com/en-us/library/system.web.caching.cache.aspx) includes a warning against such use - Rob Howard [encouraged use outside of web apps](http://weblogs.asp.net/cschittko/archive/2004/07/04/172684.aspx) I don't expect to use one of its highlights, [SqlCacheDependency](http://msdn.microsoft.com/en-us/library/system.web.caching.sqlcachedependency.aspx), but the addition of [CacheItemUpdateCallback](http://msdn.microsoft.com/en-us/library/system.web.caching.cacheitemupdatecallback.aspx) in .NET 3.5 seems like a Really Good Thing. ## [Enterprise Library Caching Application Block](http://msdn.microsoft.com/en-us/library/aa480453.aspx) - other blocks are already in use so the dependency already exists - cache persistence isn't necessary; regenerating the cache on restart is OK Getting a callback *after* an item has been removed is not very convenient for cache items that ought to be available all the time. It looks like a client will have to just sleep and poll until the cache item is repopulated.
0
21,877
08/22/2008 06:14:06
932
08/10/2008 18:44:53
1
0
Dynamically Rendering asp:Image from BLOB entry in ASP.NET
What I want to achieve is this. I want to give the user the ability to upload an image file, store the image in BLOB in SQL Server, and then use this image as a logo in other pages of the site. I have done this by using Response.Clear(); Response.ContentType = "image/pjpeg"; Response.BinaryWrite(imageConents); Response.End(); but to do this, I use a User control in the place where I want to show the image. I want to do it if possible using an asp:Image control, or even a pure old html image control. Is this possible? Thank you all
asp.net
null
null
null
null
null
open
Dynamically Rendering asp:Image from BLOB entry in ASP.NET === What I want to achieve is this. I want to give the user the ability to upload an image file, store the image in BLOB in SQL Server, and then use this image as a logo in other pages of the site. I have done this by using Response.Clear(); Response.ContentType = "image/pjpeg"; Response.BinaryWrite(imageConents); Response.End(); but to do this, I use a User control in the place where I want to show the image. I want to do it if possible using an asp:Image control, or even a pure old html image control. Is this possible? Thank you all
0