qid int64 1 3.11M | question stringlengths 10 32.1k | date stringlengths 10 10 | metadata list | response_j stringlengths 0 33.7k | response_k stringlengths 3 34.7k |
|---|---|---|---|---|---|
2,284,860 | I've been poring through .NET disassemblies and the GCC source code, but can't seem to find anywhere the actual implementation of `sin()` and other math functions... they always seem to be referencing something else.
Can anyone help me find them? I feel like it's unlikely that ALL hardware that C will run on supports ... | 2010/02/17 | [
"https://Stackoverflow.com/questions/2284860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172387/"
] | For `sin` specifically, using Taylor expansion would give you:
sin(x) := x - x^3/3! + x^5/5! - x^7/7! + ... (1)
you would keep adding terms until either the difference between them is lower than an accepted tolerance level or just for a finite amount of steps (faster, but less precise). An example would be something ... | if you want `sin` then
```
__asm__ __volatile__("fsin" : "=t"(vsin) : "0"(xrads));
```
if you want `cos` then
```
__asm__ __volatile__("fcos" : "=t"(vcos) : "0"(xrads));
```
if you want `sqrt` then
```
__asm__ __volatile__("fsqrt" : "=t"(vsqrt) : "0"(value));
```
so why use inaccurate code when the machine ... |
2,284,860 | I've been poring through .NET disassemblies and the GCC source code, but can't seem to find anywhere the actual implementation of `sin()` and other math functions... they always seem to be referencing something else.
Can anyone help me find them? I feel like it's unlikely that ALL hardware that C will run on supports ... | 2010/02/17 | [
"https://Stackoverflow.com/questions/2284860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172387/"
] | Concerning trigonometric function like `sin()`, `cos()`,`tan()` there has been no mention, after 5 years, of an important aspect of high quality trig functions: **Range reduction**.
An early step in any of these functions is to reduce the angle, in radians, to a range of a 2\*π interval. But π is irrational so simple ... | If you want an implementation in software, not hardware, the place to look for a definitive answer to this question is Chapter 5 of [Numerical Recipes](http://www.nr.com/). My copy is in a box, so I can't give details, but the short version (if I remember this right) is that you take `tan(theta/2)` as your primitive op... |
2,284,860 | I've been poring through .NET disassemblies and the GCC source code, but can't seem to find anywhere the actual implementation of `sin()` and other math functions... they always seem to be referencing something else.
Can anyone help me find them? I feel like it's unlikely that ALL hardware that C will run on supports ... | 2010/02/17 | [
"https://Stackoverflow.com/questions/2284860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172387/"
] | There's nothing like hitting the source and seeing how someone has actually done it in a library in common use; let's look at one C library implementation in particular. I chose uLibC.
Here's the sin function:
<http://git.uclibc.org/uClibc/tree/libm/s_sin.c>
which looks like it handles a few special cases, and then ... | I'll try to answer for the case of `sin()` in a C program, compiled with GCC's C compiler on a current x86 processor (let's say a Intel Core 2 Duo).
In the C language the Standard C Library includes common math functions, not included in the language itself (e.g. `pow`, `sin` and `cos` for power, sine, and cosine res... |
2,284,860 | I've been poring through .NET disassemblies and the GCC source code, but can't seem to find anywhere the actual implementation of `sin()` and other math functions... they always seem to be referencing something else.
Can anyone help me find them? I feel like it's unlikely that ALL hardware that C will run on supports ... | 2010/02/17 | [
"https://Stackoverflow.com/questions/2284860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172387/"
] | The actual implementation of library functions is up to the specific compiler and/or library provider. Whether it's done in hardware or software, whether it's a Taylor expansion or not, etc., will vary.
I realize that's absolutely no help. | Don't use Taylor series. Chebyshev polynomials are both faster and more accurate, as pointed out by a couple of people above. Here is an implementation (originally from the ZX Spectrum ROM): <https://albertveli.wordpress.com/2015/01/10/zx-sine/> |
2,284,860 | I've been poring through .NET disassemblies and the GCC source code, but can't seem to find anywhere the actual implementation of `sin()` and other math functions... they always seem to be referencing something else.
Can anyone help me find them? I feel like it's unlikely that ALL hardware that C will run on supports ... | 2010/02/17 | [
"https://Stackoverflow.com/questions/2284860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172387/"
] | OK kiddies, time for the pros....
This is one of my biggest complaints with inexperienced software engineers. They come in calculating transcendental functions from scratch (using Taylor's series) as if nobody had ever done these calculations before in their lives. Not true. This is a well defined problem and has been ... | The essence of how it does this lies in this excerpt from *Applied Numerical Analysis* by Gerald Wheatley:
>
> When your software program asks the computer to get a value of
> [](https://i.stack.imgur.com/H9tMQ.gif) or [![enter image description her... |
2,284,860 | I've been poring through .NET disassemblies and the GCC source code, but can't seem to find anywhere the actual implementation of `sin()` and other math functions... they always seem to be referencing something else.
Can anyone help me find them? I feel like it's unlikely that ALL hardware that C will run on supports ... | 2010/02/17 | [
"https://Stackoverflow.com/questions/2284860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172387/"
] | Chebyshev polynomials, as mentioned in another answer, are the polynomials where the largest difference between the function and the polynomial is as small as possible. That is an excellent start.
In some cases, the maximum error is not what you are interested in, but the maximum relative error. For example for the s... | Don't use Taylor series. Chebyshev polynomials are both faster and more accurate, as pointed out by a couple of people above. Here is an implementation (originally from the ZX Spectrum ROM): <https://albertveli.wordpress.com/2015/01/10/zx-sine/> |
423,896 | I am getting to grips with Windows Azure. I usually use NInject as my IoC container in web apps. However, when trying to use it within an Azure web role I get a security exception (something to do with reflection permission).
Has anyone used other IoC with Azure and had succcess? | 2009/01/08 | [
"https://Stackoverflow.com/questions/423896",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7011/"
] | I just have been prototyping with Azure services today (not Web role, though).
Autofac IoC Container for .NET has worked in this scenario. | From Ninject google group: <http://groups.google.com/group/ninject/browse_thread/thread/8d5a0aff853c6b4f/20209877f8db179a?show_docid=20209877f8db179a>
If you set the kernel option UseReflectionBasedInjection, Ninject will work
in Azure (as well as other partial trust environments):
```
var options = new KernelOptio... |
1,494,129 | I'd like to be able to write something like the following. Can someone show me how to write a clean WordReader class in C#. A word is `[a-zA-Z]+`.
```
public List<string> GetSpecialWords(string text)
{
string word;
List<string> specialWords = new List<string>();
using (WordReader wr = new WordReader(text))... | 2009/09/29 | [
"https://Stackoverflow.com/questions/1494129",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/180615/"
] | Regex.Match("[a-zA-Z]+") should return you a word in the form of a Regex.Match object. You can use Regex.Matches to get all of the matched strings, or you can just do Regex.Match("[a-zA-Z]+", indexOfLastMatch) to get the next word.
MSDN: Regex object
<http://msdn.microsoft.com/en-us/library/system.text.regularexpres... | I would have read your valid word characters until you his a space or punctuation. You'll want to keep track of you index in the stream, while skipping over punctuation and spaces, and also numbers, in your case. This feels like homework, so I am going to leave the implementation up to you.
You should consider the cas... |
2,009,740 | There's a known problem with embedded UIWebViews that if you load data into them using loadHTMLString or loadData, the canGoBack/canGoForward properties and goBack/goForward methods don't work. These only work when using loadRequest.
Since Safari's normal app cache doesn't work in embedded UIWebViews, creating a nativ... | 2010/01/05 | [
"https://Stackoverflow.com/questions/2009740",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165162/"
] | So do you download the HTML yourself, then pass it to UIWebView as a string? Why so? Do you modify it on the fly or something?
Maybe a custom URL schema would help? You use loadRequest with a schema of your own, which in turn works with HTTP and then feeds the webview whatever data you want? | Could you fetch the content, save it to the local filesystem, point the webview to the local filesystem using file:// URLs, then intercept the link follows with shouldStartLoadWithRequest to fetch more to local fs, point webview at new local content, etc?
I've had good luck with UIWebView and file:/// URLs. Basically ... |
2,009,740 | There's a known problem with embedded UIWebViews that if you load data into them using loadHTMLString or loadData, the canGoBack/canGoForward properties and goBack/goForward methods don't work. These only work when using loadRequest.
Since Safari's normal app cache doesn't work in embedded UIWebViews, creating a nativ... | 2010/01/05 | [
"https://Stackoverflow.com/questions/2009740",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165162/"
] | I am using the UIWebView's canGoBack to check to see if I'm at the first page of the history. If I am then I just call the little method I used to load the first page (displayLocalResource sets up the HTMLString and loads it into the webView). Here is a snippet:
```
//Implementing a back button
- (void)backOne:(id)sen... | So do you download the HTML yourself, then pass it to UIWebView as a string? Why so? Do you modify it on the fly or something?
Maybe a custom URL schema would help? You use loadRequest with a schema of your own, which in turn works with HTTP and then feeds the webview whatever data you want? |
2,009,740 | There's a known problem with embedded UIWebViews that if you load data into them using loadHTMLString or loadData, the canGoBack/canGoForward properties and goBack/goForward methods don't work. These only work when using loadRequest.
Since Safari's normal app cache doesn't work in embedded UIWebViews, creating a nativ... | 2010/01/05 | [
"https://Stackoverflow.com/questions/2009740",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165162/"
] | So do you download the HTML yourself, then pass it to UIWebView as a string? Why so? Do you modify it on the fly or something?
Maybe a custom URL schema would help? You use loadRequest with a schema of your own, which in turn works with HTTP and then feeds the webview whatever data you want? | Loading the string into a temp file and using that as a URL request seems to cure this. It's something about loading the string directly that causes UIWebView not to see it as the home page you can navigate back to. This code worked for me:
```
//If you load the string like this, then "webView.canGoBack" never returns... |
2,009,740 | There's a known problem with embedded UIWebViews that if you load data into them using loadHTMLString or loadData, the canGoBack/canGoForward properties and goBack/goForward methods don't work. These only work when using loadRequest.
Since Safari's normal app cache doesn't work in embedded UIWebViews, creating a nativ... | 2010/01/05 | [
"https://Stackoverflow.com/questions/2009740",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165162/"
] | I am using the UIWebView's canGoBack to check to see if I'm at the first page of the history. If I am then I just call the little method I used to load the first page (displayLocalResource sets up the HTMLString and loads it into the webView). Here is a snippet:
```
//Implementing a back button
- (void)backOne:(id)sen... | Could you fetch the content, save it to the local filesystem, point the webview to the local filesystem using file:// URLs, then intercept the link follows with shouldStartLoadWithRequest to fetch more to local fs, point webview at new local content, etc?
I've had good luck with UIWebView and file:/// URLs. Basically ... |
2,009,740 | There's a known problem with embedded UIWebViews that if you load data into them using loadHTMLString or loadData, the canGoBack/canGoForward properties and goBack/goForward methods don't work. These only work when using loadRequest.
Since Safari's normal app cache doesn't work in embedded UIWebViews, creating a nativ... | 2010/01/05 | [
"https://Stackoverflow.com/questions/2009740",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165162/"
] | I had a same problem. I tried manage the history, but it is error prone. Now I have discovered a better solution of this.
What you want to do is simply add a loadRequest to about:blank and make that as a placeholder for you before you call loadHTMLString/loadData. Then you are totally free from monitoring the history.... | Could you fetch the content, save it to the local filesystem, point the webview to the local filesystem using file:// URLs, then intercept the link follows with shouldStartLoadWithRequest to fetch more to local fs, point webview at new local content, etc?
I've had good luck with UIWebView and file:/// URLs. Basically ... |
2,009,740 | There's a known problem with embedded UIWebViews that if you load data into them using loadHTMLString or loadData, the canGoBack/canGoForward properties and goBack/goForward methods don't work. These only work when using loadRequest.
Since Safari's normal app cache doesn't work in embedded UIWebViews, creating a nativ... | 2010/01/05 | [
"https://Stackoverflow.com/questions/2009740",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165162/"
] | I am using the UIWebView's canGoBack to check to see if I'm at the first page of the history. If I am then I just call the little method I used to load the first page (displayLocalResource sets up the HTMLString and loads it into the webView). Here is a snippet:
```
//Implementing a back button
- (void)backOne:(id)sen... | Loading the string into a temp file and using that as a URL request seems to cure this. It's something about loading the string directly that causes UIWebView not to see it as the home page you can navigate back to. This code worked for me:
```
//If you load the string like this, then "webView.canGoBack" never returns... |
2,009,740 | There's a known problem with embedded UIWebViews that if you load data into them using loadHTMLString or loadData, the canGoBack/canGoForward properties and goBack/goForward methods don't work. These only work when using loadRequest.
Since Safari's normal app cache doesn't work in embedded UIWebViews, creating a nativ... | 2010/01/05 | [
"https://Stackoverflow.com/questions/2009740",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165162/"
] | I am using the UIWebView's canGoBack to check to see if I'm at the first page of the history. If I am then I just call the little method I used to load the first page (displayLocalResource sets up the HTMLString and loads it into the webView). Here is a snippet:
```
//Implementing a back button
- (void)backOne:(id)sen... | I had a same problem. I tried manage the history, but it is error prone. Now I have discovered a better solution of this.
What you want to do is simply add a loadRequest to about:blank and make that as a placeholder for you before you call loadHTMLString/loadData. Then you are totally free from monitoring the history.... |
2,009,740 | There's a known problem with embedded UIWebViews that if you load data into them using loadHTMLString or loadData, the canGoBack/canGoForward properties and goBack/goForward methods don't work. These only work when using loadRequest.
Since Safari's normal app cache doesn't work in embedded UIWebViews, creating a nativ... | 2010/01/05 | [
"https://Stackoverflow.com/questions/2009740",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165162/"
] | I had a same problem. I tried manage the history, but it is error prone. Now I have discovered a better solution of this.
What you want to do is simply add a loadRequest to about:blank and make that as a placeholder for you before you call loadHTMLString/loadData. Then you are totally free from monitoring the history.... | Loading the string into a temp file and using that as a URL request seems to cure this. It's something about loading the string directly that causes UIWebView not to see it as the home page you can navigate back to. This code worked for me:
```
//If you load the string like this, then "webView.canGoBack" never returns... |
2,620,217 | Currently I am developing website in asp.net.
I wanted to include spellchecker module into my code.
It may not be fare to ask like this, but I don't have enough time to do R&D on that topic, of course I did enough study but I am unable to get the exact way to implement spell checker in my application.
Can any one s... | 2010/04/12 | [
"https://Stackoverflow.com/questions/2620217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/314264/"
] | All modern browsers come with built-in spell checkers these days, and users can customise them to their own language, locale and even add new words. Don't bother trying to implement your own. If your IE6 users complain, tell them to upgrade. | If you use javascript and jQuery, the [spellayt plugin](http://plugins.jquery.com/project/spellayt) provides spell checking in IE browsers. |
2,620,217 | Currently I am developing website in asp.net.
I wanted to include spellchecker module into my code.
It may not be fare to ask like this, but I don't have enough time to do R&D on that topic, of course I did enough study but I am unable to get the exact way to implement spell checker in my application.
Can any one s... | 2010/04/12 | [
"https://Stackoverflow.com/questions/2620217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/314264/"
] | All modern browsers come with built-in spell checkers these days, and users can customise them to their own language, locale and even add new words. Don't bother trying to implement your own. If your IE6 users complain, tell them to upgrade. | Have a look at this appliation, following the link -<http://www.spellchecker.net/> If you use FCK/CK Editor or TinyMCE, it perfectly works as a plug-in there. if not, you can embed it into your application as a SpellAsYouType functionality or spell-checking in pop-up.. |
2,620,217 | Currently I am developing website in asp.net.
I wanted to include spellchecker module into my code.
It may not be fare to ask like this, but I don't have enough time to do R&D on that topic, of course I did enough study but I am unable to get the exact way to implement spell checker in my application.
Can any one s... | 2010/04/12 | [
"https://Stackoverflow.com/questions/2620217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/314264/"
] | op said:
>
> It may not be fare to ask like this,
> but I don't have enough time to do R&D
> on that topic
>
>
>
and then commented:
>
> Actually I am new to .net. Recently I
> joined as a .net trainee. My trainer
> wants me to develop this module.
>
>
>
wow, you're making great strides!
follow the lin... | If you use javascript and jQuery, the [spellayt plugin](http://plugins.jquery.com/project/spellayt) provides spell checking in IE browsers. |
2,620,217 | Currently I am developing website in asp.net.
I wanted to include spellchecker module into my code.
It may not be fare to ask like this, but I don't have enough time to do R&D on that topic, of course I did enough study but I am unable to get the exact way to implement spell checker in my application.
Can any one s... | 2010/04/12 | [
"https://Stackoverflow.com/questions/2620217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/314264/"
] | op said:
>
> It may not be fare to ask like this,
> but I don't have enough time to do R&D
> on that topic
>
>
>
and then commented:
>
> Actually I am new to .net. Recently I
> joined as a .net trainee. My trainer
> wants me to develop this module.
>
>
>
wow, you're making great strides!
follow the lin... | Have a look at this appliation, following the link -<http://www.spellchecker.net/> If you use FCK/CK Editor or TinyMCE, it perfectly works as a plug-in there. if not, you can embed it into your application as a SpellAsYouType functionality or spell-checking in pop-up.. |
1,234,218 | Quite a funny question I have.
I am working now on the HTML parser and I was using vector `<HTMLTag>` for all my input purposes which seemed quite fine and fast for creating tree.
In another application I need to edit HTML structure and now inserting or reordering of the elements would be extremely painful using vect... | 2009/08/05 | [
"https://Stackoverflow.com/questions/1234218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/144154/"
] | I would make the child set a member of the element and use std::list:
```
class Element {
/* ... */
std::list<boost::shared_ptr<Element> > children;
/* ... */
};
```
That said, you might want to look into using an existing DOM library instead of rolling your own. For example, you could use [htmlcxx](http://htmlcxx... | List< pair > would work well to simulate any form of tree structure such as what you're trying to do:
list< pair< "html", list > would let you store an arbitrary number of children as well as control the order of objects in the child list.
Have fun walking this tree. |
3,086,750 | I know there are plenty of questions regarding this error, but I haven't found it easy to find one exactly like mine.
Here goes.
I have a pretty small application that writes DB data to a csv file and then uploads it to a server. I have it running on my local box out of eclipse which is great, but the final version n... | 2010/06/21 | [
"https://Stackoverflow.com/questions/3086750",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72401/"
] | The exception is raised when you create a new StringBuilder in your CSVFile class. Google tells me it's a frequent problem with GCJ, use an official Sun JVM. It usally resolves this kind of problem.
---
The `gtechReconcile` folder is assumed to contains all the class files in the `gtechReconcile` package.
In example... | The default classpath (if you don't specify one) is the current directory (".").
However, if you specify a classpath, java will use that instead of the default, thus removing the current directory.
The solution to your problem is simple: add the "current directory" to your class path, such as:
```
java -cp .:/<snip>... |
2,930,768 | I have an Sqlite database in which I want to select rows of which the value in a TIMESTAMP column is before a certain date. I would think this to be simple but I can't get it done. I have tried this:
```
SELECT * FROM logged_event WHERE logged_event.CREATED_AT < '2010-05-28 16:20:55'
```
and various variations on it... | 2010/05/28 | [
"https://Stackoverflow.com/questions/2930768",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11449/"
] | The issue is with the way you've inserted data into your table: the `+0200` syntax doesn't match any of [SQLite's time formats](http://www.sqlite.org/lang_datefunc.html):
1. YYYY-MM-DD
2. YYYY-MM-DD HH:MM
3. YYYY-MM-DD HH:MM:SS
4. YYYY-MM-DD HH:MM:SS.SSS
5. YYYY-MM-DDTHH:MM
6. YYYY-MM-DDTHH:MM:SS
7. YYYY-MM-DDTHH:MM:S... | SQLite's support for date/time types is very limited. You may have to roll-your-own method for maintaining time information. At least, that's what I did.
You can define your own stored-functions for doing comparisons using the SQLite create\_function() API. |
2,930,768 | I have an Sqlite database in which I want to select rows of which the value in a TIMESTAMP column is before a certain date. I would think this to be simple but I can't get it done. I have tried this:
```
SELECT * FROM logged_event WHERE logged_event.CREATED_AT < '2010-05-28 16:20:55'
```
and various variations on it... | 2010/05/28 | [
"https://Stackoverflow.com/questions/2930768",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11449/"
] | SQLite's support for date/time types is very limited. You may have to roll-your-own method for maintaining time information. At least, that's what I did.
You can define your own stored-functions for doing comparisons using the SQLite create\_function() API. | As best I can tell, it's entirely reasonable to include a timezone specifier; see the text "formats 2 through 10 can . . ." at <http://www.sqlite.org/lang_datefunc.html>
However, the issue is that only the date functions interpret timestamps as dates. So for actual comparison, you need to either pass the timestamp thro... |
2,930,768 | I have an Sqlite database in which I want to select rows of which the value in a TIMESTAMP column is before a certain date. I would think this to be simple but I can't get it done. I have tried this:
```
SELECT * FROM logged_event WHERE logged_event.CREATED_AT < '2010-05-28 16:20:55'
```
and various variations on it... | 2010/05/28 | [
"https://Stackoverflow.com/questions/2930768",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11449/"
] | The issue is with the way you've inserted data into your table: the `+0200` syntax doesn't match any of [SQLite's time formats](http://www.sqlite.org/lang_datefunc.html):
1. YYYY-MM-DD
2. YYYY-MM-DD HH:MM
3. YYYY-MM-DD HH:MM:SS
4. YYYY-MM-DD HH:MM:SS.SSS
5. YYYY-MM-DDTHH:MM
6. YYYY-MM-DDTHH:MM:SS
7. YYYY-MM-DDTHH:MM:S... | As best I can tell, it's entirely reasonable to include a timezone specifier; see the text "formats 2 through 10 can . . ." at <http://www.sqlite.org/lang_datefunc.html>
However, the issue is that only the date functions interpret timestamps as dates. So for actual comparison, you need to either pass the timestamp thro... |
257,801 | Here's the scenario:
I have a textbox and a button on a web page. When the button is clicked, I want a popup window to open (using Thickbox) that will show all items that match the value entered in the textbox. I am currently using the IFrame implementation of Thickbox. The problem is that the URL to show is hardcoded... | 2008/11/03 | [
"https://Stackoverflow.com/questions/257801",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1574/"
] | Just handle the onclick of your button to run a function that calls `tb_show()`, passing the value of the text box. Something like
```
... onclick = "doSearch()" ...
function doSearch()
{
tb_show(caption, 'Search.aspx?KeepThis=true&q=\"' +
$('input#tb').val() +
'\"&TB_iframe=true&height=50... | Here is an idea. I don't think it is very pretty but should work:
```
$('input#tb').blur(function(){
var url = $('input.thickbox').attr('alt');
var tbVal = $(this).val();
// add the textbox value into the query string here
// url = ..
$('input.thickbox').attr('alt', url);
});
```
Basically, you update ... |
257,801 | Here's the scenario:
I have a textbox and a button on a web page. When the button is clicked, I want a popup window to open (using Thickbox) that will show all items that match the value entered in the textbox. I am currently using the IFrame implementation of Thickbox. The problem is that the URL to show is hardcoded... | 2008/11/03 | [
"https://Stackoverflow.com/questions/257801",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1574/"
] | If you read the manual, under the iframe content section, it tells you that your parameters need to go before the TB\_iframe parameter. Everything after this gets stripped off. | Here is an idea. I don't think it is very pretty but should work:
```
$('input#tb').blur(function(){
var url = $('input.thickbox').attr('alt');
var tbVal = $(this).val();
// add the textbox value into the query string here
// url = ..
$('input.thickbox').attr('alt', url);
});
```
Basically, you update ... |
257,801 | Here's the scenario:
I have a textbox and a button on a web page. When the button is clicked, I want a popup window to open (using Thickbox) that will show all items that match the value entered in the textbox. I am currently using the IFrame implementation of Thickbox. The problem is that the URL to show is hardcoded... | 2008/11/03 | [
"https://Stackoverflow.com/questions/257801",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1574/"
] | Just handle the onclick of your button to run a function that calls `tb_show()`, passing the value of the text box. Something like
```
... onclick = "doSearch()" ...
function doSearch()
{
tb_show(caption, 'Search.aspx?KeepThis=true&q=\"' +
$('input#tb').val() +
'\"&TB_iframe=true&height=50... | In the [code-behind](http://en.wiktionary.org/wiki/code-behind) you could also just add the alt tag progammatically,
```
button1.Attributes.Add("alt", "Search.aspx?KeepThis=true&TB_iframe=true&height=500&width=700");
``` |
257,801 | Here's the scenario:
I have a textbox and a button on a web page. When the button is clicked, I want a popup window to open (using Thickbox) that will show all items that match the value entered in the textbox. I am currently using the IFrame implementation of Thickbox. The problem is that the URL to show is hardcoded... | 2008/11/03 | [
"https://Stackoverflow.com/questions/257801",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1574/"
] | Just handle the onclick of your button to run a function that calls `tb_show()`, passing the value of the text box. Something like
```
... onclick = "doSearch()" ...
function doSearch()
{
tb_show(caption, 'Search.aspx?KeepThis=true&q=\"' +
$('input#tb').val() +
'\"&TB_iframe=true&height=50... | If you read the manual, under the iframe content section, it tells you that your parameters need to go before the TB\_iframe parameter. Everything after this gets stripped off. |
257,801 | Here's the scenario:
I have a textbox and a button on a web page. When the button is clicked, I want a popup window to open (using Thickbox) that will show all items that match the value entered in the textbox. I am currently using the IFrame implementation of Thickbox. The problem is that the URL to show is hardcoded... | 2008/11/03 | [
"https://Stackoverflow.com/questions/257801",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1574/"
] | If you read the manual, under the iframe content section, it tells you that your parameters need to go before the TB\_iframe parameter. Everything after this gets stripped off. | In the [code-behind](http://en.wiktionary.org/wiki/code-behind) you could also just add the alt tag progammatically,
```
button1.Attributes.Add("alt", "Search.aspx?KeepThis=true&TB_iframe=true&height=500&width=700");
``` |
656,524 | I have a personal project I've been working on in my spare time. It's far from complete, but I want feedback on the UI and the functionality that has made it in so far. Where is a good location to get useful feedback without being persecuted for the post being unrelated to the site's purpose?
The project is a website.... | 2009/03/18 | [
"https://Stackoverflow.com/questions/656524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11112/"
] | I would recommend asking for a review of your site on [Hacker News](http://news.ycombinator.com/news). This site was created and maintained by [Paul Graham](http://en.wikipedia.org/wiki/Paul_Graham) who also founded [Y Combinator](http://en.wikipedia.org/wiki/Y_Combinator), a company focused on helping startups in thei... | I think the Business of Software forums are a good place for this.
[Joel on Software discussions](http://discuss.joelonsoftware.com/?biz) |
656,524 | I have a personal project I've been working on in my spare time. It's far from complete, but I want feedback on the UI and the functionality that has made it in so far. Where is a good location to get useful feedback without being persecuted for the post being unrelated to the site's purpose?
The project is a website.... | 2009/03/18 | [
"https://Stackoverflow.com/questions/656524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11112/"
] | I think the Business of Software forums are a good place for this.
[Joel on Software discussions](http://discuss.joelonsoftware.com/?biz) | I would also suggest you to add a [feedback form](http://userthought.com/information/fully_customizable_feedback_form) with content highlighting feature to your website.
All the functionality requires a change of only 1 line of HTML.
**Content Highlighting** feature will allow your users to select exactly what they w... |
656,524 | I have a personal project I've been working on in my spare time. It's far from complete, but I want feedback on the UI and the functionality that has made it in so far. Where is a good location to get useful feedback without being persecuted for the post being unrelated to the site's purpose?
The project is a website.... | 2009/03/18 | [
"https://Stackoverflow.com/questions/656524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11112/"
] | I would recommend asking for a review of your site on [Hacker News](http://news.ycombinator.com/news). This site was created and maintained by [Paul Graham](http://en.wikipedia.org/wiki/Paul_Graham) who also founded [Y Combinator](http://en.wikipedia.org/wiki/Y_Combinator), a company focused on helping startups in thei... | I would also suggest you to add a [feedback form](http://userthought.com/information/fully_customizable_feedback_form) with content highlighting feature to your website.
All the functionality requires a change of only 1 line of HTML.
**Content Highlighting** feature will allow your users to select exactly what they w... |
807,892 | I need to create a block of unique lines to test a different project I am working on.
So I created a simple program to generate a random string of X length.
The issue is that if I call it once, I get a random string, if I call it again (in a for loop for example) I get the same string for the entire execution of the ... | 2009/04/30 | [
"https://Stackoverflow.com/questions/807892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72136/"
] | Similar question, lots of answers:
[random string generation - two generated one after another give same results](https://stackoverflow.com/questions/376344/random-string-generation-two-generated-one-after-another-give-same-results) | the seed for the random numbers are all the same due to the short amount of time it takes, in effect you recreate the random generator with the same seed every time, so the Next() call returns the same random value. |
807,892 | I need to create a block of unique lines to test a different project I am working on.
So I created a simple program to generate a random string of X length.
The issue is that if I call it once, I get a random string, if I call it again (in a for loop for example) I get the same string for the entire execution of the ... | 2009/04/30 | [
"https://Stackoverflow.com/questions/807892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72136/"
] | Because you create a new Random object in each call.
Simply move the randomNumber out of the method and make it a class member.
```
private Random randomNumber = new Random();
private static string RandomString(int Length)
{
StringBuilder sb = new StringBuilder();
//...
}
```
All software Random generators ... | the seed for the random numbers are all the same due to the short amount of time it takes, in effect you recreate the random generator with the same seed every time, so the Next() call returns the same random value. |
807,892 | I need to create a block of unique lines to test a different project I am working on.
So I created a simple program to generate a random string of X length.
The issue is that if I call it once, I get a random string, if I call it again (in a for loop for example) I get the same string for the entire execution of the ... | 2009/04/30 | [
"https://Stackoverflow.com/questions/807892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72136/"
] | You are creating the `Random` instances too close in time. Each instance is initialised using the system clock, and as the clock haven't changed you get the same sequence of random numbers over and over.
Create a single instance of the `Random` class and use it over and over.
Use the `using` keyword so that the `Stre... | Similar question, lots of answers:
[random string generation - two generated one after another give same results](https://stackoverflow.com/questions/376344/random-string-generation-two-generated-one-after-another-give-same-results) |
807,892 | I need to create a block of unique lines to test a different project I am working on.
So I created a simple program to generate a random string of X length.
The issue is that if I call it once, I get a random string, if I call it again (in a for loop for example) I get the same string for the entire execution of the ... | 2009/04/30 | [
"https://Stackoverflow.com/questions/807892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72136/"
] | You are creating the `Random` instances too close in time. Each instance is initialised using the system clock, and as the clock haven't changed you get the same sequence of random numbers over and over.
Create a single instance of the `Random` class and use it over and over.
Use the `using` keyword so that the `Stre... | See [Random constructor description](http://msdn.microsoft.com/en-us/library/h343ddh9.aspx) at MSN, this part:
>
> The default seed value is derived from
> the system clock and has finite
> resolution. As a result, different
> Random objects that are created in
> close succession by a call to the
> default const... |
807,892 | I need to create a block of unique lines to test a different project I am working on.
So I created a simple program to generate a random string of X length.
The issue is that if I call it once, I get a random string, if I call it again (in a for loop for example) I get the same string for the entire execution of the ... | 2009/04/30 | [
"https://Stackoverflow.com/questions/807892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72136/"
] | See [Random constructor description](http://msdn.microsoft.com/en-us/library/h343ddh9.aspx) at MSN, this part:
>
> The default seed value is derived from
> the system clock and has finite
> resolution. As a result, different
> Random objects that are created in
> close succession by a call to the
> default const... | Similar question, lots of answers:
[random string generation - two generated one after another give same results](https://stackoverflow.com/questions/376344/random-string-generation-two-generated-one-after-another-give-same-results) |
807,892 | I need to create a block of unique lines to test a different project I am working on.
So I created a simple program to generate a random string of X length.
The issue is that if I call it once, I get a random string, if I call it again (in a for loop for example) I get the same string for the entire execution of the ... | 2009/04/30 | [
"https://Stackoverflow.com/questions/807892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72136/"
] | See [Random constructor description](http://msdn.microsoft.com/en-us/library/h343ddh9.aspx) at MSN, this part:
>
> The default seed value is derived from
> the system clock and has finite
> resolution. As a result, different
> Random objects that are created in
> close succession by a call to the
> default const... | only declare randomNumber once
```
public class MyClass
{
private static Random randomNumber = new Random();
private static string RandomString(int Length)
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i ... Length; ++i)
{
int x = MyClass.randomNumber.Next(6... |
807,892 | I need to create a block of unique lines to test a different project I am working on.
So I created a simple program to generate a random string of X length.
The issue is that if I call it once, I get a random string, if I call it again (in a for loop for example) I get the same string for the entire execution of the ... | 2009/04/30 | [
"https://Stackoverflow.com/questions/807892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72136/"
] | See [Random constructor description](http://msdn.microsoft.com/en-us/library/h343ddh9.aspx) at MSN, this part:
>
> The default seed value is derived from
> the system clock and has finite
> resolution. As a result, different
> Random objects that are created in
> close succession by a call to the
> default const... | the seed for the random numbers are all the same due to the short amount of time it takes, in effect you recreate the random generator with the same seed every time, so the Next() call returns the same random value. |
807,892 | I need to create a block of unique lines to test a different project I am working on.
So I created a simple program to generate a random string of X length.
The issue is that if I call it once, I get a random string, if I call it again (in a for loop for example) I get the same string for the entire execution of the ... | 2009/04/30 | [
"https://Stackoverflow.com/questions/807892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72136/"
] | You are creating the `Random` instances too close in time. Each instance is initialised using the system clock, and as the clock haven't changed you get the same sequence of random numbers over and over.
Create a single instance of the `Random` class and use it over and over.
Use the `using` keyword so that the `Stre... | only declare randomNumber once
```
public class MyClass
{
private static Random randomNumber = new Random();
private static string RandomString(int Length)
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i ... Length; ++i)
{
int x = MyClass.randomNumber.Next(6... |
807,892 | I need to create a block of unique lines to test a different project I am working on.
So I created a simple program to generate a random string of X length.
The issue is that if I call it once, I get a random string, if I call it again (in a for loop for example) I get the same string for the entire execution of the ... | 2009/04/30 | [
"https://Stackoverflow.com/questions/807892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72136/"
] | You are creating the `Random` instances too close in time. Each instance is initialised using the system clock, and as the clock haven't changed you get the same sequence of random numbers over and over.
Create a single instance of the `Random` class and use it over and over.
Use the `using` keyword so that the `Stre... | Because you create a new Random object in each call.
Simply move the randomNumber out of the method and make it a class member.
```
private Random randomNumber = new Random();
private static string RandomString(int Length)
{
StringBuilder sb = new StringBuilder();
//...
}
```
All software Random generators ... |
807,892 | I need to create a block of unique lines to test a different project I am working on.
So I created a simple program to generate a random string of X length.
The issue is that if I call it once, I get a random string, if I call it again (in a for loop for example) I get the same string for the entire execution of the ... | 2009/04/30 | [
"https://Stackoverflow.com/questions/807892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72136/"
] | You are creating the `Random` instances too close in time. Each instance is initialised using the system clock, and as the clock haven't changed you get the same sequence of random numbers over and over.
Create a single instance of the `Random` class and use it over and over.
Use the `using` keyword so that the `Stre... | the seed for the random numbers are all the same due to the short amount of time it takes, in effect you recreate the random generator with the same seed every time, so the Next() call returns the same random value. |
337,702 | I wonder how can I write a ***catch'em all*** exception handler in the application level which will give the user the option to resume the application flow? | 2008/12/03 | [
"https://Stackoverflow.com/questions/337702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | If you are running a Windows Forms application: add a handler to the `Application.ThreadException` event. | It depends on what you mean by "resume". The trouble with exceptions is that unless you're *very* careful, by the time an exception happens your application state is quite possibly corrupt - you might have completed *half* an operation.
If you can isolate your operations - much like a database isolates transactions - ... |
337,702 | I wonder how can I write a ***catch'em all*** exception handler in the application level which will give the user the option to resume the application flow? | 2008/12/03 | [
"https://Stackoverflow.com/questions/337702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Use below code in your program.cs class. It will automatically Send mail when exception occurs.
```
using System;
using System.Windows.Forms;
using System.Net;
using System.Net.Mail;
using System.Threading;
namespace ExceptionHandlerTest
{
static class Program
{
/// <summary>
/// The main ent... | In some versions of .NET you can actually put a catcher around the Application.Run() (you'll find this in program.cs) and this should catch all the Main Thread's exceptions however in most cases this maybe poor design and wont give you much of an opportunity to "resume".
Additionally you will *always* have to manually ... |
337,702 | I wonder how can I write a ***catch'em all*** exception handler in the application level which will give the user the option to resume the application flow? | 2008/12/03 | [
"https://Stackoverflow.com/questions/337702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I assume you are writing a Windows application in which case, **yes**, you can do this. I will leave the rights and wrongs of whether or not you should to others. There are already enough answers which look at this and I suggest you **consider them carefully before you actually do this**.
Note, that this code will beh... | I don't think this is really feasible using a global error handler. You need to figure out what kind of errors are recoverable at different points in your application and write specific error handlers to address the errors as they occur -- unless you want to resort to application restart, which may or may not work depe... |
337,702 | I wonder how can I write a ***catch'em all*** exception handler in the application level which will give the user the option to resume the application flow? | 2008/12/03 | [
"https://Stackoverflow.com/questions/337702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I assume you are writing a Windows application in which case, **yes**, you can do this. I will leave the rights and wrongs of whether or not you should to others. There are already enough answers which look at this and I suggest you **consider them carefully before you actually do this**.
Note, that this code will beh... | [Microsoft Enterprise Library Exception Handling Application Block](http://msdn.microsoft.com/en-us/library/ff664698(v=pandp.50).aspx) has examples of how you can do this.
Basically you surround the code that can throw exceptions with this:
```
try
{
MyMethodThatMightThrow();
}
catch(Exception ex)
{
bool rethro... |
337,702 | I wonder how can I write a ***catch'em all*** exception handler in the application level which will give the user the option to resume the application flow? | 2008/12/03 | [
"https://Stackoverflow.com/questions/337702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I assume you are writing a Windows application in which case, **yes**, you can do this. I will leave the rights and wrongs of whether or not you should to others. There are already enough answers which look at this and I suggest you **consider them carefully before you actually do this**.
Note, that this code will beh... | In some versions of .NET you can actually put a catcher around the Application.Run() (you'll find this in program.cs) and this should catch all the Main Thread's exceptions however in most cases this maybe poor design and wont give you much of an opportunity to "resume".
Additionally you will *always* have to manually ... |
337,702 | I wonder how can I write a ***catch'em all*** exception handler in the application level which will give the user the option to resume the application flow? | 2008/12/03 | [
"https://Stackoverflow.com/questions/337702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | If you are running a Windows Forms application: add a handler to the `Application.ThreadException` event. | I don't think this is really feasible using a global error handler. You need to figure out what kind of errors are recoverable at different points in your application and write specific error handlers to address the errors as they occur -- unless you want to resort to application restart, which may or may not work depe... |
337,702 | I wonder how can I write a ***catch'em all*** exception handler in the application level which will give the user the option to resume the application flow? | 2008/12/03 | [
"https://Stackoverflow.com/questions/337702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | If you are running a Windows Forms application: add a handler to the `Application.ThreadException` event. | You should read up on all the problems associated with VB's "`On Error Resume Next`" style of error handling. It sounds like you're trying to implement this for C#.
Even if you can resume from the point of where the exception is generated, this is a broken technique for error handling. There's no way for a global han... |
337,702 | I wonder how can I write a ***catch'em all*** exception handler in the application level which will give the user the option to resume the application flow? | 2008/12/03 | [
"https://Stackoverflow.com/questions/337702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I assume you are writing a Windows application in which case, **yes**, you can do this. I will leave the rights and wrongs of whether or not you should to others. There are already enough answers which look at this and I suggest you **consider them carefully before you actually do this**.
Note, that this code will beh... | You should read up on all the problems associated with VB's "`On Error Resume Next`" style of error handling. It sounds like you're trying to implement this for C#.
Even if you can resume from the point of where the exception is generated, this is a broken technique for error handling. There's no way for a global han... |
337,702 | I wonder how can I write a ***catch'em all*** exception handler in the application level which will give the user the option to resume the application flow? | 2008/12/03 | [
"https://Stackoverflow.com/questions/337702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | It depends on what you mean by "resume". The trouble with exceptions is that unless you're *very* careful, by the time an exception happens your application state is quite possibly corrupt - you might have completed *half* an operation.
If you can isolate your operations - much like a database isolates transactions - ... | I don't think this is really feasible using a global error handler. You need to figure out what kind of errors are recoverable at different points in your application and write specific error handlers to address the errors as they occur -- unless you want to resort to application restart, which may or may not work depe... |
337,702 | I wonder how can I write a ***catch'em all*** exception handler in the application level which will give the user the option to resume the application flow? | 2008/12/03 | [
"https://Stackoverflow.com/questions/337702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Use below code in your program.cs class. It will automatically Send mail when exception occurs.
```
using System;
using System.Windows.Forms;
using System.Net;
using System.Net.Mail;
using System.Threading;
namespace ExceptionHandlerTest
{
static class Program
{
/// <summary>
/// The main ent... | I don't think this is really feasible using a global error handler. You need to figure out what kind of errors are recoverable at different points in your application and write specific error handlers to address the errors as they occur -- unless you want to resort to application restart, which may or may not work depe... |
2,875,279 | The related default StyleCop rules are:
1. Place `using` statements inside `namespace`.
2. Sort `using` statements alphabetically.
3. But ... `System` `using` come first (still trying to figure out if that means just `using System;` or `using System[.*];`).
So, my use case:
* I find a bug and decide that I need to a... | 2010/05/20 | [
"https://Stackoverflow.com/questions/2875279",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/231677/"
] | For 2008, I use the [Power Commands](http://code.msdn.microsoft.com/PowerCommands) add-in. It includes a command to sort and remove unused using statements. I map that to Ctrl-O, Ctrl-R. It's not automatic, but it's very quick.
2010 has a Power Commands too, but I think the sort and order using statements stuff is now... | You can make VS2010 smarter by using Resharper (www.jetbrains.com), a full-fledged add-in. It can do all of these things for you (and very much more), and is well worth the price. The Resharper add-in "StyleCop for Resharper" can even check StyleCop violations on-the-fly and underline your code the same way Visual Stud... |
2,875,279 | The related default StyleCop rules are:
1. Place `using` statements inside `namespace`.
2. Sort `using` statements alphabetically.
3. But ... `System` `using` come first (still trying to figure out if that means just `using System;` or `using System[.*];`).
So, my use case:
* I find a bug and decide that I need to a... | 2010/05/20 | [
"https://Stackoverflow.com/questions/2875279",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/231677/"
] | With regards to your #1, you can edit the project template items by using the instructions [here](http://www.thecodinghumanist.com/Content/HowToEditVSTemplates.aspx) or [here](http://msdn.microsoft.com/en-us/library/ms185319.aspx). I've done this for VS 2K8 to make StyleCop and FxCop happy by default, but I haven't got... | You can make VS2010 smarter by using Resharper (www.jetbrains.com), a full-fledged add-in. It can do all of these things for you (and very much more), and is well worth the price. The Resharper add-in "StyleCop for Resharper" can even check StyleCop violations on-the-fly and underline your code the same way Visual Stud... |
1,039,048 | I'm working on a 4-player network game in WPF and learning WCF in the process. So far, to handle the network communication, I've followed the advice from the [YeahTrivia game on Coding4Fun](http://blogs.msdn.com/coding4fun/archive/2007/10/29/5773166.aspx) game: I use a `dualHttpBinding`, and have use a `CallbackContrac... | 2009/06/24 | [
"https://Stackoverflow.com/questions/1039048",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/76939/"
] | You should have multiple components, each of which should be limited to one responsibility - not necessarily one method, but handling the state for one of the objects you're dealing with. When you have everything all in one service then your service is incredibly coupled to itself. Optimally, each component should be a... | I would support Terry's response - you should definitely split up your big interface into several smaller ones.
Also, you could possibly isolate certain operations like the registration and/or login process into simpler services - not knowing anything about your game, I think this could well be a simple non-duplex ser... |
172,781 | My normal work flow to create a new repository with subversion is to create a new repos, do a checkout of the repos root, create my branches tags and trunk folders and place in the trunk my initial files. Then I do a commit of this "initial import", delete the checked out repos from my hard drive and do a checkout of t... | 2008/10/05 | [
"https://Stackoverflow.com/questions/172781",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21406/"
] | There is - it's called an "in-place import", and it's covered in the Subversion FAQ here:
<http://subversion.tigris.org/faq.html#in-place-import>
What you're really doing is creating a new empty project in the repository, checking out the empty project your local folder - which turns your folder into a working copy -... | If you've checked out a single folder, copied your files into it, run `svn add` and `svn commit`; you shouldn't need to delete the files and re-checkout.
Use the files in place: once they've been committed as you describe, they're ready to be worked on. |
172,781 | My normal work flow to create a new repository with subversion is to create a new repos, do a checkout of the repos root, create my branches tags and trunk folders and place in the trunk my initial files. Then I do a commit of this "initial import", delete the checked out repos from my hard drive and do a checkout of t... | 2008/10/05 | [
"https://Stackoverflow.com/questions/172781",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21406/"
] | I usually use "svn mkdir" to create the trunk/tags/branches directly on the server immediately after creating the repository. Then I can check out the empty trunk, move my initial files into that directory, add and commit them, and start working. | If you've checked out a single folder, copied your files into it, run `svn add` and `svn commit`; you shouldn't need to delete the files and re-checkout.
Use the files in place: once they've been committed as you describe, they're ready to be worked on. |
172,781 | My normal work flow to create a new repository with subversion is to create a new repos, do a checkout of the repos root, create my branches tags and trunk folders and place in the trunk my initial files. Then I do a commit of this "initial import", delete the checked out repos from my hard drive and do a checkout of t... | 2008/10/05 | [
"https://Stackoverflow.com/questions/172781",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21406/"
] | I agree on the "in-place import" procedure and also using a script for TTB-structure(upvoted both).
Just a small hint:
You should not import a **huge** (ten of thousands) number of files in a single commit, if you use http(s), as the time for displaying the version history *scales by the number of added entries*. Th... | If you've checked out a single folder, copied your files into it, run `svn add` and `svn commit`; you shouldn't need to delete the files and re-checkout.
Use the files in place: once they've been committed as you describe, they're ready to be worked on. |
172,781 | My normal work flow to create a new repository with subversion is to create a new repos, do a checkout of the repos root, create my branches tags and trunk folders and place in the trunk my initial files. Then I do a commit of this "initial import", delete the checked out repos from my hard drive and do a checkout of t... | 2008/10/05 | [
"https://Stackoverflow.com/questions/172781",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21406/"
] | svn checkout --force lets you checkout a workingcopy 'over' an existing path. It keeps your old files and adds files that are only in your repository.
For creating your repository: You can perform multiple mkdir commands to a repository in a single commit using the 'svnmucc' command that is available in most Subversio... | If you've checked out a single folder, copied your files into it, run `svn add` and `svn commit`; you shouldn't need to delete the files and re-checkout.
Use the files in place: once they've been committed as you describe, they're ready to be worked on. |
172,781 | My normal work flow to create a new repository with subversion is to create a new repos, do a checkout of the repos root, create my branches tags and trunk folders and place in the trunk my initial files. Then I do a commit of this "initial import", delete the checked out repos from my hard drive and do a checkout of t... | 2008/10/05 | [
"https://Stackoverflow.com/questions/172781",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21406/"
] | There is - it's called an "in-place import", and it's covered in the Subversion FAQ here:
<http://subversion.tigris.org/faq.html#in-place-import>
What you're really doing is creating a new empty project in the repository, checking out the empty project your local folder - which turns your folder into a working copy -... | I usually use "svn mkdir" to create the trunk/tags/branches directly on the server immediately after creating the repository. Then I can check out the empty trunk, move my initial files into that directory, add and commit them, and start working. |
172,781 | My normal work flow to create a new repository with subversion is to create a new repos, do a checkout of the repos root, create my branches tags and trunk folders and place in the trunk my initial files. Then I do a commit of this "initial import", delete the checked out repos from my hard drive and do a checkout of t... | 2008/10/05 | [
"https://Stackoverflow.com/questions/172781",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21406/"
] | There is - it's called an "in-place import", and it's covered in the Subversion FAQ here:
<http://subversion.tigris.org/faq.html#in-place-import>
What you're really doing is creating a new empty project in the repository, checking out the empty project your local folder - which turns your folder into a working copy -... | I agree on the "in-place import" procedure and also using a script for TTB-structure(upvoted both).
Just a small hint:
You should not import a **huge** (ten of thousands) number of files in a single commit, if you use http(s), as the time for displaying the version history *scales by the number of added entries*. Th... |
172,781 | My normal work flow to create a new repository with subversion is to create a new repos, do a checkout of the repos root, create my branches tags and trunk folders and place in the trunk my initial files. Then I do a commit of this "initial import", delete the checked out repos from my hard drive and do a checkout of t... | 2008/10/05 | [
"https://Stackoverflow.com/questions/172781",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21406/"
] | There is - it's called an "in-place import", and it's covered in the Subversion FAQ here:
<http://subversion.tigris.org/faq.html#in-place-import>
What you're really doing is creating a new empty project in the repository, checking out the empty project your local folder - which turns your folder into a working copy -... | svn checkout --force lets you checkout a workingcopy 'over' an existing path. It keeps your old files and adds files that are only in your repository.
For creating your repository: You can perform multiple mkdir commands to a repository in a single commit using the 'svnmucc' command that is available in most Subversio... |
1,083,159 | While using WPF I noticed that when I add a control to a XAML file, the default constructor is called.
Is there a way to call a parameterized constructor? | 2009/07/04 | [
"https://Stackoverflow.com/questions/1083159",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/71302/"
] | .NET 4.0 brings a new feature that challenges the answer - but apparently only for UWP applications (not WPF).
[x:Arguments Directive](https://learn.microsoft.com/en-us/dotnet/framework/xaml-services/x-arguments-directive)
```
<object ...>
<x:Arguments>
oneOrMoreObjectElements
</x:Arguments>
</object>... | No. Not from XAML [when using WPF]. |
1,083,159 | While using WPF I noticed that when I add a control to a XAML file, the default constructor is called.
Is there a way to call a parameterized constructor? | 2009/07/04 | [
"https://Stackoverflow.com/questions/1083159",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/71302/"
] | One of the guiding principles of XAML-friendly objects is that they should be completely usable with a default constructor, i.e., there is no behavior that is only accessible when using a non-default constructor. To fit with the declarative nature of XAML, object parameters are specified via property setters. There is ... | No. Not from XAML [when using WPF]. |
1,083,159 | While using WPF I noticed that when I add a control to a XAML file, the default constructor is called.
Is there a way to call a parameterized constructor? | 2009/07/04 | [
"https://Stackoverflow.com/questions/1083159",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/71302/"
] | .NET 4.0 brings a new feature that challenges the answer - but apparently only for UWP applications (not WPF).
[x:Arguments Directive](https://learn.microsoft.com/en-us/dotnet/framework/xaml-services/x-arguments-directive)
```
<object ...>
<x:Arguments>
oneOrMoreObjectElements
</x:Arguments>
</object>... | One of the guiding principles of XAML-friendly objects is that they should be completely usable with a default constructor, i.e., there is no behavior that is only accessible when using a non-default constructor. To fit with the declarative nature of XAML, object parameters are specified via property setters. There is ... |
1,083,159 | While using WPF I noticed that when I add a control to a XAML file, the default constructor is called.
Is there a way to call a parameterized constructor? | 2009/07/04 | [
"https://Stackoverflow.com/questions/1083159",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/71302/"
] | .NET 4.0 brings a new feature that challenges the answer - but apparently only for UWP applications (not WPF).
[x:Arguments Directive](https://learn.microsoft.com/en-us/dotnet/framework/xaml-services/x-arguments-directive)
```
<object ...>
<x:Arguments>
oneOrMoreObjectElements
</x:Arguments>
</object>... | Yes, you can do it by the `ObjectDataProvider`. It allows you to call non-default constructor, for example:
```xml
<Grid>
<Grid.Resources>
<ObjectDataProvider x:Key="myDataSource"
ObjectType="{x:Type local:Person}">
<ObjectDataProvider.ConstructorParameters>
... |
1,083,159 | While using WPF I noticed that when I add a control to a XAML file, the default constructor is called.
Is there a way to call a parameterized constructor? | 2009/07/04 | [
"https://Stackoverflow.com/questions/1083159",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/71302/"
] | One of the guiding principles of XAML-friendly objects is that they should be completely usable with a default constructor, i.e., there is no behavior that is only accessible when using a non-default constructor. To fit with the declarative nature of XAML, object parameters are specified via property setters. There is ... | Yes, you can do it by the `ObjectDataProvider`. It allows you to call non-default constructor, for example:
```xml
<Grid>
<Grid.Resources>
<ObjectDataProvider x:Key="myDataSource"
ObjectType="{x:Type local:Person}">
<ObjectDataProvider.ConstructorParameters>
... |
295,123 | I need to write a temporary Web-based graphical front-end for a custom server system. In this case performance and scalability aren't issues, since at most 10 people may check the system simultaneously. Also it should be PHP or Python (server) & JavaScript (client) (can't use Flex or Silverlight for very specific non-p... | 2008/11/17 | [
"https://Stackoverflow.com/questions/295123",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15124/"
] | As it hasn't been mentioned yet: [jQuery.UI](http://ui.jquery.com/) | Check out [DHTMLX](http://www.dhtmlx.com/).
>
> DHTMLX Toolkit is a comprehensive set of Ajax-enabled DHTML UI components. Professionally developed grid, treegrid, treeview, tabbar, calendar, menu, toolbar, combobox, windows, items browser, color picker and file uploader empower developers to build cross-browser web ... |
295,123 | I need to write a temporary Web-based graphical front-end for a custom server system. In this case performance and scalability aren't issues, since at most 10 people may check the system simultaneously. Also it should be PHP or Python (server) & JavaScript (client) (can't use Flex or Silverlight for very specific non-p... | 2008/11/17 | [
"https://Stackoverflow.com/questions/295123",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15124/"
] | as 2017\*
if you want to give money:
* [Kendo UI](http://www.telerik.com/kendo-ui)
* [Wijmo](http://demos.wijmo.com/5/angular/explorer/explorer/#/)
* [ExtJs](https://www.sencha.com/)
* [DHTMLX](http://dhtmlx.com/docs/products/dhtmlxGrid/)
* [Webix](http://webix.com/blog/webix-grid-1-000-000-rows-and-more/)
* [JQWidge... | I would try application.js - less animation fluff, lots of controls and it's a window manager (someone mentioned Bindows.. not worth the money for a terrible UI).
used in this [Online Word Processor](http://shutterb.org/)
I find cappuccino confusing, and I don't want to learn yet another language tied to a single lib... |
295,123 | I need to write a temporary Web-based graphical front-end for a custom server system. In this case performance and scalability aren't issues, since at most 10 people may check the system simultaneously. Also it should be PHP or Python (server) & JavaScript (client) (can't use Flex or Silverlight for very specific non-p... | 2008/11/17 | [
"https://Stackoverflow.com/questions/295123",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15124/"
] | Also Dojo's UI library named [Dijit](http://dojotoolkit.org/reference-guide/dijit/index.html) is absolutely considerable! | [ExtJs](http://extjs.com/), [Bindows](http://www.bindows.net/), [YUI](http://developer.yahoo.com/yui/). First two are commercial but worth the money. |
295,123 | I need to write a temporary Web-based graphical front-end for a custom server system. In this case performance and scalability aren't issues, since at most 10 people may check the system simultaneously. Also it should be PHP or Python (server) & JavaScript (client) (can't use Flex or Silverlight for very specific non-p... | 2008/11/17 | [
"https://Stackoverflow.com/questions/295123",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15124/"
] | [ShieldUI](http://www.shieldui.com) is also a good commercial framework. | The latest additions to the List would be WIJMO and KendoUI.
[**http://www.wijmo.com**](http://www.wijmo.com)
[**http://www.kendoui.com**](http://www.kendoui.com) |
295,123 | I need to write a temporary Web-based graphical front-end for a custom server system. In this case performance and scalability aren't issues, since at most 10 people may check the system simultaneously. Also it should be PHP or Python (server) & JavaScript (client) (can't use Flex or Silverlight for very specific non-p... | 2008/11/17 | [
"https://Stackoverflow.com/questions/295123",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15124/"
] | Also Dojo's UI library named [Dijit](http://dojotoolkit.org/reference-guide/dijit/index.html) is absolutely considerable! | Sproutcore would be a good choice.
If you're unfamiliar with it you might find that the time required to learn the basics is too long for throw-away code but once you've got the basics down it's quite quick to develop with. |
295,123 | I need to write a temporary Web-based graphical front-end for a custom server system. In this case performance and scalability aren't issues, since at most 10 people may check the system simultaneously. Also it should be PHP or Python (server) & JavaScript (client) (can't use Flex or Silverlight for very specific non-p... | 2008/11/17 | [
"https://Stackoverflow.com/questions/295123",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15124/"
] | See also this question
[What are alternatives to ExtJS?](https://stackoverflow.com/questions/200284/what-are-alternatives-to-extjs)
It's 2016
1. [Polymer](https://www.polymer-project.org/1.0/)
2. <http://angular-ui.github.io/>
Here is a few (old) ones
1. [ampleSDK](http://www.amplesdk.com/examples/) (interesting ... | The latest additions to the List would be WIJMO and KendoUI.
[**http://www.wijmo.com**](http://www.wijmo.com)
[**http://www.kendoui.com**](http://www.kendoui.com) |
295,123 | I need to write a temporary Web-based graphical front-end for a custom server system. In this case performance and scalability aren't issues, since at most 10 people may check the system simultaneously. Also it should be PHP or Python (server) & JavaScript (client) (can't use Flex or Silverlight for very specific non-p... | 2008/11/17 | [
"https://Stackoverflow.com/questions/295123",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15124/"
] | [ShieldUI](http://www.shieldui.com) is also a good commercial framework. | I used JQuery.UI. This is not necessarily an answer to this question(Especially since it is an old post), but thought I would share what I have, in case it helps anyone else, as I came to this Post searching for how to create a drop and drag UI.
Please note that this is for MVC.
**Please note** that there is no act... |
295,123 | I need to write a temporary Web-based graphical front-end for a custom server system. In this case performance and scalability aren't issues, since at most 10 people may check the system simultaneously. Also it should be PHP or Python (server) & JavaScript (client) (can't use Flex or Silverlight for very specific non-p... | 2008/11/17 | [
"https://Stackoverflow.com/questions/295123",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15124/"
] | Am I I missing something, isn't [bootstrap](http://getbootstrap.com/) the defacto go to choice ?
Also, and rather cooler, google's polymer yet ... based on web components :
<https://www.polymer-project.org/1.0/> | YUI seems to be good while Extjs also comes very close.
There is little difference between YUI and Extjs, though YUI is free has a much larger community support and is backed by a giant like Yahoo.
for cappuccino u will have to spend time learning heir Objective-J, once learnt that you need not write a single line of H... |
295,123 | I need to write a temporary Web-based graphical front-end for a custom server system. In this case performance and scalability aren't issues, since at most 10 people may check the system simultaneously. Also it should be PHP or Python (server) & JavaScript (client) (can't use Flex or Silverlight for very specific non-p... | 2008/11/17 | [
"https://Stackoverflow.com/questions/295123",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15124/"
] | Also Dojo's UI library named [Dijit](http://dojotoolkit.org/reference-guide/dijit/index.html) is absolutely considerable! | Am I I missing something, isn't [bootstrap](http://getbootstrap.com/) the defacto go to choice ?
Also, and rather cooler, google's polymer yet ... based on web components :
<https://www.polymer-project.org/1.0/> |
295,123 | I need to write a temporary Web-based graphical front-end for a custom server system. In this case performance and scalability aren't issues, since at most 10 people may check the system simultaneously. Also it should be PHP or Python (server) & JavaScript (client) (can't use Flex or Silverlight for very specific non-p... | 2008/11/17 | [
"https://Stackoverflow.com/questions/295123",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15124/"
] | Out of all the JS frameworks out there, JQuery and YUI are my favorites. They accomplish a lot of the same but in very different ways.
For your request (lazy, easy, and powerful) I would vote JQuery. If this is something that will be more long term and more of an application that is very verbose and code heavy, I wou... | Qooxdoo is phenomenal. You can do mobile, web, and desktops with it. It abstracts away all the html and css. It's well-documented and OO. You can also use the same objects server- and client-side.
<http://qooxdoo.org/demos> |
1,377,052 | Is it possible in PHP to instantiate an object from the name of a class, if the class name is stored in a string? | 2009/09/04 | [
"https://Stackoverflow.com/questions/1377052",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135295/"
] | Yep, definitely.
```
$className = 'MyClass';
$object = new $className;
``` | **[Yes it is](http://www.php.net/manual/en/language.oop5.php#89296)**:
```
<?php
$type = 'cc';
$obj = new $type; // outputs "hi!"
class cc {
function __construct() {
echo 'hi!';
}
}
?>
``` |
1,377,052 | Is it possible in PHP to instantiate an object from the name of a class, if the class name is stored in a string? | 2009/09/04 | [
"https://Stackoverflow.com/questions/1377052",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135295/"
] | Yep, definitely.
```
$className = 'MyClass';
$object = new $className;
``` | Static too:
```
$class = 'foo';
return $class::getId();
``` |
1,377,052 | Is it possible in PHP to instantiate an object from the name of a class, if the class name is stored in a string? | 2009/09/04 | [
"https://Stackoverflow.com/questions/1377052",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135295/"
] | Yep, definitely.
```
$className = 'MyClass';
$object = new $className;
``` | You can do some dynamic invocation by storing your classname(s) / methods in a storage such as a database.
Assuming that the class is resilient for errors.
```
sample table my_table
classNameCol | methodNameCol | dynamic_sql
class1 | method1 | 'select * tablex where .... '
class1 | method2 | 'select *... |
1,377,052 | Is it possible in PHP to instantiate an object from the name of a class, if the class name is stored in a string? | 2009/09/04 | [
"https://Stackoverflow.com/questions/1377052",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135295/"
] | Yep, definitely.
```
$className = 'MyClass';
$object = new $className;
``` | if your class need **arguments** you should do this:
```
class Foo
{
public function __construct($bar)
{
echo $bar;
}
}
$name = 'Foo';
$args = 'bar';
$ref = new ReflectionClass($name);
$obj = $ref->newInstanceArgs(array($args));
``` |
1,377,052 | Is it possible in PHP to instantiate an object from the name of a class, if the class name is stored in a string? | 2009/09/04 | [
"https://Stackoverflow.com/questions/1377052",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135295/"
] | **[Yes it is](http://www.php.net/manual/en/language.oop5.php#89296)**:
```
<?php
$type = 'cc';
$obj = new $type; // outputs "hi!"
class cc {
function __construct() {
echo 'hi!';
}
}
?>
``` | You can do some dynamic invocation by storing your classname(s) / methods in a storage such as a database.
Assuming that the class is resilient for errors.
```
sample table my_table
classNameCol | methodNameCol | dynamic_sql
class1 | method1 | 'select * tablex where .... '
class1 | method2 | 'select *... |
1,377,052 | Is it possible in PHP to instantiate an object from the name of a class, if the class name is stored in a string? | 2009/09/04 | [
"https://Stackoverflow.com/questions/1377052",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135295/"
] | Static too:
```
$class = 'foo';
return $class::getId();
``` | You can do some dynamic invocation by storing your classname(s) / methods in a storage such as a database.
Assuming that the class is resilient for errors.
```
sample table my_table
classNameCol | methodNameCol | dynamic_sql
class1 | method1 | 'select * tablex where .... '
class1 | method2 | 'select *... |
1,377,052 | Is it possible in PHP to instantiate an object from the name of a class, if the class name is stored in a string? | 2009/09/04 | [
"https://Stackoverflow.com/questions/1377052",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135295/"
] | if your class need **arguments** you should do this:
```
class Foo
{
public function __construct($bar)
{
echo $bar;
}
}
$name = 'Foo';
$args = 'bar';
$ref = new ReflectionClass($name);
$obj = $ref->newInstanceArgs(array($args));
``` | You can do some dynamic invocation by storing your classname(s) / methods in a storage such as a database.
Assuming that the class is resilient for errors.
```
sample table my_table
classNameCol | methodNameCol | dynamic_sql
class1 | method1 | 'select * tablex where .... '
class1 | method2 | 'select *... |
182,440 | This question is a follow-up from [How to indicate that a method was unsuccessful](https://stackoverflow.com/questions/161822/how-to-indicate-that-a-method-was-unsuccessful). The xxx() Tryxxx() pattern is something that can be very useful in many libraries. I am wondering what is the best way to offer both implementati... | 2008/10/08 | [
"https://Stackoverflow.com/questions/182440",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5789/"
] | I usually use this pattern. Depends on how the Internal method is implemented as to whether or not this makes any sense. If you have to use conditional catch blocks it can get a bit nasty...
```
public object DoSomething(object input){
return DoSomethingInternal(input, true);
}
public bool TryDoSomething(object inp... | The first example is correct if you are just going to catch the exception and not do anything but return false with it.
You could change TrySomething to look like below.
```
public bool TrySomething(string a, out result, bool throwException)
{
try
{
// Whatever
}
catch
{
if(throwException)
{
... |
182,440 | This question is a follow-up from [How to indicate that a method was unsuccessful](https://stackoverflow.com/questions/161822/how-to-indicate-that-a-method-was-unsuccessful). The xxx() Tryxxx() pattern is something that can be very useful in many libraries. I am wondering what is the best way to offer both implementati... | 2008/10/08 | [
"https://Stackoverflow.com/questions/182440",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5789/"
] | Making TrySomething just catch and swallow the exception is a really bad idea. Half the point of the TryXXX pattern is to avoid the performance hit of exceptions.
If you don't need much information in the exception, you could make the DoSomething method just call TrySomething and throw an exception if it fails. If you... | The first example is correct if you are just going to catch the exception and not do anything but return false with it.
You could change TrySomething to look like below.
```
public bool TrySomething(string a, out result, bool throwException)
{
try
{
// Whatever
}
catch
{
if(throwException)
{
... |
182,440 | This question is a follow-up from [How to indicate that a method was unsuccessful](https://stackoverflow.com/questions/161822/how-to-indicate-that-a-method-was-unsuccessful). The xxx() Tryxxx() pattern is something that can be very useful in many libraries. I am wondering what is the best way to offer both implementati... | 2008/10/08 | [
"https://Stackoverflow.com/questions/182440",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5789/"
] | I usually use this pattern. Depends on how the Internal method is implemented as to whether or not this makes any sense. If you have to use conditional catch blocks it can get a bit nasty...
```
public object DoSomething(object input){
return DoSomethingInternal(input, true);
}
public bool TryDoSomething(object inp... | Assuming this is C#, I would say the second example
```
public bool TrySomething(string a, out result)
{
try
{
result = DoSomething(a)
return true;
}
catch (Exception)
{
return false;
}
}
```
It mimics the built in `int.TryParse(string s, out int result)`, and in my o... |
182,440 | This question is a follow-up from [How to indicate that a method was unsuccessful](https://stackoverflow.com/questions/161822/how-to-indicate-that-a-method-was-unsuccessful). The xxx() Tryxxx() pattern is something that can be very useful in many libraries. I am wondering what is the best way to offer both implementati... | 2008/10/08 | [
"https://Stackoverflow.com/questions/182440",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5789/"
] | Making TrySomething just catch and swallow the exception is a really bad idea. Half the point of the TryXXX pattern is to avoid the performance hit of exceptions.
If you don't need much information in the exception, you could make the DoSomething method just call TrySomething and throw an exception if it fails. If you... | Assuming this is C#, I would say the second example
```
public bool TrySomething(string a, out result)
{
try
{
result = DoSomething(a)
return true;
}
catch (Exception)
{
return false;
}
}
```
It mimics the built in `int.TryParse(string s, out int result)`, and in my o... |
182,440 | This question is a follow-up from [How to indicate that a method was unsuccessful](https://stackoverflow.com/questions/161822/how-to-indicate-that-a-method-was-unsuccessful). The xxx() Tryxxx() pattern is something that can be very useful in many libraries. I am wondering what is the best way to offer both implementati... | 2008/10/08 | [
"https://Stackoverflow.com/questions/182440",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5789/"
] | Making TrySomething just catch and swallow the exception is a really bad idea. Half the point of the TryXXX pattern is to avoid the performance hit of exceptions.
If you don't need much information in the exception, you could make the DoSomething method just call TrySomething and throw an exception if it fails. If you... | I usually use this pattern. Depends on how the Internal method is implemented as to whether or not this makes any sense. If you have to use conditional catch blocks it can get a bit nasty...
```
public object DoSomething(object input){
return DoSomethingInternal(input, true);
}
public bool TryDoSomething(object inp... |
1,867,045 | Does someone here know if it is possible to backup only the part of a
subversion reposiotory that has changed since the last backup (that is:
the delta)?
Practically, that could be something like doing a full backup every
midnight, and a delta every hour. If then a crash occured say at 11:07,
one would have to use las... | 2009/12/08 | [
"https://Stackoverflow.com/questions/1867045",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/180275/"
] | This is certainly possible. You can do an `svnadmin dump -r(from_rev) --incremental` to dump all changes from revision *(from\_rev)* onwards (if you omit the `--incremental`, the contents of the *(from\_rev)* revision will be dumped fully). All commits are atomic, so you can do a hot-backup this way - commits that are ... | It is simpler and probably almost as efficient to use rsync. rsync also has the benefit that it can do more things, other than the repository. |
50,995 | I'm a C# developer who's fumbling in the first VB code he's written since VB6, so if I am asking a rather obvious question, please forgive me.
I decided to experiment with XML Literals to generate some XML code for me, instead of using XMLDocument
I have 2 questions, the second regarding a workaround due to my inabil... | 2008/09/09 | [
"https://Stackoverflow.com/questions/50995",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5302/"
] | If I understand correctly what you are trying to do, you can use the StringBuilder. Use the StringBuilder.Append method and append the XmlElement 'OuterXml' property.
For example:
sb.Append(xmlElement.OuterXml) | We would all be remiss not to mention that dynamic XML element names are generally a bad idea. The whole point of XML is to create a store a data structure in a form that is readily:
1. Verifiable
2. Extendable
Dynamic element names fail that first condition. Why not simply use a standard XML format for storing key/v... |
50,995 | I'm a C# developer who's fumbling in the first VB code he's written since VB6, so if I am asking a rather obvious question, please forgive me.
I decided to experiment with XML Literals to generate some XML code for me, instead of using XMLDocument
I have 2 questions, the second regarding a workaround due to my inabil... | 2008/09/09 | [
"https://Stackoverflow.com/questions/50995",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5302/"
] | VB.NET XML Literals are very powerful, but most often adding some LINQ to them makes them truly awesome. This code should do exactly what you're trying to do.
```
Dim Elements = New Dictionary(Of String, String)
Elements.Add("Key1", "Value1")
Elements.Add("Key2", "Value2")
Elements.Add("Key3", "Value3")
Dim xConnecti... | If I understand correctly what you are trying to do, you can use the StringBuilder. Use the StringBuilder.Append method and append the XmlElement 'OuterXml' property.
For example:
sb.Append(xmlElement.OuterXml) |
50,995 | I'm a C# developer who's fumbling in the first VB code he's written since VB6, so if I am asking a rather obvious question, please forgive me.
I decided to experiment with XML Literals to generate some XML code for me, instead of using XMLDocument
I have 2 questions, the second regarding a workaround due to my inabil... | 2008/09/09 | [
"https://Stackoverflow.com/questions/50995",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5302/"
] | If I understand correctly what you are trying to do, you can use the StringBuilder. Use the StringBuilder.Append method and append the XmlElement 'OuterXml' property.
For example:
sb.Append(xmlElement.OuterXml) | To answer this more completely...
When injecting Strings into an XML Literal, it will not work properly unless you use XElement.Parse when injecting an XElement (this is because special characters are escaped)
So your ideal solution is more like this:
```
Dim conns = connections.AsList()
If conns IsNot Nothing AndAl... |
50,995 | I'm a C# developer who's fumbling in the first VB code he's written since VB6, so if I am asking a rather obvious question, please forgive me.
I decided to experiment with XML Literals to generate some XML code for me, instead of using XMLDocument
I have 2 questions, the second regarding a workaround due to my inabil... | 2008/09/09 | [
"https://Stackoverflow.com/questions/50995",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5302/"
] | VB.NET XML Literals are very powerful, but most often adding some LINQ to them makes them truly awesome. This code should do exactly what you're trying to do.
```
Dim Elements = New Dictionary(Of String, String)
Elements.Add("Key1", "Value1")
Elements.Add("Key2", "Value2")
Elements.Add("Key3", "Value3")
Dim xConnecti... | We would all be remiss not to mention that dynamic XML element names are generally a bad idea. The whole point of XML is to create a store a data structure in a form that is readily:
1. Verifiable
2. Extendable
Dynamic element names fail that first condition. Why not simply use a standard XML format for storing key/v... |
50,995 | I'm a C# developer who's fumbling in the first VB code he's written since VB6, so if I am asking a rather obvious question, please forgive me.
I decided to experiment with XML Literals to generate some XML code for me, instead of using XMLDocument
I have 2 questions, the second regarding a workaround due to my inabil... | 2008/09/09 | [
"https://Stackoverflow.com/questions/50995",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5302/"
] | To answer this more completely...
When injecting Strings into an XML Literal, it will not work properly unless you use XElement.Parse when injecting an XElement (this is because special characters are escaped)
So your ideal solution is more like this:
```
Dim conns = connections.AsList()
If conns IsNot Nothing AndAl... | We would all be remiss not to mention that dynamic XML element names are generally a bad idea. The whole point of XML is to create a store a data structure in a form that is readily:
1. Verifiable
2. Extendable
Dynamic element names fail that first condition. Why not simply use a standard XML format for storing key/v... |
50,995 | I'm a C# developer who's fumbling in the first VB code he's written since VB6, so if I am asking a rather obvious question, please forgive me.
I decided to experiment with XML Literals to generate some XML code for me, instead of using XMLDocument
I have 2 questions, the second regarding a workaround due to my inabil... | 2008/09/09 | [
"https://Stackoverflow.com/questions/50995",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5302/"
] | VB.NET XML Literals are very powerful, but most often adding some LINQ to them makes them truly awesome. This code should do exactly what you're trying to do.
```
Dim Elements = New Dictionary(Of String, String)
Elements.Add("Key1", "Value1")
Elements.Add("Key2", "Value2")
Elements.Add("Key3", "Value3")
Dim xConnecti... | To answer this more completely...
When injecting Strings into an XML Literal, it will not work properly unless you use XElement.Parse when injecting an XElement (this is because special characters are escaped)
So your ideal solution is more like this:
```
Dim conns = connections.AsList()
If conns IsNot Nothing AndAl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.