instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
What is iPhone's browser tag and how iPhone optimized web site is different from a usual mobile web site? Thanks!
stackexchange/codereview
I'm trying to let an <input type="text"> (henceforth referred to as “textbox”) fill a parent container by settings its width to 100%. This works until I give the textbox a padding. This is then added to the content width and the input field overflows. Notice that in Firefox this only happens when rendering the content ...
stackexchange/codereview
I'm looking for suggestions on how to debug and chase down deadlock issues in an SQL Server 2000 database. I've had it recommended to me to use trace flags 1024 and 3605, which I have found give me the following: 1024 - this trace flag returns the type of locks participating in the deadlock and the current command aff...
stackexchange/codereview
I'm curious about everyones practices when it comes to using or distributing libraries for an application that you write. First of all, when developing your application do you link the debug or release version of the libraries? (For when you run your application in debug mode) Then when you run your app in release mode...
stackexchange/codereview
How would you dynamically subscribe to a C# event so that given a Object instance and a String name containing the name of the event, you subscribe to that event and do something (write to the console for example) when that event has been fired? It would seem using Reflection this isn't possible and I would like to avo...
stackexchange/codereview
How do I escape the underscore character? I am writing something like the following where clause and want to be able to find actual entries with _d at the end. Where Username Like '%_d'
stackexchange/codereview
I'm looking for (arguably) the correct way to return data from a XmlHttpRequest. Options I see are: Plain HTML. Let the request format the data and return it in a usable format. Advantage: easy to consume by the calling page.Disadvantage: Very rigid, stuck with a fixed layout. XML. Let the request return XML, format i...
stackexchange/codereview
I know you can look at the row.count or tables.count, but are there other ways to tell if a dataset is empty?
stackexchange/codereview
I'm struggling to find the right terminology here, but if you have jQuery object... $('#MyObject') ...is it possible to extract the base element? Meaning, the equivalent of this: document.getElementById('MyObject')
stackexchange/codereview
I have wondered about the appropriateness of reflection in C# code. For example I have written a function which iterates through the properties of a given source object and creates a new instance of a specified type, then copies the values of properties with the same name from one to the other. I created this to copy d...
stackexchange/codereview
Is there a better way to forcefully disconnect all users from an Oracle 10g database schema than restarting the Oracle database services? We have several developers using SQL Developer connecting to the same schema on a single Oracle 10g server. The problem is that when we want to drop the schema to rebuild it, inevit...
stackexchange/codereview
I have a web application that is able to open an excel template, push data into a worksheet and send the file to a user. When the file is opened a VBA Macro will refresh a pivot table based on the data that was pushed into the template. The user receives the standard File Open / Save dialog. In Internet Explorer (ver...
stackexchange/codereview
I added some custom fields (public booleans) to the global class in global.asax.cs which are initialized during the Application_Start event. How do I access them in a webhandler (ashx)? Or is it better to save them in the Application state object?
stackexchange/codereview
What semantic web frameworks are there, and what are the advantages / disadvantages of each? I've made extensive use of Jena, and I have looked at Sesame briefly. Are there others I should consider as well?
stackexchange/codereview
I've heard that creating a new process on a Windows box is more expensive than on Linux. Is this true? Can somebody explain the technical reasons for why it's more expensive and provide any historical reasons for the design decisions behind those reasons?
stackexchange/codereview
I'm trying to refer to a drive whose letter may change. I'd like to refer to it by its label (e.g., MyLabel (v:) within a Batch File. It can be referred to by V:\ . I'd like to refer to it by MyLabel. (This was posted on Experts Echange for a month with no answer. Let's see how fast SO answers it )
stackexchange/codereview
I'm developing a library alongside several projects that use it, and I've found myself frequently modifying the library at the same time as a project (e.g., adding a function to the library and immediately using it in the project). As a result, the project would no longer compile with previous versions of the library. ...
stackexchange/codereview
I need to enable/disable completely network interfaces from a script in Windows XP. I'm looking for a python solution, but any general way (eg WMI, some command-line à la netsh, some windows call) is welcome and will be adjusted. Thanks.
stackexchange/codereview
For example: This is main body of my content. I have a footnote link for this line [1]. Then, I have some more content. Some of it is interesting and it has some footnotes as well [2]. [1] Here is my first footnote. [2] Another footnote. So, if I click on the "[1]" link it directs the web page to the first foot...
stackexchange/codereview
Is there an Eclipse command to surround the current selection with parentheses? Creating a template is a decent workaround; it doesn't work with the "Surround With" functionality, because I want to parenthesize an expression, not an entire line, and that requires ${word_selection} rather than ${line_selection}. Is ther...
stackexchange/codereview
I want to apply an XSLT Stylesheet to an XML Document using C# and write the output to a File.
stackexchange/codereview
In a C++ app, I have an hWnd pointing to a window running in a third party process. This window contains controls which extend the COM TreeView control. I am interested in obtaining the CheckState of this control. I use the hWnd to get an HTREEITEM using TreeView_GetRoot(hwnd) from commctrl.h hwnd points to the window ...
stackexchange/codereview
How do you tell if a function in JavaScript is defined? I want to do something like this function something_cool(text, callback) { alert(text); if( callback != null ) callback(); } But it gets me a callback is not a function error when callback is not defined.
stackexchange/codereview
I've got just one page that I want to force to be accessed as an HTTPS page (PHP on Apache). How do I do this without making the whole directory require HTTPS? Or, if you submit a form to an HTTPS page from an HTTP page, does it send it by HTTPS instead of HTTP? Here is my example: http://www.example.com/some-page.php ...
stackexchange/codereview
On linux, it's possible to create a tun interface using a tun driver which provides a "network interface psuedo-device" that can be treated as a regular network interface. Is there a way to do this programmatically on windows? Is there a way to do this without writing my own driver?
stackexchange/codereview
Does anyone have, or know of, a binary patch generation algorithm implementation in C#? Basically, compare two files (designated old and new), and produce a patch file that can be used to upgrade the old file to have the same contents as the new file. The implementation would have to be relatively fast, and work with h...
stackexchange/codereview
Two users wanted to share the same database, originally written in MS Access, without conflicting with one another over a single MDB file. I moved the tables from a simple MS Access database to MySQL using its Migration Toolkit (which works well, by the way) and set up Access to link to those tables via ODBC. So far, I...
stackexchange/codereview
Is there any way to listen to an Oracle AQ using a Perl process as the listener.
stackexchange/codereview
I'm writing C# code that uses the windows IP Helper API. One of the functions I'm trying to call is "GetBestInterface" that takes a 'uint' representation of an IP. What I need is to parse a textual representation of the IP to create the 'uint' representation. I've found some examples via Google, like this one or this o...
stackexchange/codereview
I am writing a basic word processing application and am trying to settle on a native "internal" format, the one that my code parses in order to render to the screen. I'd like this to be XML so that I can, in the future, just write XSLT to convert it to ODF or XHTML or whatever. When searching for existing standards to ...
stackexchange/codereview
Is it realistic to try and learn and code a Flex 3 application without purchasing FlexBuilder? Since the SDK and BlazeDS are open source, it seems technically possible to develop without Flex Builder, but how realistic is it. I would like to test out Flex but don't want to get into a situation where I am dependent on t...
stackexchange/codereview
At the moment my code (PHP) has too many SQL queries in it. eg... // not a real example, but you get the idea... $results = $db->GetResults("SELECT * FROM sometable WHERE iUser=$userid"); if ($results) { // Do something } I am looking into using stored procedures to reduce this and make things a little more robust...
stackexchange/codereview
Is it possible to use gcov for coverage testing of multi-threaded applications? I've set some trivial tests of our code-base up, but it would be nice to have some idea of the coverage we're achieving. If gcov isn't appropriate can anyone recommend an alternative tool (possible oprofile), ideally with some good documen...
stackexchange/codereview
When I try to use an ssh command in a shell script, the command just sits there. Do you have an example of how to use ssh in a shell script?
stackexchange/codereview
I wrote a component that displays a filename, a thumbnail and has a button to load/play the file. The component is databound to a repeater. How can I make it so that the button event fires to the main application and tells it which file to play?
stackexchange/codereview
After being told by at least 10 people on SO that version control was a good thing even if it's just me I now have a followup question. What is the difference between all the different types of version control and is there a guide that anybody knows of for version control that's very simple and easy to understand?
stackexchange/codereview
I'm looking for a c# snippet which I can insert in a Windows service. The code must empty the recycle bin for all users on the computer. I have previously tried using SHEmptyRecycleBin (ref http://www.codeproject.com/KB/cs/Empty_Recycle_Bin.aspx) however the code doesn't work when ran from a windows service as the serv...
stackexchange/codereview
I am trying to load Linq on my .Net 3.5 enabled web server by adding the following to my .aspx page: <%@ Import Namespace="System.Query" %> However, this fails and tells me it cannot find the namespace. The type or namespace name 'Query' does not exist in the namespace 'System' I have also tried with no luck: Syst...
stackexchange/codereview
Are there any codes that allow for numerical formatting of data when using string.format?
stackexchange/codereview
I've asked this question to the forums on the Mootools website and one person said that my class selection was corrupted before an admin came along and changed my post status to invalid. Needless to say this did not help much. I then posted to a google group for Mootools with no response. My question is why doesn't ...
stackexchange/codereview
What are they and what are they good for? I do not have a CS degree and my background is VB6 -> ASP -> ASP.NET/C#. Can anyone explain it in a clear and concise manner?
stackexchange/codereview
I'm building an excel template (*.xlt) for a user here, and one of the things I want to do is have it insert the current date when a new document is created (ie, when they double-click the file in windows explorer). How do I do this? Update: I should have added that I would prefer not to use any vba (macro). If that'...
stackexchange/codereview
I'm almost certain I know the answer to this question, but I'm hoping there's something I've overlooked. Certain applications seem to have the Vista Aero look and feel to their caption bars and buttons even when running on Windows XP. (Google Chrome and Windows Live Photo Gallery come to mind as examples.) I know tha...
stackexchange/codereview
As a long time Microsoft developer, I find MSDN to be an invaluable resource. However, when tinkering at home I am not able to play with the best latest technologies and the different offerings coming from Microsoft as I cannot justify paying such a hefty price for what is essentially a pastime. The Express editions ar...
stackexchange/codereview
I'm loading a SQL Server 2000 database into my new SQL Server 2005 instance. As expected, the full-text catalogs don't come with it. How can I rebuild them? Right-clicking my full text catalogs and hitting "rebuild indexes" just hangs for hours and hours without doing anything, so it doesn't appear to be that simple......
stackexchange/codereview
ValidateEvents is a great ASP.net function, but the Yellow Screen of Death is not so nice. I found a way how to handle the HttpRequestValidationException gracefully here, but that does not work with ASP.net AJAX properly. Basically, I got an UpdatePanel with a TextBox and a Button, and when the user types in HTML into...
stackexchange/codereview
What is the most efficient way to determine how many comments a particular blog post has? We want to store the data for a new web app. We have a list of permalink URl's as well as the RSS feeds.
stackexchange/codereview
What's the best way to implement authentication over WCF? I'd prefer to not use WS-* as it needs to be transport independent. Should I "roll my own"? Is there any guidance for doing that (articles/blog posts)? Or is there some way to (and should I) use the built in ASP.NET Membership and Profile providers on the server...
stackexchange/codereview
In Python you can use StringIO for a file-like buffer for character data. Memory-mapped file basically does similar thing for binary data, but it requires a file that is used as the basis. Does Python have a file object that is intended for binary data and is memory only, equivalent to Java's ByteArrayOutputStream? The...
stackexchange/codereview
Is it possible to create images with PHP (as opposed to simply linking to them via HTML) and if so, where should I go first to learn about such a thing?
stackexchange/codereview
I did a lot of PHP programming in the last years and one thing that keeps annoying me is the weak support for Unicode and multibyte strings (to be sure, natively there is none). For example, "htmlentities" seems to be a much used function in the PHP world and I found it to be absolutely annoying when you've put an effo...
stackexchange/codereview
What types of applications have you used model checking for? What model checking tool did you use? How would you summarize your experience w/ the technique, specifically in evaluating its effectiveness in delivering higher quality software? In the course of my studies, I had a chance to use Spin, and it aroused my c...
stackexchange/codereview
I'm running a long process stored procedure. I'm wondering if in case of a timeout or any case of disconnection with the database after initiating the call to the stored procedure. Is it still working and implementing the changes on the server? ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
stackexchange/codereview
I'm looking for a way to find a the windows login associated with a specific group. I'm trying to add permissions to a tool that only allows names formatted like: DOMAIN\USER DOMAIN\GROUP I have a list of users in active directory format that I need to add: ou=group1;ou=group2;ou=group3 I have tried adding DOMAIN\Gr...
stackexchange/codereview
What are the best open source (open source and commercial) reporting tools for ASP.NET similar to Crystal Reports for ASP.NET?
stackexchange/codereview
A question that has pondered me for the last while. I am primarily a .net developer who dabbles in Objective-C for iPhone and Mac. How do you go about sending "datasets" between methods in objective-c. For example in C# you can populate a custom class with data and pass it around in a List of type custom class. EG if y...
stackexchange/codereview
I'm an experienced client application developer (C++/C#), but need to come up to speed quickly on writing server side code to perform RESTful interactions. Specifically, I need to learn how to exchange data with OpenSocial containers via the RESTful API.
stackexchange/codereview
I have a solution with many projects. One project contain few custom components. One of these components is used to display a title on an image. We can change the color of the background and many other things. The problem is IF I decide to change the default color of the background of the component or change the positi...
stackexchange/codereview
I have two arrays of animals (for example). $array = array( array( 'id' => 1, 'name' => 'Cat', ), array( 'id' => 2, 'name' => 'Mouse', ) ); $array2 = array( array( 'id' => 2, 'age' => 321, ), array( 'id' => 1, 'age' => 123, ...
stackexchange/codereview
I'm rewriting an old application and use this as a good opportunity to try out C# and .NET development (I usually do a lot of plug-in stuff in C). The application is basically a timer collecting data. It has a start view with a button to start the measurement. During the measurement the app has five different views dep...
stackexchange/codereview
MS CRM Dynamics 4.0 incorporates the MS WF engine. The built in designer allows the creation of sequential workflows whos activities have native access to CRM entities. Is it possible to: Create a state machine workflow outside of CRM (i.e. in visual studio) and import it into CRM? Have this workflow access the CRM ...
stackexchange/codereview
How do I execute the "Copy Web Site" command for an ASP.NET project in VS2008 from the command line? If I need to script this, let me have some pointers on where I can learn that.
stackexchange/codereview
i have a VS05 C++ (MFC) project which uses HtmlHelp (function HTMLHelpA, linked from HmleHelp.lib, which came from HTML HElp Workshop v1.4). the 32-bit version compiles and links fine. the 64-bit version compiles fine, but gets an "unresolved external" error on HTMLHelpA, when linking. so, my question is simple: is th...
stackexchange/codereview
Currently I'm doing some unit tests which are executed from bash. Unit tests are initialized, executed and cleaned up in a bash script. This script usualy contains an init(), execute() and cleanup() functions. But they are not mandatory. I'd like to test if they are or are not defined. I did this previously by greping ...
stackexchange/codereview
I have an image and on it are logos (it's a map), I want to have a little box popup with information about that logo's location when the user moves their mouse over said logo. Can I do this without using a javascript framework and if so, are there any small libraries/scripts that will let me do such a thing?
stackexchange/codereview
I have this code in jQuery, that I want to reimplement with the prototype library. // make external links open in popups // this will apply a window.open() behaviour to all anchor links // the not() functions filter iteratively filter out http://www.foo.com // and http://foo.com so they don't trigger off the pop-ups ...
stackexchange/codereview
Given the following interaction: $ git add foo $ git commit -m "Initial import of 'foo'" $ rm foo # This could be any destructive action on foo, like editing it. How do I restore 'foo' in my working copy? I'm looking for something like: $ git <magic> foo Restored foo to revision <blah>.
stackexchange/codereview
I want to escape a DOS filename so I can use it with sed. I have a DOS batch file something like this: set FILENAME=%~f1 sed 's/Some Pattern/%FILENAME%/' inputfile (Note: %~f1 - expands %1 to a Fully qualified path name - C:\utils\MyFile.txt) I found that the backslashes in %FILENAME% are just escaping the next lette...
stackexchange/codereview
I do a lot of work in the grid and HPC space and one of the biggest challenges we have with a system distributed across hundreds (or in some case thousands) of servers is analysing the log files. Currently log files are written locally to the disk on each blade but we could also consider publishing logging informatio...
stackexchange/codereview
I'm trying to create a server control, which inherits from TextBox, that will automatically have a CalendarExtender attached to it. Is it possible to do this, or does my new control need to inherit from CompositeControl instead? I've tried the former, but I'm not clear during which part of the control lifecycle I shoul...
stackexchange/codereview
There are similar question, but not regarding C# libraries I can use in my source code. Thank you all for your help. I've already saw lucene, but I need something more easy to search for similar strings and without the overhead of the indexing part. The answer I marked has got two very easy algorithms, and one uses LIN...
stackexchange/codereview
I've been doing some HTML scraping in PHP using regular expressions. This works, but the result is finicky and fragile. Has anyone used any packages that provide a more robust solution? A config driven solution would be ideal, but I'm not picky.
stackexchange/codereview
It seems to me that it would work perfectly well to do tail-recursion optimization in both C and C++, yet while debugging I never seem to see a frame stack that indicates this optimization. That is kind of good, because the stack tells me how deep the recursion is. However, the optimization would be kind of nice as wel...
stackexchange/codereview
I see 2 main ways to set events in JavaScript: Add an event directly inside the tag like this: <a href="" onclick="doFoo()">do foo</a> Set them by JavaScript like this: <a id="bar" href="">do bar</a> and add an event in a <script> section inside the <head> section or in an external JavaScript file, like that if you'r...
stackexchange/codereview
I've used Excel PivotTable to analyze data from my database because it allows me to "slice and dice" very quickly. As we know what is in our database tables, we all can write SQL queries that do what PivotTable does. But I am wondering why PivotTable can construct the queries so fast while it knows nothing about the d...
stackexchange/codereview
I'm trying to determine if there's a way in Visual Basic 2008 (Express edition if that matters) to do inline collection initialization, a la JavaScript or Python: Dim oMapping As Dictionary(Of Integer, String) = {{1,"First"}, {2, "Second"}} I know Visual Basic 2008 supports array initialization like this, but I can't ...
stackexchange/codereview
I would like to extract the date a jpg file was created. Java has the lastModified method for the File object, but appears to provide no support for extracting the created date from the file. I believe the information is stored within the file as the date I see when I hover the mouse pointer over the file in Win XP i...
stackexchange/codereview
All I know about the constraint is it's name (SYS_C003415), but I want to see it's definition.
stackexchange/codereview
Where is the option in Visual Studio to make the Home key go to the start of the line? Right now you have to do Home,Home or Home, Ctrl+Left Arrow i'd prefer that home goes to the start of the line. i saw it before, but now i cannot find it.
stackexchange/codereview
In the C programming language and Pthreads as the threading library; do variables/structures that are shared between threads need to be declared as volatile? Assuming that they might be protected by a lock or not (barriers perhaps). Does the pthread POSIX standard have any say about this, is this compiler-dependent or ...
stackexchange/codereview
If I am given a MemoryStream that I know has been populated with a String, how do I get a String back out?
stackexchange/codereview
I'm a beginning C++ programmer / network admin, but I figure I can learn how to do this if someone points me in the right direction. Most of the tutorials are demonstrated using old code that no longer works for some reason. Since I'm on Linux, all I need is an explanation on how to write raw Berkeley sockets. Can som...
stackexchange/codereview
My team is currently trying to automate the deployment of our .Net and PHP web applications. We want to streamline deployments, and to avoid the hassle and many of the headaches caused by doing it manually. We require a solution that will enable us to: - Compile the application - Version the application with the SV...
stackexchange/codereview
I'm looking for a Ruby's equivalent of Code Like a Pythonista: Idiomatic Python Desirable features: easy to read single document which covers all topics: tips, tricks, guidelines, caveats, and pitfalls size less than a book idioms should work out of the box for the standard distribution (% sudo apt-get install ruby ir...
stackexchange/codereview
I tried scouring the web for help on this issue, but there are so many generic words in there, that I couldn't find much of anything that was relevant. I have MS Office 2007 installed on Vista and later installed XML Notepad 2007 (also a Microsoft product). It seems that the MS Access help system is using some sort of...
stackexchange/codereview
I need to make an application in .NET CF with different/single forms with a lot of drawing/animation on each forms.I would prefer to have a single update[my own for state management and so on] function so that i can manage the different states, so that my [J2ME Gaming Code] will work without much changes.I have came t...
stackexchange/codereview
What is the proper way for an MFC application to cleanly close itself?
stackexchange/codereview
I am using .NET remoting to retrieve periodic status updates from a Windows service into a 'controller' application which is used to display some live stats about what the service is doing. The resulting network traffic is huge - many times the size of the data for the updates - so clearly I have implemented the remoti...
stackexchange/codereview
I'm coming from a Rails background and doing some work on a ASP.NET project (not ASP MVC). Newbie question: what's the easiest way to make a custom editor for a table of records? For example: I have a bunch of data rows and want to change the "category" field on each -- maybe a dropdown, maybe a link, maybe the user ty...
stackexchange/codereview
I originally asked this question on RefactorMyCode, but got no responses there... Basically I'm just try to load an XmlNodeList into an XmlDocument and I was wondering if there's a more efficient method than looping. Private Function GetPreviousMonthsXml(ByVal months As Integer, ByVal startDate As Date, ByVal xDoc As ...
stackexchange/codereview
I've made many different seperate parts of a GUI system for the Nintendo DS, like buttons and textboxes and select boxes, but I need a way of containing these classes in one Gui class, so that I can draw everything to the screen all at once, and check all the buttons at once to check if any are being pressed. My questi...
stackexchange/codereview
Before I start, I know there is this post and it doesn't answer my question: How to generate getters and setters in Visual Studio? In Visual Studio 2008 there is the ability to auto generate getters and setters (accessors) by right clicking on a private variable -> Refactor -> Encapsulate Field... This is great for a c...
stackexchange/codereview
I think most people here understand the importance of fully automated builds. The problem is one of our project is now using an integrated Visual Studio Setup project (vdproj) and has recently been ported to Visual Studio 2008. Unfortunatly, those won't build in MSBuild and calling devenv.exe /build on 2008 just crashe...
stackexchange/codereview
I'm downloading a web page (tag soup HTML) with XMLHttpRequest and I want to take the output and turn it into a DOM object that I can then run XPATH queries on. How do I convert from a string into DOM object? It appears that the general solution is to create a hidden iframe and throw the contents of the string into tha...
stackexchange/codereview
We are developing an application that involves a substantial amount of XML transformations. We do not have any proper input test data per se, only DTD or XSD files. We'd like to generate our test data ourselves from these files. Is there an easy/free way to do that? Edit There are apparently no free tools for this, and...
stackexchange/codereview
I'm setting up my team's source control + build/integration process from scratch. We were using VSS and a tool we created in-house to perform the build process. We decided to move on to a more modern environment. I have the SVN running, and I would like to set a continuous integration process with CruiseControl.NET. Is...
stackexchange/codereview
Is Boost the only way for VS2005 users experience TR2? Also is there a idiot proof way of downloading only the TR2 related packages? I was looking at the boost installer provided by BoostPro Consulting. If I select the options for all the threading options with all the packages for MSVC8 it requires 1.1GB. While I am n...
stackexchange/codereview
For example, in Java there is Functional Java and Higher-Order Java. Both essentially give a small API for manipulating higher-order, curried functions, and perhaps a few new data types (tuples, immutable lists).
stackexchange/codereview
I have an old .dot file with a few dozen styles in it. I need to place them into another .dot file that I received. Is there a better way to get them in there than manually recreating each style?
stackexchange/codereview
I'm using Steema's TeeChart ActiveX 5 component for an application in .NET C#. I do some drawings using the methods Line(), Rectangle() and Circle() through the "Canvas" property of the component. My code for drawing is called on every on every OnBeforeDrawSeries() and OnAfterDraw() events of the component. When there ...
stackexchange/codereview