instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I am using gSOAP as a Web Service toolkit and have generated the stub and proxy classes through soapcpp2 from multiple WSDLs all at once. Thus all the namespace bindings are in a single .nsmap file. Now the problem is that all the namespace bindings are being sent with all the method calls I make. The HTTP POST pack...
stackexchange/codereview
I am attempting to save an rtf file using FileDialog and would like to filter using a where clause. This is what I have: Set dlgSave = FileDialog(msoFileDialogSaveAs) With dlgSave .Title = "Provide the place to save this file" .ButtonName = "Save As..." .InitialFileName = Me.cmbPickAReportToPrint.Value & "-" & Fo...
stackexchange/codereview
Is Occam-pi a good language to learn to program LEGO MINDSTORMS & Surveyor Corporation SRV-1 robots for an programming newbie. Are there any opensource projects making use of the same -- to read source code. url for occam-pi :- http://www.transterpreter.org/
stackexchange/codereview
This is the unabashed attempt of a similar C# question. So what are your favorite F# hidden (or not) features? Most of the features I've used so far aren't exactly hidden but have been quite refreshing. Like how trivial it is to overload operators compared to say C# or VB.NET. And Async<T> has helped me shave off some ...
stackexchange/codereview
I have a program 'foo' running different threads, fooT1, fooT2, .. fooTn. Now if I want write another program 'bar', which could kill the thread fooTr, is that possible? Reason: One of the thread fooTr tracks product license. If this thread is killed; one may run this product indefinitely. And killing 'foo' itself is t...
stackexchange/codereview
I'd like to document what high-level (i.e. C++ not inline assembler ) functions or macros are available for Compare And Swap (CAS) atomic primitives... E.g., WIN32 on x86 has a family of functions _InterlockedCompareExchange in the <_intrin.h> header.
stackexchange/codereview
Since Unicode lacks a series of zero width sorting characters, I need to determine equivalent characters that will allow me to force a certain order on a list that is automatically sorted by character values. Unfortunately the list items are not in an alphabetical order, nor is it acceptable to prefix them with visible...
stackexchange/codereview
This isn't as malicious as it sounds, I want to get the current size of their windows, not look at what is in them. The purpose is to figure out that if every other window is fullscreen then I should start up like that too. Or if all the other processes are only 800x600 despite there being a huge resolution then that...
stackexchange/codereview
In many languages, assignments are legal in conditions. I never understood the reason behind this. Why would you write: if (var1 = var2) { ... } instead of: var1 = var2; if (var1) { ... } ?
stackexchange/codereview
I have renamed some excel files on my web server and after renaming the users cannot download those files. What could be the problem. They are all excel files.
stackexchange/codereview
Is C drive treated as the root folder in Windows, when one says /folder1/folder2/ in linux and C:\folder1\folder2\ in Windows?
stackexchange/codereview
I have a form where i have used Infragistics windows grid control to display the data. In this, i have placed a button on one of the cell. I want to set its visibility either True or False based on the row condition. I have handled the InitializeRow event of UltraWinGrid control and able to disable the button. But i ...
stackexchange/codereview
I have a Virtual Machine in Virtual PC 2007. To start it from the desktop, I have the following command in a batch file: "c:\program files\Microsoft Virtual PC\Virtual PC.exe" -pc "MY-PC" -launch But that leaves a dos prompt on the host machine until the virtual machine shuts down, and I exit out of the Virtual PC con...
stackexchange/codereview
I am looking for a relatively good and well supported, and preferably open source blog application that runs on ASP.NET and SQL Server. It doesn’t need to be packed full of features, it just needs the basics, such as tagging, comments, etc. Extra features are a bonus. I would also like it to be either open source or ha...
stackexchange/codereview
I am working with web Dynpro java.. I have created a stateless session bean wherein I have created business methods for inserting and retrieving records from my dictionary table. My table has two fields of java.sql.Date type The web service that i have created is working fine for insertRecords(), but for showRecords(...
stackexchange/codereview
When I open a file in eclipse it shows with the improper line spacing showing an extra line break between every line. When I open the file with notepad or wordpad it doesn't show these extra line breaks that only eclipse shows. How do I get eclipse to read these files like notepad and wordpad without those line breaks?...
stackexchange/codereview
I have a number of RGBA pixels, each of them has an alpha component. So I have a list of pixels: (p0 p1 p2 p3 p4 ... pn) where p_0_ is the front pixel and p_n_ is the farthest (at the back). The last (or any) pixel is not necessary opaque, so the resulting blended pixel can be somehow transparent also. I'm blending fro...
stackexchange/codereview
Does anyone know if there is an API to get the current monitor state (on or off) in Windows (XP/Vista/2000/2003)? All of my searches seem to indicate there is no real way of doing this. This thread tries to use GetDevicePowerState which according to Microsoft's docs does not work for display devices. In Vista I can l...
stackexchange/codereview
I want to set a style on the first and last TabItems in a TabControl, and have them updated as the visibility of the TabItems is changed. I can't see a way to do so with triggers. What we're after looks like this: | > > > | And the visibility of TabItems are determined by binding. I do have it working in code. On Tab...
stackexchange/codereview
I get a generic failure when I try to run: saslpasswd2 username This was installed by Collanet's Subversion 1.5.2.
stackexchange/codereview
Does NetworkStream.DataAvailable know whether the sender's send buffer is empty? Or does it simply indicate whether the receiver's read buffer has data? My assumption is the latter... Specifically, for some socket work involving an ongoing conversation, I currently use a length-prefix so the the receiver knows exactly ...
stackexchange/codereview
I have a products table that contains a FK for a category, the Categories table is created in a way that each category can have a parent category, example: Computers Processors Intel Pentium Core 2 Duo AMD Athlon I need to make a select query that if the selected...
stackexchange/codereview
What's the best way of inserting information in table A and using the index from table A to relate to table B. The "solution" I tried is inserting the info in table A (which has a automatically generated ID), then, select the last index and insert it in table B. This may not be very useful, as the last index may chan...
stackexchange/codereview
What is the best way to free resources (in this case unlock the ReadWriteLock) when leaving the scope ? How to cover all possible ways (return, break, exceptions etc)?
stackexchange/codereview
Visual Studio includes support for __forceinline. The Microsoft Visual Studio 2005 documentation states: The __forceinline keyword overrides the cost/benefit analysis and relies on the judgment of the programmer instead. This raises the question: When is the compiler's cost/benefit analysis wrong? And, how am...
stackexchange/codereview
The latest makefiles we've received from a third party vendor contain rules with --depend on the end of build rules, so I thought I would look it up on Google, but try as I might, I can't persuade it to display any pages with exactly the characters --depend I've tried surrounding it with quotes "--depend": I've tried t...
stackexchange/codereview
I can select all the distinct values in a column in the following ways: SELECT DISTINCT column_name FROM table_name; SELECT column_name FROM table_name GROUP BY column_name; But how do I get the row count from that query? Is a subquery required?
stackexchange/codereview
Is there a way to globally make right click also select the element that you right click on? From what I understand this has been a bug in Swing for a long time likely to never be fixed because at this point applications depend on it. Any advice on doing this on a global scale? Perhaps on the L&F?
stackexchange/codereview
What would be the best way to write Objective-C on the Windows platform? Cygwin and gcc? Is there a way I can somehow integrate this into Visual Studio? Along those lines - are there any suggestions as to how to link in and use the Windows SDK for something like this. Its a different beast but I know I can write assemb...
stackexchange/codereview
I get the following error message in SQL Server 2005: User '<username>' does not have permission to run DBCC DBREINDEX for object '<table>'. Which minimum role do I have to give to user in order to run the command?
stackexchange/codereview
I work for a product development company.We first do internal releases,and then public release.I was wondering, how other product developing companies manage their release? How do you give release number? Tag the source control?
stackexchange/codereview
I would like to know the best way to use a datagrid control linked to a combination (join) of data tables in a way that both simply allows both display, creation of new rows in underlying tables and deletion. The datagrid appears to offer the latter capabilities but I have not found a way that I am happy with to do mor...
stackexchange/codereview
We have an SQL 2005 database backend for our website, currently about 10GB in size. There are a lot more reads than writes, though I don't have the exact statistics. We're upgrading our database server and I was thinking of getting 4 disks and setting them up in two RAID 1 arrays - one for the data files and the other ...
stackexchange/codereview
I've seen the question (and answer) when posed for MS SQL Server, though I don't yet know of one for Oracle and PL/SQL. Are there xUnit style testing frameworks for Oracle's PL/SQL? What are they?
stackexchange/codereview
How do you get the max value of an enum?
stackexchange/codereview
Is there a difference between generating multiple numbers using a single random number generator (RNG) versus generating one number per generator and discarding it? Do both implementations generate numbers which are equally random? Is there a difference between the normal RNGs and the secure RNGs for this? I have a web...
stackexchange/codereview
I get obsessed with the best names for arrays and variables that I use, I'll look up words in the thesaurus, dictionary, etc.. So I'm trying to name this array / structure: $nameMe = array( '392' => TRUE, '234' => TRUE, '754' => TRUE, '464' => TRUE, ); and it's used to check if that id has a certain pr...
stackexchange/codereview
I have a simple Python script that I want to stop executing if a condition is met. For example: done = True if done: # quit/stop/exit else: # do other stuff Essentially, I am looking for something that behaves equivalently to the 'return' keyword in the body of a function which allows the flow of the code to e...
stackexchange/codereview
Various programs can do stuff only when you haven't used the computer for a while (eg screensaver, Google Desktop indexing, etc). How do they know when it has been inactive? Is there some function in Windows that tells you how long it has been inactive, or do you have to use some kind of keyboard/mouse hook to track ac...
stackexchange/codereview
I wish I were a CSS smarty .... How can you place a div container in the lower left-hand corner of the web page; taking into account the users scroll-position?
stackexchange/codereview
What kind of optimization patterns can be used to improve the performance of the garbage collector? My reason for asking is that I do a lot of embedded software using the Compact Framework. On slow devices the garbage collection can become a problem, and I would like to reduce the times the garbage collector kicks in,...
stackexchange/codereview
I'm using the mechanize module to execute some web queries from Python. I want my program to be error-resilient and handle all kinds of errors (wrong URLs, 403/404 responsese) gracefully. However, I can't find in mechanize's documentation the errors / exceptions it throws for various errors. I just call it with: se...
stackexchange/codereview
I am creating a Visual Studio Setup project. I want to un-install another component from the system from the install of my component. The other component is installed from my own setup created using Visual Studio. Currently when I am calling the un-install of the other component from the install action of the component...
stackexchange/codereview
Does anyone know where I can find a library of common but difficult (out of the ordinary) SQL script examples. I am talking about those examples you cannot find in the documentation but do need very often to accomplish tasks such as finding duplicates etc. It would be a big time saver to have something like that handy....
stackexchange/codereview
I have a JUnit 3.x TestCase which I would like to be able to parameterize. I'd like to parametrize the entire TestCase (including the fixture). However, the TestSuite.addTestSuite() method does not allow be to pass a TestCase object, just a class: TestSuite suite = new TestSuite("suite"); suite.addTestSuite(MyTes...
stackexchange/codereview
Is there a way to change the context sensitive help in Visual Studio so that it will only search against the text under the caret instead of a compilation error in your code? More info: After you compile and receive a compilation error(underlined), placing the caret within the underlined text and pressing F1 will take ...
stackexchange/codereview
I'm running a MySQL database locally for development, but deploying to Heroku which uses Postgres. Heroku handles almost everything, but my case-insensitive Like statements become case sensitive. I could use iLike statements, but my local MySQL database can't handle that. What is the best way to write a case insensitiv...
stackexchange/codereview
As the question states - is there a good tool out there which lists methods an unmanaged DLL exports? I would like it to list COM methods and interfaces too.
stackexchange/codereview
I guess this is an odd one, and the answer is most likely it is not possible since it would represent a security breach; but I am looking for a way - if any - to get a screendump of content inside the browser. I don't need the entire window, but actually just need to dump the rendered state of an tag. It need to be cr...
stackexchange/codereview
I'm working on a commercial (not open source) C++ project that runs on a linux-based system. I need to do some regex within the C++ code. (I know: I now have 2 problems.) QUESTION: What libraries do people who regularly do regex from C/C++ recommend I look into? A quick search has brought the following to my atte...
stackexchange/codereview
I use K2 as my workflow engine. For some reason my processes are not available in any of the reporting views (on the workspace). Do I have to do something special when deploying to get them there?
stackexchange/codereview
What tools are out there that compete with this product? CodeKana I know ReSharper has improved syntax highlighting. Is it comparable to this?
stackexchange/codereview
I've read ASP.NET Routing… Goodbye URL rewriting? and Using Routing With WebForms which are great articles, but limited to simple, illustrative, "hello world"-complexity examples. Is anyone out there using ASP.NET routing with web forms in a non-trivial way? Any gotchas to be aware of? Performance issues? Further recom...
stackexchange/codereview
A python script need to spawn multiple sub-processes via fork(). All of those child processes should run simultaneously and the parent process should be waiting for all of them to finish. Having an ability to set some timeout on a "slow" child would be nice. The parent process goes on processing the rest of the script...
stackexchange/codereview
I need to add functionality to my J2EE-based wep application: 1) Take some page, probably with form controls, convert it to some printer friendly format. 2) Print this rendered format a) without showing it and b) without a print dialog. I'm not too worried about 1, but have no idea if 2a and 2b are even possible. Thank...
stackexchange/codereview
Is there a way to determine who is logged on to a particular (remote) machine given the IP address (or the workstation name) of the machine? The machines in question are on an Active Directory Domain The user running the script probably won't have any special rights on either their local or the remote machine Operatin...
stackexchange/codereview
Often times when mixing jQuery with asp.net I need to use asp .net angle bracket percent, <% %>, syntax within a jQuery selector. If I would like to separate the JavaScript from markup into different files is there still a way to evaluate my JavaScript file so the angle bracket percents are interpolated before reachin...
stackexchange/codereview
The following is a Simple Style for ListBoxItem, ListBoxItem has a son Border. Border has a Padding property with value of 8, I want to change the value to 0, when the item is selected. How can I write the trigger? <??Style TargetType="{x:Type ListBoxItem}"> <Setter Property="Background" Value="Transparent"...
stackexchange/codereview
I can't find any information about this on either www.episerver.com or world.episerver.com, anyone knows?
stackexchange/codereview
I have a site, from which you can download an HTML file. This HTML file contains a form with hidden fields, which is right away posted back to the site using JavaScript. This is a way of allowing users to download to their own machine data that they edit on the site. On some machines, you get an IE "yellow bar" when tr...
stackexchange/codereview
I am trying to nail down free space on a remote server by querying all the drives and then looping until I find the drive I am seeking. Is there a better way to do this? Dim oConn As New ConnectionOptions Dim sNameSpace As String = "\\mnb-content2\root\cimv2" Dim oMS As New ManagementScope(sNameSpace, oConn) Dim oQue...
stackexchange/codereview
A common solution to building a model of a system which consists of many items of different types is to create a modular system, where each module is responsible for particular type. For example, there will be module for wombats WombatModule:IModule, where IModule interface has methods like GetCount() (to find number o...
stackexchange/codereview
We are trying to update our classic asp search engine to protect it from SQL injection. We have a VB 6 function which builds a query dynamically by concatenating a query together based on the various search parameters. We have converted this to a stored procedure using dynamic sql for all parameters except for the ke...
stackexchange/codereview
Creating hashes of hashes in Ruby allows for convenient two (or more) dimensional lookups. However, when inserting one must always check if the first index already exists in the hash. For example: h = Hash.new h['x'] = Hash.new if not h.key?('x') h['x']['y'] = value_to_insert It would be preferable to do the followin...
stackexchange/codereview
At some point in time I turned on a setting in Visual Studio 2005 that produces a warning when methods/classes don't have an xml comment associated with them. I would like to turn this off, but can't seem to find the setting again. Anyone know where this is?
stackexchange/codereview
It is possible to prevent scroll bars from appearing when you drag a Mdichild outside the bounds of the Mdiparent in vb.net? I would prefer the solution to not involve checking the posistion of the child form as there are too many forms to alter. Obviously autoscroll is set to false on the mdiparent and setting VScrol...
stackexchange/codereview
Is there a way to start PowerShell in a specific folder from Windows Explorer, e.g. to right-click in a folder and have an option like "Open PowerShell in this Folder"? It's really annoying to have to change directories to my project folder the first time I run MSBuild every day.
stackexchange/codereview
In the following code below: Image img = new Image(); img.Source = new BitmapImage(new Uri("http://someURL/somefilename.jpg", UriKind.Absolute)); how can I determine if the image successfully loaded (when there's a valid URI)? i.e., The URI is a valid format, but the file may not exist.
stackexchange/codereview
Say you've loaded a text file into a string, and you'd like to convert all Unicode escapes into actual Unicode characters inside of the string. Example: "The following is the top half of an integral character in Unicode '\u2320', and this is the lower half '\U2321'."
stackexchange/codereview
I'd like to upload (via ftp) a website when doing a release build in visual studio 2008. I don't want any source code files to be uploaded and it would be nice to configure which folders should get uploaded. I'm using either ASP.NET Web Applications or MVC. How do I configure VS.NET to automatically upload (and over...
stackexchange/codereview
Using Java swing, what is the string that correspond to a correct email mask when using the MaskFormatter? Is that possible at all to actually use a MaskFormatter for emails?
stackexchange/codereview
What's the ASP equivalent to PHP's .= when concatenating strings? I'm referring to asp NOT asp.net. I meant to specify that I'm in a for-loop. So I want to know the equivalent for .= (in php) not standard concatenation. Example: For Each Item In Request.Form If (Item = "service") then For x=1 To Request.Fo...
stackexchange/codereview
We are using c++ to develop an application that runs in Windows CE 4 on an embedded system. One of our constraint is that all the memory used by the application shall be allocated during startup only. We wrote a lot of containers and algorithms that are using only preallocated memory instead of allocating new one. Do y...
stackexchange/codereview
This is a GUI application (actually MFC). I need a command window with the ability to display a prompt like such: Name of favorite porn star: The user should be able to enter text after the prompt like such: Name of favorite porn star: Raven Riley But I need to prevent the user from moving the cursor into the promp...
stackexchange/codereview
How can I find the public facing IP for my net work in Python?
stackexchange/codereview
Just got a request from my boss for an application I'm working on. Basically we're getting an email address setup for an external client to submit excel files to. What I need is a way to automatically pick up any email sent to this address, so I can take the attachment, process it and save it to a folder. Any informat...
stackexchange/codereview
When using an aggregate control in some reports you would prefer to see a blank field instead of 0. There does not appear to be a way to do this automatically. Does anyone have a way that this can be done. Note, you want to maintain the '0' value for the field in cases when you export, but you want to show a blank w...
stackexchange/codereview
I'm curious to know how people are using table aliases. The other developers where I work always use table aliases, and always use the alias of a, b, c, etc. Here's an example: SELECT a.TripNum, b.SegmentNum, b.StopNum, b.ArrivalTime FROM Trip a, Segment b WHERE a.TripNum = b.TripNum I disagree with them, and think t...
stackexchange/codereview
How do you reverse a string in C or C++ without requiring a separate buffer to hold the reversed string?
stackexchange/codereview
Ok so part two of I have no will power experiment is: Summary Question - Is there a way to set the CanStop property on a windows service dynamically? Whole Spiel - I have a service that is currently checking and killing processes (IE Games) I have told it to if it's day I'm not allowed. Great. I set the CanStop to fa...
stackexchange/codereview
I've got some JSON data, but it's all on one line. Does anyone know of a web or Windows editor that will format (e.g. indent and insert new lines) this data for me, so I can read it better? Preferably one that uses a GUI to display the JSON—instead of a command-line tool that outputs a reformatted document, for example...
stackexchange/codereview
I've got a 'task list' database that uses the adjacency list model (see below) so each 'task' can have unlimited sub-tasks. The table has an 'TaskOrder' column so everything renders in the correct order on a treeview. Is there an SQL statement (MS-SQL 2005) that will select all the child nodes for a specified parent an...
stackexchange/codereview
I'd like to set a cookie via Django with that has several different values to it, similar to .NET's HttpCookie.Values property. Looking at the documentation, I can't tell if this is possible. It looks like it just takes a string, so is there another way? I've tried passing it an array ([10, 20, 30]) and dictionary ({'n...
stackexchange/codereview
Have you guys and gals got any tips or hacks for making the most out of the JavaScript intellisense options in Visual Studio 2008? Visual Studio shows me the "namespaces" and uses the documentation features (<param> and <summary>). I have not been able to get the <return> documentation feature to work though. Now, that...
stackexchange/codereview
I have seen people say that it is bad form to use catch with no arguments, especially if that catch doesn't do anything: StreamReader reader=new StreamReader("myfile.txt"); try { int i = 5 / 0; } catch // No args, so it will catch any exception {} reader.Close(); However, this is considered good form: StreamReade...
stackexchange/codereview
echo $_POST["name"]; //returns the value a user typed into the "name" field I would like to be able to also return the text of the key. In this example, I want to return the text "name". Can I do this?
stackexchange/codereview
I only just recently discovered that Visual C++ 2008 (and perhaps earlier versions as well?) supports for each syntax on stl lists et al to facilitate iteration. For example: list<Object> myList; for each (Object o in myList) { o.foo(); } I was very happy to discover it, but I'm concerned about portability for the ...
stackexchange/codereview
I am looking to create symlinks (soft links) from Java on a Windows Vista/ 2008 machine. I'm happy with the idea that I need to call out to the JNI to do this. I am after help on the actual C code though. What is the appropriate system call to create the link? Pointers to some good documentation on this subject would b...
stackexchange/codereview
Hey All, I have been working on this problem for a while and the usual google searches are not helping :( I have a production database in SQL 2000. I want to copy it over the top of a training database to refresh it. I want this to be something that is scheduled to happen once a week to keep the training database up-to...
stackexchange/codereview
To save network traffic I'd like to compress my data. The only trick is that I the client is a c application and the server is php. I'm looking for an open source compression library that's available for both c and php. I guess I could write an external c application to decompress my data, but I'm trying to avoid spawn...
stackexchange/codereview
Does anyone know the format of the MAPI property PR_SEARCH_KEY? The online documentation has this to say about it: The search key is formed by concatenating the address type (in uppercase characters), the colon character ':', the e-mail address in canonical form, and the terminating null character. And the ...
stackexchange/codereview
Anyone know how to programmatically mute the Windows XP Volume using C#?
stackexchange/codereview
Anyone know what group I need to belong to show up in the sp_help_operator list?
stackexchange/codereview
I have a custom application that was built to send opt-in newsletters and marketing emails. It does a pretty good job sending mail, but it doesn't respond at all to bounces or unsubscribe requests. It seems to me that rather than building that functionality myself I should use a mailing list manager such as LISTSERV. H...
stackexchange/codereview
I can get the executable location from the process, how do I get the icon from file? Maybe use windows api LoadIcon(). I wonder if there is .NET way...
stackexchange/codereview
I have some code where I'm returning an array of objects. Here's a simplified example: string[] GetTheStuff() { List<string> s = null; if( somePredicate() ) { s = new List<string>(); // imagine we load some data or something } return (s == null) ? new string[0] : s.ToArray(); } ...
stackexchange/codereview
This is a minor style question, but every bit of readability you add to your code counts. So if you've got: if (condition) then { // do stuff } else { // do other stuff } How do you decide if it's better like that, or like this: if (!condition) then { // do other stuff { else { // do stu...
stackexchange/codereview
I would like to have some suggestions about which third-part controls can we use in our Visual C++ MFC application?
stackexchange/codereview
The Matrix in SSRS (SQL Server Reporting Services 2005) seems to have issues with certain the border styles when exporting to XLS (but not PDF or web view; maybe other formats, not sure?). For example: Create a matrix and set the Matrix border style to Black Solid 1px, but all 4 of the cells to have a border style of B...
stackexchange/codereview
I've read this thread for WCF has inbuilt Custom Fault codes and stuff. But what is the best practice for ASP.Net web services? Do I throw exceptions and let the client handle the exception or send an Error code (success, failure etc) that the client would rely upon to do its processing. Update: Just to discuss further...
stackexchange/codereview