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
72,789
09/16/2008 14:17:51
12,117
09/16/2008 13:15:28
11
1
Change app icon in Visual Studio 2005?
I'd like to use a different icon for the demo version of my game, and I'm building the demo with a different build config than I do for the full verison, using a preprocessor define to lockout some content, use different graphics, etc. Is there a way that I can make Visual Studio use a different icon for the app Icon in the demo config but continue to use the regular icon for the full version's config?
c++
visual-studio-2005
icons
null
null
null
open
Change app icon in Visual Studio 2005? === I'd like to use a different icon for the demo version of my game, and I'm building the demo with a different build config than I do for the full verison, using a preprocessor define to lockout some content, use different graphics, etc. Is there a way that I can make Visual Studio use a different icon for the app Icon in the demo config but continue to use the regular icon for the full version's config?
0
72,799
09/16/2008 14:18:25
11,994
09/16/2008 12:47:20
1
0
Qt or Delphi... If you were to choose one over the other?
If you had a differential of either venturing into Delphi land or Qt land which would you choose? I know they are not totally comparable. I for one have Windows development experience with Builder C++ (almost Delphi) and MFC (almost Qt), with a bit more time working with Builder C++. Please take out the cross platform ability of Qt in your analysis. Thank you in advance for your replies.
qt
delphi
null
null
null
null
open
Qt or Delphi... If you were to choose one over the other? === If you had a differential of either venturing into Delphi land or Qt land which would you choose? I know they are not totally comparable. I for one have Windows development experience with Builder C++ (almost Delphi) and MFC (almost Qt), with a bit more time working with Builder C++. Please take out the cross platform ability of Qt in your analysis. Thank you in advance for your replies.
0
72,829
09/16/2008 14:21:31
12,298
09/16/2008 13:55:23
11
1
WSDL Generation Tools
Can anyone recommend a good (preferably open source) tool for creating WSDL files for some soap web services? I've tried playing around with some of the eclipse plug ins available and was less than impressed with what I found.
soap
wsdl
null
null
null
null
open
WSDL Generation Tools === Can anyone recommend a good (preferably open source) tool for creating WSDL files for some soap web services? I've tried playing around with some of the eclipse plug ins available and was less than impressed with what I found.
0
72,831
09/16/2008 14:21:37
9,938
09/15/2008 20:31:28
95
0
How do I capitalize first letter of first name and last name in C#?
Is there an easy way to capitalize the first letter of a string and lower the rest of it? Is there a built in method or do I need to make my own?
c#
null
null
null
null
null
open
How do I capitalize first letter of first name and last name in C#? === Is there an easy way to capitalize the first letter of a string and lower the rest of it? Is there a built in method or do I need to make my own?
0
72,832
09/16/2008 14:21:38
8,547
09/15/2008 16:18:49
66
2
Can I supress FX Cop code analysis violations globaly?
When you use Visual Studio's code analysic (FxCop), and want to supress a message there are 3 options. 1. Supress a violation in code. 2. Supress a violation in a GlobalSupression.cs file. 3. Disable the violation check in the project file (via Project -> Properties -> Code Analysic). The later is very hard to review when checking in to Source Control, and it is hard to get an overview of all disabled vioaltions. So we would like to use option 2. The problem with option 1 and 2 is that you get one supression line for each violation. E.g like: [assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Company.Project.Namespace2")] [assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Company.Project.Namespace1")] We would love to do something like this ing GlobalSuppressions.cs: [assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes")] But is this possible? How are you solving this?
.net
visual-studio
code-analysis
null
null
null
open
Can I supress FX Cop code analysis violations globaly? === When you use Visual Studio's code analysic (FxCop), and want to supress a message there are 3 options. 1. Supress a violation in code. 2. Supress a violation in a GlobalSupression.cs file. 3. Disable the violation check in the project file (via Project -> Properties -> Code Analysic). The later is very hard to review when checking in to Source Control, and it is hard to get an overview of all disabled vioaltions. So we would like to use option 2. The problem with option 1 and 2 is that you get one supression line for each violation. E.g like: [assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Company.Project.Namespace2")] [assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Company.Project.Namespace1")] We would love to do something like this ing GlobalSuppressions.cs: [assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes")] But is this possible? How are you solving this?
0
72,852
09/16/2008 14:24:02
3,497
08/28/2008 19:06:00
34
6
How to do relative imports in Python?
Imagine this directory structure: app/ __init__.py sub1/ __init__.py mod1.py sub2/ __init__.py mod2.py I'm coding mod1, and I need to import something from mod2.. How should I do it? I tried from ..sub2 import mod2 but I'm getting an "Attempted relative import in non-package".. I googled around but found only "sys.path manipulation" hacks.. Isn't there a clean way? Many thanks
python
null
null
null
null
null
open
How to do relative imports in Python? === Imagine this directory structure: app/ __init__.py sub1/ __init__.py mod1.py sub2/ __init__.py mod2.py I'm coding mod1, and I need to import something from mod2.. How should I do it? I tried from ..sub2 import mod2 but I'm getting an "Attempted relative import in non-package".. I googled around but found only "sys.path manipulation" hacks.. Isn't there a clean way? Many thanks
0
72,858
09/16/2008 14:24:47
11,927
09/16/2008 12:24:14
1
1
How to backup a VPS server? And restore it in an emergency too?
I have a VPS host running 3 sites using Ubuntu Hardy. I've spent much time setting it up. That includes all the installation + configuration and stuff. What ways are there to do backup + restore for VPS?
backup
null
null
null
null
null
open
How to backup a VPS server? And restore it in an emergency too? === I have a VPS host running 3 sites using Ubuntu Hardy. I've spent much time setting it up. That includes all the installation + configuration and stuff. What ways are there to do backup + restore for VPS?
0
72,860
09/16/2008 14:24:54
11,886
09/16/2008 12:03:35
1
2
Understandable documentation about R?
Does there exist understandable Free documentation for the R programming language, which is accessible to statistics-impaired people? The ideal documentation would include also motivation (an example) for using each statistical function.
documentation
tutorials
r
null
null
12/02/2011 01:55:02
not constructive
Understandable documentation about R? === Does there exist understandable Free documentation for the R programming language, which is accessible to statistics-impaired people? The ideal documentation would include also motivation (an example) for using each statistical function.
4
72,872
09/16/2008 14:25:22
12,452
09/16/2008 14:25:21
1
0
ASP.Net Redirect Response to a IFrame
How can I redirect the response to an IFrame?
asp.net
null
null
null
null
null
open
ASP.Net Redirect Response to a IFrame === How can I redirect the response to an IFrame?
0
72,879
09/16/2008 14:25:43
12,019
09/16/2008 12:52:54
1
0
Refactoring in Ruby
Are there any programs or IDEs that support refactoring for Ruby or RoR?
ruby
rubyonrails
refactoring
null
null
null
open
Refactoring in Ruby === Are there any programs or IDEs that support refactoring for Ruby or RoR?
0
72,893
09/16/2008 14:27:18
7,072
09/15/2008 13:07:03
8
0
What's the best way to learn C# quickly?
We have a team of Delphi developers at work who need to get up to speed and start coding in C#. We've been asked to describe how we learned C#. I can't quite figure out how I learned. My only recommendation has been to check out [MSDN Beginner Developer Learning Center][1] [Scott Gu's Blog][2] and to pick up this book: [C# 3.0 Pocket Reference][3] Any other suggestions? [1]: http://msdn.microsoft.com/en-us/beginner/default.aspx [2]: http://weblogs.asp.net/scottgu/ [3]: http://www.amazon.com/3-0-Pocket-Reference-Instant-Programmers/dp/0596519222
c#
null
null
null
null
null
open
What's the best way to learn C# quickly? === We have a team of Delphi developers at work who need to get up to speed and start coding in C#. We've been asked to describe how we learned C#. I can't quite figure out how I learned. My only recommendation has been to check out [MSDN Beginner Developer Learning Center][1] [Scott Gu's Blog][2] and to pick up this book: [C# 3.0 Pocket Reference][3] Any other suggestions? [1]: http://msdn.microsoft.com/en-us/beginner/default.aspx [2]: http://weblogs.asp.net/scottgu/ [3]: http://www.amazon.com/3-0-Pocket-Reference-Instant-Programmers/dp/0596519222
0
72,895
09/16/2008 14:27:26
12,356
09/16/2008 14:04:23
1
1
Is Async Messaging (In particular pub/sub style messaging) viable as a domain service architecture or only in an SOA-focused environment?
I have been researching asynchronous messaging, and I like the way it elegantly deals with some problems within certain domains and how it makes domain concepts more explicit. But is it a viable pattern for general domain-driven development (at least in the service/application/controller layer), or is the design overhead such that it should be restricted to SOA-based scenarios, like remote services and distributed processing?
soa
messaging
null
null
null
null
open
Is Async Messaging (In particular pub/sub style messaging) viable as a domain service architecture or only in an SOA-focused environment? === I have been researching asynchronous messaging, and I like the way it elegantly deals with some problems within certain domains and how it makes domain concepts more explicit. But is it a viable pattern for general domain-driven development (at least in the service/application/controller layer), or is the design overhead such that it should be restricted to SOA-based scenarios, like remote services and distributed processing?
0
72,899
09/16/2008 14:27:47
12,398
09/16/2008 14:15:15
1
0
In Python how do I sort a list of dictionaries by values of the dictionary?
I got a list of dictionaries and want that to be sorted by a value of that dictionary. This [{'name'='Homer', 'age'=39}, {'name'='Bart', 'age'=10}] sorted by name, should become [{'name'='Bart', 'age'=10}, {'name'='Homer', 'age'=39}]
python
list
dictionary
sorting
null
null
open
In Python how do I sort a list of dictionaries by values of the dictionary? === I got a list of dictionaries and want that to be sorted by a value of that dictionary. This [{'name'='Homer', 'age'=39}, {'name'='Bart', 'age'=10}] sorted by name, should become [{'name'='Bart', 'age'=10}, {'name'='Homer', 'age'=39}]
0
11,193,186
06/25/2012 16:20:05
1,047,883
11/15/2011 15:19:35
174
2
Roll over information
I have a form with two combo boxes and couple of buttons. One of the buttons (called "Roll Over") is for rolling over data from the previous year. When clicked it should be able to grab the data from the previous year and insert in the form for the next year. I have written the code but it does not insert the data when clicked on the button instead it inserts the data after the form has been opened once. For example: I click on "Roll Over" and then I click on a form, the form opens up but there is no data. I close the form. Click on "Roll Over" again. I open the form again and the data has been inserted. I am not sure why it doesn't let me insert the data without the form being opened at least once. Here is what my code looks like: Form_1_Test.Text10 = DLookup("Legal_Name", "1_Test", "[Program_Name] = '" & Replace([Combo2], "'", "''") & "' And [BudgetYear] = " & ([Combo0] - 1))
ms-access
access-vba
null
null
null
null
open
Roll over information === I have a form with two combo boxes and couple of buttons. One of the buttons (called "Roll Over") is for rolling over data from the previous year. When clicked it should be able to grab the data from the previous year and insert in the form for the next year. I have written the code but it does not insert the data when clicked on the button instead it inserts the data after the form has been opened once. For example: I click on "Roll Over" and then I click on a form, the form opens up but there is no data. I close the form. Click on "Roll Over" again. I open the form again and the data has been inserted. I am not sure why it doesn't let me insert the data without the form being opened at least once. Here is what my code looks like: Form_1_Test.Text10 = DLookup("Legal_Name", "1_Test", "[Program_Name] = '" & Replace([Combo2], "'", "''") & "' And [BudgetYear] = " & ([Combo0] - 1))
0
11,193,082
06/25/2012 16:12:52
1,023,866
11/01/2011 14:16:18
123
6
Cocos2d-iphone : Handle Button Press and Release
Actually i need to move my sprite as long as button is pressed and sprite should be stopped when button is released. My code is below CCMenuItemFont *item1 = [CCMenuItemFont itemFromString: @"icon.png" target:self selector:@selector(doit)]; -void()doit { spritevelocity = 80; } The Above code makes my sprite keep on moving once button is tapped.But i need to stop my sprite as soon as button is released. I tried below code but no success -void()doit { buttonpressed = YES; if (buttonpressed) { spritevelocity = 80; } } - (void)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { buttonpressed = NO; }
iphone
ios
cocos2d-iphone
null
null
null
open
Cocos2d-iphone : Handle Button Press and Release === Actually i need to move my sprite as long as button is pressed and sprite should be stopped when button is released. My code is below CCMenuItemFont *item1 = [CCMenuItemFont itemFromString: @"icon.png" target:self selector:@selector(doit)]; -void()doit { spritevelocity = 80; } The Above code makes my sprite keep on moving once button is tapped.But i need to stop my sprite as soon as button is released. I tried below code but no success -void()doit { buttonpressed = YES; if (buttonpressed) { spritevelocity = 80; } } - (void)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { buttonpressed = NO; }
0
11,193,083
06/25/2012 16:12:54
1,339,609
04/17/2012 19:28:46
6
1
Open Theme.Dialog and go to EditText
In my Theme.Dialog I have long text and on same bottom EditText. When I open Theme.Dialog brings me to the bottom of the EditText, and you see something that needs to scroll. I would not like me, were moving to the bottom. Does anyone have any ideas?
android
null
null
null
null
null
open
Open Theme.Dialog and go to EditText === In my Theme.Dialog I have long text and on same bottom EditText. When I open Theme.Dialog brings me to the bottom of the EditText, and you see something that needs to scroll. I would not like me, were moving to the bottom. Does anyone have any ideas?
0
11,193,085
06/25/2012 16:13:03
1,480,002
06/25/2012 12:44:20
1
0
opengl immediate mode, simple FBO: render to texture
I'm working on this basic implementation on a FBO and render to texture. I want to keep it simple so I'm using immediate mode and no shaders. Using a more correct way, using shaders, vbo, vao would be the next step. I'm running Mac 10.6 with glfw. The functions order is update()" then "draw()" (called from the main loop). See the code here: https://gist.github.com/e8c9825c6275369e644f The problem is that the texture to which I render isn't showing the quad that I draw in drawScene. What am I doing wrong here? D
c++
opengl
render
fbo
glfw
null
open
opengl immediate mode, simple FBO: render to texture === I'm working on this basic implementation on a FBO and render to texture. I want to keep it simple so I'm using immediate mode and no shaders. Using a more correct way, using shaders, vbo, vao would be the next step. I'm running Mac 10.6 with glfw. The functions order is update()" then "draw()" (called from the main loop). See the code here: https://gist.github.com/e8c9825c6275369e644f The problem is that the texture to which I render isn't showing the quad that I draw in drawScene. What am I doing wrong here? D
0
11,193,197
06/25/2012 16:21:30
1,479,043
06/25/2012 04:41:16
-13
0
I have a sql querry trying to get it to display correctly
my current query "SELECT * FROM `dist` JOIN `patientacct` ON patientacct.dist LIKE CONCAT('%', `dist`.name ,'%')" the output in sql Find the image at http://i.stack.imgur.com/FUpUM.jpg cant post images currently My desired look on the web page is Find the image at http://i.stack.imgur.com/QGU8c.jpg cant post images currently This is I believe a php issue but im not sure how to set up a statement that would display such! My current php is : <?php require_once('Connections/check.php'); mysql_select_db($database_check, $check); $patient_sql = "SELECT * FROM `dist` JOIN `patientacct` ON patientacct.dist LIKE CONCAT('%', `dist`.name ,'%')"; $patient_query = mysql_query($patient_sql) or die(mysql_error()); $rspatient = mysql_fetch_assoc($patient_query); ?> <?php do {?> <form name="form1" method="post" action=""> <table width="100%" border="0" cellpadding="0"> <tr> <td width="96%" class="c"><?php echo $rspatient['name']?>&nbsp;&nbsp;&nbsp;&nbsp; <?php echo $rspatient['phone'] ?> &nbsp;&nbsp;&nbsp;&nbsp;<?php echo $rspatient['acctnum'] ?></td> <td width="4%" class="r"> <input type="checkbox" name="chk[]" value="<?php echo $rspatient['name']?>" id="chk <?php echo $a++?>" onclick="getVal()" class="chk"> </td> </tr> <tr> <td class="c"><?php echo $rspatient['lines'] ?></td> <td>&nbsp;</td> </tr> </table> <table width="100%" border="1" cellpadding="0"> <tr> <td><?php echo $rspatient['frameman'] ?></td> <td><?php echo $rspatient['framemodel'] ?></td> </tr> </table> <br> <hr> <br> <?php } while ($rspatient = mysql_fetch_assoc($patient_query)) ?>
php
mysql
sql
null
null
null
open
I have a sql querry trying to get it to display correctly === my current query "SELECT * FROM `dist` JOIN `patientacct` ON patientacct.dist LIKE CONCAT('%', `dist`.name ,'%')" the output in sql Find the image at http://i.stack.imgur.com/FUpUM.jpg cant post images currently My desired look on the web page is Find the image at http://i.stack.imgur.com/QGU8c.jpg cant post images currently This is I believe a php issue but im not sure how to set up a statement that would display such! My current php is : <?php require_once('Connections/check.php'); mysql_select_db($database_check, $check); $patient_sql = "SELECT * FROM `dist` JOIN `patientacct` ON patientacct.dist LIKE CONCAT('%', `dist`.name ,'%')"; $patient_query = mysql_query($patient_sql) or die(mysql_error()); $rspatient = mysql_fetch_assoc($patient_query); ?> <?php do {?> <form name="form1" method="post" action=""> <table width="100%" border="0" cellpadding="0"> <tr> <td width="96%" class="c"><?php echo $rspatient['name']?>&nbsp;&nbsp;&nbsp;&nbsp; <?php echo $rspatient['phone'] ?> &nbsp;&nbsp;&nbsp;&nbsp;<?php echo $rspatient['acctnum'] ?></td> <td width="4%" class="r"> <input type="checkbox" name="chk[]" value="<?php echo $rspatient['name']?>" id="chk <?php echo $a++?>" onclick="getVal()" class="chk"> </td> </tr> <tr> <td class="c"><?php echo $rspatient['lines'] ?></td> <td>&nbsp;</td> </tr> </table> <table width="100%" border="1" cellpadding="0"> <tr> <td><?php echo $rspatient['frameman'] ?></td> <td><?php echo $rspatient['framemodel'] ?></td> </tr> </table> <br> <hr> <br> <?php } while ($rspatient = mysql_fetch_assoc($patient_query)) ?>
0
11,193,199
06/25/2012 16:21:48
1,455,364
06/14/2012 05:32:36
17
0
How to Customize quickform drupal module
I have added a drupal module called quickform. I wish to customize the layout. For instance, there is a submit button when i create the form, but i want to change it to an image. Where do i change this? I am new to drupal so i don't really know if my question is clear enough! Please help!
drupal-7
drupal-modules
null
null
null
null
open
How to Customize quickform drupal module === I have added a drupal module called quickform. I wish to customize the layout. For instance, there is a submit button when i create the form, but i want to change it to an image. Where do i change this? I am new to drupal so i don't really know if my question is clear enough! Please help!
0
11,193,203
06/25/2012 16:22:07
589,577
01/25/2011 19:46:38
110
7
DataGridColumn SortMemberPath on MultiBinding
I'm trying to have column sort on numeric content. Multi-binding converter works fine. This solution will set SortMemberPath to null I've tried a variety of ways, and scoured the internet substantially. Code has been modified from original for security purposes. <DataGridTemplateColumn x:Name="avgPriceColumn"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBlock> <TextBlock.Text> <MultiBinding Converter="{StaticResource avgPriceConverter}"> <Binding Path="NumberToDivideBy" /> <Binding Path="TotalDollars" /> </MultiBinding> </TextBlock.Text> </TextBlock> </DataTemplate> </DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.SortMemberPath> <MultiBinding Converter="{StaticResource avgPriceConverter}"> <Binding Path="NumberToDivideBy" /> <Binding Path="TotalDollars" /> </MultiBinding> </DataGridTemplateColumn.SortMemberPath> </DataGridTemplateColumn>
c#
wpf
xaml
binding
multibinding
null
open
DataGridColumn SortMemberPath on MultiBinding === I'm trying to have column sort on numeric content. Multi-binding converter works fine. This solution will set SortMemberPath to null I've tried a variety of ways, and scoured the internet substantially. Code has been modified from original for security purposes. <DataGridTemplateColumn x:Name="avgPriceColumn"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBlock> <TextBlock.Text> <MultiBinding Converter="{StaticResource avgPriceConverter}"> <Binding Path="NumberToDivideBy" /> <Binding Path="TotalDollars" /> </MultiBinding> </TextBlock.Text> </TextBlock> </DataTemplate> </DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.SortMemberPath> <MultiBinding Converter="{StaticResource avgPriceConverter}"> <Binding Path="NumberToDivideBy" /> <Binding Path="TotalDollars" /> </MultiBinding> </DataGridTemplateColumn.SortMemberPath> </DataGridTemplateColumn>
0
11,193,207
06/25/2012 16:22:15
114,518
05/29/2009 19:36:15
553
2
How can I alter the FixedTableHeader jQuery plugin to have a fixed first column as well?
I'm using a jQuery plugin from here [http://www.tablefixedheader.com/][1] to make a snazzy table with a fixed heading, sorting and other cool features. Now, I've also looked at jqGrid, which looks ridiculously awesome, but we are doing some funky things with our data source and I don't think it is quite ready to play well with jqGrid. Anyways, my bosses want the first column of the table I created to be fixed, so they can scroll on the x-axis, but still see the first column. How can I modify this plugin to provide this functionality? Any help is greatly appreciated Thanks [1]: http://www.tablefixedheader.com/
javascript
jquery
html
css
jquery-plugins
null
open
How can I alter the FixedTableHeader jQuery plugin to have a fixed first column as well? === I'm using a jQuery plugin from here [http://www.tablefixedheader.com/][1] to make a snazzy table with a fixed heading, sorting and other cool features. Now, I've also looked at jqGrid, which looks ridiculously awesome, but we are doing some funky things with our data source and I don't think it is quite ready to play well with jqGrid. Anyways, my bosses want the first column of the table I created to be fixed, so they can scroll on the x-axis, but still see the first column. How can I modify this plugin to provide this functionality? Any help is greatly appreciated Thanks [1]: http://www.tablefixedheader.com/
0
11,193,208
06/25/2012 16:22:17
1,228,479
02/23/2012 13:42:01
51
3
Expose ports on Azure VMRole
Can we expose ports on a Azure VMRole after we have published the project onto Azure? Probably using Azure Powershell cmdlets or some other way. At present, I am deleting the VMRole and adding new endpoints on my project (Visual Studio Azure Project) and re-publish it.
powershell
azure
azure-vm-role
null
null
null
open
Expose ports on Azure VMRole === Can we expose ports on a Azure VMRole after we have published the project onto Azure? Probably using Azure Powershell cmdlets or some other way. At present, I am deleting the VMRole and adding new endpoints on my project (Visual Studio Azure Project) and re-publish it.
0
11,193,211
06/25/2012 16:22:32
69,636
02/22/2009 18:35:54
3,047
100
fake model response in backbone.js
How can I fake a REST response in my model s.t. it does not really go to the service but returns a fixed json? If possible show me a version that does it with overriding sync() and a version that overrides fetch(). I failed with both so this will be a good education for as for the difference between them.
backbone.js
null
null
null
null
null
open
fake model response in backbone.js === How can I fake a REST response in my model s.t. it does not really go to the service but returns a fixed json? If possible show me a version that does it with overriding sync() and a version that overrides fetch(). I failed with both so this will be a good education for as for the difference between them.
0
11,193,212
06/25/2012 16:22:35
250,839
01/14/2010 15:46:42
209
6
Pandas changes default numpy array format
Is there any way to prevent pandas from changing the default print format for numpy arrays? With plain numpy, I get: >>> numpy.array([123.45, 0.06]) array([ 1.23450000e+02, 6.00000000e-02]) After I import pandas, I get: >>> numpy.array([123.45, 0.06]) array([ 123.45, 0.06]) Can I stop it from doing this as a configuration setting? I don't want to have to wrap every "import pandas" with a "foo=np.get_printoptions(); import pandas; np.set_printoptions(**foo)", but that's the best I can come up with. As it is, if I import pandas in one place, I get doctest errors from another.
python
numpy
pandas
null
null
null
open
Pandas changes default numpy array format === Is there any way to prevent pandas from changing the default print format for numpy arrays? With plain numpy, I get: >>> numpy.array([123.45, 0.06]) array([ 1.23450000e+02, 6.00000000e-02]) After I import pandas, I get: >>> numpy.array([123.45, 0.06]) array([ 123.45, 0.06]) Can I stop it from doing this as a configuration setting? I don't want to have to wrap every "import pandas" with a "foo=np.get_printoptions(); import pandas; np.set_printoptions(**foo)", but that's the best I can come up with. As it is, if I import pandas in one place, I get doctest errors from another.
0
72,911
09/16/2008 14:28:33
4,376
09/03/2008 09:30:40
173
15
What's the best way to organize CSS rules?
What strategies help you keep track of a large number of CSS rules? How do you organize your files, your code blocks, and your rules?
css
null
null
null
null
05/05/2012 13:42:44
not constructive
What's the best way to organize CSS rules? === What strategies help you keep track of a large number of CSS rules? How do you organize your files, your code blocks, and your rules?
4
72,913
09/16/2008 14:28:35
5,056
09/07/2008 15:43:17
984
70
Is it possible to advance an enumerator and get its value in a lambda?
If I have an IEnumerator variable is it possible to have a lambda function that takes it, advances it with MoveNext() and returns the Current value every single time its called?
c#
functional-programming
lambda
null
null
null
open
Is it possible to advance an enumerator and get its value in a lambda? === If I have an IEnumerator variable is it possible to have a lambda function that takes it, advances it with MoveNext() and returns the Current value every single time its called?
0
72,919
09/16/2008 14:28:57
673
08/07/2008 16:33:05
727
59
PHP Pbject oriented VS MVC (CodeIgniter)
We are starting a new app and are debating the benefits of MVC (using codeigniter for PHP) vs. using object oriented php. I myself only really started using object oriented php, and do like it, but should I use that over codeigniter? I see benefits of both.
php
oop
codeigniter
null
null
null
open
PHP Pbject oriented VS MVC (CodeIgniter) === We are starting a new app and are debating the benefits of MVC (using codeigniter for PHP) vs. using object oriented php. I myself only really started using object oriented php, and do like it, but should I use that over codeigniter? I see benefits of both.
0
72,921
09/16/2008 14:29:07
12,419
09/16/2008 14:18:53
1
0
How can you find all the IP addresses in a selected block of text with a javascript bookmarklet?
I am just starting to learn javascript, so I don't have the skills to figure out what I assume is a trivial problem. I'm working with a Wordpress blog that serves as a FAQ for our community and I am trying to pull together some tools to make managing the comments easier. [Internet Duct Tape's Greasemonkey tools, like Comment Ninja][1], are helpful for most of it, but I want to be able to get a list of all the IP addresses that we're getting comments from in order to track trends and so forth. I just want to be able to select a bunch of text on the comments page and click a bookmarklet ([http://bookmarklets.com][2]) in Firefox that pops up a window listing all the IP addresses found in the selection. [1]: http://internetducttape.com/tools/wordpress/wordpress-comment-ninja/ [2]: http://bookmarklets.com
javascript
bookmarklet
ipaddress
null
null
null
open
How can you find all the IP addresses in a selected block of text with a javascript bookmarklet? === I am just starting to learn javascript, so I don't have the skills to figure out what I assume is a trivial problem. I'm working with a Wordpress blog that serves as a FAQ for our community and I am trying to pull together some tools to make managing the comments easier. [Internet Duct Tape's Greasemonkey tools, like Comment Ninja][1], are helpful for most of it, but I want to be able to get a list of all the IP addresses that we're getting comments from in order to track trends and so forth. I just want to be able to select a bunch of text on the comments page and click a bookmarklet ([http://bookmarklets.com][2]) in Firefox that pops up a window listing all the IP addresses found in the selection. [1]: http://internetducttape.com/tools/wordpress/wordpress-comment-ninja/ [2]: http://bookmarklets.com
0
72,931
09/16/2008 14:29:50
9,631
09/15/2008 19:25:27
11
7
What's the best alternative to C++ for real-time graphics programming?
C++ just sucks too much of my time by making me micro-manage my own memory, making me type far too much (hello `std::vector<Thingy>::const_iterator it = lotsOfThingys.begin()`), and boring me with long compile times. What's the single best alternative for serious real-time graphics programming? Garbage collection is a must (as is the ability to avoid its use when necessary), and speed must be competitive with C++. A reasonable story for accessing C libs is also a must. (Full disclosure: I have my own answer to this, but I'm interested to see what others have found to be good alternatives to C++ for real-time graphics work.)
c++
real-time
graphics
3d
polls
05/05/2012 13:42:54
not constructive
What's the best alternative to C++ for real-time graphics programming? === C++ just sucks too much of my time by making me micro-manage my own memory, making me type far too much (hello `std::vector<Thingy>::const_iterator it = lotsOfThingys.begin()`), and boring me with long compile times. What's the single best alternative for serious real-time graphics programming? Garbage collection is a must (as is the ability to avoid its use when necessary), and speed must be competitive with C++. A reasonable story for accessing C libs is also a must. (Full disclosure: I have my own answer to this, but I'm interested to see what others have found to be good alternatives to C++ for real-time graphics work.)
4
72,943
09/16/2008 14:31:04
733
08/08/2008 12:53:16
282
34
Possible to set tab focus in IE7 from JavaScript
Is it possible to launch a new window in JavaScript using the window.Open function, then set the focus to that tab? Here's what I'm doing today: <code> <pre> var winRef = window.open(outUrl,wName,'left='+ wX +',top=' + wY + ',height=' + wH + ',width=' + wW + args); try { // Not all window types support the focus() property. winRef.focus(); } catch (exception) { } </pre> </code> The window opens, but the new tab doesn't receive focus.
javascript
internet-explorer-7
focus
null
null
null
open
Possible to set tab focus in IE7 from JavaScript === Is it possible to launch a new window in JavaScript using the window.Open function, then set the focus to that tab? Here's what I'm doing today: <code> <pre> var winRef = window.open(outUrl,wName,'left='+ wX +',top=' + wY + ',height=' + wH + ',width=' + wW + args); try { // Not all window types support the focus() property. winRef.focus(); } catch (exception) { } </pre> </code> The window opens, but the new tab doesn't receive focus.
0
72,945
09/16/2008 14:31:21
8,507
09/15/2008 16:11:12
11
7
How to create a triple-join table with Django
Using Django's built in models, how would one create a triple-join between three models. For example: * Users, Roles, and Events are the models. * Users have many Roles, and Roles many Users. (ManyToMany) * Events have many Users, and Users many Events. (ManyToMany) * But for any given Event, any User may have only one Role. How can this be represented in the model?
python
mvc
django
model
null
null
open
How to create a triple-join table with Django === Using Django's built in models, how would one create a triple-join between three models. For example: * Users, Roles, and Events are the models. * Users have many Roles, and Roles many Users. (ManyToMany) * Events have many Users, and Users many Events. (ManyToMany) * But for any given Event, any User may have only one Role. How can this be represented in the model?
0
72,961
09/16/2008 14:32:49
2,863
08/25/2008 16:09:56
78
9
The log file for database is full.
So our SQL Server 2000 is giving me the error, "The log file for database is full. Back up the transaction log for the database to free up some log space." How do I go about fixing this without deleting the log like some other sites have mentioned? Additional Info: Enable AutoGrowth is enabled growing by 10% and is restricted to 40MB.
sql-server
sql-server-2000
null
null
null
null
open
The log file for database is full. === So our SQL Server 2000 is giving me the error, "The log file for database is full. Back up the transaction log for the database to free up some log space." How do I go about fixing this without deleting the log like some other sites have mentioned? Additional Info: Enable AutoGrowth is enabled growing by 10% and is restricted to 40MB.
0
72,983
09/16/2008 14:34:25
12,170
09/16/2008 13:27:55
11
4
Which logging library is better?
I was wondering; which logging libraries for Delphi do you prefer? - CodeSite - SmartInspect Please try to add a reasoning why you prefer one over the other if you've used more than one. I'll add suggestions to this question to keep things readable.
delphi
logging
null
null
null
null
open
Which logging library is better? === I was wondering; which logging libraries for Delphi do you prefer? - CodeSite - SmartInspect Please try to add a reasoning why you prefer one over the other if you've used more than one. I'll add suggestions to this question to keep things readable.
0
72,994
09/16/2008 14:35:16
6,199
09/12/2008 21:42:18
36
2
.Net WinForms Transparent Control
I want to simulate a 'Web 2.0' Lightbox style UI technique in a WinForms application. That is, to draw attention to some foreground control by 'dimming' all other content in the client area of a window. The obvious solution is to create a control that is simply a partially transparent rectangle that can be docked to the client area of a window and brought to the front of the Z-Order. It needs to act like a dirty pain of glass through which the other controls can still be seen (and therefore continue to paint themselves). Is this possible? I've had a good hunt round and tried a few techniques myself but thus far have been unsuccessful. Any gurus out there that have done this or can say 'no way - not possible'. Or any other possible solutions? See: [http://www.useit.com/alertbox/application-design.html][1] (under the Lightbox section for a screenshot to illustrate what I mean) [1]: http://www.useit.com/alertbox/application-design.html
user-interface
winforms
null
null
null
null
open
.Net WinForms Transparent Control === I want to simulate a 'Web 2.0' Lightbox style UI technique in a WinForms application. That is, to draw attention to some foreground control by 'dimming' all other content in the client area of a window. The obvious solution is to create a control that is simply a partially transparent rectangle that can be docked to the client area of a window and brought to the front of the Z-Order. It needs to act like a dirty pain of glass through which the other controls can still be seen (and therefore continue to paint themselves). Is this possible? I've had a good hunt round and tried a few techniques myself but thus far have been unsuccessful. Any gurus out there that have done this or can say 'no way - not possible'. Or any other possible solutions? See: [http://www.useit.com/alertbox/application-design.html][1] (under the Lightbox section for a screenshot to illustrate what I mean) [1]: http://www.useit.com/alertbox/application-design.html
0
73,000
09/16/2008 14:35:25
7,918
09/15/2008 14:41:36
1
1
Modal dialogs in IE gets hidden behind IE if user clicks on IE pane
I have to write an applet that brings up a password dialog. The problem is that dialog is set to be always on top but when user clicks on IE window dialog gets hidden behind IE window nevertheless. And since dialog is modal and holds **all** IE threads IE pane does not refresh and dialog window is still painted on top of IE (but not refreshed). This behaviour confuses users (they _see_ dialog on top of IE but it looks like it has hanged since it is not refreshe). So I need a way to keep that dialog on top of everything. But any other solution to this problem would be nice. Here's the code: PassDialog dialog = new PassDialog(parent); /* do some non gui related initialization */ dialog.pack(); dialog.setLocationRelativeTo(null); dialog.setAlwaysOnTop(true); dialog.setVisible(true);
java
swing
internet-explorer
applet
modal-dialog
null
open
Modal dialogs in IE gets hidden behind IE if user clicks on IE pane === I have to write an applet that brings up a password dialog. The problem is that dialog is set to be always on top but when user clicks on IE window dialog gets hidden behind IE window nevertheless. And since dialog is modal and holds **all** IE threads IE pane does not refresh and dialog window is still painted on top of IE (but not refreshed). This behaviour confuses users (they _see_ dialog on top of IE but it looks like it has hanged since it is not refreshe). So I need a way to keep that dialog on top of everything. But any other solution to this problem would be nice. Here's the code: PassDialog dialog = new PassDialog(parent); /* do some non gui related initialization */ dialog.pack(); dialog.setLocationRelativeTo(null); dialog.setAlwaysOnTop(true); dialog.setVisible(true);
0
73,008
09/16/2008 14:36:22
1,762
08/18/2008 13:12:06
115
7
How much data can/should you store in a users session object?
We have several wizard style form applications on our website where we capture information from the user on each page and then submit to a backend process using a web service. Unfortunately we can't submit the information in chunks during each form submission so we have to store it the users session until the end of the process and submit it all at the same time. Is the amount of server memory/sql server disk space the only constraint on how much I can store in users sessions or is there something else I need to consider?
asp.net
session
null
null
null
null
open
How much data can/should you store in a users session object? === We have several wizard style form applications on our website where we capture information from the user on each page and then submit to a backend process using a web service. Unfortunately we can't submit the information in chunks during each form submission so we have to store it the users session until the end of the process and submit it all at the same time. Is the amount of server memory/sql server disk space the only constraint on how much I can store in users sessions or is there something else I need to consider?
0
73,022
09/16/2008 14:37:04
3,420
08/28/2008 14:19:36
123
4
CodeFile vs CodeBehind
What is the difference between **CodeFile**="file.ascx.cs" and **CodeBehind**="file.ascx.cs" in the declaration of a ASP.NET user control? Is one newer or recommended? Or do they have specific usage?
asp.net
null
null
null
null
null
open
CodeFile vs CodeBehind === What is the difference between **CodeFile**="file.ascx.cs" and **CodeBehind**="file.ascx.cs" in the declaration of a ASP.NET user control? Is one newer or recommended? Or do they have specific usage?
0
73,024
09/16/2008 14:37:12
7,574
09/15/2008 13:59:43
11
1
What is this delegate call doing in this line of code (C#)?
This is from an example accompanying the agsXMPP .Net assembly. I've read up on delegates, but am not sure how that fits in with this line of code (which waits for the logon to occur, and then sends a message. I guess what I'm looking for is an understanding of why delegate(0) accomplishes this, in the kind of simple terms I can understand. &lt;s&gt; xmpp.OnLogin += delegate(object o) { xmpp.Send(new Message(new Jid(JID_RECEIVER), MessageType.chat, "Hello, how are you?")); }; thanks, Hank Fay
c#
delegates
null
null
null
null
open
What is this delegate call doing in this line of code (C#)? === This is from an example accompanying the agsXMPP .Net assembly. I've read up on delegates, but am not sure how that fits in with this line of code (which waits for the logon to occur, and then sends a message. I guess what I'm looking for is an understanding of why delegate(0) accomplishes this, in the kind of simple terms I can understand. &lt;s&gt; xmpp.OnLogin += delegate(object o) { xmpp.Send(new Message(new Jid(JID_RECEIVER), MessageType.chat, "Hello, how are you?")); }; thanks, Hank Fay
0
73,029
09/16/2008 14:37:37
11,450
09/16/2008 08:03:25
1
0
Embedded Jetty serving static content with form authentication
I try to use the Forms-Based authentication within an embedded Jetty 1.6.7 project. Everything is fine except that if the login.html is found also all static content is visible. What is the best way around that? The servlet contexts are secured. What is the influence of the DefaultHandler? Any helpful thought is welcome! Thanks. Okami
jetty
java
web-applications
null
null
null
open
Embedded Jetty serving static content with form authentication === I try to use the Forms-Based authentication within an embedded Jetty 1.6.7 project. Everything is fine except that if the login.html is found also all static content is visible. What is the best way around that? The servlet contexts are secured. What is the influence of the DefaultHandler? Any helpful thought is welcome! Thanks. Okami
0
73,032
09/16/2008 14:38:02
3,230
08/27/2008 13:49:58
151
6
How can I sort by multiple conditions with different orders?
I'd really like to handle this without monkey-patching but I haven't been able to find another option yet. I have an array (in Ruby) that I need to sort by multiple conditions. I know how to use the sort method and I've used the trick on sorting using an array of options to sort by multiple conditions. However, in this case I need the first condition to sort ascending and the second to sort descending. For example: ordered_list = [[1, 2], [1, 1], [2, 1]] Any suggestions?
ruby
sorting
null
null
null
null
open
How can I sort by multiple conditions with different orders? === I'd really like to handle this without monkey-patching but I haven't been able to find another option yet. I have an array (in Ruby) that I need to sort by multiple conditions. I know how to use the sort method and I've used the trick on sorting using an array of options to sort by multiple conditions. However, in this case I need the first condition to sort ascending and the second to sort descending. For example: ordered_list = [[1, 2], [1, 1], [2, 1]] Any suggestions?
0
73,037
09/16/2008 14:38:41
3,048
08/26/2008 13:36:49
1
0
What's the best approach to embed RegEx in Oracle or SQL Server 2005 SQL?
This is a 3 part question regarding embedded RegEx into SQL statements. 1. How do you embed a RegEx expression into an Oracle PL/SQL select statement that will parse out the “DELINQUENT” string in the text string shown below? 2. What is the performance impact if used within a mission critical business transaction? 3. Since embedding regex into SQL was introduced in Oracle 10g and SQL Server 2005, is it considered a recommended practice? ---------- Dear Larry : Thank you for using ABC's alert service. ABC has detected a change in the status of one of your products in the state of KS. Please review the information below to determine if this status change was intended. ENTITY NAME: Oracle Systems, LLC PREVIOUS STATUS: -- CURRENT STATUS: DELINQUENT As a reminder, you may contact your the ABC Team for assistance in correcting any delinquencies or, if needed, reinstating the service. Alternatively, if the system does not intend to continue to engage this state, please notify ABC so that we can discontinue our services. Kind regards, Service Team 1 ABC --PLEASE DO NOT REPLY TO THIS EMAIL. IT IS NOT A MONITORED EMAIL ACCOUNT.-- Notice: ABC Corporation cannot independently verify the timeliness, accuracy, or completeness of the public information maintained by the responsible government agency or other sources of data upon which these alerts are based.
sql
sql-server
oracle
regex
null
null
open
What's the best approach to embed RegEx in Oracle or SQL Server 2005 SQL? === This is a 3 part question regarding embedded RegEx into SQL statements. 1. How do you embed a RegEx expression into an Oracle PL/SQL select statement that will parse out the “DELINQUENT” string in the text string shown below? 2. What is the performance impact if used within a mission critical business transaction? 3. Since embedding regex into SQL was introduced in Oracle 10g and SQL Server 2005, is it considered a recommended practice? ---------- Dear Larry : Thank you for using ABC's alert service. ABC has detected a change in the status of one of your products in the state of KS. Please review the information below to determine if this status change was intended. ENTITY NAME: Oracle Systems, LLC PREVIOUS STATUS: -- CURRENT STATUS: DELINQUENT As a reminder, you may contact your the ABC Team for assistance in correcting any delinquencies or, if needed, reinstating the service. Alternatively, if the system does not intend to continue to engage this state, please notify ABC so that we can discontinue our services. Kind regards, Service Team 1 ABC --PLEASE DO NOT REPLY TO THIS EMAIL. IT IS NOT A MONITORED EMAIL ACCOUNT.-- Notice: ABC Corporation cannot independently verify the timeliness, accuracy, or completeness of the public information maintained by the responsible government agency or other sources of data upon which these alerts are based.
0
73,039
09/16/2008 14:38:46
12,442
09/16/2008 14:23:01
1
0
What's the best way to handle long running process in an ASP.Net application?
In my web application there is a process that queries data from all over the web, filters it, and saves it to the database. As you can imagine this process takes some time. My current solution is to increase the page timeout and give an AJAX progress bar to the user while it loads. This is a problem for two reasons - 1) it still takes to long and the user must wait 2) it sometimes still times out. I've dabbled in threading the process and have read I should async post it to a web service ("Fire and forget"). Some references I've read: - [MSDN][1] - [Fire and Forget][2] So my question is - what is the best method? [1]: http://msdn.microsoft.com/en-us/library/ms978607.aspx#diforwc-ap02_plag_howtomultithread [2]: http://aspalliance.com/329
asp.net
asp.net-ajax
.net
c#
null
null
open
What's the best way to handle long running process in an ASP.Net application? === In my web application there is a process that queries data from all over the web, filters it, and saves it to the database. As you can imagine this process takes some time. My current solution is to increase the page timeout and give an AJAX progress bar to the user while it loads. This is a problem for two reasons - 1) it still takes to long and the user must wait 2) it sometimes still times out. I've dabbled in threading the process and have read I should async post it to a web service ("Fire and forget"). Some references I've read: - [MSDN][1] - [Fire and Forget][2] So my question is - what is the best method? [1]: http://msdn.microsoft.com/en-us/library/ms978607.aspx#diforwc-ap02_plag_howtomultithread [2]: http://aspalliance.com/329
0
73,045
09/16/2008 14:39:12
423,836
09/16/2008 13:34:57
56
1
What's the best way to organize code?
I'm not talking about how to indent here. I'm looking for suggestions about the best way of organizing the chunks of code in a source file. Do you arrange methods alphabetically? In the order you wrote them? Thematically? In some kind of 'didactic' order? What organizing principles do you follow? Why?
language-agnostic
organizing
null
null
null
null
open
What's the best way to organize code? === I'm not talking about how to indent here. I'm looking for suggestions about the best way of organizing the chunks of code in a source file. Do you arrange methods alphabetically? In the order you wrote them? Thematically? In some kind of 'didactic' order? What organizing principles do you follow? Why?
0
73,051
09/16/2008 14:39:49
12,525
09/16/2008 14:39:49
1
0
How to retrieve error when launching sqlcmd from C# ?
I need to run a stored procedure from a C# application. I use the following code to do so: Process sqlcmdCall = new Process(); sqlcmdCall.StartInfo.FileName = "sqlcmd.exe"; sqlcmdCall.StartInfo.Arguments = "-S localhost\\SQLEXPRESS -d some_db -Q \":EXIT(sp_test)\"" sqlcmdCall.Start(); sqlcmdCall.WaitForExit(); From the sqlcmdCall object after the call completes, I currently get an ExitCode of -100 for success and of 1 for failure (i.e. missing parameter, stored proc does not exist, etc...). How can I customize these return codes? H.
c#
sql-server
null
null
null
null
open
How to retrieve error when launching sqlcmd from C# ? === I need to run a stored procedure from a C# application. I use the following code to do so: Process sqlcmdCall = new Process(); sqlcmdCall.StartInfo.FileName = "sqlcmd.exe"; sqlcmdCall.StartInfo.Arguments = "-S localhost\\SQLEXPRESS -d some_db -Q \":EXIT(sp_test)\"" sqlcmdCall.Start(); sqlcmdCall.WaitForExit(); From the sqlcmdCall object after the call completes, I currently get an ExitCode of -100 for success and of 1 for failure (i.e. missing parameter, stored proc does not exist, etc...). How can I customize these return codes? H.
0
73,063
09/16/2008 14:40:36
12,113
09/16/2008 13:14:45
6
0
[VS] How do I add Debug Breakpoints to lines displayed in a "Find Results" window
In Visual Studio 2005/2008 it is possible to find all lines containing certain references and display them in a "Find Results" window. Now that these result lines are displayed, is there any keyboard shortcut that would allow adding debug breakpoints to all of them?
visual-studio
debugging
breakpoint
null
null
null
open
[VS] How do I add Debug Breakpoints to lines displayed in a "Find Results" window === In Visual Studio 2005/2008 it is possible to find all lines containing certain references and display them in a "Find Results" window. Now that these result lines are displayed, is there any keyboard shortcut that would allow adding debug breakpoints to all of them?
0
73,072
09/16/2008 14:41:21
11,673
09/16/2008 10:05:49
11
8
Report templates for Team Foundation Server 2008
Does anybody have links to site or pre built report running on the SQL Analysis Service provided by TFS2008? Creating a meaningful Excel report or a new report sometime is a very boring and difficult taks, maybe finding a way to share reports could be a good idea?
tfs
tfs2008
null
null
null
null
open
Report templates for Team Foundation Server 2008 === Does anybody have links to site or pre built report running on the SQL Analysis Service provided by TFS2008? Creating a meaningful Excel report or a new report sometime is a very boring and difficult taks, maybe finding a way to share reports could be a good idea?
0
73,078
09/16/2008 14:41:49
525
08/06/2008 14:41:28
230
25
How does one unit test sections of code that are procedural or event-based
I'm convinced from [this presentation][1] and other commentary here on the site that I need to learn to Unit Test. I also realize that there have been many questions about what unit testing is here. Each time I go to consider how it should be done in the application I am currently working on, I walk away confused. It is a xulrunner application application, and a lot of the logic is event-based - when a user clicks here, this action takes place. Often the examples I see for testing are testing classes - they instantiate an object, give it mock data, then check the properties of the object afterward. That makes sense to me - but what about the non-object-oriented pieces? [This guy mentioned][2] that GUI-based unit testing is difficult in most any testing framework, maybe that's the problem. The presentation linked above mentions that each test should only touch one class, one method at a time. That seems to rule out what I'm trying to do. So the question - how does one unit testing procedural or event-based code? Provide a link to good documentation, or explain it yourself. On a side note, I also have a challenge of not having found a testing framework that is set up to test xulrunner apps - it seems that the tools just aren't developed yet. I imagine this is more peripheral than my understanding the concepts, writing testable code, applying unit testing. [1]: http://www.masukomi.org/talks/unit_testing_talk_2/index.xul?data=slide_data.txt#page2 [2]: http://stackoverflow.com/questions/2364/what-is-your-experience-with-unit-testing-in-practice#2390
unit-testing
null
null
null
null
null
open
How does one unit test sections of code that are procedural or event-based === I'm convinced from [this presentation][1] and other commentary here on the site that I need to learn to Unit Test. I also realize that there have been many questions about what unit testing is here. Each time I go to consider how it should be done in the application I am currently working on, I walk away confused. It is a xulrunner application application, and a lot of the logic is event-based - when a user clicks here, this action takes place. Often the examples I see for testing are testing classes - they instantiate an object, give it mock data, then check the properties of the object afterward. That makes sense to me - but what about the non-object-oriented pieces? [This guy mentioned][2] that GUI-based unit testing is difficult in most any testing framework, maybe that's the problem. The presentation linked above mentions that each test should only touch one class, one method at a time. That seems to rule out what I'm trying to do. So the question - how does one unit testing procedural or event-based code? Provide a link to good documentation, or explain it yourself. On a side note, I also have a challenge of not having found a testing framework that is set up to test xulrunner apps - it seems that the tools just aren't developed yet. I imagine this is more peripheral than my understanding the concepts, writing testable code, applying unit testing. [1]: http://www.masukomi.org/talks/unit_testing_talk_2/index.xul?data=slide_data.txt#page2 [2]: http://stackoverflow.com/questions/2364/what-is-your-experience-with-unit-testing-in-practice#2390
0
73,086
09/16/2008 14:42:29
12,529
09/16/2008 14:40:00
1
0
three column web design with variable sides
I've been trying to come up with a way to create a 3 column web design where the center column has a constant width and is always centered. The columns to the left and right are variable. This is trivial in tables, but not correct semantically. I haven't been able to get this working properly in all current browsers. Any tips on this?
html
css
null
null
null
null
open
three column web design with variable sides === I've been trying to come up with a way to create a 3 column web design where the center column has a constant width and is always centered. The columns to the left and right are variable. This is trivial in tables, but not correct semantically. I haven't been able to get this working properly in all current browsers. Any tips on this?
0
73,087
09/16/2008 14:42:32
9,648
09/15/2008 19:28:37
16
2
X/Gnome: How to measure the geometry of an open window
Is there a standard X / Gnome program that will display the X,Y width and depth in pixels of a window that I select? Something similar to the way an xterm shows you the width and depth of the window (in lines) as you resize it. I'm running on Red Hat Enterprise Linux 4.4. Thanks!
linux
gnome
x-windows
null
null
null
open
X/Gnome: How to measure the geometry of an open window === Is there a standard X / Gnome program that will display the X,Y width and depth in pixels of a window that I select? Something similar to the way an xterm shows you the width and depth of the window (in lines) as you resize it. I'm running on Red Hat Enterprise Linux 4.4. Thanks!
0
73,095
09/16/2008 14:43:37
12,547
09/16/2008 14:43:37
1
0
How to implement a simple auto-complete functionality?
I'd like to implement a simple class (in Java) that would allow me to register and deregister strings, and on the basis of the current set of strings auto-complete a given string. So, the interface would be: * void add(String) * void remove(String) * String complete(String) What's the best way to do this in terms of algorithms and data-structures?
java
autocomplete
null
null
null
null
open
How to implement a simple auto-complete functionality? === I'd like to implement a simple class (in Java) that would allow me to register and deregister strings, and on the basis of the current set of strings auto-complete a given string. So, the interface would be: * void add(String) * void remove(String) * String complete(String) What's the best way to do this in terms of algorithms and data-structures?
0
73,110
09/16/2008 14:44:41
1,042
08/11/2008 18:02:48
386
45
How can I show scrollbars on a System.Windows.Forms.TextBox only when the text doesn't fit?
For a System.Windows.Forms.TextBox with Multiline=True, I'd like to only show the scrollbars when the text doesn't fit. This is a readonly textbox used only for display. It's a TextBox so that users can copy the text out. Is there anything built-in to support auto show of scrollbars? If not, should I be using a different control? Or do I need to hook TextChanged and manually check for overflow (if so, how to tell if the text fits?)
winforms
textbox
scrollbars
null
null
null
open
How can I show scrollbars on a System.Windows.Forms.TextBox only when the text doesn't fit? === For a System.Windows.Forms.TextBox with Multiline=True, I'd like to only show the scrollbars when the text doesn't fit. This is a readonly textbox used only for display. It's a TextBox so that users can copy the text out. Is there anything built-in to support auto show of scrollbars? If not, should I be using a different control? Or do I need to hook TextChanged and manually check for overflow (if so, how to tell if the text fits?)
0
73,117
09/16/2008 14:45:19
6,128
09/12/2008 14:13:48
219
6
Making a game in C++ using parallel processing
I wanted to "emulate" a popular flash game, Chrontron, in C++ and needed some help getting started. (NOTE: Not for release, just practicing for myself) <pre> Basics: Player has a time machine. On each iteration of using the time machine, a parallel state is created, co-existing with a previous state. One of the states must complete all the objectives of the level before ending the stage. In addition, all the stages must be able to end the stage normally, without causing a state paradox (wherein they should have been able to finish the stage normally but, due to the interactions of another state, were not). </pre> So, that sort of explains how the game works. You should play it a bit to really understand what my problem is. <br /> I'm thinking a good way to solve this would be to use linked lists to store each state, which will probably either be a hash map, based on time, or a linked list that iterates based on time. I'm still unsure.<br /> ACTUAL QUESTION: Now that I have some rough specs, I need some help deciding on which data structures to use for this, and why. Also, I want to know what Graphics API/Layer I should use to do this: SDL, OpenGL, or DirectX (my current choice is SDL). And how would I go about implementing parallel states? With parallel threads?
c++
graphics
sdl
opengl
directx
null
open
Making a game in C++ using parallel processing === I wanted to "emulate" a popular flash game, Chrontron, in C++ and needed some help getting started. (NOTE: Not for release, just practicing for myself) <pre> Basics: Player has a time machine. On each iteration of using the time machine, a parallel state is created, co-existing with a previous state. One of the states must complete all the objectives of the level before ending the stage. In addition, all the stages must be able to end the stage normally, without causing a state paradox (wherein they should have been able to finish the stage normally but, due to the interactions of another state, were not). </pre> So, that sort of explains how the game works. You should play it a bit to really understand what my problem is. <br /> I'm thinking a good way to solve this would be to use linked lists to store each state, which will probably either be a hash map, based on time, or a linked list that iterates based on time. I'm still unsure.<br /> ACTUAL QUESTION: Now that I have some rough specs, I need some help deciding on which data structures to use for this, and why. Also, I want to know what Graphics API/Layer I should use to do this: SDL, OpenGL, or DirectX (my current choice is SDL). And how would I go about implementing parallel states? With parallel threads?
0
73,123
09/16/2008 14:46:03
12,513
09/16/2008 14:37:43
1
0
Is it possible to use .htaccess to send six digit number URLs to a script but handle all other invalid URLs as 404s?
Is it possible to use .htaccess to process all six digit URLs by sending them to a script, but handle every other invalid URL as an error 404? For example: http://mywebsite.com/132483 would be sent to: http://mywebsite.com/scriptname.php?no=132483 but http://mywebsite.com/132483a or http://mywebsite.com/asdf would be handled as a 404 error. I presently have this working via a custom PHP 404 script but it's kind of kludgy. Seems to me that .htaccess might be a more elegant solution, but I haven't been able to figure out if it's even possible.
php
.htaccess
redirect
null
null
null
open
Is it possible to use .htaccess to send six digit number URLs to a script but handle all other invalid URLs as 404s? === Is it possible to use .htaccess to process all six digit URLs by sending them to a script, but handle every other invalid URL as an error 404? For example: http://mywebsite.com/132483 would be sent to: http://mywebsite.com/scriptname.php?no=132483 but http://mywebsite.com/132483a or http://mywebsite.com/asdf would be handled as a 404 error. I presently have this working via a custom PHP 404 script but it's kind of kludgy. Seems to me that .htaccess might be a more elegant solution, but I haven't been able to figure out if it's even possible.
0
73,124
09/16/2008 14:46:10
12,260
09/16/2008 13:46:42
1
1
Refreshing generated Linq to SQL code using stored procedures
When using Linq to SQL with stored procedures, what is the best way to re-generate the C# code generated by Visual Studio? For example, when adding a column to your SP's result set and need to have Visual Studio re-create the class describing the result set, I'd expect to open the DBML designer, right-click the SP in question, and select Refresh from the context menu. But there's no such option...
c#
.net
linqtosql
visualstudio2008
null
null
open
Refreshing generated Linq to SQL code using stored procedures === When using Linq to SQL with stored procedures, what is the best way to re-generate the C# code generated by Visual Studio? For example, when adding a column to your SP's result set and need to have Visual Studio re-create the class describing the result set, I'd expect to open the DBML designer, right-click the SP in question, and select Refresh from the context menu. But there's no such option...
0
73,128
09/16/2008 14:46:47
1,559
08/16/2008 17:12:19
739
75
FileSystemWatcher Dispose call hangs
We just started running in to an odd problem with a FileSystemWatcher where the call to Dispose() appears to be hanging. This is code that has been working without any problems for a while but we just upgraded to .NET3.5 SP1 so I'm trying to find out if anyone else has seen this behavior. Here is the code that creates the FileSystemWatcher: if (this.fileWatcher == null) { this.fileWatcher = new FileSystemWatcher(); } this.fileWatcher.BeginInit(); this.fileWatcher.IncludeSubdirectories = true; this.fileWatcher.Path = project.Directory; this.fileWatcher.EnableRaisingEvents = true; this.fileWatcher.NotifyFilter = NotifyFilters.Attributes; this.fileWatcher.Changed += delegate(object s, FileSystemEventArgs args) { FileWatcherFileChanged(args); }; this.fileWatcher.EndInit(); The way this is being used is to update the state image of a TreeNode object (adjusted slightly to remove business specific information): private void FileWatcherFileChanged(FileSystemEventArgs args) { if (this.TreeView != null) { if (this.TreeView.InvokeRequired) { FileWatcherFileChangedCallback d = new FileWatcherFileChangedCallback(FileWatcherFileChanged); this.TreeView.Invoke(d, new object[] { args }); } else { switch (args.ChangeType) { case WatcherChangeTypes.Changed: if (String.CompareOrdinal(this.project.FullName, args.FullPath) == 0) { this.StateImageKey = GetStateImageKey(); } else { projectItemTreeNode.StateImageKey = GetStateImageKey(); } break; } } } } Is there something we're missing or is this an anomoly from .NET3.5 SP1?
c#
.net
filesystemwatcher
null
null
null
open
FileSystemWatcher Dispose call hangs === We just started running in to an odd problem with a FileSystemWatcher where the call to Dispose() appears to be hanging. This is code that has been working without any problems for a while but we just upgraded to .NET3.5 SP1 so I'm trying to find out if anyone else has seen this behavior. Here is the code that creates the FileSystemWatcher: if (this.fileWatcher == null) { this.fileWatcher = new FileSystemWatcher(); } this.fileWatcher.BeginInit(); this.fileWatcher.IncludeSubdirectories = true; this.fileWatcher.Path = project.Directory; this.fileWatcher.EnableRaisingEvents = true; this.fileWatcher.NotifyFilter = NotifyFilters.Attributes; this.fileWatcher.Changed += delegate(object s, FileSystemEventArgs args) { FileWatcherFileChanged(args); }; this.fileWatcher.EndInit(); The way this is being used is to update the state image of a TreeNode object (adjusted slightly to remove business specific information): private void FileWatcherFileChanged(FileSystemEventArgs args) { if (this.TreeView != null) { if (this.TreeView.InvokeRequired) { FileWatcherFileChangedCallback d = new FileWatcherFileChangedCallback(FileWatcherFileChanged); this.TreeView.Invoke(d, new object[] { args }); } else { switch (args.ChangeType) { case WatcherChangeTypes.Changed: if (String.CompareOrdinal(this.project.FullName, args.FullPath) == 0) { this.StateImageKey = GetStateImageKey(); } else { projectItemTreeNode.StateImageKey = GetStateImageKey(); } break; } } } } Is there something we're missing or is this an anomoly from .NET3.5 SP1?
0
73,134
09/16/2008 14:47:22
9,236
09/15/2008 18:09:29
1
0
WIll this C++ code cause a memory leak (casting vector new)
I have been working on some legacy C++ code that uses variable length structures (TAPI), where the structure size will depend on variable length strings. The structures are allocated by casting vector `new` thus: `STRUCT* pStruct = (STRUCT*)new BYTE [sizeof(STRUCT) + nPaddingSize];` Later on however the memory is freed using a `delete` call: `delete pStruct;` Will this mix of vector new and non-vector delete cause a memory leak or would it depend on the compiler? Would I be better off changing this code to use `malloc` and `free` instead?
c++
new
delete
null
null
null
open
WIll this C++ code cause a memory leak (casting vector new) === I have been working on some legacy C++ code that uses variable length structures (TAPI), where the structure size will depend on variable length strings. The structures are allocated by casting vector `new` thus: `STRUCT* pStruct = (STRUCT*)new BYTE [sizeof(STRUCT) + nPaddingSize];` Later on however the memory is freed using a `delete` call: `delete pStruct;` Will this mix of vector new and non-vector delete cause a memory leak or would it depend on the compiler? Would I be better off changing this code to use `malloc` and `free` instead?
0
73,147
09/16/2008 14:48:33
11,820
09/16/2008 11:33:27
1
8
I need an ID3 tag reader library for Java - preferably a fast one
I'd like to know a good ID3 tag reader library for Java. Would be good if it was easy to use or had very good documentation, but my main criteria is speed - I want to be able to read ID3 tags from over 10,000 files as quickly as possible.
java
mp3
id3
null
null
06/04/2012 14:47:27
not constructive
I need an ID3 tag reader library for Java - preferably a fast one === I'd like to know a good ID3 tag reader library for Java. Would be good if it was easy to use or had very good documentation, but my main criteria is speed - I want to be able to read ID3 tags from over 10,000 files as quickly as possible.
4
73,159
09/16/2008 14:49:50
12,118
09/16/2008 13:15:29
1
0
Best way to switch between multiple versions of the Flash player for easier testing?
Are there any utilities or browser plugins that let you easily switch the version of the Flash player that is being used?
flash
browser
null
null
null
null
open
Best way to switch between multiple versions of the Flash player for easier testing? === Are there any utilities or browser plugins that let you easily switch the version of the Flash player that is being used?
0
73,162
09/16/2008 14:50:05
6,896
09/15/2008 12:46:57
11
3
How to make the taskbar blink my application like Messenger does when a new message arrive
Is there an API call in .NET or a native DLL that I can use to create similar behaviour as Windows Live Messenger when a response comes from someone I chat with.
windows
winapi
null
null
null
null
open
How to make the taskbar blink my application like Messenger does when a new message arrive === Is there an API call in .NET or a native DLL that I can use to create similar behaviour as Windows Live Messenger when a response comes from someone I chat with.
0
73,168
09/16/2008 14:50:50
3,274
08/27/2008 16:05:55
74
2
Saving HTML tables to a Database
I am trying to scrape an html table and save its data in a database. What strategies/solutions have you found to be helpful in approaching this program. I'm most comfortable with Java and PHP but really a solution in any language would be helpful.
screen-scraping
html
null
null
null
null
open
Saving HTML tables to a Database === I am trying to scrape an html table and save its data in a database. What strategies/solutions have you found to be helpful in approaching this program. I'm most comfortable with Java and PHP but really a solution in any language would be helpful.
0
73,187
09/16/2008 14:52:14
12,113
09/16/2008 13:14:45
4
0
How do I create a custom font for a blackberry application
I want to use a specific foreign language font for a Blackberry application. How is such a font created and loaded onto the Blackberry device? For example: ਪੰਜਾਬੀ
blackberry
fonts
null
null
null
null
open
How do I create a custom font for a blackberry application === I want to use a specific foreign language font for a Blackberry application. How is such a font created and loaded onto the Blackberry device? For example: ਪੰਜਾਬੀ
0
73,194
09/16/2008 14:52:28
4,240
09/02/2008 13:51:18
187
7
How Does Listening to a Multicast Hurt Me?
I'm receiving a recovery feed from an exchange for recovering data missed from their primary feed. The exchange __strongly__ recommends listening to the recovery feed only when data is needed, and leaving the multicast once I have recovered the data I need. My question is, if I am using asio, and not reading from the NIC when I don't need it, what is the harm? The messages have sequence numbers, so I can't accidentally process an old message "left" on the card. Is this really harming my application?
language-agnostic
networking
network-programming
udp
boost-asio
null
open
How Does Listening to a Multicast Hurt Me? === I'm receiving a recovery feed from an exchange for recovering data missed from their primary feed. The exchange __strongly__ recommends listening to the recovery feed only when data is needed, and leaving the multicast once I have recovered the data I need. My question is, if I am using asio, and not reading from the NIC when I don't need it, what is the harm? The messages have sequence numbers, so I can't accidentally process an old message "left" on the card. Is this really harming my application?
0
73,198
09/16/2008 14:52:44
12,260
09/16/2008 13:46:42
1
1
When using Linq to SQL with stored procedures, must char(1) columns be returned as c# chars?
When using Linq to SQL and stored procedures, the class generated to describe the proc's result set uses char properties to represent char(1) columns in the SQL proc. I'd rather these be strings - is there any easy way to make this happen?
c#
.net
visual-studio
linq-to-sql
null
null
open
When using Linq to SQL with stored procedures, must char(1) columns be returned as c# chars? === When using Linq to SQL and stored procedures, the class generated to describe the proc's result set uses char properties to represent char(1) columns in the SQL proc. I'd rather these be strings - is there any easy way to make this happen?
0
73,227
09/16/2008 14:55:05
1,538
08/16/2008 13:21:01
322
15
What is the difference between lambdas and delegates in the .NET Framework?
I get asked this question a lot and I thought I'd solicit some input on how to best describe the difference.
c#
.net
lambda
null
null
null
open
What is the difference between lambdas and delegates in the .NET Framework? === I get asked this question a lot and I thought I'd solicit some input on how to best describe the difference.
0
73,260
09/16/2008 14:57:37
12,550
09/16/2008 14:44:06
1
0
What is your choice for a Time Managment Solution?
I've come across a few different applications that monitor my usage while on the computer, but what have you used, and like? whether it be writing down your activities in a composition notbook or install an app that reports silently to a server? what do you like?
project-management
management
time
null
null
null
open
What is your choice for a Time Managment Solution? === I've come across a few different applications that monitor my usage while on the computer, but what have you used, and like? whether it be writing down your activities in a composition notbook or install an app that reports silently to a server? what do you like?
0
73,261
09/16/2008 14:57:38
8,151
09/15/2008 15:16:47
11
7
Best practice for passing parameters in Microsoft Visual Studio Tools for Office (VSTO) 3 (C#)
Many of the parameters for interacting with the Office Object model in VSTO require object parameters that are passed by reference, even when the notional type of the parameter is an int or string. 1. I suppose that this mechanism is used so that code can modify the parameter, although I can't figure out why these need to be passed as generic object instead of as their more appropriate types. Can anyone enlighten me? 2. The mechanism I've been using (cribbed from help and MSDN resources) essentially creates a generic object that contains the appropriate data and then passes that to the method, for example: object nextBookmarkName = "NextContent"; object nextBookmark = this.Bookmarks.get_Item( ref nextBookmarkName ).Range; Microsoft.Office.Interop.Word.Range newRng = this.Range( ref nextBookmark, ref nextBookmark ); This seems like a lot of extra code, but I can't see a better way to do it. I'm sure I'm missing something; what is it? Or is this really the best practice?
c#
vsto
microsoftoffice
vs2008
null
null
open
Best practice for passing parameters in Microsoft Visual Studio Tools for Office (VSTO) 3 (C#) === Many of the parameters for interacting with the Office Object model in VSTO require object parameters that are passed by reference, even when the notional type of the parameter is an int or string. 1. I suppose that this mechanism is used so that code can modify the parameter, although I can't figure out why these need to be passed as generic object instead of as their more appropriate types. Can anyone enlighten me? 2. The mechanism I've been using (cribbed from help and MSDN resources) essentially creates a generic object that contains the appropriate data and then passes that to the method, for example: object nextBookmarkName = "NextContent"; object nextBookmark = this.Bookmarks.get_Item( ref nextBookmarkName ).Range; Microsoft.Office.Interop.Word.Range newRng = this.Range( ref nextBookmark, ref nextBookmark ); This seems like a lot of extra code, but I can't see a better way to do it. I'm sure I'm missing something; what is it? Or is this really the best practice?
0
73,286
09/16/2008 14:59:50
1,265,473
09/16/2008 14:59:50
1
0
Capturing cout in Visual Studio 2005 output window?
I created a C++ console app and just want to capture the cout/cerr statements in the Output Window within the Visual Studio 2005 IDE. I'm sure this is just a setting that I'm missing. Can anyone point me in the right direction?
c++
visual-studio
null
null
null
null
open
Capturing cout in Visual Studio 2005 output window? === I created a C++ console app and just want to capture the cout/cerr statements in the Output Window within the Visual Studio 2005 IDE. I'm sure this is just a setting that I'm missing. Can anyone point me in the right direction?
0
73,305
09/16/2008 15:01:33
3,004
08/26/2008 11:32:54
1
0
How do we create an installer than doesn't require administrator permissions?
When creating a setup/MSI with Visual Studio is it possible to make a setup for a simple application that doesn't require administrator permissions to install? If its not possible under Windows XP is it possible under Vista? For example a simple image maniputlation application that allows you to paste photos on top of backgrounds. I believe installing to the Program Files folder requires administrator permissions? Can we install in the <user name>\AppData folder instead? The objective is to create an application which will install for users who are not members of the administrators group on the local machine and will not show the UAC prompt on Vista. I believe a limitation this method would be that if it installs under the app data folder for the current user other users couldn't run it. Thanks, Pete
windows-vista
installer
windows-xp
administrator
null
null
open
How do we create an installer than doesn't require administrator permissions? === When creating a setup/MSI with Visual Studio is it possible to make a setup for a simple application that doesn't require administrator permissions to install? If its not possible under Windows XP is it possible under Vista? For example a simple image maniputlation application that allows you to paste photos on top of backgrounds. I believe installing to the Program Files folder requires administrator permissions? Can we install in the <user name>\AppData folder instead? The objective is to create an application which will install for users who are not members of the administrators group on the local machine and will not show the UAC prompt on Vista. I believe a limitation this method would be that if it installs under the app data folder for the current user other users couldn't run it. Thanks, Pete
0
73,308
09/16/2008 15:01:45
12,628
09/16/2008 15:01:45
1
0
True timeout on LWP::UserAgent request method
I am trying to implement a request to an unreliable server. The request is a nice to have, but not 100% required for my perl script to successfully complete. The problem is that the server will occasionally deadlock (we're trying to figure out why) and the request will never succeed. Since the server thinks it is live, it keeps the socket connection open thus LWP::UserAgent's timeout value does us no good what-so-ever. What is the best way to enforce an absolute timeout on a request? Currently, the code looks like so: my $ua = LWP::UserAgent->new; ua->timeout(5); $ua->cookie_jar({}); my $req = HTTP::Request->new(POST => "http://$host:$port/auth/login"); $req->content_type('application/x-www-form-urlencoded'); $req->content("login[user]=$username&login[password]=$password"); # This line never returns $res = $ua->request($req); I've tried using signals to trigger a timeout, but that does not seem to work. eval { local $SIG{ALRM} = sub { die "alarm\n" }; alarm(1); $res = $ua->request($req); alarm(0); }; # This never runs print "here\n";
perl
lwp
timeout
signals
null
null
open
True timeout on LWP::UserAgent request method === I am trying to implement a request to an unreliable server. The request is a nice to have, but not 100% required for my perl script to successfully complete. The problem is that the server will occasionally deadlock (we're trying to figure out why) and the request will never succeed. Since the server thinks it is live, it keeps the socket connection open thus LWP::UserAgent's timeout value does us no good what-so-ever. What is the best way to enforce an absolute timeout on a request? Currently, the code looks like so: my $ua = LWP::UserAgent->new; ua->timeout(5); $ua->cookie_jar({}); my $req = HTTP::Request->new(POST => "http://$host:$port/auth/login"); $req->content_type('application/x-www-form-urlencoded'); $req->content("login[user]=$username&login[password]=$password"); # This line never returns $res = $ua->request($req); I've tried using signals to trigger a timeout, but that does not seem to work. eval { local $SIG{ALRM} = sub { die "alarm\n" }; alarm(1); $res = $ua->request($req); alarm(0); }; # This never runs print "here\n";
0
73,312
09/16/2008 15:02:23
10,703
09/16/2008 01:08:24
195
7
How you disable the processor cache on a PowerPC processor?
In our embedded system (using a PowerPC processor), we want to disable the processor cache. What steps do we need to take?
embedded
processor
powerpc
null
null
null
open
How you disable the processor cache on a PowerPC processor? === In our embedded system (using a PowerPC processor), we want to disable the processor cache. What steps do we need to take?
0
73,313
09/16/2008 15:02:24
1,625
08/17/2008 16:17:14
11
1
SQLGetData issues using C++ and SQL Native Client
I have a C++ application that uses SQL Native Client to connect to a MS SQL Server 2000. I am trying to retrieve a result from a TEXT column containing more data than the buffer initially allocated to it provides. To clarify my issue, I'll outline what I'm doing (code below): 1. allocate buffer of 1024 bytes use 2. bind buffer to column using SQLBindColumn 3. execute a SELECT query using SQLExecute 4. iterate through results using SQLFetch 5. SQLFetch was unable to return the entire result to my buffer: I'd like to use SQLGetData to retrieve the entire column value I have attempted to use SQLGetData as described in the example in the bottom of this page: http://msdn.microsoft.com/en-us/library/ms715441(VS.85).aspx Using a variant based on this example, both after calling SQLFetch and without calling SQLFetch, I am unable to get SQLGetData to provide results. Instead, under all circumstances, it's providing sql state 07009: Invalid descriptor index. As I continue to hammer on this, does anyone have any idea where I might be going wrong or what I might try differently. I'd prefer a solution that is consistent with the order of operations I've outlined above. Begin code: #include <windows.h> #include <sql.h> #include <sqlext.h> #include <sqltypes.h> #include <sqlncli.h> #include <cstdio> #include <string> const int MAX_CHAR = 1024; bool test_retcode( RETCODE my_code, const char* my_message ) { bool success = ( my_code == SQL_SUCCESS_WITH_INFO || my_code == SQL_SUCCESS ); if ( ! success ) { printf( "%s", my_message ); } return success; } int main ( ) { SQLHENV EnvironmentHandle; RETCODE retcode = SQLAllocHandle( SQL_HANDLE_ENV, SQL_NULL_HANDLE, &EnvironmentHandle ); test_retcode( retcode, "SQLAllocHandle(Env) failed!" ); retcode = SQLSetEnvAttr( EnvironmentHandle, SQL_ATTR_ODBC_VERSION, (SQLPOINTER) SQL_OV_ODBC3, SQL_IS_INTEGER ); test_retcode( retcode, "SQLSetEnvAttr(ODBC version) Failed" ); SQLHDBC ConnHandle; retcode = SQLAllocHandle( SQL_HANDLE_DBC, EnvironmentHandle, &ConnHandle ); test_retcode( retcode, "Could not allocate MS SQL 2000 connection handle." ); SQLSMALLINT driver_out_length; retcode = SQLDriverConnect( ConnHandle, NULL, // we're not interested in spawning a window (SQLCHAR*) "DRIVER={SQL Native Client};SERVER=localhost;UID=username;PWD=password;Database=Test;", SQL_NTS, NULL, 0, &driver_out_length, SQL_DRIVER_NOPROMPT ); test_retcode( retcode, "SQLConnect() Failed" ); SQLHSTMT StatementHandle; retcode = SQLAllocHandle(SQL_HANDLE_STMT, ConnHandle, &StatementHandle); test_retcode( retcode, "Failed to allocate SQL Statement handle." ); char* buffer = new char[ MAX_CHAR ]; SQLINTEGER length = MAX_CHAR - 1; retcode = SQLBindCol( StatementHandle, 1, SQL_C_CHAR, (SQLPOINTER) buffer, (SQLINTEGER) MAX_CHAR, &length ); test_retcode( retcode, "Failed to bind column." ); // VeryLong's first entry contains 1300+ bytes retcode = SQLExecDirect( StatementHandle, (SQLCHAR*) "SELECT VeryLong FROM LongData", SQL_NTS ); test_retcode( retcode, "SQLExecDirect failed." ); // -- Fetch Block (I've tried both with and without this block) retcode = SQLFetch( StatementHandle ); if ( retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO && retcode != SQL_NO_DATA ) { printf( "Problem fetching row.\n" ); return 9; } printf( "Fetched data. length: %d\n", length ); // -- End Fetch Block if ( length >= MAX_CHAR -1 ) { bool sql_success; std::string data; do { // this always returns -1 (SQL_ERROR) RETCODE r2 = SQLGetData( StatementHandle, 1, SQL_C_CHAR, buffer, MAX_CHAR, &length ); printf( "retcode: %i, length: %i\n", r2, length ); if ( test_retcode( r2, "SQLGetData failed." ) ) { data.append( buffer ); } else { char* err_msg = new char[ MAX_CHAR ]; SQLSMALLINT req = 1; SQLCHAR state[6]; SQLINTEGER error; SQLINTEGER output_length; int sql_state = SQLGetDiagRec( SQL_HANDLE_STMT, StatementHandle, req, state, &error, (SQLCHAR*) err_msg, (SQLINTEGER) MAX_CHAR, (SQLSMALLINT*) &output_length ); // state is: 07009, error_msg: "[Microsoft][SQL Native Client]Invalid Descriptor Index" printf( "%s\n", err_msg ); delete err_msg; return 9; } } while ( sql_success && length == MAX_CHAR - 1 ); } printf( "Done.\n" ); return 0; }
c++
mssql
sqlncli
null
null
null
open
SQLGetData issues using C++ and SQL Native Client === I have a C++ application that uses SQL Native Client to connect to a MS SQL Server 2000. I am trying to retrieve a result from a TEXT column containing more data than the buffer initially allocated to it provides. To clarify my issue, I'll outline what I'm doing (code below): 1. allocate buffer of 1024 bytes use 2. bind buffer to column using SQLBindColumn 3. execute a SELECT query using SQLExecute 4. iterate through results using SQLFetch 5. SQLFetch was unable to return the entire result to my buffer: I'd like to use SQLGetData to retrieve the entire column value I have attempted to use SQLGetData as described in the example in the bottom of this page: http://msdn.microsoft.com/en-us/library/ms715441(VS.85).aspx Using a variant based on this example, both after calling SQLFetch and without calling SQLFetch, I am unable to get SQLGetData to provide results. Instead, under all circumstances, it's providing sql state 07009: Invalid descriptor index. As I continue to hammer on this, does anyone have any idea where I might be going wrong or what I might try differently. I'd prefer a solution that is consistent with the order of operations I've outlined above. Begin code: #include <windows.h> #include <sql.h> #include <sqlext.h> #include <sqltypes.h> #include <sqlncli.h> #include <cstdio> #include <string> const int MAX_CHAR = 1024; bool test_retcode( RETCODE my_code, const char* my_message ) { bool success = ( my_code == SQL_SUCCESS_WITH_INFO || my_code == SQL_SUCCESS ); if ( ! success ) { printf( "%s", my_message ); } return success; } int main ( ) { SQLHENV EnvironmentHandle; RETCODE retcode = SQLAllocHandle( SQL_HANDLE_ENV, SQL_NULL_HANDLE, &EnvironmentHandle ); test_retcode( retcode, "SQLAllocHandle(Env) failed!" ); retcode = SQLSetEnvAttr( EnvironmentHandle, SQL_ATTR_ODBC_VERSION, (SQLPOINTER) SQL_OV_ODBC3, SQL_IS_INTEGER ); test_retcode( retcode, "SQLSetEnvAttr(ODBC version) Failed" ); SQLHDBC ConnHandle; retcode = SQLAllocHandle( SQL_HANDLE_DBC, EnvironmentHandle, &ConnHandle ); test_retcode( retcode, "Could not allocate MS SQL 2000 connection handle." ); SQLSMALLINT driver_out_length; retcode = SQLDriverConnect( ConnHandle, NULL, // we're not interested in spawning a window (SQLCHAR*) "DRIVER={SQL Native Client};SERVER=localhost;UID=username;PWD=password;Database=Test;", SQL_NTS, NULL, 0, &driver_out_length, SQL_DRIVER_NOPROMPT ); test_retcode( retcode, "SQLConnect() Failed" ); SQLHSTMT StatementHandle; retcode = SQLAllocHandle(SQL_HANDLE_STMT, ConnHandle, &StatementHandle); test_retcode( retcode, "Failed to allocate SQL Statement handle." ); char* buffer = new char[ MAX_CHAR ]; SQLINTEGER length = MAX_CHAR - 1; retcode = SQLBindCol( StatementHandle, 1, SQL_C_CHAR, (SQLPOINTER) buffer, (SQLINTEGER) MAX_CHAR, &length ); test_retcode( retcode, "Failed to bind column." ); // VeryLong's first entry contains 1300+ bytes retcode = SQLExecDirect( StatementHandle, (SQLCHAR*) "SELECT VeryLong FROM LongData", SQL_NTS ); test_retcode( retcode, "SQLExecDirect failed." ); // -- Fetch Block (I've tried both with and without this block) retcode = SQLFetch( StatementHandle ); if ( retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO && retcode != SQL_NO_DATA ) { printf( "Problem fetching row.\n" ); return 9; } printf( "Fetched data. length: %d\n", length ); // -- End Fetch Block if ( length >= MAX_CHAR -1 ) { bool sql_success; std::string data; do { // this always returns -1 (SQL_ERROR) RETCODE r2 = SQLGetData( StatementHandle, 1, SQL_C_CHAR, buffer, MAX_CHAR, &length ); printf( "retcode: %i, length: %i\n", r2, length ); if ( test_retcode( r2, "SQLGetData failed." ) ) { data.append( buffer ); } else { char* err_msg = new char[ MAX_CHAR ]; SQLSMALLINT req = 1; SQLCHAR state[6]; SQLINTEGER error; SQLINTEGER output_length; int sql_state = SQLGetDiagRec( SQL_HANDLE_STMT, StatementHandle, req, state, &error, (SQLCHAR*) err_msg, (SQLINTEGER) MAX_CHAR, (SQLSMALLINT*) &output_length ); // state is: 07009, error_msg: "[Microsoft][SQL Native Client]Invalid Descriptor Index" printf( "%s\n", err_msg ); delete err_msg; return 9; } } while ( sql_success && length == MAX_CHAR - 1 ); } printf( "Done.\n" ); return 0; }
0
73,319
09/16/2008 15:02:52
11,439
09/16/2008 07:58:40
11
2
Duplicate a whole line in Vim
How do I duplicate a whole line in Vim in a similiar way to CTRL+D in IntelliJ IDEA/Resharper or Ctrl Alt Arrow in Eclipse?
vim
null
null
null
null
null
open
Duplicate a whole line in Vim === How do I duplicate a whole line in Vim in a similiar way to CTRL+D in IntelliJ IDEA/Resharper or Ctrl Alt Arrow in Eclipse?
0
73,320
09/16/2008 15:02:55
12,597
09/16/2008 14:53:25
1
2
How to set the header sort glyph in a .NET ListView?
How do i set the column which has the header sort glyph, and its direction, in a .NET ListView. Without custom drawing.
listview
header
sorting
glyph
null
null
open
How to set the header sort glyph in a .NET ListView? === How do i set the column which has the header sort glyph, and its direction, in a .NET ListView. Without custom drawing.
0
73,335
09/16/2008 15:04:38
12,559
09/16/2008 14:44:51
1
0
How can I save some JavaScript state information back to my server onUnload?
I have an ExtJS grid on a web page and I'd like to save some of its state information back to the server when the users leaves the page. Can I do this with an Ajax request onUnload? If not, what's a better solution?
javascript
ajax
extjs
null
null
null
open
How can I save some JavaScript state information back to my server onUnload? === I have an ExtJS grid on a web page and I'd like to save some of its state information back to the server when the users leaves the page. Can I do this with an Ajax request onUnload? If not, what's a better solution?
0
73,359
09/16/2008 15:06:58
1,909
08/19/2008 14:04:34
1
1
.NET Introspection VS Reflection
What is the difference between Introspection and Reflection in .NET
.net
reflection
introspection
null
null
null
open
.NET Introspection VS Reflection === What is the difference between Introspection and Reflection in .NET
0
73,366
09/16/2008 15:07:30
7,647
09/15/2008 14:08:04
313
14
How do you read JavaDoc?
What tools/websites do you use to read JavaDocs? I currently use Firefox with 20+ tabs open when working on a J2EE project to have all the documentation available which is not very usable, is eating too much memory and is not searchable. What I would expect from such a tool/website: - Aggregate JavaDocs from different locations - Direct access to types like Ctrl+T in Eclipse or similar - Fulltext search - Cross referencing between all the Java libraries I've chosen - For a tool: offline support - Speed not mandatory: - possibility to annotate things - support for different versions of a library (+ diffing ?) - IDE integration
javadoc
java
documentation
null
null
null
open
How do you read JavaDoc? === What tools/websites do you use to read JavaDocs? I currently use Firefox with 20+ tabs open when working on a J2EE project to have all the documentation available which is not very usable, is eating too much memory and is not searchable. What I would expect from such a tool/website: - Aggregate JavaDocs from different locations - Direct access to types like Ctrl+T in Eclipse or similar - Fulltext search - Cross referencing between all the Java libraries I've chosen - For a tool: offline support - Speed not mandatory: - possibility to annotate things - support for different versions of a library (+ diffing ?) - IDE integration
0
73,380
09/16/2008 15:09:25
12,382
09/16/2008 14:10:53
58
1
How to gracefully deal with ViewState errors?
I'm running some c# .net pages with various gridviews. If I ever leave any of them alone in a web browser for an extended period of time (usually overnight), I get the following error when I click any element on the page. I'm not really sure where to start dealing with the problem. I don't mind resetting the page if it's viewstate has expired, but throwing an error is unacceptable! --- Error: The state information is invalid for this page and might be corrupted. Target: Void ThrowError(System.Exception, System.String, System.String, Boolean) Data: System.Collections.ListDictionaryInternal Inner: System.Web.UI.ViewStateException: Invalid viewstate. Client IP: 66.35.180.246 Port: 1799 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0 ViewState: (**Very long Gibberish Omitted!**) Offending URL: (**Omitted**) Source: System.Web Message: The state information is invalid for this page and might be corrupted. Stack trace: at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) at System.Web.UI.ClientScriptManager.EnsureEventValidationFieldLoaded() at System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) at System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument) at System.Web.UI.WebControls.DropDownList.LoadPostData(String postDataKey, NameValueCollection postCollection) at System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
c#
.net
exception
viewstate
null
null
open
How to gracefully deal with ViewState errors? === I'm running some c# .net pages with various gridviews. If I ever leave any of them alone in a web browser for an extended period of time (usually overnight), I get the following error when I click any element on the page. I'm not really sure where to start dealing with the problem. I don't mind resetting the page if it's viewstate has expired, but throwing an error is unacceptable! --- Error: The state information is invalid for this page and might be corrupted. Target: Void ThrowError(System.Exception, System.String, System.String, Boolean) Data: System.Collections.ListDictionaryInternal Inner: System.Web.UI.ViewStateException: Invalid viewstate. Client IP: 66.35.180.246 Port: 1799 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0 ViewState: (**Very long Gibberish Omitted!**) Offending URL: (**Omitted**) Source: System.Web Message: The state information is invalid for this page and might be corrupted. Stack trace: at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) at System.Web.UI.ClientScriptManager.EnsureEventValidationFieldLoaded() at System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) at System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument) at System.Web.UI.WebControls.DropDownList.LoadPostData(String postDataKey, NameValueCollection postCollection) at System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
0
73,385
09/16/2008 15:10:30
12,653
09/16/2008 15:08:20
1
0
asp.net Convert CSV string to string[]
Is there an easy way to convert a string from csv format into a string[] or list<string>?
c#
string
null
null
null
null
open
asp.net Convert CSV string to string[] === Is there an easy way to convert a string from csv format into a string[] or list<string>?
0
73,432
09/16/2008 15:15:50
11,911
09/16/2008 12:13:45
1
6
How can I transfer my domains from my existing registrar/hosting service to something like GoDaddy?
Will I have to pay again? I have about 9 months left before renewal but my current provider doesn't offer many options / control panels.
web-hosting
name
domain
null
null
null
open
How can I transfer my domains from my existing registrar/hosting service to something like GoDaddy? === Will I have to pay again? I have about 9 months left before renewal but my current provider doesn't offer many options / control panels.
0
73,433
09/16/2008 15:15:55
12,658
09/16/2008 15:09:52
1
0
Does a caching-nameserver usually cache the negative DNS response SERVFAIL
Does a caching-nameserver usually cache the negative DNS response SERVFAIL?
dns
null
null
null
null
null
open
Does a caching-nameserver usually cache the negative DNS response SERVFAIL === Does a caching-nameserver usually cache the negative DNS response SERVFAIL?
0
73,439
09/16/2008 15:16:19
12,218
09/16/2008 13:39:05
1
0
Is there a python package to interface with MS Cluster ?
I need to write a couple of python scripts to automate the installation of Microsoft Cluster Ressources. More specifically, I'll need to query MS Cluster to be able to get a list of ressources with their parameters. And I also need to be able to create resources and set their parameters. Is someone knows if there is a package/module. Or even some sample scripts using Mark Hammond's pywin32 packages ?
python
windows
clustering
pywin32
null
null
open
Is there a python package to interface with MS Cluster ? === I need to write a couple of python scripts to automate the installation of Microsoft Cluster Ressources. More specifically, I'll need to query MS Cluster to be able to get a list of ressources with their parameters. And I also need to be able to create resources and set their parameters. Is someone knows if there is a package/module. Or even some sample scripts using Mark Hammond's pywin32 packages ?
0
73,445
09/16/2008 15:16:41
5,569
09/10/2008 14:12:35
1
1
What are some good Java RDF libraries.
I'm looking for a light weight java library for dealing with RDF data. It needs to be able to parse and write RDF xml data. Also I would like it to support simple querying of an RDF model. SPARQL would be nice but not required and I don't need an inferencing capabilities. I've used Jena, but it's not very light weight.
java
xml
rdf
null
null
null
open
What are some good Java RDF libraries. === I'm looking for a light weight java library for dealing with RDF data. It needs to be able to parse and write RDF xml data. Also I would like it to support simple querying of an RDF model. SPARQL would be nice but not required and I don't need an inferencing capabilities. I've used Jena, but it's not very light weight.
0
73,447
09/16/2008 15:16:57
366,182
09/16/2008 13:30:44
21
3
HashBytes() Function T-SQL
What's the most efficient way to convert the output of this function from a varbinary() to a a varchar()?
transact-sql
sql-server
null
null
null
null
open
HashBytes() Function T-SQL === What's the most efficient way to convert the output of this function from a varbinary() to a a varchar()?
0
73,456
09/16/2008 15:17:21
288
08/04/2008 12:50:02
106
8
asp.net dropDownBox selectedIndex not being maintained.
I have a weird problem with a dropdownbox selectedIndex always being set to 0 upon postback. I'm not accidentally rebinding it in my code. In fact I've placed a breakpoint at the very first line of the page_load event and the value is already set to zero. The dropdown is in the master page of my project, I don't know if that makes a difference. I'm not referencing the control in my content holder. If I set my autoPostBack = 'true' the page works fine. I don't have to change any code and the selectedIndex is maintained. I have also tried setting enableViewState on and off and it doesn't make a difference. At this point I'm grasping at straws to figure out what's going on. I've never had this problem before.
asp.net
.net-2.0
null
null
null
null
open
asp.net dropDownBox selectedIndex not being maintained. === I have a weird problem with a dropdownbox selectedIndex always being set to 0 upon postback. I'm not accidentally rebinding it in my code. In fact I've placed a breakpoint at the very first line of the page_load event and the value is already set to zero. The dropdown is in the master page of my project, I don't know if that makes a difference. I'm not referencing the control in my content holder. If I set my autoPostBack = 'true' the page works fine. I don't have to change any code and the selectedIndex is maintained. I have also tried setting enableViewState on and off and it doesn't make a difference. At this point I'm grasping at straws to figure out what's going on. I've never had this problem before.
0
73,467
09/16/2008 15:18:33
6,542
09/15/2008 12:12:46
1
0
What's the best way to tell if a method is a property from within Policy Injection?
I've got a custom handler applied to a class (using the Policy Injection Application Block in entlib 4) and I would like to know whether the input method is a property when Invoke is called. Following is what my handler looks like. [ConfigurationElementType(typeof(MyCustomHandlerData))] public class MyCustomHandler : ICallHandler { public IMethodReturn Invoke(IMethodInvocation input, GetNextHandlerDelegate getNext) { if (input.MethodBase.IsPublic && (input.MethodBase.Name.Contains("get_") || input.MethodBase.Name.Contains("set_"))) { Console.WriteLine("MyCustomHandler Invoke called with input of {0}", input.MethodBase.Name); } return getNext().Invoke(input, getNext); } public int Order { get; set; } } As you can see from my code sample, the best way I've thought of so far is by parsing the method name. Isn't there a better way to do this?
c#
enterprise-library
policy-injection
null
null
null
open
What's the best way to tell if a method is a property from within Policy Injection? === I've got a custom handler applied to a class (using the Policy Injection Application Block in entlib 4) and I would like to know whether the input method is a property when Invoke is called. Following is what my handler looks like. [ConfigurationElementType(typeof(MyCustomHandlerData))] public class MyCustomHandler : ICallHandler { public IMethodReturn Invoke(IMethodInvocation input, GetNextHandlerDelegate getNext) { if (input.MethodBase.IsPublic && (input.MethodBase.Name.Contains("get_") || input.MethodBase.Name.Contains("set_"))) { Console.WriteLine("MyCustomHandler Invoke called with input of {0}", input.MethodBase.Name); } return getNext().Invoke(input, getNext); } public int Order { get; set; } } As you can see from my code sample, the best way I've thought of so far is by parsing the method name. Isn't there a better way to do this?
0
73,468
09/16/2008 15:18:36
12,661
09/16/2008 15:10:21
1
0
Non-blocking pthread_join
Is there a way of doing a non-blocking pthread_join? Some sort of timed join would be good to.
c
multithreading
pthreads
null
null
null
open
Non-blocking pthread_join === Is there a way of doing a non-blocking pthread_join? Some sort of timed join would be good to.
0
73,471
09/16/2008 15:18:57
3,012
08/26/2008 11:55:24
374
15
How can I highlight the current cell in a DataGridView when SelectionMode=FullRowSelect
I have an editable DataGridView with SelectionMode set to FullRowSelect (so the whole row is highlighted when the user clicks on any cell). However I would like the cell that currently has focus to be highlighted with a different back color (so the user can clearly see what cell they are about to edit). How can I do this (I do not want to change the SelectionMode)?
.net
winforms
datagridview
null
null
null
open
How can I highlight the current cell in a DataGridView when SelectionMode=FullRowSelect === I have an editable DataGridView with SelectionMode set to FullRowSelect (so the whole row is highlighted when the user clicks on any cell). However I would like the cell that currently has focus to be highlighted with a different back color (so the user can clearly see what cell they are about to edit). How can I do this (I do not want to change the SelectionMode)?
0
73,474
09/16/2008 15:19:28
12,178
09/16/2008 13:29:35
6
3
Not able to delete directory
I am having a frequent problems with my web hosting (its shared) I am not able to delete or change permission for a particular directory. The response is "Cannot delete. Directory may not be empty". I checked the permissions and it looks OK. There are 100s of files in this folder which I dont want. I contacted my support and they solved it saying it was permission issue. But it reappeared. Any suggestions? The server is Linux.
linux
directoryservices
null
null
null
null
open
Not able to delete directory === I am having a frequent problems with my web hosting (its shared) I am not able to delete or change permission for a particular directory. The response is "Cannot delete. Directory may not be empty". I checked the permissions and it looks OK. There are 100s of files in this folder which I dont want. I contacted my support and they solved it saying it was permission issue. But it reappeared. Any suggestions? The server is Linux.
0
73,476
09/16/2008 15:19:30
9,254
09/15/2008 18:12:15
1
1
How do I encode arbitrary data to XML using Java 1.4 and SAX?
We use SAX to parse XML because it does not require the entire XML document to be read into memory in order to parse a single value. I read many articles that insisted SAX can only be used to parse/decode XML and not create it. Is this true?
java
xml
sax
null
null
null
open
How do I encode arbitrary data to XML using Java 1.4 and SAX? === We use SAX to parse XML because it does not require the entire XML document to be read into memory in order to parse a single value. I read many articles that insisted SAX can only be used to parse/decode XML and not create it. Is this true?
0
73,484
09/16/2008 15:20:26
12,022
09/16/2008 12:53:21
11
2
How to 'bind' Text property of a label in markup
Basically I would like to find a way to ddo something like: <asp:Label ID="lID" runat="server" AssociatedControlID="txtId" Text="<%# MyProperty %>"></asp:Label> I know I could set it from code behind (writing lId.Text = MyProperty), but I'd prefer doing it in the markup and I just can't seem to find the solution. (MyProperty is a string property) cheers
c#
asp.net
null
null
null
null
open
How to 'bind' Text property of a label in markup === Basically I would like to find a way to ddo something like: <asp:Label ID="lID" runat="server" AssociatedControlID="txtId" Text="<%# MyProperty %>"></asp:Label> I know I could set it from code behind (writing lId.Text = MyProperty), but I'd prefer doing it in the markup and I just can't seem to find the solution. (MyProperty is a string property) cheers
0
73,487
09/16/2008 15:20:45
6,542
09/15/2008 12:12:46
1
0
Where can I get a simple explanation of policy injection?
I'd like a dead simple explanation of policy injection for less-informed co-workers. Where is a good resource for this? I learned about policy injection from the entlib help files, which I'm sure aren't the best option.
policy-injection
null
null
null
null
null
open
Where can I get a simple explanation of policy injection? === I'd like a dead simple explanation of policy injection for less-informed co-workers. Where is a good resource for this? I learned about policy injection from the entlib help files, which I'm sure aren't the best option.
0
73,491
09/16/2008 15:21:03
5,313
09/09/2008 01:47:27
11
1
Missing aar file in maven2 multi-project build
I'm trying to use maven2 to build an axis2 project. My project is configured as a parent project with AAR, WAR, and EAR modules. When I run the parent project's package goal, the console shows a successful build and all of the files are created. However the AAR file generated by AAR project is not included in the generated WAR project. The AAR project is listed as a dependency of WAR project. When I explicitly run the WAR's package goal, the AAR file is then included in the WAR file. Why would the parent's package goal not include the necessary dependency while running the child's package goal does? I'm using the maven-war-plugin v2.1-alpha-2 in my war project. Thanks, Joe
maven-2
null
null
null
null
null
open
Missing aar file in maven2 multi-project build === I'm trying to use maven2 to build an axis2 project. My project is configured as a parent project with AAR, WAR, and EAR modules. When I run the parent project's package goal, the console shows a successful build and all of the files are created. However the AAR file generated by AAR project is not included in the generated WAR project. The AAR project is listed as a dependency of WAR project. When I explicitly run the WAR's package goal, the AAR file is then included in the WAR file. Why would the parent's package goal not include the necessary dependency while running the child's package goal does? I'm using the maven-war-plugin v2.1-alpha-2 in my war project. Thanks, Joe
0
73,498
09/16/2008 15:22:02
2,773
08/25/2008 00:43:07
534
25
Programmatically select an MFC radio button
When I'm initializing a dialog, I'd like to select one of the radio buttons on the form. I don't see a way to associate a Control variable using the Class Wizard, like you would typically do with CButtons, CComboBoxes, etc... Further, it doesn't like a CRadioButton class even exists. How can I select one of the several radio buttons?
winapi
mfc
null
null
null
null
open
Programmatically select an MFC radio button === When I'm initializing a dialog, I'd like to select one of the radio buttons on the form. I don't see a way to associate a Control variable using the Class Wizard, like you would typically do with CButtons, CComboBoxes, etc... Further, it doesn't like a CRadioButton class even exists. How can I select one of the several radio buttons?
0
73,515
09/16/2008 15:23:21
12,717
09/16/2008 15:23:21
1
0
How to tell if .net code is being run by Visual Studio designer
I am getting some errors thrown in my code when I open a win form in visual studio's designer. I would like to branch in my code and perform a different initialization if the form is being opened by designer than if it is being run for real. How can I determine at run-time if the code is being executed as part of designer opening the form? Thanks
visual-studio
gui-designer
null
null
null
null
open
How to tell if .net code is being run by Visual Studio designer === I am getting some errors thrown in my code when I open a win form in visual studio's designer. I would like to branch in my code and perform a different initialization if the form is being opened by designer than if it is being run for real. How can I determine at run-time if the code is being executed as part of designer opening the form? Thanks
0
73,517
09/16/2008 15:23:42
3,059
08/26/2008 13:59:08
63
5
Silverlight Cross Domain Policies
In a silverlight application, I want to access the page the silverlight .xap file from an HTTP subdomain, but have the web services access a different subdomain for sensitive information over HTTPS. I set up clientaccesspolicy.xml at the root of the subdomain and it lets the silverlight app access its services over http, but not over https. It gives the cross domain access error that it would give normally without a clientaccesspolicy in place. I know that browsers themselves have a lot of restrictions about mixing http and https. Am I trying to do something that is not allowed?
silverlight
null
null
null
null
null
open
Silverlight Cross Domain Policies === In a silverlight application, I want to access the page the silverlight .xap file from an HTTP subdomain, but have the web services access a different subdomain for sensitive information over HTTPS. I set up clientaccesspolicy.xml at the root of the subdomain and it lets the silverlight app access its services over http, but not over https. It gives the cross domain access error that it would give normally without a clientaccesspolicy in place. I know that browsers themselves have a lot of restrictions about mixing http and https. Am I trying to do something that is not allowed?
0
73,518
09/16/2008 15:23:43
2,744
08/24/2008 20:43:50
39
1
How do you direct traffic to/from a particular site to a specific NIC?
In Windows XP: How do you direct traffic to/from a particular site to a specific NIC? For Instance: How do I say, all connections to stackoverflow.com should use my wireless connection, while all other sites will use my ethernet?
networking
null
null
null
null
null
open
How do you direct traffic to/from a particular site to a specific NIC? === In Windows XP: How do you direct traffic to/from a particular site to a specific NIC? For Instance: How do I say, all connections to stackoverflow.com should use my wireless connection, while all other sites will use my ethernet?
0
73,519
09/16/2008 15:23:45
11,344
09/16/2008 07:17:03
1
4
Remove C++-STL/Boost debug symbols
I would like to remove STL/Boost debug symbols from libraries and executable, for two reasons: 1. Linking gets very slow for big programs 2. Debugging jumps into stl/boost code, which is annoying For 1. incremental linking would be a big improvement, but AFAIK ld does not support incremental linking. There is a workaround "pseudo incremental linking" in an 1999 dr.dobb's journal (not in the web any more, but at [archive.org](http://web.archive.org/web/20000131063231/www.ddj.com/articles/1999/9910/9910d/9910d.htm) (the idea is to put everything in a dynamic library and all updated object files in an second one that is loaded first) but this is not really a general solution. For 2. there is a script [here](http://ubuntuforums.org/showthread.php?p=4368377), but a) it did not work for me (it did not remove symbols), b) it is very slow as it works at the end of the pipe, while it would be more efficient to remove the symbols earlier.
c++
debugging
symbols
stl
link-performance
null
open
Remove C++-STL/Boost debug symbols === I would like to remove STL/Boost debug symbols from libraries and executable, for two reasons: 1. Linking gets very slow for big programs 2. Debugging jumps into stl/boost code, which is annoying For 1. incremental linking would be a big improvement, but AFAIK ld does not support incremental linking. There is a workaround "pseudo incremental linking" in an 1999 dr.dobb's journal (not in the web any more, but at [archive.org](http://web.archive.org/web/20000131063231/www.ddj.com/articles/1999/9910/9910d/9910d.htm) (the idea is to put everything in a dynamic library and all updated object files in an second one that is loaded first) but this is not really a general solution. For 2. there is a script [here](http://ubuntuforums.org/showthread.php?p=4368377), but a) it did not work for me (it did not remove symbols), b) it is very slow as it works at the end of the pipe, while it would be more efficient to remove the symbols earlier.
0
73,524
09/16/2008 15:24:02
5,346
09/09/2008 10:01:45
246
14
How do I convert from alocation to a YGeoPoint in Yahoo Maps API?
I have a list of addresses from a Database for which I'd like to put markers on a Yahoo Map. The [`addMarker()` method][1] on YMap takes a YGeoPoint, which requires a latitude and longitude. However, Yahoo Maps must know how to convert from addresses because `drawZoomAndCenter(LocationType,ZoomLevel)` can take an address. I could convert by using `drawZoomAndCenter()` then `getCenterLatLon()` but is there a better way? [1]: http://developer.yahoo.com/maps/ajax/V3.8/index.html#YMap
yahoo-mapping
api
null
null
null
null
open
How do I convert from alocation to a YGeoPoint in Yahoo Maps API? === I have a list of addresses from a Database for which I'd like to put markers on a Yahoo Map. The [`addMarker()` method][1] on YMap takes a YGeoPoint, which requires a latitude and longitude. However, Yahoo Maps must know how to convert from addresses because `drawZoomAndCenter(LocationType,ZoomLevel)` can take an address. I could convert by using `drawZoomAndCenter()` then `getCenterLatLon()` but is there a better way? [1]: http://developer.yahoo.com/maps/ajax/V3.8/index.html#YMap
0
73,527
09/16/2008 15:24:18
9,594
09/15/2008 19:17:54
11
1
What's the best option for searching in Ruby on Rails?
There are several plugin options for building a search engine into your Ruby on Rails application. Which of these is the best? - [Thinking Sphinx][1] - [UltraSphinx][2] - [Sphincter][3] - [acts_as_sphinx][4] - [acts_as_ferret][5] - [Ferret][6] [1]: http://ts.freelancing-gods.com/ [2]: http://blog.evanweaver.com/files/doc/fauna/ultrasphinx/files/README.html [3]: http://seattlerb.rubyforge.org/Sphincter/ [4]: http://www.datanoise.com/articles/2007/3/23/acts_as_sphinx-plugin [5]: http://projects.jkraemer.net/acts_as_ferret/ [6]: http://ferret.davebalmain.com/trac/
ruby-on-rails
search
ruby
null
null
null
open
What's the best option for searching in Ruby on Rails? === There are several plugin options for building a search engine into your Ruby on Rails application. Which of these is the best? - [Thinking Sphinx][1] - [UltraSphinx][2] - [Sphincter][3] - [acts_as_sphinx][4] - [acts_as_ferret][5] - [Ferret][6] [1]: http://ts.freelancing-gods.com/ [2]: http://blog.evanweaver.com/files/doc/fauna/ultrasphinx/files/README.html [3]: http://seattlerb.rubyforge.org/Sphincter/ [4]: http://www.datanoise.com/articles/2007/3/23/acts_as_sphinx-plugin [5]: http://projects.jkraemer.net/acts_as_ferret/ [6]: http://ferret.davebalmain.com/trac/
0
73,536
09/16/2008 15:25:03
12,280
09/16/2008 13:51:28
51
6
Are REST request headers encrypted by SSL?
I'm developing a client/server app that will communicate via rest. Some custom request data will be stored in the header of the request. Both the server sending the request and the receiving server have an SSL certificate - will the headers be encrypted, or just the content?
http
ssl
rest
webservice
null
null
open
Are REST request headers encrypted by SSL? === I'm developing a client/server app that will communicate via rest. Some custom request data will be stored in the header of the request. Both the server sending the request and the receiving server have an SSL certificate - will the headers be encrypted, or just the content?
0