content
stringlengths
86
88.9k
title
stringlengths
0
150
question
stringlengths
1
35.8k
answers
list
answers_scores
list
non_answers
list
non_answers_scores
list
tags
list
name
stringlengths
30
130
Q: Microsoft Office 2007 file type, Mime types and identifying characters Where can I find a list of all of the MIME types and the identifying characters for Microsoft Office 2007 files? I have an upload form that is restricting uploads based on the extensions and identifying characters, but I cannot seem to find the...
Microsoft Office 2007 file type, Mime types and identifying characters
Where can I find a list of all of the MIME types and the identifying characters for Microsoft Office 2007 files? I have an upload form that is restricting uploads based on the extensions and identifying characters, but I cannot seem to find the Office 2007 MIME types. Can anyone help?
[ "Office 2007 MIME Types for IIS\n\n.docm, application/vnd.ms-word.document.macroEnabled.12\n.docx, application/vnd.openxmlformats-officedocument.wordprocessingml.document\n.dotm, application/vnd.ms-word.template.macroEnabled.12\n.dotx, application/vnd.openxmlformats-officedocument.wordprocessingml.template\n.potm, ...
[ 26 ]
[]
[]
[ "file_type", "mime", "office_2007" ]
stackoverflow_0000000061_file_type_mime_office_2007.txt
Q: XSD DataSets and ignoring foreign keys I have a pretty standard table set-up in a current application using the .NET XSD DataSet and TableAdapter features. My contracts table consists of some standard contract information, with a column for the primary department. This column is a foreign key to my Departments tab...
XSD DataSets and ignoring foreign keys
I have a pretty standard table set-up in a current application using the .NET XSD DataSet and TableAdapter features. My contracts table consists of some standard contract information, with a column for the primary department. This column is a foreign key to my Departments table, where I store the basic department name,...
[ "You can try turning Check-constraints off on the DataSet (it's in its properties), or altering the properties of that relationship, and change the key to a simple reference - up to you.\n" ]
[ 13 ]
[]
[]
[ ".net", "database", "xsd" ]
stackoverflow_0000000134_.net_database_xsd.txt
Q: What is the meaning of the type safety warning in certain Java generics casts? What is the meaning of the Java warning? Type safety: The cast from Object to List<Integer> is actually checking against the erased type List I get this warning when I try to cast an Object to a type with generic information, such as ...
What is the meaning of the type safety warning in certain Java generics casts?
What is the meaning of the Java warning? Type safety: The cast from Object to List<Integer> is actually checking against the erased type List I get this warning when I try to cast an Object to a type with generic information, such as in the following code: Object object = getMyList(); List<Integer> list = (List<Integ...
[ "This warning is there because Java is not actually storing type information at run-time in an object that uses generics. Thus, if object is actually a List<String>, there will be no ClassCastException at run-time except until an item is accessed from the list that doesn't match the generic type defined in the var...
[ 53 ]
[]
[]
[ "casting", "generics", "java", "type_safety", "warnings" ]
stackoverflow_0000000382_casting_generics_java_type_safety_warnings.txt
Q: Floating Point Number parsing: Is there a Catch All algorithm? One of the fun parts of multi-cultural programming is number formats. Americans use 10,000.50 Germans use 10.000,50 French use 10 000,50 My first approach would be to take the string, parse it backwards until I encounter a separator and use this as m...
Floating Point Number parsing: Is there a Catch All algorithm?
One of the fun parts of multi-cultural programming is number formats. Americans use 10,000.50 Germans use 10.000,50 French use 10 000,50 My first approach would be to take the string, parse it backwards until I encounter a separator and use this as my decimal separator. There is an obvious flaw with that: 10.000 woul...
[ "I think the best you can do in this case is to take their input and then show them what you think they meant. If they disagree, show them the format you're expecting and get them to enter it again.\n", "I don't know the ASP.NET side of the problem but .NET has a pretty powerful class: System.Globalization.Cultur...
[ 31, 27, 12, 10 ]
[]
[]
[ ".net", "asp.net", "c#", "globalization", "internationalization" ]
stackoverflow_0000000192_.net_asp.net_c#_globalization_internationalization.txt
Q: Homegrown consumption of web services I've been writing a few web services for a .net app, now I'm ready to consume them. I've seen numerous examples where there is homegrown code for consuming the service as opposed to using the auto generated methods that Visual Studio creates when adding the web reference. Is ...
Homegrown consumption of web services
I've been writing a few web services for a .net app, now I'm ready to consume them. I've seen numerous examples where there is homegrown code for consuming the service as opposed to using the auto generated methods that Visual Studio creates when adding the web reference. Is there some advantages to this?
[ "No, what you're doing is fine. Don't let those people confuse you.\nIf you've written the web services with .net then the reference proxies generated by .net are going to be quite suitable. The situation you describe (where you are both producer and consumer) is the ideal situation.\nIf you need to connect to a we...
[ 11 ]
[]
[]
[ ".net", "web_services" ]
stackoverflow_0000000470_.net_web_services.txt
Q: Lucene Score results In Lucene if you had multiple indexes that covered only one partition each. Why does the same search on different indexes return results with different scores? The results from different servers match exactly. i.e. if I searched for : Name - John Smith DOB - 11/11/1934 Partition 0 would ret...
Lucene Score results
In Lucene if you had multiple indexes that covered only one partition each. Why does the same search on different indexes return results with different scores? The results from different servers match exactly. i.e. if I searched for : Name - John Smith DOB - 11/11/1934 Partition 0 would return a score of 0.345 Parti...
[ "The scoring contains the Inverse Document Frequency(IDF). If the term \"John Smith\" is in one partition, 0, 100 times and in partition 1, once. The score for searching for John Smith would be higher search in partition 1 as the term is more scarce.\nTo get round this you would wither have to have your index being...
[ 20, 13, 9 ]
[]
[]
[ "lucene", "search" ]
stackoverflow_0000000387_lucene_search.txt
Q: How to write to Web.Config in Medium Trust? Uploading my first decently sized web app to my shared host provided me with a fresh set of challenges, by which I mean, sleepless nights. The issue was that I had most certainly not developed my application for medium trust (or had any clue what that was.) I mitigated ...
How to write to Web.Config in Medium Trust?
Uploading my first decently sized web app to my shared host provided me with a fresh set of challenges, by which I mean, sleepless nights. The issue was that I had most certainly not developed my application for medium trust (or had any clue what that was.) I mitigated all of the issues, save one. I had written an in...
[ "That actually sounds like IIS's Low level. If it is, then you won't be able to write to any file, not just the web.config.\nHere are the levels from IIS's help file:\n\n\n\nFull (internal) - Specifies unrestricted permissions. Grants the ASP.NET application permissions to access any resource that is subject to ope...
[ 24 ]
[]
[]
[ "asp.net", "c#", "medium_trust" ]
stackoverflow_0000000562_asp.net_c#_medium_trust.txt
Q: Visual Studio Setup Project - Per User Registry Settings I'm trying to maintain a Setup Project in Visual Studio 2003 (yes, it's a legacy application). The problem we have at the moment is that we need to write registry entries to HKCU for every user on the computer. They need to be in the HKCU rather than HKLM be...
Visual Studio Setup Project - Per User Registry Settings
I'm trying to maintain a Setup Project in Visual Studio 2003 (yes, it's a legacy application). The problem we have at the moment is that we need to write registry entries to HKCU for every user on the computer. They need to be in the HKCU rather than HKLM because they are the default user settings, and they do change p...
[ "First: Yes, this is something that belongs in the Application for the exact reson you specified: What happens after new user profiles are created? Sure, if you're using a domain it's possible to have some stuff put in the registry on creation, but this is not really a use case. The Application should check if ther...
[ 6, 6, 3, 2 ]
[]
[]
[ "installation", "registry", "visual_studio", "windows" ]
stackoverflow_0000000810_installation_registry_visual_studio_windows.txt
Q: Client collation and SQL Server 2005 We're upgrading an existing program from Win2k/SQL Server 2k to Windows 2003 and SQL Server 2005 as well as purchasing a new program that also uses 2k3/2k5. The vendor says that for us to host both databases we need to get the Enterprise version because the softwares clients us...
Client collation and SQL Server 2005
We're upgrading an existing program from Win2k/SQL Server 2k to Windows 2003 and SQL Server 2005 as well as purchasing a new program that also uses 2k3/2k5. The vendor says that for us to host both databases we need to get the Enterprise version because the softwares clients use different collation for the connections ...
[ "All editions of SQL Server 2000/2005/2008 support having multiple databases, each using their own collation sequence. You don't need the Enterprise version. \nWhen you have a database that uses a collation sequence that is different from default collation for the database server, you will need to take some extra...
[ 7 ]
[]
[]
[ "sql_server", "sql_server_2005", "windows_server_2003" ]
stackoverflow_0000000905_sql_server_sql_server_2005_windows_server_2003.txt
Q: Upgrading SQL Server 6.5 Yes, I know. The existence of a running copy of SQL Server 6.5 in 2008 is absurd. That stipulated, what is the best way to migrate from 6.5 to 2005? Is there any direct path? Most of the documentation I've found deals with upgrading 6.5 to 7. Should I forget about the native SQL Server ...
Upgrading SQL Server 6.5
Yes, I know. The existence of a running copy of SQL Server 6.5 in 2008 is absurd. That stipulated, what is the best way to migrate from 6.5 to 2005? Is there any direct path? Most of the documentation I've found deals with upgrading 6.5 to 7. Should I forget about the native SQL Server upgrade utilities, script out ...
[ "Hey, I'm still stuck in that camp too. The third party application we have to support is FINALLY going to 2K5, so we're almost out of the wood. But I feel your pain 8^D\nThat said, from everything I heard from our DBA, the key is to convert the database to 8.0 format first, and then go to 2005. I believe they used...
[ 11, 6, 3, 3 ]
[]
[]
[ "migration", "sql_server" ]
stackoverflow_0000000194_migration_sql_server.txt
Q: Why doesn't SQL Full Text Indexing return results for words containing #? For instance, my query is like the following using SQL Server 2005: SELECT * FROM Table WHERE FREETEXT(SearchField, 'c#') I have a full text index defined to use the column SearchField which returns results when using: SELECT * FROM Table ...
Why doesn't SQL Full Text Indexing return results for words containing #?
For instance, my query is like the following using SQL Server 2005: SELECT * FROM Table WHERE FREETEXT(SearchField, 'c#') I have a full text index defined to use the column SearchField which returns results when using: SELECT * FROM Table WHERE SearchField LIKE '%c#%' I believe # is a special letter, so how do I all...
[ "The # char is indexed as punctuation and therefore ignored, so it looks like we'll remove the letter C from our word indexing ignore lists.\nTested it locally after doing that and rebuilding the indexes and I get results!\nLooking at using a different word breaker language on the indexed column, so that those spec...
[ 14, 1 ]
[]
[]
[ "full_text_search", "indexing", "sql", "sql_server", "sql_server_2005" ]
stackoverflow_0000001042_full_text_search_indexing_sql_sql_server_sql_server_2005.txt
Q: Displaying Flash content in a C# WinForms application What is the best way to display Flash content in a C# WinForms application? I would like to create a user control (similar to the current PictureBox) that will be able to display images and flash content. It would be great to be able to load the flash content f...
Displaying Flash content in a C# WinForms application
What is the best way to display Flash content in a C# WinForms application? I would like to create a user control (similar to the current PictureBox) that will be able to display images and flash content. It would be great to be able to load the flash content from a stream of sorts rather than a file on disk.
[ "While I haven't used a flash object inside a windows form application myself, I do know that it's possible.\nIn Visual studio on your toolbox, choose to add a new component.\nThen in the new window that appears choose the \"COM Components\" tab to get a list in which you can find the \"Shockwave Flash Object\"\nOn...
[ 33, 8 ]
[]
[]
[ "adobe", "c#", "flash", "macromedia", "winforms" ]
stackoverflow_0000001037_adobe_c#_flash_macromedia_winforms.txt
Q: ViewState invalid only in Safari One of the sites I maintain relies heavily on the use of ViewState (it isn't my code). However, on certain pages where the ViewState is extra-bloated, Safari throws a "Validation of viewstate MAC failed" error. This appears to only happen in Safari. Firefox, IE and Opera all load s...
ViewState invalid only in Safari
One of the sites I maintain relies heavily on the use of ViewState (it isn't my code). However, on certain pages where the ViewState is extra-bloated, Safari throws a "Validation of viewstate MAC failed" error. This appears to only happen in Safari. Firefox, IE and Opera all load successfully in the same scenario.
[ "While I second the Channel 9 solution, also be aware that in some hosted environments Safari is not considered an up-level browser. You may need to add it to your application's browscap in order to make use of some ASP.Net features. \nThat was the root cause of some headaches we had for a client's site that used t...
[ 5, 3, 2 ]
[]
[]
[ ".net", "c#", "safari", "viewstate" ]
stackoverflow_0000001189_.net_c#_safari_viewstate.txt
Q: Using MSTest with CruiseControl.NET We have been using CruiseControl for quite a while with NUnit and NAnt. For a recent project we decided to use the testing framework that comes with Visual Studio, which so far has been adequate. I'm attempting to get the solution running in CruiseControl. I've finally got the ...
Using MSTest with CruiseControl.NET
We have been using CruiseControl for quite a while with NUnit and NAnt. For a recent project we decided to use the testing framework that comes with Visual Studio, which so far has been adequate. I'm attempting to get the solution running in CruiseControl. I've finally got the build itself to work; however, I have bee...
[ "Not sure if that helps (i found the ccnet Documentation somewhat unhelpful at times):\nUsing CruiseControl.NET with MSTest\n", "The CC.Net interface is generated via an XSL transform on your XML files put together as specified in the ccnet.config file for your projects. The XSL is already written for things lik...
[ 5, 1 ]
[]
[]
[ "build_process", "cruisecontrol.net", "msbuild" ]
stackoverflow_0000001314_build_process_cruisecontrol.net_msbuild.txt
Q: How can I get the authenticated user name under Apache using plain HTTP authentication and PHP? First, let's get the security considerations out of the way. I'm using simple authentication under Apache for a one-off, internal use only, non-internet connected LAN, PHP web app. How can get I the HTTP authenticated u...
How can I get the authenticated user name under Apache using plain HTTP authentication and PHP?
First, let's get the security considerations out of the way. I'm using simple authentication under Apache for a one-off, internal use only, non-internet connected LAN, PHP web app. How can get I the HTTP authenticated user name in PHP?
[ "I think that you are after this\n$username = $_SERVER['PHP_AUTH_USER'];\n$password = $_SERVER['PHP_AUTH_PW'];\n\n" ]
[ 40 ]
[]
[]
[ "apache", "authentication", "http_authentication", "php" ]
stackoverflow_0000001417_apache_authentication_http_authentication_php.txt
Q: Integrating Visual Studio Test Project with Cruise Control I'm looking into using Visual Studio 2008's built in unit test projects instead of NUnit and I was wondering if anyone has any experience in trying to integrate this type of unit test project with Cruise Control.Net. A: From some of the initial research ...
Integrating Visual Studio Test Project with Cruise Control
I'm looking into using Visual Studio 2008's built in unit test projects instead of NUnit and I was wondering if anyone has any experience in trying to integrate this type of unit test project with Cruise Control.Net.
[ "From some of the initial research it doesn't appear to be a super simple solution. \nIt appears that doing this involves having Visual Studio 2008 actually installed on the continuous integration server, which could be a deal breaker.\nThen configure the MSTest.exe to run in the tasks list, but first you'll have t...
[ 10 ]
[]
[]
[ "continuous_integration", "cruisecontrol.net", "unit_testing", "visual_studio" ]
stackoverflow_0000001503_continuous_integration_cruisecontrol.net_unit_testing_visual_studio.txt
Q: Register Windows program with the mailto protocol programmatically How do I make it so mailto: links will be registered with my program? How would I then handle that event in my program? Most of the solutions I found from a quick Google search are how to do this manually, but I need to do this automatically for us...
Register Windows program with the mailto protocol programmatically
How do I make it so mailto: links will be registered with my program? How would I then handle that event in my program? Most of the solutions I found from a quick Google search are how to do this manually, but I need to do this automatically for users of my program if they click a button, such as "set as default email ...
[ "@Dillie-O: Your answer put me in the right direction (I should have expected it to just be a registry change) and I got this working. But I'm going to mark this as the answer because I'm going to put some additional information that I found while working on this.\nThe solution to this question really doesn't depen...
[ 19, 13 ]
[]
[]
[ "mailto", "windows" ]
stackoverflow_0000000231_mailto_windows.txt
Q: How do I make a menu that does not require the user to press [enter] to make a selection? I've got a menu in Python. That part was easy. I'm using raw_input() to get the selection from the user. The problem is that raw_input (and input) require the user to press Enter after they make a selection. Is there any way...
How do I make a menu that does not require the user to press [enter] to make a selection?
I've got a menu in Python. That part was easy. I'm using raw_input() to get the selection from the user. The problem is that raw_input (and input) require the user to press Enter after they make a selection. Is there any way to make the program act immediately upon a keystroke? Here's what I've got so far: import sys ...
[ "On Windows:\nimport msvcrt\nanswer=msvcrt.getch()\n\n", "On Linux:\n\nset raw mode\nselect and read the keystroke\nrestore normal settings\n\n\nimport sys\nimport select\nimport termios\nimport tty\n\ndef getkey():\n old_settings = termios.tcgetattr(sys.stdin)\n tty.setraw(sys.stdin.fileno())\n select.s...
[ 10, 9, 4, 0 ]
[]
[]
[ "python" ]
stackoverflow_0000001829_python.txt
Q: Can a Windows dll retrieve its own filename? A Windows process created from an exe file has access to the command string which invoked it, including its file's path and filename. eg. C:\MyApp\MyApp.exe --help. But this is not so for a dll invoked via LoadLibrary. Does anyone know of a way for a function loaded via...
Can a Windows dll retrieve its own filename?
A Windows process created from an exe file has access to the command string which invoked it, including its file's path and filename. eg. C:\MyApp\MyApp.exe --help. But this is not so for a dll invoked via LoadLibrary. Does anyone know of a way for a function loaded via dll to find out what its path and filename is? Sp...
[ "I think you're looking for GetModuleFileName.\nhttp://www.swissdelphicenter.ch/torry/showcode.php?id=143:\n{\n If you are working on a DLL and are interested in the filename of the\n DLL rather than the filename of the application, then you can use this function:\n}\n\nfunction GetModuleName: string;\nvar\n szF...
[ 39 ]
[]
[]
[ "delphi", "dll", "winapi", "windows" ]
stackoverflow_0000002043_delphi_dll_winapi_windows.txt
Q: How to get the value of built, encoded ViewState? I need to grab the base64-encoded representation of the ViewState. Obviously, this would not be available until fairly late in the request lifecycle, which is OK. For example, if the output of the page includes: <input type="hidden" name="__VIEWSTATE" id="__VIEW...
How to get the value of built, encoded ViewState?
I need to grab the base64-encoded representation of the ViewState. Obviously, this would not be available until fairly late in the request lifecycle, which is OK. For example, if the output of the page includes: <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJODU0Njc5MD...==" /> I need a way...
[ "Rex, I suspect a good place to start looking is solutions that compress the ViewState -- they're grabbing ViewState on the server before it's sent down to the client and gzipping it. That's exactly where you want to be.\n\nScott Hanselman on ViewState Compression (2005)\nViewState Compression with System.IO.Compre...
[ 13, 4, 2 ]
[]
[]
[ "asp.net", "c#", "viewstate" ]
stackoverflow_0000001010_asp.net_c#_viewstate.txt
Q: How can I change the background of a masterpage from the code behind of a content page? I specifically want to add the style of background-color to the <body> tag of a master page, from the code behind (C#) of a content page that uses that master page. I have different content pages that need to make the master ...
How can I change the background of a masterpage from the code behind of a content page?
I specifically want to add the style of background-color to the <body> tag of a master page, from the code behind (C#) of a content page that uses that master page. I have different content pages that need to make the master page has different colors depending on which content page is loaded, so that the master page ...
[ "What I would do for the particular case is:\ni. Define the body as a server side control\n<body runat=\"server\" id=\"masterpageBody\">\n\nii. In your content aspx page, register the MasterPage with the register:\n<% MasterPageFile=\"...\" %>\n\niii. In the Content Page, you can now simply use \nMaster.FindControl...
[ 10, 1, 0 ]
[]
[]
[ ".net", "asp.net", "c#", "master_pages" ]
stackoverflow_0000002209_.net_asp.net_c#_master_pages.txt
Q: Add Custom Tag to Visual Studio Validation How can I add rules to Visual Studio (2005 and up) for validating property markup (HTML) for a vendor's proprietary controls? My client uses a control which requires several properties to be set as tags in the aspx file which generates something like 215 validation errors...
Add Custom Tag to Visual Studio Validation
How can I add rules to Visual Studio (2005 and up) for validating property markup (HTML) for a vendor's proprietary controls? My client uses a control which requires several properties to be set as tags in the aspx file which generates something like 215 validation errors on each build. It's not preventing me from buil...
[ "Right-click on the Source view of an HTML / ASP page and select \"Formatting and Validation\".\n\nClick \"Tag Specific Options\".\nExpand \"Client HTML Tags\" and select the heading.\nClick \"New Tag...\".\nAnd just fill it in!\n\nI wish that I could add custom CSS values as well.\n" ]
[ 5 ]
[]
[]
[ "visual_studio" ]
stackoverflow_0000002279_visual_studio.txt
Q: How do I turn on line numbers by default in TextWrangler on the Mac? I am fed up having to turn them on every time I open the application. A: Go to TextWrangler > Preferences. Choose Text Status Display in the category pane, then check the option "Show line numbers" and close the preferences. This should now be...
How do I turn on line numbers by default in TextWrangler on the Mac?
I am fed up having to turn them on every time I open the application.
[ "Go to TextWrangler > Preferences.\nChoose Text Status Display in the category pane, then check the option \"Show line numbers\" and close the preferences. This should now be on by default when you open existing documents.\n" ]
[ 28 ]
[]
[]
[ "macos", "textwrangler" ]
stackoverflow_0000002332_macos_textwrangler.txt
Q: How to filter and combine 2 datasets in C# I am building a web page to show a customer what software they purchased and to give them a link to download said software. Unfortunately, the data on what was purchased and the download information are in separate databases so I can't just take care of it with joins in ...
How to filter and combine 2 datasets in C#
I am building a web page to show a customer what software they purchased and to give them a link to download said software. Unfortunately, the data on what was purchased and the download information are in separate databases so I can't just take care of it with joins in an SQL query. The common item is SKU. I'll be pu...
[ "As long as the two databases are on the same physical server (assuming MSSQL) and the username/password being used in the connection string has rights to both DBs, then you should be able to perform a join across the two databases. Example: \nselect p.Date,\n p.Amount,\n d.SoftwareName,\n d.Downl...
[ 3, 2, 0 ]
[]
[]
[ ".net", "c#" ]
stackoverflow_0000002267_.net_c#.txt
Q: Binary file layout reference Where are some good sources of information on binary file layout structures? If I wanted to pull in a BTrieve index file, parse MP3 headers, etc. Where does one get reliable information? A: I'm not sure if there's a general information source for this kind of information. I always j...
Binary file layout reference
Where are some good sources of information on binary file layout structures? If I wanted to pull in a BTrieve index file, parse MP3 headers, etc. Where does one get reliable information?
[ "I'm not sure if there's a general information source for this kind of information. I always just search on google or wikipedia for that particular file type. The binary file layout structure information should be included.\nFor example, http://en.wikipedia.org/wiki/MP3#File_structure\">MP3 file layout structure\...
[ 1 ]
[]
[]
[ "binary", "data_structures", "file", "language_agnostic" ]
stackoverflow_0000002405_binary_data_structures_file_language_agnostic.txt
Q: How to map a latitude/longitude to a distorted map? I have a bunch of latitude/longitude pairs that map to known x/y coordinates on a (geographically distorted) map. Then I have one more latitude/longitude pair. I want to plot it on the map as best is possible. How do I go about doing this? At first I decided to c...
How to map a latitude/longitude to a distorted map?
I have a bunch of latitude/longitude pairs that map to known x/y coordinates on a (geographically distorted) map. Then I have one more latitude/longitude pair. I want to plot it on the map as best is possible. How do I go about doing this? At first I decided to create a system of linear equations for the three nearest ...
[ "Are there any more specific details on the kind of distortion? If, for example, your latitudes and longitudes are \"distorted\" onto your 2D map using a Mercator projection, the conversion math is readily available.\nIf the map is distorted truly arbitrarily, there are lots of things you could try, but the simple...
[ 8, 2, 0, 0 ]
[]
[]
[ "latitude_longitude", "mapping", "maps", "math" ]
stackoverflow_0000001908_latitude_longitude_mapping_maps_math.txt
Q: File size differences after copying a file to a server vía FTP I have created a PHP-script to update a web server that is live inside a local directory. I'm migrating the script into Python. It works fine for the most part, but after a PUT command, the size of the file appears to change. Thus, the size of the file...
File size differences after copying a file to a server vía FTP
I have created a PHP-script to update a web server that is live inside a local directory. I'm migrating the script into Python. It works fine for the most part, but after a PUT command, the size of the file appears to change. Thus, the size of the file is different from that of the file on the server. Once I download ...
[ "Do you need to open the locfile in binary using rb?\nf = open (locfile, \"rb\")\n\n", "Well if you go under the properties of your file in Windows or a *nix environment, you will notice two sizes. One is the sector size, and one is the actual size. The sector size is the number of sectors in bytes that are use...
[ 17, 3, 0 ]
[]
[]
[ "ftp", "ftplib", "php", "python", "webserver" ]
stackoverflow_0000002311_ftp_ftplib_php_python_webserver.txt
Q: Decoding T-SQL CAST in C#/VB.NET Recently our site has been deluged with the resurgence of the Asprox botnet SQL injection attack. Without going into details, the attack attempts to execute SQL code by encoding the T-SQL commands in an ASCII encoded BINARY string. It looks something like this: DECLARE%20@S%20NVARC...
Decoding T-SQL CAST in C#/VB.NET
Recently our site has been deluged with the resurgence of the Asprox botnet SQL injection attack. Without going into details, the attack attempts to execute SQL code by encoding the T-SQL commands in an ASCII encoded BINARY string. It looks something like this: DECLARE%20@S%20NVARCHAR(4000);SET%20@S=CAST(0x44004500...0...
[ "I went back to Michael's post, did some more poking and realized that I did need to do a double conversion, and eventually worked out this little nugget:\nConvert.ToString(Convert.ToChar(Int32.Parse(EncodedString.Substring(intParseIndex, 2), System.Globalization.NumberStyles.HexNumber)));\n\nFrom there I simply ma...
[ 24, 8 ]
[]
[]
[ "ascii", "c#", "hex", "sql", "vb.net" ]
stackoverflow_0000000109_ascii_c#_hex_sql_vb.net.txt
Q: What sites offer free, quality web site design templates? Let's aggregate a list of free quality web site design templates. There are a million of these sites out there, but most are repetitive and boring. I'll start with freeCSStemplates.org I also think other sites should follow some sort of standards, for exam...
What sites offer free, quality web site design templates?
Let's aggregate a list of free quality web site design templates. There are a million of these sites out there, but most are repetitive and boring. I'll start with freeCSStemplates.org I also think other sites should follow some sort of standards, for example here are freeCSStemplates standards Released for FREE unde...
[ "Check out:\n\nOpen Source Web Designs\nCSS Remix\nBest Web Gallery\nCSS Based\nCSS Beauty\nCSS Genius\n\n", "The Open Design Community is a great resource.\n", "http://www.csszengarden.com/\nThe images are not Creative Commons, but the CSS is.\n", "+1 for Zen garden.\nI like the resources at inobscuro.com\n"...
[ 12, 3, 2, 0, 0 ]
[]
[]
[ "css", "templates" ]
stackoverflow_0000002711_css_templates.txt
Q: Is there a keyboard shortcut to view all open documents in Visual Studio 2008 I am trying to learn the keyboard shortcuts in Visual Studio in order to be more productive. So I downloaded a document showing many of the default keybindings in Visual Basic when using the VS 2008 IDE from Microsoft. When I tried what...
Is there a keyboard shortcut to view all open documents in Visual Studio 2008
I am trying to learn the keyboard shortcuts in Visual Studio in order to be more productive. So I downloaded a document showing many of the default keybindings in Visual Basic when using the VS 2008 IDE from Microsoft. When I tried what they say is the keyboard shortcut to view all open documents (CTRL + ALT + DOWN AR...
[ "This is a conflict between your graphics driver and Visual Studio. Go to your driver settings page (Control panel) and disable the display rotation shortcuts. With this conflict removed, the shortcut will work in Visual Studio.\n" ]
[ 15 ]
[]
[]
[ "keyboard", "shortcut", "visual_studio" ]
stackoverflow_0000002765_keyboard_shortcut_visual_studio.txt
Q: Can't get a Console to VMs I've followed this otherwise excellent tutorial on getting Xen working with Ubuntu but am not able to get a console into my virtual machine (domU). I've got the extra = '2 console=xvc0' line in my /etc/xen/hostname_here.cfg file like they say, but am not able to get a console on it. If I...
Can't get a Console to VMs
I've followed this otherwise excellent tutorial on getting Xen working with Ubuntu but am not able to get a console into my virtual machine (domU). I've got the extra = '2 console=xvc0' line in my /etc/xen/hostname_here.cfg file like they say, but am not able to get a console on it. If I statically assign an IP to the ...
[ "I had followed a different tutorial on setting up my xen on ubuntu before 8.04 but now upgraded to 8.04. I used the extra line in my cfg as folows:\nextra = ' TERM=xterm xencons=tty console=tty1'\n\nIt allows me to \"xm console hostname\" from dom0. I think this was from a problem with the xen setup in the version...
[ 5 ]
[]
[]
[ "ubuntu", "virtualization", "xen" ]
stackoverflow_0000002773_ubuntu_virtualization_xen.txt
Q: How to curl or wget a web page? I would like to make a nightly cron job that fetches my stackoverflow page and diffs it from the previous day's page, so I can see a change summary of my questions, answers, ranking, etc. Unfortunately, I couldn't get the right set of cookies, etc, to make this work. Any ideas? Als...
How to curl or wget a web page?
I would like to make a nightly cron job that fetches my stackoverflow page and diffs it from the previous day's page, so I can see a change summary of my questions, answers, ranking, etc. Unfortunately, I couldn't get the right set of cookies, etc, to make this work. Any ideas? Also, when the beta is finished, will my...
[ "Your status page is available now without logging in (click logout and try it). When the beta-cookie is disabled, there will be nothing between you and your status page.\nFor wget:\nwget --no-cookies --header \"Cookie: soba=(LookItUpYourself)\" https://stackoverflow.com/users/30/myProfile.html\n\n", "From Mark H...
[ 9, 6, 3, 2, 2 ]
[]
[]
[ "curl", "http" ]
stackoverflow_0000002815_curl_http.txt
Q: Using ASP.NET Dynamic Data / LINQ to SQL, how do you have two table fields have a relationship to the same foreign key? I am using ASP.NET Dynamic Data for a project and I have a table that has two seperate fields that link to the same foreign key in a different table. This relationship works fine in SQL Server. H...
Using ASP.NET Dynamic Data / LINQ to SQL, how do you have two table fields have a relationship to the same foreign key?
I am using ASP.NET Dynamic Data for a project and I have a table that has two seperate fields that link to the same foreign key in a different table. This relationship works fine in SQL Server. However, in the LINQ to SQL model in the ASP.NET Dynamic Data model, only the first field's relationship is reflected. If I a...
[ "The solution is to delete and re-add BOTH tables to the LINQ to SQL diagram, not just the one you have added the second field and keys to.\nAlternatively, it appears you can make two associations using the LINQ to SQL interface - just don't try and bundle them into a single association.\n" ]
[ 5 ]
[]
[]
[ "asp.net", "dynamic_data" ]
stackoverflow_0000003004_asp.net_dynamic_data.txt
Q: How can you tell when a user last pressed a key (or moved the mouse)? In a Win32 environment, you can use the GetLastInputInfo API call in Microsoft documentation. Basically, this method returns the last tick that corresponds with when the user last provided input, and you have to compare that to the current tick...
How can you tell when a user last pressed a key (or moved the mouse)?
In a Win32 environment, you can use the GetLastInputInfo API call in Microsoft documentation. Basically, this method returns the last tick that corresponds with when the user last provided input, and you have to compare that to the current tick to determine how long ago that was. Xavi23cr has a good example for C# at ...
[ "As for Linux, I know that Pidgin has to determine idle time to change your status to away after a certain amount of time. You might open the source and see if you can find the code that does what you need it to do.\n", "You seem to have answered your own question there Nathan ;-)\n\"GetLastInputInfo\" is the way...
[ 3, 1 ]
[]
[]
[ "language_agnostic" ]
stackoverflow_0000002709_language_agnostic.txt
Q: How should I translate from screen space coordinates to image space coordinates in a WinForms PictureBox? I have an application that displays an image inside of a Windows Forms PictureBox control. The SizeMode of the control is set to Zoom so that the image contained in the PictureBox will be displayed in an aspe...
How should I translate from screen space coordinates to image space coordinates in a WinForms PictureBox?
I have an application that displays an image inside of a Windows Forms PictureBox control. The SizeMode of the control is set to Zoom so that the image contained in the PictureBox will be displayed in an aspect-correct way regardless of the dimensions of the PictureBox. This is great for the visual appearance of the a...
[ "I wound up just implementing the translation manually. The code's not too bad, but it did leave me wishing that they provided support for it directly. I could see such a method being useful in a lot of different circumstances.\nI guess that's why they added extension methods :)\nIn pseudocode:\n// Recompute the ...
[ 6, 2 ]
[]
[]
[ "c#", "picturebox", "winforms" ]
stackoverflow_0000002804_c#_picturebox_winforms.txt
Q: 'Best' Diff Algorithm I need to implement a Diff algorithm in VB.NET to find the changes between two different versions of a piece of text. I've had a scout around the web and have found a couple of different algorithms. Does anybody here know of a 'best' algorithm that I could implement? A: Well I've used the ...
'Best' Diff Algorithm
I need to implement a Diff algorithm in VB.NET to find the changes between two different versions of a piece of text. I've had a scout around the web and have found a couple of different algorithms. Does anybody here know of a 'best' algorithm that I could implement?
[ "Well I've used the c# version on codeproject and its really good for what I wanted...\nhttp://www.codeproject.com/KB/recipes/diffengine.aspx\nYou can probably get this translated into VB.net via an online converter if you can't do it yourself...\n", "I like An O(ND) Difference Algorithm and Its Variations by Eug...
[ 7, 7, 3 ]
[]
[]
[ "diff", "vb.net" ]
stackoverflow_0000003144_diff_vb.net.txt
Q: Is there an Unobtrusive Captcha for web forms? What is the best unobtrusive CAPTCHA for web forms? One that does not involve a UI, rather a non-UI Turing test. I have seen a simple example of a non UI CAPTCHA like the Nobot control from Microsoft. I am looking for a CAPTCHA that does not ask the user any question...
Is there an Unobtrusive Captcha for web forms?
What is the best unobtrusive CAPTCHA for web forms? One that does not involve a UI, rather a non-UI Turing test. I have seen a simple example of a non UI CAPTCHA like the Nobot control from Microsoft. I am looking for a CAPTCHA that does not ask the user any question in any form. No riddles, no what's in this image.
[ "I think you might be alluding to an \"invisible\" captcha. Check out the Subkismet project for an invisible captcha implementation.\nhttp://www.codeplex.com/subkismet\n", "Try akismet from wp guys \n", "I think asking the user simple questions like:\n\"How many legs does a dog have?\"\nWould be much more effec...
[ 4, 4, 2, 1, 1 ]
[]
[]
[ "captcha", "security", "usability" ]
stackoverflow_0000003027_captcha_security_usability.txt
Q: How can I modify .xfdl files? (Update #1) The .XFDL file extension identifies XFDL Formatted Document files. These belong to the XML-based document and template formatting standard. This format is exactly like the XML file format however, contains a level of encryption for use in secure communications. I know how ...
How can I modify .xfdl files? (Update #1)
The .XFDL file extension identifies XFDL Formatted Document files. These belong to the XML-based document and template formatting standard. This format is exactly like the XML file format however, contains a level of encryption for use in secure communications. I know how to view XFDL files using a file viewer I found ...
[ "If the encoding is base64 then this is the solution I've stumbled upon on the web:\n\"Decoding XDFL files saved with 'encoding=base64'.\nFiles saved with: \napplication/vnd.xfdl;content-encoding=\"base64-gzip\"\n\nare simple base64-encoded gzip files. They can be easily restored to XML by first decoding and then u...
[ 5, 2, 1 ]
[]
[]
[ "language_agnostic", "ruby", "xfdl" ]
stackoverflow_0000001615_language_agnostic_ruby_xfdl.txt
Q: SQL query for a database scheme In SQL Server how do you query a database to bring back all the tables that have a field of a specific name? A: The following query will bring back a unique list of tables where Column_Name is equal to the column you are looking for: SELECT Table_Name FROM INFORMATION_SCHEMA.COLUM...
SQL query for a database scheme
In SQL Server how do you query a database to bring back all the tables that have a field of a specific name?
[ "The following query will bring back a unique list of tables where Column_Name is equal to the column you are looking for:\nSELECT Table_Name\nFROM INFORMATION_SCHEMA.COLUMNS\nWHERE Column_Name = 'Desired_Column_Name'\nGROUP BY Table_Name\n\n", "SELECT Table_Name\nFROM Information_Schema.Columns\nWHERE Column_Nam...
[ 7, 0, 0 ]
[]
[]
[ "sql", "sql_server" ]
stackoverflow_0000003567_sql_sql_server.txt
Q: Looking for code to render a form that displays a view of an object I've got the task of displaying a web form to represent the properties in a .NET class. In WinForms, there's a pre-fab control named PropertyGrid that is a lot like what I need. I'm just looking for something to display a simple layout of proper...
Looking for code to render a form that displays a view of an object
I've got the task of displaying a web form to represent the properties in a .NET class. In WinForms, there's a pre-fab control named PropertyGrid that is a lot like what I need. I'm just looking for something to display a simple layout of property names next to an appropriate control like a textbox for strings or a d...
[ "ASP.Net PropertyGrid\n" ]
[ 8 ]
[]
[]
[ "asp.net", "controls", "propertygrid" ]
stackoverflow_0000003757_asp.net_controls_propertygrid.txt
Q: Setup Visual Studio 2005 to print line numbers How can I get line numbers to print in Visual Studio 2005 when printing code listings? A: Isn't there an option in the Print Dialog? Edit: There is. Go to File => Print, and then in the bottom left there is "Print what" and then "Include line Numbers" A: There is ...
Setup Visual Studio 2005 to print line numbers
How can I get line numbers to print in Visual Studio 2005 when printing code listings?
[ "Isn't there an option in the Print Dialog?\nEdit: There is. Go to File => Print, and then in the bottom left there is \"Print what\" and then \"Include line Numbers\"\n", "There is an option in the Print Dialog to do the same (in VS 2005 and 2008 atleast)!\n" ]
[ 7, 5 ]
[]
[]
[ "line_numbers", "visual_studio", "visual_studio_2005" ]
stackoverflow_0000003809_line_numbers_visual_studio_visual_studio_2005.txt
Q: More vs. Faster Cores on a Webserver The discussion of Dual vs. Quadcore is as old as the Quadcores itself and the answer is usually "it depends on your scenario". So here the scenario is a Web Server (Windows 2003 (not sure if x32 or x64), 4 GB RAM, IIS, ASP.net 3.0). My impression is that the CPU in a Webserver ...
More vs. Faster Cores on a Webserver
The discussion of Dual vs. Quadcore is as old as the Quadcores itself and the answer is usually "it depends on your scenario". So here the scenario is a Web Server (Windows 2003 (not sure if x32 or x64), 4 GB RAM, IIS, ASP.net 3.0). My impression is that the CPU in a Webserver does not need to be THAT fast because requ...
[ "For something like a webserver, dividing up the tasks of handling each connection is (relatively) easy. I say it's safe to say that web servers is one of the most common (and ironed out) uses of parallel code. And since you are able to split up much of the processing into multiple discrete threads, more cores ac...
[ 16, 3, 3, 1 ]
[]
[]
[ "asp.net", "hardware", "iis", "windows" ]
stackoverflow_0000003801_asp.net_hardware_iis_windows.txt
Q: How do I best detect an ASP.NET expired session? I need to detect when a session has expired in my Visuial Basic web application. This is what I'm using... Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If CurrentSession.IsNew AndAlso (Not Page.Request.Headers("C...
How do I best detect an ASP.NET expired session?
I need to detect when a session has expired in my Visuial Basic web application. This is what I'm using... Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If CurrentSession.IsNew AndAlso (Not Page.Request.Headers("Cookie") Is Nothing) AndAlso (Page.Request.Headers("Coo...
[ "Try the following\nIf Session(\"whatever\") IsNot Nothing Then\n\n" ]
[ 10 ]
[]
[]
[ "asp.net", "http", "session" ]
stackoverflow_0000003831_asp.net_http_session.txt
Q: How do you typeset code elements in normal text? What is the best way to typeset a function with arguments for readibility, brevity, and accuracy? I tend to put empty parentheses after the function name like func(), even if there are actually arguments for the function. I have trouble including the arguments and ...
How do you typeset code elements in normal text?
What is the best way to typeset a function with arguments for readibility, brevity, and accuracy? I tend to put empty parentheses after the function name like func(), even if there are actually arguments for the function. I have trouble including the arguments and still feeling like the paragraph is readable. Any thou...
[ "I usually take that approach, but if I feel like it's going to cause confusion, I'll use ellipses like: myFunction(...)\nI guess if I were good, I would use those any time I was omitting parameters from a function in text.\n", "I would simply be a little more careful with the name of my variables and parameters,...
[ 3, 1 ]
[]
[]
[ "format", "language_agnostic" ]
stackoverflow_0000003802_format_language_agnostic.txt
Q: Adobe Flex component events I wrote a component that displays a filename, a thumbnail and has a button to load/play the file. The component is databound to a repeater. How can I make it so that the button event fires to the main application and tells it which file to play? A: Figured it out (finally) Custom Comp...
Adobe Flex component events
I wrote a component that displays a filename, a thumbnail and has a button to load/play the file. The component is databound to a repeater. How can I make it so that the button event fires to the main application and tells it which file to play?
[ "Figured it out (finally)\nCustom Component\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<mx:Canvas xmlns:mx=\"http://www.adobe.com/2006/mxml\" x=\"0\" y=\"0\" width=\"215\" height=\"102\" styleName=\"leftListItemPanel\" backgroundColor=\"#ECECEC\" horizontalScrollPolicy=\"off\" verticalScrollPolicy=\"off\">\n<mx:S...
[ 1, 1 ]
[]
[]
[ "actionscript_3", "apache_flex" ]
stackoverflow_0000003856_actionscript_3_apache_flex.txt
Q: Is this a good way to determine OS Architecture? Since the WMI class Win32_OperatingSystem only includes OSArchitecture in Windows Vista, I quickly wrote up a method using the registry to try and determine whether or not the current system is a 32 or 64bit system. private Boolean is64BitOperatingSystem() { Reg...
Is this a good way to determine OS Architecture?
Since the WMI class Win32_OperatingSystem only includes OSArchitecture in Windows Vista, I quickly wrote up a method using the registry to try and determine whether or not the current system is a 32 or 64bit system. private Boolean is64BitOperatingSystem() { RegistryKey localEnvironment = Registry.LocalMachine.Open...
[ "Take a look at Raymond Chens solution:\nHow to detect programmatically whether you are running on 64-bit Windows\nand here's the PINVOKE for .NET:\nIsWow64Process (kernel32)\nUpdate: I'd take issue with checking for 'x86'. Who's to say what intel's or AMD's next 32 bit processor may be designated as. The probabili...
[ 8, 2, 1, 1 ]
[]
[]
[ "c#", "registry", "windows" ]
stackoverflow_0000003903_c#_registry_windows.txt
Q: Multi-Paradigm Languages In a language such as (since I'm working in it now) PHP, which supports procedural and object-oriented paradigms. Is there a good rule of thumb for determining which paradigm best suits a new project? If not, how can you make the decision? A: It all depends on the problem you're trying t...
Multi-Paradigm Languages
In a language such as (since I'm working in it now) PHP, which supports procedural and object-oriented paradigms. Is there a good rule of thumb for determining which paradigm best suits a new project? If not, how can you make the decision?
[ "It all depends on the problem you're trying to solve. Obviously you can solve any problem in either style (procedural or OO), but you usually can figure out in the planning stages before you start writing code which style suits you better.\nSome people like to write up use cases and if they see a lot of the same n...
[ 11, 2 ]
[]
[]
[ "oop", "paradigms", "php", "procedural" ]
stackoverflow_0000003978_oop_paradigms_php_procedural.txt
Q: How do I configure a Vista Ultimate (64bit) account so it can access a SMB share on OSX? I have Windows File sharing enabled on an OS X 10.4 computer. It's accessible via \rudy\myshare for all the Windows users on the network, except for one guy running Vista Ultimate 64-bit edition. All the other users are runni...
How do I configure a Vista Ultimate (64bit) account so it can access a SMB share on OSX?
I have Windows File sharing enabled on an OS X 10.4 computer. It's accessible via \rudy\myshare for all the Windows users on the network, except for one guy running Vista Ultimate 64-bit edition. All the other users are running Vista or XP, all 32-bit. All the workgroup information is the same, all login with the same...
[ "Try changing the local security policy on that Vista box for \"Local Policies\\Security Options\\Network Security: LAN manager authentication level\" from “Send NTLMv2 response only” to “Send LM & NTLM - use NTLMv2 session security if negotiated”.\n", "No I have successfully done this with my Vista 64-bit machin...
[ 3, 0 ]
[]
[]
[ "macos", "smb", "windows_vista" ]
stackoverflow_0000003996_macos_smb_windows_vista.txt
Q: Linking two Office documents Problem: I have two spreadsheets that each serve different purposes but contain one particular piece of data that needs to be the same in both spreadsheets. This piece of data (one of the columns) gets updated in spreadsheet A but needs to also be updated in spreadsheet B. Goal: A so...
Linking two Office documents
Problem: I have two spreadsheets that each serve different purposes but contain one particular piece of data that needs to be the same in both spreadsheets. This piece of data (one of the columns) gets updated in spreadsheet A but needs to also be updated in spreadsheet B. Goal: A solution that would somehow link the...
[ "So you mean that AD743 on spreadsheet B must be equal to AD743 on spreadsheet A? Try this:\n\nOpen both spreadsheets on the same\nmachine.\nGo to AD743 on spreadsheet B.\nType =.\nGo to spreadsheed A and click on\nAD743.\nPress enter.\n\nYou'll notice that the formula is something like '[path-to-file+file-name].w...
[ 5, 0 ]
[]
[]
[ "office_2003", "office_2007" ]
stackoverflow_0000003045_office_2003_office_2007.txt
Q: Why doesn't VFP .NET OLEdb provider work in 64 bit Windows? I wrote a windows service using VB that read some legacy data from Visual Foxpro Databases to be inserted in SQL 2005. The problem is this use to run fine in Windows server 2003 32-Bits, but the client recently moved to Windows 2003 64-Bits and now the se...
Why doesn't VFP .NET OLEdb provider work in 64 bit Windows?
I wrote a windows service using VB that read some legacy data from Visual Foxpro Databases to be inserted in SQL 2005. The problem is this use to run fine in Windows server 2003 32-Bits, but the client recently moved to Windows 2003 64-Bits and now the service won't work. I'm getting a message the the VFP .NET OLEdb pr...
[ "Have you tried changing the target CPU to x86 instead of \"Any CPU\" in the advanced compiler options? I know that this solves some problems with other OLEDB providers by forcing the use of the 32-bit version.\n", "You'll need to compile with the target CPU set to x86 to force your code to use the 32 bit version...
[ 15, 9, 1 ]
[]
[]
[ ".net", "legacy", "oledb", "sql_server_2005", "visual_foxpro" ]
stackoverflow_0000000717_.net_legacy_oledb_sql_server_2005_visual_foxpro.txt
Q: Searching directories for tons of files? I'm using MSVE, and I have my own tiles I'm displaying in layers on top. Problem is, there's a ton of them, and they're on a network server. In certain directories, there are something on the order of 30,000+ files. Initially I called Directory.GetFiles, but once I started ...
Searching directories for tons of files?
I'm using MSVE, and I have my own tiles I'm displaying in layers on top. Problem is, there's a ton of them, and they're on a network server. In certain directories, there are something on the order of 30,000+ files. Initially I called Directory.GetFiles, but once I started testing in a pseudo-real environment, it timed...
[ "I've worked on a SAN system in the past with telephony audio recordings which had issues with numbers of files in a single folder - that system became unusable somewhere near 5,000 (on Windows 2000 Advanced Server with an application in C#.Net 1.1)- the only sensible solution that we came up with was to change the...
[ 6, 2, 1, 1, 1 ]
[]
[]
[ "c#", "directory", "file_management" ]
stackoverflow_0000003512_c#_directory_file_management.txt
Q: Programmatically talking to a Serial Port in OS X or Linux I have a Prolite LED sign that I like to set up to show scrolling search queries from a apache logs and other fun statistics. The problem is, my G5 does not have a serial port, so I have to use a usb to serial dongle. It shows up as /dev/cu.usbserial and /...
Programmatically talking to a Serial Port in OS X or Linux
I have a Prolite LED sign that I like to set up to show scrolling search queries from a apache logs and other fun statistics. The problem is, my G5 does not have a serial port, so I have to use a usb to serial dongle. It shows up as /dev/cu.usbserial and /dev/tty.usbserial . When i do this everything seems to be hunky...
[ "/dev/cu.xxxxx is the \"callout\" device, it's what you use when you establish a connection to the serial device and start talking to it. /dev/tty.xxxxx is the \"dialin\" device, used for monitoring a port for incoming calls for e.g. a fax listener.\n", "have you tried watching the traffic between the GUI and the...
[ 5, 0 ]
[]
[]
[ "linux", "macos", "python", "serial_port" ]
stackoverflow_0000003976_linux_macos_python_serial_port.txt
Q: How can I tell if a web client is blocking advertisements? What is the best way to record statistics on the number of visitors visiting my site that have set their browser to block ads? A: Since programs like AdBlock actually never request the advert, you would have to look the server logs to see if the same use...
How can I tell if a web client is blocking advertisements?
What is the best way to record statistics on the number of visitors visiting my site that have set their browser to block ads?
[ "Since programs like AdBlock actually never request the advert, you would have to look the server logs to see if the same user accessed a webpage but didn't access an advert. This is assuming the advert is on the same server.\nIf your adverts are on a separate server, then I would suggest it's impossible to do so.\...
[ 11, 10, 4, 4, 3 ]
[]
[]
[ "analytics", "browser" ]
stackoverflow_0000002472_analytics_browser.txt
Q: ConfigurationManager.AppSettings Performance Concerns I plan to be storing all my config settings in my application's app.config section (using the ConfigurationManager.AppSettings class). As the user changes settings using the app's UI (clicking checkboxes, choosing radio buttons, etc.), I plan to be writing thos...
ConfigurationManager.AppSettings Performance Concerns
I plan to be storing all my config settings in my application's app.config section (using the ConfigurationManager.AppSettings class). As the user changes settings using the app's UI (clicking checkboxes, choosing radio buttons, etc.), I plan to be writing those changes out to the AppSettings. At the same time, while t...
[ "since you're using a winforms app, if it's in .net 2.0 there's actually a user settings system (called Properties) that is designed for this purpose. This article on MSDN has a pretty good introduction into this\nIf you're still worried about performance then take a look at SQL Compact Edition which is similar to ...
[ 10, 2, 2, 2, 1, 1, 0, 0 ]
[]
[]
[ ".net", "c#", "configuration", "performance", "properties" ]
stackoverflow_0000004157_.net_c#_configuration_performance_properties.txt
Q: What is the best way to handle multiple permission types? I often encounter the following scenario where I need to offer many different types of permissions. I primarily use ASP.NET / VB.NET with SQL Server 2000. Scenario I want to offer a dynamic permission system that can work on different parameters. Let's say ...
What is the best way to handle multiple permission types?
I often encounter the following scenario where I need to offer many different types of permissions. I primarily use ASP.NET / VB.NET with SQL Server 2000. Scenario I want to offer a dynamic permission system that can work on different parameters. Let's say that I want to give either a department or just a specific pers...
[ "I agree with John Downey.\nPersonally, I sometimes use a flagged enumeration of permissions. This way you can use AND, OR, NOT and XOR bitwise operations on the enumeration's items.\n\"[Flags]\npublic enum Permission\n{\n VIEWUSERS = 1, // 2^0 // 0000 0001\n EDITUSERS = 2, // 2^1 // 0000 0010\n VIEWPRODUC...
[ 14, 11, 2, 2, 0 ]
[]
[]
[ "permissions", "sql" ]
stackoverflow_0000001451_permissions_sql.txt
Q: Why should I practice Test Driven Development and how should I start? Lots of people talk about writing tests for their code before they start writing their code. This practice is generally known as Test Driven Development or TDD for short. What benefits do I gain from writing software this way? How do I get start...
Why should I practice Test Driven Development and how should I start?
Lots of people talk about writing tests for their code before they start writing their code. This practice is generally known as Test Driven Development or TDD for short. What benefits do I gain from writing software this way? How do I get started with this practice?
[ "There are a lot of benefits:\n\nYou get immediate feedback on if your code is working, so you can find bugs faster\nBy seeing the test go from red to green, you know that you have both a working regression test, and working code\nYou gain confidence to refactor existing code, which means you can clean up code with...
[ 37, 3, 2 ]
[ "In my opinion, the single greatest thing is that it clearly allows you to see if your code does what it is supposed to. This may seem obvious, but it is super easy to run astray of your original goals, as I have found out in the past :p\n" ]
[ -1 ]
[ "tdd", "testing" ]
stackoverflow_0000004303_tdd_testing.txt
Q: Where can I get the Windows Workflow "wca.exe" application? I am walking through the MS Press Windows Workflow Step-by-Step book and in chapter 8 it mentions a tool with the filename "wca.exe". This is supposed to be able to generate workflow communication helper classes based on an interface you provide it. I c...
Where can I get the Windows Workflow "wca.exe" application?
I am walking through the MS Press Windows Workflow Step-by-Step book and in chapter 8 it mentions a tool with the filename "wca.exe". This is supposed to be able to generate workflow communication helper classes based on an interface you provide it. I can't find that file. I thought it would be in the latest .NET 3....
[ "Should be part of the .NET 3 SDK (and later version as well). If you've already installed this, the path might look something like \nC:\\Program Files\\Microsoft SDKs\\Windows\\v6.0\\Bin\\wca.exe\nMore info on Guy Burstein's blog.\n", "On my machine, with Visual Studio 2008 installed, it's in \nC:\\Program Files...
[ 1, 1 ]
[]
[]
[ ".net_3.5" ]
stackoverflow_0000004416_.net_3.5.txt
Q: .htaccess directives to *not* redirect certain URLs In an application that heavily relies on .htaccess RewriteRules for its PrettyURLs (CakePHP in my case), how do I correctly set up directives to exclude certain directories from this rewriting? That is: /appRoot/.htaccess app/ static/ By defaul...
.htaccess directives to *not* redirect certain URLs
In an application that heavily relies on .htaccess RewriteRules for its PrettyURLs (CakePHP in my case), how do I correctly set up directives to exclude certain directories from this rewriting? That is: /appRoot/.htaccess app/ static/ By default every request to /appRoot/* is being rewritten to be pi...
[ "And the correct answer iiiiis...\nRewriteRule ^(a|bunch|of|old|directories).* - [NC,L]\n\n# all other requests will be forwarded to Cake\nRewriteRule ^$ app/webroot/ [L]\nRewriteRule (.*) app/webroot/$1 [L]\n\nI still don't get why the index.php file in the root directory was called initially even with t...
[ 6, 1, 1 ]
[]
[]
[ ".htaccess", "apache", "mod_rewrite" ]
stackoverflow_0000003157_.htaccess_apache_mod_rewrite.txt
Q: DataTable Loop Performance Comparison Which of the following has the best performance? I have seen method two implemented in JavaScript with huge performance gains, however, I was unable to measure any gain in C# and was wondering if the compiler already does method 2 even when written like method 1. The theory be...
DataTable Loop Performance Comparison
Which of the following has the best performance? I have seen method two implemented in JavaScript with huge performance gains, however, I was unable to measure any gain in C# and was wondering if the compiler already does method 2 even when written like method 1. The theory behind method 2 is that the code doesn't have...
[ "No, it can't do that since there is no way to express constant over time for a value.\nIf the compiler should be able to do that, there would have to be a guarantee from the code returning the value that the value is constant, and for the duration of the loop won't change.\nBut, in this case, you're free to add ne...
[ 6 ]
[]
[]
[ "c#", "loops", "performance" ]
stackoverflow_0000004556_c#_loops_performance.txt
Q: How can I create Prototype Methods (like JavaScript) in C#.Net? How is it possible to make prototype methods in C#.Net? In JavaScript, I can do the following to create a trim method for the string object: String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g,""); } How can I go about doing thi...
How can I create Prototype Methods (like JavaScript) in C#.Net?
How is it possible to make prototype methods in C#.Net? In JavaScript, I can do the following to create a trim method for the string object: String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g,""); } How can I go about doing this in C#.Net?
[ "You can't dynamically add methods to existing objects or classes in .NET, except by changing the source for that class.\nYou can, however, in C# 3.0, use extension methods, which look like new methods, but are compile-time magic.\nTo do this for your code:\npublic static class StringExtensions\n{\n public stati...
[ 22, 5, 0, 0 ]
[]
[]
[ ".net", "c#" ]
stackoverflow_0000004610_.net_c#.txt
Q: Verifying files for testing I was working with quality yesterday doing some formal testing. In their procedure they were verifying all files on the test machine were pulled from the release. The way they were verifying these files were the same was by checking the size and the date/time stamp windows put on them...
Verifying files for testing
I was working with quality yesterday doing some formal testing. In their procedure they were verifying all files on the test machine were pulled from the release. The way they were verifying these files were the same was by checking the size and the date/time stamp windows put on them in Windows Explorer. These happ...
[ "The only 100% way to figure out if two files are equal is to do a binary comparison of the two.\nIf you can live with the risk of false positives (ie. two files which aren't 100% identical but your code says they are), then the digest and checksum algorithms can be used to lessen the work, particularly if the file...
[ 3, 3, 1, 1, 0 ]
[]
[]
[ "testing", "windows" ]
stackoverflow_0000004665_testing_windows.txt
Q: How do you resolve a domain name to an IP address with .NET/C#? How do you resolve a domain name to an IP address with .NET/C#? A: using System.Net; foreach (IPAddress address in Dns.GetHostAddresses("www.google.com")) { Console.WriteLine(address.ToString()); } A: Try using the System.Net.Dns class
How do you resolve a domain name to an IP address with .NET/C#?
How do you resolve a domain name to an IP address with .NET/C#?
[ "using System.Net;\n\nforeach (IPAddress address in Dns.GetHostAddresses(\"www.google.com\"))\n{\n Console.WriteLine(address.ToString());\n}\n\n", "Try using the System.Net.Dns class\n" ]
[ 20, 1 ]
[]
[]
[ ".net", "c#", "dns", "reverse_dns" ]
stackoverflow_0000004816_.net_c#_dns_reverse_dns.txt
Q: How do I configure eclipse (zend studio 6) to hint and code complete several languages? My dream IDE does full code hints, explains and completes PHP, Javascript, HTML and CSS. I know it exists! so far, Zend studio 6, under the Eclipse IDE does a great job at hinting PHP, some Javascript and HTML, any way I can ex...
How do I configure eclipse (zend studio 6) to hint and code complete several languages?
My dream IDE does full code hints, explains and completes PHP, Javascript, HTML and CSS. I know it exists! so far, Zend studio 6, under the Eclipse IDE does a great job at hinting PHP, some Javascript and HTML, any way I can expand this? edit: a bit more information: right now, using zend-6 under eclipse, i type in <?p...
[ "I think the JavaScript and CSS need to be in separate files for this to work.\nExample of CSS autocomplete in Eclipse:\nStarting to type border\n\n\n\nThen setting thickness\n\n\n\nThen choosing the color\n\n\n\nChose red, and it added the ; for me\n\n\n\nWorks pretty good IMHO.\n", "The default CSS and HTML edi...
[ 2, 0 ]
[]
[]
[ "code_completion", "zend_studio" ]
stackoverflow_0000004839_code_completion_zend_studio.txt
Q: What does this error mean SECJ0222E in WebSphere Application Server 5.1 I found this on the IBM support site: ProblemA JAAS LoginContext could not be created due to the unexpected exception. User responseThe problem could be due to a configuration error. but I have no other indication and can't determine the f...
What does this error mean SECJ0222E in WebSphere Application Server 5.1
I found this on the IBM support site: ProblemA JAAS LoginContext could not be created due to the unexpected exception. User responseThe problem could be due to a configuration error. but I have no other indication and can't determine the final reason for this error. Any suggestions?
[ "Have you obtained the fix from\nhttp://www-1.ibm.com/support/docview.wss?rs=404&uid=swg1PK17150?\n" ]
[ 1 ]
[]
[]
[ "jaas", "websphere" ]
stackoverflow_0000004995_jaas_websphere.txt
Q: What point should someone decide to switch Database Systems When developing whether its Web or Desktop at which point should a developer switch from SQLite, MySQL, MS SQL, etc A: It depends on what you are doing. You might switch if: You need more scalability or better performance - say from SQLite to SQL Serve...
What point should someone decide to switch Database Systems
When developing whether its Web or Desktop at which point should a developer switch from SQLite, MySQL, MS SQL, etc
[ "It depends on what you are doing. You might switch if:\n\nYou need more scalability or better performance - say from SQLite to SQL Server or Oracle.\nYou need access to more specific datatypes.\nYou need to support a customer that only runs a particular database.\nYou need better DBA tools.\nYour application is us...
[ 4, 2, 0 ]
[]
[]
[ "database", "sql" ]
stackoverflow_0000004891_database_sql.txt
Q: Error ADMA5026E for WebSphere Application Server Network Deployment What I'm doing wrong that I get the ADMA5026E error when deployment an application with the NetworkDeployment Console? A: Try IBM Information Center
Error ADMA5026E for WebSphere Application Server Network Deployment
What I'm doing wrong that I get the ADMA5026E error when deployment an application with the NetworkDeployment Console?
[ "Try\nIBM Information Center\n" ]
[ 1 ]
[]
[]
[ "deployment", "websphere" ]
stackoverflow_0000005013_deployment_websphere.txt
Q: Upload form does not work in Firefox 3 with Mac OS X? Today, I ran into this weird problem with a user using Mac OS X. This user always had a failed upload. The form uses a regular "input type=file". The user could upload using any browser except Firefox 3 on his Mac. Only this particular user was seeing this erro...
Upload form does not work in Firefox 3 with Mac OS X?
Today, I ran into this weird problem with a user using Mac OS X. This user always had a failed upload. The form uses a regular "input type=file". The user could upload using any browser except Firefox 3 on his Mac. Only this particular user was seeing this error. Obviously, the problem is only with this one particular ...
[ "User corrected this weird problem by recreating their FireFox profile.\nHow to manage FireFox profiles\nI imagine a re-install of FireFox would have corrected the problem as well.\n", "\nI imagine a re-install of FireFox would have corrected the problem as well.\n\nProfile related problems cannot usually be solv...
[ 2, 0 ]
[]
[]
[ "firefox", "macos", "upload" ]
stackoverflow_0000005084_firefox_macos_upload.txt
Q: LINQ to SQL strings to enums LINQ to SQL allows table mappings to automatically convert back and forth to Enums by specifying the type for the column - this works for strings or integers. Is there a way to make the conversion case insensitive or add a custom mapping class or extenstion method into the mix so that ...
LINQ to SQL strings to enums
LINQ to SQL allows table mappings to automatically convert back and forth to Enums by specifying the type for the column - this works for strings or integers. Is there a way to make the conversion case insensitive or add a custom mapping class or extenstion method into the mix so that I can specify what the string shou...
[ "You can always add a partial class with the same name as your LinqToSql class, and then define your own parameters and functions. These will then be accessible as object parameters and methods for this object, the same way as the auto-generated LinqToSql methods are accessible.\nExample: You have a LinqToSql class...
[ 3 ]
[]
[]
[ "linq_to_sql" ]
stackoverflow_0000004939_linq_to_sql.txt
Q: Timer-based event triggers I am currently working on a project with specific requirements. A brief overview of these are as follows: Data is retrieved from external webservices Data is stored in SQL 2005 Data is manipulated via a web GUI The windows service that communicates with the web services has no coupli...
Timer-based event triggers
I am currently working on a project with specific requirements. A brief overview of these are as follows: Data is retrieved from external webservices Data is stored in SQL 2005 Data is manipulated via a web GUI The windows service that communicates with the web services has no coupling with our internal web UI, exc...
[ "Why not use a SQL Job instead of the Windows Service? You can encapsulate all of you db \"trigger\" code in Stored Procedures. Then your UI and SQL Job can call the same Stored Procedures and create the triggers the same way whether it's manually or at a time interval.\n", "The way I see it is this.\nYou have ...
[ 3, 0, 0 ]
[]
[]
[ "service", "sql", "timer", "triggers", "web_services" ]
stackoverflow_0000003272_service_sql_timer_triggers_web_services.txt
Q: How to set up a CSS switcher I'm working on a website that will switch to a new style on a set date. The site's built-in semantic HTML and CSS, so the change should just require a CSS reference change. I'm working with a designer who will need to be able to see how it's looking, as well as a client who will need t...
How to set up a CSS switcher
I'm working on a website that will switch to a new style on a set date. The site's built-in semantic HTML and CSS, so the change should just require a CSS reference change. I'm working with a designer who will need to be able to see how it's looking, as well as a client who will need to be able to review content update...
[ "In Asp.net 3.5, you should be able to set up the Link tag in the header as a server tag. Then in the codebehind you can set the href property for the link element, based on a cookie value, querystring, date, etc.\nIn your aspx file:\n<head>\n <link id=\"linkStyles\" rel=\"stylesheet\" type=\"text/css\" runat=\"se...
[ 22, 6, 2 ]
[ "I would do the following:\nwww.website.com/?stylesheet=new.css\nThen in your ASP.NET code:\nif (Request.Querystring[\"stylesheet\"] != null) {\n Response.Cookies[\"stylesheet\"].Value = Request.QueryString[\"stylesheet\"];\n Response.Redirect(<Current Page>);\n}\n\nThen where you define your stylesheets:\nif...
[ -2 ]
[ "asp.net", "css", "html", "javascript" ]
stackoverflow_0000005118_asp.net_css_html_javascript.txt
Q: Is this really widening vs autoboxing? I saw this in an answer to another question, in reference to shortcomings of the Java spec: There are more shortcomings and this is a subtle topic. Check this out: public class methodOverloading{ public static void hello(Integer x){ System.out.println("Integer...
Is this really widening vs autoboxing?
I saw this in an answer to another question, in reference to shortcomings of the Java spec: There are more shortcomings and this is a subtle topic. Check this out: public class methodOverloading{ public static void hello(Integer x){ System.out.println("Integer"); } public static void hello(lo...
[ "In the first case, you have a widening conversion happening. This can be see when runinng the \"javap\" utility program (included w/ the JDK), on the compiled class:\npublic static void main(java.lang.String[]);\n Code:\n 0: iconst_ 5\n 1: istore_ 1\n 2: iload_ 1\n 3: i2l\n 4: invokestatic ...
[ 16, 5, 3 ]
[]
[]
[ "autoboxing", "java", "primitive" ]
stackoverflow_0000004922_autoboxing_java_primitive.txt
Q: How do you pull the URL for an ASP.NET web reference from a configuration file in Visual Studio 2008? I have a web reference for our report server embedded in our application. The server that the reports live on could change though, and I'd like to be able to change it "on the fly" if necessary. I know I've done t...
How do you pull the URL for an ASP.NET web reference from a configuration file in Visual Studio 2008?
I have a web reference for our report server embedded in our application. The server that the reports live on could change though, and I'd like to be able to change it "on the fly" if necessary. I know I've done this before, but can't seem to remember how. Thanks for your help. I've manually driven around this for the ...
[ "In the properties window change the \"behavior\" to Dynamic.\nSee: http://www.codeproject.com/KB/XML/wsdldynamicurl.aspx\n", "If you mean a VS2005 \"Web Reference\", then the generated proxy classes have a URL property that is the SOAP endpoint url of that service. You can change this property and have your sub...
[ 3, 0 ]
[]
[]
[ "asmx" ]
stackoverflow_0000005188_asmx.txt
Q: How can I dynamically center an image in a MS Reporting Services report? Out of the box, in MS Reporting Services, the image element does not allow for the centering of the image itself, when the dimensions are unknown at design time. In other words, the image (if smaller than the dimensions allotted on the design...
How can I dynamically center an image in a MS Reporting Services report?
Out of the box, in MS Reporting Services, the image element does not allow for the centering of the image itself, when the dimensions are unknown at design time. In other words, the image (if smaller than the dimensions allotted on the design surface) will be anchored to the top left corner, not in the center. My repor...
[ "Here is how I was able to accomplish this. With help from Chris Hays\nSize the image to be as big as you would want it on the report, change \"Sizing\" property to \"Clip\".\nDynamically set the image's left padding using an expression:\n=CStr(Round((4.625-System.Drawing.Image.FromStream(System.Net.WebRequest.Crea...
[ 8 ]
[]
[]
[ "reporting_services" ]
stackoverflow_0000005264_reporting_services.txt
Q: HTML Comments Markup I am currently in the process of creating my own blog and I have got to marking up the comments, but what is the best way to mark it up? The information I need to present is: Persons Name Gravatar Icon Comment Date The Comment PS: I'm only interested in semantic HTML markup. A: I think tha...
HTML Comments Markup
I am currently in the process of creating my own blog and I have got to marking up the comments, but what is the best way to mark it up? The information I need to present is: Persons Name Gravatar Icon Comment Date The Comment PS: I'm only interested in semantic HTML markup.
[ "I think that your version with the cite, blockquote, etc. would definitely work, but if semantics is your main concern then I personally wouldn't use cite and blockquote as they have specific things that they are supposed to represent.\nThe blockquote tag is meant to represent a quotation taken from another source...
[ 7, 2, 2, 1, 1 ]
[]
[]
[ "html", "semantic_markup" ]
stackoverflow_0000005226_html_semantic_markup.txt
Q: SQL Server 2008 FileStream on a Web Server I've been developing a site using ASP.NET MVC, and have decided to use the new SQL Server 2008 FILESTREAM facility to store files 'within' the database rather than as separate entities. While initially working within VS2008 (using a trusted connection to the database), e...
SQL Server 2008 FileStream on a Web Server
I've been developing a site using ASP.NET MVC, and have decided to use the new SQL Server 2008 FILESTREAM facility to store files 'within' the database rather than as separate entities. While initially working within VS2008 (using a trusted connection to the database), everything was fine and dandy. Issues arose, ho...
[ "Take a look at this article. I don't know a whole lot about FileStreaming and security, but there are a couple of interesting options in the FileStreaming setup such as allowing remote connections and allow remote clients to access FileStreaming\n" ]
[ 2 ]
[]
[]
[ "iis", "sql_server", "sql_server_2008" ]
stackoverflow_0000005396_iis_sql_server_sql_server_2008.txt
Q: What is the best way to wrap time around the work day? I have a situation where I want to add hours to a date and have the new date wrap around the work-day. I cobbled up a function to determine this new date, but want to make sure that I'm not forgetting anything. The hours to be added is called "delay". It could...
What is the best way to wrap time around the work day?
I have a situation where I want to add hours to a date and have the new date wrap around the work-day. I cobbled up a function to determine this new date, but want to make sure that I'm not forgetting anything. The hours to be added is called "delay". It could easily be a parameter to the function instead. Please post ...
[ "Okay, how about these? The difference between the approaches should speak for themselves.\nAlso, this is tested about as far as I can throw it. The warranty lasts until... now.\nHope it helps!\nModule Module1\n\n Public Function IsInBusinessHours(ByVal d As Date) As Boolean\n Return Not (d.Hour < 8 OrEls...
[ 3, 2, 1 ]
[]
[]
[ "date", "vb.net" ]
stackoverflow_0000005260_date_vb.net.txt
Q: How do I create a Class using the Singleton Design Pattern in Ruby? The singleton pattern is a design pattern that is used to restrict instantiation of a class to one object instance. Although I know how to code the singleton pattern in C++ and Java, I was wondering if anyone know how to implement it in Ruby? A: ...
How do I create a Class using the Singleton Design Pattern in Ruby?
The singleton pattern is a design pattern that is used to restrict instantiation of a class to one object instance. Although I know how to code the singleton pattern in C++ and Java, I was wondering if anyone know how to implement it in Ruby?
[ "Actually, the above answer was not completely correct.\nrequire 'singleton'\n\nclass Example\n include Singleton\nend\n\nYou also need to include the require 'singleton' statement.\n", "Use the singleton module:\nclass Clazz\n include Singleton\nend\n\nSee http://www.ruby-doc.org/stdlib/libdoc/singleton/rdoc/i...
[ 10, 8, 0 ]
[]
[]
[ "design_patterns", "ruby", "singleton" ]
stackoverflow_0000004677_design_patterns_ruby_singleton.txt
Q: Debugging: IE6 + SSL + AJAX + post form = 404 error The Setting: The program in question tries to post form data via an AJAX call to a target procedure contained in the same package as the caller. This is done for a site that uses a secure connection (HTTPS). The technology used here is PLSQL and the DOJO JavaScri...
Debugging: IE6 + SSL + AJAX + post form = 404 error
The Setting: The program in question tries to post form data via an AJAX call to a target procedure contained in the same package as the caller. This is done for a site that uses a secure connection (HTTPS). The technology used here is PLSQL and the DOJO JavaScript library. The development tool is basically a text edit...
[ "First port of call would be to fire up Fiddler and analyze the data going to and from the browser.\nTake a look at the headers, the url actually being called and the params (if any) being passed to the AJAX method and see if it all looks good before getting to the server.\nIf that all looks ok, is there any way yo...
[ 4 ]
[]
[]
[ "ajax", "debugging", "internet_explorer", "internet_explorer_6", "ssl" ]
stackoverflow_0000005619_ajax_debugging_internet_explorer_internet_explorer_6_ssl.txt
Q: HTML comments break down I have a page that is generated which inserts an HTML comment near the top of the page. Inside the comment is a *nix-style command. <!-- command --option value --option2 value2 --option3 --> This comment breaks the page completely. What is wrong with the comment to cause this to happen,...
HTML comments break down
I have a page that is generated which inserts an HTML comment near the top of the page. Inside the comment is a *nix-style command. <!-- command --option value --option2 value2 --option3 --> This comment breaks the page completely. What is wrong with the comment to cause this to happen, and why is this the case?
[ "Comments in the XML Spec from the w3.org :\n\nFor compatibility, the string \"--\"\n (double-hyphen) MUST NOT occur within\n comments.\n\n", "If you really want to keep the comment in your page you could use this instead of an HTML comment:\n<div style=\"display:none\">command --option value --option2 value2 -...
[ 27, 2, 1 ]
[]
[]
[ "comments", "html", "sgml", "xml" ]
stackoverflow_0000005425_comments_html_sgml_xml.txt
Q: Tracking state using ASP.NET AJAX / ICallbackEventHandler I have a problem with maintaining state in an ASP.NET AJAX page. Short version: I need some way to update the page ViewState after an async callback has been made, to reflect any state changes the server made during the async call. This seems to be a commo...
Tracking state using ASP.NET AJAX / ICallbackEventHandler
I have a problem with maintaining state in an ASP.NET AJAX page. Short version: I need some way to update the page ViewState after an async callback has been made, to reflect any state changes the server made during the async call. This seems to be a common problem, but I will describe my scenario to help explain: I h...
[ "If you're already shuffling the ViewState around anyway, you might as well use an UpdatePanel. Its partial postbacks will update the page's ViewState automatically.\n", "Check out this blog post: Tweaking the ICallbackEventHandler and Viewstate. The author seems to be addressing the very situation that you are ...
[ 2, 1, 0, 0, 0 ]
[]
[]
[ "ajax", "asp.net", "asp.net_ajax", "viewstate" ]
stackoverflow_0000002328_ajax_asp.net_asp.net_ajax_viewstate.txt
Q: MVC Preview 4 - No route in the route table matches the supplied values I have a route that I am calling through a RedirectToRoute like this: return this.RedirectToRoute("Super-SuperRoute", new { year = selectedYear }); I have also tried: return this.RedirectToRoute("Super-SuperRoute", new { controller = "Super"...
MVC Preview 4 - No route in the route table matches the supplied values
I have a route that I am calling through a RedirectToRoute like this: return this.RedirectToRoute("Super-SuperRoute", new { year = selectedYear }); I have also tried: return this.RedirectToRoute("Super-SuperRoute", new { controller = "Super", action = "SuperRoute", id = "RouteTopic", year = selectedYear }); The rout...
[ "What type is selectedYear? A DateTime? If so then you might need to convert to a string.\n" ]
[ 5 ]
[]
[]
[ "asp.net_mvc", "asp.net_mvc_routing" ]
stackoverflow_0000005690_asp.net_mvc_asp.net_mvc_routing.txt
Q: Is there a lightweight, preferable open source, formattable label control for .NET? I have been looking for a way to utilize a simple markup language, or just plain HTML, when displaying text in WinForm applications. I would like to avoid embedding a web browser control since in most of the case I just want to hig...
Is there a lightweight, preferable open source, formattable label control for .NET?
I have been looking for a way to utilize a simple markup language, or just plain HTML, when displaying text in WinForm applications. I would like to avoid embedding a web browser control since in most of the case I just want to highlight a single word or two in a sentence. I have looked at using a RTFControl but I beli...
[ "Well, just use HTML. We have used the following 'FREE' control in some of our applications, and it's just beautiful.\nWe can define the UI in HTML Markup and then render it using this control:\nhttp://www.terrainformatica.com/htmlayout/main.whtm\nInitially, we started looking at HtmlToRTF converters so that we can...
[ 7 ]
[]
[]
[ ".net" ]
stackoverflow_0000005704_.net.txt
Q: Is it just me, or are characters being rendered incorrectly more lately? I'm not sure if it's my system, although I haven't done anything unusual with it, but I've started noticing incorrectly rendered characters popping up in web pages, text-files, like this: http://www.kbssource.com/strange-characters.gif I have...
Is it just me, or are characters being rendered incorrectly more lately?
I'm not sure if it's my system, although I haven't done anything unusual with it, but I've started noticing incorrectly rendered characters popping up in web pages, text-files, like this: http://www.kbssource.com/strange-characters.gif I have a hunch it's a related to the fairly recent trend to use unicode for everythi...
[ "It appears that for this particular author, the text was edited in some editor that assumed it wasn't UTF8, and then re-wrote it out in UTF8. I'm basing this off the fact that if I tell my browser to interpret the page as different common encodings, none make it display correctly. This tells me that some conversio...
[ 2, 0, 0 ]
[]
[]
[ "fonts", "unicode", "utf_8" ]
stackoverflow_0000005682_fonts_unicode_utf_8.txt
Q: mailto link for large bodies I have a page upon which a user can choose up to many different paragraphs. When the link is clicked (or button), an email will open up and put all those paragraphs into the body of the email, address it, and fill in the subject. However, the text can be too long for a mailto link. A...
mailto link for large bodies
I have a page upon which a user can choose up to many different paragraphs. When the link is clicked (or button), an email will open up and put all those paragraphs into the body of the email, address it, and fill in the subject. However, the text can be too long for a mailto link. Any way around this? We were think...
[ "By putting the data into a form, I was able to make the body around 1800 characters long before the form stopped working.\nThe code looked like this:\n<form action=\"mailto:youremail@domain.com\">\n <input type=\"hidden\" name=\"Subject\" value=\"Email subject\">\n <input type=\"hidden\" name=\"Body\" value=...
[ 15, 0 ]
[]
[]
[ "mailto" ]
stackoverflow_0000005857_mailto.txt
Q: How do I know which SQL Server 2005 index recommendations to implement, if any? We're in the process of upgrading one of our SQL Server instances from 2000 to 2005. I installed the performance dashboard (http://www.microsoft.com/downloads/details.aspx?FamilyId=1d3a4a0d-7e0c-4730-8204-e419218c1efc&displaylang=en) f...
How do I know which SQL Server 2005 index recommendations to implement, if any?
We're in the process of upgrading one of our SQL Server instances from 2000 to 2005. I installed the performance dashboard (http://www.microsoft.com/downloads/details.aspx?FamilyId=1d3a4a0d-7e0c-4730-8204-e419218c1efc&displaylang=en) for access to some high level reporting. One of the reports shows missing (recommended...
[ "First thing to be aware of:\nWhen you upgrade from 2000 to 2005 (by using detach and attach) make sure that you:\n\nSet compability to 90\nRebuild the indexes\nRun update statistics with full scan\n\nIf you don't do this you will get suboptimal plans.\nIF the table is mostly write you want as few indexes as possib...
[ 4, 3, 0 ]
[]
[]
[ "sql_server", "sql_server_2005" ]
stackoverflow_0000003975_sql_server_sql_server_2005.txt
Q: User access log to SQL Server I need to get a log of user access to our SQL Server so I can track average and peak concurrency usage. Is there a hidden table or something I'm missing that has this information for me? To my knowledge the application I'm looking at does not track this at the application level. I'm c...
User access log to SQL Server
I need to get a log of user access to our SQL Server so I can track average and peak concurrency usage. Is there a hidden table or something I'm missing that has this information for me? To my knowledge the application I'm looking at does not track this at the application level. I'm currently working on SQL Server 2000...
[ "In SQL Server 2005, go to tree view on the left and select Server (name of the actual server) > Management > Activity Monitor. Hope this helps.\n", "\non 2000 you can use sp_who2 or the dbo.sysprocesses system table\non 2005 take a look at the sys.dm_exec_sessions DMV\n\nBelow is an example\nSELECT COUNT(*) AS ...
[ 7, 6 ]
[]
[]
[ "logging", "sql_server", "statistics" ]
stackoverflow_0000005908_logging_sql_server_statistics.txt
Q: API Yahoo India Maps Yahoo has separate map for India ( which has more details than the regular maps.yahoo.com) at http://in.maps.yahoo.com/ . But when I use the API it goes to default map. How do I get API access to YMaps India? A: I don't know about yahoo, but there is another mapping website that provides an ...
API Yahoo India Maps
Yahoo has separate map for India ( which has more details than the regular maps.yahoo.com) at http://in.maps.yahoo.com/ . But when I use the API it goes to default map. How do I get API access to YMaps India?
[ "I don't know about yahoo, but there is another mapping website that provides an API for India.\nhttp://biz.mapmyindia.com/APIs.html\n" ]
[ 1 ]
[]
[]
[ "yahoo_api", "yahoo_maps" ]
stackoverflow_0000005918_yahoo_api_yahoo_maps.txt
Q: Should I provide accessor methods / Getter Setters for public/protected components on a form? If I have .Net Form with a component/object such as a textbox that I need to access from a parent or other form I obviously need to "upgrade" the modifier to this component to an Internal or Public level variable. Now, if...
Should I provide accessor methods / Getter Setters for public/protected components on a form?
If I have .Net Form with a component/object such as a textbox that I need to access from a parent or other form I obviously need to "upgrade" the modifier to this component to an Internal or Public level variable. Now, if I were providing a public variable of an int or string type etc. in my form class I wouldn't think...
[ "\"However, the VS designer doesn't seem to implement such Getters/Setters for those public objects that are components on a form (and therefore does not comply with good programming practice).\"\nIf you mean the controls you're dragging and dropping onto the form, these are marked as private instance members and a...
[ 5, 2, 2, 1 ]
[]
[]
[ ".net", "winforms" ]
stackoverflow_0000005997_.net_winforms.txt
Q: Any solution to Illegal Cross Thread Operation exception? When you data bind in C#, the thread that changes the data causes the control to change too. But if this thread is not the one on which the control was created, you'll get an Illegal Cross Thread Operation exception. Is there anyway to prevent this? A: Yo...
Any solution to Illegal Cross Thread Operation exception?
When you data bind in C#, the thread that changes the data causes the control to change too. But if this thread is not the one on which the control was created, you'll get an Illegal Cross Thread Operation exception. Is there anyway to prevent this?
[ "You should be able to do something like:\nif (control.InvokeRequired)\n{\n control.Invoke(delegateWithMyCode);\n}\nelse\n{\n delegateWithMyCode();\n}\n\nInvokeRequired is a property on Controls to see if you are on the correct thread, then Invoke will invoke the delegate on the correct thread.\nUPDATE: Actua...
[ 5, 2, 0, 0 ]
[]
[]
[ "c#", "data_binding" ]
stackoverflow_0000001994_c#_data_binding.txt
Q: Memcached chunk limit Why is there a hardcoded chunk limit (.5 meg after compression) in memcached? Has anyone recompiled theirs to up it? I know I should not be sending big chunks like that around, but these extra heavy chunks happen for me from time to time and wreak havoc. A: This question used to be in the o...
Memcached chunk limit
Why is there a hardcoded chunk limit (.5 meg after compression) in memcached? Has anyone recompiled theirs to up it? I know I should not be sending big chunks like that around, but these extra heavy chunks happen for me from time to time and wreak havoc.
[ "This question used to be in the official FAQ\nWhat are some limits in memcached I might hit? (Wayback Machine)\nTo quote:\n\nThe simple limits you will probably see with memcache are the key and \n item size limits. Keys are restricted to 250 characters. Stored data \n cannot exceed 1 megabyte in size, since tha...
[ 4 ]
[]
[]
[ "membership" ]
stackoverflow_0000005349_membership.txt
Q: Making a production build of a PHP project with Subversion If you are working in PHP (or I guess any programming language) and using subversion as your source control, is there a way to take your project (for example): C:\Projects\test\.svn C:\Projects\test\docs\ C:\Projects\test\faq.php C:\Projects\test\gu...
Making a production build of a PHP project with Subversion
If you are working in PHP (or I guess any programming language) and using subversion as your source control, is there a way to take your project (for example): C:\Projects\test\.svn C:\Projects\test\docs\ C:\Projects\test\faq.php C:\Projects\test\guestbook.php C:\Projects\test\index.php C:\Projects\test\test...
[ "If you use TortoiseSVN, you can use the export feature to automatically strip out all of the .svn files. I think other svn things have the same feature.\nRight click the root project folder, then select TortoiseSVN > Export, and tell it where you want the .svn free directory.\n", "Copy all the files manually or ...
[ 6, 2, 1 ]
[]
[]
[ "build_process", "php", "scripting", "svn", "tortoisesvn" ]
stackoverflow_0000005872_build_process_php_scripting_svn_tortoisesvn.txt
Q: Multiple foreign keys? I've got a table that is supposed to track days and costs for shipping product from one vendor to another. We (brilliantly :p) stored both the shipping vendors (FedEx, UPS) with the product handling vendors (Think... Dunder Mifflin) in a "VENDOR" table. So, I have three columns in my SHIPPIN...
Multiple foreign keys?
I've got a table that is supposed to track days and costs for shipping product from one vendor to another. We (brilliantly :p) stored both the shipping vendors (FedEx, UPS) with the product handling vendors (Think... Dunder Mifflin) in a "VENDOR" table. So, I have three columns in my SHIPPING_DETAILS table that all ref...
[ "You defined the primary key twice. Try:\nCREATE TABLE SHIPPING_GRID( \n id INT NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT 'Unique ID for each row', \n shipping_vendor_no INT(6) NOT NULL COMMENT 'Foreign key to VENDOR.no for the shipping vendor (vendors_type must be 3)', \n start_vendor_no INT(6) NOT N...
[ 13, 1, 0 ]
[]
[]
[ "foreign_keys", "mysql", "sql" ]
stackoverflow_0000006340_foreign_keys_mysql_sql.txt
Q: Normalizing a Table with Low Integrity I've been handed a table with about 18000 rows. Each record describes the location of one customer. The issue is, that when the person created the table, they did not add a field for "Company Name", only "Location Name," and one company can have many locations. For example, h...
Normalizing a Table with Low Integrity
I've been handed a table with about 18000 rows. Each record describes the location of one customer. The issue is, that when the person created the table, they did not add a field for "Company Name", only "Location Name," and one company can have many locations. For example, here are some records that describe the same ...
[ "I've had to do this before. The only real way to do it is to manually match up the various locations. Use your database's console interface and grouping select statements. First, add your \"Company Name\" field. Then:\nSELECT count(*) AS repcount, \"Location Name\" FROM mytable\n WHERE \"Company Name\" IS NULL\n G...
[ 1, 1, 0, 0, 0 ]
[]
[]
[ "database" ]
stackoverflow_0000006110_database.txt
Q: What's the difference in closure style There are two popular closure styles in javascript. The first I call anonymous constructor: new function() { var code... } and the inline executed function: (function() { var code... })(); are there differences in behaviour between those two? Is one "better" over the o...
What's the difference in closure style
There are two popular closure styles in javascript. The first I call anonymous constructor: new function() { var code... } and the inline executed function: (function() { var code... })(); are there differences in behaviour between those two? Is one "better" over the other?
[ "Both cases will execute the function, the only real difference is what the return value of the expression may be, and what the value of \"this\" will be inside the function.\nBasically behaviour of\nnew expression\n\nIs effectively equivalent to\nvar tempObject = {};\nvar result = expression.call(tempObject);\nif ...
[ 12, 5, 3, 0 ]
[ "Yes, there are differences between the two.\nBoth are anonymous functions and execute in the exact same way. But, the difference between the two is that in the second case scope of the variables is restricted to the anonymous function itself. There is no chance of accidentally adding variables to the global scope....
[ -4 ]
[ "javascript" ]
stackoverflow_0000006373_javascript.txt
Q: PHP array indexing: $array[$index] vs $array["$index"] vs $array["{$index}"] What is the difference, if any, between these methods of indexing into a PHP array: $array[$index] $array["$index"] $array["{$index}"] I'm interested in both the performance and functional differences. Update: (In response to @Jeremy) I'...
PHP array indexing: $array[$index] vs $array["$index"] vs $array["{$index}"]
What is the difference, if any, between these methods of indexing into a PHP array: $array[$index] $array["$index"] $array["{$index}"] I'm interested in both the performance and functional differences. Update: (In response to @Jeremy) I'm not sure that's right. I ran this code: $array = array(100, 200, 300); print...
[ "see @svec and @jeremy above. All array indices are of type 'int' first, then type 'string', and will be cast to that as PHP sees fit.\nPerformance wise, $index should be faster than \"$index\" and \"{$index}\" (which are the same). \nOnce you start a double-quote string, PHP will go into interpolation mode and t...
[ 34, 29, 7, 6, 1, 0 ]
[ "I believe from a performance perspective that $array[\"$index\"] is faster than $array[$index] See Best practices to optimize PHP code performance\nAnother variation that I use sometimes when I have an array inside a string is:\n$str = \"this is my string {$array[\"$index\"]}\";\n\nEdit: What I meant to say is $ro...
[ -6 ]
[ "php", "syntax" ]
stackoverflow_0000006628_php_syntax.txt
Q: Automate builds for Java RCP for deployment with JNLP I've found many sources that talk about the automated Eclipse PDE process. I feel these sources don't do a good job explaining what's going on. I can create the deployable package, in a semi-manual process via the Feature Export. The automated process requir...
Automate builds for Java RCP for deployment with JNLP
I've found many sources that talk about the automated Eclipse PDE process. I feel these sources don't do a good job explaining what's going on. I can create the deployable package, in a semi-manual process via the Feature Export. The automated process requires knowledge of how the org.eclipse.pde.build scripts work....
[ "I haven't done this before, but I found this site on the web giving an explanation.\n" ]
[ 5 ]
[]
[]
[ "build_automation", "java", "jnlp", "rcp" ]
stackoverflow_0000005855_build_automation_java_jnlp_rcp.txt
Q: Why doesn't my favicon display for my web site? I have a website that I've just uploaded onto the Internet. When I browse to the site using Firefox 3.0.1 on Ubuntu I don't see the favicon; Firefox 3.0.1 on WinXP does display it. Why isn't the favicon displaying under Ubuntu? It's a favicon.ico file in the root ...
Why doesn't my favicon display for my web site?
I have a website that I've just uploaded onto the Internet. When I browse to the site using Firefox 3.0.1 on Ubuntu I don't see the favicon; Firefox 3.0.1 on WinXP does display it. Why isn't the favicon displaying under Ubuntu? It's a favicon.ico file in the root directory, not referenced in the meta tags; would it ...
[ "Previously, there was no favicon. The browser cached the lack of favicon. Clear the Firefox cache, and all is well.\n", "Try taking a look at this previous Question, which shows you must put two meta tags in your html in order for it to work across all browsers and operating systems.\n" ]
[ 8, 5 ]
[]
[]
[ "favicon", "firefox", "ubuntu" ]
stackoverflow_0000006732_favicon_firefox_ubuntu.txt
Q: Master Pages for large web sites I've just been learning about master pages in ASP.NET 2.0. They sound great, but how well do they work in practice? Does anybody have experience of using them for a large web site? A: I'm pretty sure I've only used master pages in the context of ASP.NET MVC so I'm not sure if...
Master Pages for large web sites
I've just been learning about master pages in ASP.NET 2.0. They sound great, but how well do they work in practice? Does anybody have experience of using them for a large web site?
[ "I'm pretty sure I've only used master pages in the context of ASP.NET MVC so I'm not sure if it differs from web forms but in my experience they are not only excellent but I couldn't imagine not using them. Master pages are code inheritance to web pages.\n", "They are a must if you want to maintain the look of ...
[ 6, 5, 1, 0, 0, 0 ]
[]
[]
[ ".net", "asp.net", "asp.net_2.0", "master_pages" ]
stackoverflow_0000006719_.net_asp.net_asp.net_2.0_master_pages.txt
Q: How can I enable disabled radio buttons? The following code works great in IE, but not in FF or Safari. I can't for the life of me work out why. The code is supposed to disable radio buttons if you select the "Disable 2 radio buttons" option. It should enable the radio buttons if you select the "Enable both rad...
How can I enable disabled radio buttons?
The following code works great in IE, but not in FF or Safari. I can't for the life of me work out why. The code is supposed to disable radio buttons if you select the "Disable 2 radio buttons" option. It should enable the radio buttons if you select the "Enable both radio buttons" option. These both work... Howeve...
[ "To get FF to mimic IE's behavior when using the keyboard, you can use the keyup event on the select box. In your example (I am not a fan of attaching event handlers this way, but that's another topic), it would be like this:\n<select name=\"user\" id=\"selUser\" onchange=\"javascript:SetLocationOptions()\" onkeyup...
[ 6, 3, 1 ]
[]
[]
[ "html", "javascript", "radio_button" ]
stackoverflow_0000006441_html_javascript_radio_button.txt
Q: How do I best share an embeddable form in VB6? Is there a good way to create a form in VB6 that can easily be embedded inside other forms? On a few occasions recently, I've wanted to design and code a Form object that I could plug into several other "parent" forms. My goal is to create a centralized piece of code...
How do I best share an embeddable form in VB6?
Is there a good way to create a form in VB6 that can easily be embedded inside other forms? On a few occasions recently, I've wanted to design and code a Form object that I could plug into several other "parent" forms. My goal is to create a centralized piece of code for managing several UI components in a particular ...
[ "Take a look at VB6 UserControls; I think they are exactly what you need. You can create a UserControl within your project, add controls and code to that control, and then insert it onto a form just like standard VB6 controls. I've used UserControls to share UI layouts on many occasions and it works great.\n" ]
[ 9 ]
[]
[]
[ "code_reuse", "forms", "vb6" ]
stackoverflow_0000006913_code_reuse_forms_vb6.txt