text
stringlengths
8
267k
meta
dict
Q: Double value returns 0 Here's an example: Double d = (1/3); System.out.println(d); This returns 0, not 0.33333... as it should. Does anyone know? A: That's because 1 and 3 are treated as integers when you don't specify otherwise, so 1/3 evaluates to the integer 0 which is then cast to the double 0. To fix it, try ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366237", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: What alternative do I have to ugly submit buttons in html forms? I'd like to make a simple html form where a person can upvote or downvote an item. However I don't like the default look of a <input type="submit"> . What other options do I have to send a POST request than a bulky, default button? A: You could use an...
{ "language": "en", "url": "https://stackoverflow.com/questions/366245", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Hide and show div element with prototype and scriptaculous I'm trying to use prototype and scriptaculous to hide and display a div element but the function (below) to take advantage of the prototype setStyle property isn't working and I'm not sure what the problem is. <script type="text/javascript" language="javascr...
{ "language": "en", "url": "https://stackoverflow.com/questions/366251", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: showModelessDialog - onLoad failure - IE 7 MSIE v7 does not (in my hands) open a Modeless Dialog or trigger an onLoad event if there is a Javascript alert in the target page. The following fails in MSIE v7 but is OK in v6 (zip file of full source available if required). Would appreciate others confirming this and d...
{ "language": "en", "url": "https://stackoverflow.com/questions/366255", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Everything a c++ developer should know about network programming? So I am doing a lot of high performance network programming using Boost::Asio (or just Asio if you will), and have a pretty solid grasp of the essentials of both TCP and UDP protocols. I am wondering though, because I still don't consider myself an ex...
{ "language": "en", "url": "https://stackoverflow.com/questions/366257", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Search Javascript Array for Regex and return True/False (0/1) if found I need to know how I can search an array for some literal text and have it used as a condition whether to continue. Here's why: Each time I execute a function I am pushing the ID of the property it acts upon into an array. I need my function to c...
{ "language": "en", "url": "https://stackoverflow.com/questions/366262", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: 64 bit division Can anyone send me a c code to divide 2 64bit numbers. My compiler only supports 32/32 division. Thanx & Regards Mani A: The code is available in linux, see div64.c. Can you copy that? A: A more general idea is to use a multi-precision library, like GMP. GMP is a free library for arbitrary precisi...
{ "language": "en", "url": "https://stackoverflow.com/questions/366273", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-2" }
Q: Graphics library for embedded systems without Linux? It seems that any kind of graphic library like DirectFB or MiniGui requires some sort of underlying operation system like Linux or uClinux. I am challenged with writing a software for a micro controller with just 512kb flash, an LCD display and a touchscreen to di...
{ "language": "en", "url": "https://stackoverflow.com/questions/366278", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Delphi 7 & ICS sending DELETE requests How can I send a DELETE request with delphi 7 and the ICS component so that I can access a REST api? A: All I could find... http://wiki.overbyte.be/wiki/index.php/THttpCli.OnBeforeHeaderSend A: Another option would be to use the synapse library. Its very easy to use and exte...
{ "language": "en", "url": "https://stackoverflow.com/questions/366291", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How do you handle Rail's flash with Ajax requests? I'm pretty happy with the solution that I came up with. Basically, I have a helper method that reloads the flash inline, and then I have an after_filter that clear out the flash if the request is xhr. Does anyone have a simpler solution than that? Update: The solu...
{ "language": "en", "url": "https://stackoverflow.com/questions/366311", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "77" }
Q: Set the working folder for a remote process using WMI I'm using this article to start a process on a remote machine using WMI. How can I control the working directory that process will start in? (No need to redirect me to psexec, I'm getting an error from it, currently trying the WMI approach). A: Found the answer ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366321", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Javascript Window.Onload Function Chaining Just for the sake of experimentation, I've been trying to determine different ways to non-destructively chain window.onload functions in a web browser. This is the idea of what I have so far: var load = window.onload; var newFunction = function(){ alert("ha!"); } window...
{ "language": "en", "url": "https://stackoverflow.com/questions/366324", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Wait for a remote process to finish in .net We all know and love Process.WaitForExit(). Given a pid of a process on a remote machine (created by WMI/psexec), how do I wait for it to end? A: For me Process.GetProcessByID() just didn't work (it claimed it couldn't connect to the machine). This worked: public static b...
{ "language": "en", "url": "https://stackoverflow.com/questions/366326", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Why can't Delphi variants hold objects? Why can't Delphi variants hold objects? More importantly, what's the reason behind this limitation? A: This is just an opinion, from my experience with what variants can and cannot do. If you put a COM object into it, it will be stored as an IDispatch reference, and thus any...
{ "language": "en", "url": "https://stackoverflow.com/questions/366329", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: Best way to get sub properties using GetProperty public class Address { public string ZipCode {get; set;} } public class Customer { public Address Address {get; set;} } how can I access eitther "ZipCode" or "Address.ZipCode" with reflection? For example: Typeof(Customer).GetProperty("ZipCode")? A: You'd...
{ "language": "en", "url": "https://stackoverflow.com/questions/366332", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "29" }
Q: Using Console.WriteLine within a Windows Forms application I have an external DLL whose source code is C#. From the documentation for the DLL, I determined that it writes its debug messages to the console using Console.WriteLine. I'd like to use this DLL within a WinForms application. However, what I have discovered...
{ "language": "en", "url": "https://stackoverflow.com/questions/366345", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: IIS6 Available Memory for 32-Bit Application with Web Garden on x64 OS (32Gb Ram) We have IIS6 running on a 64-bit Windows 2003 server with 32Gb physical RAM. Due to some older 32-bit dependencies within our .NET 3.5 ASP.NET application, we are currently forced to run our IIS worker process in 32-Bit wow64 mode whic...
{ "language": "en", "url": "https://stackoverflow.com/questions/366349", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Datatype for storing video in SQL Server 2000 What datatype would be used for storing video files in sql server2000? A: In most cases, a database isn't the ideal place for video. You can force it (varbinary(max), or image on older versions), but if you do this, you'll need to be very careful to use steraming access...
{ "language": "en", "url": "https://stackoverflow.com/questions/366358", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: What do you think about this weird idea about how to configure development/staging/production instances? I just got a weird idea about how to configure environment-dependent parameters. Sort of like parameters you can find in Rails' config/database.yml In my current project I use PHP and Litespeed Web Server (though...
{ "language": "en", "url": "https://stackoverflow.com/questions/366364", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Can you explain to me the Action parameters for MVCs Controller methods? Can someone explain to or link to an article that explains how the parameters passed into the action of a controller are populated? I understand the basic mapping when you have the Controller/Action/ID and the ID is passed in as a variable, if ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366375", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to find first element that is hidden by JQuery I want to show first element that is hidden by jquery. my html code is: <ol> <li>1</li> <li style="display:none">2</li> <li style="display:none">3</li> <li style="display:none">4</li> <li style="display:none">5</li> <li><a class="add">Add Mor...
{ "language": "en", "url": "https://stackoverflow.com/questions/366379", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How can I make Eclipse CDT auto-indent properly when using BOOST_FOREACH? I write this tiny C++ example in Eclipse 3.4.1 (CDT 5.0.1): #include <iostream> #include <vector> #include <boost/foreach.hpp> int foo() { std::vector<int> numbers; BOOST_FOREACH(int n, numbers) { std::cout << n << std::endl; } ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366380", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: How can I unit test my ASP.NET MVC controller that uses FormsAuthentication? I'm working with a ASP.NET MVC solution in a test driven manner and I want to login a user to my application using forms authentication. The code I would like to end up with in the controller looks something like this: FormsAuthentication.S...
{ "language": "en", "url": "https://stackoverflow.com/questions/366388", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "47" }
Q: Java GUI - General Hello all you helpful folks @ stackoverflow! Best resources for Java GUI's? Looking at the Java Documentation, it is pretty easy to figure out the basics of JButtons, JFrames, etc but grasping the concepts of accessing JComponents from a frame, what creating a different panel does, etc is not very...
{ "language": "en", "url": "https://stackoverflow.com/questions/366391", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Silverlight on Linux did anyone try to view a Silverlight site on a Linux machine? afaik, there is something called mono on Linux which is a try to port .NET on Linux machines, but did one really try to use it? did it work? A: Moonlight is the mono implementation of SilverLight. http://www.mono-project.com/Moonlig...
{ "language": "en", "url": "https://stackoverflow.com/questions/366398", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: how to browse to a external url from turbogears/cherrypy application? I am writing a tinyurl clone to learn turbogears. I am wondering how do i redirect my browser to the external website (say www.yahoo.com) from my cherrypy/turbogears app? I googled about it, but could not find much useful info. A: Just raise a HT...
{ "language": "en", "url": "https://stackoverflow.com/questions/366421", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: What is the pythonic way to avoid default parameters that are empty lists? Sometimes it seems natural to have a default parameter which is an empty list. Yet Python produces unexpected behavior in these situations. If for example, I have a function: def my_func(working_list=[]): working_list.append("a") prin...
{ "language": "en", "url": "https://stackoverflow.com/questions/366422", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "207" }
Q: Extending std::list I need to use lists for my program and needed to decide if I use std::vector or std::list. The problem with vector is that there is no remove method and with list that there is no operator []. So I decided to write my own class extending std::list and overloading the [] operator. My code looks li...
{ "language": "en", "url": "https://stackoverflow.com/questions/366432", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Variable event in Java I'm having a problem with a Klondike Solitaire I'm programming. It's almost finished but now when I try to compile (I'm using Dr. Java, yeah I know), it keeps popping up with 2 errors. * *Cannot find symbol: Variable event *Cannot find symbol: Method "findbunki" (java.awt.Point) I've alr...
{ "language": "en", "url": "https://stackoverflow.com/questions/366438", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How easy to get started on making apps for Mac? I've done some delving into AppleScript but I'm interested in how difficult and long it would take to make semi-useful Mac apps. What really good resources besides Apple Documentation? A: As stesch said "Cocoa Programming For Mac OS X" is the best book available for a...
{ "language": "en", "url": "https://stackoverflow.com/questions/366451", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Best practices for debugging I've been doing quite a bit of debugging of managed applications lately using both Visual Studio and WinDbg, and as such I'm often ask to assist colleagues in debugging situations. On several occasions I have found people aho just insert break points here and there and hope for the best....
{ "language": "en", "url": "https://stackoverflow.com/questions/366453", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: I need Help Making my VB 2008 Express Web Browser Every time I click on a link it opens in Internet Explorer but I want it to open in another window of my web browser. Details: I created a tabbed web browser which is using a tab control. Other Controls would be a normal web browser. A: You have to hookup the newwi...
{ "language": "en", "url": "https://stackoverflow.com/questions/366454", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: (How) Can you implement snail HTTP (comet/long lived connections) in Flash? I am very interested in streaming data for web-applications. I have tried out some javascript libraries, but the hacks and browser-incompatibilities drive me crazy ! HTML5 will hopefully standardize streaming data, but until then, hopefully ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366485", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Creating urls with asp.net MVC and RouteUrl I would like to get the current URL and append an additional parameter to the url (for example ?id=1) I have defined a route: routes.MapRoute( "GigDayListings", // Route name "gig/list/{year}/{month}/{day}",...
{ "language": "en", "url": "https://stackoverflow.com/questions/366498", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Should a long method used only once be in its own class or in a function? A lot of times in code on the internet or code from my co-workers I see them creating an Object with just one method which only gets used once in the whole application. Like this: class iOnlyHaveOneMethod{ public function theOneMethod(){ ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366507", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What is the best resource for learning the features and benefits of windbg? What is the best resource for learning the features and benefits of windbg? I want to be able to discuss investigate memory issues (handles, objects), performance issues, etc . . . A: These are some I like: * *Maoni Stephens and Claudio...
{ "language": "en", "url": "https://stackoverflow.com/questions/366517", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Syntax Highlighting library in ActionScript I let user enter some code in my Flex3 (Flash 10) app and I want to do syntax highlighting. Is there any open-source library that would help me? I'll need a Lua syntax support, but I can add it myself if library has a resonable interface to do this. A: Update on 21 Jan, 2...
{ "language": "en", "url": "https://stackoverflow.com/questions/366528", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How to run the first process from a list in a file deleting the first line as if the file was a queue and I called "pop"? How to run the first process from a list of processes stored in a file and immediately delete the first line as if the file was a queue and I called "pop"? I'd like to call the first command list...
{ "language": "en", "url": "https://stackoverflow.com/questions/366533", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: XML serialization of a Dictionary with a custom IEqualityComparer I want to serialize a Dictionary that has a custom IEqualityComparer. I've tried using DataContractSerializer but I can't get the Comparer to be serialized. I can't use BinaryFormatter because of this. I can always do something like: var myDictionary ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366541", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How do I get CakePHP bake to find mysql.sock and recognize MySQL while using MAMP on Mac OSX? I am currently reading "Beginning CakePHP:From Novice to Professional" by David Golding. At one point I have to use the CLI-command "cake bake", I get the welcome-screen but when I try to bake e.g. a Controller I get the fo...
{ "language": "en", "url": "https://stackoverflow.com/questions/366550", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Mono - sharing code on client and server . . We are trying to come up with our client and server standard and there is a big debate. One school of thought is C# client and java servers using some type of proprietary messsage library to share data objects (think XML like structure . .) The issue with this model is ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366562", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: .htaccess Rewrite Rules for subdomain I use codeigniter as my main install on the main domain. I have created a subdomain and a folder called live e.g. live.domain.com maps to public/live . However in public I use codeigniter. I now have the dynamic codeigniter url: http://domain.com/api/ which I want to map to my ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366586", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: What does a good programmer's code look like? I am a hobbyist programmer (started with VBA to make excel quicker) and have been working with VB.NET / C#.NET and am trying to learn ADO.NET. A facet of programming that has always frustrated me is what does 'good' look like? I am not a professional so have little to co...
{ "language": "en", "url": "https://stackoverflow.com/questions/366588", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "91" }
Q: Jeditable - Activate edit of X by clicking on Y I'm trying to use Jeditable as an inline editing solution. The default behavior (click on the element to edit it) works quite well, but I would like to activate an element by clicking on another element. For example clicking on a.activateEdit will activate the next di...
{ "language": "en", "url": "https://stackoverflow.com/questions/366595", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "15" }
Q: How can I convince Firefox to redraw CSS Pseudo-elements? I'm having issues getting Firefox to update a webpage when its class is changed dynamically. I'm using an HTML table element. When the user clicks a cell in the table header, my script toggles the class back and forth between sorted_asc and sorted_des. I have...
{ "language": "en", "url": "https://stackoverflow.com/questions/366601", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How to translate a virtual memory address to a physical address? In my C++ program (on Windows), I'm allocating a block of memory and can make sure it stays locked (unswapped and contiguous) in physical memory (i.e. using VirtualAllocEx(), MapUserPhysicalPages() etc). In the context of my process, I can get the VIR...
{ "language": "en", "url": "https://stackoverflow.com/questions/366602", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "21" }
Q: Group by date only on a Datetime column Having a table with a column like: mydate DATETIME ... I have a query such as: SELECT SUM(foo), mydate FROM a_table GROUP BY a_table.mydate; This will group by the full datetime, including hours and minutes. I wish to make the group by, only by the date YYYY/MM/DD not by the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366603", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "223" }
Q: Any thoughts on RightScale and Scalr for dynamic Ec2 instance management I'm looking for a cost effective tool for managing an web app on Ec2. Rightscale seems to the big dog and charges for it. Scalr looks like a more cost effective solution but it's hard to find out any real customer experiences.. The key aspects ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366612", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "15" }
Q: How do I send an email message from my C# application? This is the code I wrote: MailMessage mail = new MailMessage("test@gmail.com", "me@myurl.com"); mail.Subject = "This is a test!!"; mail.Body = "testing..."; SmtpPermission connectAccess = new SmtpPermission(SmtpAccess.Connect); ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366629", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: ASP.NET FileUpload: how to automatically post back once a file is selected? I am working on a ASP.NET app and i have a need to post back to the server after a file is chosen in a FileUpload control without having to have the user explicitly click a 'submit' button. Is this possible? and if so, how? A: I'm assuming ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366631", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "27" }
Q: Best way to migrate site content into a new SharePoint site My team is working on a project to migrate a .com site into SharePoint. After all our look and feel assets, master pages, content types, and page layouts are created, we need to actually "move" the actual site pages into SharePoint. I'm trying to come up ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366633", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Is it possible to create a multi-server SharePoint farm in the DMZ without using a domain? I'm working with a client to plan the topology for a public facing SharePoint internet site. The SharePoint installation will live in the client's DMZ and the plan is to use an existing SQL Server machine to host the SharePoi...
{ "language": "en", "url": "https://stackoverflow.com/questions/366639", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Are design patterns in JavaScript helpful? And what exactly are they? I have been learning more and more javascript; it's a necessity at my job. We have a web application that uses a lot of javascript and I will be doing more and more every day. I have read bits and pieces about design patterns, but was wondering if...
{ "language": "en", "url": "https://stackoverflow.com/questions/366647", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Java 6 Excessive Memory Usage Does Java 6 consume more memory than you expect for largish applications? I have an application I have been developing for years, which has, until now taken about 30-40 MB in my particular test configuration; now with Java 6u10 and 11 it is taking several hundred while active. It bounc...
{ "language": "en", "url": "https://stackoverflow.com/questions/366658", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "22" }
Q: How to limit execution time of a function call? There is a socket related function call in my code, that function is from another module thus out of my control, the problem is that it blocks for hours occasionally, which is totally unacceptable, How can I limit the function execution time from my code? I guess the s...
{ "language": "en", "url": "https://stackoverflow.com/questions/366682", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "97" }
Q: How to design a good about box? There is not official standard dealing with the layout of about boxes, which display the credits of a computer software and other information. What should a good about box contain? And... is it okay to put an easter egg in? (source: seasip.info) A: I generally prefer to make tabbe...
{ "language": "en", "url": "https://stackoverflow.com/questions/366683", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How often do you need to create a real class hierarchy in your day to day programming? I create business applications with heavy database use. Most of the programming work is just to connect components to the database and modifying components to adapt to general interface behaviour. I mostly use Delphi with its rich...
{ "language": "en", "url": "https://stackoverflow.com/questions/366685", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Top Issues Running ASP.NET app on Mono Assume I have an ASP.NET MVC app that's not doing anything too fancy (no P/Invoke, no unsafe, etc). I've considered the idea of running on Mono to support Linux, among other platforms. I haven't used Mono in a long time. What are the top issues I'm likely to face? A: * *Mono...
{ "language": "en", "url": "https://stackoverflow.com/questions/366688", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: jQuery Dialog Box Im trying to do a dialog box with jquery. In this dialog box Im going to have terms and conditions. The problem is that the dialog box is only displayed for the FIRST TIME. This is the code. JavaScript: function showTOC() { $("#TOC").dialog({ modal: true, overlay: { ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366696", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "35" }
Q: Adapting Linq Entity objects to Domain objects I have the following code which adapts linq entities to my Domain objects: return from g in DBContext.Gigs select new DO.Gig { ID = g.ID, Name = g.Name, Description = g.Description, ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366697", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to manage project for free? I was asked to manage and develop a project. The client does not really care if I hire people who would do it or I do it myself. Thus, I've decided to be more manager than developer. Are there any (free / low cost) web projects that could help me to communicate with each "sub-develop...
{ "language": "en", "url": "https://stackoverflow.com/questions/366702", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-2" }
Q: Bitwise subtraction in Python This is a follow-up to my question yesterday: CMS kindly provided this example of using bitwise operators to add two numbers in C: #include<stdio.h> int add(int x, int y) { int a, b; do { a = x & y; b = x ^ y; x = a << 1; y = b; } while (a); ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366706", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: What is the best way to collect crash data? So I am sold on the concept of attempting to collect data automatically from a program - i.e., popping up a dialog box that asks the user to send the report when something goes wrong. I'm working in MS Visual Studio C#. From an implementation point of view, does it make se...
{ "language": "en", "url": "https://stackoverflow.com/questions/366718", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Objectively Good OO Design Principles Premise I believe that there is a way to objectively define "Good" and "Bad" Object-Oriented design techniques and that, as a community we can determine what these are. This is an academic exercise. If done with seriousness and resolve, I believe it can be of great benefit to ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366719", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to organize python test in a way that I can run all tests in a single command? Currently my code is organized in the following tree structure: src/ module1.py module2.py test_module1.py test_module2.py subpackage1/ __init__.py moduleA.py moduleB.py test_moduleA...
{ "language": "en", "url": "https://stackoverflow.com/questions/366720", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: Opening minidump file (*.dmp) not possible in Visual Studio.NET 2005? I have created a minidump using win32 api [DllImport("DbgHelp.dll", SetLastError = true)] private static extern bool MiniDumpWriteDump( dmp file is successfully created. i am trying to open this *.dmp file in another visual studio instance...
{ "language": "en", "url": "https://stackoverflow.com/questions/366728", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Creating an Environment Stack in OpenGL I'd like to create an abstraction in OpenGL of the environment settings(blending, stenciling, depth, etc.) that works like the matrix stack. Push onto the stack, make any changes you need, draw your objects, then pop the stack and go back to the prior settings. For example, cu...
{ "language": "en", "url": "https://stackoverflow.com/questions/366742", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Can I access Outlook Email contacts field in VBA? I would like to access the contacts field on an email message (Email options) in outlook. Normally this field ties an email to a contact. Since it is a freeform text field available from the options dialog box, I am trying to use it to store a "next action" for my em...
{ "language": "en", "url": "https://stackoverflow.com/questions/366758", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: LINQ to SQL While trying to use LINQ to SQL I encountered several problems. I have table persons: * *int ID *string firstName *string lastName And table notes that has: * *int ID *string noteText *string createdBy *datetime creationDate *int PersonID PersonID is a foreign key and the relationship is ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366766", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Convert bitmap to PNG in-memory in C++ (win32) Can I convert a bitmap to PNG in memory (i.e. without writing to a file) using only the Platform SDK? (i.e. no libpng, etc.). I also want to be able to define a transparent color (not alpha channel) for this image. The GdiPlus solution seems to be limited to images of w...
{ "language": "en", "url": "https://stackoverflow.com/questions/366768", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "19" }
Q: Getting a list of 3rd party modules with Windbg? I'm using windbg to examine some crash dumps sent in by an app. There seems to be some correlation between a crash I'm seeing and having a certain 3rd party DLL loaded into the process (a flaky Winsock LSP, I suspect). To make this sort of analysis easier in the fut...
{ "language": "en", "url": "https://stackoverflow.com/questions/366772", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Adding a data connection to SQL Server 2008 from VS 2008 Im trying to add a connection to a database in SQL Server 2008 using Visual Studio 2008. When testing the connection, it says that it is successful. However, once I said okay, it complains and say: "Cannot add data connection. Object reference not set to an in...
{ "language": "en", "url": "https://stackoverflow.com/questions/366775", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Using JavaScript With C# For non browser based operations I recently had to take a quick look at Adobe InDesign server. In this enviroment you write your interactions with the servers libs via JavaSscript. This got me thinking, how could I use the Javascript language within a C# application so that I could expose s...
{ "language": "en", "url": "https://stackoverflow.com/questions/366778", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: multi words PHP arrays replacement <?php $string = 'The quick brown fox jumped over the lazy dog.'; $patterns[0] = '/quick/'; $patterns[1] = '/brown/'; $patterns[2] = '/fox/'; $replacements[0] = 'slow'; $replacements[1] = 'black'; $replacements[2] = 'bear'; echo preg_replace($patterns, $replacements, $string); ?> O...
{ "language": "en", "url": "https://stackoverflow.com/questions/366794", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to change css properties of html elements using javascript or jquery How can I change CSS from javascript. I'm using jQuery-ui Dialog and I want to change the style of a DIV from javascript. Thanks A: Check out the jQuery documentation. If you want anything it will be there. Anyhow, if you want to add styles t...
{ "language": "en", "url": "https://stackoverflow.com/questions/366805", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Regex: Is Lazy Worse? I have always written regexes like this <A HREF="([^"]*)" TARGET="_blank">([^<]*)</A> but I just learned about this lazy thing and that I can write it like this <A HREF="(.*?)" TARGET="_blank">(.*?)</A> is there any disadvantage to using this second approach? The regex is definitely more comp...
{ "language": "en", "url": "https://stackoverflow.com/questions/366822", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Is it possible to programmatically 'clean' emails? Does anyone have any suggestions as to how I can clean the body of incoming emails? I want to strip out disclaimers, images and maybe any previous email text that may be also be present so that I am left with just the body text content. My guess is it isn't going to...
{ "language": "en", "url": "https://stackoverflow.com/questions/366834", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How to localize Content of a Django application Hey, i am currently working on a django app for my studies, and came to the point of l18n. Localizing the site itself was very easy, but now i have to allow users, to translate the dynamic content of the application. Users can save "products" in the database and give t...
{ "language": "en", "url": "https://stackoverflow.com/questions/366838", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: How do you backup an apache Jackrabbit repository without shutting Jackrabbit down? When running Apache Jackrabbit JCR as an embedded service in your app, is there a quick way to get a sound and consistent backup of the contents of the Jackrabbit repository without shutting Jackrabbit down? If so how? A: See Backup...
{ "language": "en", "url": "https://stackoverflow.com/questions/366842", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Generating random fixed length permutations of a string Lets say my alphabet contains X letters and my language supports only Y letter words (Y < X ofcourse). I need to generate all the words possible in random order. E.g. Alphabet=a,b,c,d,e,f,g Y=3 So the words would be: aaa aab aac aba .. bbb ccc .. (the above sho...
{ "language": "en", "url": "https://stackoverflow.com/questions/366849", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: C# Decimal datatype performance I'm writing a financial application in C# where performance (i.e. speed) is critical. Because it's a financial app I have to use the Decimal datatype intensively. I've optimized the code as much as I could with the help of a profiler. Before using Decimal, everything was done with th...
{ "language": "en", "url": "https://stackoverflow.com/questions/366852", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "67" }
Q: jQuery UI Dialog Box - does not open after being closed I have a problem with the jquery-ui dialog box. The problem is that when I close the dialog box and then I click on the link that triggers it, it does not pop-up again unless I refresh the page. How can I call the dialog box back without refreshing the actual...
{ "language": "en", "url": "https://stackoverflow.com/questions/366854", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "79" }
Q: How to convert C# StructureMap initialization to VB.NET? I'm about to put my head thru this sliding glass door. I can't figure out how to execute the following code in VB.NET to save my life. private static void InitStructureMap() { ObjectFactory.Initialize(x => { ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366856", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Notify panel similar to stackoverflow's Remember the little div that shows up at the top of the page to notify us of things (like new badges)? I would like to implement something like that as well and am looking for some best practices or patterns. My site is an ASP.NET MVC app as well. Ideally the answers would inc...
{ "language": "en", "url": "https://stackoverflow.com/questions/366857", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "26" }
Q: When would you use the different git merge strategies? From the man page on git-merge, there are a number of merge strategies you can use. * *resolve - This can only resolve two heads (i.e. the current branch and another branch you pulled from) using 3-way merge algorithm. It tries to carefully detect criss-cr...
{ "language": "en", "url": "https://stackoverflow.com/questions/366860", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "462" }
Q: Java Driver.getConnection() yields "Connection Refused" from mysql on live system, not dev Pretty straightforward stuff, here -- I'm just not good enough with mysql to understand what it wants from me. I've got a short java test-case that opens a connection on mysql on my dev system but, when I try to put it to my s...
{ "language": "en", "url": "https://stackoverflow.com/questions/366861", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Is there a way to avoid row deletion on an specific table using constrains or triggers? Is there a way to avoid row deletion on an specific table using constrains? I'd like to (for example) deny row deletion if the id is 0,1 or 2 This is in order to avoid users deleting master accounts for an application, and I'd li...
{ "language": "en", "url": "https://stackoverflow.com/questions/366883", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Best way to use Javascript's "good parts" On Stackers' recommendation, I have been reading Crockford's excellent Javascript: The Good Parts. It's a great book, but since so much of it is devoted to describing the best way to use Javascript's basic functionality, I'm not sure how I can put his advice into practice wi...
{ "language": "en", "url": "https://stackoverflow.com/questions/366887", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: Change Backlight Brightness on iPhone Programmatically Does the SDK provide any way to change the brightness of the backlight, or turn it off temporarily? A: I'm trying to do the same thing. As it happens there are a number posts out there in the internets with "solutions" for this. The most detailed is here This ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366889", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How do I override methods of nested types? I've got a custom TObjectList descendant in Delphi 2009, and I'd like to play with its enumerator a bit and add some filtering functionality to the MoveNext method, to cause it to skip certain objects. MoveNext is called by DoMoveNext, which is a virtual method, so this sh...
{ "language": "en", "url": "https://stackoverflow.com/questions/366896", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Good design: How to pass InputStreams as argument? I've got a big file on which I'm opening a FileInputStream. This file contains some files each having an offset from the beginning and a size. Furthermore, I've got a parser that should evaluate such a contained file. File file = ...; // the big file long offset = 1...
{ "language": "en", "url": "https://stackoverflow.com/questions/366897", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: New iPhone App - How to Choose which Xcode Template to Use? In general I'd like to understand which templates to use when, when I'm making new iPhone apps. Could anyone offer some guidelines, tips, rules-of-thumb? Also, how much should I agonize over this? If I start off with the wrong one, can I add the missing p...
{ "language": "en", "url": "https://stackoverflow.com/questions/366899", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "19" }
Q: How to: Use a ConfigurationSection without loading it via the GetSection call I would like to load a specific ConfigurationSection but the way the CLR loads the assemblies is giving me some trouble: My CustomConfigurationSection definition is on a specific assembly which cannot be found by the overall process of ass...
{ "language": "en", "url": "https://stackoverflow.com/questions/366902", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Best way to test ASP.Net data-driven App I'm looking at setting up unit tests and integration testing, but I've run into the problem that the connection string in the web.config is unavailable for testing. The solution we've come up with to get around this is to have another connection string for testing, but I was ...
{ "language": "en", "url": "https://stackoverflow.com/questions/366912", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Basic Rails question: manually inserting a row into a database table I'm learning Rails and it's going well so far. My biggest question at the moment is: how do I go about manually inserting a row into my database? I've got the scaffolding in place for creating rows of DataTypeOne, but I want a row for DataTypeTwo t...
{ "language": "en", "url": "https://stackoverflow.com/questions/366913", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Limit Per Criteria I have an articles table and a categories table. I want to fetch 7 articles for each category. Currently I have this but it's terrible slow on large tables so it's not really a solution: SELECT id, title, categories_id, body, DATE_FORMAT(pubdate, "%d/%m/%y %H:%i") a...
{ "language": "en", "url": "https://stackoverflow.com/questions/366915", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Need advice on Windows to OS X Port Estimation and cost of dev. on OS X I am a 10year+, C++ linux/windows developer and I have been asked to estimate the effort to port the windows application to OS X. I haven't developed on OS X before,so I don't know what to expect. It is a C++/Qt application, so I want to ask: wh...
{ "language": "en", "url": "https://stackoverflow.com/questions/366923", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: LINQ to SQL auto-generated Extensibility Methods When I generate entity classes using LINQ to SQL I get what I want but I get also a bunch of other Extensibility Methods Definitions. For Example for myField (TEXT) I get: partial void OnMyFieldChanging(string value); partial void OnMyFieldChanged(); What's a c...
{ "language": "en", "url": "https://stackoverflow.com/questions/366926", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Invoking cl.exe (MSVC compiler) in Cygwin shell I'm heavily using Cygwin (with PuTTY shell). But, it's quite tricky to invoke cl.exe (that is, the Visual C++ compiler toolchain) in the Cygwin Bash shell. Running vcvars*.bat in the Bash shell doesn't work obviously. I tried to migrate VC++'s environment variables to...
{ "language": "en", "url": "https://stackoverflow.com/questions/366928", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "29" }
Q: Is it necessary to override bind:toObject:withKeyPath:options: in an NSView subclass to implement binding? I have an NSView subclass which has property which I want to be bindable. I've implemented the following in the subclass: myView.h: @property (readwrite, retain) NSArray *representedObjects; myView.m: @synthes...
{ "language": "en", "url": "https://stackoverflow.com/questions/366938", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }