instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I want a list of hyperlinks on a basic html page, which point to files on our corporate intranet. When a user clicks the link, I want the file to open. They are excel spreadsheets, and this is an intranet environment, so I can count on everyone having Excel installed. I've tried two things: The obvious and simple thin...
stackexchange/codereview
Is it possible to determine which property of an ActiveX control is the default property? For example, what is the default property of the VB6 control CommandButton and how would I found out any other controls default! /EDIT: Without having source to the object itself
stackexchange/codereview
We recently lost a database and I want to recover the data from de Production.log. Every request is logged like this: Processing ChamadosController#create (for XXX.XXX.XXX.40 at 2008-07-30 11:07:30) [POST] Session ID: 74c865cefa0fdd96b4e4422497b828f9 Parameters: {"commit"=>"Gravar", "action"=>"create", "funcionario...
stackexchange/codereview
In Java, static and transient fields are not serialized. However, I found out that initialization of static fields causes the generated serialVersionUID to be changed. For example, static int MYINT = 3; causes the serialVersionUID to change. In this example, it makes sense because different versions of the class would ...
stackexchange/codereview
What's the best and/or fastest method of doing multijoin queries in Django using the ORM and QuerySet API?
stackexchange/codereview
I need to write a Java Comparator class that compares Strings, however with one twist. If the two strings it is comparing are the same at the beginning and end of the string are the same, and the middle part that differs is an integer, then compare based on the numeric values of those integers. For example, I want th...
stackexchange/codereview
I want to do a Response.Redirect("MyPage.aspx") but have it open in a new browser window. I've done this before without using the JavaScript register script method. I just can't remember how?
stackexchange/codereview
Is there a way to iterate (through foreach preferably) over a collection using reflection? I'm iterating over the properties in an object using reflection, and when the program gets to a type that is a collection, I'd like it to iterate over the contents of the collection and be able to access the objects in the colle...
stackexchange/codereview
Is there any library (or even better, web service) available which can convert from a latitude/longitude into a time zone?
stackexchange/codereview
What is the maximum size for a MySQL table? Is it 2 million at 50GB? 5 million at 80GB? At the higher end of the size scale, do I need to think about compressing the data? Or perhaps splitting the table if it grew too big?
stackexchange/codereview
I want to write a command that specifies "the word under the cursor" in VIM. For instance, let's say I have the cursor on a word and I make it appear twice. For instance, if the word is "abc" and I want "abcabc" then I could type: :s/\(abc\)/\1\1/ But then I'd like to be able to move the cursor to "def" and use th...
stackexchange/codereview
I came across this article written by Andrei Alexandrescu and Petru Marginean many years ago, which presents and discusses a utility class called ScopeGuard for writing exception-safe code. I'd like to know if coding with these objects truly leads to better code or if it obfuscates error handling, in that perhaps the g...
stackexchange/codereview
Can you use CMFCVisualManager with a dialog based application to change the applications appearance? If so how is it done? The idea is to change the shape, colour etc. of controls such as push buttons using the MFC Feature Pack released with MSVC 2008.
stackexchange/codereview
I have an app that I've written in C#/WinForms (my little app). To make it cross-platform, I'm thinking of redoing it in Adobe AIR. Are there any arguments in favor of WinForms as a cross-platform app? Is there a cross-platform future for Winforms (e.g., Mono, etc.)? Suggestions for cross-platform UI development? By cr...
stackexchange/codereview
I'm a web developer, and I want to make the web sites I develop more accessible to those using screen readers. What limitations do screen readers have that I should be most aware of, and what can I do to avoid hitting these limitations. This question was sparked by reading another question about non-image based captch...
stackexchange/codereview
I had a plugin installed in Visual Studio 2008, and it created some extra dockable windows. I have uninstalled it, and I can't get rid of the windows it created - I close them, but they always come back. They're just empty windows now, since the plugin is no longer present, but nothing I've tried gets rid of them. I...
stackexchange/codereview
What is the best way to copy a directory (with sub-dirs and files) from one remote Linux server to another remote Linux server? I have connected to both using SSH client (like Putty). I have root access to both.
stackexchange/codereview
The Interface Segregation Principle (ISP) says that many client specific interfaces are better than one general purpose interface. Why is this important?
stackexchange/codereview
Possible Duplicates: Learn Obj-C Memory Management Where are the best explanations of memory management for iPhone? I come from a C/C++ background and the dynamic nature of Objective-C is somewhat foreign to me, is there a good resource anyone can point me to for some basic memory management techniques in Objective-...
stackexchange/codereview
I want to copy a live production database into my local development database. Is there a way to do this without locking the production database? I'm currently using: mysqldump -u root --password=xxx -h xxx my_db1 | mysql -u root --password=xxx -h localhost my_db1 But it's locking each table as it runs.
stackexchange/codereview
I'm porting old VB6 code that uses the Winsock control to C#. I haven't done any socket programming and I wonder if anyone has a good reference/tutorial/howto that I can use to start getting up to speed. I'm appealing to the hive mind while I proceed with my generally unproductive googling. I'm using UDP, not TCP at t...
stackexchange/codereview
I've been trying to get into F# on and off for a while but I keep getting put off. Why? Because no matter which 'beginners' resource I try to look at I see very simple examples that start using the operator ->. However, nowhere have I found as yet that provides a clear simple explanation of what this operator means. ...
stackexchange/codereview
Are there any good database schema comparison tools out there that support Sybase SQL Anywhere version 10? I've seen a litany of them for SQL Server, a few for MySQL and Oracle, but nothing that supports SQL Anywhere correctly. I tried using DB Solo, but it turned all my non-unique indexes into unique ones, and I di...
stackexchange/codereview
For a particular project I have, no server side code is allowed. How can I create the web site in php (with includes, conditionals, etc) and then have that converted into a static html site that I can give to the client? Update: Thanks to everyone who suggested wget. That's what I used. I should have specified that I w...
stackexchange/codereview
I start by creating a string variable with some non-ascii utf-8 encoded data on it: >>> text = 'á' >>> text '\xc3\xa1' >>> text.decode('utf-8') u'\xe1' Using unicode() on it raises errors... >>> unicode(text) Traceback (most recent call last): File "<stdin>", line 1, in <module> UnicodeDecodeError: 'ascii' codec can...
stackexchange/codereview
Is there any way to use this kind of format in .Net (C#)? I want to use the same skin format that uTorrent uses in my app, but i can't get the transparent background. Any ideas? Thanks for your time.
stackexchange/codereview
I am going to be using Subversion for source control on a new J2EE web application. What directory structure will you recommend for organizing code, tests and documentation?
stackexchange/codereview
I have a site, which contains several ashx handlers, on a couple of the handlers I want to reject non-SSL requests. Is there a way that I can do this in code?
stackexchange/codereview
I'd like to automate TortoiseSVN as part of a commit process. Specifically I'd like to dynamically create a log entry for the commit dialog. I know that I can launch the commit dialog either from the commandline or by right clicking on a folder and selecting svncommit. I'd like to use the start commit hook to setup a l...
stackexchange/codereview
Strange question, but: Sharepoint 2007 greets you with the Administrator Tasks on the Central Administration after installation. I just wonder if this list is "safe" to be used for my own Administration Tasks? The reason why i'm asking is because I found that Sharepoint uses a lot of "black magic" and unlogical behavio...
stackexchange/codereview
I have three unordered lists that have been created as Scriptaculous Sortables so that the user can drag items within the lists and also between them: var lists = ["pageitems","rowitems","columnitems"]; Sortable.create("pageitems", { dropOnEmpty: true, containment: lists, constraint: false }); Sortable.create("...
stackexchange/codereview
How can you suppress the Terminated message that comes up after you kill a process in a bash script? I tried set +bm, but that doesn't work. I know another solution involves calling exec 2> /dev/null, but is that reliable? How do I reset it back so that I can continue to see stderr?
stackexchange/codereview
I have settled a web synchronization between SQLSERVER 2005 as publisher and SQLEXPRESS as suscriber. Web synchro has to be launched manually through IE interface (menu tools/synchronize) and to be selected among available synchronizations. Everything is working fine except that I did not find a way to automate the syn...
stackexchange/codereview
I need to enumerate though generic IList<> of objects. The contents of the list may change, as in being added or removed by other threads, and this will kill my enumeration with a "Collection was modified; enumeration operation may not execute." What is a good way of doing threadsafe foreach on a IList<>? prefferably w...
stackexchange/codereview
I have a machine with VmWare installed which added two extra network interfaces. The OS is Vista. I have two Java applications, one which broadcasts datagrams, and one which receives those datagrams. The problem I'm having is that unless I disable both VmWare network interfaces, the receiver can't receive the datagr...
stackexchange/codereview
I've seen lots of descriptions how anonymous types work, but I'm not sure how they're really useful. What are some scenarios that anonymous types can be used to address in a well-designed program?
stackexchange/codereview
By default when using a webapp server in Eclipse Web Tools, the server startup will fail after a timeout of 45 seconds. I can increase this timeout in the server instance properties, but I don't see a way to disable the timeout entirely (useful when debugging application startup). Is there a way to do this?
stackexchange/codereview
Context: I'm in charge of running a service written in .NET. Proprietary application. It uses a SQL Server database. It ran as a user member of the Administrators group in the local machine. It worked alright before I added the machine to a domain. So, I added the machine to a domain (Win 2003) and changed the user to...
stackexchange/codereview
The Open/Closed Principle states that software entities (classes, modules, etc.) should be open for extension, but closed for modification. What does this mean, and why is it an important principle of good object-oriented design?
stackexchange/codereview
I have a large exiting C++ project involving: 4 applications 50+ libraries 20+ third party libraries It all builds fine on Windows using VS8, Linux using QMake (project uses Qt a lot). I also build it on OS X using QMake but I was wanting to setup an Xcode project to handle it in an IDE. I'm struggling to setup ...
stackexchange/codereview
In C#, what is the difference (if any) between these two lines of code? tmrMain.Elapsed += new ElapsedEventHandler(tmrMain_Tick); and tmrMain.Elapsed += tmrMain_Tick; Both appear to work exactly the same. Does C# just assume you mean the former when you type the latter?
stackexchange/codereview
I have a website that is perfectely centered aligned. The CSS code works fine. The problem doesn't really have to do with CSS. I have headers for each page that perfectely match eachother. However, when the content gets larger, Opera and FireFox show a scrollbar at the left so you can scroll to the content not on the s...
stackexchange/codereview
What method do I call to get the name of a class?
stackexchange/codereview
As part of the Nant copy task, I would like to change the properties of the files in the target location. For instance make the files "read-write" from "read-only". How would I do this?
stackexchange/codereview
I have just started reading DDD. I am unable to completely grasp the concept of Entity vs Value objects.. Can someone please explain the problems (maintainability, performance.. etc) a system could face when a Value object is designed as a Entity object? Example would be great...
stackexchange/codereview
Why does the use of temp tables with a SELECT statement improve the logical I/O count? Wouldn't it increase the amount of hits to a database instead of decreasing it. Is this because the 'problem' is broken down into sections? I'd like to know what's going on behind the scenes.
stackexchange/codereview
I'm building an HTML UI with some text elements, such as tab names, which look bad when selected. Unfortunately, it's very easy for a user to double-click a tab name, which selects it by default in many browsers. I might be able to solve this with a JavaScript trick (I'd like to see those answers, too) -- but I'm reall...
stackexchange/codereview
I'm wondering if there's any way to write CSS specifically for Safari using only CSS. I know there has to be something out there, but I haven't found it yet.
stackexchange/codereview
I just started to learn Ruby and as a .Net developer, I'm wondering if I should just go straight ahead and use IronRuby, without trying some pure Ruby first. What do you think? Will I be missing anything? -- rauchy
stackexchange/codereview
I'm using the After Effects CS3 Javascript API to dynamically create and change text layers in a composition. Or at least I'm trying to because I can't seem to find the right property to change to alter the actual text of the TextLayer object.
stackexchange/codereview
I am looking for a CSS-based web page template where the main content div occupies the full height of the view port (minus header and footer heights) when its content has few lines. The footer should be at the bottom of the viewport, rather than right below content, where it's more in the middle of the viewport. Conten...
stackexchange/codereview
I would like to write all meta data (including advanced summary properties) for my files in a windows folder to a csv file. Is there a way to collect all the attributes? I see mp3 files have a different set of attributes compared to jpg files. (c#) This can also be a script (vb, perl) Update: by looking at libextract...
stackexchange/codereview
Has anybody come up with a better technique for managing tags and branches in subversion than what is generally recommended (the parallel directories called 'tags' and 'branches')?
stackexchange/codereview
I am using an ASP.NET MVC project and everytime I add a class to a folder it makes really long namespaces. Example: Project = Tully.Saps.Data Folder = DataAccess/Interfaces Namespace = Tully.Saps.Data.DataAccess.Interfaces Folder = DataAccess/MbNetRepositories Namespace = Tully.Saps.Data.DataAccess.MbNetRepos...
stackexchange/codereview
I would like to make a child class that has a method of the parent class where the method is a 'classmethod' in the child class but not in the parent class. Essentially, I am trying to accomplish the following: class foo(Object): def meth1(self, val): self.value = val class bar(foo): meth1 = classmetho...
stackexchange/codereview
Is there a way to detect, from within the finally clause, that an exception is in the process of being thrown? See the example below: try { // code that may or may not throw an exception } finally { SomeCleanupFunctionThatThrows(); // if currently executing an exception, exit the program, // otherwise ...
stackexchange/codereview
I am wondering, what goes into the creation of a GUID. I don't mean what is used to create a GUID in a specific language (NewID() in SQL Server, Guid.NewGuid() in C#), I mean when you call those methods/functions, what do they do to make the GUID?
stackexchange/codereview
I'm making a WinForms app with a ListView set to detail so that several columns can be displayed. I'd like for this list to scroll when the mouse is over the control and the user uses the mouse scroll wheel. Right now, scrolling only happens when the ListView has focus. How can I make the ListView scroll even when it d...
stackexchange/codereview
I'm looking for a tool that will reverse engineer Java into a sequence diagram BUT also provides the ability to filter out calls to certain libraries. For example, the Netbeans IDE does a fantastic job of this but it includes all calls to String or Integer which clutter up the diagram to the point it is unusable. Any...
stackexchange/codereview
I wondered if anyone can give an example of a professional use of RSS/Atom feeds in a company product. Does anyone use feeds for other things than updating news? For example, did you create a product that gives results as RSS/Atom feeds? Like price listings or current inventory, or maybe dates of training lessons? Or a...
stackexchange/codereview
The Visual Studio refactoring support for C# is quite good nowadays (though not half as good as some Java IDE's I've seen already) but I'm really missing C++ support. I have seen Refactor! and am currently trying it out, but maybe one of you guys know a better tool or plugin? I've been working with Visual Assist X no...
stackexchange/codereview
My application uses 2.0. At some point in the future I may want to start using newer features added in later framework versions. Should I wait until then? Or are there advantages to updating to the latest .NET 3.5 now? I suppose by the time I am ready for next spring's release 4.0 will be out. Perhaps I should stic...
stackexchange/codereview
Say I have several JavaScript includes in a page: <script type="text/javascript" src="/js/script0.js"></script> <script type="text/javascript" src="/js/script1.js"></script> <script type="text/javascript" src="/js/script2.js"></script> <script type="text/javascript" src="/js/script3.js"></script> <script type="text/jav...
stackexchange/codereview
I am trying to do something I've done a million times and it's not working, can anyone tell me why? I have a table for people who sent in resumes, and it has their email address in it... I want to find out if any of these people have NOT signed up on the web site. The aspnet_Membership table has all the people who ARE ...
stackexchange/codereview
Does anyone know of some good resources related to setting up heirarchical user account systems? I'm currently setting one up and am struggling with some of the more complex logic (especially with determining permissions). I was hoping I might be able to find some resources to help me along. Some Background: I'm buildi...
stackexchange/codereview
I've used poderosa(a .NET terminal app) to monitor logs on multiple linux/solaris servers. This application is NOT getting currently maintained and I've had several problems with it. I'm wondering what other users do to simultaneously monitor several logs in real-time(as in tail -f logfile). I would like to be able to ...
stackexchange/codereview
We are currently storing plain text passwords for a web app that we have. I keep advocating moving to a password hash but another developer said that this would be less secure -- more passwords could match the hash and a dictionary/hash attack would be faster. Is there any truth to this argument?
stackexchange/codereview
This one has been bugging me for a while now. Is there a way I can stop Intellj IDEA from reporting missing keys in tags? My messages are not stored in property files so the issue does not apply in my case. I'm using IntelliJ IDEA 7.0.4
stackexchange/codereview
What I'm trying to do with MRS is to teach myself some basic AI; what I want to do is to make a rocket entity, with things such as vectored exhaust, and staging. Anyone have an idea on how to make an entity that can fly? Or do I just need to constantly apply a force upwards?
stackexchange/codereview
I use PHPMyAdmin for convenience in updating a remote database. But it doesn't show warnings, by default, which recently got me into some embarrassing trouble where I was updating a SET field with string not on its list and not noticing the problem. I'm using 2.11.9.1 (Dreamhost's default install). On the PHPMyAdmin w...
stackexchange/codereview
Is it possible to order results in SQL Server 2005 by the relevance of a freetext match? In MySQL you can use the (roughly equivalent) MATCH function in the ORDER BY section, but I haven't found any equivalence in SQL Server. From the MySQL docs: For each row in the table, MATCH() returns a relevance value; that is, a...
stackexchange/codereview
I'm currently trying to improve the design of a legacy db and I have the following situation Currently I have a table SalesLead in which we store the the LeadSource. Create Table SalesLead( .... LeadSource varchar(20) .... ) The Lead Sources are helpfully stored in a table. Create Table LeadSource ( Le...
stackexchange/codereview
I am using VS2008 and Resharper. Resharper creates a directory _Resharper.ProjectName. These files provide no value for source control that I am aware of and cause issues when committing changes. How can I get SVN to ignore them? I am using TortoiseSVN as my interface for SVN. EDIT: You guys are fast.
stackexchange/codereview
If I have a table structure that is: code, description, isdeleted where code is the primary key. The user creates a record, then later on deletes it. Because I am using soft deletes the isdeleted will be set to true. Then in my queries I would be doing a select with the where clause and not isdeleted Now if a user go...
stackexchange/codereview
There's a discussion going on over at comp.lang.c++.moderated about whether or not assertions, which in C++ only exist in debug builds by default, should be kept in production code or not. Obviously, each project is unique, so my question here is not so much whether assertions should be kept, but in which cases this is...
stackexchange/codereview
I would like to be able to programmatically bind some data to the dependency properties on a BitmapEffect. With a FrameworkElement like TextBlock there is a SetBinding method where you can programmatically do these bindings like: myTextBlock.SetBinding(TextBlock.TextProperty, new Binding("SomeProperty")); And I know y...
stackexchange/codereview
I'm interested in grabbing the EPG data from DVB-T streams. Does anyone know of any C libraries or an alternative means of getting the data?
stackexchange/codereview
There are many posts on the internet about the ReadDirectoryChangesW API function missing files when there is a lot of file activity. Most blame the speed at which the ReadDirectoryChangesW function loop is called. This is an incorrect assumption. The best explanation I have seen is in the following post, the commen...
stackexchange/codereview
Having tries to target two of these environments at the same time I can safely say the if you have to use a database etc. you end up having to write unique code for that environment. Have you got a great way to handle this situation?
stackexchange/codereview
I have an exe with an App.Config file. Now I want to create a wrapper dll around the exe in order to consume some of the functionalities. The question is how can I access the app.config property in the exe from the wrapper dll? Maybe I should be a little bit more in my questions, I have the following app.config content...
stackexchange/codereview
I have an Eclipse RCP app running on Java 6. When I try to run the product configuration from within Eclipse, it silently terminates almost immediately. No error is reported in the console. I've tried setting breakpoints in the IApplication and in the Activator, and neither are reached. I know I don't have much spec...
stackexchange/codereview
I'm working in Flash CS3, targeting Actionscript 2, and I'm writing an image preloader. When I test the movie with the download simulation turned on everything works just fine, and my preloader successfully updates the download progress bar I've made. When I upload the movie to my web server though, it almost behaves ...
stackexchange/codereview
I have an application that sends the customer to another site to handle the payments. The other site, outside of the customer, calls a page on our server to let us know what the status is of the payment. The called page checks the parameters that are given by the payment application and checks to see whether the transa...
stackexchange/codereview
With a distributed application, where you have lots of clients and one main server, should you: Make the clients dumb and the server smart: clients are fast and non-invasive. Business rules are needed in only 1 place Make the clients smart and the server dumb: take as much load as possible off of the server Additiona...
stackexchange/codereview
I currently have speakers set up both in my office and in my living room, connected to my PC via two sound cards, and would like to switch the set of speakers I'm outputting to on the fly. Anyone know an application or a windows API call that I can use to change the default sound output device? It is currently a bit of...
stackexchange/codereview
I want to connect a C# .NET application to a PostgreSQL database, using TLS with client and server authentication: in other words, if the certificate from the client can not be verified against the certificate of the server, the client should get access denied, and if the client can not verify the certificate of the se...
stackexchange/codereview
I am looking for some JavaScript plugin (preferably jQuery) to be able to scroll through an image, in the same way that Google Maps works. I can make the image draggable but then I see the whole image while dragging even if the parent div is overflow:hidden. Any help would be greatly appreciated!
stackexchange/codereview
Let's say I have the following HTML: <table id="foo"> <th class="sortasc">Header</th> </table> <table id="bar"> <th class="sortasc">Header</th> </table> I know that I can do the following to get all of the th elements that have class="sortasc" $$('th.sortasc').each() However that gives me the th elements from bo...
stackexchange/codereview
I decided to try http://www.screwturn.eu/ wiki as a code snippet storage utility. So far I am very impressed, but what irkes me is that when I copy paste my code that I want to save, '<'s and '[' (http://en.wikipedia.org/wiki/Character_encodings_in_HTML#Character_references) invariably screw up the output as the wiki i...
stackexchange/codereview
I am serving all content through apache with Content-Encoding: zip but that compresses on the fly. A good amount of my content is static files on the disk. I want to gzip the files beforehand rather than compressing them every time they are requested. This is something that, I believe, mod_gzip did in Apache 1.x auto...
stackexchange/codereview
I'm looking mainly at things like new SQL syntax, new kinds of locking, new capabilities etc. Not so much in the surrounding services like data warehousing and reports...
stackexchange/codereview
Here's a simplified version of what I'm trying to do : Before any other actions are performed, present the user with a form to retrieve a string. Input the string, and then redirect to the default controller action (e.g. index). The string only needs to exist, no other validations are necessary. The string must be av...
stackexchange/codereview
I've noticed that there seems to be quite a bit of hostility towards Linq To Entities particularly from the Alt.Net folks. I understand the resistance to more "drag and drop" programming, but from my understanding, Linq To Entities doesn't require it. We're currently using Linq to SQL, and we are using the DBML docu...
stackexchange/codereview
Dictionaries unlike lists are not ordered (and do not have the 'sort' attribute). Therefore, you can not rely on getting the items in the same order when first added. What is the easiest way to loop through a dictionary containing strings as the key value and retrieving them in ascending order by key? For example, you...
stackexchange/codereview
I have a VB.NET Windows Forms project that at one point paints text directly to onto the form at runtime. Before I paint with the font though, I want to make sure that the font and font-size exists on the user's machine. If they don't, I'll try a few other similar fonts, eventually defaulting with Arial or something. W...
stackexchange/codereview
Google / Youtube has an API for Youtube for javascript and Actionscript 2. Unfortunately this API is not compatible with Actionscript 3 without a wrapper - which google does not themselves provide. Has anybody got an actionscript 3 wrapper they can make available?
stackexchange/codereview
I need to package my Python application, its dependencies, and Python itself into a single MSI installer for distribution to users. The end result should desirably be: Python is installed in the standard location the package and its dependencies are installed in a separate directory (possibly site-packages) the instal...
stackexchange/codereview
I have written a site in Prototype but want to switch to jQuery. Any ideas on how best make the switch?
stackexchange/codereview
I was introduced to VisualAssist a few years ago and for me there's no going back. Are there any other tools I'm missing out on?
stackexchange/codereview
When a system has N tiers, and when using an ORM, how do you send loaded entities across the tiers ? Do you use DTO ? When DTO are not used and the entities are directly sent, how do you protect againt the uninitialized lazy loaded relationship errors ? Note : this is not a "should N tiers be used ?" question. I assume...
stackexchange/codereview