text
stringlengths
8
267k
meta
dict
Q: How to create a small widget with JavaScript I really don't know how to describe it, but if you understood it and had experience on that field, may be you can help me with something 'Open Source' and 'Ready-made'. I want to create something like a box 'or widget', where you can change its content by hitting some but...
{ "language": "en", "url": "https://stackoverflow.com/questions/326058", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-4" }
Q: How to make floating divs fill up space I'm trying to create a "workflow" bar on a web page. The items in the workflow might be of different lengths. There might be enough items to fill the width of the screen, hence the flow needs to wrap onto the next line. I'm using left floating divs to do this. However, I'd li...
{ "language": "en", "url": "https://stackoverflow.com/questions/326059", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: variable.ToString() vs. Convert.ToString(variable) Let's say I have an integer that I need to convert to a string (I might be displaying the value to the user by means of a TextBox, for example. Should I prefer .ToString() or Convert.ToString(). They both do the same thing (don't they?). int someValue = 4; // You c...
{ "language": "en", "url": "https://stackoverflow.com/questions/326060", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: In STL maps, is it better to use map::insert than []? A while ago, I had a discussion with a colleague about how to insert values in STL maps. I preferred map[key] = value; because it feels natural and is clear to read whereas he preferred map.insert(std::make_pair(key, value)). I just asked him and neither of us ca...
{ "language": "en", "url": "https://stackoverflow.com/questions/326062", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "209" }
Q: How to control Video Cam connected to Firewire using a program I need to control (play,rewind,stop) my Video Cam connected to firewire of my PC Is this possible. My program is written in .NET Thanks Anon A: This is done through DirectShow which is part of the Windows SDK. Take a look at the DVApp sample.
{ "language": "en", "url": "https://stackoverflow.com/questions/326063", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Conception of inheritance in object-oriented languages I was discussing multiple inheritance vs. single inheritance with a friend of mine, and discovered that plainly, my conception of Object-Oriented design is completely different than his. I am mostly an Obj-C programmer, so Multiple Inheritance is not something I...
{ "language": "en", "url": "https://stackoverflow.com/questions/326068", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to identify if a webpage is being loaded inside an iframe or directly into the browser window? I am writing an iframe based facebook app. Now I want to use the same html page to render the normal website as well as the canvas page within facebook. I want to know if I can determine whether the page has been loade...
{ "language": "en", "url": "https://stackoverflow.com/questions/326069", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "747" }
Q: Which is preferred CTabCtrl vs. CPropertySheet in MFC? I don't know how to use both of them. So a sample code with pros and cons is perfect. Which one is preferred? Why? A: Neither is preferred, they serve different purposes. If you want a dialog with several pages, use a CPropertySheet. If you need a dialog with s...
{ "language": "en", "url": "https://stackoverflow.com/questions/326079", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Sorting in XSLT v1.0 to obtain the greatest value, a new question I have an XML document with several <person> elements, each of which contains the <name> of the person, and several <preferred-number> elements inside a grouping <preferred-numbers> element. I already found that to obtain the greatest <preferred-numb...
{ "language": "en", "url": "https://stackoverflow.com/questions/326084", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Why do I have to cast enums to int in C#? This is my code: internal enum WindowsMessagesFlags { WM_EXITSIZEMOVE = 0x00000232, WM_DISPLAYCHANGE = 0x0000007e, WM_MOVING = 0x00000216, } protected override void WndProc(ref Message m) { switch(m.Msg) { case (int)WindowsMessage...
{ "language": "en", "url": "https://stackoverflow.com/questions/326098", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Why is this regex returning errors when I use it to fish img src's from HTML? I'm writing a function that fishes out the src from the first image tag it finds in an html file. Following the instructions in this thread on here, I got something that seemed to be working: preg_match_all('#<img[^>]*>#i', $content, $mat...
{ "language": "en", "url": "https://stackoverflow.com/questions/326103", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What are the Advantages of Using OnAsyncPostBackError over Page_Error I am currently researching an exception handling architecture for our App. We will be using UpdatePanels extensively and we will also be calling Webservices. I want to know if there is any real need to implement a ScriptManager.OnAsyncPostBackErr...
{ "language": "en", "url": "https://stackoverflow.com/questions/326106", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Flex intellisense forgets flash.* I am using Eclipse 3.3.2 with the Flex Builder Plugin (3.0.194161) and the Flex SDK 3.2. Recently the intellisense has started forgetting about everything in the flash.* package EXCEPT flash.errors.* The code still compiles, but attempting to automatically resolve something (CTRL+SP...
{ "language": "en", "url": "https://stackoverflow.com/questions/326110", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Single statement method to remove elements from container Is there a single algorithm that removes elements from a container as happens in the following code? vec_it = std::remove_if( vec.begin(), vec.end(), pred ); vec.erase( vec_it, vec.end() ); A: The idiomatic way to do it is like jalf has said. You can build ...
{ "language": "en", "url": "https://stackoverflow.com/questions/326112", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Is there a way to run ActiveX components in Firefox through the use of a plugin? I have an ActiveX plugin that we need (if possible) to run in Firefox. Is there a plugin (or other way) for Firefox that will allow this? A: I seem to have found a solution: http://code.google.com/p/ff-activex-host/ "This Firefox plugi...
{ "language": "en", "url": "https://stackoverflow.com/questions/326125", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Writing a method based on the value of an enumeration without falling into a code smell Imagine I have a document (word document). I have an enumeration which will indicate how to extract data from the document. So if I want just text, the images, or both (3 members of the enumeration). I have a case statement based...
{ "language": "en", "url": "https://stackoverflow.com/questions/326128", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How to get MethodInfo of a generic method? I am trying to get a MethodInfo object for the method: Any<TSource>(IEnumerable<TSource>, Func<TSource, Boolean>) The problem I'm having is working out how you specify the type parameter for the Func<TSource, Boolean> bit... MethodInfo method = typeof(Enumerable).GetMetho...
{ "language": "en", "url": "https://stackoverflow.com/questions/326136", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Defining templates for common look and feel pragmatically I have a new project which simply put, is an attempt to formalize the look and feel of all of our departmental pages. I Googled around and found many tutorials which discussed the pros and cons of several techniques. And from what I've been reading, the thing...
{ "language": "en", "url": "https://stackoverflow.com/questions/326141", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: BlogEngine.Net Code Formatting Extension that works? For months now I've been trying to find a code syntax formatting extension that works for BlogEngine.Net. I'm not fond of the behavior of the default formatting extension, and have tried a couple of others (manoli is among them), but they always seem to interact ...
{ "language": "en", "url": "https://stackoverflow.com/questions/326160", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: network drive file sharing For the better part of 10 years + we have relied on various network mapped drives to allow file sharing. One drive letter for sharing files between teams, a seperate file share for the entire organization, a third for personal use etc. I would like to move away from this and am trying to...
{ "language": "en", "url": "https://stackoverflow.com/questions/326167", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: NHibernate mapping with a class hierarchy whose base class is abstract and the discriminator is not a string Here are the domain model classes: public abstract class BaseClass { ... } public class ChildClass : BaseClass { ... } Note that the parent class is abstract and this is what gives me some difficulties when...
{ "language": "en", "url": "https://stackoverflow.com/questions/326174", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: I need to combine several methods without adding some data members. Any ideas? Lets say I need to write several functions processing some data. These functions are performing a single task - some mathematical calculations. I suppose there is no need to combine them with some data members. Shall I use: * *a class ...
{ "language": "en", "url": "https://stackoverflow.com/questions/326179", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Is query to new added object possible in MS Entity Framework Is there a way to query or just access newly added object (using ObjectContext.AddObject method) in Entity Framework? I mean situation when it is not yet saved to data store using SaveChanges I understand that queries are translated to underlying SQL and e...
{ "language": "en", "url": "https://stackoverflow.com/questions/326186", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: SSRS Expression Evaluation Issue I'm having an issue with expressions within reports. I'm coloring the background of a textbox within a table depending on the value within it. The text in the field relates to backups for a SQL Server. The value is either a date or the text "Not Yet Taken". If the date is more th...
{ "language": "en", "url": "https://stackoverflow.com/questions/326193", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: ASP.Net Form Databound problems I know there is a similar problem on this forum, but the solutions did not really work for me. I am populating form controls with fields from a few different data sources, and the data shows up great. I have an ImageButton control, which has an OnClick Event set to grab all of the da...
{ "language": "en", "url": "https://stackoverflow.com/questions/326194", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: FF3/Windows CSS z-index problem with YouTube player I'm stuck on what appears to be a CSS/z-index conflict with the YouTube player. In Firefox 3 under Windows XP, Take a look at this page: http://spokenword.org/program/21396 Click on the Collect button and note that the pop-up <div> appears under the YouTube player....
{ "language": "en", "url": "https://stackoverflow.com/questions/326196", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "43" }
Q: Generic list manipulation function in C? What is a generic list manipulation function in C? (I saw this when I was going through some materials.) What is the difference between this function and a function which can accept elements of any kind? Are they same...? How can we implement them individually if they are no...
{ "language": "en", "url": "https://stackoverflow.com/questions/326202", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Alternatives to MySQL I would like to store data persistently for my application, but I don't really need a full blown relational database. I really could get by with a basic "cache"-like persistent storage where the structure is just a (key, value) pair. In lieu of a database what are my best, scalable options? A:...
{ "language": "en", "url": "https://stackoverflow.com/questions/326203", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: What is forward reference in C? What is forward reference in C with respect to pointers? Can I get an example? A: I think "forward reference" with respect to pointers means something like this: struct MyStruct *ptr; // this is a forward reference. struct MyStruct { struct MyStruct *next; // another forward refer...
{ "language": "en", "url": "https://stackoverflow.com/questions/326205", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: enforcing at most one user in a JSP application I'm developing a web tool using JSP, where there are many users of multiple kind (i.e. administrators, guest, write-enabled users, ...). Since this will be a subscription based system (i.e. user pay for a 3/6/12 month subscription), I need to enforce at most 1 login pe...
{ "language": "en", "url": "https://stackoverflow.com/questions/326206", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Table of SQL Errors & Stored Procedures I have this bit of code I found on the web at the end of each of my stored procedures: ROLLBACK TRANSACTION PRINT '-----START: ERROR DETAILS-----' PRINT ERROR_NUMBER() PRINT ERROR_SEVERITY() PRINT ERROR_STATE() PRINT ERROR_PROCEDUR...
{ "language": "en", "url": "https://stackoverflow.com/questions/326213", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Overriding fields or properties in subclasses I have an abstract base class and I want to declare a field or a property that will have a different value in each class that inherits from this parent class. I want to define it in the baseclass so I can reference it in a base class method - for example overriding ToSt...
{ "language": "en", "url": "https://stackoverflow.com/questions/326223", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "170" }
Q: Custom caching in ASP.NET I want to cache custom data in an ASP.NET application. I am putting lots of data into it, such as List<objects>, and other objects. Is there a best practice for this? Since if I use a static data, if the w3p.exe dies or gets recycled, the cache will need to be filled again. The database is ...
{ "language": "en", "url": "https://stackoverflow.com/questions/326224", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: ASP FileUpload file size issue Im using a fileupload control for my asp application and it throws a HttpException when the file upload size is bigger than the max request length. As far i understand the fileupload will open a memory stream to a file once the file browse dialog is closed but there is no way of knowi...
{ "language": "en", "url": "https://stackoverflow.com/questions/326229", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Multiple DataKeyNames in a GridView I have a GridView populated from an ObjectDataSource with two items in its DataKeyNames field. One is the primary key, ID, the other is a category field (the category field is used to add header rows to delineate categories). Displaying works fine, but I'm trying to create a Dele...
{ "language": "en", "url": "https://stackoverflow.com/questions/326233", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: How to create your own Windows XP Keyboard Mapping? My father has found a Russian language keyboard mapping that he really likes here. However, it is non-standard and therefore is not one that appears in the Languages (Control Panel->Regional and Language Options->Languages->Details->Text Services And Input Languag...
{ "language": "en", "url": "https://stackoverflow.com/questions/326236", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Packaging a Python library I have a few Munin plugins which report stats from an Autonomy database. They all use a small library which scrapes the XML status output for the relevant numbers. I'm trying to bundle the library and plugins into a Puppet-installable RPM. The actual RPM-building should be straightforward;...
{ "language": "en", "url": "https://stackoverflow.com/questions/326254", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How to make a folder in windows explorer activate an external application? I need to create an application that when a user copies a file into an specific folder, my application will be activated and the file will be changed, also, when the user reads back any file in the folder, changes will also be made to the fil...
{ "language": "en", "url": "https://stackoverflow.com/questions/326262", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Rails: calling a model class in a library I'm trying to verify that a parameter is an instance of a specific class in Rails: def schedule(action, *args) if arg.is_a? Aircraft ... end end I'm doing this in a library class (the file is in lib/) and I get an uninitialized constant Aircraft error. Aircraft is a...
{ "language": "en", "url": "https://stackoverflow.com/questions/326277", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Is it possible to include a subreport or 2 reports in the same Crystal Report? I'm using Crystal Reports in vs2008, so I'm using datasets with procedures to get the data from the db, my escenario is the following: In the same Crystal Report, I have to show two reports, basically using the sames datasets, and the sa...
{ "language": "en", "url": "https://stackoverflow.com/questions/326282", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Deciding on type in the runtime and applying it in generic type - how can I do this? I would like to create a strongly type list and decide the type in runtime. This is my code.I thought it should work, but it doesn't :) Type elementType = Type.GetType(parts[0].Trim(),false,true); var elementsBeing...
{ "language": "en", "url": "https://stackoverflow.com/questions/326285", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Shark: how to filter down to one specific method I'm new to Shark, and I was wondering if it's possible to narrow down a time sample to one specific method? Let's say I'd like to, just for the sake of it, know how much resources have been used on calls to the method 'count' for all NSArray (or subclasses) instances....
{ "language": "en", "url": "https://stackoverflow.com/questions/326303", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: SMS Communication Through The Internet If I am to send a message to a mobile device from a website and viceversa, how can that be done? What I know: A couple of years ago I developed a simple enrollment system on J2ME platform(just for trying J2ME out). I had a mysql database that I setup in a pc/server, and for the...
{ "language": "en", "url": "https://stackoverflow.com/questions/326305", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Looking for recommendations on open-source Java instrument visualization components I am putting together an Java application that needs to display some basic lab instrument components. For example, I'd like to display: a strip chart, oscilloscope-style trace, and a panel meter (galvanometer needle). Rendering req...
{ "language": "en", "url": "https://stackoverflow.com/questions/326307", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How will locking behave in .net? abstract class Foo { private List<Object> container; private bool update; Foo Foo() { container = new List<object>(); update = false; } public abstract Bar CreateBar(); public void BeginUpdate() { if (!update) { ...
{ "language": "en", "url": "https://stackoverflow.com/questions/326309", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How do I create an expression tree calling IEnumerable.Any(...)? I am trying to create an expression tree that represents the following: myObject.childObjectCollection.Any(i => i.Name == "name"); Shortened for clarity, I have the following: //'myObject.childObjectCollection' is represented here by 'propertyExp' //'...
{ "language": "en", "url": "https://stackoverflow.com/questions/326321", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "41" }
Q: Developing an Internet Client On Windows CE I have 5 HP Compaq t5530 Thin Clients with Windows CE 6.0 installed in 'em. I have a Windows 2003 server. Those 6 PCs should be used for browsing. And a user can browse for an hour and be able to extend time. I need to develop a simple client-server program to control the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/326329", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Do I have to call dispose after each use though datatable is stored in cache? Simple case: i put a DataTable in Cache DataTable table = SomeClass.GetTable(); Cache["test"] = table; then in later calls i use DataTable table = (DataTable)Cache["test"]; now the question is: should i call table.dispose() on each call,...
{ "language": "en", "url": "https://stackoverflow.com/questions/326335", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Do you use enum types in your WCF web services? I've heard some people saying that enums are evil and shouldn't be used in web services because of the mismatches that could occur between the server and the client if some values are assigned, or if the enum is marked with the Flags attribute. They also said that web ...
{ "language": "en", "url": "https://stackoverflow.com/questions/326339", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "44" }
Q: How do you unit test? I've read a little bit about unit testing and was wondering how YOU unit test. Apparently unit testing is supposed to break a program down into very small "units" and test functionality from there. But I'm wondering, is it enough to unit test a class? Or do you take it even further and unit t...
{ "language": "en", "url": "https://stackoverflow.com/questions/326344", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Simple role authentication in asp.net I want to do a simple role authentication in .NET - but am lost in the profusion of apis... I would like to have a web.config per directory with role access like: <authorization> <allow roles="admin"/> <deny users="*"/> </authorization> And in my login page, where I do ...
{ "language": "en", "url": "https://stackoverflow.com/questions/326350", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: RDoc : Change name of 'Atttributes:' section in ri-documentation I'm using some meta-programming to generate a bunch of methods in ruby like so: class EmotionalObject def self.mood( name, *details ) define_method(name) do # ... end end mood :happy, #... mood :sad, #... mood :ebuillent, #... ...
{ "language": "en", "url": "https://stackoverflow.com/questions/326352", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Database Management Using The properties window Please enumerate the procedure in which a visual basic program can access a database using data control and Active x data object (ADO)? A: This is a big old topic but below are a couple of simple examples to read through a recordset... Dim con As New ADODB.Connection ...
{ "language": "en", "url": "https://stackoverflow.com/questions/326358", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Easiest, most maintainable online DB solution? I wish to create an online system to track some things (e.g., a database with children, where each child has 1 or more visits from doctors). I want the users to be able to enter data as well as search for it, especially from mobile devices. So, this is a custom mobile o...
{ "language": "en", "url": "https://stackoverflow.com/questions/326364", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Changing connection string at runtime in Enterprise Library Is there a way to change the connection string of a DataBase object in Enterprise Library at runtime? I've found this link but its a little bit outdated (2005) I've also found this but it seems to apply to .Net in general, I was wondering if there was somet...
{ "language": "en", "url": "https://stackoverflow.com/questions/326365", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Experiences with Zoho Creator? I wish to create an online system to track some things (e.g., a database with children, where each child has 1 or more visits from doctors). I want the users to be able to enter data as well as search for it, especially from mobile devices. So, this is a custom mobile online DB app of ...
{ "language": "en", "url": "https://stackoverflow.com/questions/326366", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: WPF: Check/Uncheck all checkbox for checkboxes located in gridview cell template? I'm trying to create a check/uncheck all CheckBox for a number of CheckBoxes that are located inside the cell template of a GridViewColumn. I added this column to a GridView (along with other columns), set the GridView to the view prop...
{ "language": "en", "url": "https://stackoverflow.com/questions/326374", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: PHP APIs for Hotmail, Gmail and Yahoo? I am a PHP developer who is kind of in a pickle. I'm trying to locate and/or build an API capable of speaking to Hotmail, Yahoo and GMAIL in order to retrieve contact lists (with the user's consent, of course). The one I'm having the most trouble finding is a Hotmail API. Where...
{ "language": "en", "url": "https://stackoverflow.com/questions/326379", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "21" }
Q: Are there any guarantees about when IIS might recycle while processing a 1-way WCF operation? Background This question is in two parts. I have a one-way WCF operation hosted in IIS 6. The following is my understanding of how this works: _1. IIS receives a request. _2. IIS sends an HTTP 202 response (thanks, I'll pr...
{ "language": "en", "url": "https://stackoverflow.com/questions/326382", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: HTTP Caching, Browsers weirdeness and everything else! Yesterday I've tried to get serious about rightly caching some PHP generated pages (think "Articles with comments"). Big fail. Long story short: I set the ETag header, set the Last-Modified one and check server side every Article browser request with them to see...
{ "language": "en", "url": "https://stackoverflow.com/questions/326384", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to surround a code block with a using statement in ReSharper? I'm watching Stephen A Bohlen's excellent Summer of NHibernate series, and have been watching him interact with CodeRush. I've recently installed ReSharper (I'm a ReSharper newbie), and I'm trying to find some of the ReSharper productivity equivalent...
{ "language": "en", "url": "https://stackoverflow.com/questions/326387", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How do I create a Java string from the contents of a file? I've been using the idiom below for some time now. And it seems to be the most wide-spread, at least on the sites I've visited. Is there a better/different way to read a file into a string in Java? private String readFile(String file) throws IOException { ...
{ "language": "en", "url": "https://stackoverflow.com/questions/326390", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1738" }
Q: Multi-bit database field I'm using a MSSQL database and would like to create a column that only has 4 possible values. Is there any way to define a 2-bit column? I see the bit datatype and then the next smallest is tinyint which is 1 full byte. If there is no such field, I'd be interesting in finding out why not...
{ "language": "en", "url": "https://stackoverflow.com/questions/326392", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: JSF h:column tag fix width Can someone show me how to fix the width of a column in a datatable with JSF? My code currently reads: <h:column> <f:facet name="header"> <h:outputText value="Data Field 1" /> </f:facet> <h:commandLink id="dataLink" action="#{pc_SearchResultsFragment.setField1}"> ...
{ "language": "en", "url": "https://stackoverflow.com/questions/326393", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: :hover with elements I am working with: #top ul li.corner span.right-corner:hover { background-image:url("images/corner-right-over.gif"); width:4px; height:15px; float:left; } #top ul li.corner span.left-corner:hover { background-image:url("images/corner-left-over.gif"); float:left; wid...
{ "language": "en", "url": "https://stackoverflow.com/questions/326396", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Best language choice for a spam detection service I have around 20 or so active blogs that get quite a bit of spam. As I hate CAPCHA the alternative is very smart spam filtering. I want to build a simple REST api like spam checking service which I would use in all my blogs. That way I can consolidate IP blocks and...
{ "language": "en", "url": "https://stackoverflow.com/questions/326401", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Shall I use "virtual" keyword for destructor of base-class which is actually an interface? I have an abstract base class and derived class: type TInterfaceMethod = class public destructor Destroy; virtual; abstract; procedure Calculate; virtual; abstract; procedure PrepareForWork; virtual; abstract; en...
{ "language": "en", "url": "https://stackoverflow.com/questions/326405", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Best way to approach FPGA Device Requirements When designing FPGA systems how can I estimate roughly the number of logic blocks a given task would require? Anyone have a rough order of magnitude on what I should expect for these comon devices?: * *UART *packet deframer with CRC32 *8 micro core I've seen www.o...
{ "language": "en", "url": "https://stackoverflow.com/questions/326419", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Oracle DB query formatting I have a problem with formatting the data when doing an query to an Oracle database. What I want to do is to export some data into the formatbelow into a textfile; 1IN20071001 40005601054910101200 1 65 * *First number (1 above) = Company number (position 1-5, blan...
{ "language": "en", "url": "https://stackoverflow.com/questions/326425", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: What version-control system is most trivial to set up and use for toy projects? I teach the third required intro course in a CS department. One of my homework assignments asks students to speed up code they have written for a previous assignment. Factor-of-ten speedups are routine; factors of 100 or 1000 are not u...
{ "language": "en", "url": "https://stackoverflow.com/questions/326429", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "68" }
Q: What is the best way to display nested formulas to business users? Many of our transactions are comprised of calculations that are comprised of other calculations. How did you represent the hierarchy / execution graph to users? Was there a specific control you found that worked well? How would you project the re...
{ "language": "en", "url": "https://stackoverflow.com/questions/326432", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do I declare a TDictionary enumerator? I've got a TDictionary that stores a bunch of objects indexed by name, and I'd like to be able to examine all of the objects. So I tried this: var enumerator: TMyObject; begin for enumerator in myDictionary do But that wouldn't compile. "Incompatible types: 'TMyObject'...
{ "language": "en", "url": "https://stackoverflow.com/questions/326444", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Unit testing with Entity Framework I want to test my Entities that are built using Entity Framework. My concern is that using Entity Framework means directly working with data source. So any ideas how to unit testing Entity Framework based components? A: Apparently it's very hard. Eloquently put by Erik here - TDD ...
{ "language": "en", "url": "https://stackoverflow.com/questions/326450", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "71" }
Q: Firefox: pass event from anonymous javascript function In this abbreviated code, the inline event works - the "event" is passed to the testKeyPress function <textarea id="source" onkeydown= "showCursPos(this); var tf=testKeyPress(event); document.onkeypress=function(){return tf}; document.onkeydow...
{ "language": "en", "url": "https://stackoverflow.com/questions/326454", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Register Startup Script Control I am looking to make a web control where I can register client startup scripts inline with my aspx because I hate registering in the codebehind! An example of what I have so far: <Ben:StartupScript runat="server"> var form = document.getElementById("<% =form1.ClientID %>"); </Be...
{ "language": "en", "url": "https://stackoverflow.com/questions/326460", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Accessing JS data from PHP A remote site is supplying a data structure in a js file. I can include this file in my page to access the data and display it in my page. <head> <script type="text/javascript" src="http://www.example.co.uk/includes/js/data.js"></script> </head> Does anyone know how I use PHP to take ...
{ "language": "en", "url": "https://stackoverflow.com/questions/326463", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: MSXML XSL Transformation multithreaded performance contention I have a multithreaded server C++ program that uses MSXML6 and continuously parses XML messages, then applies a prepared XSLT transform to produce text. I am running this on a server with 4 CPUs. Each thread is completely independent and uses its own tran...
{ "language": "en", "url": "https://stackoverflow.com/questions/326466", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: GWT without JavaScript? I was looking into GWT. It seems nice, but our software have the must work without JS requirement. Is it possible? A: You could degrade gracefully by creating an html structure that is just 'good enough' (with form posts, linked menus, etc) and then have GWT attach to each part of that struc...
{ "language": "en", "url": "https://stackoverflow.com/questions/326467", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Grails forwarding and/or redirection with parameters Is it possible to do page forwarding in Grails? I searched but no luck. If possible, how do I pass parameters in the forwarding method? If not, how would I do it using redirection? I've found something like this for redirection so far: A: Redirection is idiomatic...
{ "language": "en", "url": "https://stackoverflow.com/questions/326474", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Rounding a number to the nearest 5 or 10 or X Given numbers like 499, 73433, 2348 what VBA can I use to round to the nearest 5 or 10? or an arbitrary number? By 5: 499 -> 500 2348 -> 2350 7343 -> 7345 By 10: 499 -> 500 2348 -> 2350 7343 -> 7340 etc. A: It's simple math. Given a number X and a rounding factor ...
{ "language": "en", "url": "https://stackoverflow.com/questions/326476", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "64" }
Q: Multithreaded image processing in C++ I am working on a program which manipulates images of different sizes. Many of these manipulations read pixel data from an input and write to a separate output (e.g. blur). This is done on a per-pixel basis. Such image mapulations are very stressful on the CPU. I would like t...
{ "language": "en", "url": "https://stackoverflow.com/questions/326487", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Game Terrain Database Model I am developing a game for the web. The map of this game will be a minimum of 2000km by 2000km. I want to be able to encode elevation and terrain type at some level of granularity - 100m X 100m for example. For a 2000km by 2000km map storing this information in 100m2 buckets would mea...
{ "language": "en", "url": "https://stackoverflow.com/questions/326497", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: java background/daemon/service cross platform best practices I am looking for the best way to make my desktop java program run in the background (daemon/service?) across most platforms (Windows, Mac OS, Linux [Ubuntu in particular]). By "best way" I am hoping to find a way that will: * *require a minimum amount o...
{ "language": "en", "url": "https://stackoverflow.com/questions/326509", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "27" }
Q: Is MEF Microsoft's version of Lua? I see parallels between MEF and Lua. Both allow you to register methods and deploy as you need. Are both MEF and Lua forms of IoC / Dependency Injection? A: I'll assume you're aware of the huge differences between these technologies and focus on the question: "Are both MEF and...
{ "language": "en", "url": "https://stackoverflow.com/questions/326514", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Windows CE vs Embedded Linux Now I'm sure we're all well aware of the relative merits of Linux vs Windows Desktop. However I've heard much less about the world of embedded development. I'm mainly interested in solutions for industry and am therefore uninterested about the IPhone or Android and more interested in the...
{ "language": "en", "url": "https://stackoverflow.com/questions/326516", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "32" }
Q: Will repeated calls to srand() in c++ use the same seed? If I have srand(2) declared in my main of my driver file, do I need to declare srand(2) in my code file which is being linked with my driver? Thanks. edit (from user's comment below) If I do, srand(2); srand(2); will I get the seed as 2? or something else? A...
{ "language": "en", "url": "https://stackoverflow.com/questions/326558", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Converting a string of 1's and 0's to a byte array I have a string with a length that is a multiple of 8 that contains only 0's and 1's. I want to convert the string into a byte array suitable for writing to a file. For instance, if I have the string "0010011010011101", I want to get the byte array [0x26, 0x9d], w...
{ "language": "en", "url": "https://stackoverflow.com/questions/326571", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Navigation, background swap not having every * on mouseover I am using the following jquery code: $("#top ul li.corner").mouseover(function(){ $("span.left-corner").addClass("left-corner-hover"); $("span.right-corner").addClass("right-corner-hover"); $("span.content").addClass("content-hover"); }).mouse...
{ "language": "en", "url": "https://stackoverflow.com/questions/326580", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How can I control/override the auto-complete in my iPhone app? I want to control/override the auto-complete feature when a user enters text in my iPhone app. Specifically I'd like to auto-complete a collection of words I supply. For example say my name is BillBobJohn. When I type "billb" auto-complete will suggest ...
{ "language": "en", "url": "https://stackoverflow.com/questions/326590", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How do I wrap a function in Javascript? I'm writing a global error handling "module" for one of my applications. One of the features I want to have is to be able to easily wrap a function with a try{} catch{} block, so that all calls to that function will automatically have the error handling code that'll call my gl...
{ "language": "en", "url": "https://stackoverflow.com/questions/326596", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "39" }
Q: How can I get the size of an object in the HttpRuntime.Cache? I am currently storing many different types of objects in the ASP.NET HttpRuntime.Cache and I was wondering if there is a way to figure out how big each object is? A: Look at these questions: Getting the size of a field in bytes with C# Find out the size...
{ "language": "en", "url": "https://stackoverflow.com/questions/326606", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: ASP.NET MVC - View with master page, how to set title? What is prefered way of setting html title (in head) for view when using master pages? One way is by using Page.Title in .aspx file, but that requires in master page which can mess with HTML code. So, lets assume no server side controls, only pure html. Any bet...
{ "language": "en", "url": "https://stackoverflow.com/questions/326628", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: Sorting on the server or on the client? I had a discussion with a colleague at work, it was about SQL queries and sorting. He has the opinion that you should let the server do any sorting before returning the rows to the client. I on the other hand thinks that the server is probably busy enough as it is, and it must...
{ "language": "en", "url": "https://stackoverflow.com/questions/326634", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "27" }
Q: Retrieving a byte array stored in a INT field in the database how do I retrieve the byte array stored in an integer column in my database? Do I first case it as int, then as byte[] ? byte[] permissions = (byte) Convert.ToInt(dr["myField"]); ? A: Well, the data is stored as an integer. How do you want to convert tha...
{ "language": "en", "url": "https://stackoverflow.com/questions/326648", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Vertically align text within input field of fixed-height without display: table or padding? The line-height property usually takes care of vertical alignment, but not with inputs. Is there a way to automatically center text without playing around with padding? A: I've not tried this myself, but try setting: height ...
{ "language": "en", "url": "https://stackoverflow.com/questions/326650", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "81" }
Q: php SOAP call over SSL - How do I jam a cert, key, and CA cert together in the request? So, I'm trying to consume a webservice using something like this: $client = new SoapClient("some.wsdl", array('local_cert' => "cert_key.pem")); I've done this successfully in the past with other web services that required a c...
{ "language": "en", "url": "https://stackoverflow.com/questions/326656", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Is There An OSS Implementation Of Google AdWords Is there an open source implementation of Google AdWords, or is the technology protected in some way (such as being patented)? Edit: To clarify, I'm looking for a 3rd party implementation of an AdWords-like system (that has nothing to to with Google AdWords beyond the...
{ "language": "en", "url": "https://stackoverflow.com/questions/326670", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How to detect if two files are on same "volume"? I'm trying to use System.IO.File.Replace to update a file, and it's throwing System.IOException if the destination file is on a NAS. According to MSDN, if the destination file is on a different volume, this method throws an exception. It's right, but how do I detect i...
{ "language": "en", "url": "https://stackoverflow.com/questions/326672", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: HttpRuntime.Cache[] vs Application[] I know that most people recommend using HttpRuntime.Cache because it has more flexibility... etc. But what if you want the object to persist in the cache for the life of the application? Is there any big downside to using the Application[] object to cache things? A: Use cache wh...
{ "language": "en", "url": "https://stackoverflow.com/questions/326675", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "30" }
Q: Choosing an attractive linear scale for a graph's Y Axis I'm writing a bit of code to display a bar (or line) graph in our software. Everything's going fine. The thing that's got me stumped is labeling the Y axis. The caller can tell me how finely they want the Y scale labeled, but I seem to be stuck on exactly wh...
{ "language": "en", "url": "https://stackoverflow.com/questions/326679", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "91" }