instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I unpacked a zip-file delivery into a clearcase view. Now I want to add the complete file tree to the repository. The GUI only provides an "Add to source control ..." for individual files/directories. Do you know how to recursively add the whole tree? (I'm on a Windows system, but have Cygwin installed.)
stackexchange/codereview
Requirements: free, preferably open-source implemented in one of the .NET managed langs Google found these: A Generic, Reusable Diff Algorithm on codeproject An O(ND) Difference Algorithm for C# Diff/Merge/Patch Library for C#/.NET by Joshua Tauberer EDIT: No apps please, only libraries.
stackexchange/codereview
The scenario You have developed a webapp using EJBs version 3. The system is deployed, delivered and is used by the customer. If you would have to rewrite the system from scratch, would you use EJBs again? No: Don't answer this question, answer this one instead. Yes: Provide one important, real problem that EJBs solv...
stackexchange/codereview
We have got loads of options for php + MySQL + Apache combo... Which is the best pack among these ? Lets confine our ideas to WAMP vs XAMPP, is there a better option to go for? I created an online programming contest web app called CodeFire on XAMPP, later I had to switch to WAMP, where none of the php scripts worked p...
stackexchange/codereview
My company releases a small software product for which I've recently been taking over the development side. It is a C# Windows Forms application. One of the things I've noticed is that much of the information about how the software is used is filtered through my superiors and I get the feeling that I'm missing importa...
stackexchange/codereview
Is there a clean, preferably standard method of trimming leading and trailing whitespace from a string in C? I'd roll my own, but I would think this is a common problem with an equally common solution.
stackexchange/codereview
I have a temp table with the exact structure of a concrete table T. It was created like this: select top 0 * into #tmp from T After processing and filling in content into #tmp, I want to copy the content back to T like this: insert into T select * from #tmp This is okay as long as T doesn't have identity column, ...
stackexchange/codereview
After being troubled by an issue that I simply did not have the knowledge to debug, I've just decided that I have to learn how to use Windbg. My only problem: I have no clue where to start :-( I'm not really a WinApi-Guy, having use languages that abstract the Windows Api away from me usually. So I just wonder: What is...
stackexchange/codereview
How much of a performance hit will running everything over TLS do to my server? I would assume this is completely ignorable in this day and age? I heard once that servers today could encrypt gigabytes of data per second, is that true? And if so, is it linearly scalable so that if top speed is 10GB/second, encrypting 1G...
stackexchange/codereview
I need to change the DataTemplate for items in a ListBox depending on whether the item is selected or not (displaying different/more information when selected). I don't get a GotFocus/LostFocus event on the top-most element in the DataTemplate (a StackPanel) when clicking the ListBox item in question (only through tabb...
stackexchange/codereview
EDIT: This question is more about language engineering than C++ itself. I used C++ as an example to show what I wanted, mostly because I use it daily. I didn't want to know how it works on C++ but open a discussion on how it could be done. That's not the way it works right now, that's the way I wish it could be done, a...
stackexchange/codereview
I am currently working on an web application that uses ASP.NET 2.0 framework. I need to redirect to a certain page, say SessionExpired.aspx, when the user session expires. There are lot of pages in the project, so adding code to every page of the site is not really a good solution. I have MasterPages though, which I th...
stackexchange/codereview
I have a templated class defined (in part) as template <class T> MyClass { public: void DoSomething(){} }; If I want to call DoSomething from another class, but be able to do this for multiple 'T' types in the same place, I am stuck for an idea as method functions pointers are uniquely constrained to the class type...
stackexchange/codereview
Is it possible that Microsoft will be able to make F# programs, either at VM execution time, or more likely at compile time, detect that a program was built with a functional language and automatically parallelize it better? Right now I believe there is no such effort to try and execute a program that was built as si...
stackexchange/codereview
I have a web service which takes quite some time to complete execution, and i am calling this web service asynchronously. I also want to implement an Abort functionality which will abort the web service method. Currently, i am observing that even if I dispose the requesting Web Service object, the web service completes...
stackexchange/codereview
When I am unsure about some thing for a project, I usually use a small separate project and make it my playground for things need to be tested. How do you do that ?
stackexchange/codereview
I have a problem with scandir(): The manpage contains this as prototype: int scandir(const char *dir, struct dirent ***namelist, int (*filter)(const struct dirent *), int (*compar)(const struct dirent **, const struct dirent **)); Therefore I have this: static inline int RubyCompare(const struct dirent **a, cons...
stackexchange/codereview
Is there a way to have Linux read ahead when cloning a disk? I use the program named "dd" to clone disks. The last time I did this it seemed as though the OS was reading then writing but never at the same time. Ideally, the destination disk would be constantly writing without waiting that's of course if the source d...
stackexchange/codereview
This code is from Prototype.js. I've looked at probably 20 different tutorials, and I can't figure out why this is not working. The response I get is null. new Ajax.Request(/path/to / xml / file.xml, { method: "get", contentType: "application/xml", onSuccess: function(transport) { alert(transport.respons...
stackexchange/codereview
Is there a way of comparing two bitmasks in Transact-SQL to see if any of the bits match? I've got a User table with a bitmask for all the roles the user belongs to, and I'd like to select all the users that have any of the roles in the supplied bitmask. So using the data below, a roles bitmask of 6 (designer+programme...
stackexchange/codereview
In PHP, a string enclosed in "double quotes" will be parsed for variables to replace whereas a string enclosed in 'single quotes' will not. In Python, does this also apply?
stackexchange/codereview
Our subversion repository has been moved to a new host, and we have old applications that connect to that host. We CANNOT add an alias for the new server with the old name, how can we re-connect our checked out clients to the new repository?
stackexchange/codereview
Is it possible to have a MySQLi prepared statement within the fetch() call of a previous statement? If not, what's the best way around it? Example code: if($stmt = $link->prepare("SELECT item FROM data WHERE id = ?")) { $stmt->bind_param("i", $id); $stmt->execute(); $stmt->bind_result($item); while( $st...
stackexchange/codereview
Okay, so I'm making a table right now for "Box Items". Now, a Box Item, depending on what it's being used for/the status of the item, may end up being related to a "Shipping" box or a "Returns" box. A Box Item may be defective:if it is, a flag will be set in the Box Item's row (IsDefective), and the Box Item will be pu...
stackexchange/codereview
With a huge influx of newbies to Xcode, I'm sure there are lots of Xcode tips and tricks to be shared. What are yours?
stackexchange/codereview
How often should you use git-gc? The manual page simply says: Users are encouraged to run this task on a regular basis within each repository to maintain good disk space utilization and good operating performance. Are there some commands to get some object counts to find out whether it's time to gc?
stackexchange/codereview
As stated in the title, i'm looking for an XML schema (XSD-file) for the Glade markup language? Wikipedia states that Glade is a schema based markup language (list of schemas at wikipedia). I tried to search the web, wikipedia and the glade website,but i couldn't find an XSD for Glade. Thx, Juve
stackexchange/codereview
I see them all the time and always ignore them. Can someone explain to me why they have become so prevalent? If I'm using a site that allows me to explore it via tags (e.g., this one, del.icio.us, etc.) that's what I will do. Why would I need a "cloud" of tags upon which to click? I can just type that tag(s) into a ...
stackexchange/codereview
I'll soon be posting an article on my blog, but I'd like to verify I haven't missed anything first. Find an example I've missed, and I'll cite you on my post. The topic is failed Singleton implementations: In what cases can you accidentally get multiple instances of a singleton? So far, I've come up with: Race Conditi...
stackexchange/codereview
This is what I've got. It works. But, is there a simpler or better way? One an ASPX page, I've got the download link... <asp:HyperLink ID="HyperLinkDownload" runat="server" NavigateUrl="~/Download.aspx">Download as CSV file</asp:HyperLink> And then I've got the Download.aspx.vb Code Behind... Public Partial Class Down...
stackexchange/codereview
In wxPython, if I create a list of radio buttons and place the list initially, is it possible to change the contents in that list later? For example, I have a panel that uses a boxSizer to place the widgets initially. One of those widgets is a list of radio buttons (I have also tried a normal radiobox). I would like to...
stackexchange/codereview
I have a third party .NET Assembly and a large Java application. I need to call mothods provided by the .NET class library from the Java application. The assembly is not COM-enabled. I have searched the net and so far i have the following: C# code (cslib.cs): using System; namespace CSLib { public class CSClass ...
stackexchange/codereview
I want to search for files containing DOS line endings with grep on Linux. Something like this: grep -IUr --color '\r\n' . The above seems to match for literal rn which is not what is desired. The output of this will be piped through xargs into todos to convert crlf to lf like this grep -IUrl --color '^M' . | xargs -...
stackexchange/codereview
I have a simple message box in a WPF application that is launched as below: private void Button_Click(object sender, RoutedEventArgs e) { MessageBox.Show("Howdy", "Howdy"); } I can get white to click my button and launch the message box. UISpy shows it as a child of my window I couldn't work out the method to acc...
stackexchange/codereview
How do you do your own fonts? I don't want a heavyweight algorithm (freetype, truetype, adobe, etc) and would be fine with pre-rendered bitmap fonts. I do want anti-aliasing, and would like proportional fonts if possible. I've heard I can use Gimp to do the rendering (with some post processing?) I'm developing for an ...
stackexchange/codereview
One thing that's really been making life difficult in getting up to speed on the codebase on an ASP classic project is that the include file situation is kind of a mess. I sometimes find the function I was looking for being included in an include file that is totally unrelated. Does anyone have any advice on how to r...
stackexchange/codereview
I know most people think that as a bad practice but when you are trying to make your class public interface only work with references, keeping pointers inside and only when necessary, I think there is no way to return something telling that the value you are looking doesn't exist in the container. class list { pub...
stackexchange/codereview
I'm writing some JavaScript code that needs to fire the click event for a link. In Internet Explorer I can do this var button = document.getElementById('myButton'); button.click(); But this doesn't work in Firefox, and I assume any other browser. In Firefox, I've done this var button = document.getElementById('myB...
stackexchange/codereview
After downloading files from a remote UNIX FTP server, you want to verify that you have downloaded all the files correctly. Minimal you will get information similar to "dir /s" command in Windows command prompt. The FTP client runs on Windows.
stackexchange/codereview
Any other tweaks for making emacs as vim-like as possible would be appreciated as well. Addendum: The main reason I don't just use vim is that I love how emacs lets you open a file in two different frames [ADDED: sorry, this was confusing: I mean separate windows, which emacs calls "frames"]. It's like making a vertic...
stackexchange/codereview
Is there a way to encrypt the data file that mysql uses? I have a mysql server on an open machine, and I would like to encrypt the data file so even if someone copies the data files, they cannot read the data. Thanks
stackexchange/codereview
I need to rename the database but when I do in PGAdmin : ALTER DATABASE "databaseName" RENAME TO "databaseNameOld" it told me that it cannot. How can I do it? (Version 8.3 on WindowsXP) Update The first error message : Cannot because I was connect to it. So I selected an other database and did the queries. I get a se...
stackexchange/codereview
I think I know how to handle this case, but I just want to make sure I have it right. Say you have the following C code: int myInt = 3; int* myPointer = &myInt; int** mySecondPointer = &myPointer; P contains an address that points to a place in memory which has another address. I'd like to modify the second address....
stackexchange/codereview
From a Joel's post on Copilot: Direct Connect! We’ve always done everything we can to make sure that Fog Creek Copilot can connect in any networking situation, no matter what firewalls or NATs are in place. To make this happen, both parties make outbound connections to our server, which relays traffic...
stackexchange/codereview
XML, granted, is very useful, but can be quite verbose. What alternatives are there and are they specialised for any particular purpose? Library support to interrogate the contents easily is a big plus point.
stackexchange/codereview
Possible Duplicate: Pre & post increment operator behavior in C, C++, Java, & C# Here is a test case: void foo(int i, int j) { printf("%d %d", i, j); } ... test = 0; foo(test++, test); I would expect to get a "0 1" output, but I get "0 0" What gives??
stackexchange/codereview
How do you support optimistic / pessimistic concurrency using NHibernate?
stackexchange/codereview
I've actually solved this, but I'm posting it for posterity. I ran into a very odd issue with the DataGridView on my dual-monitor system. The issue manifests itself as an EXTREMELY slow repaint of the control (like 30 seconds for a full repaint), but only when it is on one of my screens. When on the other, the repaint ...
stackexchange/codereview
Take a .Net Winforms App.. mix in a flakey wireless network connection, stir with a few users who like to simply pull the blue plug out occasionally and for good measure, add a Systems Admin that decides to reboot the SQL server box without warning now and again just to keep everyone on their toes. What are the suggest...
stackexchange/codereview
I have just started working with the AnimationExtender. I am using it to show a new div with a list gathered from a database when a button is pressed. The problem is the button needs to do a postback to get this list as I don't want to make the call to the database unless it's needed. The postback however stops the ...
stackexchange/codereview
Are there some principles of organizing classes into namespaces? For example is it OK if classes from namespace N depends on classes from N.X? And if classes from N.X depends on classes from N?
stackexchange/codereview
It says in this article that: Making a class final because it is immutable is a good reason to do so. I'm a bit puzzled by this... I understand that immutability is a good thing from the POV of thread-safety and simplicity, but it seems that these concerns are somewhat orthogonal to extensibility. So, why is immutab...
stackexchange/codereview
I have a following SQL Server 2005 database schema: CREATE TABLE Messages ( MessageID int, Subject varchar(500), Text varchar(max) NULL, UserID NULL ) The column "UserID" - which can be null - is a foreign key and links to the table CREATE TABLE Users ( UserID int, ... ) Now I have several POCO clas...
stackexchange/codereview
I am having some problems reading from a file. I have two header files: a and b. b is derived from a,and c is derived from b. Now i want to open a text file. The whole format is like this: A john A johnee P 123 If the first charcter is 'a' and 'p' is also there, then print the second line, else print the first line. ...
stackexchange/codereview
What is the best way to test my webforms applications? Looks like people are loving Watin, and selenium.
stackexchange/codereview
I would like to be able to render a view and send it as an email, similar to what can be done with Ruby on Rails. What is the best way to do this? EDIT: My solution so far is to use a templating engine (NHaml, StringTemplate.net). It works but I would prefer not to have a second template engine in my site.
stackexchange/codereview
Is there a way to manipulate the speed of the video playback? I'm especially interested in a way to slow down with frame blending, exactly like the function in Final Cut Pro.
stackexchange/codereview
If you need more details, let me know. EDIT: Changed title for clarity purposes.
stackexchange/codereview
I'm referring to distinctions such as in this answer: ...bash isn't for writing applications it's for, well, scripting. So sure, your application might have some housekeeping scripts but don't go writing critical-business-logic.sh because another language is probably better for stuff like that. As programmer who's wo...
stackexchange/codereview
Is it possible to integrate SSRS reports to the webforms..an example will be enough to keep me moving.
stackexchange/codereview
I am running a couple of databases on MySQL 5.0.45 and am trying to get my legacy database to sync with a revised schema, so I can run both side by side. I am doing this by adding triggers to the new database but I am running into problems with replication. My set up is as follows. Server "master" Database "legacydb"...
stackexchange/codereview
I have email addresses encoded with HTML character entities. Is there anything in .NET that can convert them to plain strings?
stackexchange/codereview
I have created a hierarchy of content types. The root of my hierarchy has the content type "Document" as a parent. There are about 20 other content types derived from my root. Now, I want to change the parent from "Document" to something else. Is it possible? Either in the web interface or in code? Can the definition o...
stackexchange/codereview
I'm looking for a simple, easy to understand algorithm to alphabetically sort an array of characters in C.
stackexchange/codereview
I've always been a largely independent learner gleaning what I can from Wikipedia and various books. However, I fear that I may have biased my self-education by inadvertent omission of topics and concepts. My goal is to teach myself the equivalent of an undergraduate degree in Computer Science from a top university (do...
stackexchange/codereview
Or is it now the other way around? From what I've heard there are some areas in which C# proves to be faster than C++, but I've never had the guts to test it by myself. Thought any of you could explain these differences in detail or point me to the right place for information on this.
stackexchange/codereview
I was wondering how i can force a user who has requested a page using Http to use the secure https version? I am using Websphere 6.1 as my application server and Rad 7 as my development environment Thanks Damien
stackexchange/codereview
What number of classes do you think is ideal per one namespace "branch"? At which point would one decide to break one namespace into multiple ones? Let's not discuss the logical grouping of classes (assume they are logically grouped properly), I am, at this point, focused on the maintainable vs. not maintainable number...
stackexchange/codereview
First, I'd like to establish the acceptable end-to-end latency for a real-time system in the financial world is less than 200ms. Okay, here's what I'm after. In the design of real-time systems, there are "design patterns" (or techniques) that will increase the performance (i.e. reduce processing time, improve scalabili...
stackexchange/codereview
What are (if any)the implied assumptions or restrictions and the differences of designing like: A) this: class SampleClass1 { IWorker workerA; IWorker workerB; void setWorkerA(IWorker w); void setWorkerB(IWorker w); WorkResult doWork(); } B) versus this: class SampleClass2 { WorkResult doWork(...
stackexchange/codereview
I have the following string array: var sa = new string[] {"yabba","dabba","doo"}; I can convert it to "yabba, dabba, doo" it using string.Join() but what is the super-cool LINQ way of doing it? The Join extension method seems promising but for a novice like me very confusing.
stackexchange/codereview
I am trying to find a way to disable Design / Split views from appearing in Visual Studio. I figure there's no way to completely disable it, but I still can't seem to find a way to remove the shortcut (F7), or remove the buttons from the bottom bar.
stackexchange/codereview
That's the question: Which library can help me to access data available via WebDAV in my Java-programs? OpenSource is preferred.
stackexchange/codereview
Wanting to implement authentication by client certificates I am experiencing some issues. First some facts The whole site is using SSL. I am using IIS 6 (on Windows Server 2003) and have configured the site to accept client certificates, not requiring them. Most browsers are however implemented in a way so that they wi...
stackexchange/codereview
We use BigIP to load balance between our two IIS servers. We recently deployed a WCF service hosted on by IIS 6 onto these two Windows Server 2003R2 servers. Each server is configured with two host headers: one for the load balancer address, and then a second host header that points only to that server. That way we ...
stackexchange/codereview
My boss asked me to setup a Subversion server for him to use so that he can share all his documents across different machines in sync and still be able to access them when there is no Internet connection. I have this up for him, but now he's requesting that the 'create date' file attribute be preserved. I explained th...
stackexchange/codereview
Java Newbie here. I have a JFrame that I added to my netbeans project, and I've added the following method to it, which creates a JTable. Problem is, for some reason when I call this method, the JTable isn't displayed. Any suggestions? public void showFromVectors(Vector colNames, Vector data) { jt = new javax....
stackexchange/codereview
I've been too lax with performing DB backups on our internal servers. Is there a simple command line program that I can use to backup certain databases in SQL Server 2005? Or is there a simple VBScript?
stackexchange/codereview
For example, I have an ASP.NET form that is called by another aspx: string url = "http://somewhere.com?P1=" + Request["param"]; Response.Write(url); I want to do something like this: string url = "http://somewhere.com?P1=" + Request["param"]; string str = GetResponse(url); if (str...) {} I need to get whatever Respon...
stackexchange/codereview
What algorithm does twitter use to determine the 10 topics that you can see at search.twitter.com? I would like to implement that algorithm and I would also like to show the 50 most popular topics (instead of 10). Can you describe the most efficient algorithm? Thanks! (Twitters API can be found at- http://apiwiki.twitt...
stackexchange/codereview
When I try the following lookup in my code: Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup("java:comp/env"); return (DataSource) envCtx.lookup("jdbc/mydb"); I get the following exception: java.sql.SQLException: QueryResults: Unable to initialize naming context: Name java:comp i...
stackexchange/codereview
Is there a Java package providing funcionality like the .Net System.Data namespace ? Specificaly the DataSet and Adaptor classes ?
stackexchange/codereview
I am having trouble deciding on whether to classify my application as 'real time' or 'near real time', or perhaps even something else. The software receives data immediately as it is generated from the source, then based on certain rules, raises an alert when certain conditions are met. It takes the approach of checkin...
stackexchange/codereview
I have a memory buffer corresponding to my screen resolution (1280x800 at 24-bits-per-pixel) that contains my screen contents at 24bpp. I want to convert this to 8-bpp (ie. Halftone color palette in Windows). I currently do this: 1. Use CreateDIBSection to allocate a new 1280x800 24-bpp buffer and access it as a DC, as...
stackexchange/codereview
I have a dilemma, I'm using Java and Oracle and trying to keep queries on PL/SQL side. Everything is OK, until I have these complex queries which may and may not have conditions. It's not hard in Java to put together WHERE clause with conditions, but it's not nice. And on PL/SQL side I also found out that the only pos...
stackexchange/codereview
I have a stored procedure that consists of a single select query used to insert into another table based on some minor math that is done to the arguments in the procedure. Can I generate the plan used for this query by referencing the procedure somehow, or do I have to copy and paste the query and create bind variable...
stackexchange/codereview
We are using SQL 2005 and the try-catch functionality to handle all of our error handling within the DB. We are currently working on deploying a .NET CLR function to make some WCF calls in the DB. This WCF procedure is written in the CLR and then deployed to SQL. If I put a try-catch block in the CLR code, it catches t...
stackexchange/codereview
I have developed some custom DAO-like classes to meet some very specialized requirements for my project that is a server-side process that does not run inside any kind of framework. The solution works great except that every time a new request is made, I open a new connection via MySQLdb.connect. What is the best "...
stackexchange/codereview
OK, I have been working on a random image selector and queue system (so you don't see the same images too often). All was going swimmingly (as far as my crappy code does) until I got to the random bit. I wanted to test it, but how do you test for it? There is no Debug.Assert(i.IsRandom) (sadly) :D So, I got my brain on...
stackexchange/codereview
Does someone know of any port to VS2008 of the support for snippets for C++? VS2005 had a nice enhancement pack: Microsoft Visual Studio 2005 IDE Enhancements But the snippets for C++ feature is not supported in VS2008. I already tryed to use the SDK to reimplement it but gave up out of lack of time since are a huge nu...
stackexchange/codereview
I'm a bit lost here and I can't find much documentation.
stackexchange/codereview
I have a TemplateField in a DetailsView and its input should be one of a few choices in a lookup table. Currently it's a text field, but I want it to be a group of radio buttons, and it should work in both insert and edit mode (the correct current value should be selected in edit mode). How do I create mutually exclusi...
stackexchange/codereview
I have a Python module installed on my system and I'd like to be able to see what functions/classes/methods are available in it. I want to call the help function on each one. In Ruby I can do something like ClassName.methods to get a list of all the methods available on that class. Is there something similar in Python?...
stackexchange/codereview
I'm attempting to do an AJAX call (via JQuery) that will initiate a fairly long process. I'd like the script to simply send a response indicating that the process has started, but JQuery won't return the response until the PHP script is done running. I've tried this with a "close" header (below), and also with output b...
stackexchange/codereview
What happens if I use SHGetFolderPath api call in a 32 bit system with CSIDL_PROGRAM_FILESx86 folder id instead of the CSIDL_PROGRAM_FILES id? Theoretically CSIDL_PROGRAM_FILESx86 should map to C:\program files (x86) in a 64 bit system but what does it map to in a 32 bit system where this path doesn't exist?
stackexchange/codereview
Sometimes coloring a logfile or other gives a good overview when looking for stuff and behaviors I just saw that grep have a coloring feature grep -C 99999 --color <regexp> <filename> What other methods are there?
stackexchange/codereview
First of all, I'm fairly sure snapping to grid is fairly easy, however I've run into some odd trouble in this situation and my maths are too weak to work out specifically what is wrong. Here's the situation I have an abstract concept of a grid, with Y steps exactly Y_STEP apart (the x steps are working fine so ignore t...
stackexchange/codereview
I'd like to automatically change my database connection settings on a per-vhost basis, so that I don't have to edit any PHP code as it moves from staging to live and yet access different databases. This is on a single dedicated server. So I was wondering, can I set a PHP variable or constant in httpd.conf as part of th...
stackexchange/codereview
I'm using .NET 3.5. I have two string arrays, which may share one or more values: string[] list1 = new string[] { "apple", "orange", "banana" }; string[] list2 = new string[] { "banana", "pear", "grape" }; I'd like a way to merge them into one array with no duplicate values: { "apple", "orange", "banana", "pear", "gr...
stackexchange/codereview
I am trying to figure out this: c = 1 def f(n): print c + n def g(n): c = c + n f(1) # => 2 g(1) # => UnboundLocalError: local variable 'c' referenced before assignment Thanks!
stackexchange/codereview