instruction_seed stringlengths 1 35.8k | _source stringclasses 1
value |
|---|---|
I am debugging some code in the Selenium-rc proxy server. It seems the culprit is the HttpURLConnection object, whose interface for getting at the HTTP headers does not cope with duplicate header names, such as:
Set-Cookie: foo=foo; Path=/
Set-Cookie: bar=bar; Path=/
The way of getting at the headers through the HttpU... | stackexchange/codereview |
Is there a C# equivalent for the VB.NET FormatNumber function?
I.e.:
JSArrayString += "^" + (String)FormatNumber(inv.RRP * oCountry.ExchangeRate, 2);
| stackexchange/codereview |
When I was in China my company's website was blocked for about 24 hours.
I assume it was the "Great Chinese Firewall" but I was wondering if there is any way that I can find out exactly where a packet or TCP/IP connection gets blocked.
I was able to verify that it wasn't being blocked at our end(I used the local host f... | stackexchange/codereview |
How do I target .NET 3.5 alone after installing SP1 in VS2008? This is because VS 2008 lists only .NET 3.5, .NET 3.0 & .NET 2.0 and does not specifically show .NET 3.5 SP1.
| stackexchange/codereview |
How do you update a summary field's value from post function in JIRA?
| stackexchange/codereview |
I'm on .NET 2.0, running under Medium Trust (so TimeZoneInfo and the Registry are not allowed options). I'm asking the user for two dates and a time zone, and would really love to be able to automatically determine whether I need to adjust the time zone for DST.
This probably isn't even a valid scenario unless I hav... | stackexchange/codereview |
I'd like to check if a Class object represents a subclass of other class
for example
Class class1 = Class.forName("Class1");
Class class2 = Class.forName("Class2");
if(class1.isSubClassOf(class2)) // fake methos isSubClassOf
{
// do sth
}
How can I implement this isSubClassOf method ?
| stackexchange/codereview |
What modes are the best?
And any tips or tricks that make developing java in emacs a bit better.
| stackexchange/codereview |
I need to import largish (24MB) text files into a MySQL table. Each line looks like this:
1 1 0.008 0 0 0 0 0
There are one or more spaces after each field, and the last field is tailed by about 36 spaces before the newline.
How do I import such a file into MySQL? From the docu... | stackexchange/codereview |
We're currently building an application that executes a number of external tools. We often have to pass information entered into our system by users to these tools.
Obviously, this is a big security nightmare waiting to happen.
Unfortunately, we've not yet found any classes in the .NET Framework that execute command l... | stackexchange/codereview |
Scenario: Document library in SharePoint with column x of "Person or Group" type. From within a VBA macro (or VSTO add-in) we're trying to access the MetaProperty on the document to set/get the user name. Any attempt to access the value via the ContentTypeProperties collection throws a
Type MisMatch error (13).
Th... | stackexchange/codereview |
I'm building a Silverlight application and one of my caveats from last time was that if you need anything done right in Silverlight/WPF way you'd need to model your objects as a DependecyObject and use DependencyProperty(ies)
I find this model to be rather cumbersome, requiring static fields and initializers in half t... | stackexchange/codereview |
What would be the easiest way to re-order existing page events according to the ASP.NET Page LifeCycle?
I'm trying to make my events more readable and maybe make it easy to scroll into a sequentially near event.
If there's no easy way, is there a non-mouse way to quickly switch to a page event without having to type t... | stackexchange/codereview |
I understand that we can use SMS Sender in command line mode.
But i been getting this error same as this article http://www.oreillynet.com/pub/a/wireless/2003/10/10/sms.html
The smssender.exe will use the last device that was successfully used to send messages in the Windows version of SMS Sender. But I tried it many t... | stackexchange/codereview |
I want to implement a two-pass cache system:
The first pass generates a PHP file, with all of the common stuff (e.g. news items), hardcoded. The database then has a cache table to link these with the pages (eg "index.php page=1 style=default"), the database also stores an uptodate field, which if false causes the firs... | stackexchange/codereview |
From time to time, there will be student attached to our projects, i would certainly like to assign him/her many things to do so can learn more. But alot of times we are resigned to assigning stuff like documentaiton, updating of ui mockup screens etc. As problem is that is it bit hard to trust the quality of work prov... | stackexchange/codereview |
I'm a little blockheaded right now…
I have a date string in european format dd.mm.yyyy and need to transform it to mm.dd.yyyy with classic ASP. Any quick ideas?
| stackexchange/codereview |
How do you setup an asp.net sql membership role/membership provider on a production machine? I'm trying to setup BlogEngine.NET and all the documentation says to use the ASP.NET Website Administration tool from Visual Studio but that isn't available on a production machine. Am I the first BlogEngine user to use it on a... | stackexchange/codereview |
Has anyone used ADO.NET Data Services as a data source for Adobe Flex applications? If so, any success stories or tragedies to avoid? If you did use it, how did you handle security?
| stackexchange/codereview |
I'm looking for a good TraceListener for .Net that supports rolling over the log file based on size limits.
Constraints
Uses .Net built in Trace logging
Independent class or binary that's not part of some gigantic library
Allows rolling over a log file based on size
| stackexchange/codereview |
When running the default c++ project in Visual Studios for a Windows CE 5.0 device, I get an error complaining about missing resources. Depends says that my executable needs ayghsell.dll (the Windows Mobile shell), and CoreDll.dll. Does this mean that my executable can only be run on Windows Mobile devices, instead o... | stackexchange/codereview |
Everyone I talk to who knows (knew) about it claims it was the greatest thing since sliced bread. Why did it fail? Or, if it didn't fail, who's using it now?
| stackexchange/codereview |
I have a handful of projects that all use one project for the data model. Each of these projects has its own applicationContext.xml file with a bunch of repetitive data stuff within it.
I'd like to have a modelContext.xml file and another for my ui.xml, etc.
Can I do this?
| stackexchange/codereview |
I started using Sandcastle some time ago to generate a Documentation Website for one of our projects. It's working quite well but we've always only written documentation for classes, methods, properties (...) in our project and had completely separate documentation for the overall project and project parts/modules/name... | stackexchange/codereview |
I've seen a few examples on how to do build deployment, however I have something unique that I'd like to do:
Deploy the build to a folder that has the build number (eg. Project\Builds\8423)
Alter the version number in the .NET AssmblyInfo.cs to match the build number
Has anyone done this before with .NET projects usi... | stackexchange/codereview |
I'm just wondering if there can be a case where the hostname can be successfully resolved but the returned hostEntry.AddressList is empty.
Currently I'm doing something like this:
IPHostEntry hostEntry = Dns.GetHostEntry("some.hostname.tld");
if (hostEntry.AddressList.Count() < 1)
{
// can that ever happen?
throw n... | stackexchange/codereview |
We are using fmt:setBundle to load a resource bundle from a database (we extended the ResourceBundle class to do that).
When we modify a value in database, we have to reload the web server to display the new value on the web app.
Is there any simple way to use the new value without restarting the web server ?
(We do no... | stackexchange/codereview |
I'm considering the following: I have some data stream which I'd like to protect as secure as possible -- does it make any sense to apply let's say AES with some IV, then Blowfish with some IV and finally again AES with some IV?
The encryption / decryption process will be hidden (even protected against debugging) so it... | stackexchange/codereview |
What's the difference between failover and disaster recovery?
| stackexchange/codereview |
We have an app with an extensive admin section. We got a little trigger happy with features (as you do) and are looking for some quick and easy way to monitor "who uses what".
Ideally a simple gem that will allow us to track controller/actions on a per user basis to build up a picture of the features that are used and... | stackexchange/codereview |
I thought that CSIDL_COMMON_APPDATA\company\product should be the place to put files that are common for all users of the application and that the application can modify, however, on Vista this is a read-only location, unless modified by the installer (as per MSDN - http://msdn.microsoft.com/en-us/library/ms995853.aspx... | stackexchange/codereview |
While I certainly understand the purpose of buffer annotations, I can't see what kind of errors __callback detects.
Any ideas, examples?
| stackexchange/codereview |
I have noticed that some browsers (in particular, Firefox and Opera) are very zealous in using cached copies of .css and .js files, even between browser sessions. This leads to a problem when you update one of these files, but the user's browser keeps on using the cached copy.
What is the most elegant way of forcing th... | stackexchange/codereview |
We have a discussion going on in my team at the moment, and I'd be interested in other views. Suppose we have a RESTful web service whose role is to annotate documents by applying a variety of analysis algorithms and services. The basic interaction in clear: we have a resource which is the document collection; the cli... | stackexchange/codereview |
I received the following exception when I was using the Regex class with the regular expression: (?'named a'asdf)
System.ArgumentException: parsing \"(?'named a'asdf)\" - Invalid group name: Group names must begin with a word character.
What is the problem with my regular expression?
| stackexchange/codereview |
I need a way to modify a value in a table after a certain amount of time has passed. My current method is as follow:
insert end time for wait period in table
when a user loads a page requesting the value to be changed, check to see if current >= end time
if it is, change the value and remove the end time field, if it... | stackexchange/codereview |
In c#, we have interfaces. Where did these come from? They didn't exist in c++.
| stackexchange/codereview |
I'm working on a database design for groups hierarchy used as the foundation of a larger system. Each group can contain other groups, and also 'devices' as leaf objects (nothing goes below device).
The database being used is MS SQL 2005. (Though working in MS SQL 2000 would be a bonus; a solution requiring MS SQL 2008 ... | stackexchange/codereview |
I see __all__ in __init__.py files. What does it do?
| stackexchange/codereview |
I'm writing a little desktop app that should be able to encrypt a data file and protect it with a password (i.e. one must enter the correct password to decrypt). I want the encrypted data file to be self-contained and portable, so the authentication has to be embedded in the file (or so I assume).
I have a strategy th... | stackexchange/codereview |
I am receiving a message from a commercial program stating that the "LogMessage" stored procedure is not found. There does not appear to be a stored procedure called LogMessage in the associated MS SQLServer 2000 database. What can I do to track down the missing procedure, other than calling the company?
| stackexchange/codereview |
I'm doing some testing on Firefox toolbars for the sake of learning and I can't find out any information on how to store the contents of a "search" drop-down inside the user's profile.
Is there any tutorial on how to sort this out?
| stackexchange/codereview |
I'm looking for a way to do query auto-completion/suggestions in Lucene. I've Googled around a bit and played around a bit, but all of the examples I've seen seem to be setting up filters in Solr. We don't use Solr and aren't planning to move to using Solr in the near future, and Solr is obviously just wrapping around ... | stackexchange/codereview |
As a temporary quick fix to mitigate the major risk while working on the permanent fix for XSS Vulnerability in a very large code base, I'm looking for a pre-existing XSS prevention blacklist that does a reasonable job of protecting against XSS.
Preferably a set of Regular Expressions. I'm aware of plenty of cheat shee... | stackexchange/codereview |
So you've created a ruby library.
How do you create and publish your rubygem? And what common pitfalls and gotchas are there pertaining to creating and publishing rubygems?
| stackexchange/codereview |
I have a requirement to be able to provide a flex component in English and several asian languages. I have looked at the flex documentation and it seems that I have to build several swf's, which feels wrong.
Does anyone know of a straightforward and practical way of bundling string resources in different languages a... | stackexchange/codereview |
I want to upload and then process a file in a Ruby on Rails app. The file upload is usually quite short, but the server-side processing can take some time (more than 20 seconds) so I want to give the user some indicator - something better than a meaningless 'processing...' screen.
I'm trying to use the following code ... | stackexchange/codereview |
When sockets are created or files are opened/created in C, is the file descriptor that's assigned to the socket/file guaranteed to be the lowest-valued descriptor available? What does the C spec say about file descriptor assignment in this regard, if anything?
| stackexchange/codereview |
RFC 1738 specifies the syntax for URL's, and mentions that
URLs are written only with the graphic
printable characters of the
US-ASCII coded character set. The
octets 80-FF hexadecimal are not
used in US-ASCII, and the octets 00-1F
and 7F hexadecimal represent
control characters; these must be
encoded.
... | stackexchange/codereview |
The problem is not about randomness itself (we have rand), but in cryptographically secure PRNG. What can be used on Linux, or ideally POSIX? Does NSS have something useful?
Clarification: I know about /dev/random, but it may run out of entropy pool. And I'm not sure whether /dev/urandom is guaranteed to be cryptograph... | stackexchange/codereview |
I am using VMware Server 1.0.7 on Windows XP SP3 at the moment to test software in virtual machines.
I have also tried Microsoft Virtual PC (do not remeber the version, could be 2004 or 2007) and VMware was way faster at the time.
I have heard of Parallels and VirtualBox but I did not have the time to try them out. Any... | stackexchange/codereview |
I am trying to create some cached user controls. Basically Header and Footer are static.
Except the footer has one link that reads in the URL of the page and puts it into the javascript for sending a link to a friend. So I need that link to be dynamic.
I set up a substitution control and had the static method return ... | stackexchange/codereview |
I will preface this question by saying, I do not think it is solvable. I also have a workaround, I can create a stored procedure with an OUTPUT to accomplish this, it is just easier to code the sections where I need this checksum using a function.
This code will not work because of the Exec SP_ExecuteSQL @SQL calls. An... | stackexchange/codereview |
I am building a table using the DataGridView where a user can select items from a dropdown in each cell. To simplify the problem, lets say i have 1 column. I am using the DataGridViewComboBoxColumn in the designer. I am trying to support having each row in that column have a different list of items to choose from.
... | stackexchange/codereview |
How can I set the background color of a specific item in a System.Windows.Forms.ListBox?
I would like to be able to set multiple ones if possible.
| stackexchange/codereview |
I have inherited a project that uses LLBLGen Pro for the DB layer. The DB model requires that when a entry is deleted a flag (DeletedDate is set to the current time). The last programmer ignored this requirement and has used regular deletes throughout the entire application.
Is there a way to set the code generator to ... | stackexchange/codereview |
I have just installed Windows Server 2003 Standard Edition and therefore IIS6 (comes as standard). I have also install the windows component that enable the administration of IIS from the browser (https://server:8098/). The problem I have is that I have to log-in to this tool but the Server Administrator u/name and p/w... | stackexchange/codereview |
Excluding the check digit, what is the minimum length number the luhn algorithm will work on?
My thoughts are that it would work on any number greater than 2 digits (again, excluding the check digit).
The reason I ask is this:
if i iterates over all digits in the number from right to left.
This causes i%2 == 0 (used ... | stackexchange/codereview |
I have one JSON that is coming in a string format. I need to store it in a key-pair value or something like that. I am using asp.net 2.0 and can not use 3rd party DLL like Newtonsoft.Json.dll. I guess last option will be to use regular expression.
Can anybody please help me in this?
| stackexchange/codereview |
What is the best way to store a large amount of text in a table in SQL server?
Is varchar(max) reliable?
| stackexchange/codereview |
I have a site on my webhotel I would like to run some scheduled tasks on. What methods of achieving this would you recommend?
What I’ve thought out so far is having a script included in the top of every page and then let this script check whether it’s time to run this job or not.
This is just a quick example of what I ... | stackexchange/codereview |
http://localhost:8080/rtsclient/loginform.faces
Url jnp://localhost:1099
Application Server Type jboss40
Datasource jdbc/ilogDataSource
User rtsAdmin
Password rtsAdmin
The above is for jboss.
Now i have deployed RTS onto Sun Application Server. And i want to configure the jndi such that.
My RTS client can actually... | stackexchange/codereview |
I am trying to optimize some stored procedures on a SQL Server 2000 database and when I try to use SQL Profiler I get an error message "In order to run a trace against SQL Server you have to be a member of sysadmin fixed server role.". It seems that only members of the sysadmin role can run traces on the server (someth... | stackexchange/codereview |
When you create a new web user control in visual studio it by default adds the Page_Load event. What is the advantage to using this rather than overriding the base OnLoad event on the control? Is it just that the Page_Load event fires before OnLoad?
| stackexchange/codereview |
Is there a way to have Visual Studio 2008 automatically add heading information to files? For example, "Copyright 2008" or something along those lines. I've been digging through the options, but nothing seems to be jumping out at me.
| stackexchange/codereview |
I'm trying to put together a selector in SASS that will operate on the visted, hovered state of a link, but I can't quite seem to get the markup right, can someone enlighten me?
I was writing it like this:
&:visited:hover
attribute: foo
| stackexchange/codereview |
Python allocates integers automatically based on the underlying system architecture. Unfortunately I have a huge dataset which needs to be fully loaded into memory.
So, is there a way to force Python to use only 2 bytes for some integers (equivalent of C++ 'short')?
| stackexchange/codereview |
I have a table of users which has a username column consisting of a six digit number e.g 675381, I need to prepend a zero to each of these usernames e.g. 0675381 would be the final output of the previous example, is there a query that could handle this?
| stackexchange/codereview |
Say for instance I was writing a function that was designed to accept multiple argument types:
var overloaded = function (arg) {
if (is_dom_element(arg)) {
// Code for DOM Element argument...
}
};
What's the best way to implement is_dom_element so that it works in a cross-browser, fairly accurate way?
| stackexchange/codereview |
In my database, I have a model which has a field which should be selected from one of a list of options. As an example, consider a model which needs to store a measurement, such as 5ft or 13cm or 12.24m3. The obvious way to achieve this is to have a decimal field and then some other field to store the unit of measureme... | stackexchange/codereview |
When reviewing, I sometimes encounter this kind of loop:
i = begin
while ( i != end ) {
// ... do stuff
if ( i == end-1 (the one-but-last element) ) {
... do other stuff
}
increment i
}
Then I ask the question: would you write this?
i = begin
mid = ( end - begin ) / 2 // (the middle element)
whil... | stackexchange/codereview |
In other words, is it correct to use:
public class CustomerList : System.Collections.Generic.List<Customer>
{
/// supposed to be empty
}
instead of:
using CustomerList = System.Collections.Generic.List<Customer>
I'd rather use the first approach because I'd just define CustomerList once, and every time I needed a... | stackexchange/codereview |
ex: <a><strike>example data in here</strike></a>
I want everything inside the a tag, to the end
/<a>([^<]*)<\/a>/
It works when there are no additional tags within the <a> tag, but what if there are?
I want to know if you can tell it to grab everything up to [^</a>] instead of [^<] only.
Doing it with /<a>(.*)<\/a>... | stackexchange/codereview |
I am wanting to find the distance between two different points. This I know can be accomplished with the great circle distance.
http://www.meridianworlddata.com/Distance-calculation.asp
Once done, with a point and distance I would like to find the point that distance north, and that distance east in order to create a b... | stackexchange/codereview |
I need to create a PRIVATE message queue on a remote machine and I have resolved to fact that I can't do this with the .NET Framework in a straight forward manner. I can create a public message queue on a remote machine, but not a PRIVATE one. I can create a message queue (public or private) locally.
I am wondering if... | stackexchange/codereview |
I am running some queries to track down a problem with our backup logs and would like to display datetime fields in 24-hour military time. Is there a simple way to do this? I've tried googling and could find nothing.
| stackexchange/codereview |
I'm downloading some images from a service that doesn't always include a content-type and doesn't provide an extension for the file I'm downloading (ugh, don't ask).
What's the best way to determine the image format in .NET?
The application that is reading these downloaded images needs to have a proper file extension o... | stackexchange/codereview |
Is it possible to detect when the user clicks on the browser's back button?
I have an Ajax application and if I can detect when the user clicks on the back button I can display the appropriate data back
Any solution using PHP, JavaScript is preferable. Hell a solution in any language is fine, just need something that I... | stackexchange/codereview |
How can I discover any USB storage devices and/or CD/DVD writers available at a given time (using C# .Net2.0).
I would like to present users with a choice of devices onto which a file can be stored for physically removal - i.e. not the hard drive.
| stackexchange/codereview |
Maybe my understanding of agile development isn't as good as it should be, but I'm curious how an agile developer would potentially use off-the-shelf (OTS) software when the requirements and knowledge of what the final system should be are changing as rapidly as I understand them to (often after each iteration of devel... | stackexchange/codereview |
I am looking for an open-source project involving c++ GUI(s) working with a database. I have not done it before, and am looking for a way to get my feet wet. Which can I work on?
| stackexchange/codereview |
I am a bit rusty on my cursor lingo in PL/SQL. Anyone know this?
| stackexchange/codereview |
I'm creating a new mail item, in C# VS-2008 outlook 2007, and attaching a file. The first issue is that I don't see an attachment area under the subject line showing the attachment. If I send the e-mail its properties show that there is an attachment and the e-mail size has grown by the attachment amount. I just can... | stackexchange/codereview |
I am programming a UNIX shell and I have to use the execv() system call to create a process.
One of the parameters for execv() is the filepath for the executable. So if somebody types in /bin/ls, it will run the ls executable. But what I need is a function such that when ls is typed, it will search for the filepath o... | stackexchange/codereview |
How can I specify the filename when dumping data into the response stream?
Right now I'm doing the following:
byte[] data= GetFoo();
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(data);
Response.End();
With the code above, I get "foo.aspx.pdf" as t... | stackexchange/codereview |
A client of mine uses Oracle 9i's utl_smtp to send mails out notifications to managers when their employees have made travel requests and they woul like quite a few changes made to the mailouts done.
We're having a lot of problems getting utl_smtp to talk to any smtp server on our network. We've even tried installing ... | stackexchange/codereview |
I want to set a breakpoint on the __DoPostBack method, but it's a pain to find the correct file to set the breakpoint in.
The method __DoPostBack is contained in an auto-generated js file called something like:
ScriptResource.axd?d=P_lo2...
After a few post-backs visual studio gets littered with many of these files,... | stackexchange/codereview |
I'm planning to propose to my (very small) company that we buy a computer to run continous integration on. If they say yes, the task of actually buying the machine will probably fall on me, so my question is:
What do I look for in a computer that will be used for continuous integration for a very small (3 people) php t... | stackexchange/codereview |
I came aboard a new project with a new company and we are trying to use JPA to do some DB work. So we have an Ear with an EJB, a webservice, and then there is a app client in the ear that really does all the work. The Webservice, calls the EJB, and the EJB calls the client to do the DB work. So within the appclient ... | stackexchange/codereview |
Which checksum algorithm can you recommend in the following use case?
I want to generate checksums of small JPEG files (~8 kB each) to check if the content changed. Using the filesystem's date modified is unfortunately not an option.
The checksum need not be cryptographically strong but it should robustly indicate chan... | stackexchange/codereview |
I'm looking for real world best practices, how other people might have implemented solutions with complex domains.
| stackexchange/codereview |
Does iPhone support XML-RPC, Is their any open source framework which I can use?
| stackexchange/codereview |
I need to calculate averages, standard deviations, medians etc for a bunch of numerical data. Is there a good open source .NET library I can use? I have found NMath but it is not free and may be overkill for my needs.
| stackexchange/codereview |
OK, I'm not looking for anti-patterns - I'm looking for things that aren't really patterns, or perhaps patterns that have been abused.
My personal least favourite is the "Helper" pattern.
E.g. I need to create a SQL query, so call SQLQueryHelper. This needs to process some strings, so it in turn calls StringHelper. Etc... | stackexchange/codereview |
Is it a good idea for me to use Qt Jambi in Java as a toolkit?
I see that Qt Jambi is hard to learn, and Swing is easier than Qt Jambi, but I think that Qt Jambi is more powerful.
| stackexchange/codereview |
Is there a way to use sql-server like analytic functions in Hibernate?
Something like
select foo from Foo foo where f.x = max(f.x) over (partition by f.y)
| stackexchange/codereview |
What RTOS is best for working on the same PC with Windows?
I know about RTX and INtime, but have not used them. Are there any others? Which one is your favorite and why?
| stackexchange/codereview |
Is there a SQL or PHP script that I can run that will change the default collation in all tables and fields in a database?
I can write one myself, but I think that this should be something that readily available at a site like this. If I can come up with one myself before somebody posts one, I will post it myself.
| stackexchange/codereview |
I'm looking to implement an ESB and wanted to get thoughts related to "how" my web services might change (WCF) or -- how my client apps that consume these services might "need to be revised" (-- other than a new service ref to the ESB path --)
The device I'm working with specifically is the "WebSphere DataPower XML Sec... | stackexchange/codereview |
I'm stuck with the following problem. I'm trying to implement a basic GridView paged result set, which connects to an Oracle database. By itself, the GridView, and the paged results, work fine. The problem comes when I try to put it in page layout class that we have at work.
We have ClassA, which inherits from Page, an... | stackexchange/codereview |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.