instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I have a managed Windows application that loads a managed C++ component that uses AfxLoadLibrary to load a third party component if present on the client machine. Once detected, I'm unloading the component using AfxFreeLibrary in an attempt to lower the working set of the managed parent application. The call to AfxF...
stackexchange/codereview
I have embedded a Python interpreter in a C program. Suppose the C program reads some bytes from a file into a char array and learns (somehow) that the bytes represent text with a certain encoding (e.g., ISO 8859-1, Windows-1252, or UTF-8). How do I decode the contents of this char array into a Python string? The Pyt...
stackexchange/codereview
Please don't reply I should use ddd, nemiver, emacs, vim, or any other front-end, I just prefer gdb as it is, but would like to see its output with some terminal colors.
stackexchange/codereview
I want to force the current execution line to a specific line in the same function, possibly skipping intermediate lines. All my old school debuggers had this feature, but I can't find it in eclipse. Is there a way to do it without changing code?
stackexchange/codereview
If you launch Emacs using the -nw flag to force a console session (rather than an X session if you have X windows running), how do you get to the menu? There are some items held in the menus that are infrequently-enough used on my part that I don't recall the escape or control sequence to do them.
stackexchange/codereview
I'm writing a sample console service host and I want to plug into WCF stack to be able to print a message to console when new message arrives, even if it won't get processed by the service at the moment (because service is working on previous calls). This is based on my assumption that messages arriving get queued by t...
stackexchange/codereview
I have found that there is generally a singe type or namespace that takes in any particular enum as a parameter and as a result I have always defined those enums there. Recently though, I had a co-worker make a big deal about how that was a stupid thing to do, and you should always have an enum namespace at the root of...
stackexchange/codereview
I've got a byte() array returned as result of directx sound capture, but for other parts of my program I want to treat the results as single(). Is trundling down the array item by item the fastest way of doing it or is there a clever way to do it ? The code that gets it is CType(Me._applicationBuffer.Read(Me._nextCapt...
stackexchange/codereview
I would like to make a list of remarkable robot simulation environments including advantages and disadvantages of them. Some examples I know of are Webots and Player/Stage.
stackexchange/codereview
I'm a .Net developer and would like to investigate building and running our framework on Mono. If the initial project is successful I will happily invest in an OS learning curve, but right now I want to focus on getting things up and running and seeing the code working. What would be the best distribution to start wi...
stackexchange/codereview
I’m writing a prototype WCF enabled distributed app, to try and find out any issues I’ll have upgrading my existing “sending xml over tcp to communicate” apps I’ve got. I’m using Callback Contracts to register clients with a server (Singleton in ServiceHost) and so far all the communications between client and server ...
stackexchange/codereview
After reading this discussion and this discussion about using CrashRpt to generate a crash dump and email it to the developers, I've been having a difficult time finding any instructions/tutorials for configuring the email settings used by the library to send the email. When you call the install() function to initializ...
stackexchange/codereview
I have a text file of this format: L O A D C A S E 1 O F 2 ... J O I N T D I S P L A C E M E N T S (global) Joint X-dsp Y-dsp Z-dsp X-rot Y-rot Z-rot 1 0.0 0.0 0.0 0.0 0.0 -0.001712 2 ...
stackexchange/codereview
We have a SharePoint Team Site (WSS 3.0 not MOSS), that includes Tasks list to records every tasks related to a project. Here's the scenario. Users : List item Supervisor1 TeamMember1 TeamMember2 TeamMember3 How do we set the permission settings so that Every users (Supervisor and team members) can see any tasks. S...
stackexchange/codereview
I recently asked a question about tracing Linq-to-Entities I think that one of the answers was not right, as they refer to using the DataContext. Is there a DataContext for LINQ-to-Entities? If so, how do I get it?
stackexchange/codereview
My ASP.NET MVC application will take a lot of bandwidth and storage space. How can I setup an ASP.NET upload page so the file the user uploaded will go straight to Amazon S3 without using my web server's storage and bandwidth?
stackexchange/codereview
I've got a really large project I made for myself and rece3ntly a client asked for their own version of it with some modifications. The project name was rather silly and my client wants the source so I figured it'd be best if I renamed all my files from sillyname.h sillyname.cpp sillyname.dsp etc.. Unfortunatly afte...
stackexchange/codereview
I have a micro-mini-search engine that highlights the search terms in my rails app. The search ignores accents and the highlight is case insensitive. Almost perfect. But, for instance if I have a record with the text "pão de queijo" and searches for "pao de queijo" the record is returned but the iext is not highlighted...
stackexchange/codereview
I have a corrupt database. If I open it in MS Access, MS Access offers to repair it, and it succeeds. How can I do that with code? On a machine where MS Access is not installed. I know from trying it that JRO.JetEngine.CompactDatabase does NOT work. In other words, I want to do what Access or JETCOMP.exe is doing, n...
stackexchange/codereview
I vahe eclipse rcp app. In my plugin A I use 3rd party plugin B. In plugin B there is plugin.xml with some extensions. In my plugin A I have added some extensions to extensions defined in plugin B, and it works. Now I tried to overwrite some values in some extensions from B in plugin A. Now, when I run app sometimes it...
stackexchange/codereview
Does anybody know of a free web browser plugin for eclipse that is better than the built-in browser? I searched but couldn't find anything. I know Tasktop has one, but it's not free...
stackexchange/codereview
I compile my project with VIsual Studio 2005 Express Edition, and get this linking error. Can anyone suggest how to solve that?
stackexchange/codereview
Is there a way to take a class name and convert it to a string in C#? As part of the Entity Framework, the .Include method takes in a dot-delimited list of strings to join on when performing a query. I have the class model of what I want to join, and for reasons of refactoring and future code maintenance, I want to be...
stackexchange/codereview
I am writing a site that uses strongly typed datasets. The DBA who created the table made gave a column a value that represents a negative. The column is 'Do_Not_Estimate_Flag' where the column can contain 'T' or 'F'. I can't change the underlying table or the logic that fills it. What I want to do is to add a 'ESTIMA...
stackexchange/codereview
I need to index a whole lot of webpages, what good webcrawler utilities are there? I'm preferably after something that .NET can talk to, but that's not a showstopper. What I really need is something that I can give a site url to & it will follow every link and store the content for indexing.
stackexchange/codereview
Sometimes I find myself in the situation where I want to execute several sequential commands like such: try: foo(a, b) except Exception, e: baz(e) try: bar(c, d) except Exception, e: baz(e) ... This same pattern occurs when exceptions simply need to be ignored. This feels redundant and the excessive sy...
stackexchange/codereview
Out style: bool result; if(something.TryParse(val, out result)) { DoSomething(result); } Nullable style: bool? result = something.TryParse2(val); if(result.HasValue) { DoSomething(result.Value); }
stackexchange/codereview
In ruby the library path is provided in $:, in perl it's in @INC - how do you get the list of paths that Python searches for modules when you do an import?
stackexchange/codereview
Why or why not?
stackexchange/codereview
For an interview in a few, I'm not at all familiar with Flash development. What would you ask?
stackexchange/codereview
I am developing a mobile app to run on a pocketpc. We have a mobile printer and card swipe that uses com1 to send and get info. I'm using the device emulator and want to test without the printer. How do I create a virtual com1 port to right to and read from? I tried com0com but the device emulator will not set that...
stackexchange/codereview
I've been playing with some algorithms on the internet for a while and I can't seem to get them to work, so I'm tossing the question out here; I am attempting to render a velocity vector line from a point. Drawing the line isn't difficult: just insert a line with length velocity.length into the graph. This puts the lin...
stackexchange/codereview
How can I display a calendar control (date picker) in Oracle forms 9/10?
stackexchange/codereview
I need to add a tooltip/alt to a "td" element inside of my tables with jquery. Can someone help me out? I tried: var tTip ="Hello world"; $(this).attr("onmouseover", tip(tTip)); where I have verified that I am using the "td" as "this". **Edit:**I am able to capture the "td" element through using the "alert" command an...
stackexchange/codereview
I am using Installshield 2008 Developer Edition and need to run SQL scripts against an existing SQL Server 2005 Express. When I do this without InstallShield, I would have to have some ODBC drivers installed for example. How does InstallShield do this? Does it include some sort of driver? Or does it depend on preexist...
stackexchange/codereview
Edit: My problem is not a problem anymore: I have redo my performances tests and I have do a fatal stupid error: I had forget a x1000 to get seconds from milliseconds :/ Sorry for that guys. For info: - I do some 1900 updates per second from my PC to the DataBase server on local network. - 3.200 updates per seco...
stackexchange/codereview
When I go back to school after Thanksgiving, I'll be taking a course in CS Theory covering topics such as deterministic and nondeterministic finite state machines, turing machines, pushdown automata and a few other things. However, I haven't found a good application that can produce a visual representation of them as w...
stackexchange/codereview
When comparing an HTTP GET to an HTTP POST, what are the differences from a security perspective? Is one of the choices inherently more secure than the other? If so, why? I realize that POST doesn't expose information on the URL, but is there any real value in that or is it just security through obscurity? Is there eve...
stackexchange/codereview
Is there any way to access the file object used by a CSV writer/reader object after it has been instantiated? I openned up the csv module, and it appears it's contest are builtin. I also tried setting the file object as a property but I get the following error: AttributeError: '_csv.writer' object has no attribute 'f...
stackexchange/codereview
On a 32-bit CPU, an integer is 4 bytes and a short integer is 2 bytes. If I am writing a C/C++ application that uses many numeric values that will always fit within the provided range of a short integer, is it more efficient to use 4 byte integers or 2 byte integers? I have heard it suggested that 4 byte integers are ...
stackexchange/codereview
My computer has two external audiocards and one in the motherboard with windows vista. In Vista it sees two entities for the same soundcard, a digital- and a analog output. When i try to play an videofile with digital audio, say an dvd, it chooses 'Default DirectSound' whereas i want it to use 'Digital Output Auzentec...
stackexchange/codereview
Is there a way to place a watch on variable and only have Visual Studio break when that value changes? It would make it so much easier to find tricky state issues. Can this be done? Breakpoint conditions still need a breakpoint set, and I'd rather set a watch and let Visual Studio set the breakpoints at state changes.
stackexchange/codereview
Visual Studio seems to be modifying a list of .vsmdi files in my .sln every time sometimes when I run a unit test. This is annoying because my source control client thinks the .sln file needs to be checked in even though I don't want to check it in. Is there any way to keep Visual Studio from munging the .sln file afte...
stackexchange/codereview
I know the Html.Button has been moved to the Microsoft.Web.Mvc namespace, but I really miss the generic versions that used to exist in the early Previews. All I want the Html.Button to do is to hit an action in my controller, but I'd rather not write the JavaScript in the onClickMethod argument. In my previous project...
stackexchange/codereview
I have a template in word (.docx) format and want to replace some placeholders in this template with my own data, do you know where I can find the right classes for this project? It would be nice for me to know the namespace. Are there any newer classes for handling word documents in the docx format (xml) than the com ...
stackexchange/codereview
Why can't I pass the table name to a prepared PDO statement? $stmt = $dbh->prepare('SELECT * FROM :table WHERE 1'); if ($stmt->execute(array(':table' => 'users'))) { var_dump($stmt->fetchAll()); } Is there another safe way to insert a table name into a SQL query? With safe, I mean that I don't want to do $sql = "S...
stackexchange/codereview
I'm designing a small SQL database to be used by a web application. Let's say a particular table has a Name field for which no two rows will be allowed to have the same value. However, users will be able to change the Name field at any time. The primary key from this table will be used as a foreign key in other tables...
stackexchange/codereview
Does anyone know the full list of C# compiler number literal modifiers? By default declaring '0' makes it an Int32 and '0.0' makes it a 'Double'. I can use the literal modifier 'f' at the end to ensure something is treated as a 'Single' instead. For example like this... var x = 0; // x is Int32 var y = 0f; // y is...
stackexchange/codereview
As stated in RFC 3286: "...endpoints must manage the conversion between bytes sent and received and TSNs sent and received, since TSN is per chunk rather than per byte". How does this affect the congestion control algorithm?
stackexchange/codereview
I'm not looking for java-web-start, I'm looking for a thick-client application installation toolkit. I've got a stand-alone application that consists of several files (jar files, data files, etc) and would need to do some pretty standard installation tasks, like asking the user for target directories, have them locate...
stackexchange/codereview
We're getting our feet wet with unit testing in VS 2008 Professional Edition and have hit what might be a pretty large snag: there appears to be no way to determine code coverage in this particular VS edition. It seems that this is something only available in VS Team System Development Edition. In other words, VS 2008 ...
stackexchange/codereview
I'm running into a problem setting up my development environment. I've been working on ColdFusion and .NET applications up until recently I haven't needed to touch IIS. Now, I have to set up a classic ASP application for some one-off work. I added a virtual directory in IIS and pointed it at the actual codebase on my l...
stackexchange/codereview
I know a Haskell module name, but I can't figure out in what package it is defined. This is bad because I can't compile without a package exposing this module. Specificaly it is Text.Regex that I can't locate, but I would like to know how to solve that problem in general.
stackexchange/codereview
I'm benchmarking a WPF application on various platforms and I need an easy way to determine if WPF is using hardware or software rendering. I seem to recall a call to determine this, but can't lay my hands on it right now. Also, is there an easy, code based way to force one rendering pipeline over the other?
stackexchange/codereview
A lot of literature talks about using inline functions to "avoid the overhead of a function call". However I haven't seen quantifiable data. What is the actual overhead of a function call i.e. what sort of performance increase do we achieve by inlining functions?
stackexchange/codereview
I had a look in the reference doc, and Spring seems to have pretty good support for sending mail. However, I need to login to a mail account, read the messages, and download any attachments. Is downloading mail attachments supported by the Spring mail API? I know you can do this with the Java Mail API, but in the past ...
stackexchange/codereview
I'm running a regular expression against a large scalar. Though this match isn't capturing anything, my process grows by 30M after this match: # A if (${$c} =~ m/\G<<\s*/cgs) { #B ... } $c is a reference to a pretty big scalar (around 21M), but I've verified that pos(${$c}) is in the right place and the expre...
stackexchange/codereview
I'm trying to convert an incoming sting of 1s and 0s from stdin into their respective binary values (where a string such as "11110111" would be converted to 0xF7). This seems pretty trivial but I don't want to reinvent the wheel so I'm wondering if there's anything in the C/C++ standard libs that can already perform su...
stackexchange/codereview
For example if I'm working on Visual Studio 2008, I want the values devenv and 2008 or 9. The version number is very important...
stackexchange/codereview
Possible Duplicate: Upload files directly to Amazon S3 from ASP.NET application My ASP.NET MVC application will take a lot of bandwidth and storage space. How can I setup an ASP.NET upload page so the file the user uploaded will go straight to Amazon S3 without using my web server's storage and bandwidth?
stackexchange/codereview
How exactly can I create a new directory using Emacs? What commands do I use? (If possible, please provide an example)
stackexchange/codereview
How do I convert a utf-8 string to a utf-16 string in PHP?
stackexchange/codereview
Is it possible to cancel out of a long running process in VB6.0 without using DoEvents? For example: for i = 1 to someVeryHighNumber ' Do some work here ' ... if cancel then exit for end if next Sub btnCancel_Click() cancel = true End Sub I assume I need a "DoEvents" before the "if cancel...
stackexchange/codereview
I am writing a dhtml application that creates an interactive simulation of a system. The data for the simulation is generated from another tool, and there is already a very large amount of legacy data. Some steps in the simulation require that we play "voice-over" clips of audio. I've been unable to find an easy way t...
stackexchange/codereview
I have an object that needs a test if the object data is valid. The validation itself would be called from the thread that instatiated the object, it looks like this: { if (_step.Equals(string.Empty)) return false; if (_type.Equals(string.Empty)) return false; if (_setup.Equals(string.Empty)) return false; ret...
stackexchange/codereview
I just did a delete from table How do I roll back or undelete the rows??
stackexchange/codereview
I'm on a Hardy Heron Ubuntu build, BTW.
stackexchange/codereview
I have come to see an Installer class item in Visual studio. Why they have maintain an seperate item for Installer. Do they create any custom installers ?
stackexchange/codereview
I'm trying to get a postgres jdbc connection working in eclipse. It would be nice to use the Data Source Explorer, but for now I'm just trying to get a basic connection. What I have done so far is download the postgres JDBC connector. I then tried two different things. First, Preferences-> Data Management, I tried to a...
stackexchange/codereview
What's the object type returned by Datepicker? Supposing I have the following: $("#txtbox").datepicker({ onClose: function(date){ //something } }); What is date? I'm interested in reading the date object from another Datepicker for comparison, something like: function(date){ oDate = $("#o...
stackexchange/codereview
Possible Duplicate: Any tool to migrate repo from Vault to Subversion? I'm currently reviewing the benefits of moving from SVN to a SourceGear Vault. Has anyone got advice or a link to a detailed comparison between the two? Bear in mind I would have to move my current Source Control system across which works strongl...
stackexchange/codereview
Are there any good methods for getting ASP.NET 2.0 to validate under the XHTML 1.0 Strict (or Transitional) DTD? I'm interested to hear some ideas before I hack up the core of the HTTP response. One major problem is the form tag itself, this is the output I got from W3C when I tried to validate: Line 13, Column 11: th...
stackexchange/codereview
I'm writing a scheduler or sorts. It's basically a table with a list of exes (like "C:\a.exe") and a console app that looks at the records in the table every minute or so and runs the tasks that haven't been run yet. I run the tasks like this: System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInf...
stackexchange/codereview
My application runs under CF 2.0 locally and i would like to know how to connect and send something to print in the embedded printer of a http://www.milliontech.com/home/content/view/195/95/'>Bluebird BIP-1300 device. Ideally i would like an example in C#. Thank you in advance.
stackexchange/codereview
I need to create a unique ID for a given location, and the location's ID must be sequential. So its basically like a primary key, except that it is also tied to the locationID. So 3 different locations will all have ID's like 1,2,3,4,5,...,n What is the best way to do this? I also need a safe way of getting the next...
stackexchange/codereview
I'm using watermark extenders on textboxes and an exception is being thrown from the AJAX Control Toolkit .dll. It's strange because this just started happening. I tried debugging from the Ajax solution and Ajax examples (but with my code), but no dice. Is there a way to step into the Ajax .dll from my solution to s...
stackexchange/codereview
I want a function like GetCurrentThread which returns a TThread object of the current executing thread. I know there is a Win32 API call GetCurrentThread, but it returns the thread Id. If there is a possibility to get TThread object from that ID that's also fine.
stackexchange/codereview
Please provide tips for effectively using git with svn. What are your "best practices"?
stackexchange/codereview
I recently installed the Eclipse Metrics Plugin and have exported the data for one of our projects. It's all very good having these nice graphs but I'd really like to understand more in depth what they all mean. The definitions of the metrics only go so far to telling you what it really means. Does anyone know of any g...
stackexchange/codereview
I need a way to allow each letter of a word to rotate through 3 different colors. I know of some not so clean ways I can do this with asp.NET, but I'm wondering if there might be a cleaner CSS/JavaScript solution that is more search engine friendly. The designer is including a file like this for each page. I'd rather n...
stackexchange/codereview
I need to compress files in [*.zip] format in .NET 1.1. I don't want to use SharpZip for compression as I got random errors - "Access Denied" - when running it in .NET 1.1. SharptZip will work properly only if I put the assembly on the GAC - which is not an option in my project. This is the problem. Check this: http:/...
stackexchange/codereview
As it was made clear in my recent question, Swing applications need to explicitly call System.exit() when they are ran using the Sun Webstart launcher (at least as of Java SE 6). I want to restrict this hack as much as possible and I am looking for a reliable way to detect whether the application is running under Webst...
stackexchange/codereview
I need to store encrypted data (few small strings) between application runs. I do not want the user to provide a passphrase every time (s)he launches the application. I.e. after all it goes down to storing securely the encryption key(s). I was looking into RSACryptoServiceProvider and using PersistentKeyInCsp, but I'm ...
stackexchange/codereview
We use the DesignSurface and all that good IDesignerHost goodness in our own designer. The designed forms are then persisted in our own bespoke format and all that works great. WE also want to export the forms to a text-based format (which we've done as it isn't that difficult). However, we also want to import that tex...
stackexchange/codereview
I'm creating a site where the user unfortunately has to provide a regex to be used in a MySQL WHERE clause. And of course I have to validate the user input to prevent SQL injection. The site is made in PHP, and I use the following regex to check my regex: /^([^\\\\\']|\\\.)*$/ This is double-escaped because of PHP's w...
stackexchange/codereview
Basically the question is how to get from this: foo_id foo_name 1 A 1 B 2 C to this: foo_id foo_name 1 A B 2 C
stackexchange/codereview
So, I use Linux, and I've been trying to find the time to get into game programming. I started out with Panda3d and had some pretty decent results and got a feel for many of the concepts in game programming. Not too long after that, I decided to step it up a notch and go to something more powerful and C or C++ based. I...
stackexchange/codereview
I was going through the AWDR book on web development with ruby on rails and one of the issues with the old code was it didn't use respond_to to make sure the view used would be the javascript view. Now in some updated examples I've seen people mention they later, when implementing graceful degradation, use request.xhr?...
stackexchange/codereview
Is there a way to determine the number of users that have active sessions in an ASP.NET application? I have an admin/tools page in a particular application, and I would like to display info regarding all open sessions, such as the number of sessions, and perhaps the requesting machines' addresses, or other credential ...
stackexchange/codereview
I have a VB6 project in Visual Source Safe 6.0. When I open the project I want to Check Out (Get) all the files in the project so that I can edit them. I have the VSS Options (within VB6) set to act on the Project recursively, but when I check out the project.vbp it only checks out the project file, not all the modules...
stackexchange/codereview
I have an ASP.NET linkbutton control on my form. I would like to use it for javascript on the client side and prevent it from posting back to the server. (I'd like to use the linkbutton control so I can skin it and disable it in some cases, so a straight up tag is not preferred). How do I prevent it from posting back ...
stackexchange/codereview
I have a modal popup that initially shows some content but expands a div if a checkbox is selected. The modal expands correctly but doesn't recenter unless you scroll up or down. Is there a javascript event I can tack on to my javascript function to recenter the entire modal?
stackexchange/codereview
In a PHP project I'm working on we need to create some DAL extensions to support multiple database platforms. The main pitfall we have with this is that different platforms have different syntaxes - notable MySQL and MSSQL are quite different. What would be the best solution to this? Here are a couple we've discussed: ...
stackexchange/codereview
When i use any of the other strongly typed HTML helpers after typing for example Html.Actionlink<HomeController>(x=>x. This pops up intellisense on the methods that the HomeController class has. However for the example above, this does not happen. Only after inserting the link text (second parameter) and going back t...
stackexchange/codereview
I've only started playing with both ASP.Net MVC and the new-to-VS2008 Dynamic Data Website Templates. I note that they both use routing in their URL handling, and I'm given to understand that because of routing, ASP.Net MVC won't work under IIS6. However my DynamicData site works just fine on IIS6. I've had to tempor...
stackexchange/codereview
I know the mantra is that the database is always the long pole in the tent anytime a page is being generated server-side. But there's also a good bit of file i/o going on on a web server. Scripted code is replete with include/require statements. Moreover, its typically a practice to store templated html outside the app...
stackexchange/codereview
I am working through a book which gives examples of Ranges being converted to equivalent arrays using their "to_a" methods When i run the code in irb I get the following warning warning: default `to_a' will be obsolete What is the the correct alternative to using to_a? are there alternate ways to populate an array wi...
stackexchange/codereview
Is there a way to generate random number on Windows by reading from a file or pseudo file or character special file, the way that can be done on Linux by reading from /dev/random? Not asking about various crypto API, but whether there is in Windows something akin to the Linux way.
stackexchange/codereview
I want to apply a function to all columns in a matrix with MATLAB. For example, I'd like to be able to call smooth on every column of a matrix, instead of having smooth treat the matrix as a vector (which is the default behaviour if you call smooth(matrix)). I'm sure there must be a more idiomatic way to do this, but I...
stackexchange/codereview
I'm pretty familiar with Ruby and Ramaze, but I wanted to provide my Admins with an install howto, since they're more familiar with Tomcat and standard Apache installations. I tried it locally first and it got pretty long: sudo aptitude install ruby1.8 ruby1.8-dev rubygems1.8 sqlite3 wget http://www.geocities.jp/kosak...
stackexchange/codereview