text
stringlengths
8
267k
meta
dict
Q: C# Multiple Indexers Is it possible to have something like the following: class C { public Foo Foos[int i] { ... } public Bar Bars[int i] { ... } } If not, then are what are some of the ways I can achieve this? I know I could make functions called getFoo(int i) and getBar(in...
{ "language": "en", "url": "https://stackoverflow.com/questions/431339", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: Will providing APIs help deter screen scraping? I have been thinking quite a bit here lately about screen scraping and what a task it can be. So I pose the following question. Would you as a site developer expose simple APIs to prevent users from screen scraping, such as JSON results? These results could then implem...
{ "language": "en", "url": "https://stackoverflow.com/questions/431355", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: How-To Mock WCF Services? How-to Mock WCF Services Proxies with Rhino Mocks ? A: Create your service so that it implements an interface. Then you can either mock the interface in your client or create a fake implementation of the interface to use in your tests. A: I know this is an old post but it something that ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431363", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How to make a progress-bar in copy or query? How can I make a progress-bar in copy or SQL query or file transfer (rapi)? Or some thing's that I can't measure? Thanks for any help. A: Set the progress bar to marquee instead of progress. This will let your users know that something is still happening without providi...
{ "language": "en", "url": "https://stackoverflow.com/questions/431377", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to resolve ambiguous column names when retrieving results? I have two tables in my database: NEWS table with columns: * *id - the news id *user - the user id of the author) USERS table with columns: * *id - the user id I want to execute this SQL: SELECT * FROM news JOIN users ON news.user = user.id ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431391", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "76" }
Q: What can I do with OpenSocial in terms of building 3rd party apps? I have read the Open Social blog and am trying to build an app for one of the third parties that uses the Open Social model for their applications. And I'm still not clear what it enables me to do with our application, could someone provide an OpenSo...
{ "language": "en", "url": "https://stackoverflow.com/questions/431409", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: GridView with Pager TopAndBottom I have extended the standard GridView control in ASP.NET. Basically it is just the same, but paging and sorting is done using callbacks. I have successfully created my own PagerTemplate, but it only works when PagerSettings.Position is set to Top. I want to have the pager at both the...
{ "language": "en", "url": "https://stackoverflow.com/questions/431413", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Class vs Struct for data only? Is there any advantage over using a class over a struct in cases such as these? (note: it will only hold variables, there will never be functions) class Foo { private: struct Pos { int x, y, z }; public: Pos Position; }; Versus: struct Foo { struct Pos { int x, y, z...
{ "language": "en", "url": "https://stackoverflow.com/questions/431429", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: A cross platform process manager tool I need a program that is able to launch a set of processes according to a schedule/configuration; the program would run in the background and restart the processes in case they crash. There are standard tools for this kind of task on both windows and unix - what I need is a cros...
{ "language": "en", "url": "https://stackoverflow.com/questions/431431", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Restarting a Python Interpreter Quietly I have a python interpreter embedded inside an application. The application takes a long time to start up and I have no ability to restart the interpreter without restarting the whole application. What I would like to do is to essentially save the state of the interpreter and ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431432", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: How to deploy web app directly from Visual Studio 2008? I used to use discountasp.net and I can use Visual Studio 2008 to "publish" the website directly to the web host. I am using a dedicated server now (well, to be exact, Amazon EC2 Windows), how should I setup the web server so I can deploy the website directly f...
{ "language": "en", "url": "https://stackoverflow.com/questions/431443", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Will F# perform well when writing math functions for a C# program? Does anyone know how well F# measures with regards to performance, compared to C#. I have a C# raytracer with a lot of vector manipulations, ray-collission algorithms etc. and thought they might be more easily expressed in F#. I'm not asking for how ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431444", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Class not registered HRESULT 0x80040154 I'm using the .NET framework version 6.0 on Windows Vista. I recently installed a program that displays charts. When I open it, I get an error message from the Microsoft .NET framework: Class not registered (exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). How do I...
{ "language": "en", "url": "https://stackoverflow.com/questions/431455", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Can you define your own template variables in Eclipse In Eclipse there are templates that help you by automatically inserting some code or comments. You can edit these templates yourself via Preferences > Java > Editor > Templates. There are so-called "template variables" that you can use to make these templates a l...
{ "language": "en", "url": "https://stackoverflow.com/questions/431465", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "22" }
Q: Building a vertical IE Explorer Bar (Band Object) (like Favorites Panel) I am trying to build a vertical explorer bar (band object in IE7 that "sticks" across all tabs (similar to the "Favorites" bar). In case you don't know I'm talking about, open up IE7 and go to View->Explorer Bar->Research to open the Research b...
{ "language": "en", "url": "https://stackoverflow.com/questions/431467", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How expensive is it to dereference a pointer? How expensive is it to perform the dereference operation on a pointer? I can imagine that the memory transfer is somehow proportional to the object size, but I want to know how expensive the dereference operation part is. A: Dereferencing, when translated into machine c...
{ "language": "en", "url": "https://stackoverflow.com/questions/431469", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "52" }
Q: window border width and height in Win32 - how do I get it? ::GetSystemMetrics (SM_CYBORDER) ...comes back with 1 and I know the title bar is taller than ONE pixel :/ I also tried: RECT r; r.left = r.top = 0; r.right = r.bottom = 400; ::AdjustWindowRect (& r, WS_OVERLAPPED, FALSE); _...
{ "language": "en", "url": "https://stackoverflow.com/questions/431470", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "32" }
Q: Alternative document structure in JTextPane? In a JTextPane with a DefaultStyledDocument the document structure (hierarchy of Element objects) ends with a LeafElement that spans all the character of the enclosing paragraph. Is there a way to customize the document such that each leaf element will represent a single ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431481", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: iphone: Sending multitouch from the device to the simulator? I need to record a video of a multitouch game I'm working on, and I'd like to record it from the simulator. My idea was to send touches from the device to the simulator (like this project does with the accelerometer). Just by googling I haven't found anyth...
{ "language": "en", "url": "https://stackoverflow.com/questions/431485", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Wiki rendering in GWT Client side rendering is useful when we want to use wiki like syntax. Unfortunately I have not found any library which gives wiki syntax rendering in GWT client side. Does anyone knows such an API/library? A: Also quite nice: http://code.google.com/p/gwtwiki/ A: Sounds like you want a Javasc...
{ "language": "en", "url": "https://stackoverflow.com/questions/431491", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: JSON Syntax: Transmitting an array A valid JSON Syntax is something of the kind: { "username": "admin", "password": "123" } But what if I want to transmit an array of 'users' (given the example), instead of a single 'user' ? Is the code below Valid JSON, according to the specifications? [{ "username": "admin"...
{ "language": "en", "url": "https://stackoverflow.com/questions/431494", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Cascade.SaveOrUpdate (SQLite) fluent-nhibernate I have a many-to-many relationship between two classes: Tournament and Players I set Cascade.SaveUpdate in the mappings, but when saving a Tournament instance, the Players will not be saved to the Players table. Nhibernate only writes parent and child key columns in th...
{ "language": "en", "url": "https://stackoverflow.com/questions/431509", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Determine if table exists in SQL Server CE? I know this is similar to this question, but I'm using SQL Server CE 3.5 with a WinForms project in C#. How can I determine whether a table exists? I know the IF keyword is not supported, though EXISTS is. Does information_schema exist in CE where I can query against it...
{ "language": "en", "url": "https://stackoverflow.com/questions/431511", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: Run a command in a shell and keep running the command when you close the session I am using Putty to connect to a remote server. What I want to know is if there is any way to write my commands and allow them to keep running after I close the session with Putty. The reason for this is that I do not want to keep the c...
{ "language": "en", "url": "https://stackoverflow.com/questions/431521", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "36" }
Q: Ambiguous type variable error msg I don't think it is a bug, but I am a bit puzzled as to why that doesn't work. A bonus question is why does it mention variable e? There is no variable e. Prelude> :m +Control.Exception Prelude Control.Exception> handle (\_-> return "err") undefined <interactive>:1:0: ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431527", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "22" }
Q: C++: Dynamically loading classes from dlls For my current project I want to be able to load some classes from a dll (which is not always the same, and may not even exist when my app is compiled). There may also be several alternative dll's for a given class (eg an implementation for Direct3D9 and one for OpenGL), bu...
{ "language": "en", "url": "https://stackoverflow.com/questions/431533", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "30" }
Q: Searching for exact phrase How do i achieve "Exact Phrase" functionality on this field using BooleanQuery/any other class? For example if a user types in "top selling book" then it should return books which has this phrase in its description. Thanks again! A: Having the query within double quotes should work.
{ "language": "en", "url": "https://stackoverflow.com/questions/431556", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: ASP.net: Display PDF in a asp.net web page User click on a link button and it will direct them to a url that is dynmaically generated which a pdf file. The browser will prompt the user to either save or open it. I want to know if it is possible to downlaod the pdf file to the server then show the pdf file in the asp...
{ "language": "en", "url": "https://stackoverflow.com/questions/431560", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: PHP: Is it better to concatenate on 1 line or multiple lines? Or is there a difference? Is there a difference or is one better than the other of the following: $var = ''; ... $var .= 'blah blah'; $var .= $var2; $var .= 'blah blah'; Or $var = ''; ... $var .= 'blah blah' . $var2 . 'blah blah'; Is there a speed diffe...
{ "language": "en", "url": "https://stackoverflow.com/questions/431569", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Concat in MySQL with condition I have three columns in my table - company_name, first_name, last_name. In the result of a SELECT, I'd like to have only one column: name, which should contain content of company_name if it's not NULL or concatenation of first_name +' '+ last_name, if the company_name is not set. Any ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431571", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Swing components inside HTML Does anybody know of a pure java (ar at least cross platform) open source component/library which displays HTML which can contain swing components inside it? All I could find were either abandoned or incomplete. I am asking because I'm thinking about trying out approach to do use this co...
{ "language": "en", "url": "https://stackoverflow.com/questions/431579", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How can I consume IIS7's FREB programatically IIS 7 has a very useful feature called Failed Request Tracing (FREB for short). It has a very nice visualization feature, involving an extremely complex XSL stylsheet that parses the results into a useful treeview. I, however, want to consume FREB programatically, and be...
{ "language": "en", "url": "https://stackoverflow.com/questions/431581", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How should I start designing an AI algorithm for an artillery warfare game? Here's the background... in my free time I'm designing an artillery warfare game called Staker (inspired by the old BASIC games Tank Wars and Scorched Earth) and I'm programming it in MATLAB. Your first thought might be "Why MATLAB? There ar...
{ "language": "en", "url": "https://stackoverflow.com/questions/431586", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "19" }
Q: Compression to Improve Hard Disk Write Performance On a modern system can local hard disk write speeds be improved by compressing the output stream? This question derives from a case I'm working with where a program serially generates and dumps around 1-2GB of text logging data to a raw text file on the hard disk an...
{ "language": "en", "url": "https://stackoverflow.com/questions/431594", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Windows Home Server backup solution I admit this is not strictly a programming question, although I do use my WHS as a source repository server for home projects, and I'm guessing many other coders here do as well. Does anyone have a recommendation for a good backup solution for the non-fileshare portion of Windows ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431605", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Zipcode to city/state look-up XML file? Trying to find an XML file I can use in lieu of a look-up database table until we get our web hosting switched over to the right DB. Can anyone refer me to an XML file with elements whose children have zipcodes, states, and cities? E.g.: <zip code="98117"> <state>WA</state...
{ "language": "en", "url": "https://stackoverflow.com/questions/431616", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Overriding id on create in ActiveRecord Is there any way of overriding a model's id value on create? Something like: Post.create(:id => 10, :title => 'Test') would be ideal, but obviously won't work. A: we can override attributes_protected_by_default class Example < ActiveRecord::Base def self.attributes_prote...
{ "language": "en", "url": "https://stackoverflow.com/questions/431617", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "111" }
Q: What's the best IPC mechanism for medium-sized data in Perl? I'm working on designing a multi-tiered app in Perl and I'm wondering about the pros and cons of the various IPC mechnisms available to me. I'm looking at handling moderately-sized data, typically a few dozen kilobytes but up to a couple of megabytes, and...
{ "language": "en", "url": "https://stackoverflow.com/questions/431623", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: How to combine multiple querysets in Django? I'm trying to build the search for a Django site I am building, and in that search, I am searching in three different models. And to get pagination on the search result list, I would like to use a generic object_list view to display the results. But to do that, I have to ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431628", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "804" }
Q: Specify XBAP at runtime, in my .NET WPF application? Can I host an XBAP in my WPF application dynamically? Can I download an XBAP, set it to be hosted in my WPF application, and interact with it programatically? A: I would assume "yes", since you can always place a WebBrowser control in your application and then c...
{ "language": "en", "url": "https://stackoverflow.com/questions/431632", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Grails, Inserting lots of data using withTransaction results in OutOfMemoryError I'm using Grails 1.1 beta2. I need to import a large amount of data into my Grails application. If I repeatedly instantiate a grails domain class and then save it, the performance is unacceptably slow. Take for example importing people ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431635", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: Win32 equivalent of opendir Would anyone know what the Win32 equivalent of opendir is (or if it even exists) ? Obviously I could use FindFirstFile(Ex) with FindNextFile, but appending * to the path seems like such a hackish way to do it. A: FindFirstFile and FindNextFile are the appropriate Win32 APIs. Assuming you...
{ "language": "en", "url": "https://stackoverflow.com/questions/431638", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: SerializationException when setting instance of one class to another I'm trying to pass an instance of a class between two separate classes, like the following. //classes public class A { public string name; public string data; } public class B : MarshalByRefObject { public A _a; } public class C : Marshal...
{ "language": "en", "url": "https://stackoverflow.com/questions/431642", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How can you access a set of photos with the iPhone SDK? I know that I can access the camera or show the image picker to the user, but what if I just wanted to pick 10 photos, randomly, from the images stored on the device with no user interaction? Using UIImagePickerController gives me the ability to use the camera...
{ "language": "en", "url": "https://stackoverflow.com/questions/431643", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How can I hook into the current FormsAuthenticationModule in a Medium Trust environment? I've got an HttpModule in my application that hooks into the FormsAuthenticationModule's Authenticate event with the following code: public void Init(HttpApplication context) { FormsAuthenticationModule faModule = (F...
{ "language": "en", "url": "https://stackoverflow.com/questions/431644", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Determining if a position is free in a Closed Hashing How would you go about determining whether a position is already occupied or not? When the memory is allocated, all that there is in it is garbage (in C++, which is what I'm using atm). I was thinking of using an auxiliary array of bools to know whether the posit...
{ "language": "en", "url": "https://stackoverflow.com/questions/431647", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Learn C# on mac? Is mono the only route , any specific visual studio like editors that you recommend? A: Yeah, mono is really your only option, unless some undergrad somewhere has developed some very experimental thing I don't know about. As for an IDE, well I believe the only thing half way stable that will work r...
{ "language": "en", "url": "https://stackoverflow.com/questions/431648", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: Disabling seam's redirect filter I'm doing a project in seam that requires restful URLs. I have a view that is mapped to /group/{group}/{locale}. On that page I have a list of so called messages. Each message has a button to save changes to the message. This is linked to an action bean like this: <h:commandButton ty...
{ "language": "en", "url": "https://stackoverflow.com/questions/431652", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Is there a "Group Box" equivalent in Java Swing? Trying to build a GUI application in Java/Swing. I'm mainly used to "painting" GUIs on the Windows side with tools like VB (or to be more precise, Gupta SQLWindows... wonder how many people know what that is ;-)). I can't find an equivalent of a Group Box in Swing......
{ "language": "en", "url": "https://stackoverflow.com/questions/431654", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "60" }
Q: How would I add new data via a REST service opposed to RPC style service? I'm still learning about REST and, in my test, came up with this scenario I don't know how to deal with. I have an existing sample WCF service which uses Linq-to-Sql. Its a tremendously simple database with a single table called "Tasks" which...
{ "language": "en", "url": "https://stackoverflow.com/questions/431658", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: VisualEditor in Java - dynamically build sub-panel? I'm using the "Visual Editor" to "paint" my Swing GUI. Can I dynamically build the contents of a sub-panel with VE or do I have to use a predefined sub-class of JPanel (and build that with VE)? A: You can dynamically build the contents of a sub panel - say based o...
{ "language": "en", "url": "https://stackoverflow.com/questions/431663", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Does anybody have experience with Visual Studio 2008 on Windows 7? Has anyone already tried this, anything particulair that I need to be aware of? A: Yep, been running it for a while and I haven't hit any problems yet. Can't say I've use it all day every day, but I've built WPF, WinForms, Web and Console apps with ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431667", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How to translate strings in JS I have a project which I want to translate into multiple languages for the PHP Part I use Zend Frameworks Zend_Translate with GetText. Now I want to translate the JS part too. I am using the jQuery JS Framework and would love to hear your thoughts on translation for JS files A: http:/...
{ "language": "en", "url": "https://stackoverflow.com/questions/431672", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Does Resharper support RowTest? Resharper doesn't recognise Rowtests, is this normal? Is there anyway to fix it? (other than splitting rowtest manually) A: Install Gallio www.gallio.org it has a ReSharper plugin that lets you run NUnit/MbUnit row tests
{ "language": "en", "url": "https://stackoverflow.com/questions/431673", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Equivalent of shell 'cd' command to change the working directory? cd is the shell command to change the working directory. How do I change the current working directory in Python? A: You can change the working directory with: import os os.chdir(path) There are two best practices to follow when using this method: ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431684", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "828" }
Q: Windows Vista Desaturated: Grayscale UI Occasionally working in Windows Vista the O.S. will desaturate the screen, rendering all colors as grayscale. Is there a way to do this programatically? Failing that, is there a way to do it by tweaking Vista settings? Thanks. A: Umm, if I had to guess, I'd say that Vista (an...
{ "language": "en", "url": "https://stackoverflow.com/questions/431686", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: UIImageView animations slow I've got a UIImageView with about 10 full-screen jpegs, totalling about 128k. Throwing these into theUIImageView with setAnimationImages works like a champion in the emulator until I try to run it on the iPhone which results in a fail. Is something wrong here? I would think with all the f...
{ "language": "en", "url": "https://stackoverflow.com/questions/431696", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: benefits of "HTTP authentication with PHP" what are the benefits of using HTTP authentication with PHP (HTTP 401 headers) instead of using a normal form submit authentication?? A: Your question is a bit vague, but the general answer is that using this method gives you a more "RESTful" implementation that follows wh...
{ "language": "en", "url": "https://stackoverflow.com/questions/431698", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Are AVL trees always a subset of red black trees? I am searching for a proof that all AVL trees can be colored like a red-black tree? Can anyone give the proof? A: By definition R/B trees can be slightly less balanced then AVL-s, as |maxPath - minPath| must be <= 1 for AVLs and maxPath <= 2 * minPath for R/Bs so t...
{ "language": "en", "url": "https://stackoverflow.com/questions/431714", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Why is it "impossible" to implement garbage collection in C because of weak typing? I was told by a rather smart person that you cannot implement garbage collection in C because of it's weakly typed. The basic idea seems to be that C gives you too much freedom. He mentioned casting pointers without type checking... ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431719", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "21" }
Q: Is there an easier way of using extension methods in Powershell v2 Background this post explains how one can consume extension methods in Powershell http://community.bartdesmet.net/blogs/bart/archive/2007/09/06/extension-methods-in-windows-powershell.aspx Compare this to what someone does in C# - they add a "using S...
{ "language": "en", "url": "https://stackoverflow.com/questions/431727", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: script to manipulate the dhcp/conf i want to write a script to manipulate the dhcp.conf file. which in the sense, it has to read the file and it should ping all the lease IP and should give another text file, in which it should give the list of IPs, which devices are now existing. EDIT: thanks for your swift reply. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431736", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Displaying a Django query result in HTML - table, list, css divs? I am working on an django application that will return what historically was a table of information: ISSUE DESCRIPTION INITIATOR INITIATEDDATE ASSIGNEE FORECASTDATE STATUS REMARKS That will be the entrance point for users to sort / filter, etc...
{ "language": "en", "url": "https://stackoverflow.com/questions/431738", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Highlighted squares on a CustomControl chessboard don't persist beyond the initial MouseDown event I've been coding a Windows app chess game in C# as an exercise in honing my skills, and also because it's fun. I have included functionality that allows a player to select the option to highlight the squares a piece ca...
{ "language": "en", "url": "https://stackoverflow.com/questions/431739", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Combobox with image - passing value to drawItem event I have a C# app with a combo box. I was add items to it in the usual way using a loop to loop through some objects and add each name property value to the combobox: comboBox1.Items.Add(object.name); But then I decided I would like to display an image by the tex...
{ "language": "en", "url": "https://stackoverflow.com/questions/431749", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Python csv.reader: How do I return to the top of the file? When I'm moving through a file with a csv.reader, how do I return to the top of the file. If I were doing it with a normal file I could just do something like "file.seek(0)". Is there anything like that for the csv module? Thanks ahead of time ;) A: You ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431752", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "59" }
Q: Get SSID of the wireless network I am connected to with C# .Net on Windows Vista I'd like to know if there is any .Net class that allows me to know the SSID of the wireless network I'm connected to. So far I only found the library linked below. Is the best I can get or should I use something else? Managed WiFi (http...
{ "language": "en", "url": "https://stackoverflow.com/questions/431755", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "27" }
Q: Systeminfo: Product ID If you type systeminfo at the command prompt, there is a listing for Product ID. Can someone explain what this is exactly, and would it make a good seed for a registration code algorithm? A: It's a good start. But (IMHO) you can use directly a GUID. Read more here: http://en.wikipedia.org/w...
{ "language": "en", "url": "https://stackoverflow.com/questions/431759", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Storing Images to use in application I would like to store some images to use in my C# application. They are png files and are currently in a folder with the dlls. Ideally I would like to have them included with the dll so i dont have to include the actual images with the installation. What is the best way to do...
{ "language": "en", "url": "https://stackoverflow.com/questions/431760", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Asp.net Request.Browser.Crawler - Dynamic Crawler List? I learned Why Request.Browser.Crawler is Always False in C# (http://www.digcode.com/default.aspx?page=ed51cde3-d979-4daf-afae-fa6192562ea9&article=bc3a7a4f-f53e-4f88-8e9c-c9337f6c05a0). Does anyone uses some method to dynamically update the Crawler's list, so R...
{ "language": "en", "url": "https://stackoverflow.com/questions/431765", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: C# Do I need TRY/CATCH in order to throw? If all I want to do is throw the exception up a level when it occurs? private void TryCatch() { try { foo(); } catch (Exception ex) { throw; } } private void NoTryCatch() { foo(); } Aren't these two methods the same? If an exception occ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431785", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Programmatically Update an attribute in Core Data I've looked through all the class documentation for Core Data and I can't find away to programmatically update values in a core data entity. For example, I have a structure similar to this: id | title ============ 1 | Foo 2 | Bar 3 | FooFoo Say that I...
{ "language": "en", "url": "https://stackoverflow.com/questions/431797", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "19" }
Q: On a Silverlight 2 datagrid, how can I get a collection of only the rows that are edited? I load data into my grid using a WCF service. When a user clicks 'Submit' on my silverlight 2 control, I want to send only the edited rows back to my WCF service for updating. Is there a good way to do this? A: Its better if...
{ "language": "en", "url": "https://stackoverflow.com/questions/431803", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: MySQL error when deploying .NET application I'm attempting to install a MYSQL driven .net application to a Windows XP sp2 machine. The development machine is the same OS. The application and all connectivity work fine on my machine (the developers mantra), but I receive the following error on the installation machin...
{ "language": "en", "url": "https://stackoverflow.com/questions/431821", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do I join multiple tables in SQL whose objects will be modeled using inheritance? For my university assignment I have to design some basic managment system for sicknesses and all for a school. I have decided to model some basic inheritance in the form of * *Person --> Student *Person --> Staff *Person --> ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431825", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Making GET and POST Requests from an iPhone Application - Clarification Needed I'm following along with this useful looking answer to my question. It seems to be working, but here are two questions I have: * *How do I detect an HTTP error? The didFailWithError method doesn't seem to be getting called? UPDATE: ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431826", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Message Window C++ Win32 class/example Is there a class/example application for a message-only window that is in C++ Win32? A: From the docs for CreateWindow: hWndParent [in] Handle to the parent or owner window of the window being created. To create a child window or an owned window, supply a valid wind...
{ "language": "en", "url": "https://stackoverflow.com/questions/431827", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Capturing the image of a web page using Firefox and Safari I have a utility that I put together that uses the .NET Framework to capture an image of a web page so that I can use the thumbnail image to preview a page. There are sites which offer this service like websnapr.com, kwiboo.com and shrinktheweb.com. I would ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431833", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Get Domain LogonServer in C# In a command prompt I am able to get the domain logon server by typing: echo %logonserver% How can I get this same result in C#? A: System.Environment.GetEnvironmentVariable("logonserver")
{ "language": "en", "url": "https://stackoverflow.com/questions/431836", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: is it possible to do inline function in vb.net? the question is in the title A: Inlining is the responsibility of the CLR (JIT) and there are some conditions as to when a function is inlined: * *The code size is smaller than 32 bytes of IL. *The function does not contain "complex" constructs, e.g. loops, switch...
{ "language": "en", "url": "https://stackoverflow.com/questions/431839", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: How to render decoded HTML in a (i.e. a ) in GridView cell I'm binding a GridView to an LINQ query. Some of the fields in the objects created by the LINQ statement are strings, and need to contain new lines. Apparently, GridView HTML-encodes everything in each cell, so I can't insert a <br /> to create a new line wi...
{ "language": "en", "url": "https://stackoverflow.com/questions/431840", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "30" }
Q: Mesh rendering using Octree algorithm I'm the founder of SceneMax - a 3D scripting language since 2005. I want to add a scene rendering using one mesh object built with 3d package like 3ds max and split by octree algorithm for optimized performance. Do you know where can I find an algorithm which takes a mesh .X fi...
{ "language": "en", "url": "https://stackoverflow.com/questions/431841", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: jQuery each tr.children is undefined in Firefox 3.0 I have a snippet of code that I'm working with to filter rows in a table. It works perfectly in every browser other than Firefox v3.0.x (works fine with 3.1 beta 2). When I run the snippet in Firefox 3.0.x, it says that children is undefined. I am using jQuery v...
{ "language": "en", "url": "https://stackoverflow.com/questions/431861", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Ignore python multiple return value Say I have a Python function that returns multiple values in a tuple: def func(): return 1, 2 Is there a nice way to ignore one of the results rather than just assigning to a temporary variable? Say if I was only interested in the first value, is there a better way than this:...
{ "language": "en", "url": "https://stackoverflow.com/questions/431866", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "379" }
Q: Best database independent SQL DDL utility? I'm working on a project for the .net platform and would like to support multiple database types. I would like to keep the DDL under source control in a generic format then convert it to database specific DDL for deployment. So I'm looking for utilities that will convert ge...
{ "language": "en", "url": "https://stackoverflow.com/questions/431875", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Linked drop down lists and load div I'm kind of new when it comes to programming but am trying to learn. What I need to do for my site is have 2 or 3 linked drop-down menus so when I select an item from the first one, the second one will refresh with other options. I have found a way to do this using Java but I cann...
{ "language": "en", "url": "https://stackoverflow.com/questions/431876", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Which SCM system for Xcode? I am developing an application for the Mac as a small team (me + another person) effort. We are located in different cities, and have started to see the need for solid source control management. None of us have any experience with this, and both of us are relatively new to Cocoa/Obj-C/Xco...
{ "language": "en", "url": "https://stackoverflow.com/questions/431881", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "21" }
Q: Vertical to Horizontal? I have a PostgreSQL table that looks like this: A -> B A -> C A -> G A -> H B -> O B -> K Where "->" separates two columns where the first points to the second (hyperlinks). Now I would like to take all distinct values in the first column and assign them an ARRAY containing all values to whi...
{ "language": "en", "url": "https://stackoverflow.com/questions/431882", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Best query syntax for nested tables? I have a numerical field called category_id in my table. I want to do something like this. $ids=implode(',',$id_array); $sql="SELECT * FROM myTbl WHERE IN(category_id,'$ids')"; Which should output something like: SELECT * FROM myTbl WHERE IN(category_id,'1,2,3,4,5,6'); Is this...
{ "language": "en", "url": "https://stackoverflow.com/questions/431884", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Is possible send a array in Obj-c for a variable arguments function? In python it is easy to build a dictionary or array and pass it unpacked to a function with variable parameters I have this: - (BOOL) executeUpdate:(NSString*)sql, ... { And the manual way is this: [db executeUpdate:@"insert into test (a, b, c, d,...
{ "language": "en", "url": "https://stackoverflow.com/questions/431910", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Namespace Rule of Thumb Is there a general rule of thumb as to how many classes, interfaces etc should go in to a given name space before the items should be further classfied in to a new name space? Like a best practice or a community preference? Or is this all personal preference? namespace: MyExample.Namespace ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431911", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Way to get all alphabetic chars in an array in PHP? Is there a way to get all alphabetic chars (A-Z) in an array in PHP so I can loop through them and display them? A: PHP has already provided a function for such applications. chr(x) returns the ascii character with integer index of x. In some cases, this approach ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431912", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "197" }
Q: How do you import a large MS SQL .sql file? I use RedGate SQL data compare and generated a .sql file, so I could run it on my local machine. But the problem is that the file is over 300mb, which means I can't do copy and paste because the clipboard won't be able to handle it, and when I try to open the file in SQL S...
{ "language": "en", "url": "https://stackoverflow.com/questions/431913", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "274" }
Q: Capistrano is hanging when prompting for SUDO password to an Ubuntu box I have a capistrano deployment recipe I've been using for some time to deploy my web app and then restart apache/nginx using the sudo command. Recently cap deploy is hanging when I try to execute these sudo commands. I see the output: "[sudo]...
{ "language": "en", "url": "https://stackoverflow.com/questions/431925", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: How to set default WPF Window Style in app.xaml? I am trying to set the default Style for every window in my WPF Windows application in my app.xaml. So far i have this in app.xaml: <Application.Resources> <ResourceDictionary> <Style x:Key="WindowStyle" TargetType="{x:Type Window}"> <Setter Pr...
{ "language": "en", "url": "https://stackoverflow.com/questions/431940", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "66" }
Q: NHibernate generated GUID - field type I'm new to NHibernate. If I use NHibernate to generate GUIDs for inserts to MS Sql2005, what type does the id field in the db need to be. Any help appreciated. Thanks A: uniqueidentifier
{ "language": "en", "url": "https://stackoverflow.com/questions/431942", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Unpack to unknown number of variables? How could I unpack a tuple of unknown to, say, a list? I have a number of columns of data and they get split up into a tuple by some function. I want to unpack this tuple to variables but I do not know how many columns I will have. Is there any way to dynamically unpack it to a...
{ "language": "en", "url": "https://stackoverflow.com/questions/431944", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: asp.net mvc routing when passed parameter contains dot I have very basic routing: routes.MapRoute( "Default", "{controller}/{action}/{id}",parameters new { controller = "Home", action = "Index", id = "" } ); ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431945", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Why would @@IDENTITY or SCOPE_IDENTITY() be DBNull? (resolved: see bottom) I have the following code snippet: Protected Sub SqlDataSource1_Inserted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs) Handles SqlDataSource1.Inserted affected = CInt(DirectCast(e.Command.Para...
{ "language": "en", "url": "https://stackoverflow.com/questions/431955", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: When destructuring tuples in Haskell, where can the elements be used? I am reading a tutorial that uses the following example (that I'll generalize somewhat): f :: Foo -> (Int, Foo) ... fList :: Foo -> [Int] fList foo = x : fList bar where (x, bar) = f foo My question lies in the fact that it seems you can re...
{ "language": "en", "url": "https://stackoverflow.com/questions/431956", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }