instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
How can I use Hyperlink button in gridview. I mean when I run my program,all data is displayed in gridview,but I want hyperlink in gridview, so that when I will click in hyperlink it will show the select path which is in gridview : if there is pdf file path and I just click on this hyper link then I can see the pdf fil...
stackexchange/codereview
For example, suppose I have a batch file called 'test.cmd' and it simply contains: echo %1 I can call this directly from the command prompt with 'test.cmd some¬arg' and the result is that the string 'some¬arg' is printed. However if I place that same call in a second batch file, called 'tester.cmd' for the sake of arg...
stackexchange/codereview
I'm looking to re-organize the way we release our internal software. All of the code (PHP webapps, some Java apps and Perl scripts) is checked into Subversion repositories but there are no branches or tags, everything is checked into trunk (only around 1-3 devs per app). On the production linux servers, the software is...
stackexchange/codereview
Is there a way to find the number of lines of code used in an MS-Access database?
stackexchange/codereview
Which sql data type should we use for number bases primary key: int bigint numeric float
stackexchange/codereview
I am having some trouble manipulating images using CodeIgniter 1.7. With the following code, the image is uploaded correctly. Alas, instead of a new image being made, and then modified; the existing image is modified. Any help? //Upload image first $config['upload_path'] = './uploads/'; $config['allowed_types'] = 'gif...
stackexchange/codereview
At work we do almost everything in Java and perl, but I wanted to build out a feature using PHP and sessions. Some peeps thought that it was a bad idea to try to do PHP sessions on our system, cause it's distributed to many servers. What would the specific problem be?
stackexchange/codereview
Please forgive my long question. I have an idea for a design that I could use some comments on. Is it a good idea to do this? And what are the pit falls I should be aware of? Are there other similar implementations that are better? My situation is as follows: I am working on a rewrite of a windows forms application tha...
stackexchange/codereview
I would like to hear some opinions about using the isolated storage in Silverlight for storing sensitive data. For example, is it OK to store an authentication token (some GUID that identifies a server-side session) in this storage, or is it better to use cookies? The isolated storage gives an advantage over cookies in...
stackexchange/codereview
The event returns a standardized timestamp in the format of "Sat Oct 25 21:55:29 +0000 2008" How can I compare this with the current time in PHP so that it gives me the result in a form like "It has been 15 minutes!" or "It has been three days!" Also, how can I get the current time?
stackexchange/codereview
Photoshop has that great: BiCube Shaper option for resizing. However I cannot find an equivalent. I've seen various code using GD that used imagecopyresampled and custom unsharp mask, but no where near the quality I am expecting. Any help?
stackexchange/codereview
How can I create a query for a full outer join across a M2M relationchip using the django QuerySet API? It that is not supported, some hint about creating my own manager to do this would be welcome. Edited to add: @S.Lott: Thanks for the enlightenment. The need for the OUTER JOIN comes from the application. It has to ...
stackexchange/codereview
All numbers that divide evenly into x. I put in 4 it returns: 4, 2, 1 edit: I know it sounds homeworky. I'm writing a little app to populate some product tables with semi random test data. Two of the properties are ItemMaximum and Item Multiplier. I need to make sure that the multiplier does not create an illogical ...
stackexchange/codereview
I'm writing a license agreement dialog box with Win32 and I'm stumped. As usual with these things I want the "accept/don't accept" buttons to become enabled when the slider of the scroll bar of the richedit control hits bottom, but I can't find a way to get notified of that event. The earliest I've been able to learn...
stackexchange/codereview
we have users in each region of the world. I would like to create an environment picker that shows up a map on the form and has a link for each region. So if i was in NY i would click NY and would get the NY environment. Any ideas of doing this dynamically in winforms as opposed to having a static map image.
stackexchange/codereview
Is there any good resource (book, reference, web site, application...) which explains how to compute time complexity of an algorithm? Because, it is hard to make the things concrete in my mind. Sometimes it is talking about an iteration has time complexity of lg n; and then according to the another loop it becomes n.lg...
stackexchange/codereview
I've decided to add auto-update functionality to one of my applications and was looking for any existing solutions that compare the current running version with the latest version that is then downloaded from the web. I know Sparkle on Mac OSX which is very nice and powerful, but was wondering whether there is somethin...
stackexchange/codereview
How to get all the database names and corresponding table names together ?
stackexchange/codereview
In my Direct3D application, the camera can be moved using the mouse or arrow keys. But if I hard code (0,1,0) as the up direction vector in LookAtLH, the frame goes blank at some orientations of the camera. I just learned the hard way that when looking along the Y-axis, (0,1,0) no longer works as the Up direction (seem...
stackexchange/codereview
can you please tell me which add-in you are using to generate real/integer values in Excel 2007 (running on Vista SP1)? I have tried a couple of them and particularly Random Generator from AbleBits.com but there are some problems with entering lowest and highest values there. I guess this is due to Office 2007 & Vista...
stackexchange/codereview
VS2008 Code Analysis will flag a spelling mistake in an identifier using the IdentifiersShouldBeSpelledCorrectly warning type. This process is using an American dictionary by default because words are being flagged that are correctly spelt using the British spelling. For example, words like "Organisation" and "Customis...
stackexchange/codereview
What is the best way of storing data out to a file on a network, which will be later read in again programmatically. Target platform for the program is Linux (Fedora), but it will need to write out a file to a Windows (XP) machine This needs to be in C++, there will be a high number of write / read events so it needs t...
stackexchange/codereview
I'm thinking about learning CAS, but I need to quickly grasp basic architecture, performance implications and if it at all suits my needs. What should I read?
stackexchange/codereview
What is the best way to store a large number of data points? For example temperature values which are measured every minute over lots of locations? SQL databases with one row per data points doesn't seem very efficient.
stackexchange/codereview
I am looking for resources on Microsoft Sync Framework. Although MSDN and Google Search gave me the brief overview, I want some demos and presentations. Also, is Live Mesh based on Sync Framework?
stackexchange/codereview
Is there some additional configuration needed before I can set thread priorities in a Windows service? In my service, I have a few threads that each call the CreateProcess() function to launch an external application. I would like to adjust thread (or process) priorities to normal or lower, depending on some other fac...
stackexchange/codereview
Are there any third party enterprisey data grid controls out there, alla JIDE Data Grid? Is there a website like torry.net that lists third party java controls? Google doesn't turn up much for and I thought there would be a lot of both considering how popular java seems to be. TIA
stackexchange/codereview
There are several application systems that pass messages to each other as part of their work process. Due to technical constraints revolving transactional integrity, the application data and message delivery are all committed into a single mainframe DB2 database. The messages are not directly passed to BizTalk server (...
stackexchange/codereview
Which performs better: Crystal Reports or SQL Server Reporting Services?
stackexchange/codereview
I am interested if it's safe to install both TortoiseCVS and TortoiseSVN on the same computer? All our corporate projects are controlled by CVS, but I want to use SVN for my personal documents (and TortoiseSVN as client). Is it possible? Thanks!
stackexchange/codereview
I have a class that contains a dynamically allocated array, say class A { int* myArray; A() { myArray = 0; } A(int size) { myArray = new int[size]; } ~A() { // Note that as per MikeB's helpful style critique, no need to check against 0. delete [] myArr...
stackexchange/codereview
I have created a base class A and a class B is a derived class inherited from class A. Both classes are marked as Serialized. When I try to return an object of type B through a web method i am getting following error: System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was u...
stackexchange/codereview
I am working on a PHP application that intends to ease company workflow and project management, let's say something like Basecamp and GoPlan. I am not sure on what the best approach is, database-wise. Should I use a single database and add client-specific columns to each of the tables, or should I create a database for...
stackexchange/codereview
The following javascript should setup an interval so a new item from the list of json objects will be added to the top of the list slowly, but instead they are all added at the same time. <script type="text/javascript"> var json; var count = 0; $(document).ready(function() { $.ajax({ typ...
stackexchange/codereview
I am using a 3rd party API which is defined in 2 DLLs. I have included those DLLs in my project and set references to them. So far so good. However, these DLLs have at least one dependent DLL which cannot be found at runtime. I copied the missing DLL into the project and set the 'Copy to output' flag but without succe...
stackexchange/codereview
When I refer to nested set model I mean what is described here. I need to build a new system for storing "categories" (I can't think of better word for it) in a user defined hierarchy. Since the nested set model is optimized for reads instead of writes, I decided to use that. Unfortunately during my research and test...
stackexchange/codereview
I need to install a file into the Environment.SpecialFolder.ApplicationData folder, which differs between XP and Vista. Is there a built in way to reference the correct folder in WiX or will I have to use conditional checks for OS and do it manually? If I have to do the latter, how do I reference the current windows us...
stackexchange/codereview
I've got some experience with Bash, which I don't mind, but now that I'm doing a lot of Windows development I'm needing to do basic stuff/write basic scripts using the Windows command-line language. For some reason said language really irritates me, so I was considering learning Python and using that instead. Is Pytho...
stackexchange/codereview
I need to get a list of all documents in a site collection, which I believe I can do with either the alldocs table or the alluserdata table (MOSS 2007 SP1) but do not see how I can get the author information for the document. I do not need the contents of the document (e.g. AllDocStreams content) Something like this:...
stackexchange/codereview
How do you connect to a remote server via IP address in the manner that TOAD, SqlDeveloper, are able to connect to databases with just the ip address, username, SID and password? Whenever I try to specify and IP address, it seems to be taking it locally. In other words, how should the string for cx_Oracle.connect() be ...
stackexchange/codereview
What is the equivalent to the C# "!" operator in F#?
stackexchange/codereview
I know that you can do this in SQL Server 2005, but I'm at a loss for 2000.
stackexchange/codereview
While using Vim (at home and at work), I often find myself doing similar things repeatedly. For example, I may turn a bunch of CSV text into a series of SQL inserts. I've been using Vim for years, but only recently have I tried to seriously think about how I could improve my productivity while using it. My question is....
stackexchange/codereview
Having a vector containing pointers to objects then using the clear function doesn't call the destructors for the objects in the vector. I made a function to do this manually but I don't know how to make this a generic function for any kind of objects that might be in the vector. void buttonVectorCleanup(vector<Button ...
stackexchange/codereview
Right now our test and production databases are on the same server, but with different names. Deploying has meant editing Web.config to change all the connection strings for the correct database. A step which I forget all too frequently... We've finally created a new database server for testing, and I'm moving the d...
stackexchange/codereview
I would like to find out where I would be able to find the MP3 library, for implementation in an Operating System.
stackexchange/codereview
Which Inversion of control (IoC) containers support .NET 1.1?
stackexchange/codereview
I need to call a VBScript file (.vbs file extension) in my C# Windows application. How can I do this? There is an add-in to access a VBScript file in Visual Studio. But I need to access the script in code behind. How to do this?
stackexchange/codereview
I'm creating a cms and have not yet settled on the matter of where to store the complete url for a given page in the structure. Every page have a slug (url friendly name of the page) and every page has a nullable (for top-level pages) parent and children. Where do I store the complete url (/first-page/sub-page) for a g...
stackexchange/codereview
Lets say on MySQL database (if it matters).
stackexchange/codereview
I have a property called "IsSecureConnection" that is part of my object's interface. This makes sense for most implementations of the interface, however, in some implementations I would like to make the property ReadOnly. Should I omit this property from the object's interface even though it is required by all of th...
stackexchange/codereview
We have a situation where a C# application is working with SQL CE 3.5 . To allow for a legacy program to use some of its features we have produced a C++ dll which uses interop to extract the info that it needs from the C# program. For this to work, the C#-program needs to access the database. Its not a very complex sce...
stackexchange/codereview
I have form area in my view. If I click button A, I want to submit to /Books/1 and if I click button B, I want to submit to /Books/2 How do I achieve this with MVC?
stackexchange/codereview
I have a database table named call with columns call_time, location, emergency_type and there are three types of emergency: paramedics, police and firefighters. In the windows form I created CheckBoxes 'paramedics', 'police', 'firefighters' and I want to retrieve all table columns which meet user's selection. I created...
stackexchange/codereview
Today somebody told me that interface implementation in C# is just "Can-Do" relationship, not "Is-A" relationship. This conflicts with my long-time believing in LSP(Liskov Substitution Principle). I always think that all inheritance should means "Is-A" relationship. So, If interface implementation is just a "Can-Do" r...
stackexchange/codereview
I need to add a row to a spreadsheet using VBScript on a PC that does not have Microsoft Office installed. I tried [Set objExcel = CreateObject("Excel.Application")] Since Excel does not exist on the PC I cannot create this object. Is there a way to modify a spreadsheet without Excel?
stackexchange/codereview
Is there a Python class that wraps the file interface (read, write etc.) around a string? I mean something like the stringstream classes in C++. I was thinking of using it to redirect the output of print into a string, like this sys.stdout = string_wrapper() print "foo", "bar", "baz" s = sys.stdout.to_string() #now s =...
stackexchange/codereview
Hey all, This is my first question here! I'm trying to setup custom error pages in my JBoss RESTful web service. I'm starting with the 400 error, so in my web.xml I've added <error-page> <error-code>400</error-code> <location>/400.html</location> </error-page> and I've placed 400.html at the root of my war fi...
stackexchange/codereview
I don’t have advanced knowledge in JavaScript, and I am trying to learn how to use Ext JS framework in ASP.NET (C# or VB.NET) environment. I’ve got couple of samples, but was unable get the project working. Is there such as website or book so I can go a read up about Ext JS in more details and how can I include this in...
stackexchange/codereview
What are the key use cases for the use of virtualization -- that is, running one or more "virtual PCs" using software such as VMWare and Microsoft Virtual PC -- for software development? Also -- are there other instances/uses of virtualization that aren't covered by my definition above (use of a tool like MS Virtual PC...
stackexchange/codereview
Are there any limitations on the amount of memory that the Flash player can use? If you have a SWF that over time gets a lot of data from the server, then more and more data will be kept in memory. Is there a limitation on this?
stackexchange/codereview
We use a simple object model for our low level networking code at work where struct pointers are passed around to functions which are pretending to be methods. I've inherited most of this code which was written by consultants with passable C/C++ experience at best and I've spent many late nights trying to refactor code...
stackexchange/codereview
I have built the IronPythonIntegration solution that comes with the Visual Studio 2005 SDK (as explained at http://www.izume.com/2007/10/13/integrating-ironpython-with-visual-studio-2005), and I can now use IronPython projects inside Visual Studio 2005. However, to let a Python file import from the standard library I n...
stackexchange/codereview
I am using Oracle 10g R2. Recently, after rebooting the server, I started having a problem where I couldn't connect to the instance. I am only connecting locally on the server itself. Oddly enough, the issue corrects itself if I start the Database Administration Assistant, and select my instance to supposedly change ...
stackexchange/codereview
i'm trying to change the number of rows in a TableLayoutPanel programatically (sometimes it needs to be four, sometimes five, and rarely six). Unfortunatly changing the number of rows does not keep the RowStyles collection in sync, so you are then not able to set the height of the newly added rows. The following test c...
stackexchange/codereview
I used a class which derives from CListBox, and create it with following: style:WS_CHILD|WS_VISIBLE |LBS_OWNERDRAWFIXED | WS_VSCROLL | WS_HSCROLL I expect the ListBox's item to be have a fixed size, not affected by the size of the list box. So I override the MeasureItem() method, in which I specify the item's size lik...
stackexchange/codereview
I've tried a couple of approaches to update a column in a mySQL database table from another table but am not having any luck. I read somewhere that version 3.5.2 does not support multi-table updates and I need a code-based solution - is that correct? If not can anybody point me in the right direction using sql? UPDAT...
stackexchange/codereview
If you want to some code to execute based on two or more conditions which is the best way to format that if statement ? first example:- if(ConditionOne && ConditionTwo && ConditionThree) { Code to execute } Second example:- if(ConditionOne) { if(ConditionTwo ) { if(ConditionThree) { Code to e...
stackexchange/codereview
I am generating the json from PHP.
stackexchange/codereview
I just got hold of a PDA (Samsung Omnia i900) with an embedded motion sensor (accelerometer) and would like to code something that would exploit this feature. Any pointers?
stackexchange/codereview
I have WPF ListBox which is bound to a ObservableCollection, when the collection changes, all items update their position. The new position is stored in the collection but the UI does not update. So I added the following: void scenarioItems_CollectionChanged(object sender, System.Collections.Specialized.NotifyColle...
stackexchange/codereview
I am interested in mastering prefetch-related functions such as _mm_prefetch(...) so when I perform operations that loop over arrays, the memory bandwidth is fully utilized. What are the best resources for learning about this? I am doing this work in C using GCC 4 series on an intel linux platform.
stackexchange/codereview
I am trying to add different styles within a textarea eg bold, different colors etc WYSIWYG editors (eg tinyMCE) used in web pages typically do this but I am having trouble working out how they do it. You cannot do this: alt text http://www.yart.com.au/test/html.gif So how do they achieve it?
stackexchange/codereview
I'm creating a really complex dynamic sql, it's got to return one row per user, but now I have to join against a one to many table. I do an outer join to make sure I get at least one row back (and can check for null to see if there's data in that table) but I have to make sure I only get one row back from this outer jo...
stackexchange/codereview
Three buttons, Save, Cancel, Close looks messy, yet after the user has saved the data should they really click a Cancel button? I need the 'Save' button to leave the form open. What is best practice? Thanks
stackexchange/codereview
I have a page that contains a user control that is just a personalized dropdown list . I assign to each item the attribute onClick=__doPostBack('actrl',0). when I click the page postback fine and I got the expected results. However in IE6 my page doesn't change to the new values loaded from the server. The weird thing...
stackexchange/codereview
What's the best algorithm for comparing two arrays to see if they have the same members? Assume there are no duplicates, the members can be in any order, and that neither is sorted. compare( [a, b, c, d], [b, a, d, c] ) ==> true compare( [a, b, e], [a, b, c] ) ==> false compare( [a, b, c], [a,...
stackexchange/codereview
I am currently try to use the sutekishop .Net CMS product but am getting the error "Could not load type 'System.Web.HttpContextWrapper2'..." Is this an MVC assembly mismatch? i have uninstalled mvc 5 and installed 3 (required according to the set up) but am still getting the issues. Any ideas? Rhys Full error: Could n...
stackexchange/codereview
How can I count operations in C++? I'd like to analyze code in a better way than just timing it since the time is often rounded to 0 millisec.
stackexchange/codereview
I'm having a bit of a problem. I have a datatable in the parent form. I open a dialogbox form that gets the datatable property and creates a checkboxlist. This will be used to export those columns. But when I run the application the parentform property is null. I've tried setting it in the parent and dialogbox form (I ...
stackexchange/codereview
I'm trying to get this sample for AJAX to WCF working, with the following code. When viewed in FF, nothing is displayed, and when viewed in IE, the time is displayed. I'm using IIS 7, btw. function getTime() { TimeService.TimeService.GetTimeFormatted("dd-mm-yyyy [hh:mm:ss]", onMethodCompleted, ...
stackexchange/codereview
Delphi (and probably a lot of other languages) has class helpers. These provide a way to add extra methods to an existing class. Without making a subclass. So, what are good uses for class helpers?
stackexchange/codereview
I am developing a java web app using servlet, in order to prevent user from hitting the back button to see previous users' info, I have the following code : protected void processRequest(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { HttpSessi...
stackexchange/codereview
I have lots of files in different formats (mostly pdf files) and I need to check if they can be opened without errors and get a list of those that are broken. Other than opening them all separately is there a way to find out which won't open / are corrupt?
stackexchange/codereview
So, my question is how do people get the word out that their website or blog exists? Do blogger invest in ads? Is is just through word of mouth? Or searching Google? I'm just curious how does a website build it's popularity. Do you just put your website up on the web and hope people find it? I know you can make your si...
stackexchange/codereview
How do I enable assembly bind failure logging (Fusion) in .NET?
stackexchange/codereview
I used the command line "arp -s IP MAC" command to set a static ARP entry on Windows Server 2003. When I ran "arp -a" it was there as a "static" entry. When I restart, it is gone. Is there some file somewhere like lmhosts where I can make this absolutely permanent? Thanks!
stackexchange/codereview
Up until now I have been using std::string in my C++ applications for embedded system (routers, switches, telco gear, etc.). For the next project, I am considering to switch from std::string to std::wstring for Unicode support. This would, for example, allow end-users to use Chinese characters in the command line inter...
stackexchange/codereview
After reading Martin Fowler's Mocks Aren't Stubs, I've discovered I've been practicing TDD in the "mockist" fashion. But I'm wondering if even in mockist TDD if one can take mocking too far. Here's an updated example in Python-style pseudo-code: def sync_path(self): if self.confirm_or_create_connection(): s...
stackexchange/codereview
I have a class that subclasses NSMutableArray. I init it using: MyClass class = [MyClass arrayWithContentsOfFile:path]; When i try to access any of my subclass methods the app crashes with this error: -[NSCFArray loadCards]: unrecognized selector sent to instance 0x454a30 * Terminating app due to uncaught exceptio...
stackexchange/codereview
I need to set up this scenario: A SQL Server 2005 database will create a transactional replication subscription from another database to populate a set of lookup tables. These lookup tables will then be published as a merge replication publication to the client's SQL Server Mobile. I remember seeing a similar scenar...
stackexchange/codereview
For simplicity lets say I have two flex mxml pages. form.mxml button.mxml If the form.mxml page had the following code, it should work fine: <custom:SelectView dSource="{_thedata}" id="form" visible="false"> </custom:SelectView> <mx:LinkButton label="Show" id="lbShow" click="form.visible=true;> <mx:LinkButton label="...
stackexchange/codereview
Say I've got a class like this: class Test { int x; SomeClass s; } And I instantiate it like this: Test* t = new Test; Is x on the stack, or the heap? What about s?
stackexchange/codereview
Let me start by saying I'm a huge fan of the elegance of this pattern -- I have a group of basic entities that I have implemented builders for (specifically for testing). However I have found (and this may be the caveat) that as my program evolved I kept having to go back and re-work the builders. In the end, it real...
stackexchange/codereview
I've been teaching myself Objective-C over the past month or so (I'm a Java head) and I've got my brain wrapped around most of it now. One thing that's confusing me at the moment: What's the difference between importing a class via @class vs doing a #import? Is one better than another one, or do I need to use one inst...
stackexchange/codereview
When I've worked a bit with my source code, I did my usual thing commit and then I pushed to a remote repository. But then I noticed I forgot to organize my imports in the source code. So I do the amend command to replace the previous commit: > git commit --amend Unfortunately the commit can't be pushed back to the re...
stackexchange/codereview
I'm looking for a an R package which can be used to train a Dirichlet prior from counts data. I'm asking for a colleague who's using R, and don't use it myself, so I'm not too sure how to look for packages. It's a bit hard to search for, because "R" is such a nonspecific search string. There doesn't seem to be anyth...
stackexchange/codereview
In my website, users have the possibility to store links. During typing the internet address into the designated field I would like to display a suggest/autocomplete box similar to Google Suggest or the Chrome Omnibar. Example: User is typing as URL: http://www.sta Suggestions which would be displayed: http://www.stap...
stackexchange/codereview
In SQL it is easy to do a join and only return the columns you want from the joined table. What is the best way to map this in JPA / Hibernate? For example, there is a Folder entity mapped to the EMAIL_FOLDER and an Email entity mapped to the EMAIL table. There is a one-to-many relationship from Folder to Email. The Em...
stackexchange/codereview
Obviously I could create a Calendar object with the date and use get(DAY) on it, but knowing Groovy, I would guess there is an easier, quicker way I just don't know about? Answer (date1..date2).size() == 1 // true if two dates are on same calendar day
stackexchange/codereview