text
stringlengths
8
267k
meta
dict
Q: Connecting from Linux to Windows to perform a task I've been asked to find a way to connect from a Linux system to one of several Windows servers. What we need to do ideally is connect to whatever Windows server is causing the trouble, kill a process, and restart the process. Ideally, it would be something that co...
{ "language": "en", "url": "https://stackoverflow.com/questions/292016", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Is there a good reason to use upper case for SQL keywords? The default seems to be upper case, but is there really any reason to use upper case for keywords? I started using upper case, because I was just trying to match what SQL Server gives me whenever I tried to create something, like a new stored procedure. But ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292026", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "157" }
Q: ASP.NET Create style of nav menu like windows.com Just noticed that the style of the navigation menu on windows.com is just what i need for my website. I'm wondering how to create that kind of drop down list that has multiple columns. When the mouse hover on each item, the column gives a preview of that item. Thank ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292032", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Is functional programming relevant to web development? I've been seeing so much recently about functional programming and Clojure looks particularly interesting. While I 'understand' the basic description of what it is, I can't figure out how I would use it on a day to day basis as a web developer, if I can at all. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292033", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "90" }
Q: how search for a substring found within a string of text and highlight all of it I'm trying to highlight the search results but I want to include the surrounding text that is limited by the enclosing tags. So if the $term is "cool" the preg_replace should end up with: <div><span style="background: #f00">My hair cut ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292037", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Resources for Database Sharding and Partitioning I'm working with a database schema that is running into scalability issues. One of the tables in the schema has grown to around 10 million rows, and I am exploring sharding and partitioning options to allow this schema to scale to much larger datasets (say, 1 billion...
{ "language": "en", "url": "https://stackoverflow.com/questions/292039", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Custom UITabBarItem Image/Title on iPhone I'd like to add a custom title to one of the predefined UITabBarItems. Whenever I select the particular instance I like in Interface Builder -- if I modify the the title it gets preset back to a 'custom' identifier. Ideally I'd like the book icon from the 'Bookmarks' identif...
{ "language": "en", "url": "https://stackoverflow.com/questions/292041", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Why does Flex let me treat a class as an object This code is blunderous, as it adds a class to an array and later tries to pull it and manipulate it as if it were an object. private function fail(event:Event):void { var myObj:MyClass; var a:ArrayCollection = new ArrayCollection(); var x:MyClass; var ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292066", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Is it better to use ob_get_contents() or $text .= 'test'; I have seen a lot of ob_get_clean() the last while. Typically I have done $test .= 'test' I'm wondering if one is faster and/or better than the other. Here is the code using ob_get_clean(): ob_start(); foreach($items as $item) { echo '<div>' . $item . '<...
{ "language": "en", "url": "https://stackoverflow.com/questions/292068", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: OpenGL: How to implement an "eraser" tool? I'm working on a game for the iPhone that has a drawing/paint mechanic involved and I'm having problems trying to create a tool that would erase things already painted. The main problem is that the background being painted on is not a solid color but a static image or anima...
{ "language": "en", "url": "https://stackoverflow.com/questions/292071", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: ExtJS with Squash Javascript Obfuscator I stumbled upon this javascript obfuscator called Squash, I want to use it on my ExtJS project to obfuscate my javascript files. I've tried it and the result are totally obfuscated codes. But it seems that I have to obfuscate the ExtJS library too because I got warnings that i...
{ "language": "en", "url": "https://stackoverflow.com/questions/292085", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to delete all tables in HTML with JavaScript? How can I delete all the tables in a web page? The tables don't have any ids associated with them. A: Danger! getElementsByTagName returns a ‘live’ NodeList. In Joel's code, removing element 0 moves the items in the list down so that when you remove element 1, you'v...
{ "language": "en", "url": "https://stackoverflow.com/questions/292091", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Polling the keyboard (detect a keypress) in python How can I poll the keyboard from a console python app? Specifically, I would like to do something akin to this in the midst of a lot of other I/O activities (socket selects, serial port access, etc.): while True: # doing amazing pythonic embedded stuff # ......
{ "language": "en", "url": "https://stackoverflow.com/questions/292095", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "77" }
Q: Groovy grep a word I wanted to grep for java process and then find the max heap memory used. I tried this def ex =['sh','-c','ps -aef | grep Xmx'] String str = ex.execute().text while str has something like java -Xmx1024M /kv/classes/bebo/ -Xms512M How do I extract the value 1024M? I was planning to user java rege...
{ "language": "en", "url": "https://stackoverflow.com/questions/292097", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: VB 6: How can I execute a .bat file but wait until its done running before moving on? VB 6: How can I execute a .bat file but wait until its done running before moving on? A: You will need to use Win32 API calls to ShellExecuteEx and WaitForSingleObject on the process handle returned from ShellExecuteEx in the SHEL...
{ "language": "en", "url": "https://stackoverflow.com/questions/292098", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Browser Neutral Way to add options to a select element in javascript I just learned something interesting. The add method for the javascript select object in IE 6 takes only one parameter. It throws an error when you pass it two parameters which I believe is the standard, even as documented on the MSDN site. My ques...
{ "language": "en", "url": "https://stackoverflow.com/questions/292101", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: How can the Eight Commandments of Source Code Control be modernized? How do you update this? I've never seen any current team that actually "checks out" a file. I don't compile, either. These seem to be from before the days of branching. * *You shall check in early and check in often. You anger your coworkers whe...
{ "language": "en", "url": "https://stackoverflow.com/questions/292107", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Outputting to stderr whenever malloc/free is called With Linux/GCC/C++, I'd like to record something to stderr whenever malloc/free/new/delete are called. I'm trying to understand a library's memory allocations, and so I'd like to generate this output while I'm running unit tests. I use valgrind for mem leak detec...
{ "language": "en", "url": "https://stackoverflow.com/questions/292109", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Is there any reason not to make a member function virtual? Is there any real reason not to make a member function virtual in C++? Of course, there's always the performance argument, but that doesn't seem to stick in most situations since the overhead of virtual functions is fairly low. On the other hand, I've been ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292124", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "25" }
Q: Hosting a complex online service I have an idea for a web-based service. The implementation is very complex. There will be very few users, and the traffice will be fairly low, but the server-side code could require a lot of resources. Ideally I'd need to have as much control over the servers as possible. How should ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292127", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Whats the best tutorial / place for learning generics I have a team of junior developers and they want to have better understanding and usages of generics. Anyone recommend good tutorial or articles samples that are good places to start. A: A few links: * *An Introduction to C# Generics *Generics (C# Programmi...
{ "language": "en", "url": "https://stackoverflow.com/questions/292132", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Anyone know whether there is a 5-star rating component on iPhone? In Google groups and some other web sites, there is a 5-star rating component which is pretty neat, such as in this url: http://groups.google.com/group/Google-Picasa-Data-API/browse_thread/thread/b5a346e6429a70a7?hl=en I am wondering whether there is ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292137", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: File Access from Excel COM object fails when run from NT Service on Vista We use COM objects to access excel spreadsheets in an NT service (via the Windows Scripting Host). Prior to Vista, this worked beautifully, but starting with Vista, we receive this error: Microsoft Office Excel cannot access the file 'c:\myfi...
{ "language": "en", "url": "https://stackoverflow.com/questions/292150", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Code snippets for methods in Visual Studio In Visual Studio I can type e.g. for TAB TAB and a code snippet pops in. Are there built-in code snippets for private, public, etc. methods as well? A: Some of the snippets I use, also mentioned at MSDN, follows: * *'#if Creates a #if directive and a #end...
{ "language": "en", "url": "https://stackoverflow.com/questions/292164", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "67" }
Q: excluding characters in \S regex match I have the following regex expression to match html links: <a\s*href=['|"](http:\/\/(.*?)\S['|"]> it kind of works. Except not really. Because it grabs everything after the < a href... and just keeps going. I want to exclude the quote characters from that last \S match. Is the...
{ "language": "en", "url": "https://stackoverflow.com/questions/292167", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What package naming convention do you use for personal/hobby projects in Java? I'm already familiar with the standard Java package naming convention of using a domain name to create a unique package name (i.e. package com.stackoverflow.widgets). However, I've never seen any recommendations for how to choose package ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292169", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "153" }
Q: Contextual code generation in Visual C# 2008? I type ArrayList memberNames = new ArrayList() { "Jim", "John", "George" }; and Visual Studio tells me "ArrayList" cannot be found so I have to manually go to the top of the file and type using System.Collections; Is there a way to get Visual Studio to do this automat...
{ "language": "en", "url": "https://stackoverflow.com/questions/292171", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How can I implement a stack? How can I create a program to convert binary to decimal using a stack in C#? A: Here is a hint, this snippet converts a decimal integer to binary using a Stack, you just have to invert the process :-P int num = 50; Stack<int> stack = new Stack<int>(); while (num ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292173", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: ASP.NET shared hosting provider that allows multiple websites (not just applications)? Most ASP.NET hosts give you a single website in IIS. Then, they let you set subfolders as applications. Are there any shared ASP.NET 3.5 hosts that give you multiple websites with a single account? I have several low traffic web...
{ "language": "en", "url": "https://stackoverflow.com/questions/292180", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Finding Dll Function Parameters How can I find the parameters of an undocumented Dll function? I have searched all over the internet and ended up finding one way: it involves decorated functions. However, I cannot find a way to get those. Any help would be appreciated. A: The only way to do this is by disassemblin...
{ "language": "en", "url": "https://stackoverflow.com/questions/292186", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "23" }
Q: How to find whether the user clicks browser back button or Refresh button I need to find whether the user clicking the browser back button or Refresh button. I need to redirect the page to Error page when he clicks the back or refresh button. How to do this. I need to do this in javascript for my ASP.net page A: Yo...
{ "language": "en", "url": "https://stackoverflow.com/questions/292204", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: How do I create a view with scrolling where the size of a label is unknown? In my iPhone application I have a table view. When user taps any row, information about that element will open. All information comes from an XML file, size unknown; some information may contain images. I tried to do it using a multiline la...
{ "language": "en", "url": "https://stackoverflow.com/questions/292223", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How wrong is it to have a unique and normal index on the same column? I have the following table structure CREATE TABLE `table` ( `id` int(11) NOT NULL auto_increment, `date_expired` datetime NOT NULL, `user_id` int(11) NOT NULL, `foreign_id` int(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `date_expire...
{ "language": "en", "url": "https://stackoverflow.com/questions/292230", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Get Windows Username from WCF server side I'm pretty green with web services and WCF, and I'm using Windows integrated authentication - how do I get the username on the server-side interface? I believe that I'm supposed to implement a custom Behavior, or perhaps something with WCF Sessions? Any clues would be super-...
{ "language": "en", "url": "https://stackoverflow.com/questions/292233", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "21" }
Q: Is there a universal application ID for sending MMS in J2ME? I'm having problems with this. The thing is that when I send an MMS with J2ME to another devices with JSR 205 (two tested: SonyEriccson w610i and Nokia 5300), a receiving icon flashes, but the message is not in the inbox folder. I think this happens becaus...
{ "language": "en", "url": "https://stackoverflow.com/questions/292239", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Vb6 How do I make a Random String of 0-9 and a-z of x characters Trying to create a random string, x characters in length using 0-9 and a-z/A-Z and can't seem to find a good example, any ideas? A: Function RandomString(cb As Integer) As String Randomize Dim rgch As String rgch = "abcdefghijklmnopqrstuv...
{ "language": "en", "url": "https://stackoverflow.com/questions/292254", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: JavaScript for HTML Form I'm a simple soul with simple needs, and I'm trying to configure a form. I detest forms. It needs to have JavaScript to transfer the data, it needs to send an e-mail with the data to an e-mail address, and it needs to redirect visitors to a pdf. CGI has always been confusing to me, and I d...
{ "language": "en", "url": "https://stackoverflow.com/questions/292256", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Javascript invalidated after dom manipulation My page has two components that depend on JavaScript. On the left-hand side, there is attribute-based navigation (abn). And the right-hand side is the Result of the abn. There is an event handler for abn and an event handler for the result (both are on clicks) Whenever t...
{ "language": "en", "url": "https://stackoverflow.com/questions/292257", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: New Cool Features of C# 4.0 What are the coolest new features that you guys are looking for, or that you've heard are releasing in c# 4.0. A: IDynamicObject, the glue behind dynamic, allows interpretation of a call at runtime. This is interesting for inherently untyped scenarios such as REST, XML, COM, DataSet, dyn...
{ "language": "en", "url": "https://stackoverflow.com/questions/292265", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "28" }
Q: What is an existential type? I read through the Wikipedia article Existential types. I gathered that they're called existential types because of the existential operator (∃). I'm not sure what the point of it is, though. What's the difference between T = ∃X { X a; int f(X); } and T = ∀x { X a; int f(X); } ? A: A...
{ "language": "en", "url": "https://stackoverflow.com/questions/292274", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "206" }
Q: keyless ciphers of ROT13/47 ilk Do you know of any other ciphers that performs like the ROT47 family? My major requirement is that it'd be keyless. A: Sounds like you might be looking for some "classical cryptography" solutions. SUBSTITUTION CIPHERS are encodings where one character is substituted with another. E....
{ "language": "en", "url": "https://stackoverflow.com/questions/292276", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Populate JTable from a Hashtable in Java I have a function which gets a key from the user and generates a Hashtable (on a pattern specified by the key). After creating a Hashtable, I would like to populate a JTable so that each each column represents a key and every rows represents the values associated with the key...
{ "language": "en", "url": "https://stackoverflow.com/questions/292279", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How do you get the type of generic argument from the stackframe? We are supposed to instantiate our entities through a factory since they are set up differently on the client and server. I want to make sure this is the case but cant quite get it to work. public interface IEntityFactory { TEntity Create<TEntity>(...
{ "language": "en", "url": "https://stackoverflow.com/questions/292295", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: msbuild: when in the build project is Microsoft.VisualBasic.Targets 'imported' by msbuild? Here's my situation: I'm trying to understand how msbuild works by looking at the build files located in the .NET framework install path: C:\Windows\Microsoft.NET\Framework\v3.5>dir /s/b microsoft* Microsoft.Build.Tasks.v3.5....
{ "language": "en", "url": "https://stackoverflow.com/questions/292298", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Selecting unique elements from a List in C# How do I select the unique elements from the list {0, 1, 2, 2, 2, 3, 4, 4, 5} so that I get {0, 1, 3, 5}, effectively removing all instances of the repeated elements {2, 4}? A: Here is another way that works if you have complex type objects in your List and want to get th...
{ "language": "en", "url": "https://stackoverflow.com/questions/292307", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "27" }
Q: Jquery's Ajax Property For Asp.Net 2.0 I always see the code like this in the blogs: $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebService.asmx/HelloWorld", data: "{}", dataType: "js...
{ "language": "en", "url": "https://stackoverflow.com/questions/292308", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Geographical Data Visualization in a Web Application I've got a request to implement a visualization service for geographical related data. I have a list of Italian ZIP Codes (they are called CAP in Italian). I've already found a table which maps these ZIP codes to geographical coordinates (lat/long). So, the data I...
{ "language": "en", "url": "https://stackoverflow.com/questions/292314", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to handle right to left languages in Flash (pre version 10)? We are currently working with Flex creating a web application. We are having trouble taking Arabic text from the user and displaying correctly (like in a chat feature). While presumably Flash 10 will solve this problem, we don't want to force our users...
{ "language": "en", "url": "https://stackoverflow.com/questions/292316", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Fast Vector rendering library for C or Python I'm looking for a library like Cairo, just far faster. It has to be a library that works with C or Python. It also would be nice if I could output to PNG, and SVG. I am looking at Qt's arthur, but that's C++, and I'm not a fan. Any suggestions? Edit: another preconditio...
{ "language": "en", "url": "https://stackoverflow.com/questions/292324", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Missing "Export Template" option in Visual Studio 2005 I am trying to learn & create Visual Studio templates and as per this MSDN article, The simplest type of template to create is an item template. To do so, simply open a project that includes the file you want to use as a template and then chooses File ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292339", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Basic Syntax and Examples Tutorial At work I work closely with MS-Office. I have managed to generate some scripts that perform various tasks. While I can port functions to VBA with some difficulty, I do not fully understand the foundations of the VBA language. Items for which I seek basic syntax and examples include...
{ "language": "en", "url": "https://stackoverflow.com/questions/292348", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Opening a VS 2003 C++ project in VS 2008 Found some old code, circa VS 2003. Now I have just VS 2008 (SP1) installed. When I try opening the *.sln file, it tries converting the projects. The report notifies me it was done successfully, but the solution is empty, marked with "project file was unloaded". VS 2008 doesn...
{ "language": "en", "url": "https://stackoverflow.com/questions/292350", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: MySQL True vs False optimization Can someone explain to me why I'm seeing the following behavior: mysql> show index from history_historyentry; +----------------------+------------+------------------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+ ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292351", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What is the difference between 'git pull' and 'git fetch'? What are the differences between git pull and git fetch? A: git fetch pulls down the code from the remote server to your tracking branches in your local repository. If your remote is named origin (the default) then these branches will be within origin/, fo...
{ "language": "en", "url": "https://stackoverflow.com/questions/292357", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13537" }
Q: Client Java vs (Adobe) Flash for web applications, what to choose and when A few years ago client Java was unsuitable for web development because a remarkable part of web users did not have Java installed. ( I don't remember exact numbers, more than 10%). Now I see the Google Analytics stats for a big site and it t...
{ "language": "en", "url": "https://stackoverflow.com/questions/292361", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: URL decoding in Javascript I want to decode a string that has been encoded using the java.net.URLEncoder.encode() method. I tried using the unescape() function in javascript, but a problem occurs for blank spaces because java.net.URLEncoder.encode() converts a blank space to '+' but unescape() won't convert '+' to ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292362", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Choosing when to instantiate classes I recently wrote a class for an assignment in which I had to store names in an ArrayList (in java). I initialized the ArrayList as an instance variable private ArrayList<String> names. Later when I checked my work against the solution, I noticed that they had initialized their Ar...
{ "language": "en", "url": "https://stackoverflow.com/questions/292363", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to avoid dependencies between Enum values in code and corresponding values in a database? I have a number of user permissions that are tested throughout my ASP.NET application. These permission values are referenced in an Enum so that I can conveniently test permissions like so: * *btnCreate.Enabled = Permiss...
{ "language": "en", "url": "https://stackoverflow.com/questions/292378", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Extract characters occurring before one of several forbidden characters I want to discard all remaining characters in a string as soon as one of several unwanted characters is encountered. As soon as a blacklisted character is encountered, the string before that point should be returned. For instance, if I have an a...
{ "language": "en", "url": "https://stackoverflow.com/questions/292380", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Best practices for developers in dealing with clients Personally, I've found that when good developers deal with clients, they often get sucked into the after-sales support process and this process has been difficult to reverse, so was just interested to hear the various strategies that developers employ in maintain...
{ "language": "en", "url": "https://stackoverflow.com/questions/292388", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: How to rename existing files using a batch file for backup purpose? pkzip25 -add=all -dir=current -silent -locale -exclude=DistData.zip -exclude=extract.bat -exclude=run.bat -exclude=pkzip25.exe -exclude=extracted.txt -exclude=zipped.txt -exclude=.\STORE DistData.zip *.* pkzip25 -view -directories DistData.zip >zipp...
{ "language": "en", "url": "https://stackoverflow.com/questions/292392", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: PHP Templating I'm writing a simple templating layer in PHP but I've got myself a little stuck. Here's how it works at the moment: Firstly I use fetch_template to load the template contents from the database - this works (and I collect all the templates at startup if you're interested). I use PHP variables in my tem...
{ "language": "en", "url": "https://stackoverflow.com/questions/292395", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Best practice for limiting the number of associations within a has_many relationship? Say that I have two models- Users and Accounts. Each account can have at most n users associated with it, and a user can only be associated with one account. It would seem natural to say that User belongs_to :account and Account...
{ "language": "en", "url": "https://stackoverflow.com/questions/292403", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Optimisation: use local files or databases for HTML This follows on from this question where I was getting a few answers assuming I was using files for storing my HTML templates. Before recently I've always saved 'compiled' templates as html files in a directory (above the root). My templates usually have two types ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292415", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: in jQuery, set spans with same class to display:inline from :block Using jQuery, is there a way to select all tag that reference a specific css class, and set the display to "inline"? example: <span class="theclass">junk</span> <span class="theclass">other junk</span> <span class="theclass">more junk</span> in .css...
{ "language": "en", "url": "https://stackoverflow.com/questions/292419", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Determine if a reflected type can be cast to another reflected type In .net (C#), If you have two types discovered through reflection is it possible to determine if one can be cast to the other? (implicit and/or explicit). What I'm trying to do is create a library that allows users to specify that a property on one ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292437", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Wrapping Visual C++ in C# I need to do some process injection using C++ but I would prefer to use C# for everything other than the low level stuff. I have heard about "function wrapping" and "marshaling" and have done quite a bit of google searching and have found bits of information here and there but I am still re...
{ "language": "en", "url": "https://stackoverflow.com/questions/292450", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Rails non-image file upload to DB without using server-side temp files? I'm looking into the feasibility of adding a function to my Rails-based intranet site that allows users to upload files. Two purposes: My users are widely distributed geographically and linking to documents on the shared network storage doesn't ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292453", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Profiler for Visual Studio 2008, C++? Are there any good, free (or at least reasonably cheap) profilers for at least native C++ that can integrate with Visual Studio 2008 Professional? I looked at DevPartner community edition but they seem to only support Visual Studio 2003 and Visual Studio 2005. Failing that ar...
{ "language": "en", "url": "https://stackoverflow.com/questions/292457", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: Stored Procedures MSSQL2005 If you have a lot of Stored Procedures and you change the name of a column of a table, is there a way to check which Stored Procedures won't work any longer? Update: I've read some of the answers and it's clear to me that there's is no easy way to do this. Would it be easier to move away...
{ "language": "en", "url": "https://stackoverflow.com/questions/292458", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How do you plan an application's architecture before writing any code? One thing I struggle with is planning an application's architecture before writing any code. I don't mean gathering requirements to narrow in on what the application needs to do, but rather effectively thinking about a good way to lay out the ove...
{ "language": "en", "url": "https://stackoverflow.com/questions/292463", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "85" }
Q: What do I need to know to make a Java application that uses a database? Since I've started using NetBeans, I've learned of some powerful ways to abstract away the process of creating Java database applications with automatically generated UI, beans bindings, and a bunch of other stuff I only vaguely understand the w...
{ "language": "en", "url": "https://stackoverflow.com/questions/292464", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: MS Source Server: significance of srcsrv.ini variable The MS source server technology uses an initialization file named srcsrv.ini. One of the values identifies the source server location(s), e.g., MYSERVER=\\machine\foobar The docs leave much unanswered about this value. To start with, I haven't been able to find ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292480", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Finding which part of an ListBox ItemTemplate was double clicked I have a data bound ListBox that uses a custom ItemTemplate to display my stuff. The ItemTemplate has a 4x2 grid that contains different elements. Now I want my users to be able to get at different pieces of data, depending on the subitem they double c...
{ "language": "en", "url": "https://stackoverflow.com/questions/292491", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Regular expression to remove empty tags I would like such empty span tags (filled with &nbsp; and space) to be removed: <span> &nbsp; &nbsp; &nbsp; </span> I've tried with this regex, but it needs adjusting: (<span>(&nbsp;|\s)*</span>) preg_replace('#<span>(&nbsp;|\s)*</span>#si','<\\1>',$encoded); A: Translating...
{ "language": "en", "url": "https://stackoverflow.com/questions/292516", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Converting Console Application to Windows Application in Visual Studio 2008? I found this solution which works, but I find it hard to believe there isn't a one-click solution to this problem. Do you know a better way? A: No, there isn't a "better" way. This is really the only way :) (unless you create your own pro...
{ "language": "en", "url": "https://stackoverflow.com/questions/292521", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: My reCaptcha gets Page.IsValid=False always... when using onClientClick="return validate()" I'm using reCaptcha in my asp.net 2.0 web application. I'm using onClientClick="return validateForm()" on my submit button. validateForm does basic checking and stops the form from getting to the server if not needed... For s...
{ "language": "en", "url": "https://stackoverflow.com/questions/292528", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: LINQ to SQL Designer Bug Every time that I change a value in the designer after saving it, the .designer.cs file will be deleted. Can anyone tell me how can I fix this problem? A: Don't place your own code in the designer file, instead use a separate file leveraging the partial classes concept. A: Move using dire...
{ "language": "en", "url": "https://stackoverflow.com/questions/292535", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: How to recognize a path inside a string Just that... I get a string which contains a path to a file plus some arguments. How can I recognize the path? I thought about the index of the '.' in the file... but I don't like it. What about using regular expressions? Can anyone point me in the right direction? Regards Edi...
{ "language": "en", "url": "https://stackoverflow.com/questions/292544", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How do you build an SWT application with Maven I trying to learn swt, and I use maven for all my builds and eclipse for my IDE. When getting the swt jars out of the maven repository, I get: Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-pi-gtk-3034 in java.library.path at java.lang.ClassLoader...
{ "language": "en", "url": "https://stackoverflow.com/questions/292548", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "25" }
Q: Modifying Excel spreadsheet with .NET Here's the problem: I have to modify an existing Excel spreadsheet using .NET. The spreadsheet is hugely complex, and I just have to add data in some predefined areas. I'm investigating my options, and Excel Automation/InterOp is out of the question, as I'm implementing an ASP....
{ "language": "en", "url": "https://stackoverflow.com/questions/292551", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Extension method instead of Null Object pattern I'm wondering to using extension method to avoid checking for null in hierarchy. The example: // GetItems(), GetFirstOrDefault(), GetProduct(), GetIDProduct() are extension methods like: public static SomeType GetSomeProperty( this XYZ obj ) { if ( object.Reference...
{ "language": "en", "url": "https://stackoverflow.com/questions/292552", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Practical Application of MVC || When to use, or not use MVC I have seen the ASP.NET community buzzing about MVC. I know the basics of its origin, and that there are many sites (unless I am mistaken, stack overflow itself) based on ASP.NET MVC. From everything I have heard and read about MVC it seems to be the futu...
{ "language": "en", "url": "https://stackoverflow.com/questions/292557", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "30" }
Q: How can I draw a concave corner rectangle in WPF? How can I draw a concave corner rectangle in WPF? A: You can create this by Path Operation under Expression blend (Menu - Object-> Path operations) I have created a Path by subtracting four ellipse against a rectangle. the Path.Data for a concave rectangle is given ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292558", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Can I run SSIS packages with SQL Server Express or Web or Workgroup editions? I have looked at the SQL Server 2008 feature comparison matrix and it lists the express/web and workgroup editions as having the SSIS runtime. Does this mean it is possible to develop SSIS packages using the developer edition, and then dep...
{ "language": "en", "url": "https://stackoverflow.com/questions/292564", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "19" }
Q: Browser application & local file system access I want to enhance my browser-based web application with functionality that enables management of local files and folders. E.g. folder tree structures should be synchronized between local workstation and server via HTTP(S). I am aware of security-related limitations in b...
{ "language": "en", "url": "https://stackoverflow.com/questions/292566", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: How to save and load different types of objects? During coding I frequently encounter this situation: * *I have several objects (ConcreteType1, ConcreteType2, ...) with the same base type AbstractType, which has abstract methods save and load . Each object can (and has to) save some specific kind of data, by over...
{ "language": "en", "url": "https://stackoverflow.com/questions/292574", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Best practices for allowing users to choose a display name on a social networking website? I run a social networking / blogging website ( http://www.obsidianportal.com ), and currently the users are identified by their unique (and unchangeable) username everywhere. Many have requested the ability to have a display ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292584", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Interacting with UI threads in Java/J2ME I'm writing a J2ME application. One of the pieces is something that polls the contents of a directory periodically, and, if there are any new things, paints them on the screen. I've done this by having the UI form launch a polling thread with a pointer back to itself, and w...
{ "language": "en", "url": "https://stackoverflow.com/questions/292587", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: IDynamicObject implementation ignores multiple property invocations I've implemented IDynamicObject in C# 4, return a custom MetaObject subclass that does simple property getter/setter dispatch to a Dictionary. Not rocket science. If I do this: dynamic foo = new DynamicFoo(); foo.Name = "Joe"; foo.Name = "Fred"; ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292602", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Web technology for a first small web project I'm a C++ developer with basic Python skills. Here's the task, a friend of mine is running a small company and he asked me if I can make a website for him. I have no real deadline so I think it's a perfect opportunity to try sth new and do some web development. User has t...
{ "language": "en", "url": "https://stackoverflow.com/questions/292607", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Microsoft MIDL does not report an error if a typedef uses an unknown type, is it a bug? I would like to know whether I am missing something: //this is test.idl typedef foo foo_t; // end of test.idl When I compile test.idl with the following command: midl /W4 test.idl I get this output Microsoft (R) 32b/64b MIDL Co...
{ "language": "en", "url": "https://stackoverflow.com/questions/292610", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How can I set the value of a DropDownList using jQuery? As the question says, how do I set the value of a DropDownList control using jQuery? A: If your dropdown is Asp.Net drop down then below code will work fine, $("#<%=DropDownName.ClientID%>")[0].selectedIndex=0; But if your DropDown is HTML drop down then thi...
{ "language": "en", "url": "https://stackoverflow.com/questions/292615", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "378" }
Q: PHP MYSQL - Many data in one column I need to store of 100-200 data in mysql, the data which would be separated by pipes.. any idea how to store it on mysql? should I use a single column or should I make many multiple columns? I don't know exactly how many data users will input. I made a form, it halted at the part...
{ "language": "en", "url": "https://stackoverflow.com/questions/292618", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: jQuery Draggable Error: Object doesn't support this property or method I am trying to add a draggable object to to a simple html page. IE gives: Object doesn't support this property or method FF gives: jQuery(".dragthis").draggable is not a function Using latest jquery unpacked. Here is the code: <html> <head> ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292635", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Print Stylesheets for pages with long horizontal tables I have a page that spits out db data in long horizontal tables. I need to print it nicely so it does not cut off. Any tips ? A: * *Change table into horizontal one with many rows (swap rows/columns) *Suggest users to switch to Landscape mode. AFAIK there's ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292642", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Identifying list item index - which is a better approach? I need to pick up list items from an list, and then perform operations like adding event handlers on them. I can think of two ways of doing this. HTML: <ul id="list"> <li id="listItem-0"> first item </li> <li id="listItem-1"> second item </l...
{ "language": "en", "url": "https://stackoverflow.com/questions/292646", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: SQL - How to make a conditional INSERT Using only MySQL, I'm seeing if it's possible run an insert statement ONLY if the table is new. I successfully created a user variable to see if the table exists. The problem is that you can't use "WHERE" along with an insert statement. Any ideas on how to get this working? // ...
{ "language": "en", "url": "https://stackoverflow.com/questions/292660", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Changing item in foreach thru method Let's start with the following snippet: Foreach(Record item in RecordList){ .. item = UpdateRecord(item, 5); .. } The UpdateRecode function changes some field of item and returns the altered object. In this case the compiler throws an exception saying that the item can not...
{ "language": "en", "url": "https://stackoverflow.com/questions/292667", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Is there a workaround for overloading the assignment operator in C#? Unlike C++, in C# you can't overload the assignment operator. I'm doing a custom Number class for arithmetic operations with very large numbers and I want it to have the look-and-feel of the built-in numerical types like int, decimal, etc. I've ov...
{ "language": "en", "url": "https://stackoverflow.com/questions/292676", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "34" }