text
stringlengths
8
267k
meta
dict
Q: corrupted email attachments in .NET I'm trying to attach a PDF attachment to an email being sent with System.Net.Mail. The attachment-adding part looks like this: using (MemoryStream pdfStream = new MemoryStream()) { pdfStream.Write(pdfData, 0, pdfData.Length); Attachment a = new Attachment(pdfStream, ...
{ "language": "en", "url": "https://stackoverflow.com/questions/307365", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Eclipse CDT Invalid Project Path I have a C project that is built using a makefile, Eclipse constantly warns about "Invalid project path: Duplicate path entries", but I cannot figure out what the hell it wants me to do. I would like to disable this warning and continue with my life. My application compiles and runs...
{ "language": "en", "url": "https://stackoverflow.com/questions/307367", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "44" }
Q: What is the strtok_s equivalent in VC7? The strtok_s function exists in vc8 but not in vc7. So what's a function (or code) that does the equivalent of strtok_s in vc7? A: Take a look at this MSDN page. As far as I can tell, the security enhancements a) Make strtok() reentrant (and thread-safe) by having it take a ...
{ "language": "en", "url": "https://stackoverflow.com/questions/307369", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do I improve performance of DataSet.ReadXml if I'm using a schema? I'm have a ADO DataSet that I'm loading from its XML file via ReadXml. The data and the schema are in separate files. Right now, it takes close to 13 seconds to load this DataSet. I can cut this to 700 milliseconds if I don't read the DataSet's...
{ "language": "en", "url": "https://stackoverflow.com/questions/307370", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do I get the Visual Studio Load Test Agent to use the servers second CPU I am running a Visual Studio Load Test using an Agent on one of our servers. This server has two CPU and I have a licence for the Test Agent to use both. My question is how do I configure the Test Agent service to use the second cpu? A: W...
{ "language": "en", "url": "https://stackoverflow.com/questions/307382", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Need quick way to validate proper nesting of HTML tags Is there a firefox plugin or something similar I can use to validate that my html output has properly closed tags? A: You can use either the W3 HTML Validator or HTML Tidy online. A: I use this little guy Html Validator. I like him. The errors it makes help ...
{ "language": "en", "url": "https://stackoverflow.com/questions/307389", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Emulate IDispatchEx in C# C# 3.0 Extension methods add extensions to the base Type making calling that method on all instances of that Type legal. Now, JavaScript I know implements IDispatchEx through which it's possible to add methods to a specific instance. So how do I add a set of methods to an 'instance' of a C#...
{ "language": "en", "url": "https://stackoverflow.com/questions/307390", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Prevent hiding of ModalPopupExtender when ok or cancel is clicked I am using an ASP.NET ModalPopupExtender on a page and would like to prevent the dialog from hiding when the user presses the ok button in certain conditions. But I can't seem to find a way. What I am looking for is something like this ajax:ModalPopu...
{ "language": "en", "url": "https://stackoverflow.com/questions/307391", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do I connect multiple sortable lists to each other in jQuery UI? I'm new to jQuery, and I'm totally struggling with using jQuery UI's sortable. I'm trying to put together a page to facilitate grouping and ordering of items. My page has a list of groups, and each group contains a list of items. I want to allow us...
{ "language": "en", "url": "https://stackoverflow.com/questions/307411", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "34" }
Q: How to Configure SQL Server 2005 Replication through a firewall? What ports or modes of communication do you need to open up for SQL Server 2005 Transactional Replication? Main and slave are geographically separated. A: Make sure you enable encryption, otherwise your replicated data could be sniffed by any one in ...
{ "language": "en", "url": "https://stackoverflow.com/questions/307422", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Extending application.cfc in a subdirectory I have the following two files and would like the second to extend the first: * *wwwroot\site\application.cfc *wwwroot\site\dir\application.cfc However, when I go to declare the component for the second file, I'm not sure what to put in the extends attribute. My pro...
{ "language": "en", "url": "https://stackoverflow.com/questions/307423", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: How to serialize to dateTime Working to get DateTimes for any time zone. I'm using DateTimeOffset, and a string, and an XmlElement attribute. When I do, I get the following error: [InvalidOperationException: 'dateTime' is an invalid value for the XmlElementAttribute.DataType property. dateTime cannot be conv...
{ "language": "en", "url": "https://stackoverflow.com/questions/307433", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: JavaScript Libraries - Side-by-Side Comparisons Microsoft recently announced that they were endorsing jQuery as an "officially" supported JavaScript library. I certainly wouldn't argue that jQuery is a fantastic framework to work with. In fact, I just bought the book. But I'm curious to know why. Specifically, I'm...
{ "language": "en", "url": "https://stackoverflow.com/questions/307436", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Moving a directory atomically I have two directories in the same parent directory. Call the parent directory base and the children directories alpha and bravo. I want to replace alpha with bravo. The simplest method is: rm -rf alpha mv bravo alpha The mv command is atomic, but the rm -rf is not. Is there a simp...
{ "language": "en", "url": "https://stackoverflow.com/questions/307437", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "47" }
Q: How can I tell when a MySQL table was last updated? In the footer of my page, I would like to add something like "last updated the xx/xx/200x" with this date being the last time a certain mySQL table has been updated. What is the best way to do that? Is there a function to retrieve the last updated date? Should I a...
{ "language": "en", "url": "https://stackoverflow.com/questions/307438", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "207" }
Q: Finding closest non-black pixel in an image fast I have a 2D image randomly and sparsely scattered with pixels. given a point on the image, I need to find the distance to the closest pixel that is not in the background color (black). What is the fastest way to do this? The only method I could come up with is build...
{ "language": "en", "url": "https://stackoverflow.com/questions/307445", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: How can I encrypt my website traffic? What is the easiest free method of encrypting my web traffic? I'd like to be able to log in to sites on my web server without sending my password in plaintext. Edit: My web server is running on the LAMP stack , although it is a shared host so I don't have root. A: Get an X.509 ...
{ "language": "en", "url": "https://stackoverflow.com/questions/307448", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Observers vs. Triggers What's the general consensus? If you need to change the database after a given action, do you use an observer pattern and let the framework / application handle the update for you? Or do you bypass the application and delegate the update to a database trigger? Obviously the trigger is faster,...
{ "language": "en", "url": "https://stackoverflow.com/questions/307463", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: to throw, to return or to errno? i am creating a system. What i want to know is if a msg is unsupported what should it do? should i throw saying unsupported msg? should i return 0 or -1? or should i set an errno (base->errno_). Some messages i wouldnt care if there was an error (such as setBorderColour). Others i wo...
{ "language": "en", "url": "https://stackoverflow.com/questions/307471", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Automated Dead code detection in native C++ application on Windows? Background I have an application written in native C++ over the course of several years that is around 60 KLOC. There are many many functions and classes that are dead (probably 10-15% like the similar Unix based question below asked). We recently b...
{ "language": "en", "url": "https://stackoverflow.com/questions/307478", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Short unique id in php I want to create a unique id but uniqid() is giving something like '492607b0ee414'. What i would like is something similar to what tinyurl gives: '64k8ra'. The shorter, the better. The only requirements are that it should not have an obvious order and that it should look prettier than a seemin...
{ "language": "en", "url": "https://stackoverflow.com/questions/307486", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "56" }
Q: function pointers in python I would like to do something like the following: def add(a, b): #some code def subtract(a, b): #some code operations = [add, subtract] operations[0]( 5,3) operations[1](5,3) In python, is it possible to assign something like a function pointer? A: Python has nothing called poi...
{ "language": "en", "url": "https://stackoverflow.com/questions/307494", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Exists a way to prevent cookies from getting stolen? in Web 2.0 applications many users usually want to stay logged in ('remember me' flag) and on the other hand their cookie can give access to very private data. Is there a way to prevent that somebody who steals the cookie - directly from the computer or via sniffi...
{ "language": "en", "url": "https://stackoverflow.com/questions/307495", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: A good ocaml parser? I'm looking for a good ocaml parsing library that isn't a derivative of flex/bison. Ideally, I'd like a monadic combinator library along the lines of parsec, but I can't find anything. I would use haskell, but making llvm bindings for haskell is proving more tiresome than I originally thought. C...
{ "language": "en", "url": "https://stackoverflow.com/questions/307499", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: How do I select a single element in jQuery? I have a table structure that looks like: <table> <tr id="row1"> <td> <div>row 1 content1</div> </td> <td> <div>row 1 content2</div> </td> <td> <div>row 1 content3</div> </td> </tr> <tr id="row2"> <td> <div>row 2 content1</div> ...
{ "language": "en", "url": "https://stackoverflow.com/questions/307500", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "36" }
Q: In Linux, what do all the values in the "top" command mean? When you run top and see all running processes, I've always wanted to know just what everything actually means. e.g. all the various single-letter state codes for a running process (R = Running, S = Sleeping, etc...) Where can I find this? A: Programs lik...
{ "language": "en", "url": "https://stackoverflow.com/questions/307502", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "68" }
Q: What's a concise way to check that environment variables are set in a Unix shell script? I've got a few Unix shell scripts where I need to check that certain environment variables are set before I start doing stuff, so I do this sort of thing: if [ -z "$STATE" ]; then echo "Need to set STATE" exit 1 fi if...
{ "language": "en", "url": "https://stackoverflow.com/questions/307503", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "520" }
Q: How do I apply OrderBy on an IQueryable using a string column name within a generic extension method? public static IQueryable<TResult> ApplySortFilter<T, TResult>(this IQueryable<T> query, string columnName) where T : EntityObject { var param = Expression.Parameter(typeof(T), "o"); var body = Expression.Prope...
{ "language": "en", "url": "https://stackoverflow.com/questions/307512", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "90" }
Q: Custom intellisense for server controls? Can you program/configure Visual Studio to produce custom intellisense for your own server controls. eg can you get it to do this: alt text http://www.yart.com.au/test/vs.gif for a tag of your own like: <MyCompany:MyTag ... A: You should be getting this for free (default be...
{ "language": "en", "url": "https://stackoverflow.com/questions/307514", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Can you have protected nested classes in C++? I have a class that only really ever needed by classes in a certain class hierarchy. I wanted to know if it is possible to nest the class in the highest class's protected section and have all the other classes automatically inherit it? A: "Inherit" is the wrong word to ...
{ "language": "en", "url": "https://stackoverflow.com/questions/307524", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: why do tweens stop randomly? With code like the following, sometimes the child controls correctly finish their animation and sometimes they stop at random places in the middle. Why don't they work correctly? var t:Tween; t = new Tween(child1,"x",Elastic.easeOut,0,100,2,true); t = new Tween(child1,"y", Elastic.easeO...
{ "language": "en", "url": "https://stackoverflow.com/questions/307531", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How can I communicate over TCP sockets from JavaScript? I'm thinking about how limiting it is for AJAX apps to have to poll for updates, when what would be ideal is for javascript to be able to set up a real two way connection to the server. I'm wondering if there is some method of integrating javascript with a brow...
{ "language": "en", "url": "https://stackoverflow.com/questions/307539", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "24" }
Q: What is an alternative to InfoPath for XML editing? We are look at providing a method for our non-technical users to edit XML and pass it to our existing XML input functionality. I remembered InfoPath saved its data as XML, and took another look at it. It's great the way it allows you to define a form based on an ...
{ "language": "en", "url": "https://stackoverflow.com/questions/307541", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Do you use the "this" operator in C#? Duplicate post, see: When do you use the "this" keyword? On almost every project I worked the "This" operator is used, when i start developing i was told that it is a good practice. is this really necessary does it gives you more readability? A: Tools like Resharper have a bui...
{ "language": "en", "url": "https://stackoverflow.com/questions/307558", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How do I copy a version of a single file from one Git branch to another? I've got two branches that are fully merged together. However, after the merge is done, I realise that one file has been messed up by the merge (someone else did an auto-format, gah), and it would just be easier to change to the new version in ...
{ "language": "en", "url": "https://stackoverflow.com/questions/307579", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1282" }
Q: Rails Model has_many with multiple foreign_keys Relatively new to rails and trying to model a very simple family "tree" with a single Person model that has a name, gender, father_id and mother_id (2 parents). Below is basically what I want to do, but obviously I can't repeat the :children in a has_many (the first ge...
{ "language": "en", "url": "https://stackoverflow.com/questions/307581", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "51" }
Q: How frequent is DateTime.Now updated ? or is there a more precise API to get the current time? I have code running in a loop and it's saving state based on the current time. Sometimes this can be just milliseconds apart, but for some reason it seems that DateTime.Now will always return values of at least 10 ms apart...
{ "language": "en", "url": "https://stackoverflow.com/questions/307582", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "29" }
Q: Time difference in C++ Does anyone know how to calculate time difference in C++ in milliseconds? I used difftime but it doesn't have enough precision for what I'm trying to measure. A: I know this is an old question, but there's an updated answer for C++0x. There is a new header called <chrono> which contains mode...
{ "language": "en", "url": "https://stackoverflow.com/questions/307596", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "36" }
Q: How do exceptions work (behind the scenes) in c++ I keep seeing people say that exceptions are slow, but I never see any proof. So, instead of asking if they are, I will ask how do exceptions work behind the scenes, so I can make decisions of when to use them and whether they are slow. From what I know, exceptions a...
{ "language": "en", "url": "https://stackoverflow.com/questions/307610", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "129" }
Q: XML instance generation from XML schema (xsd) I was wondering if there's a way I can automate the generation of XML files from XSD schemas given that I have the data and the labels. I'd like to do this in python/java. It seems very possible, yet I can't find any library that allows me to do this. I'm looking for a f...
{ "language": "en", "url": "https://stackoverflow.com/questions/307616", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: .NET (web) How to execute some code after all events are handled? I have this .NET web app that draws a table in Page_Load. Then after that it handles the events, which should change the table drawn in Page_Load. This is very inefficient. Is there a way to execute the code (which draws the table) after it finishes h...
{ "language": "en", "url": "https://stackoverflow.com/questions/307618", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: JSON - Slashes and application type..refactoring My code works (yeah!) which sends json to a server.. would appreciate any thoughts on refactoring 1) My C# code sends this json to the server {\"firstName\":\"Bill\",\"lastName\":\"Gates\",\"email\":\"asdf@hotmail.com\",\"deviceUUID\":\"abcdefghijklmnopqrstuvwxyz\"} W...
{ "language": "en", "url": "https://stackoverflow.com/questions/307619", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: utf-8 and htmlentities in RSS feeds I'm writing some RSS feeds in PHP and stuggling with character-encoding issues. Should I utf8_encode() before or after htmlentities() encoding? For example, I've got both ampersands and Chinese characters in a description element, and I'm not sure which of these is proper: $output...
{ "language": "en", "url": "https://stackoverflow.com/questions/307623", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: How do you setup a linked server to an Oracle database on SQL 2000/2005? I am able to create and execute a DTS package that copies tables from a remote Oracle database to a local SQL server, but want to setup the connection to the Oracle database as a linked server. The DTS package currently uses the Microsoft OLE D...
{ "language": "en", "url": "https://stackoverflow.com/questions/307636", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "21" }
Q: Easiest way to extract SharePoint list data to a separate SQL Server table? Edited: What is the easiest way to scrape extract SharePoint list data to a separate SQL Server table? One condition: you're in a work environment where you don't control the SQL Server behind the SharePoint Server, so you can't just pull fr...
{ "language": "en", "url": "https://stackoverflow.com/questions/307640", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Clean up AppBar after process kill I have written an Application Desktop Toolbar (a.k.a AppBar), it works great except for the fact that if I kill the process, the AppBar code never gets a chance to cleanup by sending an ABM_REMOVE. The problem is that this basically screws the users desktop up. The AppBar is writte...
{ "language": "en", "url": "https://stackoverflow.com/questions/307643", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How to remove duplicate values from an array in PHP How can I remove duplicate values from an array in PHP? A: Use array_values(array_unique($array)); array_unique: for unique array array_values: for reindexing A: sometimes array_unique() is not the way, if you want get unique AND duplicated items... $unique=array...
{ "language": "en", "url": "https://stackoverflow.com/questions/307650", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "230" }
Q: How do you develop an application to draw, edit and save UML models in Cocoa? Will the individual UML diagram shapes be NSView subclasses or NSBezierPaths? How are the diagrams created and managed? A: One way to do this is to: * *Create a document-based app *Design model classes for the different objects the en...
{ "language": "en", "url": "https://stackoverflow.com/questions/307653", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Rollback a stored procedure call from inside a transaction using LINQ-to-SQL? I have a C#.net winform program which runs with a SQL Server database. I am using LINQ-to-SQL. Is it possible to rollback the call to one or more stored procedures inside a transaction within my program using LINQ-to-SQL? Initially I t...
{ "language": "en", "url": "https://stackoverflow.com/questions/307656", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Errors Raised within Class Debug As If Raised at Property Call I am (unfortunately) developing an application in Excel 2000 VBA. I believe I have discovered that any error raised within a Custom Class property, function, or sub debugs as if the error were raised at the point in the VBA code where the property is ca...
{ "language": "en", "url": "https://stackoverflow.com/questions/307657", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How can I get a script's output to be copied to the Windows clipboard? I find myself running scripts and copy-pasting the output of these runs into emails or into some other documents. Is there a way such that I can make the copy-to-clipboard step a part of the script itself? Most of my scripts are either Perl or ba...
{ "language": "en", "url": "https://stackoverflow.com/questions/307658", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Binding to an element within a UserControl Say I have a user control like the one below, how would I bind something to the ActualWidth of the "G1" grid from outside of the control? <UserControl x:Class="Blah"> <WrapPanel> <Grid x:Name="G1"> ... </Grid> <Grid> ... </Grid> </WrapPanel> ...
{ "language": "en", "url": "https://stackoverflow.com/questions/307664", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: foo_url(mock_foo) sometimes doesn't work in rspec tests I am trying to write an rspec test for a controller that accesses a model Group. @request.env['HTTP_REFERER'] = group_url(@mock_group) ### Line 49 I get this: NoMethodError in 'ActsController responding to create should redirect to :back' You have a nil obj...
{ "language": "en", "url": "https://stackoverflow.com/questions/307669", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to remove duplicate values from a multi-dimensional array in PHP How can I remove duplicate values from a multi-dimensional array in PHP? Example array: Array ( [0] => Array ( [0] => abc [1] => def ) [1] => Array ( [0] => ghi [1] => jkl ) [2] => Array...
{ "language": "en", "url": "https://stackoverflow.com/questions/307674", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "358" }
Q: Is it possible to implement pre-tested commits in TFS? I'm intrigued by the idea in TeamCity of pre-testing commits (i.e. verifying they don't break the build before allowing check-in to occur) and I'm wondering if there is any way to implement this in TFS. It looks like TeamCity can interface to TFS version control...
{ "language": "en", "url": "https://stackoverflow.com/questions/307676", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Using jQuery, Restricting File Size Before Uploading On PHP, they have a way to restrict file size AFTER uploading, but not BEFORE uploading. I use the Malsup jQuery Form Plugin for my form posting, and it supports image file posting. I was wondering if perhaps there's a restriction where I can set how many bytes ca...
{ "language": "en", "url": "https://stackoverflow.com/questions/307679", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "50" }
Q: best way to save/load iphone game data I'm working on a puzzle game, the game engine holds a complex hierarchy of objects, from game actors to vectors to transition animations. Depending on the game state, they might add up from 10 to 1000 (in extreme cases). I've been delaying the moment until I'd have to work on t...
{ "language": "en", "url": "https://stackoverflow.com/questions/307681", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Authenticate Sharepoint with Active Directory? Just need to use find a simple way to have AD authenticate as the login for a Sharepoint site. This fairly quick and simple to get going ? Thanks! A: For SharePoint 2007, see this article. You probably want to set it up to do Windows integrated authentication with N...
{ "language": "en", "url": "https://stackoverflow.com/questions/307684", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: 2.0 Equivalent of WCF Service Hosting a WCF Service Host in a Windows Service really seems to be quite a simple way to go to communicate with a running Windows Service...if you're running 3.0/3.5. What the easiest way to get the same sorts of things out of the 2.0 Framework if that's what you're stuck with? A: You ...
{ "language": "en", "url": "https://stackoverflow.com/questions/307685", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to download a file from a URL in C#? What is a simple way of downloading a file from a URL path? A: Use System.Net.WebClient.DownloadFile: string remoteUri = "http://www.contoso.com/library/homepage/images/"; string fileName = "ms-banner.gif", myStringWebResource = null; // Create a new WebClient instance. usi...
{ "language": "en", "url": "https://stackoverflow.com/questions/307688", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "459" }
Q: How to open and use a socket in C? I would like to know the simplest and most effective way to open and write data to a socket in the C programming language for network programming. A: POSIX 7 minimal runnable client server TCP example Get two computers in a LAN, e.g. your home WiFi network. Run the server on one c...
{ "language": "en", "url": "https://stackoverflow.com/questions/307692", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "20" }
Q: Algorithm: Keeping count of key/value pair in NSDictionary Being new to Cocoa, and probably not knowing all of the potential classes available that already have this functionality neatly wrapped in an OO class, here's an algorithm inquiry. What's the best bet to count how many times a particular key occurs in an arr...
{ "language": "en", "url": "https://stackoverflow.com/questions/307695", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Does Microsoft SkyDrive have an API? So with the recent news that Microsoft Skydrive is going to get bumped to 25GB of storage per account, does anyone know if SkyDrive has an API? (And if so, where are the docs?) A: SkyDrive (renamed 'OneDrive') has an official API. Details can be found by going to The OneDrive ...
{ "language": "en", "url": "https://stackoverflow.com/questions/307696", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "35" }
Q: How many of you have contributed/gave feedback to your standards committees? Ok as programmers we all follow programming standards (as in W3 standards, or C++ standard, etc...), and many of us consider these standards "sacred" and also many seasoned programmers can recite their choice of standards by heart when aske...
{ "language": "en", "url": "https://stackoverflow.com/questions/307703", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Add a common namespace reference by default to all pages in a project Is there any easy way to add a using statement to every class I create in a project without having to write using SomeNamespace; in every file? [edit] I could add a template I realise but I'm talking about doing it for every file in an existing p...
{ "language": "en", "url": "https://stackoverflow.com/questions/307706", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do you force Firefox to not cache or re-download a Silverlight XAP file? When working with Silverlight, I've noticed that Firefox will cache the XAP file, so if I do an update, a user may be stuck using an outdated version. Is there a way to force the browser to either re-download the XAP file every time, or ma...
{ "language": "en", "url": "https://stackoverflow.com/questions/307709", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "50" }
Q: What is the Best method to http transfer a file from the client to a server, in Java 1.5? What is the Best method to http transfer a file from the client to a server, in Java 1.5? A: I'd use Apache Commons HttpClient A: I'd use URLConnection.
{ "language": "en", "url": "https://stackoverflow.com/questions/307718", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Did Scott Hanselman have too much cough syrup on show #135? So this question will get technical – eventually – but first check out Hanselminutes with Atwood (et. al.) where Scott basically invites developers to try to hack this site. It’s a hoot. I first thought (out loud of course, because with headphones on you ...
{ "language": "en", "url": "https://stackoverflow.com/questions/307722", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Web store version control for very small group or individual? For very small teams, or an individual developer, is there a source code control tool which is a web service, or web based application, with no or very little cost? Ideally, it would work with Microsoft development. IDE Integration would be awesome, but a...
{ "language": "en", "url": "https://stackoverflow.com/questions/307728", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Why do new instances of a class share members with other instances? class Ball: a = [] def __init__(self): pass def add(self,thing): self.a.append(thing) def size(self): print len(self.a) for i in range(3): foo = Ball() foo.add(1) foo.add(2) foo.size() I would expect a return of : 2 2...
{ "language": "en", "url": "https://stackoverflow.com/questions/307729", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Event handler not fired for dynamically created controls I've got this problem with dynamically created TextBox. When the TextBox is created in PageLoad, it's TextChanged event was fired. But when I dynamically delete and recreated the TextBox, the TextChanged was not fired. This is the code: .aspx file <body> <...
{ "language": "en", "url": "https://stackoverflow.com/questions/307737", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: In MVC, when do you use <%= %> and <% %>? In asp.net mvc, when do we use: and Do we ever need to put a ; (colon) ? A: <%="something" %> is just a shortcut for Response.Write("something") A: <%= %> renders the output (string) of the contained command to the response. <% %> wraps executable statements (logic) in th...
{ "language": "en", "url": "https://stackoverflow.com/questions/307740", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: News feed database design as in Facebook How would make a news feed "friendly" database design, so that it wouldn't be extremely expensive to get all of the items (query) to put in the news feed? The only way I can think of would involve UNIONing nearly every table (representing groups, notes, friends, etc) and get...
{ "language": "en", "url": "https://stackoverflow.com/questions/307748", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: request.params item disappearing after postback I have an ASP.net application that has a request item, which is disappearing after several postbacks. The postbacks are just for validation and ajax calls. The session is not resetting as I still have ~60 items in the params collection. A: Is it perhaps that the value...
{ "language": "en", "url": "https://stackoverflow.com/questions/307753", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Advice on the best way to structure/format a LINQ to XML query? I have written a LINQ to XML query that does what I want, but it looks pretty ugly. I am wondering, how would you guys format the following query in a way that doesn't look quite so garish? Apologies if my example is a bit verbose. The XML documents I ...
{ "language": "en", "url": "https://stackoverflow.com/questions/307757", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Is there any way to restrict how many item returned by CodeCentral Web Service I am building web client for CodeCentral web service from CodeGear web site. I need to restrict number of items return by Search operation of CodeGear web service, say it, 10 per page. This way I can minimize loading of my web page. I jus...
{ "language": "en", "url": "https://stackoverflow.com/questions/307759", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: where is my ActiveX DLL project template in VS 2005? In VB6, ActiveX DLL is listed as a project template but in VS 2005+ there is no such thing. Where is my good old ActiveX DLL template? Many thanks in advance. A: A couple of concepts; .NET Assemblies are the functional equivalent to ActiveX DLLs in the .NET langa...
{ "language": "en", "url": "https://stackoverflow.com/questions/307763", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do I check if an object's type is a particular subclass in C++? I was thinking along the lines of using typeid() but I don't know how to ask if that type is a subclass of another class (which, by the way, is abstract) A: dynamic_cast can determine if the type contains the target type anywhere in the inheritance...
{ "language": "en", "url": "https://stackoverflow.com/questions/307765", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "106" }
Q: Compile errors after converting to a Web Application Project from a Web Site I'm trying to convert a Web Site to the Web Application project model and I'm running into compile errors that do not seem to be covered by the guidance I found at Converting a Web Site Project to a Web Application Project. The issue is tha...
{ "language": "en", "url": "https://stackoverflow.com/questions/307766", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: RESTful 'miscellaneous' pages in an ASP.NET MVC site? Imagine we were doing this StackOverflow site in ASP.NET MVC (funny that, 'cause it is...). We have to develop the views: * *About this site *Faq *Privacy policy *404 page *Error page *etc... Now, because we want to keep this RESTful because we're tryin...
{ "language": "en", "url": "https://stackoverflow.com/questions/307772", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How can I list the contents of a .zip folder in c#? How can I list the contents of a zipped folder in C#? For example how to know how many items are contained within a zipped folder, and what is their name? A: Ick - that code using the J# runtime is hideous! And I don't agree that it is the best way - J# is out of ...
{ "language": "en", "url": "https://stackoverflow.com/questions/307774", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "32" }
Q: How do I use the value of a variable at declaration time in a JavaScript anonymous function? This is a really basic question but... I have some code like this var arr = Array('blah.jpg','ha.jpg'); for (var i=0; i<array.length; i++) { $('div#blah' + i).click(function() { $('img').attr('src', arr[i]); }...
{ "language": "en", "url": "https://stackoverflow.com/questions/307777", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How do I enable color when running RSpec through RStakeout? When using topfunky's RStakeout, the color in the result of the spec command is lost. This happens even when adding the --color flag. A: I was able to get it to work with --tty in my .rspec file (use Rails 3.0.3 and rspec 2.3). I think it's --autotest for ...
{ "language": "en", "url": "https://stackoverflow.com/questions/307783", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How do I replace 'php3' with 'php' inside every file in a directory Hopefully a nice simple one. I've got a php3 website that I want to run on php 5.2 To start with I'd just like to have every reference to the current "index.php3" _within_each_file_ (recursively) changed to "index.php" and then move on to worrying a...
{ "language": "en", "url": "https://stackoverflow.com/questions/307796", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How can I raise an event every hour (or specific time interval each hour) in .NET? I'm working on a little web crawler that will run in the system tray and crawl a web site every hour on the hour. What is the best way to get .NET to raise an event every hour or some other interval to perform some task. For example I...
{ "language": "en", "url": "https://stackoverflow.com/questions/307798", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "31" }
Q: Summary of new features in WCF 2.0? Is there a good reference, or summary list, of new features in WCF 2.0/VS2010? I'm trying to do a justification proposal for a project, to migrate from Jabber to WCF. A: Not answering your question in particular, but WCF 2.0's not going to come out for quite some time, so I'd bas...
{ "language": "en", "url": "https://stackoverflow.com/questions/307809", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: what alternatives are there to using global.asax? I am using my own custom authentication with IIS, and I want the server on every page load (no matter what type of file) to first check the Application variable to see if the user is authenticated and authorized to see the site. In global.asax this could be: void App...
{ "language": "en", "url": "https://stackoverflow.com/questions/307821", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: CyclicalReferenceException while using Betwixt I have cyclical references in my hibernate domain model which is causing Betwixt to fail. I don't want to change my domain model. How do I change Betwixt to ignore the cyclical reference?
{ "language": "en", "url": "https://stackoverflow.com/questions/307823", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How do you fix a bad merge, and replay your good commits onto a fixed merge? I accidentally committed an unwanted file (filename.orig while resolving a merge) to my repository several commits ago, without me noticing it until now. I want to completely delete the file from the repository history. Is it possible to r...
{ "language": "en", "url": "https://stackoverflow.com/questions/307828", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "430" }
Q: Can I force a display font from inside a formula in Crystal Reports? I have a report with a lot of formulas that translate the word "TRUE" into an "X" and "FALSE" into a blank space. I use these to put an "X" in a checkbox. Sometimes there is text after my checkbox. To avoid slight shifts to the left and right, I p...
{ "language": "en", "url": "https://stackoverflow.com/questions/307830", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: in IIS, what's the difference between "application" and "session"? A Session is per browser (determined via cookies), but when does an "Application" start, and end, and how does IIS know know when a request is a part of the same same "Application" instance (if not done via cookies the same way that sessions are)? A...
{ "language": "en", "url": "https://stackoverflow.com/questions/307831", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Best way to load an application like it was in its previous state when it was terminated I would like to learn the best practices in reloading the application state, such that when my app is started, it should automatically load the "correct" view/subview when it is opened again. In my particular case, my app has a ...
{ "language": "en", "url": "https://stackoverflow.com/questions/307832", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How to add a UIButton at runtime I am trying to add a UIButton at runtime however it is not visible. What am I doing wrong? - (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { UIButton *btn = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain]; btn.frame = CGRectM...
{ "language": "en", "url": "https://stackoverflow.com/questions/307845", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: ejb3-persistence.jar source Well, I must be brain-damaged, because I can't find the java source for Sun's persistence.jar or JBoss's ejb3-persistence.jar JPA package. They are open-source aren't they? I looked all over the java.sun.com site as well as the GlassFish wiki, but came up empty. I'd like a src.zip or fol...
{ "language": "en", "url": "https://stackoverflow.com/questions/307848", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: Cayenne null pointer error when trying to commit changes I'm running the following code that errors when I try to commit my changes using Cayenne as my ORM. The code is pasted below and errors out on the context.commitChanges();line. The output messages are pasted below the code. Any help on figuring this out w...
{ "language": "en", "url": "https://stackoverflow.com/questions/307849", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: VS2008 Missing C/C++ Header Files So, I'm working on some network programming in C, and it would seem that I am missing a bunch of standard C/C++ header files. For example, sys/socket.h is not there. A few otheres are missing too like netdb.h, and unistd.h. Is there a pack I need to install to get these on windows? ...
{ "language": "en", "url": "https://stackoverflow.com/questions/307855", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to reset the scroll position of a UITableView? I would like to completely reset the scroll position of a UITableView, so that every time I open it, it is displaying the top-most items. In other words, I would like to scroll the table view to the top every time it is opened. I tried using the following piece of c...
{ "language": "en", "url": "https://stackoverflow.com/questions/307857", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: Is there a way to create a Makefile without running ./configure? I'd like to skip the tests and create a (default) Makefile. A: Of course you can write a makefile by hand. A quick googling shows LOTS of tutorials. This one looks promising. For the cliffs notes version, the example boils down this: CC=g++ CFLAGS=-c ...
{ "language": "en", "url": "https://stackoverflow.com/questions/307859", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Upload Image to Database From DetailsView Insert Mode I am attempting to upload an image to a database via a DetailsView containing an UploadFile control in the Edit Item template. I have a stored procedure which handles the upload to a SQLServer DB which expects two parameters: AuthorName, varchar(20) and AuthorIma...
{ "language": "en", "url": "https://stackoverflow.com/questions/307874", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: jQuery draggable table elements jQuery's draggable functionality doesn't seem to work on tables (in FF3 or Safari). It's kind of difficult to envision how this would work, so it's not really surprising that it doesn't. <html> <style type='text/css'> div.table { display: table; } div.row { display: table-ro...
{ "language": "en", "url": "https://stackoverflow.com/questions/307882", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "29" }