text
stringlengths
8
267k
meta
dict
Q: Writing an XmlSchema to a MemoryStream fails with an exception while running from Nunit I'm trying to convert an XmlSchema object to string. I'm building a simple XmlSchema, compiling it, and then converting it as follows: public string ConvertXmlSchemaToString(XmlSchema xmlSchema) { String schemaAsString = ...
{ "language": "en", "url": "https://stackoverflow.com/questions/411056", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: CodeDom generic type constraint Is there a way to generate a class constraint with CodeDom. Because when I use something like var method = new CodeMemberMethod(); var genericParam = new CodeTypeParameter("InterfaceType"); genericParam.Constraints.Add("class"); method.TypeParameters.Add(genericParam); the generated ...
{ "language": "en", "url": "https://stackoverflow.com/questions/411057", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: IE is losing ClearType I'm experiencing something really strange! I have a div that I'm hiding with JS (jQuery). Like this: $('#myDiv').hide(); Then when I make a fadeIn like this: $("#myDiv").fadeIn('slow'); then the text loses ClearType in IE but not in FF. If I go with toggle insted of fadeIn, then it's all fin...
{ "language": "en", "url": "https://stackoverflow.com/questions/411058", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: How do I tell rsync to run only if the destination directory exists? I have this bash script running my backup to an external hard drive... only if that drive is mounted (OS X): DIR=/Volumes/External; if [ -e $DIR ]; then rsync -av ~/dir_to_backup $DIR; else echo "$DIR does not exist"; fi This works, but I sens...
{ "language": "en", "url": "https://stackoverflow.com/questions/411092", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Function with same name but different signature in derived class not found I have a function with the same name, but with different signature in a base and derived classes. When I am trying to use the base class's function in another class that inherits from the derived, I receive an error. See the following code: c...
{ "language": "en", "url": "https://stackoverflow.com/questions/411103", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "96" }
Q: C++, equivalence between pointer-to-functions and pointer-to-member-functions? I'm used to thinking of member functions as just being a special case of normal functions, where member functions have an extra parameter at the beginning of their parameter list for the 'this' pointer, that is, the object on which the me...
{ "language": "en", "url": "https://stackoverflow.com/questions/411114", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Programmatic graphics toolchain I have drawn an icon in Inkscape, but would now like to programmatically alter it (change the colours slightly for different icon states) and convert it to a tiled PNG format file containing multiple icons with different colours. I know about Inkscape's --export-png options, but can't...
{ "language": "en", "url": "https://stackoverflow.com/questions/411118", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: comparing code size vs source size There are plenty of script/tools for counting line of code, and some to count functions size in terms of line of code. But here I'm looking to a way to measure function size in terms of bytes of generated code. Does anyone know a way/tools to extract this information from a .lib or...
{ "language": "en", "url": "https://stackoverflow.com/questions/411121", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Is it true that NHibernate ISession.save(newTransientEntity) will only return generated Id, but NOT updating the Id property of the entity? Using NHibernate.Mapping.Attributes, I have a entity class with something like: [Class] public class EntityA { ... [Id][Generator(class="guid")] public Guid Id {...} ...
{ "language": "en", "url": "https://stackoverflow.com/questions/411127", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Using named_scope to get row count Rails gurus: I've just discovered named_scope thanks to another SO user. :) I'd like to get the count of a set of rows - i.e. a SELECT COUNT(*). Additionally, I want to still be able to chain named scopes in the call. Is this a legitimate (albeit weird) usage of named scope? named...
{ "language": "en", "url": "https://stackoverflow.com/questions/411134", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: How can I find duplicate headers in a large solution in MSVC++ 2005 or 2008? In Visual Studio (C++), is there a way to easily find duplicate headers that are defined in .cpp files? I'm also trying to find ways to detect this situation: * *A includes B includes C *A includes C *=> A doesn't need to include C A...
{ "language": "en", "url": "https://stackoverflow.com/questions/411142", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How to make text in a WinForms TextBox unselectable without disabling it? Is it possible to make the text in a TextBox unselectable without disabling the TextBox? It's a RichTextBox and I need it's formatting and selection features. I can't disable it because I want to handle MouseMove and MouseDown events. So far I...
{ "language": "en", "url": "https://stackoverflow.com/questions/411143", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: What's causing these javascript validation errors (Implied global and already defined var)? Could anyone explain me why: function doAjax() { var xmlHttpReq = false; try { // Firefox, Opera 8.0+ and Safari xmlHttpReq = new XMLHttpRequest(); } catch (e) { // Internet Explorer try { ...
{ "language": "en", "url": "https://stackoverflow.com/questions/411145", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to generate .net classes from Access tables Is there any way that I can get my .NET classes to be automatically generated from the tables in Access? Anything like ORM available? A: You can either use an ORM such as nHibernate, here's a partial older list of ORM's http://www.theserverside.net/news/thread.tss?thr...
{ "language": "en", "url": "https://stackoverflow.com/questions/411162", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Postback problem when using URL Rewrite and 404.aspx I'm using URL rewrite on my site to get URLs like: http://mysite.com/users/john instead of http://mysite.com/index.aspx?user=john To achive this extensionless rewrite with IIS6 and no access to the hosting-server I use the "404-approach". When a request that the s...
{ "language": "en", "url": "https://stackoverflow.com/questions/411167", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: What is involved in open sourcing proprietary software? My primary motivation for asking this question is this uservoice suggestion. Jeff declined the ticket to make the SO software open source saying that it will take more time. I've seen this before in various other pieces of software that have gone from propriet...
{ "language": "en", "url": "https://stackoverflow.com/questions/411180", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: FORTRAN, what do you recommend for a development environment I need to start developing in FORTRAN, any recommendations on learning\developing FORTRAN coming from the .NET area? Any recommended environments that are close to Visual Studio? Visual Fortran looked really promising, but is a bit pricey, and look like ...
{ "language": "en", "url": "https://stackoverflow.com/questions/411195", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Flex 3 - Launching a .exe file i want to organize my ebooks. and want to create an air app that would have the list of my ebooks. i want it, that if i click that ebook name. i would launch/call the ebook file. just like double clicking the icon in a folder. how could i trigger that in flex? thanks. also, is it possi...
{ "language": "en", "url": "https://stackoverflow.com/questions/411202", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to increase the space between two tables in LaTeX? I'm completely new to LaTeX and something I'm wanting to do is eluding me. Below, I have the code for two tables which appear side-by-side (which is what I wanted). But they're very close together, I'd like to have maybe an inch in-between the two tables. How wo...
{ "language": "en", "url": "https://stackoverflow.com/questions/411217", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: Hudson, C++ and UnitTest++ Has anyone used Hudson as a Continuous-Integration server for a C++ project using UnitTest++ as a testing library? How exactly did you set it up? I know there have been several questions on Continuous Integration before, but I hope this one has a narrower scope. EDIT: I'll clarify a bit on...
{ "language": "en", "url": "https://stackoverflow.com/questions/411218", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "22" }
Q: Converting float to int in F# Can someone please explain why int (0.4 * 10.0) is 4 yet int ((2.4 - 2.0) * 10.0) is 3? And then also please explain how to get 4. i.e. Do I really have to do int (System.Math.Round((2.4 - 2.0) * 10.0))? It's just so ugly for something that should be so simple. A: Actually, in .Net th...
{ "language": "en", "url": "https://stackoverflow.com/questions/411221", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: A source to learn database design I am looking to make a website and in the future desktop apps as well and i know nothing about db design so what tutorials or books (online preferably) are there? thanks A: The introduction to normalization in the MySQL manual is very good. There's also a list of resources at the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/411222", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Footer isn't sticking to bottom though I have it coded I removed the footer for the time being, site had to go online. So the link is gone as well. As you can see (in FF2 as well as in IE7) the footer is at the bottom of the SCREEN, but not at the bottom of the page (content). I have this in my code: <div id="wrap">...
{ "language": "en", "url": "https://stackoverflow.com/questions/411228", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Comparing two objects . If i have a complex object, what is the best practice pattern to write code to compare 2 instances to see if they are the same A: I think the answer is highly problem dependent. For example, you may want to consider objects equal only if all of their properties are equivalent. This would ...
{ "language": "en", "url": "https://stackoverflow.com/questions/411232", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: problem with php script in 1and 1 hosting I have a problem. I have wrote an upload form on my html page. Then created an upload php file. I added both to my webserver 1 and 1. when clicking on the script on the live webpage - it starts uploading, however the domain name/upload.php file sits there with nothing ther...
{ "language": "en", "url": "https://stackoverflow.com/questions/411237", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: .netTiers vs SubSonic I had some time this afternoon to run a head to head comparison between netTiers and SubSonic. I used code generated using SubStage (part of the SubSonic 2.1 release) and I used RepositoryRecord as my base class. I ran the same test against the same database using code generated by .netTiers 2....
{ "language": "en", "url": "https://stackoverflow.com/questions/411238", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do I select individual words of a camelized word in IntelliJ IDEA What is the shortcut in IntelliJ IDEA to move across or select individual words of a camelized word? Lets say I have aLongMultiWordVariableName, I want to be able to move the cursor to each word for editing or select parts of the variable. Eclipse...
{ "language": "en", "url": "https://stackoverflow.com/questions/411240", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "98" }
Q: How do I pass/get command line parameters? I am trying to use Shoes and I need to pass it command-line parameters (basically, my Shoes app will be called from another pre-existing app and this would allow me to pre-fill some parts of shoes). Should I then call it using bin/shoes wrapper? It seems I can not pass argu...
{ "language": "en", "url": "https://stackoverflow.com/questions/411246", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Running a CMD or BAT in silent mode How can I run a CMD or .bat file in silent mode? I'm looking to prevent the CMD interface from being shown to the user. A: Use Advanced BAT to EXE Converter from http://www.battoexeconverter.com This will allow you to embed any additional binaries with your batch file in to one s...
{ "language": "en", "url": "https://stackoverflow.com/questions/411247", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "56" }
Q: Coding style checker for C I'm working for a company that has strict coding style guidelines but no automatic tool to validate them. I've looked around and the only tools I could find were lint like tools that seem to be aimed at verifying what the code does, and preventing bugs and not at making sure the coding sty...
{ "language": "en", "url": "https://stackoverflow.com/questions/411249", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "25" }
Q: What are the differences between PHP and Java? What are the main differences between PHP and Java that someone proficient in PHP but learning Java should know about? Edit: I mean differences in the syntax of the languages, i.e their data types, how they handle arrays & reference variables, and so forth :) A: * *Ja...
{ "language": "en", "url": "https://stackoverflow.com/questions/411254", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "23" }
Q: Tab movement in shoes I have a problem I have a: stack { flow { para "Enter text:" edit_line } edit_box } (simplified version). When user is on edit_line and presses tab, I want it to move to edit_box control (currently, it just loses focus). Thanks, Juraj. A: Currently, this only works on linux ...
{ "language": "en", "url": "https://stackoverflow.com/questions/411255", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: What is the best way to test GWT code What is the best way to test GWT code? GWTTestCase in hosted mode is too slow and none of the mocking frameworks work. Currently we are following MVC as suggested in http://robvanmaris.jteam.nl/2008/03/09/test-driven-development-for-gwt-ui-code/ and using GWTMockUtilities disarm...
{ "language": "en", "url": "https://stackoverflow.com/questions/411257", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: Tutorial for tile based side scroller game-play? Does anyone know a good resource or some pointers which could help me make a side scrolling tile based (descreet movement for character) with box pushing and moving platforms etc. I'm focused right now C/C++ console development (tho after this project I may stop and d...
{ "language": "en", "url": "https://stackoverflow.com/questions/411273", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Why does perfmon fail to give available memory and what are the alternatives? I am trying to get reliable information on when my C# application (Windows XP) will run out of memory. I did some research and tests on my machine and picked the most reliable perfmon counters: Memory.Pages Output/sec Memory.Available Byte...
{ "language": "en", "url": "https://stackoverflow.com/questions/411275", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Import from ADO.NET Data Services into Excel I'm playing around with ADO.NET Data Services and would like to import the output from a query into a spreadsheet. Although Excel 2007 allows me to import the results of a request from the web page, the resulting spreadsheet contains all the XML header info which makes s...
{ "language": "en", "url": "https://stackoverflow.com/questions/411287", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: alternatives to winsock2 with example server source in c++ i'm using this example implementation found at http://tangentsoft.net/wskfaq/examples/basics/select-server.html This is doing most of what I need, handles connections without blocking and does all work in its thread (not creating a new thread for each connec...
{ "language": "en", "url": "https://stackoverflow.com/questions/411295", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Fastest way to compare two lists I have a List (Foo) and I want to see if it's equal to another List (foo). What is the fastest way ? A: From 3.5 onwards you may use a LINQ function for this: List<string> l1 = new List<string> {"Hello", "World","How","Are","You"}; List<string> l2 = new List<string> {"Hello","World...
{ "language": "en", "url": "https://stackoverflow.com/questions/411296", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: google charts bad request does anyone know why this is a bad request? http://chart.apis.google.com/chart?cht=lxy& chd=t:0,0.7,1.4,2.2,2.9,3.6,4.3,5,5.8,6.5,7.2,7.9,8.6,9.4,10.1,10.8,11.5,12.2,12.9,13.7,14.4,15.1,15.8,16.5,17.3,18,18.7,19.4,20.1,20.9,21.6,22.3,23,23.7,24.5,25.2,25.9,26.6,27.3,28.1,28.8,29.5,30.2,30.9...
{ "language": "en", "url": "https://stackoverflow.com/questions/411302", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How should I using C# to read partition table/boot sector? Hi i'v look through the WMI class... but none can help me in getting the partition table information... now i'm having a project which is to display the USB thumbdrive's .MBR how should i go about it? really puzzle... Any help and guide will be very much app...
{ "language": "en", "url": "https://stackoverflow.com/questions/411304", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: List a given attribute of specific child elements I have some XML code that looks like this <SEARCHRESULTS> <FUNCTION name="BarGraph"> <PARAMETER name="numList"></PARAMETER> <PARAMETER name="maxValue"></PARAMETER> <CODE>Some code</CODE> </FUNCTION> </SEARCHRESULTS> And I want to extract a list of pa...
{ "language": "en", "url": "https://stackoverflow.com/questions/411306", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How much information to log from errors? At the company I work for, I have created a Error Logging class to handle errors in my ASP.net application. It is a custom class because we are not allowed to install additional software on our servers (nLog, log4net, etc). I currently use it in two of my projects and have s...
{ "language": "en", "url": "https://stackoverflow.com/questions/411312", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How to access properties of a usercontrol in C# I've made a C# usercontrol with one textbox and one richtextbox. How can I access the properties of the richtextbox from outside the usercontrol. For example.. if i put it in a form, how can i use the Text propertie of the richtextbox??? thanks A: Change the access mo...
{ "language": "en", "url": "https://stackoverflow.com/questions/411316", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "21" }
Q: Do you usually set the default value before or set it in the else? Which one of the following do you do: var = true; if (...) var = false; Or if (...) var = false; else var = true; Is there a reason you pick on or the other? I'm working on the premise that nothing else is happening to var. The next line of code mi...
{ "language": "en", "url": "https://stackoverflow.com/questions/411330", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Using JavaMail with TLS I found several other questions on SO regarding the JavaMail API and sending mail through an SMTP server, but none of them discussed using TLS security. I'm trying to use JavaMail to send status updates to myself through my work SMTP mail server, but it requires TLS, and I can't find any exam...
{ "language": "en", "url": "https://stackoverflow.com/questions/411331", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "52" }
Q: Delphi code generation I need to speed up my coding, too much work, so I need be able to generate code. Any tools, any ideas? A: If you mean something like a modeling tool, you could try out ModelMaker. A: Rather than trying to code generate, you should probably just obtain code to do the bulk of what you want to...
{ "language": "en", "url": "https://stackoverflow.com/questions/411342", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How best to determine if an argument is not sent to the JavaScript function I have now seen 2 methods for determining if an argument has been passed to a JavaScript function. I'm wondering if one method is better than the other or if one is just bad to use? function Test(argument1, argument2) { if (Test.argum...
{ "language": "en", "url": "https://stackoverflow.com/questions/411352", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "262" }
Q: How do i make ActiveRecord work on Tables with multiple columns as Primary keys? How do i use ActiveRecord on existing DB with multiple columns as primary key and no ID column? I had to write extensions/hacks on set_primary_key, update and delete methods. But im not sure if it'll work on future versions. Is there a ...
{ "language": "en", "url": "https://stackoverflow.com/questions/411384", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do I interact with a kerberos server from my own application My network has a kerberos server for username/password authentication. Machines that run my application have functioning kerberos clients, so users can use kinit, etc. How do I interact with the server programatically, from my own custom applications? ...
{ "language": "en", "url": "https://stackoverflow.com/questions/411391", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to use javascript onclick on a DIV tag to toggle visibility of a section that contains clickable links? Hi I've got a DIV section that has only its title visible initially. What I would like to achieve is that when the visitor clicks anywhere on the area of toggle_section the toggle_stuff div toggles between vis...
{ "language": "en", "url": "https://stackoverflow.com/questions/411396", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Limiting text in a UITextView I am trying to limit the text input into a UITextView in cocoa-touch. I really want to limit the amount of rows rather than the number of characters. So far I have this to count the amount of rows: - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacemen...
{ "language": "en", "url": "https://stackoverflow.com/questions/411398", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Is it OK to include an ID inside the URL? Well, my question is simple. Does the ID affect the position of a webpage on Google ? I have links like this http://example.com/news/title-slug/15/ and people say to me that I should remove the ID from the URL. And I belive that is not true. By my logic, you can't depen...
{ "language": "en", "url": "https://stackoverflow.com/questions/411407", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How can I post data (form) to html page and hijacking the data in the middle? the site addres: http://www.ynet.co.il/YediothPortal/Ext/TalkBack/CdaTalkBack/1,2497,L-3650194-0-68-544-0--,00.html * *fill the form with rubbish. *Hit 'Send' *the form post the data to another HTML without any parsing of the data i'v...
{ "language": "en", "url": "https://stackoverflow.com/questions/411408", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Subversion Repository on Linux Dev What's the best practice for setting up a subversion repository on a linux development machine. External users need to be able to access a specific repository, but nothing else on the machine. I know one answer is to set up a dedicated repository, but I'm looking for a single mac...
{ "language": "en", "url": "https://stackoverflow.com/questions/411410", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Flex Matching Many Database Records (Quicksilver-like or Launchy-like matching) Assume I have a database table with many names. I'd like to "flex match" against these names. I'm not sure if "flex match" is the proper term to use, but let's go with that for now. There have been similar discussions on "fuzzy matchi...
{ "language": "en", "url": "https://stackoverflow.com/questions/411411", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: SSRS: Error while querying data from an Excel file (through ODBC) I am trying to render a simple chart using SSRS. The data is in an Excel sheet. I have set up an user DSN and created a data source in SSRS using ODBC. I am able to query the excel in Data tab. However while trying to preview, I get the following erro...
{ "language": "en", "url": "https://stackoverflow.com/questions/411413", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Pointer to void in C++? I'm reading some code in the Ogre3D implementation and I can't understand what a void * type variable means. What does a pointer to void mean in C++? A: It's just a generic pointer, used to pass data when you don't know the type. You have to cast it to the correct type in order to use it. A...
{ "language": "en", "url": "https://stackoverflow.com/questions/411422", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: What happens to an iPhone app when iPhone goes into stand-by mode? My app uses NSTimer and it appears that NSTimer doesn't fire when the iPhone goes into the stand-by mode (either by pressing the hardware button or by the idle timer). When I activate the iPhone again, my app is still in the foreground. What happens ...
{ "language": "en", "url": "https://stackoverflow.com/questions/411436", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "24" }
Q: How to show if a method may return null After posting this question and reading that one I realized that it is very important to know if a method is supposed to return null, or if this is considered an error condition and an exceptions should be thrown. There also is a nice discussion when to return ‘null’ or throw ...
{ "language": "en", "url": "https://stackoverflow.com/questions/411447", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "50" }
Q: How to refresh a simple binding of a Windows Forms control? I'm binding a domain objects property to the Text property of a System.Windows.Forms.Label using the DataBindings: Label l = new Label(); l.DataBindings.Add(new Binding("Text",myDomainObject,"MyProperty")); However, when I change the domain object, the Lab...
{ "language": "en", "url": "https://stackoverflow.com/questions/411457", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: EF entites via WCF problem I've created a WCF service based on an Entity Framework model. When I consume the service from a console app, a WinForm app, and a WPF app, everything just works. I can see the entites and can add/delete/etc. However, when I try to consume the same WCF service from a web app, I get erro...
{ "language": "en", "url": "https://stackoverflow.com/questions/411459", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Use HTTP Keep-Alive for server to communicate to client Recently in an interview I was asked how I would approach an online chat client application. I went through the standard "polling" solution but was cut off because the interviewer was looking for the "HTTP 1.1 keep-alive" method. Having used HTTP for quite a ...
{ "language": "en", "url": "https://stackoverflow.com/questions/411460", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: RESTful way to create multiple items in one request I am working on a small client server program to collect orders. I want to do this in a "REST(ful) way". What I want to do is: Collect all orderlines (product and quantity) and send the complete order to the server At the moment I see two options to do this: * *...
{ "language": "en", "url": "https://stackoverflow.com/questions/411462", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "145" }
Q: Question on dynamic URL parsing I see many, many sites that have URLs for individual pages such as http://www.mysite.com/articles/this-is-article-1 http://www.mysite.com/galleries/575 And they don't redirect, they don't run slowly... I know how to parse URL's, that's easy enough. But in my mind, that seems slow an...
{ "language": "en", "url": "https://stackoverflow.com/questions/411464", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: ASP.NET MVC Form repopulation I have a controller with two actions: [AcceptVerbs("GET")] public ActionResult Add() { PrepareViewDataForAddAction(); return View(); } [AcceptVerbs("POST")] public ActionResult Add([GigBinderAttribute]Gig gig, FormCollection formCollection) { ...
{ "language": "en", "url": "https://stackoverflow.com/questions/411476", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Strange results from OdbcDataReader reading Sqlite DB This method returns some strange results, and was wondering if someone could explain why this is happening, and possibly a solution to get my desired results. Results: FileName = what I'd expect FileSize = what I'd expect Buffer = all bytes = 0 BytesRead = 0 Blob...
{ "language": "en", "url": "https://stackoverflow.com/questions/411478", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to process events from Buttons inside Repeaters? And what's this EnableEventValidation thing? I have a Repeater with a Button inside the ItemTemplate. I added the CommandName property to the button and registered and event handler for the ItemCommand event on the Repeater. My problem is that when I click the but...
{ "language": "en", "url": "https://stackoverflow.com/questions/411491", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: build argument lists containing whitespace In bash one can escape arguments that contain whitespace. foo "a string" This also works for arguments to a command or function: bar() { foo "$@" } bar "a string" So far so good, but what if I want to manipulate the arguments before calling foo? This does not work: b...
{ "language": "en", "url": "https://stackoverflow.com/questions/411495", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: Mutual Exclusion Problem Please take a look on the following pseudo-code: boolean blocked[2]; int turn; void P(int id) { while(true) { blocked[id] = true; while(turn != id) { while(blocked[1-id]) /* do nothing */; turn = id; ...
{ "language": "en", "url": "https://stackoverflow.com/questions/411499", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Understanding IEquatable When I implement objects that I want to compare using the IEquatable<T> interface: * *Why do I have to override Equals(object) method if I already implemented Equals(T)? *Can I use == and != operators once I implement IEquatable<T>? A: * *From MS Docs article on IEquatable<T>: If you...
{ "language": "en", "url": "https://stackoverflow.com/questions/411500", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "53" }
Q: Is Postback considered as a pageview by google ads or CPM ads? Is a postback (asp.net) considered as a pageview by google ads or CPM ads or it is ignored? How does google ads differentiate between a postback and a pageview? A: (Update: Sorry I mixed google adsense with google analytics. Not sure if this works the s...
{ "language": "en", "url": "https://stackoverflow.com/questions/411504", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: XML Fetcher Cron job: Run how often and how many fetches? I've got a PHP script on a shared webhost that selects from ~300 'feeds' the 40 that haven't been updated in the last half hour, makes a cURL request and then delivers it to the user. SELECT * FROM table WHERE latest_scan < NOW() - INTERVAL 30 MINUTE ORDER BY...
{ "language": "en", "url": "https://stackoverflow.com/questions/411512", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Way to Automatically Add a LinqToSql base class to Entities? Is there an automatic way to add base classes to Linq2Sql entities? I know I can define a partial and implement that but there has to be an automated way, right? A: The LINQ-to-SQL code-generator supports this directly. The base-class for the data-context...
{ "language": "en", "url": "https://stackoverflow.com/questions/411515", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Management of Java string resources I'm working on a java SE 1.5+ swing application, in conjunction with others. I'm wondering what the best way of managing string resources is. I understand the principles behind resource bundles etc. I'd like to avoid having one property file for every class that needs a string, as...
{ "language": "en", "url": "https://stackoverflow.com/questions/411517", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to create a series of dates in Cocoa for a week I am current writing an application and need to show the current days of the week. So, for the coming week I need to generate the follow dates. Monday, 5 January 2009 Tuesday, 6 January 2009 Wednesday, 7 January 2009 Thursday, 8 January 2009 Friday, 9 January 2009 ...
{ "language": "en", "url": "https://stackoverflow.com/questions/411530", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Adsense in a ajax based application? How do I add adsense or other ads in a asp.net ajax/ajax based application ? (ex. ra-ajax samples page) or GWT Is creating an iframe a viable solution? As stated below, placing adsense script is easy. But the google bot wont be able to scan my ajax based page, as all of the con...
{ "language": "en", "url": "https://stackoverflow.com/questions/411533", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Custom protocol in linux? I am attempting to port one of my hobby project to linux. Preferrably to Mono since it is written in C#. But I am looking into Python as well. One of the feature of the application is that it needs to associate with a custom protocol so the application is invoked when the user clicks links ...
{ "language": "en", "url": "https://stackoverflow.com/questions/411544", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: Code Generator vs Code Refactoring How do you like your CRUD programs. Code-generated, framework-driven, or manually written? A: My experience with code generators is that they're a good start but after the changes have settled down I usually want to rewrite the modules by hand. Of course, that can become a maint...
{ "language": "en", "url": "https://stackoverflow.com/questions/411547", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Anatomy of an email message What are the various parts to an email message? I'm working with these 3rd party components, and so far from what I understand are: * *emails have unique messageID's (per server I would presume) *emails have headers *emails have body text that can be either html or plain text. *atta...
{ "language": "en", "url": "https://stackoverflow.com/questions/411553", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Why does FogBugz require that the DEP is turned off? I am really wondering why FogBugz when installed locally insists that DEP is turned off? A: FogBugz 6 (and earlier) requires that Data Execution Prevention (DEP) be disabled on versions of Windows that have DEP, because of a third-party COM component that we use...
{ "language": "en", "url": "https://stackoverflow.com/questions/411560", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-1" }
Q: missing data in gridview I've created DataTable dt = new DataTable(); dt.Columns.Add("Type"); dt.Columns.Add("Address1"); dt.Columns.Add("Address2"); dt.Columns.Add("PostalCode"); dt.Columns.Add("Country"); DataRow drow = dt.NewRow(); drow["Type"] =...
{ "language": "en", "url": "https://stackoverflow.com/questions/411571", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Proper Currying in C# Given a method DoSomething that takes a (parameterless) function and handles it in some way. Is there a better way to create the "overloads" for functions with parameters than the snippet below? public static TResult DoSomething<TResult>(Func<TResult> func) { //call func() and do something ...
{ "language": "en", "url": "https://stackoverflow.com/questions/411572", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "44" }
Q: Inserting data into SQL Table with Primary Key. For dupes - allow insert error or Select first? Given a table such as: CREATE TABLE dbo.MyTestData (testdata varchar(50) NOT NULL) ALTER TABLE dbo.MyTestData WITH NOCHECK ADD CONSTRAINT [PK_MyTestData] PRIMARY KEY CLUSTERED (testdata) And given that we want a uniq...
{ "language": "en", "url": "https://stackoverflow.com/questions/411575", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Why must a lambda expression be cast when supplied as a plain Delegate parameter Take the method System.Windows.Forms.Control.Invoke(Delegate method) Why does this give a compile time error: string str = "woop"; Invoke(() => this.Text = str); // Error: Cannot convert lambda expression to type 'System.Delegate' // be...
{ "language": "en", "url": "https://stackoverflow.com/questions/411579", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "130" }
Q: How do I save a stream to a file in C#? I have a StreamReader object that I initialized with a stream, now I want to save this stream to disk (the stream may be a .gif or .jpg or .pdf). Existing Code: StreamReader sr = new StreamReader(myOtherObject.InputStream); * *I need to save this to disk (I have the filena...
{ "language": "en", "url": "https://stackoverflow.com/questions/411592", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "853" }
Q: dealing with blank non-string data in json and asp.net ajax I am trying to figure out the best way in an asmx web service to indicate null for a date so that I can insert dbnull.value when the user doesn't enter text into a date field. Currently I have a string field in the class that I am serializing that will ser...
{ "language": "en", "url": "https://stackoverflow.com/questions/411594", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: summation of second table grouped by results of first table Using MySQL syntax, how would I write a query to return the following (I am including the two table descriptions and the relationship between them): TABLE_A (ID, DATE, TABLE_C_ID) TABLE_B (ID, AMOUNT, TABLE_A_ID) TABLE_C (ID) I want to return the following...
{ "language": "en", "url": "https://stackoverflow.com/questions/411624", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to set current document.domain in WebBrowser Control to avoid "Access is denied"? How can I set current document.domain in WebBrowser Control to avoid "Access is denied" in Cross-domain calls (XMLHTTP Requests or Iframe/frame access)? I've tried CurrentDocument = WebBrowserControl.Document CurrentDocument.domai...
{ "language": "en", "url": "https://stackoverflow.com/questions/411626", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: DRY in ASP.NET MVC - details display vs. edit form I am trying to learn ASP.NET MVC and I hit this problem: I have a "view product details" form that I want to reuse as an add/edit form. (When you look at the product details, if you have the rights to do it an Edit link should appear; it should redisplay the same fo...
{ "language": "en", "url": "https://stackoverflow.com/questions/411628", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Representing u1F000 as a Java string I've got a bunch of unicode characters from U1F000 and upwards, and I'm wondering how to represent them in Java. A Java unicode escape is on the form "\uXXXX" and the Java language specification says that "Representing supplementary characters requires two consecutive Unicode esc...
{ "language": "en", "url": "https://stackoverflow.com/questions/411631", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to find out what Eclipse is doing in background? OS X 10.5.6. My Eclipse 3.4 is going crazy lately. After innocent operations like typing text or moving some files in Navigator view or saving, it sometimes starts "waiting on background operation", and eats one CPU core, shuffling back and forth tens of megabyte...
{ "language": "en", "url": "https://stackoverflow.com/questions/411632", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Downloading image with a variable URL? I am new to this, so please dumb it down for me. I have been tinkering with Objective-C for an iPhone app and have hit a road block. I am trying to pass the value contained in a variable (string) to a method but it doesn't work. I am guessing it is because the variable is prob...
{ "language": "en", "url": "https://stackoverflow.com/questions/411633", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do you not do joins? I've been reading a lot lately about how joins in DB queries slow things down. Evidently Google App Engine doesn't even allow them. I'm wondering how people design an app with no joins though. For example I'm working on an app that has contacts and organizations. A contact can be in many org...
{ "language": "en", "url": "https://stackoverflow.com/questions/411646", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How to handle this exception? Haskell is givinig me a headache today. I want to handle an exception. When it gets to the top it prints like this: *** Exception: ../p/trip/Trip.hs:(88,16)-(89,50): Non-exhaustive patterns in function split To me it looks like it is PatternMatchFail, but this doesn't work: handle (\(Pa...
{ "language": "en", "url": "https://stackoverflow.com/questions/411651", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How to Change Default Copyright Template Whenever I make a new file in xcode, it puts something like this at the top of the file: // Copyright __MyCompanyName__ 2008. All rights reserved. How can I change that to something useful? Update: found the answer here. A: As of Xcode 6.1.1 this can be changed by click...
{ "language": "en", "url": "https://stackoverflow.com/questions/411653", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Enterprise Library Unity vs Other IoC Containers What's pros and cons of using Enterprise Library Unity vs other IoC containers (Windsor, Spring.Net, Autofac ..)? A: As far as I've seen they are pretty much the same, except for a few implementation details here and there. The biggest advantage that Unity has over t...
{ "language": "en", "url": "https://stackoverflow.com/questions/411660", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "137" }
Q: iPhone app: How to implement a slider button like the builtin one I'm talking about the "slide to unlock" button on iPhone. Any ideas how to go about implementing one in my own iPhone app? I don't see it as a control in IB, or maybe I just missed it? A: It's not a provided control, you'll have to roll your own. Thi...
{ "language": "en", "url": "https://stackoverflow.com/questions/411661", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: What can we learn from your most recent cataclysmic paradigm shift? Very occasionally we go throuh a software learning experience that turns our assumptions upside down, and we view software development from a whole new perspective. The most obvious one I suspect for most of us who have been around a while was the t...
{ "language": "en", "url": "https://stackoverflow.com/questions/411668", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Monitoring, simulating, creating HTTP packets I did some HTTP monitoring with WireShark. Are there more tools like this that allow you to create your own HTTP messsages? Telnet comes to mind Could be handy to get see how hacker-proof your site is... A: Charlse HTTP proxy tool is my favorite. You can manually create...
{ "language": "en", "url": "https://stackoverflow.com/questions/411669", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: What is the general term for the IDE popup that shows you the members when you add the dot after its name? I am writing an academic paper and I need to refer to a feature that exists in most IDEs for OO languages, where you type an objects name in the source code, add the dot, and something pops up and lets you pick...
{ "language": "en", "url": "https://stackoverflow.com/questions/411676", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }