text
stringlengths
8
267k
meta
dict
Q: How do I programmatically use the "using" keyword in C#? I have some System.Diagnotics.Processes to run. I'd like to call the close method on them automatically. Apparently the "using" keyword does this for me. Is this the way to use the using keyword? foreach(string command in S) // command is something like "c:\...
{ "language": "en", "url": "https://stackoverflow.com/questions/185381", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Order of static constructors/initializers in C# While working on a C# app I just noticed that in several places static initializers have dependencies on each other like this: static private List<int> a = new List<int>() { 0 }; static private List<int> b = new List<int>() { a[0] }; Without doing anything special tha...
{ "language": "en", "url": "https://stackoverflow.com/questions/185384", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "27" }
Q: MVC model structure in Python I'm having problems structuring classes in the Model part of an MVC pattern in my Python app. No matter how I turn things, I keep running into circular imports. Here's what I have: Model/__init__p.y * *should hold all Model class names so I can do a "from Model import User" e.g. from...
{ "language": "en", "url": "https://stackoverflow.com/questions/185389", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: ASP.NET: Open File From URL In ASP.NET, I have an XML file (within my project) that I would like to deserialize. FileStream objects do not allow you to open a file via URL. What is the easiest way to open the file so that I can deserialize it? A: If the file is within your project you just need to get the physi...
{ "language": "en", "url": "https://stackoverflow.com/questions/185391", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Issues with client consuming a .net web service upgraded from .NET 1.1 to 3.5 I am working on a web application that was recently converted from Visual Studio 2003 to Visual Studio 2008. The application contained some web services that were written using the .NET 1.1 Framework and Web Service Enhancements 2.0. The...
{ "language": "en", "url": "https://stackoverflow.com/questions/185420", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How can I open a link in the default web browser from an HTA? I'm working on an application that is implemented as an HTA. I have a series of links that I would like to have open in the system's default web browser. Using <a href="url" target="_blank"> opens the link in IE regardless of the default browser. Is there...
{ "language": "en", "url": "https://stackoverflow.com/questions/185423", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: How to use JSON to create object that Inherits from Object Type? I know how to use JSON to create objects, but there doesn't seem to be away to use JSON to create an object that is of a specific object type. Here's an example of an Object and creating an instance of it: Person = function() { }; Person.prototype = { ...
{ "language": "en", "url": "https://stackoverflow.com/questions/185429", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: Why is Eclipse deleting my files and putting them in 'Local History'! Several times now I've had Eclipse delete files for me seemingly randomly - then they appear under the 'Local History' option. What is going on! I'm definitely not just deleting things by mistake. Most recently it deleted my template files under ...
{ "language": "en", "url": "https://stackoverflow.com/questions/185442", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Why is MPI considered harder than shared memory and Erlang considered easier, when they are both message-passing? There's a lot of interest these days in Erlang as a language for writing parallel programs on multicore. I've heard people argue that Erlang's message-passing model is easier to program than the dominant...
{ "language": "en", "url": "https://stackoverflow.com/questions/185444", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "34" }
Q: FileLoadException on windows 2003 for managed c++ dll My company has login integration with GroupWise, and Exchange 5.5/2000+. The Exchange 5.5/GroupWise logic is done using wldap32.dll (win32), and so the login code is in a managed c++ class. When the configuration tool (or the backend service) tries to load the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/185445", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Should I just move the file or create a class which moves it? Okay, I got this small program which tags (as in ID3v2.4 etc.) some music files. Now I want the user to have the option to move and/or rename those tagged files if he/she wishes to. Considering that I am trying to keep a fairly clean and loosely coupled d...
{ "language": "en", "url": "https://stackoverflow.com/questions/185447", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Would you consider this a singleton/singleton pattern? Imagine in the Global.asax.cs file I had an instance class as a private field. Let's say like this: private MyClass _myClass = new MyClass(); And I had a static method on Global called GetMyClass() that gets the current HttpApplication and returns that instance...
{ "language": "en", "url": "https://stackoverflow.com/questions/185448", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Quick-and-dirty way to ensure only one instance of a shell script is running at a time What's a quick-and-dirty way to make sure that only one instance of a shell script is running at a given time? A: Here's an approach that combines atomic directory locking with a check for stale lock via PID and restart if stale....
{ "language": "en", "url": "https://stackoverflow.com/questions/185451", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "205" }
Q: Reading input m-file in a main m-file I would like MATLAB to tell me if I have an input file (.m file) that contains some variables with their numbers (i.e., a = 5, b = 6, c = 7) so that I can then use that .m file in another program (main .m file) that uses these variables to calculate S = a + b + c. How can I then...
{ "language": "en", "url": "https://stackoverflow.com/questions/185461", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: What's the best way to handle landscape/portrait differences in IB? I have a view that supports landscape and portrait viewing, with the controls all moving around when you switch from one to the other. I'm currently doing this by setting the .center of each one of my controls when the user rotates the phone. The pr...
{ "language": "en", "url": "https://stackoverflow.com/questions/185463", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: C# Retrieving correct DbConnection object by connection string I have a connection string being passed to a function, and I need to create a DbConnection based object (i.e. SQLConnection, OracleConnection, OLEDbConnection etc) based on this string. Is there any inbuilt functionality to do this, or any 3rd party lib...
{ "language": "en", "url": "https://stackoverflow.com/questions/185474", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "23" }
Q: Determine if swf is in a "debug" player or mode Is there a way using Flash (CS3+AS3) to determine if the published swf is running in a debug player or in Flash's debug mode? I'm aware that Flex provides the ability to setup different build targets (release/debug) and that you can use something like CONFIG::debug for...
{ "language": "en", "url": "https://stackoverflow.com/questions/185477", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: AIR Caching framework/library Anyone know of a good memory/disk caching library for AIR? Extra points for being compatible with Flash CS3, and being free (as in beer). I'd like to cache results of http requests: both binary and text (xml). A: The bulk-loader project might have what you're looking for. I haven't use...
{ "language": "en", "url": "https://stackoverflow.com/questions/185479", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Prevent direct access to a PHP page How do I prevent my users from accessing directly pages meant for ajax calls only? Passing a key during ajax call seems like a solution, whereas access without the key will not be processed. But it is also easy to fabricate the key, no? Curse of View Source... p/s: Using Apache as...
{ "language": "en", "url": "https://stackoverflow.com/questions/185483", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: Which Eclipse Subversion plugin should I use? Subclipse, Subversive, or something else? There's a bit of debate around the topic, can we come to some conclusion here? EDIT: It's been a couple months now, and I ended up deciding the plugin slowed Eclipse down too much, and was a hassle to use every time I changed a f...
{ "language": "en", "url": "https://stackoverflow.com/questions/185486", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "53" }
Q: Return values from different tables based on a priority Assuming I have three tables : TableA (key, value) TableB (key, value) TableC (key, value) and I want to return a value for all keys. If the key exists in TableC return that value else if the key exists in B return that value else return the value from table A ...
{ "language": "en", "url": "https://stackoverflow.com/questions/185487", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How can I concatenate regex literals in JavaScript? Is it possible to do something like this? var pattern = /some regex segment/ + /* comment here */ /another segment/; Or do I have to use new RegExp() syntax and concatenate a string? I'd prefer to use the literal as the code is both more self-evident and conci...
{ "language": "en", "url": "https://stackoverflow.com/questions/185510", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "180" }
Q: Convert Month Number to Month Name Function in SQL I have months stored in SQL Server as 1,2,3,4,...12. I would like to display them as January,February etc. Is there a function in SQL Server like MonthName(1) = January? I am trying to avoid a CASE statement, if possible. A: You can use the inbuilt CONVERT functio...
{ "language": "en", "url": "https://stackoverflow.com/questions/185520", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "241" }
Q: What other objects are accessible inside <%# %> tags in aspx? I run into similar codes like this all the time in aspx pages: <asp:CheckBox Runat="server" ID="myid" Checked='<%# DataBinder.Eval(Container.DataItem, "column").Equals(1) %>'> I was wondering what other objects I have access to inside of that <%# %> tag....
{ "language": "en", "url": "https://stackoverflow.com/questions/185521", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Actionscript3 E4X XML and CSS: Do I really have to use CDATA? When working with CSS inside of XML such as <span class="IwuvAS3"></span> when parsed in flash, if I don't use CDATA like the following: <![CDATA[<span class="IwuvAS3"></span>]]> then the parsed data drops down a line for every "<" character it sees. Wh...
{ "language": "en", "url": "https://stackoverflow.com/questions/185522", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Generate View for iPhone application using interface builder.? I wanted to generate one fix view using interface builder, but the size of that view is exceeding the size of iphone screen,and I am not able to maximize screen. I wanted to show table view in that screen. I did enabled scrolling but that didn't work, Up...
{ "language": "en", "url": "https://stackoverflow.com/questions/185523", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-1" }
Q: Building MFC Automation example (to access Excel using OLE automation). Can't compile I'm trying to build the example described at http://support.microsoft.com/kb/178749/EN-US/ in order to build an application that programatically accesses Excel using Automation. I have Visual C++ 2005/Visual Studio 2005. Some of...
{ "language": "en", "url": "https://stackoverflow.com/questions/185524", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Java: AWT on Solaris How is AWT implemented for Solaris? ie: What native libraries, if any, is it dependent on? A: For Sun JRE: Old school MToolkit use Motify. From 1.5 I think, there is XToolkit which just use xlib. From memory Solaris kept the MToolkit as the default longer than on Linux. It's switchable with the...
{ "language": "en", "url": "https://stackoverflow.com/questions/185531", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-3" }
Q: How does the DropBox Mac client work? I've been looking at the DropBox Mac client and I'm currently researching implementing a similar interface for a different service. How exactly do they interface with finder like this? I highly doubt these objects represented in the folder are actual documents downloaded on ev...
{ "language": "en", "url": "https://stackoverflow.com/questions/185533", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Largest Heap used in a managed environment? (.net/java) What is the largest heap you have personally used in a managed environment such as Java or .NET? What were some of the performance issues you ran into, and did you end up getting a diminishing returns the larger the heap was? A: I work on a 64-bit .Net syste...
{ "language": "en", "url": "https://stackoverflow.com/questions/185535", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: In openGL, how can you get items to draw back to front? By default it seems that objects are drawn front to back. I am drawing a 2-D UI object and would like to create it back to front. For example I could create a white square first then create a slightly smaller black square on top of it thus creating a black pan...
{ "language": "en", "url": "https://stackoverflow.com/questions/185536", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: .NET logging framework In java world you have log4j and a a pretty decent logging framework, is there anything like that for C#/.NET? A: If you are looking for a simple non-bloat solution (the download is only about 100K and the actual dll about 40K), I've successfully used BitFactory on a number of projects. It's ...
{ "language": "en", "url": "https://stackoverflow.com/questions/185542", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "24" }
Q: Remove domain information from login id in C# I would like to remove the domain/computer information from a login id in C#. So, I would like to make either "Domain\me" or "Domain\me" just "me". I could always check for the existence of either, and use that as the index to start the substring...but I am looking for...
{ "language": "en", "url": "https://stackoverflow.com/questions/185559", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "22" }
Q: Updating OpenLDAP using a Java class I need to be able to update an attribute on OpenLDAP using a Java class. I've taken a stab at creating an LDAP entry, but it looks like a Java object instead of a proper LDAP entry. (Grrrr) import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.Nami...
{ "language": "en", "url": "https://stackoverflow.com/questions/185563", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Fetching Minimum/Maximum for each group in ActiveRecord This is an age-old question where given a table with attributes 'type', 'variety' and 'price', that you fetch the record with the minimum price for each type there is. In SQL, we can do this by: select f.type, f.variety, f.price from ( select type, min(pric...
{ "language": "en", "url": "https://stackoverflow.com/questions/185569", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: What is mattr_accessor in a Rails module? I couldn't really find this in Rails documentation but it seems like 'mattr_accessor' is the Module corollary for 'attr_accessor' (getter & setter) in a normal Ruby class. Eg. in a class class User attr_accessor :name def set_fullname @name = "#{self.first_name} #{s...
{ "language": "en", "url": "https://stackoverflow.com/questions/185573", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "118" }
Q: Powershell equivalent of bash ampersand (&) for forking/running background processes In bash the ampersand (&) can be used to run a command in the background and return interactive control to the user before the command has finished running. Is there an equivalent method of doing this in Powershell? Example of usage...
{ "language": "en", "url": "https://stackoverflow.com/questions/185575", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "216" }
Q: Dynamic (?) parser Does there exist a parser that generates an AST/parse tree at runtime? Kind of like a library that would accept a string of EBNF grammar or something analogous and spit out a data structure? * *I'm aware of antlr, jlex and their ilk. They generate source code which could do this. (like to skip...
{ "language": "en", "url": "https://stackoverflow.com/questions/185584", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Understanding the "cannot find symbol" error What is this error? cannot find symbol, symbol: method getstring(java.lang.String) Location: class InternalFrameDemo if <!windowTitleField.getText().equals(getstring("InternalFrameDemo.frame_label"))) A: it means that the class InternalFrameDemo has no getstring() me...
{ "language": "en", "url": "https://stackoverflow.com/questions/185591", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Java Generics Syntax for arrays What data structure does the following declaration specify? List<ArrayList>[] myArray; I think it should declare an array where each element is a List (e.g., a LinkedList or an ArrayList) and require that each List contain ArrayList objects. My reasoning: List<String> someList; ...
{ "language": "en", "url": "https://stackoverflow.com/questions/185594", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: how to structure data for searchability I am writing a search application specifically for music playlists. The genre and file format differs from playlist to playlist, and sometimes within the playlist there are differences too. There is also a concept of "synonymous" tags (e.g. urban would cover both hiphop and r...
{ "language": "en", "url": "https://stackoverflow.com/questions/185597", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Insert array into database in a single row I wonder if this would be doable ? To insert an array into one field in the database. For instance I have a title, I want to have that title with only one id, but it's going to be bilingually used on the website. It feels a bit unnecessary to make another table to have thei...
{ "language": "en", "url": "https://stackoverflow.com/questions/185606", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: page Preinit, Init, load I am having a doubt in page_init, page preinit, load. I need to know when we use this also where we need to call our objects in different stages of our life cycle. Please let me know how they will process for each events raised A: Its called the Page lifecycle because at different stages of...
{ "language": "en", "url": "https://stackoverflow.com/questions/185609", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: SharePoint and Enterprise Library 4.0 Has anybody been successful in integrating the Enterprise Library v4.0 with SharePoint WSS 3.0? I created a very simple .ASPX page. It's only purpose will to be to connect to an Oracle database and display some values in a DropDownList. But right now, all it does is displays ...
{ "language": "en", "url": "https://stackoverflow.com/questions/185621", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: static variables in an inlined function I have a function that is declared and defined in a header file. This is a problem all by itself. When that function is not inlined, every translation unit that uses that header gets a copy of the function, and when they are linked together there are duplicated. I "fixed" that...
{ "language": "en", "url": "https://stackoverflow.com/questions/185624", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "97" }
Q: Query Analyzer VS. Query Profiler Reads, Writes, and Duration Discrepencies I'm using MS Sql Server 2000, and for many queries when I run a query in Query Analyzer, with the statistics turned on, the numbers reported in the statistics tab are extremely different from the values shown in the Query Profiler. When the...
{ "language": "en", "url": "https://stackoverflow.com/questions/185634", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Optimizations for a Write heavy Oracle application? What are some useful Oracle optimizations one can use for an Application that mostly writes (updates) to an Oracle database? The general usage pattern here is not web-serving or logging, as is most cases, but instead to persist complex state of a system, so the on...
{ "language": "en", "url": "https://stackoverflow.com/questions/185638", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Dispose of Image in WPF in Listbox (memory leak) I have a ListBox with a bunch of images in it (done through a datatemplate). The images are created by setting the items source: <Image x:Name="ItemImage" Source="{Binding ImageUrl}"/> and then they are cleared by using the listbox's Items.Clear() method. New Imag...
{ "language": "en", "url": "https://stackoverflow.com/questions/185648", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How to scale a UIImageView proportionally? I have a UIImageView and the objective is to scale it down proportionally by giving it either a height or width. UIImage *image = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://farm4.static.flickr.com/3092/2915896504_a88b69c9de.jp...
{ "language": "en", "url": "https://stackoverflow.com/questions/185652", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "347" }
Q: RFC timestamp in Flash/AS3 I'd like to know if Flash/AS3 has any nice way to convert an AS3 'Date' object to/from rfc-850 timestamp format (as used by HTTP date and last-modified). This question is very similar to this question about rfc 3339, except it's specific to AS3 and rfc-850. RFC-850 is like: Thu, 09 Oct 200...
{ "language": "en", "url": "https://stackoverflow.com/questions/185661", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Templated ASP.NET user control I'm trying to create a user control that allows users to make something like the following: <uc1:MyControl id="controlThing" runat="server"> <uc1:BoundColumn id="column1" Column="Name" runat="server" /> <uc1:CheckBoxBoundColumn id="column2" Column="Selector" runat="server" /...
{ "language": "en", "url": "https://stackoverflow.com/questions/185664", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do I sync application data between an iPhone and another computer? I'm working on an iPhone application that would allow viewing and editing of data that I want to keep in sync with a desktop application. I don't see anything in the SDK that directly addresses data synchronization, nor can I find anything that a...
{ "language": "en", "url": "https://stackoverflow.com/questions/185673", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: User Persistence: asp.net caching: I'm working with caching and persistence for the first time. I have a user object that handles all my user data. Persisting this from page to page I'm planning on using a cookie with a token that then returns the user-object from the cache. What's the best way to implement this. T...
{ "language": "en", "url": "https://stackoverflow.com/questions/185679", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Javascript nested class How do I define nested class in Java Script. Here is the code snippet I have: objA = new TestA(); function TestB () { this.testPrint = function () { print ( " Inside testPrint " ); } } function TestA () { var myObjB = new TestB(); } Now I am trying to access testPrint using...
{ "language": "en", "url": "https://stackoverflow.com/questions/185680", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How to parse the DOM and determine what row is selected in an ASP.NET ListView How to parse the DOM and determine what row is selected in an ASP.NET ListView? I'm able to interact with the DOM via the HtmlElement in Silverlight, but I have not been able to locate a property indicating the row is selected. For refere...
{ "language": "en", "url": "https://stackoverflow.com/questions/185681", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to inflate a file with zlib.NET? I'm using the zlib.NET library to try and inflate files that are compressed by zlib (on a Linux box, perhaps). Here's what I'm doing: zlib.ZInputStream zinput = new zlib.ZInputStream(File.Open(path, FileMode.Open, FileAccess.Read)); while (stopByte != (data = zinput.ReadByt...
{ "language": "en", "url": "https://stackoverflow.com/questions/185690", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: SVN client on windows without administrator rights I am trying to install an svn client on a friend's work windows laptop without much success. It seems that everyone is using TortoiseSVN nowadays, which unfortunately doesn't install without administrator access. Is there any way around it or another client I can tr...
{ "language": "en", "url": "https://stackoverflow.com/questions/185693", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "29" }
Q: The Most Efficient Way To Find Top K Frequent Words In A Big Word Sequence Input: A positive integer K and a big text. The text can actually be viewed as word sequence. So we don't have to worry about how to break down it into word sequence. Output: The most frequent K words in the text. My thinking is like this. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/185697", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "91" }
Q: How do I copy files using Windows Batch? I have a directory with several subdirectories with files. How can I copy all files in the subdirectories to a new location? Edit: I do not want to copy the directories, just the files... As this is still on XP, I chose the below solution: for /D %S IN ("src\*.*") DO @COPY ...
{ "language": "en", "url": "https://stackoverflow.com/questions/185698", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Winform Caching Is there a Winform caching library out there? I need to pass a few datasets aroung in a Winform Application, and probably persist to storage upon close. I've seen some samples around via Google, using System.Web. What's the recommendation and where can I get some details. I am using VS 2008 for 2.0. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/185706", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: IE Chopping off left of DIV In IE6 the left of the #right-content DIV is cut off. I've been playing with it and can't get it to display properly. http://philzit.com/services A: The cause is the -60px margin on the #right-content div. You can try adding position:realtive zoom:1 As these often solve these kinds of ...
{ "language": "en", "url": "https://stackoverflow.com/questions/185709", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Would you architect the control API of the next-gen Mars rover to be RESTful instead of an RPC? Forgive me if this verges on being a "discussion" question, but I really would appreciate a yes/no answer, with an appropriate explanation. Suppose you have to design and implement a control API for a robot, say the ne...
{ "language": "en", "url": "https://stackoverflow.com/questions/185740", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Is BitmapSource the only type can be used in Image Source? We can use Bitmapsource object as the content of a Image control, However if I only have Bitmap object, can I use it directly, if I convert Bitmap to Bitmapsouce using the following method: Bitmap bitmap = imageObjToBeConvert; IntPtr HBitmap ...
{ "language": "en", "url": "https://stackoverflow.com/questions/185741", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How can I turn an int into three bytes in Java? I am trying to convert an int into three bytes representing that int (big endian). I'm sure it has something to do with bit-wise and and bit shifting. But I have no idea how to go about doing it. For example: int myInt; // some code byte b1, b2 , b3; // b1 is most s...
{ "language": "en", "url": "https://stackoverflow.com/questions/185747", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Access HTTP response headers in for flash.net.URLLoader object? Is there a way to access the response headers from an HTTP result when using Flash/Flex's URLLoader? Setting the request headers is possible, as is accessing the response code, but getting a hold of the actual response headers seems to be conspicuously ...
{ "language": "en", "url": "https://stackoverflow.com/questions/185761", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: How to get proper line number when using trigger_error in PHP? I am using trigger_error to "throw" errors in a custom class. My problem is that trigger_error prints out the line number where trigger_error was called. For example, given the following code: 01 <?php 02 class Test { 03 function doA...
{ "language": "en", "url": "https://stackoverflow.com/questions/185778", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Modifying NSDate to represent 1 month from today I'm adding repeating events to a Cocoa app I'm working on. I have repeat every day and week fine because I can define these mathematically (3600*24*7 = 1 week). I use the following code to modify the date: [NSDate dateWithTimeIntervalSinceNow:(3600*24*7*(weeks))] I k...
{ "language": "en", "url": "https://stackoverflow.com/questions/185780", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: Finding the LCM of a range of numbers I read an interesting DailyWTF post today, "Out of All The Possible Answers..." and it interested me enough to dig up the original forum post where it was submitted. This got me thinking how I would solve this interesting problem - the original question is posed on Project Euler...
{ "language": "en", "url": "https://stackoverflow.com/questions/185781", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "21" }
Q: Apache: Caching a DEFLATE'd file It seems redundant to have zlib compress a web page during every request. It is also the bottleneck of my files' response times. Is there a way to cache the zlib'd file so that it is compressed only once at each modification? Or should I just keep wishing? A: If you want a quick and...
{ "language": "en", "url": "https://stackoverflow.com/questions/185782", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How can I make the Visual Studio debugger stop breaking at data breakpoints which are set to run a macro and continue? I'm running into an odd problem with Visual Studio 2005: I have a data breakpoint that's set to run a macro and continue (that is, I select a macro and check Continue Execution.) Now, instead of sil...
{ "language": "en", "url": "https://stackoverflow.com/questions/185797", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to control the font DPI in .NET WinForms app I created an app for a small business. Some of the employees in the office can not see the form correctly. The reason is they have their DPI setting set to above 96dpi. Does anybody know of a way to control this? For all of you who have experience with winforms apps...
{ "language": "en", "url": "https://stackoverflow.com/questions/185804", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "38" }
Q: What, exactly, distinguishes between private and protected (in Flex)? In Flex (and many other languages) a function/method of a class can be declared private or protected (or public). What's the difference? I have the impression it has something to do with the relationship to child classes and how things are inherit...
{ "language": "en", "url": "https://stackoverflow.com/questions/185825", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Equivalent of Class Loaders in .NET Does anyone know if it possible to define the equivalent of a "java custom class loader" in .NET? To give a little background: I am in the process of developing a new programming language that targets the CLR, called "Liberty". One of the features of the language is its ability to...
{ "language": "en", "url": "https://stackoverflow.com/questions/185836", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "44" }
Q: How to Write a "Fake" ListBox I use ListBox to show Images. However I found if the Listbox contain more than 1000 Image Items, It is really slow if I want to zoom the thumbnails. I asked the qestion in In a WPF ListBox with more than 1000 Image Items the Zoom Images become slow And tried lots of method, however I ca...
{ "language": "en", "url": "https://stackoverflow.com/questions/185842", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to initialize private static members in C++? What is the best way to initialize a private, static data member in C++? I tried this in my header file, but it gives me weird linker errors: class foo { private: static int i; }; int foo::i = 0; I'm guessing this is because I can't initialize a private...
{ "language": "en", "url": "https://stackoverflow.com/questions/185844", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "613" }
Q: New project: I am having troubles picking a language to use I am starting my first independent for profit venture. I am having a hard time deciding what language to use. I want to write my app in Perl, but I don't think it will be simple enough to compile. If I don't write it in Perl I will write it in C++. The appl...
{ "language": "en", "url": "https://stackoverflow.com/questions/185862", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: MySQL 5 (32bits) on Windows 2008 server As above, anyone tried that before on Windows 2008 server? If yes, how is everything go? Stable enough for production use? A: I've successfully (as in no problems with the default install and operate) done the following several times: Transferred a major application built on ...
{ "language": "en", "url": "https://stackoverflow.com/questions/185878", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Qt: difference between moc output in debug and release? Using the Qt Visual studio integration, adding a new Qt class adds two separate moc.exe generated files - one for debug and one for release (and one for any other configuration currently existing). Yet the two eventual generated files seem to be identical. On t...
{ "language": "en", "url": "https://stackoverflow.com/questions/185883", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How do I analyze a .hprof file? I have a production server running with the following flag: -XX:+HeapDumpOnOutOfMemoryError Last night it generated a java-38942.hprof file when our server encountered a heap error. It turns out that the developers of the system knew of the flag but no way to get any useful informatio...
{ "language": "en", "url": "https://stackoverflow.com/questions/185893", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "262" }
Q: Deleting Visual Studio binary output folders automatically? I just got through manually removing the bin\ and obj\ folders from around 30 VS projects getting them ready for an initial SVN commit. Yeah, I know, I should have done it alot sooner, but these are personal project on my home PC, and I only installed a SVN...
{ "language": "en", "url": "https://stackoverflow.com/questions/185896", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Localization / internationalization tool I'm looking to add localization to a web site (asp.net /c# if that makes a difference) with a minimum of effort. I've looked at tools like wiztom multilizer and I am curious as to others experience with them. Have you used tools like these successfully and if so, what would ...
{ "language": "en", "url": "https://stackoverflow.com/questions/185898", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: What is the difference between a symbolic link and a hard link? Recently I was asked this during a job interview. I was honest and said I knew how a symbolic link behaves and how to create one, but do not understand the use of a hard link and how it differs from a symbolic one. A: Underneath the file system, files ...
{ "language": "en", "url": "https://stackoverflow.com/questions/185899", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1003" }
Q: WeakReference and event handling Is it a good practice to implement event handling through WeakReference if that event is the only thing holding the reference and that we would need the object to be garbage collected? As an argument to this: Folks say that if you subscribe to something it’s your responsibility ...
{ "language": "en", "url": "https://stackoverflow.com/questions/185931", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "33" }
Q: How do I create a copy of an object in PHP? It appears that in PHP objects are passed by reference. Even assignment operators do not appear to be creating a copy of the Object. Here's a simple, contrived proof: <?php class A { public $b; } function set_b($obj) { $obj->b = "after"; } $a = new A(); $a->b = "be...
{ "language": "en", "url": "https://stackoverflow.com/questions/185934", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "200" }
Q: How to delete the contents of a folder? How can I delete the contents of a local folder in Python? The current project is for Windows, but I would like to see *nix also. A: You might be better off using os.walk() for this. os.listdir() doesn't distinguish files from directories and you will quickly get into trouble...
{ "language": "en", "url": "https://stackoverflow.com/questions/185936", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "761" }
Q: Overriding the java equals() method - not working? I ran into an interesting (and very frustrating) issue with the equals() method today which caused what I thought to be a well tested class to crash and cause a bug that took me a very long time to track down. Just for completeness, I wasn't using an IDE or debugge...
{ "language": "en", "url": "https://stackoverflow.com/questions/185937", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "152" }
Q: Ruby: define_method vs. def As a programming exercise, I've written a Ruby snippet that creates a class, instantiates two objects from that class, monkeypatches one object, and relies on method_missing to monkeypatch the other one. Here's the deal. This works as intended: class Monkey def chatter puts "I am ...
{ "language": "en", "url": "https://stackoverflow.com/questions/185947", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "66" }
Q: How Do I Detect the Adobe Acrobat Version Installed in Firefox via JavaScript I know this can be done in IE by creating an ActiveX object, but how do I do it in FF. The navigator.plugins['Adobe Acrobat'] object lets me know if it's installed or not, but it doesn't contain the version number. Any ideas? A: http://ww...
{ "language": "en", "url": "https://stackoverflow.com/questions/185952", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Can I pass a sharepoint security context value to a reporting services report parameter? I'm considering using reporting services 05 SP2 with share point integration on a new reporting project. In this project's reports users can only see records they own. I was thinking a simple userId parameter on the report woul...
{ "language": "en", "url": "https://stackoverflow.com/questions/185953", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do I send an alert to a blackberry from an Excel 2007 spreadsheet? I've been asked to find a way to send an alert to a blackberry when certain conditions are met on an Excel 2007 spreadsheet. The alert can be an SMS (preferred) or an email. The cell values are changing throughout the day from a DDE feed. What ar...
{ "language": "en", "url": "https://stackoverflow.com/questions/185962", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Rails: How to change the title of a page? What is the best way to create a custom title for pages in a Rails app without using a plug-in? A: Without further details on the use-case or requirements that you're trying to satisfy, I can think of several alternatives: 1) Switch the title in one of your layout pages and...
{ "language": "en", "url": "https://stackoverflow.com/questions/185965", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "173" }
Q: How to select a range of elements in jQuery <div id="myDiv"> <a>...</a> <a>...</a> <a>...</a> <a>...</a> <a>...</a> <a>...</a> </div> If you wanted to select the 2nd, 3rd and 4th a tags in the above example, how would you do that? The only thing I can think of is: $("#myDiv a:eq(1), #m...
{ "language": "en", "url": "https://stackoverflow.com/questions/185966", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "62" }
Q: Generate an E-R Diagram by reverse-engineering a database Note: Originally this question was asked for PostgreSQL, however, the answer applies to almost any database which has a JDBC driver that can detect foreign-key associations. Querying PostgreSQL data dictionary for foreign-keys and relationship between table...
{ "language": "en", "url": "https://stackoverflow.com/questions/185967", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: How do I create a heterogeneous Array in Scala? In javascript, we can do: ["a string", 10, {x : 1}, function() {}].push("another value"); What is the Scala equivalent? A: Arrays in Scala are very much homogeneous. This is because Scala is a statically typed language. If you really need pseudo-heterogeneous featu...
{ "language": "en", "url": "https://stackoverflow.com/questions/185972", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "28" }
Q: Configuring IIS on Windows Vista Home Edition My friend accidentally bought a laptop with Windows Vista Home Basic Edition. He figured out how to install IIS on it, but it doesn't seem to have either the management console or the admin tools. Is there any way for him to configure a site or import an IIS 6 config fil...
{ "language": "en", "url": "https://stackoverflow.com/questions/185983", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What open source .Net utility projects or code libraries do you use? I use log4net in just about every code project. I was wondering what other generally useful code projects are available? A: * *Rhino.Mocks *NUnit *NHibernate *Spring.NET *Castle *My own somewhat eclectic MiscUtil *PostSharp A: I like the C...
{ "language": "en", "url": "https://stackoverflow.com/questions/185987", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: MVP examples for Windows Forms Is there good example code or a test project for explaining the Model–view–presenter (MVP) pattern. There are a lot of explanation links, but I want to have some good example code to show others without reinventing the wheel. A: Jeremy Miller's "Build your own CAB" series is fantasti...
{ "language": "en", "url": "https://stackoverflow.com/questions/185993", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "39" }
Q: How do I listen/identify when a program runs in Windows using C++? Specifically, I want to listen to when programs are run and record information such as: timestamp, executable, windows name and user. A: Alternatively, use the WMI interface to find out what's running and take appropriate action. In the VBScript cod...
{ "language": "en", "url": "https://stackoverflow.com/questions/186004", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What's the best way to find a string/regex match in files recursively? (UNIX) I have had to do this several times, usually when trying to find in what files a variable or a function is used. I remember using xargs with grep in the past to do this, but I am wondering if there are any easier ways. A: This is one of t...
{ "language": "en", "url": "https://stackoverflow.com/questions/186015", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "34" }
Q: How do you explain this structure in JavaScript? (function() { //codehere } )(); What is special about this kind of syntax? What does ()(); imply? A: The creates an anonymous function, closure and all, and the final () tells it to execute itself. It is basically the same as: function name (){...} name(); ...
{ "language": "en", "url": "https://stackoverflow.com/questions/186024", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "15" }