instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I need to know the maximum length of a textbox in ssrs. How much data can it accomodate?
stackexchange/codereview
I am new to Hibernate and attempting to run a java/spring example that retrieves data from a table in MS SqlServer. Everytime I try to run the program, the data source loads ok. But when spring tries to load the session facotry it gets the following error: Exception in thread "main" org.springframework.beans.factory.B...
stackexchange/codereview
Can someone explain why there is the need to add an out or in parameter to indicate that a generic type is Co or Contra variant in C# 4.0? I've been trying to understand why this is important and why the compiler can't just figure it out.. Thanks, Josh
stackexchange/codereview
I'm running into a common pattern in the code that I'm writing, where I need to wait for all threads in a group to complete, with a timeout. The timeout is supposed to be the time required for all threads to complete, so simply doing Thread.Join(timeout) for each thread won't work, since the possible timeout is then ti...
stackexchange/codereview
I am currently working on an iPhone 2.1 application. I am new to Objective C, coming from a Java background. My application has as a base the Utility Application template available in Xcode with the iPhone SDK. Currently I have some controls, such as an UISlider and text box, in the FlipsideView. The UISlider already h...
stackexchange/codereview
What is the best way to refresh a DataGridView when you update an underlying data source? I'm updating the datasource frequently and wanted to display the outcome to the user as it happens. I've got something like this (and it works), but setting the DataGridView.DataSource to null doesn't seem like the right way. List...
stackexchange/codereview
I've just started tinkering with XML manipulation with PHP, and i've stumbled into something unexpected. Here's the XML i'm using as a test input: <list> <activity1> running </activity1> <activity2> swimming </activity2> <activity3> soccer </activity3> </list> Now, i was expecting that this PHP code would ...
stackexchange/codereview
What's the easiest way to get the UTC offset in PHP, relative to the current (system) timezone?
stackexchange/codereview
There is a list of projects here, mainly the Facebook Developer Toolkit and Facebook.NET. However, I've seen a lot of negative feedback about the toolkit and it seems like Facebook.NET hasn't been upgraded to the latest facebook API. Are either of these worth using? Any other good libraries out there? Specifically I'm...
stackexchange/codereview
For example VK_LEFT, VK_DELETE, VK_ESCAPE, VK_RETURN, etc. How and where are they declared? Are they constants, #defines, or something else? Where do they come from? If possible, please provide a file name/path where they are declared. Or some other info as specific as possible.
stackexchange/codereview
This is just to satisfy my own curiosity. Is there an implementation of this: float InvSqrt (float x) { float xhalf = 0.5f*x; int i = *(int*)&x; i = 0x5f3759df - (i>>1); x = *(float*)&i; x = x*(1.5f - xhalf*x*x); return x; } in C#? If it exists, post the code. I guess I should have mentioned I was...
stackexchange/codereview
http://localhost/XYZ/Client/(S(enlodz55ov4ncafza0gpp045))/Info/Rates.aspx Does anyway know what /(S(enlodz55ov4ncafza0gpp045))/ means? Any help appreciated.
stackexchange/codereview
If I need a varchar(30) field, for example, that needs to contain several different foreign character sets, is there one particular language type that I can use in MySQL? For example, I have a field contains names in Chinese, Russian, English, Spanish and Portuguese, and possibly more in the future. How do I enable t...
stackexchange/codereview
Using MSSQL2005, can I truncate a table with a foreign key constraint if I first truncate the child table (the table with the primary key of the FK relationship)? I know that I can either Use a DELETE without a where clause and then RESEED the identity (or) Remove the FK, truncate the table, and recreate the FK. I th...
stackexchange/codereview
I'm making a program that fits the wizard concept ideally; the user is walked through the steps to create a character for a game. However, I'm realizing that the limitations of the wizard are making it difficult to design "elegant" logic flow. For example, because all pages of the wizard are initalized at the same time...
stackexchange/codereview
I heard about SSIS, a new replacement of the old DTS. I believe it has the same functionality which I used to perform. Now, like any other product from Microsoft, you have to mess with 10 different choices for a single package. I would like to get your opinion of which edition of SQL Server 2005 I should buy to ensure ...
stackexchange/codereview
Considering the criteria listed below, which of Python, Groovy or Ruby would you use? Criteria (Importance out of 10, 10 being most important) Richness of API/libraries available (eg. maths, plotting, networking) (9) Ability to embed in desktop (java/c++) applications (8) Ease of deployment (8) Ability to interface wi...
stackexchange/codereview
When calling DirectoryInfo.GetDirectories(".") on an instance of a DirectoryInfo class which points to a valid folder (excluding drive roots), the result is a DirectoryInfo array whose first (and only) element points to a invalid directory named the same as itself, below itself. For example: static void Main(string[] a...
stackexchange/codereview
The TextWrapping property of the TextBox has three possible values: Wrap NoWrap WrapWithOverflow I would like to bind to the IsChecked property of a MenuItem. If the MenuItem is checked, I want to set the TextWrapping property of a TextBox to Wrap. If the MenuItem is not checked, I want to set the TextWrapping prop...
stackexchange/codereview
How do I convert a string to DateTime format? For example, if I had a string like: "24/10/2008" How do I get that into DateTime format ?
stackexchange/codereview
Has anybody used a good obfuscator for PHP? I've tried some but they don't work for very big projects. They can't handle variables that are included in one file and used in another, for instance. Or do you have any other tricks for stopping the spread of your code?
stackexchange/codereview
Is there a way to make sure a (large, 300K) background picture is always displayed first BEFORE any other content is shown on the page? On the server we have access to PHP.
stackexchange/codereview
I'm looking to build a VM into a game and was wondering if anyone knew of any really simple VM's (I was thinking RISC/PIC was close to what I wanted) that are usually used for embedded projects such as controlling robots, motors, sensors, etc. My main concern is having to write a compiler/assembler if I roll my own. I'...
stackexchange/codereview
Is there a way to dump an entire assemblies source to files using reflector?
stackexchange/codereview
Someone left the organisation but before leaving, he locked all the files for an unknown reason. How do you unlock them all so that the other developers can work?
stackexchange/codereview
At the moment I use PHP for almost everything I develop for the Web but its linguistic limitations are starting to annoy me. However, as I developed some practices and maintain some PHP libraries that help me a lot, I don't feel I'd be ready to just switch to LISP throwing away all my PHP output. It could even be impos...
stackexchange/codereview
Could anyone show me a sample about how to use these two commands in Windbg please? I read the document in debugger.chm, but confused. I did search in Google and MSDN, but not find an easy to learn sample.
stackexchange/codereview
I accidentally added a binary file to SVN with the add command, and now I want to remove it from being version controlled, but not delete the file. How do I do this?
stackexchange/codereview
Having an issue with some images using IE7 - work fine in 6 and in all versions of Firefox. Has anyone run across this before? I know I've had it happen in the past (and I googled a fix, but darned if I can find the fix again... note to self, document things like this for future ;) ) <div class="contextBlock"> <p class...
stackexchange/codereview
I've been developing a GUI library for Windows (as a personal side project, no aspirations of usefulness). For my main window class, I've set up a hierarchy of option classes (using the Named Parameter Idiom), because some options are shared and others are specific to particular types of windows (like dialogs). The way...
stackexchange/codereview
I want to have a web based admin to upload, delete files and folders in Amazon S3 on ASP.NET website. I am pretty sure something like this already exist, has anyone seen it?
stackexchange/codereview
What's the best way to handle a visitor constructing their own URL and replacing what we expect to be an ID with anything they like? For example: ASP.Net MVC - handling bad URL parameters But the user could just as easily replace the URL with: https://stackoverflow.com/questions/foo I've thought of making every Control...
stackexchange/codereview
That's it. It's a dumb dumb (embarrassing!) question, but I've never used C# before, only C++ and I can't seem to figure out how to access a Label on my main form from a secondary form and change the text. If anybody can let me know real quick what to do I'd be so grateful! BTW, I should really clarify. Sorry: I've got...
stackexchange/codereview
Usually, I need to retrieve data from a table in some range; for example, a separate page for each search result. In MySQL I use LIMIT keyword but in DB2 I don't know. Now I use this query for retrieve range of data. SELECT * FROM( SELECT SMALLINT(RANK() OVER(ORDER BY NAME DESC)) AS RUNNING_NO , DATA_...
stackexchange/codereview
I've got a database here that runs entirely on GMT. The client machines, however, may run on many different time zones (including BST). When you pull data back using SqlConnection, it will translate the datetime value so, for instance 19 August 2008 becomes 18 August 2008 23:00:00. My question is, is there a way to s...
stackexchange/codereview
So in a .NET app , i got about 2 million items that i need to hold them in memory for processing , 1 by 1, would holding these items in a Stack collection , is better than holding them in a List collection, assuming that the memory used by the stack object will be keep minimizing every time an item is poped out of the ...
stackexchange/codereview
What site(s) do you recommend for looking at complimentary colors for site design? It would also be beneficial to enter a hex or RGB value and have the color wheel spit back complimentary colors. Most popular: Kuler Others in alphabetical order: 4096 Color Wheel Allprofitallfree - color-wheel2 Color Wheel v1.2 Javas...
stackexchange/codereview
Has anyone researched how to access the gps chipset on a blackberry over usb so that it is unnecessary to transmit this data over the cell carrier's data network? Is it possible to access the GPS chipset, store information in a buffer, and open an interface connection (over the usb charging port), for access? Not sur...
stackexchange/codereview
I would like to use Linq to Xml to get a single XElement from a .xml file by attribute name, similar to how you retrieve single objects in Linq to Sql by Id below: var singleDog = context.Dogs.Single(p => p.Id == int.Parse(Id)); Is this possible?
stackexchange/codereview
The following code receives seg fault on line 2: char *str = "string"; str[0] = 'z'; // could be also written as *str = 'z' printf("%s\n", str); While this works perfectly well: char str[] = "string"; str[0] = 'z'; printf("%s\n", str); Tested with MSVC and GCC.
stackexchange/codereview
I am working on an ASP.Net web application that must print dynamically created labels on standard Avery-style label sheets (one particular size, so only one overall layout). The labels have a variable number of lines (3-6) and may contain either lines of text or a graphic barcode image. Our first cut, that I inherited,...
stackexchange/codereview
I have seen at least one site in the past that had analytics on Open Source projects, describing lines of code, hours worked, number of check-ins, all sorts of stuff. Does anyone know of any of those sites?
stackexchange/codereview
I did it using the commands as described here and it works but I want to do it using the SQL Management Studio. SQL Server 2008 Books Online says this: To create a full-text catalog: In Object Explorer, expand the server, expand Databases, and expand the database in which you want to create the full-text catalo...
stackexchange/codereview
Clarification: this is not about user agent calls to pages, but Classic ASP calling ASP.NET! I have applications that are midway through a transition from Classic ASP to ASP.NET. There are a half million lines of code, so a complete rewrite of everything at once was simply not plausible, or frankly prudent considerin...
stackexchange/codereview
I am loading some data from an XML document, modifying it, and writing back out to XML. The reading is done using a SAX parser library and the writing is done with a piece of custom code. Sometimes, the file is modified externally, and extra elements are added (such as references to stylesheets). Rather than losing ...
stackexchange/codereview
There is another recent Project Euler question but I think this is a bit more specific (I'm only really interested in PHP based solutions) so I'm asking anyway. Question #5 tasks you with: "What is the smallest number that is evenly divisible by all of the numbers from 1 to 20?" Now, I have solved it twice. Once very i...
stackexchange/codereview
Similar to the one here on StackOverFlow, I would be needing to implement a way for people to vote up and vote down comments in a forum like site. However instead of having a generic overall score, we will display the total amount of "thumbs up" and "thumbs down". The overall score will be needed for filtering purposes...
stackexchange/codereview
I've got a little c# windows service that periodically pulls xml from a web service and stores the data in a database table. Unfortunately it's failing because the web service has occasional bad data in it - strings instead of decimals. I don't have any control over the web service (unvalidated user input from softwar...
stackexchange/codereview
When you have a derived class, is there an simpler way to refer to a variable from a method other than: BaseClass::variable EDIT As it so happens, I found a page that explained this issue using functions instead: Template-Derived-Classes Errors. Apparently it makes a difference when using templates classes.
stackexchange/codereview
I've seen some horrific code written in Perl, but I can't make head nor tail of this one: select((select(s),$|=1)[0]) It's in some networking code that we use to communicate with a server and I assume it's something to do with buffering (since it sets $|). But I can't figure out why there's multiple select calls or th...
stackexchange/codereview
Given a string of keywords, such as "Python best practices", I would like to obtain the first 10 Stack Overflow questions that contain that keywords, sorted by relevance (?), say from a Python script. My goal is to end up with a list of tuples (title, URL). How can I accomplish this? Would you consider querying Google ...
stackexchange/codereview
I'm looking to create a Visual Studio 2008 template that will create a basic project and based on remove certain files/folders based on options the user enters. Right now, I have followed some tutorials online which have let me create the form to query the user and pass the data into an IWizard class, but I don't know ...
stackexchange/codereview
I recently got involved in a Java project at work: we're using MyEclipse for the IDE, and Subclipse for source control integration. Since I am new to the project, I am currently submitting any changes I make as patches, to make it easier for the other team members to review my changes and decide whether or not to commi...
stackexchange/codereview
I been trying to get sqlcachedependecy working, but it doesn't appear to work I got the proper settings in my web.config and also global.asa, however when I run this query and the changes are made to the database from either with in or outside the web site the cached objects are not updated please someone help? I know...
stackexchange/codereview
I've seen a number of questions asking about a web SVN repository-browsing tool. However, of the ones I've taken a look at, they either require a specific username/password to be configured, rely on default access to the repository being available, or require a separate user database outside Subversion. In a corporate...
stackexchange/codereview
I have written a vector-based 3D editor (UI customized somewhat like technical drawings). I now want save the vectors/drawing data in portable formats. Which formats are available; which (one?) of them are the most widely accepted, and where can I get hold of the format specifications?
stackexchange/codereview
In a WPF app, is there a object I can assign to FileSystemWatcher.SynchronizingObject? I can make my own, but if there is one available, I would like to use it.
stackexchange/codereview
I'm looking at all the CSS Drop shadow tutorials, which are great. Unfortunately, I need to put a shadow on three sides of a block element (left, bottom, right). All the tutorials talk about shifting your block element up and to the left. Anyone have insights into putting a shadow on three or even four sides?
stackexchange/codereview
I have a window which contains an NSBox control. In that NSBox are several other controls, (popups, text fields, etc...) I have two other NSBox's in the same NIB file that are filled with controls that I would like to swap out with the first under certain conditions. I would like this to happen with a nice cross fade e...
stackexchange/codereview
I have recently had the need to write a fluent interface for C# that will essentially mirror SQL. Yes, I am aware of LINQ to SQL, but I'm interesting in getting "closer to the metal"--having something that essentially provides nothing more than an Intellisensified SQL shim within C#. E.g., var fq = new FluentQuery(); ...
stackexchange/codereview
Sometimes gdb prints "incomplete type" for some type of variables. What does this mean and how can we see that value?
stackexchange/codereview
I'm trying to read variables from a batch file for later use in the batch script, which is a Java launcher. I'd ideally like to have the same format for the settings file on all platforms (Unix, Windows), and also be a valid Java Properties file. That is, it should look like this: setting1=Value1 setting2=Value2 ... I...
stackexchange/codereview
If your data change after the application is deployed, how do you keep the database up to date? I mean, you can add or remove table, thats a simple task. Altering an existing table can be trivial too. But if you change the structure often, how do you keep that under a control? I used to keep a table with a current dat...
stackexchange/codereview
I'm getting a whole bunch of linker errors in Visual studios for methods I'm not even calling directly. I'm a java developer by day, but I have a project I need to do in C++, intended to run on windows machines. Hence, I'm stuck messing about with Visual Studio. Bascally, I have an os project that I added an accessor m...
stackexchange/codereview
Anyone know of an opensource PHP Load Testing Framework similar to the Grinder " "http://grinder.sourceforge.net/".
stackexchange/codereview
We don't currently have our SQL Server objects in any form of source control. We recently installed TFS 2008 and I'd like to get our SQL server code added. I think I could script all of the database and create script files for each object, but I'm hoping there is a way to point to a database in SSMS and create a projec...
stackexchange/codereview
Basically I'm trying to change the Canvas.Left property of an Ellipse Silverlight control in C#. Here is how I'm accessing the control: Ellipse c1 = this.FindName("Circle1") as Ellipse; How would I then set the Canvas.Left property? Thanks, Jeff
stackexchange/codereview
I have whitespace characters showing in the Visual Studio code editor, and I'd like to remove them.
stackexchange/codereview
As the question implies, I'm looking for a way to programmatically screen grab a given panorama, I.E set a longitude and latitude and POV (pitch, yaw and zoom) and save the grab to the server. So far the most promise has been shown by Using .net to control the google earth com api (http://earth.google.com/comapi/inde...
stackexchange/codereview
I have the following var id='123'; newDiv.innerHTML = "<a href=\"#\" onclick=\" TestFunction('"+id+"', false);\"></a>"; Which renders <a href="#" onclick="return Testfunction('123',false);"></a> in my HTML. The problem I have is that I wish to take the call to the method TestFunction, and use as a string parameter i...
stackexchange/codereview
The problem is very simple. An object needs to notify some events that might be of interest to observers. When I sat to validate a design that I cooked up now in Ruby just to validate it.. I find myself stumped as to how to implement the object events. In .Net this would be a one-liner.. .Net also does handler method s...
stackexchange/codereview
what is the naming convention for message bundle property files when using variants? for instance, if the locale is EN US, the property file lookup will be message_en_US.properties though, what if I instantiate a local EN US though the variant string is "DEVL" what is the search order?
stackexchange/codereview
The question is if a database connection should be passed in by reference or by value? For me I'm specifically questioning a PHP to MySQL connection, but I think it applies to all databases. I have heard that in PHP when you pass a variable to a function or object, that it is copied in memory and therefore uses twice a...
stackexchange/codereview
Is there a way to emulate mixins or traits in java? basically, I need a way to do multiple inheritance so I can add common business logic to several classes
stackexchange/codereview
I'm writing an image bank with Django, and I want to add a button to get a hi-res version of an image (the low-res is shown in the details page). If I put just an <a> link, the browser will open the image instead of downloading it. Adding an HTTP header like: Content-Disposition: attachment; filename="beach008.jpg" ...
stackexchange/codereview
I guess this is a multi-part question. I am building a membership site and want to have the accounts as international as possible. What is the best way to collect phone numbers on a form that allows for international numbers? I'm not worried about storing them, just collection and validation. What I have now is a d...
stackexchange/codereview
I am trying to convert an access datetime field to a mysdl format, using the following string: select str_to_date('04/03/1974 12:21:22', '%Y %m %d %T'); While I do not get an error, I do not get the expected result, instead I get this: +---------------------------------------------------+ | str_to_date('04/03/1974 12:...
stackexchange/codereview
What's the best way to write a LINQ query that inserts a record and then returns the primary key of that newly inserted record using C# ?
stackexchange/codereview
User A logs into a ticket management system to edit content on "SomePage.aspx" User B logs in 30 seconds later to edit the same ticket on "SomePage.aspx" What are some of the best known practices(in a 3-tier architecture) for notifying each of the users that someone else is modifying the same content?
stackexchange/codereview
I'm quite new to programming, and I was wondering if there is a good source of well-programmed non-standard C code and libraries. I Googled and didn't find anything. I was a bit surprised by this, especially because I used to search for many Python examples and libraries and never had trouble finding anything. I alrea...
stackexchange/codereview
I need to present a wizard once, the first time my windows forms application is run after install. I could use a user setting like firstrun = false I suppose. But I also need handle the case where the program is uninstalled, then reinstalled. How will that user setting be reset? It's already present in the config file ...
stackexchange/codereview
I have seen many examples, with many 'no, you missed something' comments. What is the right way to match an e-mail address? For Sanity sake, only fully-qualified domain names, no @localhost allowed. (or, both ways) Subdomains must be allowed (issac@deptartment.company.museum)
stackexchange/codereview
I have always initialized my strings to NULL, with the thinking that NULL means the absence of a value and "" or String.Empty is a valid value. I have seen more examples lately of code where String.Empty is considered the default value or represents no value. This strikes me as odd, with the newly added nullable type...
stackexchange/codereview
We are using LINQ very widely in our system. Particularly LINQ-to-objects. So in some places we end up having a LINQ query in memory build up from some huge expressions. The problem comes when there's some bug in the expressions. So we get NullReferenceException and the stack trace leads us nowhere (to [Lightweight Fun...
stackexchange/codereview
I have an ASP page which will fetch records from a SQL server DB table. The table "order_master" has a field called order_date. I want to frame a select query to fetch order date > a date entered by user(ex : 07/01/2008) I tried with convert and cast, but both are not working. The sample data in order_date column is 4/...
stackexchange/codereview
Related Article On a similar topic to the above article, but of a more specific note. How exactly do you handle items that are in the viewstate (so they are included on submit), but can also be changed via AJAX. For instance, say we had a dropdown list that was populated through an AJAX web service call (not an update ...
stackexchange/codereview
I know that JavaScript doesn't support macros (Lisp-style ones) but I was wondering if anyone had a solution to maybe simulate macros? I Googled it, and one of the solutions suggested using eval(), but as he said, would be quite costly. They don't really have to be very fancy. I just want to do simple stuff with them. ...
stackexchange/codereview
When I am using a form containing <input id="myFile" type="file" runat="server" /> to upload a file, my server-side code only sees the filename without the full path when using Firefox, while it works just fine in IE. Is it possible to retrieve the full file path server-side in this case?
stackexchange/codereview
Most of the time, I've seen release management handled as a defined process with the supporting tool as the version control system (usually via branching and tagging). However, are there any tools dedicated to release management? I'm looking for both open source and closed source tools, if any exist.
stackexchange/codereview
I've got this python dictionary "mydict", containing arrays, here's what it looks like : mydict = dict( one=['foo', 'bar', 'foobar', 'barfoo', 'example'], two=['bar', 'example', 'foobar'], three=['foo', 'example']) i'd like to replace all the occurrences of "example" by "someotherword". While I can alre...
stackexchange/codereview
Duplicate: What happens if you call erase on a map element while iterating from begin to end How to filter items from a stdmap I have a map map1<string,vector<string>> i have a iterator for this map "itr". i want to delete the entry from this map which is pointed by "itr". i can use the function map1.erase(itr); afte...
stackexchange/codereview
Multistrings (double null-terminated string of null-separated strings) are common in the Windows API. What's a good method for converting a multistring returned from an API to a C# string collection and vice versa? I'm especially interested in proper handling of character encoding (Windows XP an later). The following m...
stackexchange/codereview
Can't figure out why I'm getting 'SQL Statement ignored' and 'ORA-01775: looping chain of synonyms' on line 52 of this stored procedure. Got any ideas? CREATE OR REPLACE PACKAGE PURGE_LOG_BY_EVENT_DAYS AS TYPE dual_cursorType IS REF CURSOR RETURN dual%ROWTYPE; PROCEDURE log_master_by_event_days (event_id NUMBER,...
stackexchange/codereview
I have a PHP application which needs to output a python script, more specifically a bunch of variable assignment statements, eg. subject_prefix = 'This String From User Input' msg_footer = """This one too.""" The contents of subject_prefix et al need to be written to take user input; as such, I need to escape the cont...
stackexchange/codereview
I have an Ant script that needs to checkout a directory from Subversion. This works using svnant/svnkit. However, Subversion access is authenticated, and I do not want to store my user password in a file. Can I make svnkit pop up a password dialog? Or even better, make it use the same credential caching that subversiv...
stackexchange/codereview
What would you use to perform a compliance testing of an HTTP proxy? I've seen two projects so far: Web Polygraph (the feedback I got from a coworker is mostly negative) Funkload
stackexchange/codereview
Why is volatile needed in C? What is it used for? What will it do?
stackexchange/codereview
I've looked for references on the Audible format, and it appears that people are only interested in cracking/converting out of it. I've got a collection of MP3 files that I want to convert into Audible format for use on my Kindle and iPod. Does anybody have a good reference on the Audible or protected AAC formats and ...
stackexchange/codereview
I have a few links that should all open in the same window or tab. To accomplish this I've given the window a name like in this example code: <a href="#" onClick='window.open("http://somesite.com", "mywindow", "");'>link 1</a> <a href="#" onClick='window.open("http://someothersite.com", "mywindow", "");'>link 2</a> Th...
stackexchange/codereview
I am trying to figure out how a library works and I would like to be able to visualize which methods and lines of code are executed in response to user input (e.g. a keypress or mouse click). Is there a way to do this in .NET?
stackexchange/codereview