instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I've got a DataSet in VisualStudio 2005. I need to change the datatype of a column in one of the datatables from System.Int32 to System.Decimal. When I try to change the datatype in the DataSet Designer I receive the following error: Property value is not valid. Cannot change DataType of a column once it has data...
stackexchange/codereview
We have literally 100's of Access databases floating around the network. Some with light usage and some with quite heavy usage, and some no usage whatsoever. What we would like to do is centralise these databases onto a managed database and retain as much as possible of the reports and forms within them. The benefits o...
stackexchange/codereview
I've noticed a lot of Microsoft sites have the *.MSPX extension. While I'm very familiar with ASP.NET, I've not seen this extension before. Does anyone know what this identifies?
stackexchange/codereview
Does anyone know a way to auto-generate database tables for a given class? I'm not looking for an entire persistence layer - I already have a data access solution I'm using, but I suddenly have to store a lot of information from a large number of classes and I really don't want to have to create all these tables by ha...
stackexchange/codereview
Before I upgraded to Firefox 3 I used to constantly use the View Source Chart Firefox Addon which shows the source HTML in a very organized, graphical form. Unfortunately, this addon is only for Firefox 2 and the beta version for Firefox 3 now costs $10 on the author's site. Anyone know of a similar addon that works f...
stackexchange/codereview
I work in a Windows environment and would prefer to deploy code to IIS. At the same time I would like to code in Python. Having read that IIS can run fastCGI application, I went to the IIS site where it describes in detail how to get PHP up and running but not much about anything else. Does anyone have experience getti...
stackexchange/codereview
I'm writing (in C# with .NET 3.5) an administrative application which will poll multiple Windows systems for various bits of data. In many cases it will use WMI, but in some cases it may need to read remote registry or remotely execute some command or script on the polled system. This polling will happen at repeating i...
stackexchange/codereview
Are there any good oracle podcasts around? The only ones I've found is produced by oracle corp, and as such are little more than advertising pieces pushing their technology of the moment. I'm specifically interested in Database technologies.
stackexchange/codereview
I have a class to parse a matrix that keeps the result in an array member: class Parser { ... double matrix_[4][4]; }; The user of this class needs to call an API function (as in, a function I have no control over, so I can't just change its interface to make things work more easily) that looks like this: void api...
stackexchange/codereview
Does anyone have any experience with a good wpf pivot table control?
stackexchange/codereview
We have an intranet site backed by SVN, such that the site is a checkout out copy of the repository (working folder used only by IIS). Something on the site has been causing problems today, and I want to know how to find out what was checked out to that working folder in the last 48 hours. Update: If there's an option...
stackexchange/codereview
Assuming I'm trying to automate the installation of something on windows and I want to try to test whether another installation is in progress before attempting install. I don't have control over the installer and have to do this in the automation framework. Is there a better way to do this, some win32 api?, than just ...
stackexchange/codereview
Quite a few methods exist for passing data into a Flex binary from a Rails application. Right now, I'm using the old e4x resultFormat with a xml.erb template. I've done AMF before, but I feel like inlining parameters into the embed itself is a better solution because you don't have to wait for the browser to load a s...
stackexchange/codereview
Is it possible to extract all of the VBA code from a Word 2007 "docm" document using the API? I have found how to insert VBA code at runtime, and how to delete all VBA code, but not pull the actual code out into a stream or string that I can store (and insert into other documents in the future). Any tips or resources w...
stackexchange/codereview
We are building a website which will display news headlines and news. It will be a public site initially, but will evolve include portal content like personalized web pages. The site also needs to build web 2.0 features around the news stories being displayed, and needs to be extensible and highly customizable, allowi...
stackexchange/codereview
I'm trying to embed a window from my process into the window of an external process using the SetParent function and have encountered a few problems. First off, here is an outline of what I am currently doing to embed my window into the application: HWND myWindow; //Handle to my application window HWND externalWindow; ...
stackexchange/codereview
I'm trying to install GODI on linux (Ubuntu). It's a library management tool for the ocaml language. I've actually installed this before --twice, but awhile ago-- with no issues --that I can remember-- but this time I just can't figure out what I'm missing. $ ./bootstrap --prefix /home/nlucaroni/godi $ ./bootstrap_stag...
stackexchange/codereview
I am looking for easy steps that are simple and effective in making a web application more secure. What are your top tips for secure web applications, and what kind of attack will they stop?
stackexchange/codereview
I'm implementing a custom control and in this control I need to write a bunch of links to the current page, each one with a different query parameter. I need to keep existing query string intact, and add (or modify the value of ) an extra query item (eg. "page"): "Default.aspx?page=1" "Default.aspx?page=2" "Default.as...
stackexchange/codereview
I have a problem with a sample routing with the preview 5 of asp.net mvc. In the AccountController I have 2 actions: public ActionResult Delete() public ActionResult Delete(string username) While trying to look for Account/Delete or Account/Delete?username=davide the ControllerActionInvoker throws a exception sayi...
stackexchange/codereview
I like how SQLite library can be included into an application and the application has a full-fledged database to use. Similarly, is there an open source versioning library that I can include into my application so that I can save versions of files as well as do diffs and merges?
stackexchange/codereview
How can i stop the host machine entering standby mode while my application is running? Is there any win32 api call to do this?
stackexchange/codereview
EditPad Lite has a nice feature (CTRL-E, CTRL-I) which inserts a time stamp e.g. "2008-09-11 10:34:53" into your code. What is the best way to get this functionality in Vim? (I am using Vim 6.1 on a Linux server via SSH. In the current situation a number of us share a login so I don't want to create abbreviations in th...
stackexchange/codereview
I have an infopath 2007 form that I am developing which uses 3 different views. The 3 different views are basically the same form, but have different text boxes shown, depending upon what button the user selects. I run into a problem where 'view 1' has some form validation, but the user has selected 'view 2' and submit...
stackexchange/codereview
What is the command to list all triggers in a MySQL database?
stackexchange/codereview
We're a .NET team which uses the Oracle DB for a lot of reasons that I won't get into. But deployment has been a bitch. We are manually keeping track of all the changes to the schema in each version, by keeping a record of all the scripts that we run during development. Now, if a developer forgets to check-in his scri...
stackexchange/codereview
I have a Linq query that I want to call from multiple places: var myData = from a in db.MyTable where a.MyValue == "A" select new { a.Key, a.MyValue }; How can I create a method, put this code in it, and then c...
stackexchange/codereview
Part of the web application I'm working on is an area displaying messages from management to 1...n users. I have a DataAccess project that contains the LINQ to SQL classes, and a website project that is the UI. My database looks like this: User -> MessageDetail <- Message <- MessageCategory MessageDetail is a join tabl...
stackexchange/codereview
I am looking for a tool which will take an XML instance document and output a corresponding XSD schema. I certainly recognize that the generated XSD schema will be limited when compared to creating a schema by hand (it probably won't handle optional or repeating elements, or data constraints), but it could at least ser...
stackexchange/codereview
Conceptually, I would like to accomplish the following but have had trouble understand how to code it properly in C#: SomeMethod { // Member of AClass{} DoSomething; Start WorkerMethod() from BClass in another thread; DoSomethingElse; } Then, when WorkerMethod() is complete, run this: void SomeOtherMetho...
stackexchange/codereview
I've been doing a massive code review and one pattern I notice all over the place is this: public bool MethodName() { bool returnValue = false; if (expression) { // do something returnValue = MethodCall(); } else { // do something else returnValue = Expression; ...
stackexchange/codereview
In a project of mine the SQL statements that are executed against a SQL Server are failing for some unknown reason. Some of the code is already used in production so debugging it is not an easy task. Therefore I need a way to see in the database itself what SQL statements are used, as the statements are generated at ru...
stackexchange/codereview
I've been hearing about triggers, and I have a few questions. What are triggers? How do I set them up? Are there any precautions, aside from typical SQL stuff, that should be taken?
stackexchange/codereview
With the code, forms and data inside the same database I am wondering what are the best practices to design a suite of tests for a Microsoft Access application (say for Access 2007). One of the main issues with testing forms is that only a few controls have a hwnd handle and other controls only get one they have focus,...
stackexchange/codereview
Given an array of characters which forms a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it. Example input and output: >>> reverse_words("this is a string") 'string a is this' It should be O(N) time and O(1) space (split() and pushing on / popping off the stack ar...
stackexchange/codereview
It's common to have a table where for example the the fields are account, value, and time. What's the best design pattern for retrieving the last value for each account? Unfortunately the last keyword in a grouping gives you the last physical record in the database, not the last record by any sorting. Which means IM...
stackexchange/codereview
I start with an entity A with primary key A1, it has child collections B and C, but they are empty, because I haven't prefetched them. I now get a new occurrence of A (A prime) with primary key A1 with the child collections B and C filled. What is a good way to get the A and A prime to be the same object and to get A ...
stackexchange/codereview
I'm using the d programing language to write a program, and I'm trying to use ddbg to debug it. When there is an exception, I want to have the program break whenever there is an exception thrown so that I can inspect the stack. Alternatively, is there another debugger that works with d? Is there another way to get a ...
stackexchange/codereview
Word 2007 saves its documents in .docx format which is really a zip file with a bunch of stuff in it including an xml file with the document. I want to be able to take a .docx file and drop it into a folder in my asp.net web app and have the code open the .docx file and render the (xml part of the) document as a web pa...
stackexchange/codereview
Ok, so I'm an idiot. So I was working on a regex that took way to long to craft. After perfecting it, I upgraded my work machine with a blazing fast hard drive and realized that I never saved the regex anywhere and simply used RegexBuddy's autosave to store it. Dumb dumb dumb. I sent a copy of the regex to a cowo...
stackexchange/codereview
I want to use the Date::ABBR_MONTHS constant in my rails application. I see the Ruby stdlib documentation at http://www.ruby-doc.org/stdlib/ which does not seem to have this constant. However, this constant is there at http://stdlib.rubyonrails.org/ What is the difference between these two libraries? This constant is ...
stackexchange/codereview
I need to serialize the System.Configuration.SettingsProperty and System.Configuration.SettingsPropertyValue class object through WCF.
stackexchange/codereview
I would like to write a plug-in that will allow a custom written CRM to read and write to their local Outlook client. I know that this poses a security concern. But, my clients are asking that their CRM "be connected" to Outlook. They would like to be able to do the following: A) When a contact sends them an email (...
stackexchange/codereview
This is a segment of code from an app I've inherited, a user got a Yellow screen of death: Object reference not set to an instance of an object on the line: bool l_Success ... Now I'm 95% sure the faulty argument is ref l_Monitor which is very weird considering the object is instantiated a few lines before. Anyone...
stackexchange/codereview
I'm reading text from a flat file in c# and need to test whether certain values are dates. They could be in either YYYYMMDD format or MM/DD/YY format. What is the simplest way to do this in .Net?
stackexchange/codereview
I have the following table relationship in my database: Parent / \ Child1 Child2 \ / GrandChild I am trying to create the FK relationships so that the deletion of the Parent table cascades to both child and the grandchild table. For any one particular granchild, ...
stackexchange/codereview
How can I get the list of available databases on a SQL Server instance? I'm planning to make a list of them in a combo box in VB.NET.
stackexchange/codereview
I've got a young nephew who aspires to grow up to be a game programmer and i'd like to introduce him to the world of open-source as well as get him a sweet gift. Anything like that out there?
stackexchange/codereview
Edit: Solved, there was a trigger with a loop on the table (read my own answer further below). We have a simple delete statement that looks like this: DELETE FROM tablename WHERE pk = 12345 This just hangs, no timeout, no nothing. We've looked at the execution plan, and it consists of many lookups on related tables t...
stackexchange/codereview
Does anyone know where to find an explanation to the warnings in VS 2005 Code Analyses tool. I would like some documentation, explaining why it creates the warnings it does and what course of action one should take.
stackexchange/codereview
Does anyone know of any free frameworks that help you create thumbnails for web pages, that when clicked, the original image loads ontop of the page (modal like), as oppossed to opening a separate page. Thanks!
stackexchange/codereview
Do you always follow the convention of putting branches, tags and trunk directories at the top level of your Subversion repository? Lately, I have stopped bothering and nothing bad has happened (yet)! It should be possible to move directory trees around if there's ever a need to create them. Am I building up troubl...
stackexchange/codereview
Does anyone know of any existing projects that aim to port Android's Java VM over to the iPhone? From what I understand, this wouldn't be too out of reach and would certainly make for some exciting developments. Edit: I should point out that I am aware this will not happen using the official iPhone SDK. However, a jail...
stackexchange/codereview
I am attempting to devise a system for packing integer values greater than 65535 into a ushort. Let me explain. We have a system which generates Int32 values using an IDENTITY column from SQL Server and are limited by an in-production client API that overflows our Int32 IDs to ushorts. Fortunately the client only has...
stackexchange/codereview
How many messages does the queue for a standard window hold? What happens when the queue overflows? The documentation for GetMessage and relatives doesn't say anything about this, and PeekMessage only gives you a yes/no for certain classes of messages, not a message count. This page says that the queues are implemented...
stackexchange/codereview
I'm looking to build an reusable control or custom helper for my MVC project. I'm sure there is a best practice for this. Any help is appreciated.
stackexchange/codereview
The use of XSLT (XML Stylesheet Language Transform) has never seen the same popularity of many of the other languages that came out during the internet boom. While it is in use, and in some cases by large successful companies (i.e. Blizzard Entertainment), it has never seemed to reach mainstream. Why do you think thi...
stackexchange/codereview
We are currently using Apache 2.2.3 and Tomcat 5 (Embedded in JBoss 4.2.2) using mod_proxy_jk as the connector. Can someone shed some light on the the correct way to calculate / configure the values below (as well as anything else that may be relevant). Both Apache and Tomcat are running on separate machines and have ...
stackexchange/codereview
What are the different database options on Windows Mobile available? I have used CEDB and EDB for linear dataset needs. I have heard of SQL server 2005 Mobile edition. But what are the advantages over others (if there is any)
stackexchange/codereview
NOTE: I am not set on using VI, it is just the first thing that came to mind that might be able to do what I need. Feel free to suggest any other program. I have a form with nearly 100 fields that I would like to auto-fill with PHP. I know how to do the autofill, but I would like to avoid manually adding the needed tex...
stackexchange/codereview
what configuration needs to be tweaked, and where does it live, in order to increase the maximum allowed post size?
stackexchange/codereview
How can you strip non-ASCII characters from a string? (in C#)
stackexchange/codereview
Do I have to restart IIS if I drop a new DLL in the bin of my virtual directory?
stackexchange/codereview
Is there a good command-line UNIX charting / graphing / plotting tool out there? I'm looking for something that will plot xy points on an ASCII graph. Just to clarify, I'm looking for something that will output a graph in ASCII (like ascii-art style), so I can use it over an interactive shell session without needing X...
stackexchange/codereview
Seems to me most of developers completely ignore this features. People prefer handling security exceptions as generic ones relying on standard windows roles and rights instead of learning to use CAS ways of enhancing security - probably because CAS is quite confusing in its logic and naming. Can anyone suggest any gene...
stackexchange/codereview
The application I am currently working on generates a lot of SQL inline queries. All generated SQL is then handed off to a database execution class. I want to write a parsing service for the data execution class that will take a query like this: SELECT field1, field2, field3 FROM tablename WHERE foo=1 AND bar="baz" an...
stackexchange/codereview
we're have a client that needs to get interactive messages from a server, from clients that are distributed around the world behind all kinds of firewalls with all kinds of ports closed. The only thing we can rely on is HTTP port 80 (and HTTPS 443). The design is basically modeled after XMPP (the Jabber protocol), usin...
stackexchange/codereview
I would like to know how to unload an assembly that is loaded into the main AppDomain. I have the following code: var assembly = Assembly.LoadFrom( FilePathHere ); I need/want to be able to unload this assembly when I am done. Thanks for your help.
stackexchange/codereview
I know I can do this: IDateTimeFactory dtf = MockRepository.GenerateStub<IDateTimeFactory>(); dtf.Now = new DateTime(); DoStuff(dtf); // dtf.Now can be called arbitrary number of times, will always return the same value dtf.Now = new DateTime()+new TimeSpan(0,1,0); // 1 minute later DoStuff(dtf); //ditto from above W...
stackexchange/codereview
Many websites, including this one, add what are apparently called slugs - descriptive but as far as I can tell useless bits of text - to the end of URLs. For example, the URL the site gives for this question is: https://stackoverflow.com/questions/47427/why-do-some-websites-add-slugs-to-the-end-of-urls But the followin...
stackexchange/codereview
This free collection library comes from IT University of Copenhagen. http://www.itu.dk/research/c5/ There is a video with one of the authors on Channel 9. I am trying to learn how to use these collections and I was wondering whether anyone has more experiences or what are your thoughts on this specific collection libra...
stackexchange/codereview
Consider the following 2 queries: select tblA.a,tblA.b,tblA.c,tblA.d from tblA where tblA.a not in (select tblB.a from tblB) select tblA.a,tblA.b,tblA.c,tblA.d from tblA left outer join tblB on tblA.a = tblB.a where tblB.a is null Which will perform better? My assumption is that in general the join will be better ex...
stackexchange/codereview
What is the shortcut key for Run to cursor in Visual Studio 2008?
stackexchange/codereview
Resharper, RefactorPro, etc?
stackexchange/codereview
I am trying to create a horizontal menu with the elements represented by <span>'s. The menu itself (parent <div>) has a fixed width, but the elements number is always different. I would like to have child <span>'s of the same width, independently of how many of them are there. What I've done so far: added a float: left...
stackexchange/codereview
I've inherited a desktop application which has a custom .NET file chooser that is embedded in a control, but it has some issues. I'd like to replace it with a non-custom File Chooser (like the OpenFileDialog). However, for a variety of reasons it needs to be embedded in the parent control not a popup dialog. Is there...
stackexchange/codereview
In SQL Server 2005 I have an "id" field in a table that has the "Is Identity" property set to 'Yes'. So, when an Insert is executed on that table the "id" gets set automatically to the next incrementing integer. Is there an easy way when the Insert is executed to get what the "id" was set to without having to do a Sele...
stackexchange/codereview
I have a problem with WSE on Windows 2000 Machines. The method SoapReceivers.Add crashed under Windows 2000. It seemes that the windows 2000 os did not allow to start a listening service on excluse addresses. So I find a out that I can set this in the config file to "false" But the problem is still be available. Anybo...
stackexchange/codereview
If unit-test names can become outdated over time and if you consider that the test itself is the most important thing, then is it important to choose wise test names? ie [Test] public void ShouldValidateUserNameIsLessThan100Characters() {} verse [Test] public void UserNameTestValidation1() {}
stackexchange/codereview
I have a user script that would be much more useful if it could dynamically change some of its execution dependent on what the user wanted. Passing simple switches would easily solve this problem but I don't see any way to do it. I also tried embedding a keyword in the script name, but Xcode copies the script to a gui...
stackexchange/codereview
Does someone have any tips/advice on database design for a web application? The kind of stuff that can save me a lot of time/effort in the future when/if the application I'm working on takes off and starts having a lot of usage. To be a bit more specific, the application is a strategy game (browser based, just text) th...
stackexchange/codereview
Possible Duplicate: Avoiding repeated constants in CSS We have some "theme colors" that are reused in our CSS sheet. Is there a way to set a variable and then reuse it? E.g. .css OurColor: Blue H1 { color:OurColor; }
stackexchange/codereview
I've got a c# assembly which I'm invoking via COM from a Delphi (win32 native) application. This works on all the machines I've tested it on, except one. The problem is that the Delphi application gets "Class not registered" when trying to create the COM object. Now, when I look in the registry under HKEY_CLASSES_ROOT\...
stackexchange/codereview
How can I extract the list of available SQL servers in an SQL server group? I'm planning to put that list in a combo box in VB.NET.
stackexchange/codereview
I'm looking at ways to deploy a Ruby on Rails app (running on JRuby) to a Tomcat instance for testing. The tomcat instance is running on a Solaris server that I can SSH to. I've looked at using Capistrano, but there doesn't seem to be a lot out there about using it to deploy to Tomcat, or even about running it under JR...
stackexchange/codereview
I have a fairly standards compliant XHTML+CSS site that looks great on all browsers on PC and Mac. The other day I saw it on FF3 on Linux and the letter spacing was slightly larger, throwing everything out of whack and causing unwanted wrapping and clipping of text. The CSS in question has font-size: 11px; font-family:...
stackexchange/codereview
Here is a sample code to retrieve data from a database using the yield keyword that I found in a few place while googling around : public IEnumerable<object> ExecuteSelect(string commandText) { using (IDbConnection connection = CreateConnection()) { using (IDbCommand cmd = CreateCommand(commandText, con...
stackexchange/codereview
There seem to be two rival Eclipse plugins for integrating with Maven: m2Eclipse and q4e. Has anyone recently evaluated or used these plugins? Why would I choose one or the other?
stackexchange/codereview
I've been trying to implement unit testing and currently have some code that does the following: query external database, loading into a feed table query a view, which is a delta of my feed and data tables, updating data table to match feed table my unit testing strategy is this: I have a testing database that I am ...
stackexchange/codereview
I'm writing a game in Java, and I want the user to be able to provide input from both the command line and my GUI. Currently, I use this method to get input: static String getInput(){ System.out.println("Your move:"); Scanner sc = new Scanner(System.in); return sc.nextLine(); } I want t...
stackexchange/codereview
I have a page which is largely created by DOM script, which generates a table of images (normal img elements) from several webcams (helping out a friend with a pet boarding and my HTML/DOM is a bit rusty). It works fine in FF3 or Chrome, but not in IE7, In fact, the whole table is not visible in IE (but the body backg...
stackexchange/codereview
Using jQuery, how do you bind a click event to a table cell (below, class="expand") that will change the image src (which is in the clicked cell - original will be plus.gif, alternating with minus.gif) and hide/show the row immediately below it based on whether that row has a class of hide. (show it if it has a class o...
stackexchange/codereview
I sometimes need to use Visual Studio when I have limited screen real estate (remote desktopping from a laptop for example). It would be really useful to be able to make the currently selected code tab maximise to take the whole screen for a limited time. Is that possible? Is there a keyboard shortcut?
stackexchange/codereview
I'm writing a C# program that acts as a PowerPoint 2007 plugin. On some machines, some calls to the PowerPoint object model throw a COMException with the message RPC_E_SYS_CALL_FAILED. I couldn't find any specific advice on what to do regarding this error, or how to avoid it. From Googling it looks like something to do...
stackexchange/codereview
I want to parse a web page in Groovy and extract all of the href links and the associated text with it. If the page contained these links: <a href="http://www.google.com">Google</a><br /> <a href="http://www.apple.com">Apple</a> the output would be: Google, http://www.google.com<br /> Apple, http://www.apple.com I'm ...
stackexchange/codereview
I have 3 tables Links Link ID Link Name GroupID (FK into Groups) SubGroupID (FK into Subgroups) Groups GroupID GroupName SubGroup SubGroupID SubGroupName GroupID (FK into Groups) Every link needs to have a GroupID but teh SubGroupID is optional. How do i write a SQL query to show: Links.LinkName, Groups.GroupName,...
stackexchange/codereview
What is the best way for me to determine a controller variable's value during execution? For example, is there a way I can insert a break in the code, and cause the value of the variable to be output to the screen (or the log)?
stackexchange/codereview
In one of our application im getting an exception that i can not seem to find or trap. ... Application.CreateForm(TFrmMain, FrmMain); outputdebugstring(pansichar('Application Run')); //this is printed Application.Run; outputdebugstring(pansichar('Application Run After')); //this is printed end. <--- The Ex...
stackexchange/codereview
I am trying to read ASCII text response from a tcp open streaming socket This is what I have come up with so far. I want to know what is the best way to do this that includes error handling. Should I also be checking the SocketError after the Receive call in the do loop? IPEndPoint ep = new IPEndPoint(IPAddress.Parse...
stackexchange/codereview
I want to log user's actions in my Ruby on Rails application. So far, I have a model observer that inserts logs to the database after updates and creates. In order to store which user performed the action that was logged, I require access to the session but that is problematic. Firstly, it breaks the MVC model. Secondl...
stackexchange/codereview