instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
e.g, Is the user playing a movie full screen, or looking at powerpoint in full screen mode? I could have sworn I saw a IsFullScreenInteractive API before, but can't find it now
stackexchange/codereview
From an earlier post about trying to improve my sites performance I have been looking at HTTP compression. I have read about setting it up in IIS but it seems to be a global thing for all IIS application pools I may not be allowed to do this as there is another site running on it as well. I then saw some code to put in...
stackexchange/codereview
Is it possible to create a SQL query which will return one column which contains the dates from a given date range (e.g. all dates from last year till today). E.g. dat ---- 2007-10-01 2007-10-02 2007-10-03 2007-10-04 ... I am wondering if this is possible as an alternative to creating a table which holds all those dat...
stackexchange/codereview
what is the best way of displaying/using the revision number in a java webapp? we just use ant to build our .war archive, no buildserver or such. i'd hope there was some kind if $ref that i could write in a resource file, but this is only updated when the file in question is committed. i need it globally. what would yo...
stackexchange/codereview
I noticed last night that the WCF extensions for Visual Studio 2005 aren't available on their site any longer. I've read that they want people to use Visual Studio 2008 for WCF/WF/WPF. Have they made an official statement regarding this? edit: I already have the CTP3 for VS2005. I want to know what Microsoft's offici...
stackexchange/codereview
This is a nut I'm cracking these days Application I'm working on has some advanced processing towards SQL. One of the operations selects various metadata on the objects in the current context from different tables, based on the item names in the collection. For this, a range of "select...from...where...in()" is execute...
stackexchange/codereview
I've got a lightbox textbox that is displayed using an AJAX call from an ASP.NET UpdatePanel. When the lightbox is displayed, I use the focus() method of a textbox that is in the lightbox to bring focus to the textbox right away. When in Firefox, the text box gains focus with no problem. In IE, the text box does not ga...
stackexchange/codereview
Can we extend the Team Site to host our own pages. i.e. Does TFS allows you to add pages/web parts that are developed by us. I have found few clues in Google but no one could elaborate properly.
stackexchange/codereview
I am about to start a project for a potentially heavily accessed ASPNET MVC application and I was thinking to use Subsonic for my DAL. I have some concern about the ability of Subsonic to handle thousands of concurrent requests. Can anyone give me some examples of popular web sites using Subsonic? Also if you have any...
stackexchange/codereview
I'm interested in making desktop widgets, similar to Apple's Dashboard or what Vista has. I'd like to make them cross-platform, if possible. Opera's widgets are cross-platform but require the user to have Opera installed, so that's a big limitation. I know most widgets are made with HTML/XML, CSS, and Javascript. Is th...
stackexchange/codereview
How do I set a variable to the result of select query without using a stored procedure? I want to do something like: OOdate DATETIME SET OOdate = Select OO.Date FROM OLAP.OutageHours as OO WHERE OO.OutageID = 1 Then I want to use OOdate in this query: SELECT COUNT(FF.HALID) from Outages.FaultsInOutages as OFIO INNE...
stackexchange/codereview
We currently are using both Visual Source Safe and Team Foundation Server at work (VSS for old projects, TFS for current or new projects). We have always used Labels in source control for each build. In VSS if you chose to see a file history you could include labels. In TFS I cannot find an option to include the labl...
stackexchange/codereview
I have an scheduled agent that is trying to access a database on another server. When it runs I get an error 4063 - Database ...databasename... has not been opened yet. The servers is listed in the ACL as manager. What are some other possible causes for this errors?
stackexchange/codereview
I have a VB6 dll that is trying to create a COM object using the following line of code: Set CreateObj = CreateObject("OPSValuer.OPSValue") However this fails with the error "Object variable or With block variable not set". I can see OPSValuer.OPSValue in dcomcnfg and it appears to be registered fine. Does anyone have...
stackexchange/codereview
I am testing an application that checks if a file exists across a network. In my testing, I am purposefully pulling the network plug so the file will not be found. The problem is this causes my app to go unresponsive for at least 15 seconds. I have used both the FileExists() and GetAttr() functions in VB6. Does anyone ...
stackexchange/codereview
I have a Python web application consisting of several Python packages. What is the best way of building and deploying this to the servers? Currently I'm deploying the packages with Capistrano, installing the packages into a virtualenv with bash, and configuring the servers with puppet, but I would like to go for a more...
stackexchange/codereview
Since content of web applications is dynamically generated it would appear that AdSense is not going to produce relevant ads. Is there a way to increase relevancy of the AdSense ads for the web application? Is it possible to achieve Gmail-like ad functionality at all for third-party applications? Is there a better ad p...
stackexchange/codereview
I'd like to create a batch job in X++ for Microsoft Axapta 3.0 (Dynamics AX). How can I create a job which executes an X++ function like this one? static void ExternalDataRead(Args _args) { ... }
stackexchange/codereview
I have a simple "accordion" type page containing a list of H3 headers and DIV content boxes (each H3 is followed by a DIV). On this page I start with all DIVs hidden. When a H3 is clicked the DIV directly below (after) is revealed with jQuery's "slideDown" function while all other DIVs are hidden with the "slideUp" f...
stackexchange/codereview
A program receives a list of Messages (base type). Each message in the list has to be processed according to it's type (descendant type). However, different messages need different inputs in order to be processed correctly. What is the following technique called? (I haven't checked this code in a compiler) abstract ...
stackexchange/codereview
I need to zip and password-protect a file. Is there a good (free) library for this? This needs to be opened by a third party, so the password protection needs to work with standard tools.
stackexchange/codereview
I have some simple shell scripting tasks that I want to do For example: Selecting a file in the working directory from a list of the files matching some regular expression. I know that I can do this sort of thing using standard bash and grep but I would be nice to be able to hack quick scripts that will work in wind...
stackexchange/codereview
I have seen continuations in Jetty 6.0 that addresses scaling for comet/reverse-ajax applications. Are there any other libraries/frameworks to be used with Tomcat 5.5?
stackexchange/codereview
I have a form that I would like to style. specifcally I would like to chnage the background color of the form item's label. (the backgorundColor attribute changes both the label and the inputs background color) i.e. <mx:Form> <mx:FormItem label="username:"> <mx:TextInput /> </mx:FormItem> </mx:Form> ...
stackexchange/codereview
I have a collection of ClickOnce packages in a publish folder on a network drive and need to move them all to another server (our DR machine). After copy/pasting the whole directory and running the setups on the new machine I get an error message stating that it cannot find the old path: Activation of ...MyClickOn...
stackexchange/codereview
Does anyone have or know best practices for implementing a custom layout engine in WinForms? I've seen the windowsclient.net link, but it's a bit dated (Sept 2001).
stackexchange/codereview
In Google Chrome, I can provide the command-line argument --user-data-dir="..." to have Chrome use a different directory for state like cookies, cache, and so forth. This makes it possible to trivially load web pages from a "fresh" browser and simulate multiple independent users. How can I do the same thing with Inter...
stackexchange/codereview
I'm trying to modify the class of an element if an ajax call based on that element is successful <script type='text/javascript'> $("#a.toggle").click(function(e){ $.ajax({ url: '/changeItem.php', dataType: 'json', type: 'POST', success: function(data,text){ if(data.error=...
stackexchange/codereview
In handling a WM_GETMINMAXINFO message, I attempt to alter the parameter MINMAXINFO structure by changing the ptMaxSize. It doesn't seem to have any effect. When I receive the WM_SIZE message, I always get the same value, no matter whether I increase or decrease the ptMaxSize in the WM_GETMINMAXINFO.
stackexchange/codereview
Is there such a thing as unit test generation? If so... ...does it work well? ...What are the auto generation solutions that are available for .NET? ...are there examples of using a technology like this? ...is this only good for certain types of applications, or could it be used to replace all manually written unit te...
stackexchange/codereview
The ASP.NET application that I am currently responsible for at my day job has hit its limit in terms of its ability to scale inside a single server. Obviously we are working toward moving session out of process and the test and hopefully deploy date draws near. I would like to draw on the experiencies of people using t...
stackexchange/codereview
I have a the following scenarios. I am trying to calculate throughput of the java's XSLT transformer. I have 10 threrads, each iterates 1000 times. The task of the thread is to read the XML and XSLT file and trasnform it and write to a new file. I want to calculate the TPS. Can you please suggest the way to calculate ...
stackexchange/codereview
This semester, I took a course in computer graphics at my University. At the moment, we're starting to get into some of the more advanced stuff like heightmaps, averaging normals, tesselation etc. I come from an object-oriented background, so I'm trying to put everything we do into reusable classes. I've had good succe...
stackexchange/codereview
What are the key differences between HTML4 and HTML5 draft? Please keep the answers related to changed syntax and added/removed html elements.
stackexchange/codereview
I have a class declared as follows: Public MustInherit Container(Of T As {New, BaseClass}) Inherits ArrayList(Of T) I have classes that inherit this class. I have another class that I must pass instances in this method: Public Sub LoadCollection(Of T As {BaseClass, New})(ByRef Collection As Container(Of T)) I need to...
stackexchange/codereview
Whilst refactoring some code I came across some getter methods that returns a std::string. Something like this for example: class foo { private: std::string name_; public: std::string name() { return name_; } }; Surely the getter would be better returning a const std::string&? The current met...
stackexchange/codereview
I truly love VIM - it's one of only a handful of applications I've every come across that make you feel warm and fuzzy inside. However, for PHP development, I still use PDT Eclipse although I would love to switch. The reason I can't quite at the moment is the CTRL+SPACE code-assist functionality that I rely on so mu...
stackexchange/codereview
Not too practical maybe, but still interesting. Having some abstract question on matrix multiplication I have quickly implemented a matrix for ints, then tested my assumptions. And here I noticed that just int matrix is not good, if I occasionally want to use it with decimal or double. Of course, I could try just to ca...
stackexchange/codereview
I'm making a Stored Procedure that basically concatenates a long string with data from many records. I want to do: set @output = @output + 'aaa' + LINEBREAK How do I specify that line break?
stackexchange/codereview
I am currently having a hardtime understanding and implementing events in C# using delagates. I am used to the Java way of doing things: Define an interface for a listener type which would contain a number of method definitions Define adapter class for that interface to make things easier if I'm not interested in all...
stackexchange/codereview
I would like to use VB9 but am not sure what syntax to use to say that I want a variable to be statically typed as in C#'s: var foo = new Whatever(); In previous versions of VB: Dim foo = New Whatever() created a dynamically typed variable. Is there a way to get static typing without actually writing the type in VB9?...
stackexchange/codereview
I am running a Django through mod_python on Apache on a linux box. I have a custom authentication backend, and middleware that requires authentication for all pages, except static content. My problem is that after I log in, I will still randomly get the log in screen now and again. It seems to me that each apache proce...
stackexchange/codereview
I wonder what's the best deployment directory for Rails apps? Some developers use directories such as /u/apps/#{appname}. Are there any advantages when using /u/apps/#{appname} instead of /var/www/#{appname} or other OS default directories? Obviously I want to pick the directory with the best security properties and th...
stackexchange/codereview
I'm currently learning functional programming in my spare time with Scala, and I have an idle newbie question. I can see the elegance of having immutable objects when doing something like calculating a Haar wavelet transform - i.e. when the data itself being represented by the objects doesn't change. But I saw a blog w...
stackexchange/codereview
In WPF, there are two ways to set the focus to an element. You can either call the .Focus() method of the input element, or call Keyboard.Focus() with the input element as parameter. // first way: item.Focus(); // alternate way: Keyboard.Focus(item); What is the difference between these two? Are there special reasons ...
stackexchange/codereview
I'm developing a website. I'm using a single-page web-app style, so all of the different parts of the site are AJAX'd into index.php. When a user logs in and tells Firefox to remember his username and password, all input boxes on the site get auto-filled with that username and password. This is a problem on the form to...
stackexchange/codereview
It's really quite annoying as they are not part of the project.
stackexchange/codereview
I need a Datepicker for a WPF application. What is considered to be the best one?
stackexchange/codereview
I have a flowlayout panel and on a resize event, I resize all the controls inside the flowlayout panel so they fit the width of the (flowlayoutpanel - padding - scroll bar width). On some resizes, the scroll bar is not shown, hiding most of the controls outside the area of the flowlayoutpanel while on other resizes th...
stackexchange/codereview
I was wondering if it would be possible to retrieve the complete list of security roles defined in a web.xml file in the java code? And if so how to do it? I am aware of the 'isUserInRole' method but I also want to handle cases where a role is requested but not defined (or spelled differently) in the web.xml file.
stackexchange/codereview
I have a WinForms application with a view where the user selects a single time span from a list of predefined time spans in a ComboBox, with it's DropDownStyle property set to DropDownList. Now, the requirements have changed. The users are going to need the ability to make multiple selections from the list of time span...
stackexchange/codereview
I have asked our hosting provider to add mod_python to our httpd server. The server appears to be in an hsphere cluster and they appear to use yum to administer it. He is reporting some dependencies missing and I do't quite understand how that could have come about. versions (this is as much as I have been given): Ce...
stackexchange/codereview
I have a web application that generates a long report and I need to print it. If I just print the page it will break at the end of the physical page. How can I calculate where to make a break in the web page so that the page breaks line up with the physical pages when they print?
stackexchange/codereview
when i have a many-to.many relation with nhibernate and let nhibernate generate my db schema, it adds an aditional table that contains the primary keys of the related entities. is it possible to add additional fields to this and access them without having to hassle around with sql manually?
stackexchange/codereview
I have read (or perhaps heard from a colleague) that in .NET, TransactionScope can hit its timeout and then VoteCommit (as opposed to VoteRollback). Is this accurate or hearsay? I couldn't track down information on the web that talked about this issue (if it IS an issue), so I wonder if anyone has any direct experien...
stackexchange/codereview
What is .net dynamic data and why would I use it?
stackexchange/codereview
What is the best way to create a clone of a DTO? There is not an ICloneable interface or a BinaryFormatter class in Silverlight. Is reflection the only way?
stackexchange/codereview
I'm not sure why the TSpeedButton has this property but when a TSpeedButton is the only button of a given groupindex, it doesn't stay pressed, whether or not "AllowAllUp" is pressed. Maybe a Jedi control would suffice, but hopefully there's some fix. Any help or anecdotes are appreciated. BTW, I'm (still) using Delph...
stackexchange/codereview
I've used ZenTest and autotest to work on Ruby projects before, and I used to using them for test-driven development a la this configuration. I have a project that I'm currently working on in Java, and I was wondering if there is something similar in the Java world to achieve the same effect.
stackexchange/codereview
I find it annoying that I can't clear a list. In this example: a = [] a.append(1) a.append(2) a = [] The second time I initialize a to a blank list, it creates a new instance of a list, which is in a different place in memory, so I can't use it to reference the first, not to mention it's inefficient. The only way I c...
stackexchange/codereview
After developing a WPF application without Source Control, I decided to add the solution to TFS. After doing so whenever I opened the main window.xaml file in Design View Visual Studio would disappear and the following event would be logged in the Application Event log: .NET Runtime version 2.0.50727.3053 - Fatal Exec...
stackexchange/codereview
How do I write unit tests in .NET? Specifically Visual Studio 2005?
stackexchange/codereview
Has anyone ever done work to get Ruby to do continuations (like Seaside on Smalltalk)?
stackexchange/codereview
Using jQuery, how do you check if there is an option selected in a select menu, and if not, assign one of the options as selected. (The select is generated with a maze of PHP functions in an app I just inherited, so this is a quick fix while I get my head around those :)
stackexchange/codereview
My math-fu is failing me! I need an efficient way of reducing network ranges to supersets, e.g. if I input list of IP ranges: 1.1.1.1 to 2.2.2.5 1.1.1.2 to 2.2.2.4 10.5.5.5 to 155.5.5.5 10.5.5.6 to 10.5.5.7 I want to return the following ranges: 1.1.1.1 to 2.2.2.5 10.5.5.5 to 155.5.5.5 Note: the input lists are not...
stackexchange/codereview
I have a server written in Java that runs as a Windows service (thanks to Install4J). I want this service to be able to download the latest version of the JAR file it runs from, and start running the new code. The stitch is that I don't want the Windows service to fully exit. Ideally, I would accomplish this by a uni...
stackexchange/codereview
Inside a service, what is the best way to determine a special folder path (e.g., "My Documents") for a specific user? SHGetFolderPath allows you to pass in a token, so I am assuming there is some way to impersonate the user whose folder you are interested in. Is there a way to do this based just on a username? If not, ...
stackexchange/codereview
What is the easiest way to encode a PHP string for output to a JavaScript variable? I have a PHP string which includes quotes and newlines. I need the contents of this string to be put into a JavaScript variable. Normally, I would just construct my JavaScript in a PHP file, à la: <script> var myvar = "<?php echo $my...
stackexchange/codereview
I was considering creating a separate SQLite database for certain apps on a Django project. However, I did not want to use direct SQLite access if possible. Django-style ORM access to these database would be ideal. Is this possible? Thank you.
stackexchange/codereview
I am trying to get the yasnippet and pabbrev packages working together with emacs, but I cannot seem to get any love. How can I get them to play nicely together? The crux of the problem is that pabbrev and yasnippet are binding to the tab keys. Both packages seem to do this fallback when a match isn't found, but they...
stackexchange/codereview
Banging my head against the wall here. I don't want to reinvent the wheel. The default Flex 3 classs for PopupButton is a combination of two buttons. One is a normal button with label and/or icon, and the second is the arrow which opens the popup. My struggle here is that I just want a button with an icon that opens t...
stackexchange/codereview
On our web application, the search results are displayed in sortable tables. The user can click on any column and sort the result. The problem is some times, the user does a broad search and gets a lot of data returned. To make the sortable part work, you probably need all the results, which takes a long time. Or I...
stackexchange/codereview
I have been looking for a logging framework for .net (c#) and decided to give log4net a go after reading up on a few question/answer threads here on stackoverflow. I see people mentioning over and over that they use a wrapper class for log4net and I am wonder what that would look like. I have my code split up into diff...
stackexchange/codereview
Is there any performance comparison of System.IO.File.ReadAllxxx / WriteAllxxx methods vs StreamReader / StremWriter classes available on web. What you think is the best way(from a performance perspective) to read/write text files in .net 3.0? When I checked the MSDN page of System.IO.File class, in the sample code MS ...
stackexchange/codereview
Right now I have a visual studio project which contains a custom content type that I made. It also contains all the necessary files for making a sharepoint solution (wsp) file and a script to generate this. Now, I would like to do 2 things. First, I'd like to create a custom display form for the content type and incl...
stackexchange/codereview
Now, I know this is completely subjective, so please don't flame me. I've never been entirely satisfied with linux whenever I decided to install a distro like Ubuntu, Fedora etc. because of their awkward positioning and spacing of widgets. Have a look at this: Notice the awkward spacing of the text field's text. I've...
stackexchange/codereview
The following code has a simple binding which binds the Text of the TextBlock named MyTextBlock to TextBox's Text and ToolTip property using the exact same Binding notation: <StackPanel> <TextBlock x:Name="MyTextBlock">Foo Bar</TextBlock> <TextBox Text="{Binding ElementName=MyTextBlock, Path=Text, StringForm...
stackexchange/codereview
In a SQL-database I make some selects, that get an duration (as result of a subtraction between two dates) in seconds as an int. But I want to format this result in a human-readable form like 'hh:mm' or 'dd:hh'. Is that possible in SQL and how can I realize this?
stackexchange/codereview
I'm having a bit of trouble with the UTL_MAIL package in Oracle 10g, and was wondering if anyone had any solutions? I connect to my DB as SYSMAN and load the following two scripts; @C:\oracle\product\10.2.0\db_1\rdbms\admin\utlmail.sql @C:\oracle\product\10.2.0\db_1\rdbms\admin\prvtmail.plb I set up the SMTP server; AL...
stackexchange/codereview
If I try to insert data with a 20 digit primary key into a SQLite database I get an error with the second insert statement because it "is not unique". If I select the values I can see from the SQLite commandprompt that the primary key is written in scientific notation. The column type is decimal. Is there a way to for...
stackexchange/codereview
I'm hoping someone has seen this before because I can't for the life of me find the problem. I'm trying to do the old "fix the back button" thing in an application and I think i have a pretty decent approach, the problem is that it relies on the application not calling page_load when you hit back and instead loading t...
stackexchange/codereview
Is there a good method for writing C / C++ function headers with default parameters that are function calls? I have some header with the function: int foo(int x, int y = 0); I am working in a large code base where many functions call this function and depend on this default value. This default value now needs to chan...
stackexchange/codereview
This is something I've always wondered, and I can't find any mention of it anywhere online. When a shop from, say Japan, writes code, would I be able to read it in English? Or do languages, like C, PHP, anything, have Japanese translations that they write? I guess what I'm asking is does every single coder in the world...
stackexchange/codereview
I'd like to know how to script this. Also, is there an out of the box GUI tool that will let me do this?
stackexchange/codereview
I'm trying to select data from a table defined similar to the following : Column | Data Type ------------------------- Id | Int DataType | Int LoggedData | XML but I only want to select those rows with a specific DataType value, and that contain a string (or evaluates a piece of XPath) in the...
stackexchange/codereview
How do I generate a range of consecutive numbers (one per line) from a MySQL query so that I can insert them into a table? For example: nr 1 2 3 4 5 I would like to use only MySQL for this (not PHP or other languages).
stackexchange/codereview
Due to the lack of clientaccesspolicy.xml, there appears to be problems with using Amazon S3 via Flex. Are there any work arounds? Edit: Both of the below answers are great and work, I've upvoted both (I'm not going to assign an answer to the question as they both work): Can you use Amazon S3 via Flex? Can you use Amaz...
stackexchange/codereview
Is SQL case sensitive? I've used MySQL and SQL Server which both seem to be case insensitive. Is this always the case? Does the standard define case-sensitivity?
stackexchange/codereview
Is there any open source or free .net ui toolkit containing at least one of the following controls: gantt chart (ms project like) calendar (google calendar like or ms outlook 2003, 2007 like) scheduler (outlook 2007 like) Thanks
stackexchange/codereview
Is there any way to validate the width and height of image when uploaded? using javascript of server side ? like jsp, aspx etc?
stackexchange/codereview
I was developing a web page, where I was laying out a board for a Chess-like game, along with a couple of piece trays. It's all done using HTML (with jQuery for dynamic updating as the game is played). Somewhere I'd got the notion that using absolute positioning of elements within a page was considered a bad practice, ...
stackexchange/codereview
I'm looking for metrics on how many ASP.NET developers are actively using ASP.NET. If you have links to reliable metrics I would be interested to see them.
stackexchange/codereview
What would you consider best practice for organizing JUnit tests in a project, and why? For example, do you keep your tests next to the classes they test? Do you put them in a separate but parallel package structure? Do you use a different organization strategy entirely?
stackexchange/codereview
I am building a blog type page, and I want to load items into the page as the user scrolls down, much like Google Reader, or Soup.io. How would you go about achieving this effect? I've seen some examples which read the height of the page, and have an onScroll even attached to the window so that as the user scrolls down...
stackexchange/codereview
I have a database driven website serving about 50,000 pages. I want to track each webpage/record hit. I will do this by creating logs, and then batch processing the logs once a day. I am not concerned with how I will do the batch process, only with the quickest way to log. How would you log, which do you think is quick...
stackexchange/codereview
Why do I get compiler errors with this Java code? 1 public List<? extends Foo> getFoos() 2 { 3 List<? extends Foo> foos = new ArrayList<? extends Foo>(); 4 foos.add(new SubFoo()); 5 return foos; 6 } Where 'SubFoo' is a concrete class that implements Foo, and Foo is an interface. Errors I get with this code:...
stackexchange/codereview
I've got a relatively large .Net system that consists of a number of different applications. Rather than having lots of different app.config files, I would like to share a single configuration file between all the apps. I would also like to have one version when developing on my machine, one version for someone else de...
stackexchange/codereview
I'm building a form with php/mysql. I've got a table with a list of locations and sublocations. Each sublocation has a parent location. A column "parentid" references another locationid in the same table. I now want to load these values into a dropdown in the following manner: --Location 1 ----Sublocation 1 ----Subloca...
stackexchange/codereview
Java has some very good open source static analysis tools such as FindBugs, Checkstyle and PMD. Those tools are easy to use, very helpful, runs on multiple operating systems and free. Commercial C++ static analysis products are available. Although having such products are great, the cost is just way too much for stude...
stackexchange/codereview
I've always assumed that before I can use the Dvorak layout I need to purchase a Dvorak keyboard. But I can't find one on Amazon. Is it simply a matter of popping the keys off a Qwerty keyboard and moving them around?
stackexchange/codereview