instruction
stringlengths
0
30k
> I have to explicitly null the session > value during non postbacks in order to > emulate how ViewState works. I'm still foggy as to why you can't store whatever object(s) you are binding against in session. If you could store that object in session the following should work: 1. On first load bind your top use...
> I have to explicitly null the session > value during non postbacks in order to > emulate how ViewState works. I'm still foggy as to why you can't store whatever object(s) you are binding against in session. If you could store that object in session the following should work: 1. On first load bind your top use...
I suppose you need VBA code: Public Function GetColumnAddress(nCol As Integer) As String Dim r As Range Set r = Range("A1").Columns(nCol) GetColumnAddress = r.Address End Function
Out of curiosity, are you using a DOCTYPE, and if so, which one? I'm not saying incompatabilities with the DOCTYPE are the issue, but quirks mode is something to rule out before trying anything else.
Lose the parentheses and commas. Calling your function as: $s = CreateAppPoolScript "name" "user" "pass" gives: cscript adsutil.vbs CREATE "w3svc/AppPools/name" IIsApplicationPool cscript adsutil.vbs SET "w3svc/AppPools/name/WamUserName" "user" cscript adsutil.vbs SET "w3svc/AppPools/nam...
You can use a RichTextbox to convert RTF to text or vice versa. RichTextBox r = new RichTextBox(); r.RtfText = strRTFString; Console.WriteLine(r.Text);
You can use a RichTextbox to convert RTF to text or vice versa. RichTextBox r = new RichTextBox(); r.Rtf = strRTFString; Console.WriteLine(r.Text);
You can use a RichTextbox to convert RTF to text or vice versa. RichTextBox r = new RichTextBox(); r.Rtf = strRTFString; Console.WriteLine(r.Text); Edit: Why has this been modded down?
You can use a RichTextbox to convert RTF to text or vice versa. RichTextBox r = new RichTextBox(); r.Rtf = strRTFString; Console.WriteLine(r.Text);
How do I find the Excel column name that corresponds to a given integer?
|excel|algorithm|language-agnostic|
How would you determine the column name (e.g. "AQ" or "BH") of the nth column in Excel?
How would you determine the column name (e.g. "AQ" or "BH") of the nth column in Excel? Edit: I mean a function to determine this.
|language-agnostic|algorithm|excel|
How would you determine the column name (e.g. "AQ" or "BH") of the nth column in Excel? Edit: A language-agnostic algorithm to determine this is the main goal here.
I had a similar problem. My solution was to: 1. import into a staging-table. 2. delete the duplicates 3. copy what's left over into the live table It's a little BFI, but it just plain works.
One more, using urlretrieve import urllib urllib.urlretrieve ("http://www.example.com/songs/mp3.mp3", "mp3.mp3")
Is GDI+ actually still a "usable" technology?
|.net|gdi+|
I just wonder a bit whether or not GDI+ is still a technology worth using, especially in a .net sense. Granted, GDI+ is still THE technology to handle Images in Windows, but it is also unmanaged code (obviously). Now, after discovering that GDI+ is actually not supported on ASP.net¹, I just wonder: Is it actually fe...
One of the most frustrating things about writing unit tests is dealing with dependencies. One of the greatest things about Test-Driven Development is that it produces code that is decoupled from its dependencies. Cool, huh? When I find myself asking questions like this one, I look for ways to decouple the code I'm...
Is the type of id compatible with 555? Or has it been changed to a non-integer type? Alternatively, does the 555 argument somehow go missing (e.g. if you are using JDBC and the prepared statement did not get its arguments set before executing the query)?
If you're shelling out, I'd use the reg command (details below). If you can tell us what language you're working with, we could provide language specific code. C:\>reg /? REG Operation [Parameter List] Operation [ QUERY | ADD | DELETE | COPY | SAVE | LOAD | UNLOAD | RESTORE | ...
there we go, <sarcasm>apparently when you create another ctor, you have to actually call the no arg ctor in order for the stuff in the ctor to happen</sarcasm>
Using core JQuery, how do you remove all the options of a select box, then add one option and select it?
|javascript|jquery|
My select box is the following <Select id="mySelect" size="9" </Select> thanks
My select box is the following <Select id="mySelect" size="9" </Select> thanks EDIT: This answer was helpful with chaining...however (in IE) .val('whatever') did not select the option that was added. (I did use the same 'value' in both .append and .val) $('#mySelect').find('option').remove().end().a...
My select box is the following <Select id="mySelect" size="9" </Select> thanks EDIT: This answer was helpful with chaining...however (in IE) .val('whatever') did not select the option that was added. (I did use the same 'value' in both .append and .val) $('#mySelect').find('option').remove().end().a...
My select box is the following <Select id="mySelect" size="9" </Select> thanks EDIT: This answer was helpful with chaining...however (in IE) .val('whatever') did not select the option that was added. (I did use the same 'value' in both .append and .val) $('#mySelect').find('option').remove().end().a...
How much control do you have over the download process? If you roll your own, you can have the file being downloaded go to a temp directory or have a temporary name until it's finished downloading, and then mv it to the correct name when it's done. If you're using third party software, then you don't have as much con...
If they are coming from a Java world, they are used to garbage collection. As such, I'd probably spend a bit of time talking about smart (reference counted) pointers, and how they compare to garbage collection.
VeriSign (ick)'s SeatBelt plugin: <https://pip.verisignlabs.com/seatbelt.do> Ideally, the plugin would allow a higher-level of authentication. I know something like this was planned for the OLPC.
Citrix Server sort of app - on a Mac?
|macos|citrix|
Does anyone know of a similar product to Citrix Server that'll run on the Mac OS? Essentially, I'm looking to allow multiple remote users to log in to the same OSX Server at the same time (with full visual desktop, not SSH).
Splitting the layers is only needed for more than 450 users. I would also recommend having the Build Server on a completely seperate machine. Building is very file system intensive. SQL Server performs best when it has complete control of a file system - so having build and TFS on the same machine may create perfo...
I can only once again point to [Stroustrup](http://www.research.att.com/~bs/new_learning.pdf) and preach: Don't teach the C subset! It's important, but not for beginners! C++ is complex enough as it is and the standard library classes, especially the STL, is much more important and (at least superficially) easier to un...
Memory management (pointers, allocation etc), basics of STL and templates (since STL uses templates). I think STL is important since one would be missing the richness of the Java SE class library in C++.
Mapping collections with LINQ
|linq|functional-programming|
I have a collection of objects to which I'd like to just add a new property. How do I do that with LINQ?
Something that I haven't seen mentioned thus far: the people who know the database best aren't always the people that write the application code. Stored procedures give the database folks a way to interface with programmers that don't really want to learn that much about SQL. Large--and especially legacy--databases are...
I like to keep this option turned off (especially when working with a big project), but it's useful to be able to find the file in the tree now and then. I found a way to do this here: http://weblogs.asp.net/kdente/archive/2008/04/30/locating-the-active-item-in-solution-explorer.aspx I hope I'm not being too verb...
If your application is not particularly processor intensive, [redgate ANTS Profiler][1] is a good choice - the line-by-line stats can come in quite handy, and the whole product is clean and well-designed. If your app needs a lot of CPU to operate normally, however, most of the .NET profilers on the market won't be a...
How do I implement an OpenID server in Rails?
|ruby-on-rails|openid|
I see a similar question [for Ubuntu](http://stackoverflow.com/questions/28588/how-do-you-set-up-an-openid-provider-server-in-ubuntu), but I'm interested in hosting my own OpenID provider through my Rails-based site that already has an identity and authentication system in place. Note that I'm not looking for the de...
Things that modern computers do a lot of, where a little benefit could go a long way? Let's see... * Data management: relational database management could benefit from faster relational joins (especially joins involving a large number of relations). Involves massive homogeneous data sets. * Tokenising, lexing, pars...
Nothing renders below select controls in IE6. It's one of the many "features" microsoft bestowed upon us when they gifted IE to the world You have to hide them, then re-show them. Observe the [standard lightbox script](http://code.google.com/p/nucleus-plugins/source/browse/lightbox2/trunk/lightbox2/js/lightbox.js...
Although more general than some of the other tips, here is mine: When using a large number of "items", try to avoid creating a control for each one of them, rather reuse the controls. For example if you have 10 000 items, each corresponding to a button, it is very easy to (programatically) create a 10 000 buttons an...
I believe I understand the problem. The exception is being caught, the issue is confusion over the debugger's behavior and differences in the debugger settings among each person trying to repro it. In the 3rd case from your repro I believe you are getting the following message: "NoViableAltException was unhandled by...
G'day, One case that I can think of is when the data you are modelling cannot be easily represented in a relational database. Once such example is the database used by mobile phone operators to monitor and control base stations for mobile telephone networks. I almost all of these cases, an [OO DB][1] is used, ...
***Lisp recursive:*** (defun factorial (x) (if (<= x 1) 1 (* x (factorial (- x 1)))))
The parts of your application that talk to the outside world (ie UI, database etc.) are always a problem when unit-testing. The way around this is actually not to test those layers but make them as thin as possible. For the UI you can use a humble dialog or a view that doesn't do anything worth testing and then put all...
Windows Presentation Foundation. It's basically Microsoft's latest attempt to make development easier, and provide a whole heap of nice functionality out of the box. I'm not sure where to start, but googling "WPF 101" should throw up a few useful links.
Why do people think that an memory leak in .net is not the same as an other leak? An memory leak is when you attach to an resource and do not let it go, that you can do both in managed and in unmanaged coding. Regarding .net, and other programming tools, there have been ideas about garbage collecting, and other w...
I once retooled a messy tables-for-layout to xhtml 1.0 transitional and the size went from 100kb to 40kb. The images loaded went from 200kb to just 50kb. The reason I got such a large savings was because the site had all the JS embedded in every page. I also retooled all the JS so it was correct for both IE6 and FF2...
Perhaps I'm not fully understanding the need here. You are developing against 10g, but for your own test/dev environment you want a more lightweight database? Or, are you developing an application that synchs with 10g database when online, but when offline uses a local store? In both cases, I'd recommend staying...
As they say - "there are more than one way to skin a cat": Build it yourself, running something like Linux or *BSD. The benefit of this, is that it makes it easy to do the dynamic part of your question, it's just a matter of a few well-placed shell/python/perl/whatever scripts. The drawback is that your ceiling traf...
Over the last 8 years we maintained a small development network with about 20 to 30 machines. We had one computer dedicated to be the firewall. Actually, we never run into serious problems we are now replacing it with a dedicated router/firewall solution (though we haven't decided yet which). Reasons for that are: s...
It seems to me the problem is *transferring* a file before it's complete, not that you're deleting it. If this is Linux, it's possible for a file to be open by process A and process B can unlink the file. There's no error, but of course A is wasting its time. Therefore, the fact that rsync deletes the source file ...
Here's a regex to match IPv4 addresses: \b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b You'll need to escape the backlashes when you specify it as a string literal in Java: "\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[...
Here's a regex to match IPv4 addresses: \b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b You'll need to escape the backslashes when you specify it as a string literal in Java: "\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?...
Assuming "alphanumeric" means letters and numbers, you could treat each letter/number as a base-36 digit. Unfortunately, large strings will cause the number to grow rapidly and you'd have to resort to big integers, which are hardly efficient. If your strings are usually different when you make the comparison (i.e. s...
We haven't performed the type of scalability and perf tests necessary to come up with any conclusions. I think ScottGu may have been discussing potential perf targets. As we move towards Beta and RTM, we will internally be doing more perf testing. However, I'm not sure what our policy is on publishing results of perf t...
Checkout the [TimeComplexity](http://wiki.python.org/moin/TimeComplexity) page on the py dot org wiki. It covers set/dicts/lists/etc at least as far as time complexity goes.
k, found it. If any of your stylesheets is missing or pathed incorrectly, it throws a 404. If your 404 page has inline styles, they get respected via the "alternate sheets" rule in webkit. Thus, the red links on the "yellow screen of death" are causing my problem in overlap.
It would seem that an [MD5][1] hash would work fine. The risk of a hash collision would be extremely unlikely. Depending on the length of your string, a hash that generates an int/long would run into max value problems very quickly. [1]: http://en.wikipedia.org/wiki/MD5
I believe you want: if 'normal' != root.state(): tkMessageBox.showinfo("Key you!", " ".join(sys.argv[1:]))
var a = from i in ObjectCollection select new {i.prop1, i.prop2, i.prop3, ..., newprop = newProperty}
I'm guessing that you don't want them to hit the submit button more than once while the submit is processing. My approach has been to just hide the button entirely and display some sort of status indicator (animated gif, etc) instead.
I'm guessing that you don't want them to hit the submit button more than once while the submit is processing. My approach has been to just hide the button entirely and display some sort of status indicator (animated gif, etc) instead. Here's a very contrived example (it's technically in prototype but I think a jq...
Design: Java and returning self-reference in setter methods
|java|
I have already proposed this in [my blog][1], but I find this place the most appropriate. For classes that have a long list of setters that are used frequently, I found this way very useful (although I have recently read about the [Builder pattern][2] in Effective Java that is kinda the same). Basically, all setter ...
Can I generate ASP.NET MVC routes from a Sitemap?
|asp.net-mvc|url|sitemap|
I'm thinking of learning the ASP.NET MVC framework for an upcoming project. Can I use the advanced routing to create long URLs based on the sitemap hiearachy? Example navigation path:<br/> Home > Shop > Products > Household > Kitchen > Cookware > Cooksets > Nonstick Typical (I think) MVC URL:<br/> http://examp...
|asp.net|asp.net-mvc|url|routes|sitemap|
Does the OutputCacheFilter in the Microsoft MVC Preview 4 actually save on action invocations?
|mvc|aspnetmvc|aspnet|asp|c#|
We deployed a live, fresh, swanky site using preview 3 including rigorous stress testing. Page Output caching was our saviour and afforded us the ability to meet our performance contractual requirements. My question is, is there a difference between action OutputCacheFilter and page output caching? Is the act...
|mvc|aspnetmvc|asp.net|asp|c#|
|c#|asp.net|mvc|asp|asp.net-mvc|
|c#|asp.net-mvc|
|c#|asp.net|asp.net-mvc|outputcache|
I think there are three options, broadly speaking: 1. Instead of broadcasting UDP, you could create an entity (a thread, process, server, service, or whatever the thing is that exists in your solution) that keeps a list of subscribers and sends unicast UDP messages to them. 2. Use UDP multicast, but you'll have t...
the thing to remember is that unit testing is about testing the units of code you write. Your unit tests shouldn't test that clicking a button raises an event, but that the code being executed by that click event does as it's supposed to. What you're really wanting to do is test the underlying code does what it shou...
It's certainly effective lock-in, as 1800 says. But in fairness to the database vendors, the SQL standard is always playing catch-up to current databases' feature sets. Most databases we have today are of pretty ancient lineages. If you trace Microsoft SQL Server back to its roots, I think you'll find Ingres - one of t...
Object databases are not relational databases. They can be really handy if you just want to stuff some objects in a database. They also support versioning and modify classes for objects that already exist in the database. [db4o][1] is the first one that comes to mind. [1]: http://www.db4o.com/
You can go a long way just using files stored in the file system. RDBMSs are getting better at handling blobs, but this can be a natural way to handle image data and the like, particularly if the queries are simple (enumerating and selecting individual items.) Other things that don't fit very well in a RDBMS are hi...
G'day, Have a look in /etc/init.d for something similar and use that as a basis. See also crontab, or maybe at, to run on a regular basis. cheers, Rob
What is WPF?
|wpf|
I have seen lots of questions recently about WPF... - What is it? - What does it stand for? - How can I begin programming WPF?
|wpf|windows|microsoft|googleit|
|windows|wpf|microsoft|
I second the usage of TableLayoutPanel for single-line inline controls. I usually set each column and the first row to AutoSize and set each child control's Dock property to Fill in the designer. That gets the horizontal layout to display properly. To make the the text line up between labels/textboxes, set the Text...
OS X's Quartz window server has no remoting abilities, unlike [its predecessor](http://en.wikipedia.org/wiki/Display_PostScript). X11 *does*, but 'native' OS X applications don't use that; of the few Mac apps typically run in X11 (such as GIMP or CrossOver), none are specific to the Mac, so you might as well run them o...