text
stringlengths
8
267k
meta
dict
Q: Exporting a plot as an image in Mathematica on a machine without X11 (ie, without involving the frontend) Consider the following dialog with the command-line interface to the kernel: $ math Mathematica 6.0 for Linux x86 (32-bit) In[1]:= p = Plot[x^2, {x,-1,1}] Out[1]= -Graphics- In[2]:= Export["foo.png", p] Out[2]...
{ "language": "en", "url": "https://stackoverflow.com/questions/315464", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: RT parallel processing in Rails I'm developing a sort of personalized search engine in Ruby on Rails, and I'm currently trying to find best way of sorting results depending on user's record, in real time. Example: items that are searched for can have tags (separate entities with ids), for example item has tags=[1, 5...
{ "language": "en", "url": "https://stackoverflow.com/questions/315466", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Problem with NVelocity, foreach and two Lists is there an easy way to solve the following problem. Let's say I fetch a IList with some books in my controller from my model. Now I want to enrich the output and fetch a preview from Amazon with another model from an outside framework and get another IList. Now I put bo...
{ "language": "en", "url": "https://stackoverflow.com/questions/315475", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How can I toggle word wrap in Visual Studio? Does Visual Studio .NET have a way to toggle word-wrap on and off? I am used to this feature in Eclipse which allows you to right click and toggle word wrap on and off so that when you have long lines that extend out to the right, you don't have to move the bottom scroll ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315485", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "376" }
Q: Rencode AVI file to fit within given output file size. I have an AVI file, which I want to re-encode to fit on a CD of size 650 MB. How can I encode such that file size does not exceed the given size? Which program can I use ? A: I assume you want to do this programmatically: For Windows: You can use directshow to...
{ "language": "en", "url": "https://stackoverflow.com/questions/315488", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What are some good techniques for performance testing SharePoint web parts and controls? This is a question about performance testing specific to SharePoint web parts and controls (although standard ASP.NET methods would be applicable as well). I'm wondering what are some good techniques, considering factors such as...
{ "language": "en", "url": "https://stackoverflow.com/questions/315490", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Weird SQL Server Management studio behavior I am currently using SQL Server Management Studio (Ver 9.00.3042.00) and click the "New Query" and wrote the following code: Select colA, colB, colC colD From table1 When I click the parse (checkbox) button to validate the SQL statement, it says "Comm...
{ "language": "en", "url": "https://stackoverflow.com/questions/315495", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: PHP objects as faux-arrays I have an object that implements ArrayAccess, Iterator and Countable. That produces a nigh-perfect array masking. I can access it with offsets ($object[foo]), I can throw it into a foreach-loop, and many other things. But what I can't do is give it to the native array iterator functions (n...
{ "language": "en", "url": "https://stackoverflow.com/questions/315496", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Tricks for generating SQL statements in Excel Do you have any tricks for generating SQL statements, mainly INSERTs, in Excel for various data import scenarios? I'm really getting tired of writing formulas with like ="INSERT INTO Table (ID, Name) VALUES (" & C2 & ", '" & D2 & "')" A: The semi-colon needs to be insi...
{ "language": "en", "url": "https://stackoverflow.com/questions/315504", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "20" }
Q: What's a good way to rewrite this non-tail-recursive function? For some reason, I am having trouble thinking of a good way to rewrite this function so it uses constant stack space. Most online discussions of tree recursion cheat by using the Fibonacci function and exploiting the properties of that particular problem...
{ "language": "en", "url": "https://stackoverflow.com/questions/315507", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: COM over USB with .NET to interface with 3rd party hardware I have a project where I have to interact with two different devices that supply data via COM over USB. The client is telling me that this can be done easily with HyperTerminal but I am unfamiliar with it. I am coding with .NET 2.0 (but can use 3.5 if neces...
{ "language": "en", "url": "https://stackoverflow.com/questions/315508", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Standared WebCam interface for .NET besides DirectShow? I want to be able to take still images with a web cam, via .NET 2.0 (or 3.5 if necessary). I know I can use DirectShow but that seems like a very large learning curve. Is there a simple to use OCX, or library that can work with most standard webcams? A: Pegasu...
{ "language": "en", "url": "https://stackoverflow.com/questions/315513", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Adobe Air Retrieving Server URL at Runtime I'm not familiar with Adobe Air and I am uploading a file to a server. For simple testing purposes I have hard coded an upload URL (Specifically a URL to a upload directory on the server to which the amf channels point) into the code. Is there a way in adobe air to get this...
{ "language": "en", "url": "https://stackoverflow.com/questions/315516", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Is there a more elegant way to convert an XML Document to a String in Java than this code? Here is the code currently used. public String getStringFromDoc(org.w3c.dom.Document doc) { try { DOMSource domSource = new DOMSource(doc); StringWriter writer = new StringWriter(); ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315517", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "71" }
Q: PowerShell : how to query AD and exchange mailbox sizes I just recently found out that exchange server2007 will no longer be supporting WMI, namely the service which uses \ROOT\MicrosoftExchangeV2. The old script I wrote output the ServerName, StorageGroupName, Storename, MailboxDisplayName, Size, TotalItems, Delete...
{ "language": "en", "url": "https://stackoverflow.com/questions/315518", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Coding style... error condition first or last? Which is better in general in terms of the ordering? Do you put the fault condition at the top or bottom? if (noProblems == true) { // do stuff } else { // deal with problem } OR if (noProblems == false) { // deal with problem } else { // do stuff } ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315519", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: Handle for ShellExecute() - Parent Window? I am trying to use ShellExecute to open a file in Excel. I was reading about the function on MSDN forums, and I found the folowing information about the handle, which is the first parameter: "hwnd [in] A handle to the owner window used for displaying a user interface (UI) ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315527", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Yahoo maps api, version 3.8 doesn't display custom image? I used the following code to display custom marker on Yahoo Maps : <Script type=text/javascript> var map=new YMap(document.getElementById('map')); // Create a map object Get_Lat_Lon() ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315532", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Scientific data visualization and the .NET framework I have spent a long time searching for a product that would bring functionality similar to matplotlib to the .NET framework. From what I can tell, nothing really measures up. Is this an accurate assessment? Here is what I have found: Commercial: * *ChartFX ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315533", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: Will a .NET EXE targeted to x86 run on AMD chips? If I target the x86 platform for my .NET app, will it run properly on AMD chips? I know that it will work with Intel chips, and that Vista 64 has the ability to run x86 apps in a special mode, but I don't know how much of that is hardware and how much of that is the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315537", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Only one return statement per method, even in this scenario? I like the idea of having only one return statement per method. What do you do in this situation though? public static string ChopText(string Text) { if (String.IsNullOrEmpty(Text)) { // return here ????? } } The only alternative I can thin...
{ "language": "en", "url": "https://stackoverflow.com/questions/315546", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: javascript document.write in external js file Working on big, high loaded project I got the problem that already described in billion of topics on forums and blog, but there is no solution that will help in my case. Here is the story. I have the HTML code of banner, I don't know what is the code. Sometimes it's plai...
{ "language": "en", "url": "https://stackoverflow.com/questions/315552", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: How to override background color for WinForm minimize and maximize buttons Is it possible to override the background color of the minimize and maximized buttons in WinForms? A: Not without writting your own NC_PAINT which is very bad practice by itself. You never know when the user will use a new visual style never...
{ "language": "en", "url": "https://stackoverflow.com/questions/315566", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: TFS 2005 Wiki Template? Is there a Wiki plugin for TFS 2005, ie. SharePoint Services 2.0? A: There is one here: http://www.neoworks.com/products/sharepoint/wikipoint/index.html I do not know how good it is, but you can install a demo and try it out. A: If you upgraded to TFS2008 then you could use a Sharepoint S...
{ "language": "en", "url": "https://stackoverflow.com/questions/315576", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Scrum and Fogbugz Anyone out there using Fogbugz and Scrum together? We use Fogbugz extensively, and I'm looking for ideas from anyone who may be using it as part of Scrum. I found these two items, but they are archived and unvailable for further discussion. I'm specifically interested in ideas for mapping Scrum con...
{ "language": "en", "url": "https://stackoverflow.com/questions/315585", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "23" }
Q: How do I get images located in my recourse folder into an array? I want to load 52 images (deck of cards) in gif format from my recourse folder into an Image[] in c#. Any ideas? Thanks, Jon A: You can read a Bitmap from a file like this; public static Bitmap GetBitmap( string filename ) { Bitmap retBitmap ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315590", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How can I pass a class name as an argument to an object factory in cocoa? I am working on an object factory to keep track of a small collection of objects. The objects can be of different types, but they will all respond to createInstance and reset. The objects can not be derived from a common base class because som...
{ "language": "en", "url": "https://stackoverflow.com/questions/315591", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: VB.NET: How can I remap the soap.location property of a web service at runtime? I have a web application I'm deploying at multiple clients. Each client will be consuming a web service that was developed by a third party and is hosted at each client location. The soap.location will be different for each deployment....
{ "language": "en", "url": "https://stackoverflow.com/questions/315599", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Conceptual question: Loose Coupling I am building a graphic board like project where i am facing a design issue. Main Class is Board which is a canvas responsible for handling mouse events when drawing shapes. It also has context variables such as currentShape or snapFlag to activate grid magnetism. To handle the mo...
{ "language": "en", "url": "https://stackoverflow.com/questions/315608", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Workflow - choosing the appropriate host environment The application that I'm designing will retrieve and store content from a variety of disparate sources on a schedule. In some cases, the content will be retrieved based on a time interval (think stock quotes), and in other cases the content will be retrieved base...
{ "language": "en", "url": "https://stackoverflow.com/questions/315609", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How do I extract a tar file in Java? How do I extract a tar (or tar.gz, or tar.bz2) file in Java? A: I just tried a bunch of the suggested libs (TrueZip, Apache Compress), but no luck. Here is an example with Apache Commons VFS: FileSystemManager fsManager = VFS.getManager(); FileObject archive = fsManager.resolveF...
{ "language": "en", "url": "https://stackoverflow.com/questions/315618", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "68" }
Q: MySQL: How to select all rows from a table EXCEPT the last one I have a table with N rows, and I wanna select N-1 rows. Suggestions on how to do this in one query, if it's possible..? A: Another technique I don't see listed here is SELECT * FROM table ORDER BY id DESC LIMIT 10000 OFFSET 1; This will give you the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315621", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Release notes, what for? What are release notes for and who reads them? Should/could they be automated by just spitting out bug fixes for the current release, or do they warrant careful human editing? So, anybody with a link to best practices(reasoning behind) in regards to software release notes? A: This really d...
{ "language": "en", "url": "https://stackoverflow.com/questions/315628", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: Is there an inverse of System.Diagnostics.ConditionalAttribute? Is there an analogous conditional-not-present attribute or maybe a way to use the Conditional attribute to only include a method if that symbol is not defined? What I'm looking for is something that works like this: [Conditional("!SILVERLIGHT")] private...
{ "language": "en", "url": "https://stackoverflow.com/questions/315646", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Determining Word Frequency of Specific Terms I'm a non-computer science student doing a history thesis that involves determining the frequency of specific terms in a number of texts and then plotting these frequencies over time to determine changes and trends. While I have figured out how to determine word frequenci...
{ "language": "en", "url": "https://stackoverflow.com/questions/315667", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: Automagically expanding a Python list with formatted output Does anyone know if there's a way to automatically expand a list in Python, separated by commas? I'm writing some Python code that uses the MySQLdb library, and I'm trying to dynamically update a list of rows in a MySQL database with certain key values. Fo...
{ "language": "en", "url": "https://stackoverflow.com/questions/315672", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Needing an ExtJS bug workaround I have a web application that uses Ext-JS 2.2. In a certain component, we have an empty toolbar that we are trying to add a button to using myPanel.getTopToolbar().insertButton(0, [...array of buttons...]); However, in IE6/7 this fails because of lines 20241-20242 in ext-all-debug.j...
{ "language": "en", "url": "https://stackoverflow.com/questions/315678", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Open Dialog preserving settings How does one preserve the settings in the Open Dialog box? For example, I would the Open Dialog to remember that I chose the Details view and sorted by date modified. A: Microsoft didn't see fit to give us any documented way of doing this, but some people have figured out bits of th...
{ "language": "en", "url": "https://stackoverflow.com/questions/315692", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Implementing A Draggable/Resortable Stacked List in jQuery I'm needing to make this layout editor that uses a good bit of jQuery for letting one resort the items on their resume. I envisioned showing a dialog with a graphical representation of the sections, sort of like: [Details - locked -- immovable] [Overview -- ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315704", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How can I read from an IO::Socket::INET filehandle only if there is a complete line? When reading from a IO::Socket::INET filehandle it can not be assumed that there will always be data available on the stream. What techniques are available to either peek at the stream to check if data is available or when doing the...
{ "language": "en", "url": "https://stackoverflow.com/questions/315706", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: C# Technique - Getting Constant Values By String Is there any good way to convert strings like "xlSum", "xlAverage", and "xlCount" into the value they have under Microsoft.Office.Interop.Excel.XlConsolidationFunction? I guess reflection would be slow (if its possible). There are about 10 of these constant values. I ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315708", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How to Add Event Handler with Arguments to an Array of Elements in Javascript? I have a three-step process that is entirely reliant upon JavaScript and Ajax to load data and animate the process from one step to the next. To further complicate matters, the transition (forward and backward) between steps is animated :...
{ "language": "en", "url": "https://stackoverflow.com/questions/315712", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Running a function periodically in twisted protocol I am looking for a way to periodically send some data over all clients connected to a TCP port. I am looking at twisted python and I am aware of reactor.callLater. But how do I use it to send some data to all connected clients periodically ? The data sending logic ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315716", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "24" }
Q: How do I check if Windows Installer 3.1 or higher is installed? I need to know this since this is a pre-req for .NET 3.5 and if I'm including the .NET bootstrapper, I should also see if Windows Installer 3.1 is needed. Right now I'm checking for the registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows...
{ "language": "en", "url": "https://stackoverflow.com/questions/315717", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "21" }
Q: Regex/Textmate Confusion I'm trying to create a Textmate snippet, but have run into some difficulties. Basically, I want to type in a Name and split it into its parts. Example, Bill Gates: (Bill), (bill), (Gates), (gates), (Bill Gates), (Bill gates), (bill Gates), (bill gates) EDIT** So I most certainly can produce...
{ "language": "en", "url": "https://stackoverflow.com/questions/315718", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: VBScript chr() appears to return wrong value I'm trying to convert a character code to a character with chr(), but VBScript isn't giving me the value I expect. According to VBScript, character code 199 is: � However, when using something like Javascript's String.fromCharCode, 199 is: Ç The second result is what ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315719", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Rails: Is there an equivalent to save_without_validation which skips after_save filters? I have an after_save filter which I dont want to trigger in a specific instance. Is there a way to do this similar to save_without_validation? Thanks, A: When using rails 2, you can invoke the private method create_without_cal...
{ "language": "en", "url": "https://stackoverflow.com/questions/315724", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Controller's actions names localization I am facing a problem. I would like to localize my action names in my project so french people can have clean urls with french names. http://www.test.com/Home should be http://www.test.com/Accueil It is a good thing too for google indexing. Moreover I would like to be Restful ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315729", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do I prevent a WCF service from enter a faulted state? I have a WCF Service that should not enter the faulted state. If there's an exception, it should be logged and the service should continue uninterrupted. The service has a one-way operation contract and is reading messages from an MSMQ. My problems are twofo...
{ "language": "en", "url": "https://stackoverflow.com/questions/315736", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "37" }
Q: unexpected margin with very simple html I have a very simple html. The red div is inside the blue div and has a 10 px top margin. On non-ie browsers, the blue box is 10 px apart from the top of viewport and the red div is at the very top of the blue div. What I expect is the ie behavior: red div must be 10 px apart ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315738", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: jQuery callbacks firing too early I have a problem when assigning functions to the click event of a button in IE 7 with jQuery. Something like the following works fine in Opera but produces an infinite loop in IE: function updateIndputFields(index, id) { $("#reloadBtn").click(function(){ updateIndputFields(index,...
{ "language": "en", "url": "https://stackoverflow.com/questions/315739", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Detecting loss of connection to fix gateway? (QuickFix) I'm trying to find a good way to detect a loss of connection. My adapter is implemented as a Fix::Application based on one of the examples. It uses a socket initiator to connect to the fix gateway. When I unplug the internet it takes about 30 seconds for the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315743", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: event handler problems c# I have a handle that fires when the ItemAdd event is triggered on the Sent Items folder in outlook. This handle prompts the user and depending on their selection then opens a custom windows form to save the sent email. Now ... heres what happens ... * *The prompt shows fine when an item ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315744", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Form element messes up imported HTML/CSS layout template in ASP.NET I want to use this pure HTML/CSS template for my ASP.NET website: http://sub3.tanguay.de I copy it inside my Default.aspx page, inside the FORM element, but the form messes up the layout: http://sub2.tanguay.de UPDATE: this now displays correctly, ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315745", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Mocking for Dummies? I'm new to mocking, I have a new .net web project that is in UI->BLL->DAL->DB structure, I use NUnit to do some testing currently. I intent to use it to test middle tier so I don't have to actually write to DB. Now, I've never done any mocking, don't quite know where to start, so I am looking fo...
{ "language": "en", "url": "https://stackoverflow.com/questions/315747", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "15" }
Q: Fire javascript code when download finishes I need to update a pair of old classic asp pages— a search.asp page that provides a simple form which is then posted to a results.asp page. One of the form options on the search page is a drop down list (<select) for the "format". If the user chooses the excel format the...
{ "language": "en", "url": "https://stackoverflow.com/questions/315752", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: ASP.NET based Workflow Engine I am working on a design spec for a new application that will be heavily workflow driven. Before I re-invent the wheel, is there a decent lightweight workflow engine that plugs into ASP.NET already around? Basically, I'm looking for something that handles moving through a defined set of...
{ "language": "en", "url": "https://stackoverflow.com/questions/315758", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: What is the best way to determine the number of days in a month with JavaScript? I've been using this function but I'd like to know what's the most efficient and accurate way to get it. function daysInMonth(iMonth, iYear) { return 32 - new Date(iYear, iMonth, 32).getDate(); } A: If you call this function often,...
{ "language": "en", "url": "https://stackoverflow.com/questions/315760", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "129" }
Q: Is it possible to have different members in a class document have different colours? I am using visual studio 2008 professional and was wondering, how can I have different colours for method calls within class methods, and for properties/fields? This would be good as it would give me a quick visual overview of what ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315770", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: CruiseControl.Net: How Does One Clear Obsolete Build History? I just started using CCNet, and in the process of getting my build projects set up I racked up a lot of build history from trial and error. I really don't want to keep that old stuff around, but I can't seem to see where/how to get rid of it. I'm sure thi...
{ "language": "en", "url": "https://stackoverflow.com/questions/315778", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: ASP.NET theme not rendering correctly I have a small web application which uses themes. The themes work on host, so on preinit, if the host = a, load x theme, if the host = b, load y theme. In my code this looks like: If request.url.host.contains("a") Then Page.Theme = x Else request.url.host.contains("b") Then...
{ "language": "en", "url": "https://stackoverflow.com/questions/315780", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Develop app to run natively or go cross platform? What's your opinion on whether one should write an application for a specific platform or use a cross platform approach and reach more potential clients? It would be a GUI based application and I'm thinking of using Java. Most of the applications that I've used built...
{ "language": "en", "url": "https://stackoverflow.com/questions/315782", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Select a ListItem from DropDownList using a Linq Query I' trying to use a Linq query to find and set the selected value in a drop down list control. Dim qry = From i In ddlOutcome.Items _ Where i.Text.Contains(value) Dim selectedItem As ListItem = qry.First ddlOutcome.SelectedValue = selectedItem.Va...
{ "language": "en", "url": "https://stackoverflow.com/questions/315787", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Minimalist cacheable jQuery/javascript library for iPhone? Given the iPhone's 25k limit for caching of files, I'm wondering if there's interest in an iPhone optimized javascript library that makes caching a top level goal. Since it'd be iPhone only it could get rid of most cross-browser cruft and rely on safari spec...
{ "language": "en", "url": "https://stackoverflow.com/questions/315788", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: how to avoid duplicates in a has_many :through relationship? How can I achieve the following? I have two models (blogs and readers) and a JOIN table that will allow me to have an N:M relationship between them: class Blog < ActiveRecord::Base has_many :blogs_readers, :dependent => :destroy has_many :readers, :thr...
{ "language": "en", "url": "https://stackoverflow.com/questions/315792", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "39" }
Q: How to handle multiple errors in C#? I have some code that reads 10 registry keys, sometimes the values are not present sometimes the keys are not present, sometimes the value isn't boolean etc etc. How should I add error handling to this, currently it is placed in one big try{} catch{} but if the second value I rea...
{ "language": "en", "url": "https://stackoverflow.com/questions/315799", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: OpenCV's Python - OS X I get the following error while building OpenCV on OS X 10.5 (intel): ld: warning in .libs/_cv_la-_cv.o, file is not of required architecture ld: warning in .libs/_cv_la-error.o, file is not of required architecture ld: warning in .libs/_cv_la-pyhelpers.o, file is not of required architecture ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315803", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How to display my application's errors in JSF? In my JSF/Facelets app, here's a simplified version of part of my form: <h:form id="myform"> <h:inputSecret value="#{createNewPassword.newPassword1}" id="newPassword1" /> <h:message class="error" for="newPassword1" /> <h:inputSecret value="#{createNewPassword.newP...
{ "language": "en", "url": "https://stackoverflow.com/questions/315804", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "42" }
Q: Roll my own or use existing CMS (Drupal perhaps?) I need to create a internal website and can't figure out if we should be writing our own, or using an existing framework. Most of the website will essentially be a front end to a database. We need to have a number of people enter data into forms. We then want to be...
{ "language": "en", "url": "https://stackoverflow.com/questions/315828", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Do C# objects know the type of the more specific class? Suppose you create a generic Object variable and assign it to a specific instance. If you do GetType(), will it get type Object or the type of the original class? A: Yes. You can also do: object c = new FooBar(); if(c is FooBar) Console.WriteLine("FOOBAR!...
{ "language": "en", "url": "https://stackoverflow.com/questions/315829", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Learning C# from java POV What books would you guys recommend if one has been a java developer for years and is now trying to take the c#/asp.net route? A: First read this whitepaper: C# From a Java Developers Perspective Then, you can move onto books that cover the .NET framework, as you'll see the langauges diffe...
{ "language": "en", "url": "https://stackoverflow.com/questions/315833", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Should I avoid using "text-align: justify;"? Is there any reason to avoid using text-align: justify;? Does it reduce readability or cause problems? A: Firstly, this is purely a design-related problem and solution. The design of your grid specifies if justifying text is needed. I think justify align alone has no ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315845", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "80" }
Q: Why null cast a parameter? When and why would somebody do the following: doSomething( (MyClass) null ); Have you ever done this? Could you please share your experience? A: Let's say you have these two functions, and assume that they accept null as a valid value for the second parameters. void ShowMessage(String ms...
{ "language": "en", "url": "https://stackoverflow.com/questions/315846", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "82" }
Q: Rails model without database I want to create a Rails (2.1 and 2.2) model with ActiveRecord validations, but without a database table. What is the most widely used approach? I've found some plugins that claim to offer this functionality, but many of them don't appear to be widely used or maintained. What does the...
{ "language": "en", "url": "https://stackoverflow.com/questions/315850", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "75" }
Q: Is Azure an Operating System or a Framework? MS is calling Azure an Operating System. To me, it feels much more like a framework. I am having a bit of trouble defining the two separately. I have a general intuition, but I am not articulate enough to really say if Azure is really an OS or just a framework sitting...
{ "language": "en", "url": "https://stackoverflow.com/questions/315879", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Domain Masking with HTML How do I mask the address of another site using HTML? For example, I'd like: http://www.example.com/source.html To point to another page: http://www.example.com/dest.html Note that the destination page could be on another domain. A: There's plenty of people who would assert that your object...
{ "language": "en", "url": "https://stackoverflow.com/questions/315887", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to programmatically change name or icon of Eclipse view? Can the name and icon of an Eclipse view be programmatically changed? I am referring to the name and icon that appear in the tab for the view - which are specified as XML attributes "name" and "icon" in the <view> element in plugin.xml. A: setPartName(Str...
{ "language": "en", "url": "https://stackoverflow.com/questions/315891", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: How to convert a literal object into user defined object in javascript? Writing a ton of web applications leveraging JSON/AJAX, I find myself returning tons literal javascript objects (JSON). For example, I may be request all the Cats from GetCats.asp. It would return: [ { 'id': 0, 'name': 'Persian' }, { 'id'...
{ "language": "en", "url": "https://stackoverflow.com/questions/315893", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Odd Exception when Combining .hbm.xml and Fluent NHibernate - Any ideas? So I'm converting my mapping files on an as needed basis (when making changes, convert to mapping). Any when configuring NHibernate like so: Assembly asm = Assembly.Load("RPMWare.Core.DataAccess"); //NHibernate configuration: see hibernate.cfg...
{ "language": "en", "url": "https://stackoverflow.com/questions/315894", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Git for beginners: The definitive practical guide Ok, after seeing this post by PJ Hyett, I have decided to skip to the end and go with Git. So what I need is a beginner's practical guide to Git. "Beginner" being defined as someone who knows how to handle their compiler, understands to some level what a Makefile is...
{ "language": "en", "url": "https://stackoverflow.com/questions/315911", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "854" }
Q: Posting/submitting multiple forms in jQuery I have two forms on a page (one is being grabbed by AJAX). I need them both to be posted, so I serialize the second one and send it in a post using jQuery before submitting the first one. However, only the first form appears to be getting posted. The odd thing is though...
{ "language": "en", "url": "https://stackoverflow.com/questions/315912", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Trying to improve efficiency of array formula I have a SUM array formula that has multiple nested IF statements, making it very inefficient. My formula spans over 500 rows, but here is a simple version of it: {=SUM(IF(IF(A1:A5>A7:A11,A1:A5,A7:A11)-A13:A17>0, IF(A1:A5>A7:A11,A1:A5,A7:A11)-A13:A17,0))} As you can see...
{ "language": "en", "url": "https://stackoverflow.com/questions/315915", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: What is the difference between an OS and a Framework? I recently posted a question about Azure... is it really an OS? I understand the technical details, and I got a lot of fuzzy answers... I really want to know... what do you think is the difference between an OS and a Framework? Just for reference, Azure will be ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315918", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Setting global_names parameter Greetings, My company uses Peoplesoft for its financials and HR. Our implementation is on Oracle databases. Setting global_names = TRUE forces you to name your database link the same as the target. My question is does anyone know the ramification of setting global_names to false in ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315919", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: In Log Shipping configuration with SQL2005, Primary server's backup job not being added I'm creating a log shipping configuration between two sql server 2005 instances. I'm shipping the logs of a single database and I'm not using a Monitor service (for the time being). When I run the SQL Server Log Shipping Wizard...
{ "language": "en", "url": "https://stackoverflow.com/questions/315929", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: SharePoint Default Styles I'm building a custom web part for SharePoint and I'm trying to use the default styles so when people theme the site, it will theme with it. I've found a couple of decent sites that show the different styles like: http://www.sharepointcustomization.com/resources/tipstricks/wss_cssguide.htm ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315932", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: WebBrowser document cast not valid I've got a WebBrowser control on my page. To fire some javascript on a page displayed in the browser control, I call this.myBrowser.Document.InvokeScript("Test"); This works on my dev box with IE7, but on a seperate test machine I get the following error: Exception Type: System.Inv...
{ "language": "en", "url": "https://stackoverflow.com/questions/315938", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do I get the max ID with Linq to Entity? I have a table User which has an identity column UserID, now what is the correct Linq to Entity line of code that would return me the max UserID? I've tried: using (MyDBEntities db = new MyDBEntities()) { var User = db.Users.Last(); // or var User = db.Users.M...
{ "language": "en", "url": "https://stackoverflow.com/questions/315946", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "90" }
Q: C++ catching all exceptions Is there a c++ equivalent of Java's try { ... } catch (Throwable t) { ... } I am trying to debug Java/jni code that calls native windows functions and the virtual machine keeps crashing. The native code appears fine in unit testing and only seems to crash when called through jni...
{ "language": "en", "url": "https://stackoverflow.com/questions/315948", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "320" }
Q: Getting autonumber primary key from MS SQL Server I am currently working in C#, and I need to insert a new record into one table, get the new primary key value, and then use that as a foreign key reference in inserting several more records. The Database is MS SQL Server 2003. All help is appreciated! A: The way to ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315963", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Binding to multiple concrete implementations with IOC frameworks? I'm relatively familiar with the concepts of DI/IOC containers having worked on projects previously where their use were already in place. However, for this new project, there is no existing framework and I'm having to pick one. Long story short, the...
{ "language": "en", "url": "https://stackoverflow.com/questions/315964", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: MySQL -- create two indexes, only one appears in SHOW CREATE TABLE output In have a many-to-many linking table and I'm trying to set up two foreign keys on it. I run these two statements: ALTER TABLE address_list_memberships ADD CONSTRAINT fk_address_list_memberships_address_id FOREIGN KEY index_address_id (address_...
{ "language": "en", "url": "https://stackoverflow.com/questions/315965", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How do you construct a LINQ to Entities query to load child objects directly, instead of calling a Reference property or Load() I'm new to using LINQ to Entities (or Entity Framework whatever they're calling it) and I'm writing a lot of code like this: var item = (from InventoryItem item in db.Inventory ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315966", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "46" }
Q: Question: Regarding GridView boundfield ReadOnly property I have a Gridview boundfield where i set ReadOnly to true because i don't want user to change its value. However on the objectdatasource control's update method that boundfield became null when i try to use it as parameter in update method. Is there a way to ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315968", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: In C++, what do you do nearly all the time? There are a few things that I almost always do when I put a class together in C++. 1) Virtual Destructor 2) Copy constructor and assignment operator (I either implement them in terms of a private function called Copy(), or declare them private and thus explicitly disallow ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315987", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: XCOPY hosts file on vista from a batch file I need a command to replace the hosts file on my machine. Seems pretty straight forward but I cannot get the command to work with xcopy. Any obvious flaws in the command? luaexec -w -f "XCOPY" "%ScriptPath%/ModifiedHosts/vista/hosts" "%windir%/system32/drivers/etc/hosts" ...
{ "language": "en", "url": "https://stackoverflow.com/questions/315991", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: What is the best way to make the output of one stream the input to another I'm wondering if there is a better/inbuilt way, other than using a byte buffer and looping, to read from one stream and write it to another (in .NET). Generally this is done to apply a transform to a stream and move it on. In this instance, w...
{ "language": "en", "url": "https://stackoverflow.com/questions/316007", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Sql Import wizard imports 1022868890 as 1.02287e+009 I'm trying to import some data from Excel to SQL Server, I have a TEXT column with some numbers in it, some of the numbers go over just fine, and some turn into scientific form. Column in Excel is "text" type, column in the target sql table is varchar(255) Here ar...
{ "language": "en", "url": "https://stackoverflow.com/questions/316008", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: C# Best way to get folder depth for a given path? I'm working on something that requires traversing through the file system and for any given path, I need to know how 'deep' I am in the folder structure. Here's what I'm currently using: int folderDepth = 0; string tmpPath = startPath; while (Directory.GetParent(tmp...
{ "language": "en", "url": "https://stackoverflow.com/questions/316009", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: SQL Server 2005 database stuck in single user mode I have a database that is stuck in single-user mode. I kill the process that obtains the "lock" on the db but when I kill it another one spawns automatically, (using the sa account). This happens even with SQL Server agent disabled. Any ideas? A: It's probably you...
{ "language": "en", "url": "https://stackoverflow.com/questions/316013", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }