text
stringlengths
8
267k
meta
dict
Q: Delete all elements at application close in ASP.Net Can anyone help me in this. Am using Asp.NET WITH C#. I am have an number of products in my database. When I run my code all the products values are stored in a database table. Without an exit button, if I close my application, when I run for second time the dat...
{ "language": "en", "url": "https://stackoverflow.com/questions/404545", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: C++ Inserting 2D array Object into another This problem is a continuation of a previous problem: C++ Returning and Inserting a 2D array object and it is highly recommended to view the link to understand the following. I followed through Adam Rosenfield's answer and it solved the first two problems. However the last ...
{ "language": "en", "url": "https://stackoverflow.com/questions/404547", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do you style major and minor comments? Sometimes I want to write a "major" comment to describe a large block of code and then write "minor" comments to describe a few of the lines within that block of code: // Major comment // Minor comment ... // Minor comment 2 ... The major comment looks strange without co...
{ "language": "en", "url": "https://stackoverflow.com/questions/404549", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: How to remove objects from an Enumerable collection in a loop Duplicate Modifying A Collection While Iterating Through It Has anyone a nice pattern to allow me to get around the inability to remove objects while I loop through an enumerable collection (eg, an IList or KeyValuePairs in a dictionary) For example, the...
{ "language": "en", "url": "https://stackoverflow.com/questions/404557", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: Drag and drop file functionality to browser I am looking for a way to mimic Windows Live functionality on dragging files from windows explorer onto a web page in a browser and capturing the filename. I think this functionality is through the following control Microsoft.Live.Folders.RichUpload.UploadControl Any poin...
{ "language": "en", "url": "https://stackoverflow.com/questions/404574", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Free SQL Query generator tool for oracle database? Do you use any free tool to generate query for oracle database. Tool that autocomplete and suggests the table names and column names. A: Oracle SQL Developer has auto-complete and such. Written and maintained by Oracle themselves. It is written in java though, and...
{ "language": "en", "url": "https://stackoverflow.com/questions/404581", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: SQL Server Enterprise Manager 2005 - stored procedures not showing up When using SQL Server Management Studio from SQL Server 2005, I can connect to an instance of SQL Server 2000... but none of the stored procedures show up. Is there some trick to allow SQL Server Enterprise Manager 2005 to properly talk to SQL Ser...
{ "language": "en", "url": "https://stackoverflow.com/questions/404600", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How do you negotiate a domain model with your domain experts? Suppose you're working with a customer's domain experts. You realize (or at least have a reasonable belief) that your model of their problem is clearer than theirs. How do you convince them that they should go your way. In my case, it is fairly clear what...
{ "language": "en", "url": "https://stackoverflow.com/questions/404601", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Improving turn around time when building Java EE apps One troubling aspect of building Java EE applications is the turn around time for the edit, compile, deploy process. I tried using Jetty but even that has some problems after making several edits you will usually run into a memory error. At the moment I use Netbe...
{ "language": "en", "url": "https://stackoverflow.com/questions/404602", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Comparing Unix/Linux IPC Lots of IPCs are offered by Unix/Linux: pipes, sockets, shared memory, dbus, message-queues... What are the most suitable applications for each, and how do they perform? A: It's worth noting that lots of libraries implement one type of thing on top of another. Shared memory doesn't need to ...
{ "language": "en", "url": "https://stackoverflow.com/questions/404604", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "80" }
Q: Developing a code base for multiple versions of a product I know this is possible since there are so many packages available where you have a "Standard", "Professional", and "Enterprise" version of a package... but does anyone have any decent tutorials available on how a uISV would go about learning the techniques i...
{ "language": "en", "url": "https://stackoverflow.com/questions/404606", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: What are some best practices for reducing memory usage in C? What are some best practice for "Memory Efficient C programming". Mostly for embedded/mobile device what should be the guidelines for having low memory consumptions ? I guess there should be separate guideline for a) code memory b) data memory A: All g...
{ "language": "en", "url": "https://stackoverflow.com/questions/404615", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "41" }
Q: Disable browser cache in PHP or JavaScript in a Flash application We are developing a Flash site with PHP. the problem is that it storing the cache , but we have to disable the cache using JavaScript or PHP. How can I disable caching? A: Try loading the movie with a query string, that should disable the cache. Note...
{ "language": "en", "url": "https://stackoverflow.com/questions/404617", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: What is the most common design patterns for any windows forms application? I am asking about that as I am going to develop a client side application using c# to display stock data and make some user-interaction, so give me links for best tutorials you read before A: Jeremy Miller's guide is an excellent starting pl...
{ "language": "en", "url": "https://stackoverflow.com/questions/404624", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Is it safe to copy over a dll that is used by a running process on Windows XP? This is on Windows XP. I have a running process (that I'd like to stay running). If I copy over a dll that it uses (as in, replace it with a newer version), will this cause problems for the running process, or is the code already loaded ...
{ "language": "en", "url": "https://stackoverflow.com/questions/404646", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to get a specific cell in a DataGridView on selection changed With a listbox, I have the following code to extract the item selected: private void inventoryList_SelectedIndexChanged(object sender, EventArgs e) { String s = inventoryList.SelectedItem.ToString(); s = s.Substring(0, s.IndexO...
{ "language": "en", "url": "https://stackoverflow.com/questions/404651", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Calculating optimal stock length This is similar to the cutting stock problem, but with a slight difference. I want to find out what the optimal length of the stock is based on the sizes of the cuts. Potential complications: * *The Wikipedia article on the Cutting Stock Problem is way over my head. I suspect that...
{ "language": "en", "url": "https://stackoverflow.com/questions/404675", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Ruby: More flexibility than Java/C#? Is is that I'm a newbie learning Ruby, or does it really have more ways to write (the same) things than Java/C#? Also, if it is more flexible than Java, are there any linguistic features of Ruby that are generally not used to avoid confusion? Examples might be parallel assignment...
{ "language": "en", "url": "https://stackoverflow.com/questions/404676", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: mod_rewrite: Check for Custom query string in URL? I'm trying to use URL rewrite in my new project. But I also need to allow custom query sting in URL. I just want to know how to write rewrite rule for this URL http://www.mysite.com/edit/123/?q1=value1&q2=value2 to become this http://www.mysite.com/index.php?acti...
{ "language": "en", "url": "https://stackoverflow.com/questions/404684", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Solution for e-Forms engine My client is asking for a solution that handles e-forms generation to be done by a technology-savvy user (not a developer). In other words, An e-form engine for dynamic creation and implementation of electronic forms. Is there any tool/solution in the market available that handles this r...
{ "language": "en", "url": "https://stackoverflow.com/questions/404689", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Which one of these code samples has better performance? In replies to one of my questions, I received a number of answers saying that style 2 may perform better than style 1. I don't understand how, since I believe they should emit essentially the same machine instructions (if written in C++). Could you please expla...
{ "language": "en", "url": "https://stackoverflow.com/questions/404698", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Tag clouds: Are there any in either flash or javascript I would like to display tagcloud in my home page. Found this wordpress flash plugin http://alexisyes.com/tags/wpcumulus , but for that i needed to setup wordpress. I am wondering whether there is any other standalone plugin similar to wpcumulus which can be con...
{ "language": "en", "url": "https://stackoverflow.com/questions/404701", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Is Refactoring by Compilation Errors Bad? I have been used to do some refactorings by introducing compilation errors. For example, if I want to remove a field from my class and make it a parameter to some methods, I usually remove the field first, which causes a compilation error for the class. Then I would introduc...
{ "language": "en", "url": "https://stackoverflow.com/questions/404717", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: How can I change Firefox's proxy settings from an external program? I've seen a few programs (eg Charles Web Developer Proxy) that are able to modify Firefox's proxy settings. The sequence is: * *Firefox is running, with the users proxy settings. *User starts the external third party application, which *modifie...
{ "language": "en", "url": "https://stackoverflow.com/questions/404729", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Java: how to check if character belongs to a specific unicode block? I need to identify what natural language my input belongs to. The goal is to distinguish between Arabic and English words in a mixed input, where the input is Unicode and is extracted from XML text nodes. I have noticed the class Character.Unicode...
{ "language": "en", "url": "https://stackoverflow.com/questions/404733", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: Determining application path in a Python EXE generated by pyInstaller I have an application that resides in a single .py file. I've been able to get pyInstaller to bundle it successfully into an EXE for Windows. The problem is, the application requires a .cfg file that always sits directly beside the application i...
{ "language": "en", "url": "https://stackoverflow.com/questions/404744", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "113" }
Q: Why library name gets an additional 0 in its name? I have this tiny Qt project with a project file like this: TEMPLATE = lib TARGET = record32 VERSION = 0.0.1 DEPENDPATH += . INCLUDEPATH += . CONFIG += shared SOURCES += recorder.cpp HEADERS += recorder.h When I compile a library from it by qmake && nmake, it resul...
{ "language": "en", "url": "https://stackoverflow.com/questions/404774", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How to organize Rails models that are too fat? It is good practice to shift logic from the controller into the model. But in any complex system, this invariably leads to a very large file even if a majority of the methods are one liners as per the Rails Way. I've resorted to splitting up models into other modules an...
{ "language": "en", "url": "https://stackoverflow.com/questions/404785", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "29" }
Q: Database size estimation tool Is there a tool for estimating the size of a database? I am looking for such a tool, which I can input the estimated tables, row size, data types, indexes and other variables to give me a clue about the size of a yet-non-existing database. I know MS Sql Server Books Online has a good d...
{ "language": "en", "url": "https://stackoverflow.com/questions/404794", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: LBYL vs EAFP in Java? I was recently teaching myself Python and discovered the LBYL/EAFP idioms with regards to error checking before code execution. In Python, it seems the accepted style is EAFP, and it seems to work well with the language. LBYL (Look Before You Leap): def safe_divide_1(x, y): if y == 0: ...
{ "language": "en", "url": "https://stackoverflow.com/questions/404795", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "77" }
Q: Java Covariants public class CovariantTest { public A getObj() { return new A(); } public static void main(String[] args) { CovariantTest c = new SubCovariantTest(); System.out.println(c.getObj().x); } } class SubCovariantTest extends CovariantTest { public B getObj() { ...
{ "language": "en", "url": "https://stackoverflow.com/questions/404804", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: Pin Generation I am looking to develop a system in which i need to assign every user a unique pin code for security. The user will only enter this pin code as a means of identifying himself. Thus i dont want the user to be able to guess another users pincode. Assuming the max users i will have is 100000, how long sh...
{ "language": "en", "url": "https://stackoverflow.com/questions/404806", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: MySQL transaction support with mixed tables It seems like I will be needing transaction with MySQL and I have no idea how should I manage transactions in Mysql with mixed InnoDB/MyISAM tables, It all seems like a huge mess. You might ask why would I ever want to mix the tables together... the anwer is PERFORMANCE. a...
{ "language": "en", "url": "https://stackoverflow.com/questions/404809", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: I need help--lists and Python How to return a list in Python??? When I tried returning a list,I got an empty list.What's the reason??? A: As Andrew commented, you will receive better answers if you show us the code you are currently using. Also if you could state what version of Python you are using that would be g...
{ "language": "en", "url": "https://stackoverflow.com/questions/404825", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-3" }
Q: Cocoa Won't Capture Shift Modifier? I have an application in which I'm trying to capture the shift key modifier to perform an action, however when I run the program and press and normal key without the shift key modifier I get a beep and the modifier and key are not sent to my keyDown event. The relevant code is: N...
{ "language": "en", "url": "https://stackoverflow.com/questions/404830", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Do you prefer "if (var)" or "if (var != 0)"? I've been programming in C-derived languages for a couple of decades now. Somewhere along the line, I decided that I no longer wanted to write: if (var) // in C if ($var) # in Perl when what I meant was: if (var != 0) if (defined $var and $var ne '') I think part ...
{ "language": "en", "url": "https://stackoverflow.com/questions/404838", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "22" }
Q: Can quantum algorithms be used for encryption? Can quantum algorithms be useful? Has any one been successful in putting quantum algorithms to any use? A: "Quantum algorithms" are algorithms to be run on quantum computers. There are things that can be done quickly in the quantum computation model that are not known ...
{ "language": "en", "url": "https://stackoverflow.com/questions/404839", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Relevance of Red Green Light Testing I am starting, and loving, TDD, however wondering about the red green light concept. I do understand in theory the importance of ensuring you can fail a test before passing it. In practice, however, I am finding it somewhat a futile practice. I feel I can't properly write a faili...
{ "language": "en", "url": "https://stackoverflow.com/questions/404842", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: in ps -l, what does wchan=stext mean? when I try to fine-tune my process, I see that the waiting channel is stext, what does it mean? A: wchan is broken on x86 systems where the SCHED_NO_NO_OMIT_FRAME_POINTER has been set to "y" (which is the default value). In those systems wchan will always return "0" which maps ...
{ "language": "en", "url": "https://stackoverflow.com/questions/404854", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Calculation of cubic Bézier with known halfway point I know: * *The control points a and d (start and end point of a 2D cubic bezier curve) *The slopes a->b, c->d, and b->c (b,c the other control points) *Where the halfway point of the Bézier curve is. Now, given this information, what is the formula for the po...
{ "language": "en", "url": "https://stackoverflow.com/questions/404861", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How to multi-line "Replace in files..." in Notepad++ If the free source code editor Notepad++ has the feature "Find in files...", that is without the files being opened in the editor, does it also have the feature "Replace in files..."? Notepad++ is based on the editing component Scintilla - for which at SourceForge...
{ "language": "en", "url": "https://stackoverflow.com/questions/404873", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "84" }
Q: Change date format that MySQL reads I have a batch file that was created for an Oracle database that I'm now trying to import to a MySQL database. I've had to deal with all sorts of inconsistencies between the two. The file has all the dates as '17-NOV-1981' rather than '1981-11-17' as MySQL expects. The batch file...
{ "language": "en", "url": "https://stackoverflow.com/questions/404875", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to create a java.awt.Image from image data? How to create a java.awt.Image from image data? Image data is not pure RGB pixel data but encoded in jpeg/png format. JavaME has a simple api Image.createImage(...) for doing this. public static Image createImage(byte[] imageData, int i...
{ "language": "en", "url": "https://stackoverflow.com/questions/404877", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: SQLite3: Insert BLOB with NULL characters in C++ I'm working on the development of a C++ API which uses custom-designed plugins to interface with different database engines using their APIs and specific SQL syntax. Currently, I'm attempting to find a way of inserting BLOBs, but since NULL is the terminating chara...
{ "language": "en", "url": "https://stackoverflow.com/questions/404879", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Alternative to CString::Format? Is there any better alternative for doing string formatting in VC6, with syntax checking before substitution? A: CString offers the Format method for printf-style formatting, but this isn't type-safe. For type-safe string formatting you could either use std::stringstream / std::wstr...
{ "language": "en", "url": "https://stackoverflow.com/questions/404886", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Stupefied by RSpec I'm sorry, but this is beginning to feel like kicking myself in the head. I'm completely baffled by RSpec. Have watched video after video, read tutorial after tutorial, and still I'm just stuck on square one. === here is what I'm working with http://github.com/fudgestudios/bort/tree/master === ...
{ "language": "en", "url": "https://stackoverflow.com/questions/404887", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Is this a Windows XP firewall bug? I have a webserver running on my Windows XP computer. I have set the firewall to allow incoming HTTP connections: Firewall settings window->'Advanced' tab->select my network connection->Settings->Services->check 'Webserver(HTTP)' checkbox. Normally, this works. However, sometimes ...
{ "language": "en", "url": "https://stackoverflow.com/questions/404890", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to pass values from one page to another in jQuery I have two pages of jQuery, Page1 and Page2, and I'm able to get input in Page1. The somval=1000$. The page 1 user enters the somevalue. I have stored the value: var val = somval; Now in the second page, I need to get the result of somvalue in page 1. Of course ...
{ "language": "en", "url": "https://stackoverflow.com/questions/404891", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Scope of variables in a delegate I found the following rather strange. Then again, I have mostly used closures in dynamic languages which shouldn't be suspectable to the same "bug". The following makes the compiler unhappy: VoidFunction t = delegate { int i = 0; }; int i = 1; It says: A local variable named 'i' c...
{ "language": "en", "url": "https://stackoverflow.com/questions/404899", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Handling events of HTML elements inserted by jQuery I currently have an anchor tag that, when clicked, appends another anchor tag to the DOM. This is all done via jQuery. I know what the "id" attribute of the anchor tag to be added will be. However, when I try the following code, it fails to handle the newly added...
{ "language": "en", "url": "https://stackoverflow.com/questions/404905", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Can someone explain this C++ notation? if (vector1.x > ((float*)&vector1)[j]) Is j simply just an index into the vector? e.g. is C++ able to retrieve these values using array notation even though vector isn't an array? If so I'm guessing it achieves this by referencing vector by its address? A: The C++ Standard sa...
{ "language": "en", "url": "https://stackoverflow.com/questions/404934", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How can I pass an "array" of values to my stored procedure? I want to be able to pass an "array" of values to my stored procedure, instead of calling "Add value" procedure serially. Can anyone suggest a way to do it? am I missing something here? Edit: I will be using PostgreSQL / MySQL, I haven't decided yet. A: As...
{ "language": "en", "url": "https://stackoverflow.com/questions/404941", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: Download Web Page How do i Download Web Page using C (not with libcurl), OS: Win32 A: To download a web page, you need two things: * *Establish a communication channel with the websever *Manage the web server protocol to download a page. For the first item, have a look at the socket API. You need to open a so...
{ "language": "en", "url": "https://stackoverflow.com/questions/404946", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Practical way to commit changes in source control to multiple branches A common scenario when using source control is to have a development branch along with versioned release branches. We use CVS, with HEAD as the development branch, and a branch named e.g. release-6-2 for the current release of a product. Developm...
{ "language": "en", "url": "https://stackoverflow.com/questions/404948", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Animation End Callback for CALayer? Using iPhone CALayer, I want a rotation animation for my spirit layer, but I also want a callback for the animation end, hot to do that? I think maybe I should use CABasicAnimation, but I don't know how to do rotation using CABasicAnimation, any idea? Thanks A: If you set a dele...
{ "language": "en", "url": "https://stackoverflow.com/questions/404957", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How do I write raw printer code to a windows printer share from ruby? Using java, minus the exception handling, it is as simple as FileOutputStream ostream = new FileOutputStream("\\\\host\\share"); PrintStream printStream = new PrintStream(ostream); printStream.print("HELLO PRINTER"); printStream.close(); ostream....
{ "language": "en", "url": "https://stackoverflow.com/questions/404975", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to authenticate users on one site and pass credentials to other site? ( Windows Authentication, ASP.Net) We have multiple web-applications running Windows authentication.Users log on to the websites using Domain\Username which is different from the DomainOther\UsernameOther that they use on their local computers...
{ "language": "en", "url": "https://stackoverflow.com/questions/404978", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How do I retrospectively create unit tests for a .NET application? I am new to unit testing but am beginning to think I need it. I have an ASP.NET web forms application that is being extended in unforeseen directions meaning that certain bits of code are being adapted for multiple uses. I need to try and ensure that...
{ "language": "en", "url": "https://stackoverflow.com/questions/404988", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Writing a string to a file causes an exception in C# I'm getting a "FormatException: Input string was not in a correct format" error that I don't understand. I'm using the following lines to write a string to a text file: using (StreamWriter sw = new StreamWriter(myfilename, false, System.Text.Encoding.GetEncoding(...
{ "language": "en", "url": "https://stackoverflow.com/questions/404989", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to check if a microphone and a speaker are from the same sound card? My question is how to check if a microphone and a speaker are from the same sound card on Windows platform. If they are from different cards, then the logic to handling timing will be different. I'm using both DSound and WMME API. A: WMI does ...
{ "language": "en", "url": "https://stackoverflow.com/questions/404995", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Komodo Edit: Running macros via keybinding versus toolbar Question: Is anyone out there familiar enough with Komodo Edit to shed some light on this macro? I need to figure out how to do buffer text selection in a macro when it is invoked via the tool panel. Problem: I have a very simple macro in Komodo Edit javascri...
{ "language": "en", "url": "https://stackoverflow.com/questions/404997", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: http-on-examine-response observer - possible to block response from further processing? I am attempting to implement a firefox extension which filters incoming HTTP responses and handles them accordingly. I wish to block HTTP responses containing a specific header. Having read through some of the MDC articles, it ap...
{ "language": "en", "url": "https://stackoverflow.com/questions/405010", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: "Permanent" std::setw Is there any way how to set std::setw manipulator (or its function width) permanently? Look at this: #include <iostream> #include <iomanip> #include <algorithm> #include <iterator> int main( void ) { int array[] = { 1, 2, 4, 8, 16, 32, 64, 128, 256 }; std::cout.fill( '0' ); std::cout.fla...
{ "language": "en", "url": "https://stackoverflow.com/questions/405039", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "34" }
Q: Porting easily from 2D to 3D on a Java game Due to lack of capital and time we are having to do our game in 2D even though me (the developer) would prefer if it was done in 3D. I would hate for users to join the game, only to think the graphics look bad and leave. Though I suppose we just have to try and do our best...
{ "language": "en", "url": "https://stackoverflow.com/questions/405042", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Response.Redirect with # anchor, does not work in IE7 Response.Redirect(string.Format("myprofile.aspx?uid={0}&result=saved#main",user.UserID)); said code translates to IE7 - myprofile.aspx?uid=933fdf8e-1be0-4bc2-a269-ac0b01ba4755&result=saved FF- myprofile.aspx?uid=933fdf8e-1be0-4bc2-a269-ac0b01ba4755&result=saved#...
{ "language": "en", "url": "https://stackoverflow.com/questions/405043", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to sort a string of characters in objective-C? I'm looking for an Objective-C way of sorting characters in a string, as per the answer to this question. Ideally a function that takes an NSString and returns the sorted equivalent. Additionally I'd like to run length encode sequences of 3 or more repeats. So, for...
{ "language": "en", "url": "https://stackoverflow.com/questions/405047", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Line reading chokes on 0x1A I have the following file: abcde kwakwa <0x1A> line3 linllll Where <0x1A> represents a byte with the hex value of 0x1A. When attempting to read this file in Python as: for line in open('t.txt'): print line, It only reads the first two lines, and exits the loop. The solution seems to...
{ "language": "en", "url": "https://stackoverflow.com/questions/405058", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: Using Partial classes for autogen code, how to setup filenaming etc? I have a datalayer.cs file that was generated using a code gen tool. I am marking the class as a partial class, so I can create another file with my own hand written datalayer code. How should I name my files? Should I do it like this: /data/parti...
{ "language": "en", "url": "https://stackoverflow.com/questions/405059", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Can I use a Regex in an XPath expression? Something like .//div[@id='foo\d+] to capture div tags with id='foo123'. I'm using .NET, if that matters. A: As other answers have noted, XPath 1.0 does not support regular expressions. Nonetheless, you have the following options: * *Use an XPath 1.0 expression (note the...
{ "language": "en", "url": "https://stackoverflow.com/questions/405060", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "62" }
Q: Coverting a TMyQuery dataset to TClientDataSet in Delphi I make use of the Mydac components by devart (corelab) to access MySql from Delphi (2006) Very often I need to work with data in a TClientDataSet What is the best way to convert the dataset of a TMyQuery to TClientDataSet Currently I am using var MyQ...
{ "language": "en", "url": "https://stackoverflow.com/questions/405065", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Zend Pagination - Seems Not to be limiting number of results on each page I am relatively new to The Zend framework having only been working with it probably two months at the most. I am now trying to get a list of results from a query I run, send it through the zend paginator class and display 4 results per page, h...
{ "language": "en", "url": "https://stackoverflow.com/questions/405072", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Flash/Flex Error #1063 When Retrieving SharedObject I have a parts application that is built on Flex 3 and I having a problem with the parts list. The parts list uses two objects: * *Part *ArrayOfPart I cache the parts list locally in a SharedObject. This has been working fine for a couple months. I added a ne...
{ "language": "en", "url": "https://stackoverflow.com/questions/405073", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to save a user made HTML page? I made a drag and drop utility that make it possible for users to drag and drop elements directly on a workplace and create their page, I wound how can I save the user's work as HTML page! A: You mean the position of all elements? How about iterating through them and saving their ...
{ "language": "en", "url": "https://stackoverflow.com/questions/405076", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-1" }
Q: Best way to get started on simple 3D user interfaces using Java? I'm writing a time management application and I have an idea for presenting timelines and todo items in 3D. Visually, I imagine this as looking down a corridor or highway in 3D, with upcoming deadlines and tasks represented as signposts - more importan...
{ "language": "en", "url": "https://stackoverflow.com/questions/405078", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Viewstate error on SharePoint custom site page with SPGridView I've got a custom site page in Windows SharePoint Services 3.0 that contains an SPGridView. When I use the search box on this page, I get the following error: Unable to validate data. at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(B...
{ "language": "en", "url": "https://stackoverflow.com/questions/405082", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Development and production environment in PHP I would like to setup two environments for my new website written in PHP. One - to develop new versions and test them. And second production where my actual stable version of website will be available. Website in PHP will consist of many PHP and other files (JS, images, ...
{ "language": "en", "url": "https://stackoverflow.com/questions/405092", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: ReSharper-like addon for the Flash IDE? Sometimes its necessary to code in AS2 to target Flash Player 8, so we're forced to write within the Flash IDE. Any refactoring tools / plugins available for Actionscript?... Within or without the Flash IDE, that's no problem, as long as it builds for Flash Player 8, AS2. A:...
{ "language": "en", "url": "https://stackoverflow.com/questions/405095", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Sun branded competitor to .NET using the JVM There have been many JVM languages in the recent few years including Javascript, Python, Ruby etc. (full list here: List of JVM Languages). My question is this: why has Sun not come out with a full suite of languages for the JVM just like Microsoft's .NET? With the new ve...
{ "language": "en", "url": "https://stackoverflow.com/questions/405099", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Impersonate another user in Visual SourceSafe We had an employee leave the company, and they left some files checked out in our VSS database. What is the best way to impersonate that user, so I can release those files? A: Within ssadmin you can reset their VSS password (so that you know what their VSS password is,...
{ "language": "en", "url": "https://stackoverflow.com/questions/405104", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: I can't but help get the idea I'm doing it all wrong (Python, again) All of the questions that I've asked recently about Python have been for this project. I have realised that the reason I'm asking so many questions may not be because I'm so new to Python (but I know a good bit of PHP) and is probably not because P...
{ "language": "en", "url": "https://stackoverflow.com/questions/405106", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How are objects stored in memory in C++? How are objects stored in memory in C++? For a regular class such as class Object { public: int i1; int i2; char i3; int i4; private: }; Using a pointer of Object as an array can be used to access i1 as follows? ((Object*)&myObject)[0] === i1? Other...
{ "language": "en", "url": "https://stackoverflow.com/questions/405112", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: which one to use linked list or static arrays? I have a structure in C which resembles that of a database table record. Now when I query the table using select, I do not know how many records I will get. I want to store all the returned records from the select query in a array of my structure data type. Which method...
{ "language": "en", "url": "https://stackoverflow.com/questions/405113", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Best file system to transfer 5+GB files between OS X and Windows on removable media I need to transfer DVD image files between a Windows XP computer and a Mac running Leopard. The machines are not connected via a fast network, and I have a few USB drives floating around that I want to use, e.g. 8GB flash, 60GB and 2...
{ "language": "en", "url": "https://stackoverflow.com/questions/405114", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Why is the scope of if and delegates this way in c# Inspired by this question I began wondering why the following examples are all illegal in c#: VoidFunction t = delegate { int i = 0; }; int i = 1; and { int i = 0; } int i = 1; I'm just wondering if anyone knew the exact reason why the language was designed...
{ "language": "en", "url": "https://stackoverflow.com/questions/405116", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: CSS issue: link is wrongly displayed a { color: #000; } a:hover { text-decoration: none; color: #fff; } That is the code I use. But, none of the links I have in my pages listen to this. They abide by this instead: #menu li, a { text-align: center; display: block; float: left; margin: ...
{ "language": "en", "url": "https://stackoverflow.com/questions/405120", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Manually setting a UIButton state I UIButton using + buttonWithType: What I need to figure out is how to manually change the button state. There are times when I need it to be set to "disabled." I read through the UIButton documentation but I cannot seem to find anything about manually setting a button state. Any t...
{ "language": "en", "url": "https://stackoverflow.com/questions/405134", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "20" }
Q: How to format a Date without using code - Format String Question How can I achieve the following with a format string: Do 01.01.2009 ? It has to work in all languages (the example would be for Germany). So there should only be the short weekday and then the short date. I tried 'ddd d' (without the '). However, this ...
{ "language": "en", "url": "https://stackoverflow.com/questions/405140", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Is it possible to prevent an NSURLRequest from caching data or remove cached data following a request? On iPhone, I perform a HTTP request using NSURLRequest for a chunk of data. Object allocation spikes and I assign the data accordingly. When I finish with the data, I free it up accordingly - however instruments do...
{ "language": "en", "url": "https://stackoverflow.com/questions/405151", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "90" }
Q: Detecting syllables in a word I need to find a fairly efficient way to detect syllables in a word. E.g., Invisible -> in-vi-sib-le There are some syllabification rules that could be used: V CV VC CVC CCV CCCV CVCC *where V is a vowel and C is a consonant. E.g., Pronunciation (5 Pro-nun-ci-a-tion; CV-CVC-CV-V-CVC) ...
{ "language": "en", "url": "https://stackoverflow.com/questions/405161", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "154" }
Q: Best method of testing for a function in JavaScript? I've done quite a bit of research into this but it seems that the methods used are inconsistent and varied. Here are some methods I have used in the past: /* 1: */ typeof myFunc === 'function' /* 2: */ myFunc.constructor === Function /* 3: */ myFunc instanceof ...
{ "language": "en", "url": "https://stackoverflow.com/questions/405164", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Please advise on Ruby vs Python, for someone who likes LISP a lot I am a C++ developer, slowly getting into web development. I like LISP a lot but don't like AllegroCL and web-frameworks available for LISP. I am looking for more freedom and ability to do cool hacks on language level. I don't consider tabs as a crime...
{ "language": "en", "url": "https://stackoverflow.com/questions/405165", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "21" }
Q: what will happen with the overlapping portion of boost once C++0x becomes mainstream? what will happen with the overlapping portion of boost once C++0x becomes mainstream? Will boost still contain everything it used to, or will they adapt the library to update it with the new std:: stuff? Will boost have both a norm...
{ "language": "en", "url": "https://stackoverflow.com/questions/405175", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: How to simplify this Sql query The Table - Query has 2 columns (functionId, depFunctionId) I want all values that are either in functionid or in depfunctionid I am using this: select distinct depfunctionid from Query union select distinct functionid from Query How to do it better? A: I think that's the best you'l...
{ "language": "en", "url": "https://stackoverflow.com/questions/405176", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Last inserted record ID problems using typed DataSet and DataGridView I'm using following for a simple database application: * *SQL Server Compact Edition .sdf file as database, with int primary key IDs. *Typed DataSet and BindingSource as data access layer *DataGridView for displaying data. My problem is, I'...
{ "language": "en", "url": "https://stackoverflow.com/questions/405189", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: SQL Server Database Management with Continuous Integration Let's say we have a continuous integration server. When I check in, the post-hook pulls the latest code, runs the tests, packages everything. What is the best way to also automate the database changes? Ideally, I'd build an installer that could either build ...
{ "language": "en", "url": "https://stackoverflow.com/questions/405192", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: Export Crystal Report to Text File - No RTF File I am using Crystal Report that comes with VS 2005. I need to Export the Crystal Report To Text File. What's the way to do it. A: Looks like they've taken away that enumeration for some reason. I suppose you could loop through the underlying recordset, and dump the c...
{ "language": "en", "url": "https://stackoverflow.com/questions/405193", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Komodo Edit: How to do some of these basic Macro and Snippet operations? I am wondering how to do (or where to find documentation) on these basic macro and snippet operations in Komodo Edit. * *1) FILE/IO: write a string to a temporary file from within a komodo javascript macro *2) FILE/IO: read the content of ...
{ "language": "en", "url": "https://stackoverflow.com/questions/405212", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What is Memory Monitor for the iPhone? I've heard a lot of people talk of a tool called Memory Monitor as a better way to examine the memory usage of an iPhone app as Object Alloc doesn't give an accurate picture of how much memory an app is actually using. How can I launch Memory Monitor? I can't find it in instrum...
{ "language": "en", "url": "https://stackoverflow.com/questions/405217", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: What to use for SQL Server instead of "Key"? I have a script of MySQL queries that I use and that work. I'm trying to execute the same queries in Microsoft SQL server and there's one thing I don't understand. MySql uses "key" to define a key made up of different fields. What is the way to do the same thing in SQL Se...
{ "language": "en", "url": "https://stackoverflow.com/questions/405229", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Policy to allow user to enumerate accounts only within his own OU in Active Directory Is it possible to define a policy which restricts a user to enumerate only accounts in his own OU? For example lets consider a domain Contosos and OUs Sales and HR.The Sales OU has two users A and B and the HR OU has users C and D....
{ "language": "en", "url": "https://stackoverflow.com/questions/405230", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }