instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
Basically I wanted to do something like git push mybranch to repo1, repo2, repo3 right now I'm just typing push many times, and if I'm in a hurry to the the pushing done, I just send them all to the background git push repo1 & git push repo2 & I'm just wondering if git natively supports what I want to do, or if maybe t...
stackexchange/codereview
recently I was given the task to discover a C# solution I have never seen before, and give suggestions on refactoring it. I think I will use NDepend (for the first time ever) to see the overall picture, and also to check a lot of code metrics to figure out what could be refactored. NDepend is pretty good at showing the...
stackexchange/codereview
As someone who is just starting to learn the intricacies of computer debugging, for the life of me, I can't understand how to read the Stack Text of a dump in Windbg. I've no idea of where to start on how to interpret them or how to go about it. Can anyone offer direction to this poor soul? ie (the only dump I have on ...
stackexchange/codereview
I am writing some code to see if there is a hole in the firewall exception list for WinXP and Vista for a specific port used by our client software. I can see that I can use the NetFwMgr.LocalPolicy.CurrentProfile.GloballyOpenPorts to get a list of the current Open port exceptions. But i can not figure out how to get...
stackexchange/codereview
This is not "exactly" a programming question, but it's highly related. We are writing an app that sends out email invitations for a client (no, it's not spam). Their designer gave us an HTML and CSS template to use which is fine. The problem is that it looks like crap in Outlook 2007 because Microsoft decided to use...
stackexchange/codereview
Basically what the title says. (Forgive me because I am a .NET newb) In my department, we have a server running .net 3.5 and ever since I got into this section I have been using LINQ. However, I am starting a personal project on a different server (obviously), so 2 questions: What do I need to get up and running with...
stackexchange/codereview
Is there an easy way to create standalone .exe files from Lua scripts? Basically this would involve linking the Lua interpreter and the scripts. I believe it is possible (PLT Scheme allows the creation of standalone executables in the same way), but how, exactly?
stackexchange/codereview
Is there any smart way to do this? If using Linq2Nhibernate, you really seem to have to rely on HQL or the likes to do multiple deletes from a database (without loading up and deleting one by one)? It doesn't seem like Linq2Sql have it either? I just want something that can do stuff like: DELETE FROM Accounts WHERE am...
stackexchange/codereview
I recently turned on Windows Firewall logging on my computer and started tracking incoming and outgoing connections. Something curious about the logfiles is that I have noticed numerous UDP packets (in fact, it constitutes basically all of my incoming traffic) that don't have my host as destination or source showing up...
stackexchange/codereview
The following code: template <typename S, typename T> struct foo { void bar(); }; template <typename T> void foo <int, T>::bar() { } gives me the error invalid use of incomplete type 'struct foo<int, T>' declaration of 'struct foo<int, T>' (I'm using gcc.) Is my syntax for partial specialization wrong? Note that ...
stackexchange/codereview
What's wrong with Linq to SQL? Or - what about Linq to SQL would make it unsuitable for a project, either new or existing? I want to hear about why you would not choose Linq to SQL for a particular project - including what project parameters make it unsuitable.
stackexchange/codereview
I have the following interface which I'm trying to make COM-visible. When I try to generate the type-library it doesn't like the fact that my implementation class derives from a generic-class. Is it possible to use a generic class as a COM implementation class? (I know I could write a non-generic wrapper and export t...
stackexchange/codereview
I have a ASP.Net page using ADO to query MS access database and as a learning exercise i would like to incorporate LINQ. I have one simple table called Quotes. The fields are: QuoteID, QuoteDescription, QuoteAuthor, QuoteDate. I would like to run simple queries like, "Give me all quotes after 1995". How would i inc...
stackexchange/codereview
I have been looking at various dependency injection frameworks for .NET as I feel the project I am working on would greatly benefit from it. While I think I have a good grasp of the capabilities of these frameworks, I am still a little unclear on how best to introduce them into a large system. Most demos (understandabl...
stackexchange/codereview
What is the best way to sort class members? I'm in conflict with a team member about this. He suggests that we should sort the members alphabetically. I think it's better to organize in a semantic manner: important attributes first, related methods together, etc. What do you think?
stackexchange/codereview
I'm pretty new to both C++ and Block Cipher encryption, and I am currently in the process of writing a decryption function for AES (16 byte seed / 16 byte blocks). All is going well, but my total data size is not always a multiple of my block size. I'm wondering what the best way to handle leftover data at the end of m...
stackexchange/codereview
I hope I haven't painted myself into a corner. I've gotten what seems to be most of the way through implementing a Makefile and I can't get the last bit to work. I hope someone here can suggest a technique to do what I'm trying to do. I have what I'll call "bills of materials" in version controlled files in a source ...
stackexchange/codereview
I tried to package a Twisted program with py2exe, but once I run the exe file I built, I got a "No module named resource" error. And I found the py2exe said: The following modules appear to be missing ['FCNTL', 'OpenSSL', 'email.Generator', 'email.Iterators', 'email.Utils', 'pkg_resources', 'pywintypes', 'resource', ...
stackexchange/codereview
Given two image buffers (assume it's an array of ints of size width * height, with each element a color value), how can I map an area defined by a quadrilateral from one image buffer into the other (always square) image buffer? I'm led to understand this is called "projective transformation". I'm also looking for a gen...
stackexchange/codereview
It sounds like Mozilla is having good luck improving JavaScript performance with TraceMonkey. See also Andreas Gal's paper on Trace Trees. Are these improvements available to other interpreters/compilers and if so, does this mean we'll see a cascade of improvements in other interpreted languages?
stackexchange/codereview
I would like to simulate filesystem corruption for the purpose of testing how our embedded systems react to it and ultimately have them fail as gracefully as possible. We use different kinds of block device emulated flash storage for data which is modified often and unsuitable for storage in NAND/NOR. Since I have a pr...
stackexchange/codereview
I have to implement the VinPower application. They offer a Java version, a C dll and an ActiveX dll, if anyone has an idea on where I could begin, I'd appreciate it.
stackexchange/codereview
Forgive me if this verges on being a "discussion" question, but I really would appreciate a yes/no answer, with an appropriate explanation. Suppose you have to design and implement a control API for a robot, say the next generation Mars Rover. Do you architect this API according to RESTful principles, or do you u...
stackexchange/codereview
We can use Bitmapsource object as the content of a Image control, However if I only have Bitmap object, can I use it directly, if I convert Bitmap to Bitmapsouce using the following method: Bitmap bitmap = imageObjToBeConvert; IntPtr HBitmap = bitmap.GetHbitmap(); result = Imaging.CreateBitmapSo...
stackexchange/codereview
I'm working with some code that is confusing me and I'm wondering if I'm just not grokking the data structures. The data I'm working with utilizes vectors and layers. I believe a vector is just a row of data but I'm not sure. Any information you could provide or point me to about the use of these would be very helpful....
stackexchange/codereview
I've tried this: string newScript = textBox1.Text; HtmlElement head = browserCtrl.Document.GetElementsByTagName("head")[0]; HtmlElement scriptEl = browserCtrl.Document.CreateElement("script"); lblStatus.Text = scriptEl.GetType().ToString(); scriptEl.SetAttribute("type", "text/javascript"); head.AppendChild(scriptEl); s...
stackexchange/codereview
I have a repeater that outputs divs like the following for every item returned from some method. <div class="editor-area"> <div class="title">the title</div> <div>the description</div> <div class="bottom-bar"> <a href="link">Modify</a> <a href="link2">Delete</a> </div> </div> I need to ...
stackexchange/codereview
Anyone have a good set of sqlplus configuration directives to help transform a given sql query into nicely tab separated output for pulling into a spreadsheet or further processing?
stackexchange/codereview
With the advent of new features like lambda expressions (inline code), does it mean we dont have to use delegates or anonymous methods anymore? In almost all the samples I have seen, it is for rewriting using the new syntax. Any place where we still have to use delegates and lambda expressions won't work?
stackexchange/codereview
I've recently inherited C# console application that is in need of some pruning and clean up. Long story short, the app consists of a single class containing over 110,000 lines of code. Yup, over 110,000 lines in a single class. And, of course, the app is core to our business, running 'round the clock updating data u...
stackexchange/codereview
I'm using HttpListener to allow a user to set up a proxy on a user-defined port. When I start the HttpListener, I get an exception if the application isn't running under administrator privileges in Vista. From what I've read, this is expected behavior - administrator privileges are required to start listening on a port...
stackexchange/codereview
I want to write a script which cleans the 'run' dialogue automatically every log off. Where is the history stored?
stackexchange/codereview
I need to encode a 100KB+ string as base64 in VBA. Are there any built-in functions or COM objects available which will do this as a pure VBA approach is either complex or doesn't scale well at these volumes (see links from dbb and marxidad)?
stackexchange/codereview
Is it possible to view an MS Access report in the .Net ReportViewer control?
stackexchange/codereview
I have many years of experience in Java including Swing, Servlet and JDBC, but have never programmed for a Java EE server. Many job advertisements from large companies are specifically asking for Java EE experience. Are there specific skills or development environments that I should learn to qualify for these kinds of...
stackexchange/codereview
I am getting very frustrated because I cannot seem to figure out why Collections shuffling is not working properly. Lets say that I am trying to shuffle the randomizer array. int[] randomizer = new int[] {200,300,212,111,6,2332}; Collections.shuffle(Arrays.asList(randomizer)); For some reason the elements stay sort...
stackexchange/codereview
Why does tempuri.org exist? Why does each XML Webservice require its own namespace, unique from any other on the web?
stackexchange/codereview
What is the difference between the search() and match() functions in the Python re module? I've read the Python 2 documentation (Python 3 documentation), but I never seem to remember it.
stackexchange/codereview
Using Xcode 3.1 on OSX 10.5; is it possible to attach (the debugger) to a running remote process? I know that it's possible to start and debug a remote process (as explained here), but it would be great if I could find a way to attach to an already running remote process... edit to add: Thanks. I've submitted a bug rep...
stackexchange/codereview
I was trying to insert new data into an existing XML file, but it's not working. Here's my xml file: <list> <activity>swimming</activity> <activity>running</activity> <list> Now, my idea was making two files: an index page, where it displays what's on the file and provides a field for inserting new elements, a...
stackexchange/codereview
Can I programatically set the position of a WPF ListBox's scrollbar? By default, I want it to go in the center.
stackexchange/codereview
What is the best way to take a given PHP object and serialize it as XML? I am looking at simple_xml and I have used it to parse XML into objects, but it isn't clear to me how it works the other way around.
stackexchange/codereview
I made a panel and set it to fill the screen, now I can see the windows under it but I want it to be click through, meaning they could click a file or see a tool tip of another object through the transparency. RE: This may be too obvious, but have you tried sending the panel to the back by right clicking and choosing...
stackexchange/codereview
I am working a standalone c# desktop application that sends out documents and then imports them from Outlook when they are sent back. The application picks up the emails from a specified folder processes them and then saves the senders name plus other stuff to a database. This works well for Outlook 2003 and 2007 which...
stackexchange/codereview
We have our JBoss and Oracle on separate servers. The connections seem to be dropped and is causing issues with JBoss. How can I have the JBoss reconnect to Oracle if the connection is bad while we figure out why the connections are being dropped in the first place?
stackexchange/codereview
What is meant by ‘value semantics’, and what is meant by ‘implicit pointer semantics’?
stackexchange/codereview
I need any tool or IDE environment to debug and test the vb scripts code. Please suggest any free ones. My vb scripts are standalone (vbs extenstion).
stackexchange/codereview
I am trying to convert an int into three bytes representing that int (big endian). I'm sure it has something to do with bit-wise and and bit shifting. But I have no idea how to go about doing it. For example: int myInt; // some code byte b1, b2 , b3; // b1 is most significant, then b2 then b3. *Note, I am aware tha...
stackexchange/codereview
I have been experimenting with WPF and rendering strict XAML markup in a web browser, also known as Loose XAML (explained here and here). It strikes me as mostly useful for displaying static content. However, it also appears possible to bind to an XML data provider. Loose XAML files are not compiled with an applicat...
stackexchange/codereview
I created a class derived from System.Configuration.Install for my installer. But the code in Uninstall() is being called when I try to update the application. How can I detect that the user is trying to update instead of uninstall? Maybe this post explains it better than me: My problem boils down to: when the user ...
stackexchange/codereview
In our legacy system, we wrote our own VM to execute our internal DSL at run time. The in-house VM was designed to run our internal DSL only. We are in the process of rewriting our legacy application. One of the idea we are considering is, to transform our internal DSL to external DSL (C# or Java) and take advantage of...
stackexchange/codereview
I've got a php page which handles requets for file downloads. I need to be able to detect when a file has been downloaded successfully. How can this be done? Perhaps there's some means of detecting this client-side then sending a confirmation down to the server. Thanks. Edit: By handle, I mean that the page is doing so...
stackexchange/codereview
Other than standard OO concepts, what are some other strategies that allow for producing good, clean PHP code when a framework is not being used?
stackexchange/codereview
Is there a way to access the response headers from an HTTP result when using Flash/Flex's URLLoader? Setting the request headers is possible, as is accessing the response code, but getting a hold of the actual response headers seems to be conspicuously lacking... Specifically, I would like to get a hold of the Last-Mod...
stackexchange/codereview
Let's say that I have two arrays (in Java), int[] numbers; and int[] colors; Each ith element of numbers corresponds to its ith element in colors. Ex, numbers = {4,2,1} colors = {0x11, 0x24, 0x01}; Means that number 4 is color 0x11, number 2 is 0x24, etc. I want to sort the numbers array, but then still have it so...
stackexchange/codereview
There are certain Crystal Reports features that cannot be combined in the same report, for example SQL command objects and server side grouping. However, as far as I can find, the built-in help doesn't seem to clearly document these conflicts. For example, checking the help page for either of those features doesn't men...
stackexchange/codereview
How do I make an asynchronous call to a web service using the PHP SOAP Extension?
stackexchange/codereview
Well, the question is pretty much in the title. I've just installed Visual Studio SP1, and now when I want to import a Entity Model from a database, it doesn't display the SQL Anywhere provider anymore. Does anyone know if there is a patch or some way to make it work with SP1? Thanks.
stackexchange/codereview
What is the most efficient way to get the default constructor (i.e. instance constructor with no parameters) of a System.Type? I was thinking something along the lines of the code below but it seems like there should be a simplier more efficient way to do it. Type type = typeof(FooBar) BindingFlags flags = BindingFlags...
stackexchange/codereview
What are the best JVM settings you have found for running Eclipse?
stackexchange/codereview
I'm not asking about general syntactic rules for file names. I mean gotchas that jump out of nowhere and bite you. For example, trying to name a file "COM<n>" on Windows?
stackexchange/codereview
I hope this is programmer-related question. I'm in the hobby business of C# programming. For my own purposes I need to parse html files and the best idea is..regular expression. As many found out, it's quite time consuming to learn them and thus I'm quite interested if you know about some application that would be able...
stackexchange/codereview
I used to often find myself coping a piece of code from a website/Word document etc only to discover that when doing Paste I would end up with the desired code plus some extra HTML tags/text, basically extra formatting information. To get rid of that extra ballast I would paste the text to the Notepad and then copy it ...
stackexchange/codereview
i have robot and want to control it via internet using radio wave .. but still i dont know the best language to do that . with the need to build scure site to insure not any body can use it . i expect for site asp with c# but what is the language i'll need it to control from sender device to the recipt robot . also nee...
stackexchange/codereview
The vxWorks documentation states: The WDB agent itself is independent of the target operating system: it attaches to run-time OS services through a virtual-function run-time interface. The WDB agent can execute before VxWorks is running (as in the early stages of porting a BSP to a new board)." How can I use t...
stackexchange/codereview
I have this working definition: IDENTIFIER [a-zA-Z][a-zA-Z0-9]* I don't want to keep repeating the [a-zA-Z] and [0-9], so I made two new definitions DIGIT [0-9] VALID [a-zA-Z] How can I rewrite the IDENTIFIER rule to use the DIGIT and VALID definitions? I don't know how to do the "second" match, I'm stuck her...
stackexchange/codereview
JavaScript post request like a form submit shows you how to submit a form that you create via POST in JavaScript. Below is my modified code. var form = document.createElement("form"); form.setAttribute("method", "post"); form.setAttribute("action", "test.jsp"); var hiddenField = document.createElement("input"); hi...
stackexchange/codereview
I want to convert a string into a double and after doing some math on it, convert it back to a string. How do I do this in Objective-C? Is there a way to round a double to the nearest integer too?
stackexchange/codereview
I'm a big fan of log4net, but recently, some (in my department) have questioned its inclusion in our projects because of the seemingly heaviness of each logging method. I would argue that there are better techniques than others, but that's another question. I'm curious to know, what is the typical impact of a log4net D...
stackexchange/codereview
I am wondering what everyone thinks the best method of handling results from your own database is. Other teams may be involved and there is always the chance the procedure/data could be altered and erroneous results would occur. My question is this. Is it better to let and exception occur, catch and log it or try to ha...
stackexchange/codereview
In the Ajax toolkit you can use a Tab Container and add TabPanels to this. I have some controls that I want to be able to use across all tabs and the tailor the tabs with other controls as neccessary. My question is how do I reuse a panel on multiple tabs? Essentially I after something like this <TabContainer> <tabP...
stackexchange/codereview
I have the following template <h2>one</h2> <xsl:apply-templates select="one"/> <h2>two</h2> <xsl:apply-templates select="two"/> <h2>three</h2> <xsl:apply-templates select="three"/> I would like to only display the headers (one,two,three) if there is at least one member of the corresponding template. How do I check for...
stackexchange/codereview
I am just checking out F#, so apologies if this is a silly question, but in the VS2008 F# CTP 1.9.6.2 'Tutorial' project, both // and /// are used for commenting code. Is there a functional difference between the two slash vs three slash commenting, or is it convention (as it appears in the tutorial code) to comment a ...
stackexchange/codereview
My application has no forms. It runs by calling Application.Run();
stackexchange/codereview
Logging can get complicated, quickly. Considering that you have some code, how do you add logging to it? What library(ies) do you use? What are some good code techniques for getting the most out of your logging statements while having minimal impact on your application?
stackexchange/codereview
Martin Fowler says that we should do refactoring before adding new features (given that the original program is not well-structured). So we all want to refactor this dirty codebase, that's for sure. We also know that without unit-testing code it's very easy to introduce subtle bugs. But it's a large codebase. Adding a ...
stackexchange/codereview
How do I go about adding a trendline to a bar chart in reporting services 2005?
stackexchange/codereview
Has anyone been able to implement the JQuery grid plugin, jqGrid? I'm trying to implement the JSON paging, and I feel like I'm getting close, but that I am also being swamped by inconsequential details. If anyone could post some sample code, I would greatly appreciate it.
stackexchange/codereview
I have a query that looks like this: public IList<Post> FetchLatestOrders(int pageIndex, int recordCount) { DatabaseDataContext db = new DatabaseDataContext(); return (from o in db.Orders orderby o.CreatedDate descending select o) .Skip(pageIndex * recordCount) .T...
stackexchange/codereview
I can't be sure if my code is sucking, or if it's just that the browsers haven't caught up with the spec yet. My goal is to simulate list markers using generated content, so as to get e.g. continuation of the counters from list to list in pure CSS. So the code below, which I think is correct according to the spec, is l...
stackexchange/codereview
How do I use the jQuery Datepicker with a textbox input: $("#my_txtbox").datepicker({ // options }); that doesn't allow the user to input random text in the textbox. I want the Datepicker to pop up when the textbox gains focus or the user clicks on it, but I want the textbox to ignore any user input using the keyboa...
stackexchange/codereview
Our graphics person uses Adobe Illustrator and we'd like to use her images inside our WPF application as paths. Is there a way to do this?
stackexchange/codereview
I'm trying to get this simple PowerShell script working, but I think something is fundamentally wrong. ;-) ls | ForEach { "C:\Working\tools\custom-tool.exe" $_ } I basically want to get files in a directory, and pass them one by one as arguments to the custom tool.
stackexchange/codereview
I am looking for a method to compare and sort UTF-8 strings in C++ in a case-insensitive manner to use it in a custom collation function in SQLite. The method should ideally be locale-independent. However I won't be holding my breath, as far as I know, collation is very language-dependent, so anything that works on la...
stackexchange/codereview
I mean 100+ MB big; such text files can push the envelope of editors. I need to look through a large XML file, but cannot if the editor is buggy. Any suggestions?
stackexchange/codereview
When I call Response.Redirect(someUrl) I get the following HttpException: Cannot redirect after HTTP headers have been sent. Why do I get this? And how can I fix this issue?
stackexchange/codereview
I have a trace setup for SQL Server Profiler to monitor SQL that is executed on a database. I recently discovered that trigger execution is not included in the trace. After looking through available events for a trace, I do not see any that look like they would include trigger execution. Does anyone know how to setu...
stackexchange/codereview
I installed Ruby and Ruby on Rails yesterday on Vista 32bit using the directions on this site: http://rubyonrails.org/down So I downloaded the installer, then Gems, then I downloaded rails with Gems. Now I can't use the Gem or Ruby commands in the command line... so I assume there's something wrong with the environment...
stackexchange/codereview
How do you perform a CROSS JOIN with LINQ to SQL?
stackexchange/codereview
I use a MacBook, but I've got a usual keyboard attached to it. The problem is that the keys don't exactly map 1-to-1. One thing is the APPLE and ALT keys. They map to WIN and ALT, but they are usually physically inverted, so if you want to use them with the same layout you have to invert them in the OS. The Function ke...
stackexchange/codereview
Let's say I want to represent \q (or any other particular "backslash-escaped character"). That is, I want to match \q but not \\q, since the latter is a backslash-escaped backslash followed by a q. Yet \\\q would match, since it's a backslash-escaped backslash followed by a backslash-escaped q. (Well, it would match...
stackexchange/codereview
What is the approved way to convert from char* to System::string and back in C++/CLI? I found a few references to marshal_to<> templated functions on Google, but it appears that this feature never made the cut for Visual Studio 2005 (and isn't in Visual Studio 2008 either, AFAIK). I have also seen some code on Stan Lip...
stackexchange/codereview
How do you actually perform datetime operations such as adding date, finding difference, find out how many days excluding weekends in an interval? I personally started to pass some of these operations to my postgresql dbms as typically I would only need to issue one sql statement to obtain an answer, however, to do it ...
stackexchange/codereview
A while back I was reading the W3C article on 'Re-using Strings in Scripted Content', which contains some useful advice on internationalisation, but which strikes me as at odds iwth the DRY (Don't Repeat Yourself) principle of eliminating repetitive code. To take their example, we might have some code like this... prin...
stackexchange/codereview
After installing Oracle XE, something in Oracle is listening on port 8080. I am not sure if they have an Apache HTTPD, a Tomcat, or something else. But how can I disable it?
stackexchange/codereview
I work with a lot of offsite developers and contractors. I ask them daily to send me a quick 5 minute status of their work for the day. I have to sometimes consolidate the status of individuals into teams and sometimes consolidate the status of a week, for end-of-period reporting to my clients. I want to learn: Items ...
stackexchange/codereview
Has anyone ever written a function that can convert all of the controls on an aspx page into a read only version? For example, if UserDetails.aspx is used to edit and save a users information, if someone with inappropriate permissions enter the page, I would like to render it as read-only. So, most controls would be ...
stackexchange/codereview
I am trying to learn some of the basic and advanced features of visual studio, Anyone find sites that have this type of information ? I see this: https://stackoverflow.com/questions/86355/best-way-to-learn-visual-studio-power-features But it seems more related to tips and advanced features. All three versions ( 2003, 2...
stackexchange/codereview
With very large amounts of ram these days I was wondering, it is possible to allocate a single chunk of memory that is larger than 4GB? Or would I need to allocate a bunch of smaller chunks and handle switching between them? Why??? I'm working on processing some openstreetmap xml data and these files are huge. I'm curr...
stackexchange/codereview
I'm using a lot of JQuery in a web application that I am building for a client and I want to find an javascript implementation of a modal dialog that is reasonably stable across the following browser set. IE 7+ FF 2+ Chrome and Safari I've tried a couple of jQuery plugins but there always seems to be artifacts in one o...
stackexchange/codereview