text
stringlengths
8
267k
meta
dict
Q: Enforcing a strict timeout policy on a server side webrequest We will need to call out to a 3rd party to retrieve a value using REST, however if we do not receive a response within 10ms, I want to use a default value and continue processing. I'm leaning towards using an asynchronous WebRequest do to this, but I was ...
{ "language": "en", "url": "https://stackoverflow.com/questions/134917", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Visual Studio Editor: Remove Structured IF/End If Is there and easy way to remove the IF/End If structured pairing. Being able to do this in one keystroke would be nice (I also use Refactor! Pro) Right now this is what I do: * *Delete the IF line *Watch Visual Studio reformat the code to line up correctly takin...
{ "language": "en", "url": "https://stackoverflow.com/questions/134921", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Display number with leading zeros How do I display a leading zero for all numbers with less than two digits? 1 → 01 10 → 10 100 → 100 A: Or this: print '{0:02d}'.format(1) A: You can do this with f strings. import numpy as np print(f'{np.random.choice([1, 124, 13566]):0>8}') This will print constant le...
{ "language": "en", "url": "https://stackoverflow.com/questions/134934", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1329" }
Q: Type double byte character into vbscript file I need to convert → (&rarr) to a symbol I can type into a ANSI VBScript file. I am writing a script that translates a select set of htmlcodes to their actual double byte symbols using a regex. Many languages accomplish this using "\0x8594;"... what is the equivelent in V...
{ "language": "en", "url": "https://stackoverflow.com/questions/134937", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Best practice for placement of display logic in a view in CakePHP I have a CakePHP 1.2 application. I'm running into the case where I need to do some logic to render things correctly in the view. Example: I have a table called Types. There are flags for various types, so each row has one or more BOOL fields set. Fo...
{ "language": "en", "url": "https://stackoverflow.com/questions/134948", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: What is a good alternative for SourceSafe on a USB Drive? I like to keep my source files on a USB drive for the portability. To date I have been using Visual SourceSafe for this purpose. What is a good alternative to VSS that fulfils these criteria: * *Entire database can be held on a USB "pen" drive *Code / docu...
{ "language": "en", "url": "https://stackoverflow.com/questions/134950", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How do you perform address validation? Is it even possible to perform address (physical, not e-mail) validation? It seems like the sheer number of address formats, even in the US alone, would make this a fairly difficult task. On the other hand it seems like a task that would be necessary for several business requ...
{ "language": "en", "url": "https://stackoverflow.com/questions/134956", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "95" }
Q: Get top results for each group (in Oracle) How would I be able to get N results for several groups in an oracle query. For example, given the following table: |--------+------------+------------| | emp_id | name | occupation | |--------+------------+------------| | 1 | John Smith | Accountant | | 2 |...
{ "language": "en", "url": "https://stackoverflow.com/questions/134958", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: Can you use multiple VaryByCustom parameters when caching a user control? I've been trying this a couple of different ways, but it's not working for some reason. Is it even possible? A: If you are overriding GetVaryByCustomString() in the Global.asax.cs file, you can pass in a semicolon delimited list of values wh...
{ "language": "en", "url": "https://stackoverflow.com/questions/134962", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Ruby - equivalent of Python __str__() method? In Ruby, is there the equivalent of the __str__() method that you can define on Python classes? A: FWIW, inspect is probably more like __repr__() than __str__() from the library reference... repr( self) Called by the repr() built-in function and by string conversion...
{ "language": "en", "url": "https://stackoverflow.com/questions/134969", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How do I find the number of references that exist for a particular object? I have a bit of code that passes around a ton of objects and I want to determine if there are any references still lingering around that I am unaware of and where it is those references are located. Any idea of how I can do this? My understa...
{ "language": "en", "url": "https://stackoverflow.com/questions/134976", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Secure only Login.aspx for a site * *Is it possible to secure only the Login.aspx page (and the postback) and not the whole site in IIS? *We are looking to do this specifically with a SharePoint site running Forms Based Authentication against our Active Directory. *Links to this will be helpful. This is what w...
{ "language": "en", "url": "https://stackoverflow.com/questions/134988", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Best way to check if server is reachable in .NET? I have created a timeclock application in C# that connects to a web service on our server in order to clock employees in/out. The application resides in the system tray and clocks users out if they shut down/suspend their machines or if they are idle for more than th...
{ "language": "en", "url": "https://stackoverflow.com/questions/134992", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to prevent blank xmlns attributes in output from .NET's XmlDocument? When generating XML from XmlDocument in .NET, a blank xmlns attribute appears the first time an element without an associated namespace is inserted; how can this be prevented? Example: XmlDocument xml = new XmlDocument(); xml.AppendChild(xml.Cr...
{ "language": "en", "url": "https://stackoverflow.com/questions/135000", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "128" }
Q: How can I script a no-cost notification of batch file errors/returns? I have a problem with stopping a service and starting it again and want to be notified when the process runs and let me know what the result is. Here's the scenario, I have a text file output of an "sc" command. I want to send that file but not ...
{ "language": "en", "url": "https://stackoverflow.com/questions/135010", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Advantages to Using Private Static Methods When creating a class that has internal private methods, usually to reduce code duplication, that don't require the use of any instance fields, are there performance or memory advantages to declaring the method as static? Example: foreach (XmlElement element in xmlDoc.Docum...
{ "language": "en", "url": "https://stackoverflow.com/questions/135020", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "247" }
Q: Python Library Path In ruby the library path is provided in $:, in perl it's in @INC - how do you get the list of paths that Python searches for modules when you do an import? A: I think you're looking for sys.path import sys print (sys.path) A: python -c "import sys; print('\n'.join(sys.path))" /usr/local/Cell...
{ "language": "en", "url": "https://stackoverflow.com/questions/135035", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "81" }
Q: Should you always favor xrange() over range()? Why or why not? A: range() returns a list, xrange() returns an xrange object. xrange() is a bit faster, and a bit more memory efficient. But the gain is not very large. The extra memory used by a list is of course not just wasted, lists have more functionality (slice, ...
{ "language": "en", "url": "https://stackoverflow.com/questions/135041", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "463" }
Q: Interview questions for Flash developers For an interview in a few, I'm not at all familiar with Flash development. What would you ask? A: Honestly, if you yourself aren't a flash developer, I'd caution against interviewing a potential Flash developer, unless you're only doing it to get a sense of their character ...
{ "language": "en", "url": "https://stackoverflow.com/questions/135047", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Internet Explorer 8 and Internet Explorer 6 side by side Possible Duplicate: Running Internet Explorer 6, Internet Explorer 7, and Internet Explorer 8 on the same machine Is there a way to have Internet Explorer 8 and Internet Explorer 6 side by side without virtualizing? I used Multiple IEs which works fine with...
{ "language": "en", "url": "https://stackoverflow.com/questions/135057", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "28" }
Q: #ifdef vs #if - which is better/safer as a method for enabling/disabling compilation of particular sections of code? This may be a matter of style, but there's a bit of a divide in our dev team and I wondered if anyone else had any ideas on the matter... Basically, we have some debug print statements which we turn o...
{ "language": "en", "url": "https://stackoverflow.com/questions/135069", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "126" }
Q: Why do Chrome, Firefox and IE all render fixed-width SELECT controls differently? I am losing hair on this one ... it seems that when I fix width an HTML SELECT control it renders its width differently depending on the browser. Any idea how to to standardize this without having to turn to multiple style sheets? He...
{ "language": "en", "url": "https://stackoverflow.com/questions/135076", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: How can you make a DataGridView scroll one item at a time using the mouse wheel? We'd like to override DataGridView's default behavior when using a mouse wheel with this control. By default, the DataGridView scrolls a number of rows equal the SystemInformation.MouseWheelScrollLines setting. What we'd like to do is...
{ "language": "en", "url": "https://stackoverflow.com/questions/135105", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Java Developer meets Objective-C on Mac OS I have developed in C++ many years ago, but these days I am primarily a Java software engineer. Given I own an iPhone, am ready to spring for a MacBook next month, and am generally interested in getting started with Mac OS developmentmt (using Objective C), I thought I wou...
{ "language": "en", "url": "https://stackoverflow.com/questions/135112", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: How can I use an event to cause a method to run? So in my documentation it says: public event TreeViewPlusNodeCheckedEventHandler NodeChecked() You can use this event to run cause a method to run whenever the check-box for a node is checked on the tree. So how do I add a method to my code behind file that will r...
{ "language": "en", "url": "https://stackoverflow.com/questions/135121", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Hosted CRM system with an API? I apologize if this is slightly off-topic. I'm hoping to find a software-as-a-service CRM system that can be easily integrated with our custom user management application. Fundamentally, we have user our own accounts and provide services to these registered users; frequently, we have ...
{ "language": "en", "url": "https://stackoverflow.com/questions/135122", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How can I get Gmail-like file uploads for my web app? I want to add gmail-like file upload functionality for one of my projects. Can anybody help me with this? My application is built in vb.net. I would appreciate any kind of help or guidance. Thanks A: Here is the gmail uploader clone. This is the exact clone of g...
{ "language": "en", "url": "https://stackoverflow.com/questions/135123", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: Should one prefer STL algorithms over hand-rolled loops? I seem to be seeing more 'for' loops over iterators in questions & answers here than I do for_each(), transform(), and the like. Scott Meyers suggests that stl algorithms are preferred, or at least he did in 2001. Of course, using them often means moving the...
{ "language": "en", "url": "https://stackoverflow.com/questions/135129", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "27" }
Q: Semantic merge tool Background: In my job, we use SVN, C# and VisualStudio. Part of my task regularly involves global renames. Often I end up with a broken build after renaming something and then merging in changes. The question: is there a solution out there that can look at my changes, notice the global rename and...
{ "language": "en", "url": "https://stackoverflow.com/questions/135130", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Passing a ref or pointer to a managed type as an argument in C++.net I'm really baffled by this - I know how to do this in VB, unmanaged C++ and C# but for some reason I can't accept a ref variable of a managed type in C++. I'm sure there's a simple answer, really - but here's the C# equivalent: myClass.myFunction(r...
{ "language": "en", "url": "https://stackoverflow.com/questions/135132", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How can I discover if there are other devices on my local sub-net? I'm trying to confirm a user a unplugged my embedded device from a network before performing some maintenance. I'm considering "ping"ing all IP address on my sub-net, but that sounds crude. Is there a broadcast/ARP method that might work better? A: ...
{ "language": "en", "url": "https://stackoverflow.com/questions/135149", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What's the best way to remove tags from the end of a string? The .NET web system I'm working on allows the end user to input HTML formatted text in some situations. In some of those places, we want to leave all the tags, but strip off any trailing break tags (but leave any breaks inside the body of the text.) What...
{ "language": "en", "url": "https://stackoverflow.com/questions/135151", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How can I call a long-running external program from Excel / VBA? What is the best way to run an external program from excel. It might run for several minutes. What's the best-practice about how to to this. Ideally, * *A model dialog box that let's the user know that the process is executing. *If the executabl...
{ "language": "en", "url": "https://stackoverflow.com/questions/135158", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Is Google App Engine a worthy platform for a Lifestreaming app? I'm building a Lifestreaming app that will involve pulling down lots of feeds for lots of users, and performing data-mining, and machine learning algorithms on the results. GAE's load balanced and scalable hosting sounds like a good fit for a system tha...
{ "language": "en", "url": "https://stackoverflow.com/questions/135169", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Merging contacts in SQL table without creating duplicate entries I have a table that holds only two columns - a ListID and PersonID. When a person is merged with another in the system, I was to update all references from the "source" person to be references to the "destination" person. Ideally, I would like to call...
{ "language": "en", "url": "https://stackoverflow.com/questions/135173", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: MS Access Data Access Limitations I have a project right now where I'd like to be able to pull rows out of an Access database that a 3rd party product uses to store its information. There will likely be a small number of users hitting this database at the same time my "export" process does, so I'm a little concerne...
{ "language": "en", "url": "https://stackoverflow.com/questions/135183", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Reading and posting to web pages using C# I have a project at work the requires me to be able to enter information into a web page, read the next page I get redirected to and then take further action. A simplified real-world example would be something like going to google.com, entering "Coding tricks" as search cri...
{ "language": "en", "url": "https://stackoverflow.com/questions/135186", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Source Control on the IBM i (iSeries) On the web side we are working on getting source control. Now, I want to see what can be done for the iSeries side. What is your favorite source control application for iSeries and why? I am looking for low-cost if possible. A: The two most common source control packages for th...
{ "language": "en", "url": "https://stackoverflow.com/questions/135188", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: What's the difference between JavaScript and JScript? I have always wondered WHaT tHE HecK?!? is the difference between JScript and JavaScript. A: Just different names for what is really ECMAScript. John Resig has a good explanation. Here's the full version breakdown: * *IE 6-7 support JScript 5 (which is equiva...
{ "language": "en", "url": "https://stackoverflow.com/questions/135203", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "124" }
Q: Difference between ref and out parameters in .NET What is the difference between ref and out parameters in .NET? What are the situations where one can be more useful than the other? What would be a code snippet where one can be used and another can't? A: Ref and Out Parameters: The out and the ref parameters are us...
{ "language": "en", "url": "https://stackoverflow.com/questions/135234", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "412" }
Q: What's the best ASP.NET file type for a (non-SOAP, non-WSDL) web services project? Haven't done ASP.NET development since VS 2003, so I'd like to save some time and learn from other's mistakes. Writing a web services app, but not a WSDL/SOAP/etc. -- more like REST + XML. Which of the many "New Item" options (Web F...
{ "language": "en", "url": "https://stackoverflow.com/questions/135243", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Reading 32bit Packed Binary Data On 64bit System I'm attempting to write a Python C extension that reads packed binary data (it is stored as structs of structs) and then parses it out into Python objects. Everything works as expected on a 32 bit machine (the binary files are always written on 32bit architecture), ...
{ "language": "en", "url": "https://stackoverflow.com/questions/135246", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to manipulate the LargeChange and SmallChange on a scrollbar to work I have a number of panels in a single window in C# application and I created 2 scrollbars, one for horizontal and one vertical. This is what I currently have: picture with 2 scroolbars http://www.simnet.is/elinnils52/scrollbar.jpg I have 1 vari...
{ "language": "en", "url": "https://stackoverflow.com/questions/135254", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to preserve stack space with good design? I'm programming in C for RAM limited embedded microcontroller with RTOS. I regularly break my code to short functions, but every function calling require to more stack memory. Every task needs his stack, and this is one of the significant memory consumers in the project....
{ "language": "en", "url": "https://stackoverflow.com/questions/135262", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Can I run ASP.NET 2.0 and 3.5 code on the same website? Can I run ASP.NET 2.0 and 3.5 code on the same website? ...or, do I need to separate them by applications, and/or servers? A: As long as your server is running 3.5, you can run both. A: As far as IIS is concerned, 3.5 and 2.0 are the same. What you have to be...
{ "language": "en", "url": "https://stackoverflow.com/questions/135269", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: How does any application (chrome, flash, etc) get a time resolution better than the system time resolution? This article on Microsoft's tech net site supplies an exe that will calculate your windows machine's minimum time resolution - this should be the smallest "tick" available to any application on that machine: h...
{ "language": "en", "url": "https://stackoverflow.com/questions/135274", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to programmatically associate a name like COM51 to a physical serial port in Microsoft Windows? How to programmatically associate a name like COM51 to a physical serial port in Microsoft Windows? To manually perform the operation I can follow the steps described in link text Open Device Manager with devmgmt.msc ...
{ "language": "en", "url": "https://stackoverflow.com/questions/135287", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Is MSVCRT under Windows like glibc (libc) under *nix? I frequently come across Windows programs that bundle in MSVCRT (or their more current equivalents) with the program executables. On a typical PC, I would find many copies of the same .DLL's. My understanding is that MSVCRT is the C runtime library, somewhat a...
{ "language": "en", "url": "https://stackoverflow.com/questions/135296", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "31" }
Q: Sprite / Character animation in Silverlight (v2) We have a Silverlight 2 project (game) that will require a lot of character animation. Can anyone suggest a good way to do this. Currently we plan to build the art in Illustrator, imported to Silverlight via Mike Snow's plug-in as this matches the skills our artists...
{ "language": "en", "url": "https://stackoverflow.com/questions/135299", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Is there a way to programmatically import ICS into Google Calendar? I don't see any obvious way to import ICS files into Google Calendar from the API docs here: http://code.google.com/apis/calendar/developers_guide_protocol.html And I'd greatly prefer not to have to parse them myself just to send the appointments in...
{ "language": "en", "url": "https://stackoverflow.com/questions/135302", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "33" }
Q: How can I closely achieve ?: from C++/C# in Python? In C# I could easily write the following: string stringValue = string.IsNullOrEmpty( otherString ) ? defaultString : otherString; Is there a quick way of doing the same thing in Python or am I stuck with an 'if' statement? A: @Dan if otherString: stringValue ...
{ "language": "en", "url": "https://stackoverflow.com/questions/135303", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Which list implementation will be the fastest for one pass write, read, then destroy? What is the fastest list implementation (in java) in a scenario where the list will be created one element at a time then at a later point be read one element at a time? The reads will be done with an iterator and then the list wil...
{ "language": "en", "url": "https://stackoverflow.com/questions/135314", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "27" }
Q: CherryPy server name tag When running a CherryPy app it will send server name tag something like CherryPy/version. Is it possible to rename/overwrite that from the app without modifying CherryPy so it will show something else? Maybe something like MyAppName/version (CherryPy/version) A: Actually asking on IRC on ...
{ "language": "en", "url": "https://stackoverflow.com/questions/135317", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Mathematica Downvalue Lhs Does anybody know if there is a built-in function in Mathematica for getting the lhs of downvalue rules (without any holding)? I know how to write the code to do it, but it seems basic enough for a built-in For example: a[1]=2; a[2]=3; BuiltInIDoNotKnowOf[a] returns {1,2} A: This seems t...
{ "language": "en", "url": "https://stackoverflow.com/questions/135330", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: LinqToSql and WCF Within an n-tier app that makes use of a WCF service to interact with the database, what is the best practice way of making use of LinqToSql classes throughout the app? I've seen it done a couple of different ways but they seemed like they burned a lot of hours creating extra interfaces, message cl...
{ "language": "en", "url": "https://stackoverflow.com/questions/135339", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Most common examples of misuse of singleton class When should you NOT use a singleton class although it might be very tempting to do so? It would be very nice if we had a list of most common instances of 'singletonitis' that we should take care to avoid. A: Well singletons for the most part are just making things s...
{ "language": "en", "url": "https://stackoverflow.com/questions/135347", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Subversion and shared files across repositories/projects? I am migrating a client's SourceSafe repository (3 projects) to SVN and two of the projects share source files. (These projects are separate products - with different names and release versions, etc) Has SVN resolved this shortcoming? How do people generall...
{ "language": "en", "url": "https://stackoverflow.com/questions/135361", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "26" }
Q: Classic asp - When to use Response.flush? We have a painfully slow report.I added a Response.flush and it seems a great deal better. What are some of the caveats of using this method. A: If Response.Buffer is not set to true, then you'll get a run-time error. Also, If the Flush method is called on an ASP page, the...
{ "language": "en", "url": "https://stackoverflow.com/questions/135365", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: How to determine if a file is in ROM in Windows Mobile? Is there a way to programmatically determine if a given file path and name is stored in ROM (i.e. came installed on the device) or RAM (i.e. created after a hard reset)? A: Get the file attributes and check to see if FILE_ATTRIBUTE_ROMMODULE is set. A: There ...
{ "language": "en", "url": "https://stackoverflow.com/questions/135368", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Would performance suffer using autoload in php and searching for the class file? I've always struggled with how to best include classes into my php code. Pathing is usually an issue but a few minutes ago i found this question which dramatically helps that. Now I'm reading about __autoload and thinking that it could ...
{ "language": "en", "url": "https://stackoverflow.com/questions/135373", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: How do I make a WPF data template fill the entire width of the listbox? I have a ListBox DataTemplate in WPF. I want one item to be tight against the left side of the ListBox and another item to be tight against the right side, but I can't figure out how to do this. So far I have a Grid with three columns, the left ...
{ "language": "en", "url": "https://stackoverflow.com/questions/135375", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "65" }
Q: How can I build Slickedit tags on command line? I want to be able to generate slickedit tags on the commmand line, as soon as I sync a project from revision control - so via a script. Any way to do this? A: See this topic http://community.slickedit.com/index.php?topic=253.0
{ "language": "en", "url": "https://stackoverflow.com/questions/135384", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How can I design an ASP.NET website delaying the style/theme? I need to build a prototype for an intranet website, and I want to focus on usability (layout, navigability, etc) and leave the theme for later (I have very bad taste, so this will probably be done by someone else) I know about ASP.NET's capability of swi...
{ "language": "en", "url": "https://stackoverflow.com/questions/135412", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: XPI signing linux no gui I'm trying to sign an XPI on linux (no gui) using the NSS cert db (cert8.db and key3.db) i copied from another server of mine, on which I can sign XPI's just fine. On the new box I can sign with a brand new test certificate ok, but when i try to use the old cert db, it complains with: signt...
{ "language": "en", "url": "https://stackoverflow.com/questions/135416", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Rails and Flex to build an RIA Any thoughts on using Flex to build an RIA for administering a complex rails app? We are starting to find it difficult using ajax to keep our admin section intuitive and easy for users to work with. A: You've got RoR guys working on this program and you've managed to develop a complex...
{ "language": "en", "url": "https://stackoverflow.com/questions/135427", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How do I use reflection to invoke a private method? There are a group of private methods in my class, and I need to call one dynamically based on an input value. Both the invoking code and the target methods are in the same instance. The code looks like this: MethodInfo dynMethod = this.GetType().GetMethod("Draw_" +...
{ "language": "en", "url": "https://stackoverflow.com/questions/135443", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "374" }
Q: How can I detect if there is a floppy in a drive? I tried to use DriveInfo.IsReady, but it returns false if an unformatted floppy is in the drive. A: You can always try to read a sector from the floppy and see if it succeeds or not. I have no clue how to do it in .NET, but here is the C/C++ equivalent. SetLastError...
{ "language": "en", "url": "https://stackoverflow.com/questions/135445", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How do I check if an object has a specific property in JavaScript? How do I check if an object has a specific property in JavaScript? Consider: x = {'key': 1}; if ( x.hasOwnProperty('key') ) { //Do this } Is that the best way to do it? A: hasOwnProperty "can be used to determine whether an object has the speci...
{ "language": "en", "url": "https://stackoverflow.com/questions/135448", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1760" }
Q: Can I use a List as a collection of method pointers? (C#) I want to create a list of methods to execute. Each method has the same signature. I thought about putting delegates in a generic collection, but I keep getting this error: 'method' is a 'variable' but is used like a 'method' In theory, here is what I woul...
{ "language": "en", "url": "https://stackoverflow.com/questions/135451", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Will pthread_detach manage my memory for me? Suppose I have the following code: while(TRUE) { pthread_t *thread = (pthread_t *) malloc(sizeof(pthread_t)); pthread_create(thread, NULL, someFunction, someArgument); pthread_detach(*thread); sleep(10); } Will the detached thread free the memory allocated by mal...
{ "language": "en", "url": "https://stackoverflow.com/questions/135458", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: What happens when you try to free() already freed memory in c? For example: char * myString = malloc(sizeof(char)*STRING_BUFFER_SIZE); free(myString); free(myString); Are there any adverse side effects of doing this? A: Answer summary: Yes, bad things can and probably will happen. To prevent this do: free(myStrin...
{ "language": "en", "url": "https://stackoverflow.com/questions/135474", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "36" }
Q: How do you measure the progress of a web service call? I have an ASP.NET web service which does some heavy lifting, like say,some file operations, or generating Excel Sheets from a bunch of crystal reports. I don't want to be blocked by calling this web service, so i want to make the web service call asynchronous. A...
{ "language": "en", "url": "https://stackoverflow.com/questions/135478", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Sharepoint: Deploy Custom Lists and New Columns in lists I've created a custom list & also added a column in the Announcement List. Question is, how can I include those newly created items when I create a fresh Web Application (like a script, feature or something)? Additional Info: It's like when you're to deploy f...
{ "language": "en", "url": "https://stackoverflow.com/questions/135496", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Using WPF, what is the best method to update the background for a custom button control? In WPF, we are creating custom controls that inherit from button with completely drawn-from-scratch xaml graphics. We have a border around the entire button xaml and we'd like to use that as the location for updating the backgr...
{ "language": "en", "url": "https://stackoverflow.com/questions/135518", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: In Access 2003, problem with a memo field if and only if there is a filter on the PK and a sub query is joined I have a problem in a query in Acess 2003 (SP3). I have a query that includes some tables and a sub query. The sub query and tables are all joined to a main table. The query uses some aggregate functions an...
{ "language": "en", "url": "https://stackoverflow.com/questions/135526", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Will my index be used if all columns are not used? I have an index on columns A, B, C, D of table T I have a query that pulls from T with A, B, C in the WHERE clause. Will the index be used or will a separate index be needed that only includes A, B, C? A: It depends! WHERE A like '%x%' and B = 1 and C = 1 // WH...
{ "language": "en", "url": "https://stackoverflow.com/questions/135530", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "20" }
Q: MS CRM Development Projects The shop that I am working part time with is new to Microsoft CRM. I just want to survey what projects have developers done to the system to extend its capabilities. A: I did some work with CRM 3.0. My work enhanced the program and turned it into a Document Management app, where you coul...
{ "language": "en", "url": "https://stackoverflow.com/questions/135533", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How would you easily validate a JSP option pick list? I need to validate this simple pick list: <select name="<%= key %>"> <option value="ETC" SELECTED>Select an option...</option> <option value="ONE">Lorem ipsum</option> <option value="TWO">dolor sit amet</option> </select> So the user would never subm...
{ "language": "en", "url": "https://stackoverflow.com/questions/135534", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What are the benefits of OO programming? Will it help me write better code? I'm a PHPer, and am not writing object-oriented code. What are the advantages of OO over procedural code, and where can I learn how to apply these ideas to PHP? A: Objects help encapsulate complexity. For most PHP programming, it's impossib...
{ "language": "en", "url": "https://stackoverflow.com/questions/135535", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "28" }
Q: Best place to Sort a List of Tasks Im building a web application which is a process management app. Several different employee types will be shown a list of Tasks to do and as each one completes a task then it is moved on to the next employee to work on. The Task hierarchy is Batch > Load > Assembly > Part > Task. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/135539", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How can I repair "upgraded" subversion working directories? It may sound stupid, but sometimes I run into version conflicts between two versions of subversion. I mount a directory on a development server with sshfs and then edit the code with my local Vim. For subversion stuff like updating, committing etc. I ssh on...
{ "language": "en", "url": "https://stackoverflow.com/questions/135543", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do I interpret error codes from FrontPage Extensions? Wrong answer was autoselected by the stupid bounty system. I'm using front page extensions to interact with SharePoint Services 3.0 as described here. In most samples I have seen the client simply looks for particular English strings in the result and uses th...
{ "language": "en", "url": "https://stackoverflow.com/questions/135556", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How to change settings for a Visual Studio 2005 Deployment Project I have a project containing at least one DLL along with the executable output. I have added a Deployment Project to this solution, which asked me for a name and working directory upon creation like all projects. I named this "MyProduc_Installer" and...
{ "language": "en", "url": "https://stackoverflow.com/questions/135573", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How can I track the sales rank of an item on Amazon programmatically? I've seen several products that will track the sales rank of an item on Amazon. Does Amazon have any web-services published that I can use to get the sales rank of a particular item? I've looked through the AWS and didn't see anything of that nat...
{ "language": "en", "url": "https://stackoverflow.com/questions/135591", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Reproducing the blocked exe "unblock" option in file properties in windows 2003 When I download my program from my website to my windows 2003 machine, it has a block on it and you have to right click on the exe, then properties, then select the button "Unblock". I would like to add detection in my installer for when...
{ "language": "en", "url": "https://stackoverflow.com/questions/135600", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Is there any documentation other than the official documentation? The official documentation seems to be light on explanations of 'how to understand the SproutCore way' e. g., why things are done the way they are, how to intuit what to do from where you're at, etc. A: [Update] Latest resource is new wiki . Which ha...
{ "language": "en", "url": "https://stackoverflow.com/questions/135607", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How to build escrow style system I have a website where clients pay for a service but have to out the money upfront via escrow, I'm very proficient with PHP (this is what the website is coded in) how would I go about implementing an escrow system that would work automatically? A: You need to break down your design ...
{ "language": "en", "url": "https://stackoverflow.com/questions/135621", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: What's the difference between a midlet and a corelet? It's my understanding that a corelet is a Motorola-ism, but does anyone know what the difference is? Do corelets have certain abilities that midlets don't? A: I believe a corelet is a midlet that has full read access to the phone's internal file system... There...
{ "language": "en", "url": "https://stackoverflow.com/questions/135628", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Class design vs. IDE: Are nonmember nonfriend functions really worth it? In the (otherwise) excellent book C++ Coding Standards, Item 44, titled "Prefer writing nonmember nonfriend functions", Sutter and Alexandrescu recommend that only functions that really need access to the members of a class be themselves member...
{ "language": "en", "url": "https://stackoverflow.com/questions/135634", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: how to add a simple message to a php-gtk statusbar? I have a simple GtkStatusBar created with glade,and want to add a simple message with the date of the last update of the database (just a simple and plain date). I don't want to use the whole stacks, context and all the other things that gtk developers put on the s...
{ "language": "en", "url": "https://stackoverflow.com/questions/135642", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Difference between drop table and truncate table? I have some tables that I build as a part of my report rollup. I don't need them afterwards at all. Someone mentioned to truncate them as it would be faster. A: DROP TABLE deletes the table. TRUNCATE TABLE empties it, but leaves its structure for future data. A: D...
{ "language": "en", "url": "https://stackoverflow.com/questions/135653", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "82" }
Q: How to identify unused CSS definitions from multiple CSS files in a project A bunch of CSS files were pulled in and now I'm trying to clean things up a bit. How can I efficiently identify unused CSS definitions in a whole project? A: I have just found this site – http://unused-css.com/ Looks good but I would need t...
{ "language": "en", "url": "https://stackoverflow.com/questions/135657", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "423" }
Q: What are the Pros and Cons of using Global.asax? Let's collect some tips for evaluating the appropriate use of global.asax. A: I've used it before to catch errors at the application level, and to do something when a user's session expires. I also tend to use it a lot to provide static properties that read values fr...
{ "language": "en", "url": "https://stackoverflow.com/questions/135661", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: How many bytes per element are there in a Python list (tuple)? For example, how much memory is required to store a list of one million (32-bit) integers? alist = range(1000000) # or list(range(1000000)) in Python 3.0 A: Addressing "tuple" part of the question Declaration of CPython's PyTuple in a typical build con...
{ "language": "en", "url": "https://stackoverflow.com/questions/135664", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: Structure of projects in version control - .NET specific This post is similar to this previously asked question. I really want to set up my SVN repository in TTB format, but when creating a project in Visual Studio 2008 (ASP.NET/VB.NET), the structure created tends to be incompatible when considering the solution f...
{ "language": "en", "url": "https://stackoverflow.com/questions/135670", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Optimal method to perform a best levenshtein match against Map in Java I have a map in Java. I would like to compare a source string against all items in the map and return the best match based on a levenshtein ratio algorithm. I am wondering what the optimal way to perform this check on every element in the list...
{ "language": "en", "url": "https://stackoverflow.com/questions/135679", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Setting environment variables on OS X What is the proper way to modify environment variables like PATH in OS X? I've looked on Google a little bit and found three different files to edit: * */etc/paths *~/.profile *~/.tcshrc I don't even have some of these files, and I'm pretty sure that .tcshrc is wrong, sin...
{ "language": "en", "url": "https://stackoverflow.com/questions/135688", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "923" }
Q: Can you have too many stored procedures? Is there such a thing as too many stored procedures? I know there is not a limit to the number you can have but is this any performance or architectural reason not to create hundreds, thousands?? A: To me the biggest limitation to that hundreds or thousands store procedure i...
{ "language": "en", "url": "https://stackoverflow.com/questions/135701", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "14" }
Q: What are the different types of indexes, what are the benefits of each? What are the different types of indexes, what are the benefits of each? I heard of covering and clustered indexes, are there more? Where would you use them? A: OdeToCode has a good article covering the basic differences As it says in the articl...
{ "language": "en", "url": "https://stackoverflow.com/questions/135730", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "32" }
Q: Page down and page up in Emacs on Windows using the Windows key I am trying to learn Emacs and trying to find best keyboard layout for me. One thing is really annoying me. I have added following lines to .emacs (global-set-key "\C-y" 'scroll-up) (global-set-key "\M-y" 'scroll-down) When I hold Control and press y a...
{ "language": "en", "url": "https://stackoverflow.com/questions/135734", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }