instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
(another post here reminded me of this annoyance! this is not a dup!) I use VS2008 with multiple monitors. I have VS open on one and the app I'm debugging, reference pages, etc.. on the other. The problem is when I open a find window (Ctrl-F or click on the "Find in Files" icon) the window opens smack-dab in the mi...
stackexchange/codereview
How do I add a "last" class on the last <li> within a Views-generated list?
stackexchange/codereview
I have an OWL ontology and I am using Pellet to do reasoning over it. Like most ontologies it starts by including various standard ontologies: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" ...
stackexchange/codereview
I need to index up to 500,000 entries for fastest read. The index needs to be rebuilt periodically , on disk. I am trying to decide between a simple file like a hash on disk or a single table in an embedded database. I have no need for an RDBMS engine.
stackexchange/codereview
I'm looking for a wiki that I can use to track requirements for a project, but we would like to be able to export the wiki (with formatting) to Microsoft Word. Does anyone know of a wiki that does this?
stackexchange/codereview
I have a VPS host running 3 sites using Ubuntu Hardy. I've spent much time setting it up. That includes all the installation + configuration and stuff. What ways are there to do backup + restore for VPS?
stackexchange/codereview
I have been in both situations: Creating too many custom Exceptions Using too many general Exception class In both cases the project started OK but soon became an overhead to maintain (and refactor). So what is the best practice regarding the creation of your own Exception classes?
stackexchange/codereview
I'm looking at using OpenID for my authentication scheme and wanted to know what the best .NET library is to use for MVC specific applications? thx
stackexchange/codereview
I really enjoyed Jeff's post on Spartan Programming. I agree that code like that is a joy to read. Unfortunately, I'm not so sure it would necessarily be a joy to work with. For years I have read about and adhered to the "one-expression-per-line" practice. I have fought the good fight and held my ground when many progr...
stackexchange/codereview
When using custom-draw (NM_CUSTOMDRAW) to draw the entire contents of a ListView SubItem (in Report/Details view), it would be nice to be able to apply the same left and right padding in my custom paint method that is applied by the control itself for non-custom-drawn items. Is there a way to programmatically retrieve ...
stackexchange/codereview
Starting a new project and would like to use one of the MVC framworks. ASP.NET MVC is still in preview but Spring.net is in production and has a history with Java. I'd like to know the general lowdown between the two. Current questions.. What are the major feature differences? What about deployment/hosting issues? Fu...
stackexchange/codereview
I'm working with the SerialPort class in the Compact Framework, but I can't recive more than 2047 bytes. Exists any limit for the amount of bytes that I can recive? or How can I setup the object? I was trying with the WriteBufferSize and ReadBufferSize properties but they didn't work.
stackexchange/codereview
Given a datetime.time value in Python, is there a standard way to add an integer number of seconds to it, so that 11:34:59 + 3 = 11:35:02, for example? These obvious ideas don't work: >>> datetime.time(11, 34, 59) + 3 TypeError: unsupported operand type(s) for +: 'datetime.time' and 'int' >>> datetime.time(11, 34, 59) ...
stackexchange/codereview
I just installed Glassfish V2 on my local machine just to play around with it. I was wondering if there is a way to retrieve a param passed in by the GET HTTP method. For instance, http://localhost:8080/HelloWorld/resources/helloWorld?name=ABC How do I retrieve the "name" param in my Java code?
stackexchange/codereview
I'm trying to integrate running Fitnesse tests from MSBuild im my nightly build on TFS. In an attempt to make it self contained I would like to start the seleniumRC server only when it's needed from fitness. I've seen that there is a "Command Line Fixture" but it's written in java can I use that?
stackexchange/codereview
What techniques can be applied to detect Polymorphic and Metamorphic viruses? How difficult is to implement these techniques? Are these techniques being applied in modern day anti-virus softwares?
stackexchange/codereview
I have users who are using "secure-wave" security. Evidently it is some sort of white-listing application monitor. With my click-once application, the name of the folders that are used are runtime generated, so the administrators are not able to properly whitelist the application and its files. Any suggestions?
stackexchange/codereview
What is the easiest way to merge XML from two distinct DOM Documents? Is there a way other than using the Canonical DataReader approach and then messing with the outputted DOM. What I basically want is to AppendChild to XmlElements without getting: The node to be inserted is from a different document context. Here i...
stackexchange/codereview
I've found some examples using the Win32 api or simulating the ^+ button combination (ctrl-+) using SendKeys, but at least with the SendKeys method the listview grabs the cursor and sets it to an hourglass until I hit the start button on my keyboard. What is the cleanest way to do this?
stackexchange/codereview
I get this error on an update panel within a popupControlExtender which is within a dragPanelExtender. I see that a lot of other people have this issue and have various fixes none of which have worked for me. I would love to hear a logical explanation for why this is occurring and a foolproof way to avoid such issues i...
stackexchange/codereview
I'm working on a web page where I'm making an AJAX call that returns a chunk of HTML like: <div> <!-- some html --> <script type="text/javascript"> /** some javascript */ </script> </div> I'm inserting the whole thing into the DOM, but the JavaScript isn't being run. Is there a way to run it? Some detail...
stackexchange/codereview
Is there a way to combine a previous translation when extracting the csv file from an application? Or any other tool that could do this job for me? I can’t really see how could i use locbaml if i had to translate everything from scratch every time i add a new control in my application.
stackexchange/codereview
I'm looking for publications about the history of the internet browsers. Papers, articles, blog posts whatever. Cannot find anything on ACM IEEE etc. and my blog search also didn't reveal anything remarkable.
stackexchange/codereview
I need to build a simple, single user database application for Windows. Main requirements are independence from windows version and installed software. What technologies (language/framework) would you recommend? My preference for language is the Visual Basic. EDIT: What about VB.Net and SQL Server Compact Edition?
stackexchange/codereview
When working on a project, after the interesting parts are coded, my motivation is severely diminished. What do you do to get over this problem?
stackexchange/codereview
There is a limitation on Windows Server 2003 that prevents you from copying extremely large files, in proportion to the amount of RAM you have. The limitation is in the CopyFile and CopyFileEx functions, which are used by xcopy, Explorer, Robocopy, and the .NET FileInfo class. Here is the error that you get: Cannot c...
stackexchange/codereview
Whilst refactoring some old code I realised that a particular header file was full of function declarations for functions long since removed from the .cpp file. Does anyone know of a tool that could find (and strip) these automatically?
stackexchange/codereview
I'm trying to set up part of a schema that's like a "Sequence" where all child elements are optional, but at least one of the elements must be present, and there could be more than one of them. I tried doing the following, but XMLSpy complains that "The content model contains the elements <element name="DateConstant"> ...
stackexchange/codereview
For an open source project I am looking for a good, simple implementation of a Dictionary that is backed by a file. Meaning, if an application crashes or restarts the dictionary will keep its state. I would like it to update the underlying file every time the dictionary is touched. (Add a value or remove a value). A Fi...
stackexchange/codereview
There are hundreds of shopping cart solutions available for every platform, and all hosting plans come with several already installed. As a developer I understand that most of these are fairly similar from a user perspective. But which ones are built with the developer in mind? For example, which ones have a decent AP...
stackexchange/codereview
Anyone has ever programmed a PHP (or Perl) function to get the ceiling value Excel style?
stackexchange/codereview
What are the advantages and disadvantages of the Session Façade Core J2EE Pattern? What are the assumptions behind it? Are these assumptions valid in a particular environment?
stackexchange/codereview
I'm looking for a PHP library that will allow me to create a print-ready PDF. The imposition should include 1-up, 4-up, 24-up, etc. layouts, and crop marks. FPDF, TCPDF and PHP's included PDF libraries allow me to create an image and plop it on a PDF, but the more advanced layouts and crop marks are a bit beyond me. T...
stackexchange/codereview
In Java, I have a String and I want to encode it as a byte array (in UTF8, or some other encoding). Alternately, I have a byte array (in some known encoding) and I want to convert it into a Java String. How do I do these conversions?
stackexchange/codereview
Edit: Let me completely rephrase this, because I'm not sure there's an XML way like I was originally describing. Yet another edit: This needs to be a repeatable process, and it has to be able to be set up in a way that it can be called in C# code. In database A, I have a set of tables, related by PKs and FKs. A paren...
stackexchange/codereview
How can I redirect the response to an IFrame?
stackexchange/codereview
The market is flooded with VPS (virtual private server) hosting options. It seems everyone and their mother has a overloaded server in his/her closet. Enterprise options always seem priced insanely high, which make the ones that are cheap and claim enterprise level seem shaky. What do you look for in a quality VPS pr...
stackexchange/codereview
How can I insert ASCII special characters (e.g. with the ASCII value 0x01) into a string? I ask because I am using the following: str.Replace( "<TAG1>", Convert.ToChar(0x01).ToString() ); and I feel that there must be a better way than this. Any Ideas? Update: Also If I use this methodology, do I need to worry about u...
stackexchange/codereview
You can use SelectFolder() to get a folder or GetOpenFolderitem(filter as string) to get files but can you select either a folder or file? ( or for that matter selecting multiple files )
stackexchange/codereview
My developers are waging a civil war. In one camp, they've embraced Hibernate and Spring. In the other camp, they've denounced frameworks - they're considering Hibernate though. The question is: Are there any nasty surprises, weaknesses or pit-falls that newbie Hibernate-Spring converts are likely to stumble on? PS: W...
stackexchange/codereview
temp2, temp1 are pointers to some struct x: struct FunkyStruct x; struct FunkyStruct *temp1 = &x, *temp2 = &x; Now, after execution of following lines: temp2=temp1; temp1=temp1->nxt; ...Will temp2 and temp1 still point to the same memory location? If not, please explain why they would be different.
stackexchange/codereview
I am working on an application that installs a system wide keyboard hook. I do not want to install this hook when I am running a debug build from inside the visual studio (or else it would hang the studio and eventually the system), and I can avoid this by checking if the DEBUG symbol is defined. However, when I debug ...
stackexchange/codereview
I'm using castle windsor for a pet-project I'm working on. I'm starting to notice that I need to call the IoC container in different places in my code to create new objects. This dependency on the container makes my code harder to maintain. There are two solutions I've used to solve this problem I tried to create abstr...
stackexchange/codereview
Is there a polynomial time algorithm for finding a Hamiltonian walk in a graph? My algorithm is N factorial and is really slow.
stackexchange/codereview
Does the Java virtual machine ever move objects in memory, and if so, how does it handle updating references to the moved object? I ask because I'm exploring an idea of storing objects in a distributed fashion (ie. across multiple servers), but I need the ability to move objects between servers for efficiency reasons. ...
stackexchange/codereview
I'm about to create a web application that requires a lot of different web forms where the user needs to be able to input a lot of different types of information. What I mean is that one of those forms may require some text input fields, some integer input fields, some decimal input fields, some date input fields, some...
stackexchange/codereview
I have a dl containing some input boxes that I "clone" with a bit of JavaScript like: var newBox = document.createElement('dl'); var sourceBox = document.getElementById(oldkey); newBox.innerHTML = sourceBox.innerHTML; newBox.id = newkey; document.getElementById('boxes').appendChild(columnBox); In IE,...
stackexchange/codereview
What are in your opinion big differences between areas of usage for "Astoria" (ADO.NET data services) and SQL Server Data Services?
stackexchange/codereview
I am having trouble with my Visual Studio 2005 IntelliSense for some time now. It used to work fine, but for some reason the 'Updating IntelliSense...' does no longer seem to be able to complete for the solution I'm working on currenly- it simply gets stuck somewhere at about 3-bars of progress and blocks one of my pre...
stackexchange/codereview
When I run indent with various options I want against my source, it does what I want but also messes with the placement of *s in pointer types: -int send_pkt(tpkt_t* pkt, void* opt_data); -void dump(tpkt_t* bp); +int send_pkt(tpkt_t * pkt, void *opt_data); +void dump(tpkt * bp); I know my placement of *s next ...
stackexchange/codereview
I'm building a site right now, so far I've painfully forced everything to be compliant and it looks pretty much the same across browsers. However, I'm starting to implement some third party/free javascripts which do things like add attributes (eg. order=2). I could work around this but it's a pain, and I'm starting to ...
stackexchange/codereview
When using PNG files (made with Paint.NET) as background images on my web site, IE7 is changing the colors and actually displaying a darker version of my images, as seen here. In this image, the dark background and background image should be both #001122, and the medium background and background image #004466. But IE7 ...
stackexchange/codereview
I have used the Entity Framework to start a fairly simple sample project. In the project, I have created a new Entity Data Model from a SQL Server 2000 database. I am able to query the data using LINQ to Entities and display values on the screen. I have an Oracle database with an extremely similar schema (I am trying t...
stackexchange/codereview
The following program is very simple: it outputs a single dot each half a second. If it recieves a SIGQUIT, it proceeds to output ten Qs. If it recieves a SIGTSTP (Ctrl-Z), it outputs ten Zs. If it recieves a SIGTSTP while printing Qs, it will print ten Zs after it's done with the ten Qs. This is a good thing. However,...
stackexchange/codereview
I've been digging through some parts of the Linux kernel, and found calls like this: if (unlikely(fd < 0)) { /* Do something */ } or if (likely(!err)) { /* Do something */ } I've found the definition of them: #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0)...
stackexchange/codereview
In ASP.net Webforms how do you detect which Textbox someone pressed enter? Please no Javascript answers. I need to handle it all in the code behind using VB.NET.
stackexchange/codereview
I need to find the frequency of a sample, stored (in vb) as an array of byte. Sample is a sine wave, known frequency, so I can check), but the numbers are a bit odd, and my maths-foo is weak. Full range of values 0-255. 99% of numbers are in range 235 to 245, but there are some outliers down to 0 and 1, and up to 255 ...
stackexchange/codereview
I'm looking for a good, preferably free, test planning and documentation tool. Ideally something that will keep track of which tests have been run against which software version, with reporting ability. There's a whole bunch of tools listed here but are there any others, and which ones have you had the best experience ...
stackexchange/codereview
I'm using C# in .Net 2.0, and I want to read in a PNG image file and check for the first row and first column that has non-transparent pixels. What assembly and/or class should I use?
stackexchange/codereview
AFAIK one of the objectives of Stack Overflow is to make sure anyone can come here and find good answers to her Perl related questions. Certainly beginners would ask what is the best online source to learn Perl but others might just want to ask a question. Probably the friendliest place is the Monastery of Perl Monks. ...
stackexchange/codereview
Are there any programs or IDEs that support refactoring for Ruby or RoR?
stackexchange/codereview
In C#, if you have multiple constructors, you can do something like this: public MyClass(Guid inputId, string inputName){ // do something } public MyClass(Guid inputId): this(inputId, "foo") {} The idea is of course code reuse. However, what is the best approach when there is a bit of complex logic needed? Say I ...
stackexchange/codereview
Is there a way to unit-test COM-visible .NET assemblies from .NET (not via direct .NET assembly reference)? When i add reference in my test project to the COM component whitten in .NET it complains.
stackexchange/codereview
Although I don't have an iPhone to test this out, my colleague told me that embedded media files such as the one in the snippet below, only works when the iphone is connected over the WLAN connection or 3G, and does not work when connecting via GPRS. <html><body> <object data="http://joliclic.free.fr/html/object-tag/en...
stackexchange/codereview
We use Hyper-V extensively in our development environment. Each developer has a virtual server that they own and then we have a bunch of build, test, R&D, and staging virtual servers. Is there any documented or best practice way to duplicate a virtual machine in Hyper-V? What I would really like to be able to do is to...
stackexchange/codereview
I have a website with a lot of large files. However, I don't want users to start downloading like 10 files at a time. I noticed there are website out there where they only allow 2 simultaneous downloads. My website is programmed using ASP.net running on IIS. Does anyone know how I can limit simultaneous downloads?
stackexchange/codereview
I want to ditch my current editor. I feel I need something else. That do not expose my hands to the risk of RSI. I need to see why I should change editor. And it would be nice to believe, that I will be coding when I'm 80 years old. All the big guys out there are using Vim. The only Emacs guy I know are RMS. Paul Graha...
stackexchange/codereview
I'd like to write some quick scripts to play with bluetooth devices (scan etc…), for the Mac. Under linux I'd probably use hcitool, or the python bluez library. What tools are there for the Mac?
stackexchange/codereview
I'm developing a performance critical application for Intel Atom processor. What are the best gcc optimization flags for this CPU?
stackexchange/codereview
Why are there two A/D converters on the USRP2 board if you can only use one RX daughtercard?
stackexchange/codereview
Some years ago I was on a panel that was interviewing candidates for a relatively senior embedded C programmer position. One of the standard questions that I asked was about optimisation techniques. I was quite surprised that some of the candidates didn't have answers. So, in the interests of putting together a list fo...
stackexchange/codereview
I'm designing my website and was curious, before I go rip someone else's ideas, what were the salient considerations and questions one should ask in designing a database?
stackexchange/codereview
I'm running the jdepend maven plugin on my project and whether I run "mvn site:site" or "mvn jdepend:generate" the report that gets generated says "There are no package used." There are no errors in the maven output. Other plugins (cobertura, findbugs, etc.) run fine. My pom is configured like this: <reporting> <p...
stackexchange/codereview
Let's say I'm creating a program in C that needs to use a tempfile. Creating an ad hoc tempfile in /tmp is probably not a good idea. Is there a function or OS call to supply me with a tempfile name so that I can begin to write and read from it?
stackexchange/codereview
I'm developing a WinForms application (.Net 3.5, no WPF) where I want to be able to display foreign key lookups in a databound DataGridView. An example of the sort of relationship is that I have a table of OrderLines. Orderlines have a foreign key relationship to Products and Products in turn have a foreign key relat...
stackexchange/codereview
With which tool / library it is possible to update an existing database structure. On the update of the software it is also needed to change the database. Because there can be different versions of the software it should compare the current status with the target status of the database. It should: add table columns, f...
stackexchange/codereview
I would like to programmatically create a gloss effect on an Image, kinda like on the Apple-inspired design that the Web has adopted when it was updated to 2.0 Beta. Essentially this: example icons http://nhc.hcmuns.googlepages.com/web2_icons.jpg Now, I see two approaches here: I create one image which has an Alpha cha...
stackexchange/codereview
I know I can edit each individual DTS package and save it as a Visual Basic script, but with hundreds of packages on the server, that will take forever. How can I script them all at once? I'd like to be able to create one file per package so that I can check them into source control, search them to see which one refe...
stackexchange/codereview
What's a good algorithm for calculating frames per second in a game? I want to show it as a number in the corner of the screen. If I just look at how long it took to render the last frame the number changes too fast. Bonus points if your answer updates each frame and doesn't converge differently when the frame rate is ...
stackexchange/codereview
I've just switched an application to use ar_mailer and when I run ar_sendmail (after a long pause) I get the following error: Unhandled exception 530 5.7.0 Must issue a STARTTLS command first. h7sm16260325nfh.4 I am using Gmail SMTP to send the emails and I haven't changed any of the ActionMailer::Base.smtp_settings j...
stackexchange/codereview
I have the following config in my lighttpd.conf: $HTTP["host"] == "trac.domain.tld" { server.document-root = "/usr/home/daniels/trac/htdocs/" fastcgi.server = ( "/trac" => ( "trac" => ( "socket" => "/tmp/trac-fastcgi.sock", ...
stackexchange/codereview
I've been playing with Jaxer and while the concept is very cool I cannot figure out how to define objects that are available on both the client and the server. None of the examples I can find define objects at all. I'd like to be able to define an object and specify which methods will be available on the server, which ...
stackexchange/codereview
I need to get a list of attribute values from child elements in Python. It's easiest to explain with an example. Given some XML like this: <elements> <parent name="CategoryA"> <child value="a1"/> <child value="a2"/> <child value="a3"/> </parent> <parent name="CategoryB"> <chi...
stackexchange/codereview
Just want to know what is better way to get start developing faccebook app?Any tutorial recommnedation?And which is better to start up -php or rails?
stackexchange/codereview
I am looking for an enhancement to JSON that will also serialize methods. I have an object that acts as a collection of objects, and would like to serialize the methods of the collection object as well. So far I've located ClassyJSON. Any thoughts?
stackexchange/codereview
What's the best way to create recurring tasks? Should I create some special syntax and parse it, kind of similar to Cronjobs on Linux or should I much rather just use a cronjob that runs every hour to create more of those recurring tasks with no end? Keep in mind, that you can have endless recurring tasks and tasks wit...
stackexchange/codereview
What's the most elegant way to select out objects in an array that are unique with respect to one or more attributes? These objects are stored in ActiveRecord so using AR's methods would be fine too.
stackexchange/codereview
Is there a canonical ordering of submatch expressions in a regular expression? For example: What is the order of the submatches in "(([0-9]{3}).([0-9]{3}).([0-9]{3}).([0-9]{3}))\s+([A-Z]+)" ? a. (([0-9]{3})\.([0-9]{3})\.([0-9]{3})\.([0-9]{3}))\s+([A-Z]+) (([0-9]{3})\.([0-9]{3})\.([0-9]{3})\.([0-9]{3})) ([A-Z...
stackexchange/codereview
That is, I'd like to have a tuple of values. The use case on my mind: Dictionary<Pair<string, int>, object> or Dictionary<Triple<string, int, int>, object> Are there built-in types like Pair or Triple? Or what's the best way of implementing it? Update There are some general-purpose tuples implementations described in...
stackexchange/codereview
I've worked on a variety of systems as a programmer, some with Oracle, some with MySQL. I keep hearing people say that Oracle is more stable, more robust, and more secure. Is this the case? If so in what ways and why? For the purposes of this question, consider a small-medium sized production DB, perhaps 500,000 record...
stackexchange/codereview
I have been researching asynchronous messaging, and I like the way it elegantly deals with some problems within certain domains and how it makes domain concepts more explicit. But is it a viable pattern for general domain-driven development (at least in the service/application/controller layer), or is the design overhe...
stackexchange/codereview
Any recommendations on grep tools for Windows? Ideally ones that could leverage 64-bit OS. I'm aware of Cygwin, of course, and have also found PowerGREP, but I'm wondering if there are any hidden gems out there?
stackexchange/codereview
mime_content_type() is deprecated. How can I find the MIME type of a local file using PHP5 but without using this deprecated method or the PECL fileinfo extension? Edit: That's what I was afraid of. It's unfortunate that they deprecated a built-in function in favour of one that requires an extension that isn't always ...
stackexchange/codereview
It seems like IDataReader.Read() is always true at least one time (If I'm wrong about this let me know.) So how do you tell if it has no records without just wrapping it in a try/catch?
stackexchange/codereview
I was just assigned to do a CMS using ASP.net 3.5 and MySQL. I am kind of new to ASP.NET development (quite sufficient with C#) and I am wondering what major ASP.NET and general .NET features I am losing when I don't have the option to use Microsoft SQL Server. I know already from quick Googling that I lose LINQ (and I...
stackexchange/codereview
Basically I am trying to restart a service from a php web page. Here is the code: <?php exec ('/usr/bin/sudo /etc/init.d/portmap restart'); ?> But, in /var/log/httpd/error_log, I get unable to change to sudoers gid: Operation not permitted and in /var/log/messages, I get Sep 22 15:01:56 ri kernel: audit(1222063316...
stackexchange/codereview
I have a script which contacts a few sources and tell them "the IP-address XXX.XXX.XXX.XXX is my current one". My test web server has a dynamic IP-address through DHCP and amongst other things it needs to update a DDNS entry when its IP-address changes. However it's not the only thing it does, so I will need to run my ...
stackexchange/codereview
We have CC.NET setup on our ASP.NET app. When we build the project, the ASP.NET app is pre-compiled and copied to a network share, from which a server runs the application. The server is a bit different from development box'es, and the next server in our staging environment differs even more. The difference is specific...
stackexchange/codereview
Can anyone explain this in easy to understand terms?
stackexchange/codereview
I've been playing with RSS feeds this week, and for my next trick I want to build one for our internal application log. We have a centralized database table that our myriad batch and intranet apps use for posting log messages. I want to create an RSS feed off of this table, but I'm not sure how to handle the volume- ...
stackexchange/codereview