PostId
int64 4
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 1
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -55
461k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
21.5k
| Title
stringlengths 3
250
| BodyMarkdown
stringlengths 5
30k
⌀ | Tag1
stringlengths 1
25
⌀ | Tag2
stringlengths 1
25
⌀ | Tag3
stringlengths 1
25
⌀ | Tag4
stringlengths 1
25
⌀ | Tag5
stringlengths 1
25
⌀ | PostClosedDate
stringlengths 19
19
⌀ | OpenStatus
stringclasses 5
values | unified_texts
stringlengths 32
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
36,333 | 08/30/2008 20:41:02 | 2,493 | 08/22/2008 14:05:21 | 1 | 0 | Preview theme in Wordpress | In the latest version of Wordpress it gives you the opportunity to view a preview of what your site would look like using a different heme. You basically just click on the theme and it takes over the screen and you have a chance to activate it or close it (and return to the previous screen, which is grayed out in the background). I have seen a similar technique used on a number of websites recently for display images as well.
I'm wondering what technology/code they use to do this? | html | null | null | null | null | null | open | Preview theme in Wordpress
===
In the latest version of Wordpress it gives you the opportunity to view a preview of what your site would look like using a different heme. You basically just click on the theme and it takes over the screen and you have a chance to activate it or close it (and return to the previous screen, which is grayed out in the background). I have seen a similar technique used on a number of websites recently for display images as well.
I'm wondering what technology/code they use to do this? | 0 |
36,347 | 08/30/2008 21:14:27 | 1,556 | 08/16/2008 16:41:03 | 453 | 18 | What are differences generic in C++ and Java? | Java has generic keyword and C++ provides very strong programming model with generic.
Then what is difference between C++ and Java generic?
| c++ | java | generic | null | null | null | open | What are differences generic in C++ and Java?
===
Java has generic keyword and C++ provides very strong programming model with generic.
Then what is difference between C++ and Java generic?
| 0 |
36,350 | 08/30/2008 21:22:06 | 31,505 | 2008-09-01 | 956 | 36 | [c#] How to pass a single object[] to a params object[] | I have a method which takes params object[] such as:
void Foo(params object[] items)
{
Console.WriteLine(items[0]);
}
When I pass two object arrays to this method, it works fine:
Foo(new object[]{ (object)"1", (object)"2" }, new object[]{ (object)"3", (object)"4" } );
// Output: System.Object[]
But when I pass a single object[], it does not take my object[] as the first param, instead it takes its all elements like I wanted to pass them one by one:
Foo(new object[]{ (object)"1", (object)"2" });
// Output: 1, expected: System.Object[]
How do I pass a single object[] as a first argument to a params array? | c# | params | null | null | null | null | open | [c#] How to pass a single object[] to a params object[]
===
I have a method which takes params object[] such as:
void Foo(params object[] items)
{
Console.WriteLine(items[0]);
}
When I pass two object arrays to this method, it works fine:
Foo(new object[]{ (object)"1", (object)"2" }, new object[]{ (object)"3", (object)"4" } );
// Output: System.Object[]
But when I pass a single object[], it does not take my object[] as the first param, instead it takes its all elements like I wanted to pass them one by one:
Foo(new object[]{ (object)"1", (object)"2" });
// Output: 1, expected: System.Object[]
How do I pass a single object[] as a first argument to a params array? | 0 |
36,353 | 08/30/2008 21:25:44 | 3,654 | 08/29/2008 17:52:22 | 41 | 2 | What are the alternatives to using phpMyAdmin? | I've used phpMyAdmin for a while now - it gets the job done but it is very clunky and outdated, and has many features that I don't need. I'm looking for either a web based or (preferably) an OS X native alternative that is easy to use and isn't heavy on features.
Is there any programs out there that fit the bill? | osx | mysql-management | null | null | null | null | open | What are the alternatives to using phpMyAdmin?
===
I've used phpMyAdmin for a while now - it gets the job done but it is very clunky and outdated, and has many features that I don't need. I'm looking for either a web based or (preferably) an OS X native alternative that is easy to use and isn't heavy on features.
Is there any programs out there that fit the bill? | 0 |
36,399 | 08/30/2008 22:16:15 | 3,205 | 08/27/2008 13:06:13 | 214 | 19 | How does dedicated webhosting compare to Amazon's Cloud? | After stumbling into <a href="http://stackoverflow.com/questions/24885/do-you-use-amazons-cloud-services-for-your-company">Amazon Web Services</a> again I have finally checked their prices and am shocked. Positively. With their flexible billing and extremely low prices, is there any reason for still using a dedicated hosting for a website? The only one I can think of is keeping sensitive data confined to the intranet - but for publicly accessible services?
I know the above sounds like an advertisement, but I have - until today - dismissed <a href="http://www.amazon.com/gp/browse.html?node=201590011">EC2</a> as much too expensive, while it is cheaper than a budget web hosting. And <a href="http://www.amazon.com/gp/browse.html?node=16427261">S3</a> seems perfect for home backup solutions, either for one's private VCS or something like <a href="http://www.bacula.org/en/">Bacula</a> (easy to set up) / <a href="http://www.boxbackup.org/">Box Backup</a> (for the security-aware).
How does this billing system work out in real applications?
Could StackOverflow move to a cloud? | security | website | backup | amazon | cloud | null | open | How does dedicated webhosting compare to Amazon's Cloud?
===
After stumbling into <a href="http://stackoverflow.com/questions/24885/do-you-use-amazons-cloud-services-for-your-company">Amazon Web Services</a> again I have finally checked their prices and am shocked. Positively. With their flexible billing and extremely low prices, is there any reason for still using a dedicated hosting for a website? The only one I can think of is keeping sensitive data confined to the intranet - but for publicly accessible services?
I know the above sounds like an advertisement, but I have - until today - dismissed <a href="http://www.amazon.com/gp/browse.html?node=201590011">EC2</a> as much too expensive, while it is cheaper than a budget web hosting. And <a href="http://www.amazon.com/gp/browse.html?node=16427261">S3</a> seems perfect for home backup solutions, either for one's private VCS or something like <a href="http://www.bacula.org/en/">Bacula</a> (easy to set up) / <a href="http://www.boxbackup.org/">Box Backup</a> (for the security-aware).
How does this billing system work out in real applications?
Could StackOverflow move to a cloud? | 0 |
36,406 | 08/30/2008 22:22:50 | 3,799 | 08/30/2008 22:14:42 | 1 | 0 | Relative Root with Visual Studio ASP.NET debugger | I am working on an ASP.NET project which is physically located at C:\Projects\MyStuff\WebSite2. When I run the app with the Visual Studio debugger it seems that the built in web server considers "C:\Projects\MyStuff\" to be the relative root, not "C:\Projects\MyStuff\WebSite2". Is there a web.config setting or something that will allow tags like `<img src='/img/logo.png' />` to render correctly without having to resort to the ASP.NET specific tags like `<asp:image />`? If I code for the debugger's peculiarities then when I upload to the production IIS server everthing is off.
How do you resolve this? | aspnet | null | null | null | null | null | open | Relative Root with Visual Studio ASP.NET debugger
===
I am working on an ASP.NET project which is physically located at C:\Projects\MyStuff\WebSite2. When I run the app with the Visual Studio debugger it seems that the built in web server considers "C:\Projects\MyStuff\" to be the relative root, not "C:\Projects\MyStuff\WebSite2". Is there a web.config setting or something that will allow tags like `<img src='/img/logo.png' />` to render correctly without having to resort to the ASP.NET specific tags like `<asp:image />`? If I code for the debugger's peculiarities then when I upload to the production IIS server everthing is off.
How do you resolve this? | 0 |
36,407 | 08/30/2008 22:23:42 | 3,305 | 08/27/2008 18:56:35 | 116 | 10 | Firefox add-ons | What Firefox add-ons do you use that are useful for programmers? | firefox | addon | null | null | null | null | open | Firefox add-ons
===
What Firefox add-ons do you use that are useful for programmers? | 0 |
36,417 | 08/30/2008 22:27:15 | 3,800 | 08/30/2008 22:27:15 | 1 | 0 | PHP best practices? | What is a good way to remove the code from display pages when developing with PHP. Often the pages I work on need to be editted by an outside person. This person is often confused by lots of blocks of PHP, and also likes to break my code.
I've tried moving blocks of code out into functions, so now there are functions spread out all throughout the HTML now. As some pages become more complex it becomes a program again, and processing POSTs are questionable.
What can I be doing better in my PHP development? | php | null | null | null | null | 06/09/2012 16:55:46 | not constructive | PHP best practices?
===
What is a good way to remove the code from display pages when developing with PHP. Often the pages I work on need to be editted by an outside person. This person is often confused by lots of blocks of PHP, and also likes to break my code.
I've tried moving blocks of code out into functions, so now there are functions spread out all throughout the HTML now. As some pages become more complex it becomes a program again, and processing POSTs are questionable.
What can I be doing better in my PHP development? | 4 |
36,475 | 08/30/2008 23:27:50 | 1,745 | 08/18/2008 12:09:56 | 1 | 1 | Designing a threaded commenting system | What would be the best way to design a threaded commenting system so that it doesn't hammer the database? | sql | design | null | null | null | null | open | Designing a threaded commenting system
===
What would be the best way to design a threaded commenting system so that it doesn't hammer the database? | 0 |
36,477 | 08/30/2008 23:28:54 | 2,066 | 08/20/2008 03:59:13 | 33 | 4 | Long-term Static Page Caching | I maintain several client sites that have no dynamic data whatsoever, everything is static asp.net with c#.
Are there any pitfalls to caching the entire page for extreme periods of time, like a week? | caching | asp.net | c# | static | null | null | open | Long-term Static Page Caching
===
I maintain several client sites that have no dynamic data whatsoever, everything is static asp.net with c#.
Are there any pitfalls to caching the entire page for extreme periods of time, like a week? | 0 |
36,498 | 08/31/2008 00:06:37 | 792 | 08/09/2008 01:51:48 | 425 | 38 | How do I Send Email from the Command Line? | I would like to quickly send email from the command line. I realize there are probably a number of different ways to do this.
I'm looking for a simple way to do this from a linux terminal (likely a bash shell but anything should do) and an alternative way to do this on Windows. I want to be able to whip up an email right on the command line or have the flexibility to pipe the message into the command line program. How would you go about doing this? If you have small scripts that would be fine as well.
Thanks in advance. | email | command-line | null | null | null | null | open | How do I Send Email from the Command Line?
===
I would like to quickly send email from the command line. I realize there are probably a number of different ways to do this.
I'm looking for a simple way to do this from a linux terminal (likely a bash shell but anything should do) and an alternative way to do this on Windows. I want to be able to whip up an email right on the command line or have the flexibility to pipe the message into the command line program. How would you go about doing this? If you have small scripts that would be fine as well.
Thanks in advance. | 0 |
36,502 | 08/31/2008 00:18:55 | 383 | 08/05/2008 10:46:37 | 2,295 | 200 | How do can I disable DLL Caching in Windows Vista via CMD? | I know Windows Vista (and XP) cache recently loaded DLL's in memory...
How can this be disabled via the command prompt? | windowsvista | commandprompt | null | null | null | null | open | How do can I disable DLL Caching in Windows Vista via CMD?
===
I know Windows Vista (and XP) cache recently loaded DLL's in memory...
How can this be disabled via the command prompt? | 0 |
36,504 | 08/31/2008 00:21:51 | 655 | 08/07/2008 14:44:51 | 111 | 10 | Why functional languages? | I see a lot of talk on here about functional languages and stuff. Why would you use one over a "traditional" language? What do they do better? What are they worse at? What's the ideal functional programming application? | functional-programming | null | null | null | null | null | open | Why functional languages?
===
I see a lot of talk on here about functional languages and stuff. Why would you use one over a "traditional" language? What do they do better? What are they worse at? What's the ideal functional programming application? | 0 |
36,515 | 08/31/2008 00:41:03 | 1,482 | 08/15/2008 20:32:47 | 11 | 1 | Fixed Legend in Google Maps Mashup | I have a page with a Google Maps mashup that has pushpins that are color-coded by day (Monday, Tuesday, etc.) The IFrame containing the map is dynamically sized, so it gets resized when the browser window is resized.
I'd like to put a legend in the corner of the map window that tells the user what each color means. The Google Maps API includes a <code><a href="http://code.google.com/apis/maps/documentation/reference.html#GScreenOverlay">GScreenOverlay</a></code> class that has the behavior that I want, but it only lets you specify an image to use as an overlay, and I'd prefer to use a DIV with text in it. What's the easiest way to position a DIV over the map window in (for example) the lower left corner that'll automatically stay in the same place relative to the corner when the browser window is resized? | html | google-maps | null | null | null | null | open | Fixed Legend in Google Maps Mashup
===
I have a page with a Google Maps mashup that has pushpins that are color-coded by day (Monday, Tuesday, etc.) The IFrame containing the map is dynamically sized, so it gets resized when the browser window is resized.
I'd like to put a legend in the corner of the map window that tells the user what each color means. The Google Maps API includes a <code><a href="http://code.google.com/apis/maps/documentation/reference.html#GScreenOverlay">GScreenOverlay</a></code> class that has the behavior that I want, but it only lets you specify an image to use as an overlay, and I'd prefer to use a DIV with text in it. What's the easiest way to position a DIV over the map window in (for example) the lower left corner that'll automatically stay in the same place relative to the corner when the browser window is resized? | 0 |
36,533 | 08/31/2008 01:08:48 | 1,782 | 08/18/2008 14:30:58 | 1,128 | 82 | Vista speech recognition in multiple languages | my primary language is spanish, but I use all my software in english, including windows; however I'd like to use speech recognition in spanish.
Do you know if there's a way to use vista's speech recognition in other language than the primary os language? | windows-vista | speech-recognition | multi-language | null | null | null | open | Vista speech recognition in multiple languages
===
my primary language is spanish, but I use all my software in english, including windows; however I'd like to use speech recognition in spanish.
Do you know if there's a way to use vista's speech recognition in other language than the primary os language? | 0 |
36,534 | 08/31/2008 01:11:47 | 2,600 | 08/23/2008 13:40:14 | 507 | 35 | Website Hardware Scaling | So I was listening to the latest Stackoverflow podcast ([episode 19][1]), and Jeff and Joel talked a bit about scaling server hardware as a website grows. From what Joel was saying, the first few steps are pretty standard:
1. One server running both the webserver and the database (the current Stackoverflow setup)
2. One webserver and one database server
3. Two load-balanced webservers and one database server
They didn't talk much about what comes next though. Do you add more webservers? Another database server? Replicate this three-machine cluster in a different datacenter for redundancy? Where does a web startup go from here in the hardware department?
[1]: http://blog.stackoverflow.com/2008/08/podcast-19/ | hardware | scaling | null | null | null | null | open | Website Hardware Scaling
===
So I was listening to the latest Stackoverflow podcast ([episode 19][1]), and Jeff and Joel talked a bit about scaling server hardware as a website grows. From what Joel was saying, the first few steps are pretty standard:
1. One server running both the webserver and the database (the current Stackoverflow setup)
2. One webserver and one database server
3. Two load-balanced webservers and one database server
They didn't talk much about what comes next though. Do you add more webservers? Another database server? Replicate this three-machine cluster in a different datacenter for redundancy? Where does a web startup go from here in the hardware department?
[1]: http://blog.stackoverflow.com/2008/08/podcast-19/ | 0 |
36,551 | 08/31/2008 01:39:45 | 1,000 | 08/11/2008 12:41:19 | 312 | 21 | MySQL shell on Windows | The command line interface to MySQL works perfectly well in itself, but when using my local copy I'm forced to interact with it using the old-fashioned DOS windows. Is there some way I can redirect it through a better shell? | windows | mysql | shell | null | null | null | open | MySQL shell on Windows
===
The command line interface to MySQL works perfectly well in itself, but when using my local copy I'm forced to interact with it using the old-fashioned DOS windows. Is there some way I can redirect it through a better shell? | 0 |
36,554 | 08/31/2008 01:42:11 | 1,405 | 08/15/2008 11:24:08 | 11 | 1 | Spare Laptop - What to do with it? | I have an old Sony Vaio laptop. P4 2.6GHz 512MB, 40GB. What should I do with it? Right now I use it as a home server with a base install of Ubuntu server 8.04, Apache and Subversion for a repository for my Windows Visual Studio development. I am sure I could be doing more with it. Any suggestions? I have thought about using it to automate some builds but haven't gone down that road yet. | laptop | null | null | null | null | 12/12/2011 19:46:23 | off topic | Spare Laptop - What to do with it?
===
I have an old Sony Vaio laptop. P4 2.6GHz 512MB, 40GB. What should I do with it? Right now I use it as a home server with a base install of Ubuntu server 8.04, Apache and Subversion for a repository for my Windows Visual Studio development. I am sure I could be doing more with it. Any suggestions? I have thought about using it to automate some builds but haven't gone down that road yet. | 2 |
36,563 | 08/31/2008 02:05:03 | 305 | 08/04/2008 14:04:19 | 1,107 | 75 | Is there an easy way to do transparent forms in a VB .NET app? | I'm writing a simple app that's going to have a tiny form sitting in one corner of the screen, updating itself.
I'd really love for that form to be transparent and to have the transparency be user-configurable.
Is there any easy way to achieve this? | vb.net | transparency | null | null | null | null | open | Is there an easy way to do transparent forms in a VB .NET app?
===
I'm writing a simple app that's going to have a tiny form sitting in one corner of the screen, updating itself.
I'd really love for that form to be transparent and to have the transparency be user-configurable.
Is there any easy way to achieve this? | 0 |
36,568 | 08/31/2008 02:09:49 | 1,405 | 08/15/2008 11:24:08 | 16 | 1 | Automated Builds | I currently use [subversion][1] for my version control via [AhnkSVN][2] and Visual Studio. I recently started using [Tree Surgeon][3] to set up my projects. It creates a build script automatically using [NAnt][4]. I would like to be able to automate builds regularly projects within SVN. I like the idea of doing a build on every check in but nightly builds would work as well. I would give more information or more of my thoughts but figured I would leave it open and see what the SO community has to say.
[1]: http://subversion.tigris.org/
[2]: http://ankhsvn.open.collab.net/
[3]: http://www.codeplex.com/treesurgeon
[4]: http://nant.sourceforge.net/ | build-automation | subversion | nant | null | null | null | open | Automated Builds
===
I currently use [subversion][1] for my version control via [AhnkSVN][2] and Visual Studio. I recently started using [Tree Surgeon][3] to set up my projects. It creates a build script automatically using [NAnt][4]. I would like to be able to automate builds regularly projects within SVN. I like the idea of doing a build on every check in but nightly builds would work as well. I would give more information or more of my thoughts but figured I would leave it open and see what the SO community has to say.
[1]: http://subversion.tigris.org/
[2]: http://ankhsvn.open.collab.net/
[3]: http://www.codeplex.com/treesurgeon
[4]: http://nant.sourceforge.net/ | 0 |
36,580 | 08/31/2008 02:31:49 | 1,405 | 08/15/2008 11:24:08 | 26 | 1 | Something other than C# | I am a C# developer and have been programming in that for a long time. I have some experience using ASP 3.0, php, VB.NET and C. I would like to learn something else and am not sure where I should focus. I have done a little with Python but wasn't as "inspired" by the language as I would have hoped to be. Thoughts on what I should learn? I would like to go more open source based. | programming-languages | null | null | null | null | null | open | Something other than C#
===
I am a C# developer and have been programming in that for a long time. I have some experience using ASP 3.0, php, VB.NET and C. I would like to learn something else and am not sure where I should focus. I have done a little with Python but wasn't as "inspired" by the language as I would have hoped to be. Thoughts on what I should learn? I would like to go more open source based. | 0 |
36,585 | 08/31/2008 02:39:15 | 1,208 | 08/13/2008 13:11:36 | 137 | 22 | SQL Query for size of a nvarchar(max) column | I have a column which is of type nvarchar(max). How do I find the length of the string (or the number of bytes) for the column for each row in the table? | sql | null | null | null | null | null | open | SQL Query for size of a nvarchar(max) column
===
I have a column which is of type nvarchar(max). How do I find the length of the string (or the number of bytes) for the column for each row in the table? | 0 |
36,600 | 08/31/2008 03:05:52 | 3,569 | 08/29/2008 06:21:18 | 61 | 7 | Viewing DirectX application remotely | We're working on an application that displays information through a Direct3D visualisation. A late client request is the ability to view this application via some Remote Desktop solution.
Has anyone done anything similar? What options are available / unavailable? I'm thinking RDC, VNC, Citrix...
Any advice? | remote | directx | null | null | null | null | open | Viewing DirectX application remotely
===
We're working on an application that displays information through a Direct3D visualisation. A late client request is the ability to view this application via some Remote Desktop solution.
Has anyone done anything similar? What options are available / unavailable? I'm thinking RDC, VNC, Citrix...
Any advice? | 0 |
36,605 | 08/31/2008 03:14:56 | 3,821 | 08/31/2008 02:41:10 | 1 | 1 | IE 6 CSS Hover non Anchor Tag | What is the simplest and most elegant way to simulate the hover pseudo-class for non-Anchor tags in IE6?
I am specifically trying to change the cursor in this instance to that of a pointer. | css | internet-explorer-6 | null | null | null | null | open | IE 6 CSS Hover non Anchor Tag
===
What is the simplest and most elegant way to simulate the hover pseudo-class for non-Anchor tags in IE6?
I am specifically trying to change the cursor in this instance to that of a pointer. | 0 |
36,608 | 08/31/2008 03:19:33 | 3,764 | 08/30/2008 16:14:55 | 6 | 1 | How can I count the number of records that have a unique value in a particular field in ROR? | I have a record set that includes a date field, and want to determine how many unique dates are represented in the record set.
Something like:
Record.find(:all).date.unique.count
but of course, that doesn't seem to work. | ruby | ruby-on-rails | activerecord | null | null | null | open | How can I count the number of records that have a unique value in a particular field in ROR?
===
I have a record set that includes a date field, and want to determine how many unique dates are represented in the record set.
Something like:
Record.find(:all).date.unique.count
but of course, that doesn't seem to work. | 0 |
36,621 | 08/31/2008 03:57:29 | 1,615 | 08/17/2008 15:19:59 | 55 | 1 | set_error_handler Isn't Working How I Want It To Work | I'm taking the leap: my php scripts will ALL fail gracefully!
At least, that's what I'm hoping for...
I don't want to wrap (practically) every single line in try...catch statements, so I think my best bet is to make a custom error handler for the beginning of my files.
I'm testing it out on a practice page:
function customError($level,$message,$file,$line,$context){
echo "Sorry, an error has occured on line $line.<br />";
echo "The function that caused the error says $message.<br />";
die();
}
set_error_handler("customError");
echo($imAFakeVariable);
This works fine, returning:
Sorry, an error has occured on line 17.
The function that caused the error says Undefined variable: imAFakeVariable.
However, this setup doesn't work for undefined functions.
function customError($level,$message,$file,$line,$context){
echo "Sorry, an error has occured on line $line.<br />";
echo "The function that caused the error says $message.<br />";
die();
}
set_error_handler("customError");
imAFakeFunction();
This returns:
Fatal error: Call to undefined function: imafakefunction() in /Library/WebServer/Documents/experimental/errorhandle.php on line 17
Why isn't my custom error handler catching undefinedd functions? Are there other problems that this will cause?
Thanks,
Jason
| php | null | null | null | null | null | open | set_error_handler Isn't Working How I Want It To Work
===
I'm taking the leap: my php scripts will ALL fail gracefully!
At least, that's what I'm hoping for...
I don't want to wrap (practically) every single line in try...catch statements, so I think my best bet is to make a custom error handler for the beginning of my files.
I'm testing it out on a practice page:
function customError($level,$message,$file,$line,$context){
echo "Sorry, an error has occured on line $line.<br />";
echo "The function that caused the error says $message.<br />";
die();
}
set_error_handler("customError");
echo($imAFakeVariable);
This works fine, returning:
Sorry, an error has occured on line 17.
The function that caused the error says Undefined variable: imAFakeVariable.
However, this setup doesn't work for undefined functions.
function customError($level,$message,$file,$line,$context){
echo "Sorry, an error has occured on line $line.<br />";
echo "The function that caused the error says $message.<br />";
die();
}
set_error_handler("customError");
imAFakeFunction();
This returns:
Fatal error: Call to undefined function: imafakefunction() in /Library/WebServer/Documents/experimental/errorhandle.php on line 17
Why isn't my custom error handler catching undefinedd functions? Are there other problems that this will cause?
Thanks,
Jason
| 0 |
36,636 | 08/31/2008 04:38:21 | 3,786 | 08/30/2008 19:51:33 | 53 | 0 | What is a 'closure'? | I asked a question about Currying and closures where mentioned.
What is a closure? How does it relate to currying? | functional-programming | terms | computer-science | null | null | null | open | What is a 'closure'?
===
I asked a question about Currying and closures where mentioned.
What is a closure? How does it relate to currying? | 0 |
36,642 | 08/31/2008 04:54:17 | 2,496 | 08/22/2008 14:30:33 | 1 | 0 | listing items and displaying the data on one of the items. | I use asp.net 3.5 and have also begun looking at 3.5 sp1
I like the clean urls that mvc tends to have but use asp.net webforms for my primary development. I normally use a url rewriter in order to accomplish this type stuff. When I say clean urls I mean like /products to get a list of products and /products/Product_One to look at the info about product called Product_One. I've used this on sites where the listing is on one page and when you pick the item it goes to a different page that shows the info about the item selected.
but
I also like the way that the update panel works and changing stuff on screen with out flashing the screen. When I do this I tend to have a list on the left with the different items that are selectable and then have on the left the data about the selected item, then I use an update panel so that when the item on the left is selected it's data shows up on the left without flashing.
I need opinions on what you all think of the two different methods of displaying a list and seeing the item that is selected's data? What do you all do? Is there another way of doing this? Is it possible to combine the update panel method and the nice urls? (i.e. change the url to match the url that would get you to the current displayed data even though the update panel was used, and add to the history the new clean url for the current page) | asp.net | 3.5 | null | null | null | null | open | listing items and displaying the data on one of the items.
===
I use asp.net 3.5 and have also begun looking at 3.5 sp1
I like the clean urls that mvc tends to have but use asp.net webforms for my primary development. I normally use a url rewriter in order to accomplish this type stuff. When I say clean urls I mean like /products to get a list of products and /products/Product_One to look at the info about product called Product_One. I've used this on sites where the listing is on one page and when you pick the item it goes to a different page that shows the info about the item selected.
but
I also like the way that the update panel works and changing stuff on screen with out flashing the screen. When I do this I tend to have a list on the left with the different items that are selectable and then have on the left the data about the selected item, then I use an update panel so that when the item on the left is selected it's data shows up on the left without flashing.
I need opinions on what you all think of the two different methods of displaying a list and seeing the item that is selected's data? What do you all do? Is there another way of doing this? Is it possible to combine the update panel method and the nice urls? (i.e. change the url to match the url that would get you to the current displayed data even though the update panel was used, and add to the history the new clean url for the current page) | 0 |
36,646 | 08/31/2008 05:04:34 | 577 | 08/06/2008 21:36:25 | 141 | 6 | Do you use Phing? | Does anyone use [Phing][1] to deploy PHP applications, and if so how do you use it? We currently have a hand-written "setup" script that we run whenever we deploy a new instance of our project. We just checkout from SVN and run it. It sets some basic configuration variables, installs or reloads the database, and generates a v-host for the site instance.
I have often thought that maybe we should be using [Phing][1]. I haven't used ant much, so I don't have a real sense of what [Phing][1] is supposed to do other than script the copying of files from one place to another much as our setup script does. What are some more advanced uses that you can give examples of to help me understand why we would or would not want to integrate [Phing][1] into our process.
[1]: http://phing.info/trac/ | deployment | build-process | build-automation | null | null | null | open | Do you use Phing?
===
Does anyone use [Phing][1] to deploy PHP applications, and if so how do you use it? We currently have a hand-written "setup" script that we run whenever we deploy a new instance of our project. We just checkout from SVN and run it. It sets some basic configuration variables, installs or reloads the database, and generates a v-host for the site instance.
I have often thought that maybe we should be using [Phing][1]. I haven't used ant much, so I don't have a real sense of what [Phing][1] is supposed to do other than script the copying of files from one place to another much as our setup script does. What are some more advanced uses that you can give examples of to help me understand why we would or would not want to integrate [Phing][1] into our process.
[1]: http://phing.info/trac/ | 0 |
36,647 | 08/31/2008 05:07:41 | 577 | 08/06/2008 21:36:25 | 141 | 6 | Unit tests in Python | Does Python have a unit testing framework compatible with the standard xUnit style of test framework? If so, what is it, where is it, and is it any good? | python | unit-testing | null | null | null | null | open | Unit tests in Python
===
Does Python have a unit testing framework compatible with the standard xUnit style of test framework? If so, what is it, where is it, and is it any good? | 0 |
36,656 | 08/31/2008 05:55:12 | 3,831 | 08/31/2008 05:31:12 | 1 | 0 | How do I keep whitespace formatting using PHP/HTML? | I'm parsing text from a file and storing it in a string. The problem is that some of the text in the original files contains ASCII art and whatnot that I would like to preserve. When I print out the string on the HTML page, even if it does have the same formatting and everything, since it is in HTML, the spacing and linebreaks are not preserved. What is the best way to print out the text in HTML exactly as it was in the original text file?
I would like to give an example, but unfortunately, I was not able to get it to display correctly in this markdown editor :P
Basically, I would like suggestions on how to display ASCII art in HTML. | php | asciiart | html | null | null | null | open | How do I keep whitespace formatting using PHP/HTML?
===
I'm parsing text from a file and storing it in a string. The problem is that some of the text in the original files contains ASCII art and whatnot that I would like to preserve. When I print out the string on the HTML page, even if it does have the same formatting and everything, since it is in HTML, the spacing and linebreaks are not preserved. What is the best way to print out the text in HTML exactly as it was in the original text file?
I would like to give an example, but unfortunately, I was not able to get it to display correctly in this markdown editor :P
Basically, I would like suggestions on how to display ASCII art in HTML. | 0 |
9,981,614 | 04/02/2012 18:18:06 | 130,111 | 06/28/2009 17:53:48 | 313 | 16 | is it bad form to use instance vars directly in ruby? | Should you always create accesssors (for reading and/or writing) in ruby? If you have a class that's not meant to be reused outside, can't I just use instance variables directly?
One of the problems I ran into is that it's problematic to stub out `@instance_vars` in tests.
| ruby | coding-style | instance-variables | null | null | null | open | is it bad form to use instance vars directly in ruby?
===
Should you always create accesssors (for reading and/or writing) in ruby? If you have a class that's not meant to be reused outside, can't I just use instance variables directly?
One of the problems I ran into is that it's problematic to stub out `@instance_vars` in tests.
| 0 |
9,981,620 | 04/02/2012 18:18:22 | 1,317,865 | 11/18/2010 11:27:38 | 265 | 0 | c strcat with pointer | I'm trying to use pointers and strcat from C. This is part of my learning process.
The idea is the user inputs a string that contains digits and the output should return only the digits.
So, if the user inputs
`te12abc` the output should be `12`.
This is my first try:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define SIZE 10
int main()
{
char palavra[SIZE];
char palavra2[SIZE];
char *pont = palavra;
char *pont2 = palavra2;
printf("Insert the string\n");
scanf("%s", palavra);
do{
if (isdigit(*pont)){
strcat(palavra2, *pont);
}
*pont++;
}while (*pont != '\0');
printf("\nThe number is:\n%s\n", palavra2);
return 0;
}
I believe that the pointer is working as expected but can't understand why strcat is not working.
Made a second try that is the program finds a number, stores that char in one variable and only then try to use strcat with that variable. Here is the code:
int main()
{
char palavra[SIZE];
char palavra2[SIZE];
char temp;
char *pont = palavra;
char * pont2 = &temp;
printf("Insert the string\n");
scanf("%s", palavra);
do{
if (isdigit(*pont)){
temp = *pont;
strcat(palavra2, pont2);
}
*pont++;
}while (*pont != '\0');
printf("\nThe number is:\n%s\n", palavra2);
return 0;
}
Once again it gives me problems at strcat.
Made one last attempt but without pointer and still strcat does not work. Here is the code:
int main()
{
int i = 0;
char palavra[SIZE];
char palavra2[SIZE];
char temp;
printf("Insert the string\n");
scanf("%s", palavra);
do{
if (isdigit(palavra[i])){
temp = palavra[i];
strcat(palavra2, palavra[i]);
}
i++;
}while (palavra[i] != '\0');
printf("\nThe number is:\n%s\n", palavra2);
return 0;
}
Can you point me to the right direction? Don't now what more can I do..
Regards,
favolas | c | pointers | strcat | null | null | null | open | c strcat with pointer
===
I'm trying to use pointers and strcat from C. This is part of my learning process.
The idea is the user inputs a string that contains digits and the output should return only the digits.
So, if the user inputs
`te12abc` the output should be `12`.
This is my first try:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define SIZE 10
int main()
{
char palavra[SIZE];
char palavra2[SIZE];
char *pont = palavra;
char *pont2 = palavra2;
printf("Insert the string\n");
scanf("%s", palavra);
do{
if (isdigit(*pont)){
strcat(palavra2, *pont);
}
*pont++;
}while (*pont != '\0');
printf("\nThe number is:\n%s\n", palavra2);
return 0;
}
I believe that the pointer is working as expected but can't understand why strcat is not working.
Made a second try that is the program finds a number, stores that char in one variable and only then try to use strcat with that variable. Here is the code:
int main()
{
char palavra[SIZE];
char palavra2[SIZE];
char temp;
char *pont = palavra;
char * pont2 = &temp;
printf("Insert the string\n");
scanf("%s", palavra);
do{
if (isdigit(*pont)){
temp = *pont;
strcat(palavra2, pont2);
}
*pont++;
}while (*pont != '\0');
printf("\nThe number is:\n%s\n", palavra2);
return 0;
}
Once again it gives me problems at strcat.
Made one last attempt but without pointer and still strcat does not work. Here is the code:
int main()
{
int i = 0;
char palavra[SIZE];
char palavra2[SIZE];
char temp;
printf("Insert the string\n");
scanf("%s", palavra);
do{
if (isdigit(palavra[i])){
temp = palavra[i];
strcat(palavra2, palavra[i]);
}
i++;
}while (palavra[i] != '\0');
printf("\nThe number is:\n%s\n", palavra2);
return 0;
}
Can you point me to the right direction? Don't now what more can I do..
Regards,
favolas | 0 |
9,981,621 | 04/02/2012 18:18:23 | 66,086 | 02/13/2009 14:21:07 | 814 | 41 | Calling external Macro in static lib | In my code, I am using a static lib (which is compiled within my app as a subproject)
My static lib needs a macro and const defined in a .h
The problem is my static lib does not see my macros and my other variables defined in the app.
What should I do?
Thanks for your help.
Thierry
| objective-c | null | null | null | null | null | open | Calling external Macro in static lib
===
In my code, I am using a static lib (which is compiled within my app as a subproject)
My static lib needs a macro and const defined in a .h
The problem is my static lib does not see my macros and my other variables defined in the app.
What should I do?
Thanks for your help.
Thierry
| 0 |
9,981,626 | 04/02/2012 18:18:37 | 988,207 | 10/10/2011 18:31:21 | 73 | 3 | iterating over memory allocated with Marshal.AllocHGlobal() | I have a 3rd party C library which one of its exported method's is as follows:
#define MAX_INDEX 8
int GetStuff(IN char* index[MAX_INDEX], OUT char* buf, IN size_t size);
The first argument is populated with pointers into the buf argument where specific strings are stored. The size indicates how long each string is expected to be in the buf buffer. My C# P/Invoke method for this currently looks like this:
[DllImport("Path/To/Dll", CharSet = CharSet.Ansi)]
private static extern int GetStuff(IntPtr indecies, IntPtr buf, Int32 size);
The C# P/Invoke method is private because I'm wrapping it's functionality in a public "getter" method which handles the allocation/deallocation of memory for the caller. When I use this method in C++, iterating is quite simple actually. I simply do something like:
char* pIndecies[MAX_INDEX];
char* pBuffer = new char[MAX_INDEX * 256 + 1]; // +1 for terminating NULL
GetStuff(pIndecies, pBuffer, 256);
// iterate over the items
for(int i(0); i < MAX_INDEX; i++) {
if(pIndecies[i]) {
std::cout << "String for index: " << i << " " << pIndecies[i] << std::endl;
}
}
Because of how these are used in C++, I decided I should probably use IntPtr objects and just allocate the memory that I'll need from the heap, call into the native code, and iterate over it the way I would in C++. Then I remembered that chars in C# are unicode characters and not ASCII characters. Would iteration in C# work the same even if I placed the iteration in an unsafe code block? My first thought was to do the following:
IntPtr pIndecies = Marshal.AllocHGlobal(MAX_INDEX * 4); // the size of a 32-pointer
IntPtr pBuffer = Marshal.AllocHGlobal(MAX_INDEX * 256 + 1); // should be the same
NativeMethods.GetStuff(pIndecies, pBuffer, 256);
unsafe {
char* pCStrings = (char*)pIndecies.ToPointer();
for(int i = 0; i < MAX_INDEX; i++) {
if(pCStrings[i])
string s = pCStrings[i];
}
}
My question then is, "How should I iterate over what this native code method returns?" Is this the right way to marshal to this function? Should I use a StringBuilder object for the second argument? One constraining problem is that the first argument is a 1:1 mapping of a structure behind the GetStuff() method. The value of each index is crucial for understanding what you're looking at in the second buffer argument.
I appreciate any suggestions.
Thanks,
Andy | c# | pinvoke | null | null | null | null | open | iterating over memory allocated with Marshal.AllocHGlobal()
===
I have a 3rd party C library which one of its exported method's is as follows:
#define MAX_INDEX 8
int GetStuff(IN char* index[MAX_INDEX], OUT char* buf, IN size_t size);
The first argument is populated with pointers into the buf argument where specific strings are stored. The size indicates how long each string is expected to be in the buf buffer. My C# P/Invoke method for this currently looks like this:
[DllImport("Path/To/Dll", CharSet = CharSet.Ansi)]
private static extern int GetStuff(IntPtr indecies, IntPtr buf, Int32 size);
The C# P/Invoke method is private because I'm wrapping it's functionality in a public "getter" method which handles the allocation/deallocation of memory for the caller. When I use this method in C++, iterating is quite simple actually. I simply do something like:
char* pIndecies[MAX_INDEX];
char* pBuffer = new char[MAX_INDEX * 256 + 1]; // +1 for terminating NULL
GetStuff(pIndecies, pBuffer, 256);
// iterate over the items
for(int i(0); i < MAX_INDEX; i++) {
if(pIndecies[i]) {
std::cout << "String for index: " << i << " " << pIndecies[i] << std::endl;
}
}
Because of how these are used in C++, I decided I should probably use IntPtr objects and just allocate the memory that I'll need from the heap, call into the native code, and iterate over it the way I would in C++. Then I remembered that chars in C# are unicode characters and not ASCII characters. Would iteration in C# work the same even if I placed the iteration in an unsafe code block? My first thought was to do the following:
IntPtr pIndecies = Marshal.AllocHGlobal(MAX_INDEX * 4); // the size of a 32-pointer
IntPtr pBuffer = Marshal.AllocHGlobal(MAX_INDEX * 256 + 1); // should be the same
NativeMethods.GetStuff(pIndecies, pBuffer, 256);
unsafe {
char* pCStrings = (char*)pIndecies.ToPointer();
for(int i = 0; i < MAX_INDEX; i++) {
if(pCStrings[i])
string s = pCStrings[i];
}
}
My question then is, "How should I iterate over what this native code method returns?" Is this the right way to marshal to this function? Should I use a StringBuilder object for the second argument? One constraining problem is that the first argument is a 1:1 mapping of a structure behind the GetStuff() method. The value of each index is crucial for understanding what you're looking at in the second buffer argument.
I appreciate any suggestions.
Thanks,
Andy | 0 |
9,981,628 | 04/02/2012 18:18:51 | 1,106,416 | 12/19/2011 17:32:25 | 6 | 0 | Web font not showing in Firefox | http://miche.com/
This is the strangest thing. We're using two web fonts and their varying weights on the above page: Benton Sans and Jubilat, both of which we have licenses for. The h2 ("Interested in joining Miche?" "Already a Miche Representative?") is set to be Jubilat Regular, and is properly showing up in Firefox; however, the h1 ("Welcome!") is Jubilat Light, and appearing as Times New Roman.
Both weights are generated with Font Squirrel.
Both are hosted on the same server.
Both are coded in the same way.
I've reuploaded the files.
I've tried if IE so FF doesn't try to use .eot.
Before you say it: Yes, I have tried Bulletproof.
Why is Regular showing up when Light isn't? I wonder if I'm just not using the right combination of CSS.
@font-face {
font-family: 'JubilatLight';
src: url('https://bc.miche.com/FileUploads/CMS/Documents/jubilatlightwebfont.eot');
src: url('https://bc.miche.com/FileUploads/CMS/Documents/jubilatlightwebfont.eot?#iefix') format('embedded-opentype'),
url('https://bc.miche.com/FileUploads/CMS/Documents/jubilatlightwebfont.woff') format('woff'),
url('https://bc.miche.com/FileUploads/CMS/Documents/jubilatlightwebfont.ttf') format('truetype'),
url('https://bc.miche.com/FileUploads/CMS/Documents/jubilatlightwebfont.svg#JubilatLight') format('svg');
font-weight: normal;
font-style: normal;
}
#main-container h1.jubilat {
font-family: "JubilatLight";
font-weight: normal;
font-size: 40px;
color: #701271;
text-align: center;
} | html | css | firefox | font-face | null | null | open | Web font not showing in Firefox
===
http://miche.com/
This is the strangest thing. We're using two web fonts and their varying weights on the above page: Benton Sans and Jubilat, both of which we have licenses for. The h2 ("Interested in joining Miche?" "Already a Miche Representative?") is set to be Jubilat Regular, and is properly showing up in Firefox; however, the h1 ("Welcome!") is Jubilat Light, and appearing as Times New Roman.
Both weights are generated with Font Squirrel.
Both are hosted on the same server.
Both are coded in the same way.
I've reuploaded the files.
I've tried if IE so FF doesn't try to use .eot.
Before you say it: Yes, I have tried Bulletproof.
Why is Regular showing up when Light isn't? I wonder if I'm just not using the right combination of CSS.
@font-face {
font-family: 'JubilatLight';
src: url('https://bc.miche.com/FileUploads/CMS/Documents/jubilatlightwebfont.eot');
src: url('https://bc.miche.com/FileUploads/CMS/Documents/jubilatlightwebfont.eot?#iefix') format('embedded-opentype'),
url('https://bc.miche.com/FileUploads/CMS/Documents/jubilatlightwebfont.woff') format('woff'),
url('https://bc.miche.com/FileUploads/CMS/Documents/jubilatlightwebfont.ttf') format('truetype'),
url('https://bc.miche.com/FileUploads/CMS/Documents/jubilatlightwebfont.svg#JubilatLight') format('svg');
font-weight: normal;
font-style: normal;
}
#main-container h1.jubilat {
font-family: "JubilatLight";
font-weight: normal;
font-size: 40px;
color: #701271;
text-align: center;
} | 0 |
9,981,638 | 04/02/2012 18:19:28 | 1,308,691 | 04/02/2012 18:01:32 | 1 | 0 | How to Bootstrap Carousel go to index? | I'm using the Bootstrap on a project.
I would saberse there any way to make the Carousel navigate to an index. For example, something like:
$('myCarousel').to(2);
Anybody know a way to do this? | javascript | jquery | twitter-bootstrap | carousel | null | null | open | How to Bootstrap Carousel go to index?
===
I'm using the Bootstrap on a project.
I would saberse there any way to make the Carousel navigate to an index. For example, something like:
$('myCarousel').to(2);
Anybody know a way to do this? | 0 |
36,682 | 08/31/2008 08:08:35 | 1,695 | 08/18/2008 02:49:06 | 296 | 33 | Why do .Net WPF DependencyProperties have to be static members of the class | Learning WPF nowadays. Found something new today with .Net dependency properties. What they bring to the table is
* Support for Callbacks (Validation, Change, etc)
* Property inheritance
* Attached properties
among others.
But my question here is why do they need to be declared as static in the containing class? The recommmended way is to then add instance 'wrapper' property for them. Why ?
| wpf | .net | null | null | null | null | open | Why do .Net WPF DependencyProperties have to be static members of the class
===
Learning WPF nowadays. Found something new today with .Net dependency properties. What they bring to the table is
* Support for Callbacks (Validation, Change, etc)
* Property inheritance
* Attached properties
among others.
But my question here is why do they need to be declared as static in the containing class? The recommmended way is to then add instance 'wrapper' property for them. Why ?
| 0 |
36,685 | 08/31/2008 08:15:01 | 3,586 | 08/29/2008 07:51:02 | 1 | 2 | Symbian OS | Ever since I bought a Nokia N95 8G, I have been thinking about looking into some Symbian development. Could those with experience developing on the Symbian OS like their feeling towards the platform? Is it hard to get started, are the tools mature etc?
thanks,
Jimmy
| symbian | null | null | null | null | null | open | Symbian OS
===
Ever since I bought a Nokia N95 8G, I have been thinking about looking into some Symbian development. Could those with experience developing on the Symbian OS like their feeling towards the platform? Is it hard to get started, are the tools mature etc?
thanks,
Jimmy
| 0 |
36,693 | 08/31/2008 08:42:17 | 2,918 | 08/26/2008 00:13:57 | 1 | 1 | How can I render a PNG image (as a memory stream) onto a .NET ReportViewer report surface | I have a dynamically created image that I am saving to a stream so that I can display it on a ReportViewer surface.
Setup:
* Report datasource is an object datasource, with a dynamically generated stream as a property (CustomImage)
* Report.EnableExternalImages = true
* Image.Source = Database
* Image.MIMEType = image/png
* Image.Value = =Fields!CustomImage.Value
This is not working, but is not reporting any errors, just showing an empty image icon on the report surface. All other fields are displaying correctly.
Does anyone have a working code sample of this scenario?
| .net | reportviewer | streaming | image | null | null | open | How can I render a PNG image (as a memory stream) onto a .NET ReportViewer report surface
===
I have a dynamically created image that I am saving to a stream so that I can display it on a ReportViewer surface.
Setup:
* Report datasource is an object datasource, with a dynamically generated stream as a property (CustomImage)
* Report.EnableExternalImages = true
* Image.Source = Database
* Image.MIMEType = image/png
* Image.Value = =Fields!CustomImage.Value
This is not working, but is not reporting any errors, just showing an empty image icon on the report surface. All other fields are displaying correctly.
Does anyone have a working code sample of this scenario?
| 0 |
36,701 | 08/31/2008 09:17:01 | 3,836 | 08/31/2008 08:07:03 | 1 | 0 | Struct like objects in Java | Is it completely against the Java way to create struct like objects?
class SomeData1 {
public int x;
public int y;
}
I can see a class with accessors and mutators being more Java like.
class SomeData2 {
int getX();
void setX(int x);
int getY();
void setY(int y);
private int x;
private int y;
}
The class from the first example is notationally convenient.
// a function in a class
public int f(SomeData1 d) {
return (3 * d.x) / d.y;
}
This is not as convenient.
// a function in a class
public int f(SomeData2 d) {
return (3 * d.getX()) / d.getY();
} | java | design | struct | null | null | null | open | Struct like objects in Java
===
Is it completely against the Java way to create struct like objects?
class SomeData1 {
public int x;
public int y;
}
I can see a class with accessors and mutators being more Java like.
class SomeData2 {
int getX();
void setX(int x);
int getY();
void setY(int y);
private int x;
private int y;
}
The class from the first example is notationally convenient.
// a function in a class
public int f(SomeData1 d) {
return (3 * d.x) / d.y;
}
This is not as convenient.
// a function in a class
public int f(SomeData2 d) {
return (3 * d.getX()) / d.getY();
} | 0 |
36,706 | 08/31/2008 09:26:51 | 2,362 | 08/21/2008 20:46:43 | 37 | 5 | How do I make my Linux desktop sexy? | Anyone got any tips on how to improve the look and feel of the Linux desktop?
My contribution is: if you have half decent 3D acceleration on board, get CompizFusion for desktop effects to make the Mac boys cry!
[http://en.wikipedia.org/wiki/Compiz][1]
[1]: http://en.wikipedia.org/wiki/Compiz | linux | compiz | compizfusion | 3d | desktop | null | open | How do I make my Linux desktop sexy?
===
Anyone got any tips on how to improve the look and feel of the Linux desktop?
My contribution is: if you have half decent 3D acceleration on board, get CompizFusion for desktop effects to make the Mac boys cry!
[http://en.wikipedia.org/wiki/Compiz][1]
[1]: http://en.wikipedia.org/wiki/Compiz | 0 |
36,709 | 08/31/2008 09:28:51 | 2,995 | 08/26/2008 10:48:14 | 31 | 7 | Who knows of a decent yacc/bison type LALR parser generator for .net? | Thanks in advance. | lalr | .net | yacc | null | null | null | open | Who knows of a decent yacc/bison type LALR parser generator for .net?
===
Thanks in advance. | 0 |
36,715 | 08/31/2008 09:31:50 | 1,521 | 08/16/2008 10:01:35 | 373 | 10 | How can I access a website configured with host headers in IIS on the local machine? | When using host headers to host multiple websites on the same IP address in IIS, is there any way of accessing that website from a browser running on the local machine?
This is normally required when a given web component only allows configuration from the local machine. It's also useful when things like ASP.Net's built in error handling isn't working and you can only view the error in the browser but don't want to allow remote users to see it.
This has baffled me for a while and everytime I come across it I end up giving up in frustration and reconfigure stuff so I can accomplish such tasks remotely.
| iis | hostheaders | null | null | null | null | open | How can I access a website configured with host headers in IIS on the local machine?
===
When using host headers to host multiple websites on the same IP address in IIS, is there any way of accessing that website from a browser running on the local machine?
This is normally required when a given web component only allows configuration from the local machine. It's also useful when things like ASP.Net's built in error handling isn't working and you can only view the error in the browser but don't want to allow remote users to see it.
This has baffled me for a while and everytime I come across it I end up giving up in frustration and reconfigure stuff so I can accomplish such tasks remotely.
| 0 |
36,733 | 08/31/2008 09:49:18 | 1,768 | 08/18/2008 13:32:15 | 31 | 4 | Redirecting users from edit page back to calling page | I am working on a project management web application. The user has a variety of ways to display a list of tasks. When viewing a list page, they click on task and are redirected to the task edit page.
Since they are coming from a variety of ways, I am just curious as to the **best** way to **redirect** the user back to the calling page. I have some ideas, but would like to get other developers input. | asp.net | null | null | null | null | null | open | Redirecting users from edit page back to calling page
===
I am working on a project management web application. The user has a variety of ways to display a list of tasks. When viewing a list page, they click on task and are redirected to the task edit page.
Since they are coming from a variety of ways, I am just curious as to the **best** way to **redirect** the user back to the calling page. I have some ideas, but would like to get other developers input. | 0 |
36,742 | 08/31/2008 10:04:35 | 3,715 | 08/30/2008 09:17:39 | 30 | 4 | How do I find broken NMEA log sentences with grep? | My GPS logger occassionally leaves "unfinished" lines at the end of the log files. I think they're only at the end, but I want to check all lines just in case.
A sample complete sentence looks like:
$GPRMC,005727.000,A,3751.9418,S,14502.2569,E,0.00,339.17,210808,,,A*76
The line should start with a `$` sign, and end with an `*` and a two character hex checksum. I don't care if the checksum is correct, just that it's present. It also needs to ignore "ADVER" sentences which don't have the checksum and are at the start of every file.
The following Python code might work:
import re
from path import path
nmea = re.compile("^\$.+\*[0-9A-E]{2}$")
for log in path("gpslogs").files("*.log"):
for line in log.lines():
if not nmea.match(line) and not "ADVER" in line:
print "%s\n\t%s\n" % (log, line)
Is there a way to do that with `grep` or `awk` or something simple? I haven't really figured out how to get `grep` to do what I want.
Thanks. | grep | gps | nmea | null | null | null | open | How do I find broken NMEA log sentences with grep?
===
My GPS logger occassionally leaves "unfinished" lines at the end of the log files. I think they're only at the end, but I want to check all lines just in case.
A sample complete sentence looks like:
$GPRMC,005727.000,A,3751.9418,S,14502.2569,E,0.00,339.17,210808,,,A*76
The line should start with a `$` sign, and end with an `*` and a two character hex checksum. I don't care if the checksum is correct, just that it's present. It also needs to ignore "ADVER" sentences which don't have the checksum and are at the start of every file.
The following Python code might work:
import re
from path import path
nmea = re.compile("^\$.+\*[0-9A-E]{2}$")
for log in path("gpslogs").files("*.log"):
for line in log.lines():
if not nmea.match(line) and not "ADVER" in line:
print "%s\n\t%s\n" % (log, line)
Is there a way to do that with `grep` or `awk` or something simple? I haven't really figured out how to get `grep` to do what I want.
Thanks. | 0 |
36,748 | 08/31/2008 10:13:24 | 3,837 | 08/31/2008 09:51:14 | 1 | 2 | asynchronously loading a BitmapImage in C# using WPF | What's the best way to asynchronously load an BitmapImage in C# using WPF? It seems like many solution exist, but does a standard pattern or best practice exist?
Thanks! | c# | wpf | null | null | null | null | open | asynchronously loading a BitmapImage in C# using WPF
===
What's the best way to asynchronously load an BitmapImage in C# using WPF? It seems like many solution exist, but does a standard pattern or best practice exist?
Thanks! | 0 |
36,756 | 08/31/2008 10:33:29 | 2,720 | 08/24/2008 17:15:55 | 8 | 2 | F# - What are you using it for? | Ok so a good few months back i started hearing about F# and all the goodness it has, i bought Don Syme's book and started reading. At first i was really excited at how elegant it seemed to make certain tasks. But then i found a problem, although the language seems great it is quite different from what i use in work which means my co-workers won't understand it if i start developing new projects in it. So because i have not had a reason to actually work with it I still havent gotten my head around F# at all.
Luckily a new solo project is on the horizon which may give me a chance to use F#. My question is how did you start developing in F#? Do your co-workers also use it?
The project will be a pretty simple WinForm application connecting to a DB. I know i can write it all in C# or VB.NET but i would like to integrate F# in there in some way. Although developing the entire application in F# would take me far too long as i am still learning what areas would you suggest i use F# for? | self-improvement | f# | teamwork | null | null | null | open | F# - What are you using it for?
===
Ok so a good few months back i started hearing about F# and all the goodness it has, i bought Don Syme's book and started reading. At first i was really excited at how elegant it seemed to make certain tasks. But then i found a problem, although the language seems great it is quite different from what i use in work which means my co-workers won't understand it if i start developing new projects in it. So because i have not had a reason to actually work with it I still havent gotten my head around F# at all.
Luckily a new solo project is on the horizon which may give me a chance to use F#. My question is how did you start developing in F#? Do your co-workers also use it?
The project will be a pretty simple WinForm application connecting to a DB. I know i can write it all in C# or VB.NET but i would like to integrate F# in there in some way. Although developing the entire application in F# would take me far too long as i am still learning what areas would you suggest i use F# for? | 0 |
36,760 | 08/31/2008 10:39:58 | 2,138 | 08/20/2008 14:23:45 | 27 | 3 | SQL Query, Count with 0 count | I have three tables *page*, *attachment*, *page-attachment*
i have data like this
page
ID NAME
1 first page
2 second page
3 third page
4 fourth page
attachment
ID NAME
1 foo.word
2 test.xsl
3 mm.ppt
page-attachment
ID PAGE-ID ATTACHMENT-ID
1 2 1
2 2 2
3 3 3
I would like to get the number of attachments per page **also when that number is 0**. I have tried with:
select page.name, count(page-attachment.id) as attachmentsnumber from page inner join page-attachment on page.id=page-id group by page.id
I am getting this output:
NAME ATTACHMENTSNUMBER
second page 2
third page 1
I would like to get this output:
NAME ATTACHMENTSNUMBER
first page 0
second page 2
third page 1
fourth page 0
How do i get the 0 part.
Thanks in advanced.
| sql | null | null | null | null | null | open | SQL Query, Count with 0 count
===
I have three tables *page*, *attachment*, *page-attachment*
i have data like this
page
ID NAME
1 first page
2 second page
3 third page
4 fourth page
attachment
ID NAME
1 foo.word
2 test.xsl
3 mm.ppt
page-attachment
ID PAGE-ID ATTACHMENT-ID
1 2 1
2 2 2
3 3 3
I would like to get the number of attachments per page **also when that number is 0**. I have tried with:
select page.name, count(page-attachment.id) as attachmentsnumber from page inner join page-attachment on page.id=page-id group by page.id
I am getting this output:
NAME ATTACHMENTSNUMBER
second page 2
third page 1
I would like to get this output:
NAME ATTACHMENTSNUMBER
first page 0
second page 2
third page 1
fourth page 0
How do i get the 0 part.
Thanks in advanced.
| 0 |
36,778 | 08/31/2008 11:23:46 | 1,693 | 08/18/2008 02:25:37 | 1,051 | 42 | Firefox vs. IE: innerHTML handling | After hours of debugging, it appears to me that in FireFox, the innerHTML of a DOM reflects what is actually in the markup, but in IE, the innerHTML reflects what's in the markup PLUS any changes made by the user or dynamically (i.e. via Javascript).
Has anyone else found this to be true? Any interesting work-arounds to ensure both behave the same way? | javascript | firefox | dom | internet-explorer | null | null | open | Firefox vs. IE: innerHTML handling
===
After hours of debugging, it appears to me that in FireFox, the innerHTML of a DOM reflects what is actually in the markup, but in IE, the innerHTML reflects what's in the markup PLUS any changes made by the user or dynamically (i.e. via Javascript).
Has anyone else found this to be true? Any interesting work-arounds to ensure both behave the same way? | 0 |
36,806 | 08/31/2008 12:03:20 | 3,147 | 08/27/2008 01:00:22 | 65 | 8 | Setup django with WSGI and apache | I have been sold on mod_wsgi and apache rather than mod_python.
I have all the parts installed (django, apache, mod_wsgi) but have run into a problem deploying.
I am on osx 10.5 with apache 2.2 and django 1.0b2, mod_wsgi-2.3
My application is called tred.
Here are the relevant files:
httpd-vhosts (included in httpd-conf)
<pre>
NameVirtualHost tred:80
<VirtualHost *>
ServerName tred
Alias /admin_media /usr/lib/python2.5/site-packages/django/contrib/admin/media
<Directory /admin_media>
Order allow,deny
Allow from all
</Directory>
Alias /media /Users/dmg/Sites/tred/media
<Directory /media>
Order allow,deny
Allow from all
</Directory>
Alias / /Users/dmg/Sites/tred/
<Directory />
Order allow,deny
Allow from all
</Directory>
WSGIScriptAlias / /Users/dmg/Sites/tred/mod_wsgi-handler.wsgi
WSGIDaemonProcess tred user=dmg group=staff processes=1 threads=10
WSGIProcessGroup tred
</VirtualHost>
</pre>
mod_wsgi-handle.wsgi
<pre>
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')
os.environ['DJANGO_SETTINGS_MODULE'] = 'tred.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
</pre>
When I go to http://tred I get a directory listing rather than the rendered website. I think I have followed the tutorials correctly but it is obviously not right. What can I do to make this work?
| python | apache | django | mod-wsgi | null | null | open | Setup django with WSGI and apache
===
I have been sold on mod_wsgi and apache rather than mod_python.
I have all the parts installed (django, apache, mod_wsgi) but have run into a problem deploying.
I am on osx 10.5 with apache 2.2 and django 1.0b2, mod_wsgi-2.3
My application is called tred.
Here are the relevant files:
httpd-vhosts (included in httpd-conf)
<pre>
NameVirtualHost tred:80
<VirtualHost *>
ServerName tred
Alias /admin_media /usr/lib/python2.5/site-packages/django/contrib/admin/media
<Directory /admin_media>
Order allow,deny
Allow from all
</Directory>
Alias /media /Users/dmg/Sites/tred/media
<Directory /media>
Order allow,deny
Allow from all
</Directory>
Alias / /Users/dmg/Sites/tred/
<Directory />
Order allow,deny
Allow from all
</Directory>
WSGIScriptAlias / /Users/dmg/Sites/tred/mod_wsgi-handler.wsgi
WSGIDaemonProcess tred user=dmg group=staff processes=1 threads=10
WSGIProcessGroup tred
</VirtualHost>
</pre>
mod_wsgi-handle.wsgi
<pre>
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')
os.environ['DJANGO_SETTINGS_MODULE'] = 'tred.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
</pre>
When I go to http://tred I get a directory listing rather than the rendered website. I think I have followed the tutorials correctly but it is obviously not right. What can I do to make this work?
| 0 |
36,812 | 08/31/2008 12:11:10 | 2,592 | 08/23/2008 12:32:00 | 1 | 1 | How do I add data to the database in Django | I am a bit of a noob starting out in Django. Currently, i am writing up a bit of a product-based CMS as my first project.
Here is my question. How can i add additional data (products) to my Product model?
I have added '/admin/products/add' to my urls.py, but i dont really know where to go from there. How would i build both my view and my template? Please keep in mind that i dont really know all that much Python, and i am very new to Django | django | python | noob | null | null | null | open | How do I add data to the database in Django
===
I am a bit of a noob starting out in Django. Currently, i am writing up a bit of a product-based CMS as my first project.
Here is my question. How can i add additional data (products) to my Product model?
I have added '/admin/products/add' to my urls.py, but i dont really know where to go from there. How would i build both my view and my template? Please keep in mind that i dont really know all that much Python, and i am very new to Django | 0 |
36,813 | 08/31/2008 12:11:42 | 3,839 | 08/31/2008 10:11:12 | 1 | 3 | Table Stats gathering for Oracle | When and how should table stats gathering be performed for Oracle, version 9 and up? How would you go about gathering stats for a large database, where stats gathering would collide with "business hours". | oracle | null | null | null | null | null | open | Table Stats gathering for Oracle
===
When and how should table stats gathering be performed for Oracle, version 9 and up? How would you go about gathering stats for a large database, where stats gathering would collide with "business hours". | 0 |
36,817 | 08/31/2008 12:19:02 | 2,183 | 08/20/2008 19:42:13 | 232 | 8 | Who provides a WHOIS API? | Anyone can do WHOIS lookups through the whois command line tool or web based interfaces direct from the registrar but there are query limits which make commercial use difficult e.g. bulk checking of expiry dates on all your existing domains is not possible once you have more than x domains, where x is whatever thw WHOIS server query limit is.
I have found [Domain Search XML API][1] but are there any other providers of WHOIS APIs?
[1]: http://xml-api.domaintools.com/ | web-services | null | null | null | null | 02/05/2012 22:23:55 | not constructive | Who provides a WHOIS API?
===
Anyone can do WHOIS lookups through the whois command line tool or web based interfaces direct from the registrar but there are query limits which make commercial use difficult e.g. bulk checking of expiry dates on all your existing domains is not possible once you have more than x domains, where x is whatever thw WHOIS server query limit is.
I have found [Domain Search XML API][1] but are there any other providers of WHOIS APIs?
[1]: http://xml-api.domaintools.com/ | 4 |
36,825 | 08/31/2008 12:29:38 | 3,839 | 08/31/2008 10:11:12 | 6 | 4 | Intergrating Perl and Oracle AQ | Is there any way to listen to an Oracle AQ using a perl process as the listener.
| oracle | messaging | perl | null | null | null | open | Intergrating Perl and Oracle AQ
===
Is there any way to listen to an Oracle AQ using a perl process as the listener.
| 0 |
36,831 | 08/31/2008 12:35:30 | 1,596 | 08/17/2008 09:24:01 | 143 | 9 | How do you parse an IP address string in C#? | I'm writing C# code that uses the windows IP Helper API. One of the functions I'm trying to call is "[GetBestInterface][1]" that takes a 'uint' representation of an IP. What I need is to parse a textual representation of the IP to create the 'uint' representation.
I've found some examples via Google, like [this one][2] or [this one][3], but I'm pretty sure there should be a standard way to achieve this with .NET. Only problem is, I can't find this standard way. IPAddress.Parse seems to be in the right direction, but it doesn't supply any way of getting a 'uint' representation...
There is also a way of doing this using IP Helper, using the [ParseNetworkString][4], but again, I'd rather use .NET - I believe the less I rely on pInvoke the better.
So, anyone knows of a standard way to do this in .NET?
[1]: http://msdn.microsoft.com/en-us/library/aa365920(VS.85).aspx
[2]: http://www.justin-cook.com/wp/2006/11/28/convert-an-ip-address-to-ip-number-with-php-asp-c-and-vbnet/
[3]: http://www.codeguru.com/csharp/.net/net_general/internet/article.php/c10651
[4]: http://msdn.microsoft.com/en-us/library/bb408412(VS.85).aspx | networking | winapi | iphelper | null | null | null | open | How do you parse an IP address string in C#?
===
I'm writing C# code that uses the windows IP Helper API. One of the functions I'm trying to call is "[GetBestInterface][1]" that takes a 'uint' representation of an IP. What I need is to parse a textual representation of the IP to create the 'uint' representation.
I've found some examples via Google, like [this one][2] or [this one][3], but I'm pretty sure there should be a standard way to achieve this with .NET. Only problem is, I can't find this standard way. IPAddress.Parse seems to be in the right direction, but it doesn't supply any way of getting a 'uint' representation...
There is also a way of doing this using IP Helper, using the [ParseNetworkString][4], but again, I'd rather use .NET - I believe the less I rely on pInvoke the better.
So, anyone knows of a standard way to do this in .NET?
[1]: http://msdn.microsoft.com/en-us/library/aa365920(VS.85).aspx
[2]: http://www.justin-cook.com/wp/2006/11/28/convert-an-ip-address-to-ip-number-with-php-asp-c-and-vbnet/
[3]: http://www.codeguru.com/csharp/.net/net_general/internet/article.php/c10651
[4]: http://msdn.microsoft.com/en-us/library/bb408412(VS.85).aspx | 0 |
36,832 | 08/31/2008 12:37:24 | 3,848 | 08/31/2008 11:24:27 | 11 | 2 | Virtual functions in constructors, why do languages differ? | In C++ when a virtual function is called from within a constructor it doesn't behave like a virtual function. I think everyone who encountered for the first time was surprised but on second thought it makes sense, if the derived constructor hasn't yet run the object is **not** yet a *derived* so how can a derived function be called? The preconditions haven't had the chance to be set up. Example:
class base {
public:
base()
{
std::cout << "foo is " << foo() << std::endl;
}
virtual int foo() { return 42; }
};
class derived : public foo {
int* ptr_;
public:
derived(int i) : ptr_(new int(i*i)) { }
virtual int foo() { return *ptr_; }
};
It's exactly the same for Java and .NET yet they chose to go the other way, was the only reason *the principal of least surprise*?
Which do you think is the correct choice? | c++ | .net | java | language-agnostic | null | null | open | Virtual functions in constructors, why do languages differ?
===
In C++ when a virtual function is called from within a constructor it doesn't behave like a virtual function. I think everyone who encountered for the first time was surprised but on second thought it makes sense, if the derived constructor hasn't yet run the object is **not** yet a *derived* so how can a derived function be called? The preconditions haven't had the chance to be set up. Example:
class base {
public:
base()
{
std::cout << "foo is " << foo() << std::endl;
}
virtual int foo() { return 42; }
};
class derived : public foo {
int* ptr_;
public:
derived(int i) : ptr_(new int(i*i)) { }
virtual int foo() { return *ptr_; }
};
It's exactly the same for Java and .NET yet they chose to go the other way, was the only reason *the principal of least surprise*?
Which do you think is the correct choice? | 0 |
36,848 | 08/31/2008 13:00:32 | 3,839 | 08/31/2008 10:11:12 | 6 | 4 | Oracle Server performance monitoring tools | What tools would you recommend for monitoring the general health and performance of an oracle database. How do you ensure database issues are picked up and resolved quickly. | oracle | monitoring | null | null | null | 06/15/2012 18:09:08 | not constructive | Oracle Server performance monitoring tools
===
What tools would you recommend for monitoring the general health and performance of an oracle database. How do you ensure database issues are picked up and resolved quickly. | 4 |
36,861 | 08/31/2008 13:52:56 | 2,313 | 08/21/2008 15:27:23 | 40 | 5 | Strange boo language syntax | I've run into some strange syntax in [Boo Language Guide][1] :
setter = { value | a = value }
What | operator means?
[1]: http://boo.codehaus.org/Closures | boo | null | null | null | null | null | open | Strange boo language syntax
===
I've run into some strange syntax in [Boo Language Guide][1] :
setter = { value | a = value }
What | operator means?
[1]: http://boo.codehaus.org/Closures | 0 |
36,862 | 08/31/2008 13:54:20 | 745 | 08/08/2008 13:47:26 | 421 | 37 | How do you organise multiple git repositories? | With SVN, I had a single big repository I kept on a server, and checked-out on a few machines. This was a pretty good backup system, and allowed me easily work on any of the machines. I could checkout a specific project, commit and it updated the 'master' project, or I could checkout the entire thing.
Now, I have a bunch of git repositories, for various projects, several of which are on github. I also have the SVN repository I mentioned, imported via the git-svn command..
Basically, I like having all my code (not just projects, but random snippets and scripts, some things like my CV, articles I've written, websites I've made and so on) in one big repository I can easily clone onto remote machines, or memory-sticks/harddrives as backup.
The problem is, since it's a private repository, and git doesn't allow checking out of a specific folder (that I could push to github as a separate project, but have the changes appear in both the master-repo, and the sub-repos)
I *could* use the git submodule system, but it doesn't act how I want it too (submodules are pointers to other repositories, and don't really contain the actual code, so it's useless for backup)
Currently I have a folder of git-repos (for example, ~/code_projects/proj1/.git/ ~/code_projects/proj2/.git/), and after doing changes to proj1 I do `git push github`, then I copy the files into ~/Documents/code/python/projects/proj1/ and do a single commit (instead of the numerous ones in the individual repos). Then do `git push backupdrive1`, `git push mymemorystick` etc
So, the question: How do your personal code and projects with git repositories, and keep them synced and backed-up? | git | organizing | null | null | null | null | open | How do you organise multiple git repositories?
===
With SVN, I had a single big repository I kept on a server, and checked-out on a few machines. This was a pretty good backup system, and allowed me easily work on any of the machines. I could checkout a specific project, commit and it updated the 'master' project, or I could checkout the entire thing.
Now, I have a bunch of git repositories, for various projects, several of which are on github. I also have the SVN repository I mentioned, imported via the git-svn command..
Basically, I like having all my code (not just projects, but random snippets and scripts, some things like my CV, articles I've written, websites I've made and so on) in one big repository I can easily clone onto remote machines, or memory-sticks/harddrives as backup.
The problem is, since it's a private repository, and git doesn't allow checking out of a specific folder (that I could push to github as a separate project, but have the changes appear in both the master-repo, and the sub-repos)
I *could* use the git submodule system, but it doesn't act how I want it too (submodules are pointers to other repositories, and don't really contain the actual code, so it's useless for backup)
Currently I have a folder of git-repos (for example, ~/code_projects/proj1/.git/ ~/code_projects/proj2/.git/), and after doing changes to proj1 I do `git push github`, then I copy the files into ~/Documents/code/python/projects/proj1/ and do a single commit (instead of the numerous ones in the individual repos). Then do `git push backupdrive1`, `git push mymemorystick` etc
So, the question: How do your personal code and projects with git repositories, and keep them synced and backed-up? | 0 |
36,876 | 08/31/2008 14:27:32 | 31,505 | 2008-09-01 | 978 | 37 | [ASP.NET] Conditional Redirect on Login | I am using forms authentication. My users are redirected to a page (written in web.config) when they login, but some of them may not have the privilages to access this default page. In this case, I want them to redirect to another page but RedirectFromLoginPage method always redirects to the default page in web.config. How do I make the users login, and then redirect to a page which depends on some criteria? | asp.net | forms-authentication | null | null | null | null | open | [ASP.NET] Conditional Redirect on Login
===
I am using forms authentication. My users are redirected to a page (written in web.config) when they login, but some of them may not have the privilages to access this default page. In this case, I want them to redirect to another page but RedirectFromLoginPage method always redirects to the default page in web.config. How do I make the users login, and then redirect to a page which depends on some criteria? | 0 |
36,877 | 08/31/2008 14:27:50 | 3,871 | 08/31/2008 14:27:50 | 1 | 0 | How do you set up use HttpOnly cookies in PHP | How can I set the cookies in my PHP apps as HttpOnly cookies? | httponly | php | null | null | null | null | open | How do you set up use HttpOnly cookies in PHP
===
How can I set the cookies in my PHP apps as HttpOnly cookies? | 0 |
36,881 | 08/31/2008 14:36:11 | 1,197 | 08/13/2008 12:40:43 | 1 | 1 | Updating Android Tab Icons | I have an activity which has a TabHost containing a set of TabSpecs each with a listview containing the items to be displayed by the tab. When each TabSpec is created, I set an icon to be displayed in the tab header.
The TabSpecs are created in this way within a setupTabs() method which loops to create the appropriate number of tabs:
TabSpec ts = mTabs.newTabSpec("tab");
ts.setIndicator("TabTitle", iconResource);
ts.setContent(new TabHost.TabContentFactory(
{
public View createTabContent(String tag)
{
...
}
});
mTabs.addTab(ts);
There are a couple instances where I want to be able to change the icon which is displayed in each tab during the execution of my program. Currently I am deleting all the tabs, and calling the above code again to re-create them.
mTabs.getTabWidget().removeAllViews();
mTabs.clearAllTabs(true);
setupTabs();
Is there a way to replace the icon that is being displayed without deleting and re-creating all of the tabs?
| android | null | null | null | null | null | open | Updating Android Tab Icons
===
I have an activity which has a TabHost containing a set of TabSpecs each with a listview containing the items to be displayed by the tab. When each TabSpec is created, I set an icon to be displayed in the tab header.
The TabSpecs are created in this way within a setupTabs() method which loops to create the appropriate number of tabs:
TabSpec ts = mTabs.newTabSpec("tab");
ts.setIndicator("TabTitle", iconResource);
ts.setContent(new TabHost.TabContentFactory(
{
public View createTabContent(String tag)
{
...
}
});
mTabs.addTab(ts);
There are a couple instances where I want to be able to change the icon which is displayed in each tab during the execution of my program. Currently I am deleting all the tabs, and calling the above code again to re-create them.
mTabs.getTabWidget().removeAllViews();
mTabs.clearAllTabs(true);
setupTabs();
Is there a way to replace the icon that is being displayed without deleting and re-creating all of the tabs?
| 0 |
36,889 | 08/31/2008 14:41:46 | 2,287 | 08/21/2008 13:49:47 | 11 | 2 | Memcache control panel? | We've been running [eAccelerator][1] on each of 3 webservers and are looking to move to a [memcache][2] pool across all 3, hopefully reducing by about 2/3 our db lookups.
One of the handy things about eAccelerator is the web-based control interface ([control.php][3]), which has proved very useful when we've had to flush the cache unexpectedly, quickly monitor which scripts are in cache, etc.
We've been looking but haven't found anything that offers the same type of functionality for memcache - does anyone know if such a thing exists?
Obviously flushing cache etc is easy enough with memcache on the console, but our particular set-up means we may have guys monitoring our front-end and needing to flush the cache who will not necessarily have shell access on the servers.
[1]: http://eaccelerator.net/ "eAccelerator"
[2]: http://www.danga.com/memcached/ "memcache"
[3]: http://eaccelerator.net/browser/eaccelerator/tags/0.9.5-rc1/control.php "control.php" | memcached | cache | controlpanel | eaccelerator | null | null | open | Memcache control panel?
===
We've been running [eAccelerator][1] on each of 3 webservers and are looking to move to a [memcache][2] pool across all 3, hopefully reducing by about 2/3 our db lookups.
One of the handy things about eAccelerator is the web-based control interface ([control.php][3]), which has proved very useful when we've had to flush the cache unexpectedly, quickly monitor which scripts are in cache, etc.
We've been looking but haven't found anything that offers the same type of functionality for memcache - does anyone know if such a thing exists?
Obviously flushing cache etc is easy enough with memcache on the console, but our particular set-up means we may have guys monitoring our front-end and needing to flush the cache who will not necessarily have shell access on the servers.
[1]: http://eaccelerator.net/ "eAccelerator"
[2]: http://www.danga.com/memcached/ "memcache"
[3]: http://eaccelerator.net/browser/eaccelerator/tags/0.9.5-rc1/control.php "control.php" | 0 |
36,890 | 08/31/2008 14:44:18 | 3,583 | 08/29/2008 07:41:50 | 60 | 6 | Changing a CORBA interface without recompilation | I'd like to add a method to my existing server's CORBA interface. Will that require recompiling all clients?
I am using TAO. | corba | tao | idl | recompile | null | null | open | Changing a CORBA interface without recompilation
===
I'd like to add a method to my existing server's CORBA interface. Will that require recompiling all clients?
I am using TAO. | 0 |
36,901 | 08/31/2008 15:04:35 | 2,572 | 08/23/2008 00:38:49 | 26 | 1 | What does ** and * do for python parameters? | In the following method, what does the * and ** do for param2? I'm new to Python...I assume it's a reference or pointer. Answers?
def foo(param1, *param2):
def bar(param1, **param2):
| python | null | null | null | null | null | open | What does ** and * do for python parameters?
===
In the following method, what does the * and ** do for param2? I'm new to Python...I assume it's a reference or pointer. Answers?
def foo(param1, *param2):
def bar(param1, **param2):
| 0 |
36,906 | 08/31/2008 15:12:35 | 3,869 | 08/31/2008 14:21:44 | 1 | 0 | What is the fastest way to swap values in C? | I want to swap two integers, and I want to know which of these two implementations will be faster:
The obvious way with a temp variable:
void swap(int* a, int* b)
{
int temp = *a;
*a = *b;
*b = temp;
}
Or the xor version that I'm sure most people have seen:
void swap(int* a, int* b)
{
*a ^= *b;
*b ^= *a;
*a ^= *b;
}
It seems like the first uses an extra register, but the second one is doing three loads and stores while the first only does two of each. Can someone tell me which is faster and why? The why being more important. | c | performance | null | null | null | null | open | What is the fastest way to swap values in C?
===
I want to swap two integers, and I want to know which of these two implementations will be faster:
The obvious way with a temp variable:
void swap(int* a, int* b)
{
int temp = *a;
*a = *b;
*b = temp;
}
Or the xor version that I'm sure most people have seen:
void swap(int* a, int* b)
{
*a ^= *b;
*b ^= *a;
*a ^= *b;
}
It seems like the first uses an extra register, but the second one is doing three loads and stores while the first only does two of each. Can someone tell me which is faster and why? The why being more important. | 0 |
36,915 | 08/31/2008 15:29:34 | 3,798 | 08/30/2008 22:09:59 | 1 | 0 | Is there any way to sticky a file in subversion | We have been working with CVS for years, and frequently find it useful to sticky a single file here and there. Is there any way to do this in subversion, specifically from TortoiseSVN? | svn | tortoisesvn | null | null | null | null | open | Is there any way to sticky a file in subversion
===
We have been working with CVS for years, and frequently find it useful to sticky a single file here and there. Is there any way to do this in subversion, specifically from TortoiseSVN? | 0 |
36,916 | 08/31/2008 15:31:39 | 1,013 | 08/11/2008 13:24:18 | 232 | 33 | Communication between between pages | I want to enable an user to be able to communicate with other users through a site. I know that ASP.net is stateless, but what can I use for this synced communication? Java servlets?
Thank you | asp.net | null | null | null | null | null | open | Communication between between pages
===
I want to enable an user to be able to communicate with other users through a site. I know that ASP.net is stateless, but what can I use for this synced communication? Java servlets?
Thank you | 0 |
36,932 | 08/31/2008 15:55:47 | 3,880 | 08/31/2008 15:48:19 | 1 | 0 | What's the best way to implement an 'enum' in Python? | I'm mainly a C# developer, but I'm currently working on a project in Python.
What's the best way to implement the equivalent of an enum in Python? | python | enums | null | null | null | null | open | What's the best way to implement an 'enum' in Python?
===
I'm mainly a C# developer, but I'm currently working on a project in Python.
What's the best way to implement the equivalent of an enum in Python? | 0 |
36,949 | 08/31/2008 16:41:54 | 3,819 | 08/31/2008 02:19:58 | 1 | 0 | How do I use ADAM to run unit tests? | I writing a web site that uses Active Directory to validate users. I don't have access to an Active Directory instance that I can edit in any way.
I've heard that some people are using Active Directory Application Mode (ADAM) to create AD data to be used in Unit and Integration Testing.
Has anyone else done this? Are the any good site / blog that tells how to do this? What are the issues? Is this even a good idea? | testing | activedirectory | adam | null | null | null | open | How do I use ADAM to run unit tests?
===
I writing a web site that uses Active Directory to validate users. I don't have access to an Active Directory instance that I can edit in any way.
I've heard that some people are using Active Directory Application Mode (ADAM) to create AD data to be used in Unit and Integration Testing.
Has anyone else done this? Are the any good site / blog that tells how to do this? What are the issues? Is this even a good idea? | 0 |
36,952 | 08/31/2008 16:49:06 | 2,894 | 08/25/2008 20:06:55 | 262 | 34 | Ruby Introduction for C# Devs | I am curious about Ruby. Up to this point I have been following the whole C/C++/C# path and feel the need to branch out. Are there any references on how to get started and how it differs from other languages? | ruby | training | null | null | null | null | open | Ruby Introduction for C# Devs
===
I am curious about Ruby. Up to this point I have been following the whole C/C++/C# path and feel the need to branch out. Are there any references on how to get started and how it differs from other languages? | 0 |
36,953 | 08/31/2008 16:50:35 | 3,189 | 08/27/2008 11:59:18 | 81 | 9 | Resources for lexing, tokenising and parsing in python | Can people point me to resources on lexing, parsing and tokenising with Python?
I'm doing a little hacking on an open source project ([hotwire](http://www.hotwire-shell.org/)) and wanted to do a few changes to the code that [lexes](http://code.google.com/p/hotwire-shell/source/browse/trunk/hotwire/externals/shlex.py), [parses and tokenises](http://code.google.com/p/hotwire-shell/source/browse/trunk/hotwire/command.py) the commands entered into it. As it is real working code it is fairly complex and a bit hard to work out.
I haven't worked on code to lex/parse/tokenise before, so I was thinking one approach would be to work through a tutorial or two on this aspect. I would hope to learn enough to navigate around the code I actually want to alter. Is there anything suitable out there? (Ideally it could be done in an afternoon without having to buy and read the dragon book first ...) | python | resources | parse | lex | null | null | open | Resources for lexing, tokenising and parsing in python
===
Can people point me to resources on lexing, parsing and tokenising with Python?
I'm doing a little hacking on an open source project ([hotwire](http://www.hotwire-shell.org/)) and wanted to do a few changes to the code that [lexes](http://code.google.com/p/hotwire-shell/source/browse/trunk/hotwire/externals/shlex.py), [parses and tokenises](http://code.google.com/p/hotwire-shell/source/browse/trunk/hotwire/command.py) the commands entered into it. As it is real working code it is fairly complex and a bit hard to work out.
I haven't worked on code to lex/parse/tokenise before, so I was thinking one approach would be to work through a tutorial or two on this aspect. I would hope to learn enough to navigate around the code I actually want to alter. Is there anything suitable out there? (Ideally it could be done in an afternoon without having to buy and read the dragon book first ...) | 0 |
36,956 | 08/31/2008 16:53:02 | 1,600 | 08/17/2008 13:46:47 | 764 | 58 | Simulating queries of large views for benchmarking purposes | A Windows Forms application of ours pulls records from a view on SQL Server through ADO.NET and a SOAP web service, displaying them in a data grid. We have had several cases with ~25,000 rows, which works relatively smoothly, but a potential customer needs to have many times that much in a single list.
To figure out how well we scale right now, and how (and how far) we can realistically improve, I'd like to implement a simulation: instead of displaying actual data, have the SQL Server send fictional, random data. The client and transport side would be mostly the same; the view (or at least the underlying table) would of course work differently. The user specifies the amount of fictional rows (e.g. 100,000).
For the time being, I just want to know how long it takes for the client to retrieve and process the data and is just about ready to display it.
What I'm trying to figure out is this: how do I make the SQL Server send such data?
Do I:
1. Create a stored procedure that has to be run beforehand to fill an actual table?
2. Create a function that I point the view to, thus having the server generate the data 'live'?
3. Somehow replicate and/or randomize existing data?
The first option sounds to me like it would yield the results closest to the real world. Because the data is actually 'physically there', the `SELECT` query would be quite similar performance-wise to one on real data. However, it taxes the server with an otherwise meaningless operation. The fake data would also be backed up, as it would live in one and the same database — unless, of course, I delete the data after each benchmark run.
The second and third option tax the server *while* running the actual simulation, thus potentially giving unrealistically slow results.
-----
In addition, I'm unsure how to create those rows, short of using a loop or cursor. I can use `SELECT top <n> random1(), random2(), […] FROM foo` if `foo` actually happens to have `<n>` entries, but otherwise I'll (obviously) only get as many rows as `foo` happens to have. A `GROUP BY newid()` or similar doesn't appear to do the trick. | sqlserver | ado.net | benchmarking | null | null | null | open | Simulating queries of large views for benchmarking purposes
===
A Windows Forms application of ours pulls records from a view on SQL Server through ADO.NET and a SOAP web service, displaying them in a data grid. We have had several cases with ~25,000 rows, which works relatively smoothly, but a potential customer needs to have many times that much in a single list.
To figure out how well we scale right now, and how (and how far) we can realistically improve, I'd like to implement a simulation: instead of displaying actual data, have the SQL Server send fictional, random data. The client and transport side would be mostly the same; the view (or at least the underlying table) would of course work differently. The user specifies the amount of fictional rows (e.g. 100,000).
For the time being, I just want to know how long it takes for the client to retrieve and process the data and is just about ready to display it.
What I'm trying to figure out is this: how do I make the SQL Server send such data?
Do I:
1. Create a stored procedure that has to be run beforehand to fill an actual table?
2. Create a function that I point the view to, thus having the server generate the data 'live'?
3. Somehow replicate and/or randomize existing data?
The first option sounds to me like it would yield the results closest to the real world. Because the data is actually 'physically there', the `SELECT` query would be quite similar performance-wise to one on real data. However, it taxes the server with an otherwise meaningless operation. The fake data would also be backed up, as it would live in one and the same database — unless, of course, I delete the data after each benchmark run.
The second and third option tax the server *while* running the actual simulation, thus potentially giving unrealistically slow results.
-----
In addition, I'm unsure how to create those rows, short of using a loop or cursor. I can use `SELECT top <n> random1(), random2(), […] FROM foo` if `foo` actually happens to have `<n>` entries, but otherwise I'll (obviously) only get as many rows as `foo` happens to have. A `GROUP BY newid()` or similar doesn't appear to do the trick. | 0 |
36,959 | 08/31/2008 16:54:33 | 3,488 | 08/28/2008 18:28:18 | 126 | 12 | How do you use script variables in PostgreSQL? | In MS SQL Server, create my scripts to use customizable variables:
declare @somevariable int
select @somevariable = -1
insert into foo values ( @somevariable )
I'll then change the value of @somevariable at runtime, depending on the value that I want the particular situation. Since it's at the top of the script it's easy to see & remember.
How do I do the same with PostgreSQL?
Googling turned up <a href="http://www.postgresql.org/docs/8.1/static/app-psql.html#APP-PSQL-VARIABLES">PSQL variables</a>, but it's implied that they can only be used <em>within other slash commands</em>, not in actual SQL. | postgresql | variables | sql | null | null | null | open | How do you use script variables in PostgreSQL?
===
In MS SQL Server, create my scripts to use customizable variables:
declare @somevariable int
select @somevariable = -1
insert into foo values ( @somevariable )
I'll then change the value of @somevariable at runtime, depending on the value that I want the particular situation. Since it's at the top of the script it's easy to see & remember.
How do I do the same with PostgreSQL?
Googling turned up <a href="http://www.postgresql.org/docs/8.1/static/app-psql.html#APP-PSQL-VARIABLES">PSQL variables</a>, but it's implied that they can only be used <em>within other slash commands</em>, not in actual SQL. | 0 |
36,968 | 08/31/2008 17:07:39 | 3,716 | 08/30/2008 09:28:12 | 1 | 2 | designing Panels without a parent Form in VS? | Does anyone know of any tools/plugins that allow you to design a Panel independently of a Form (Windows, not Web Form) within Visual Studio?
I've been using the designer and manually extracting the bits I want from the source, but surely there is a nicer way. | visual-studio | null | null | null | null | null | open | designing Panels without a parent Form in VS?
===
Does anyone know of any tools/plugins that allow you to design a Panel independently of a Form (Windows, not Web Form) within Visual Studio?
I've been using the designer and manually extracting the bits I want from the source, but surely there is a nicer way. | 0 |
36,984 | 08/31/2008 17:28:11 | 3,191 | 08/27/2008 12:32:21 | 124 | 6 | Is there a standard way to return values from custom dialogs in Windows Forms? | So right now my project has a few custom dialogs that do things like prompt the user for his birthday, or whatever. Right now they're just doing things like setting a `this.Birthday` property once they get an answer (which is of type `DateTime?`, with the null indicating a "Cancel"). Then the caller inspects the `Birthday` property of the dialog it created to figure out what the user answered.
My question is, *is there a more standard pattern for doing stuff like this?* I know we can set `this.DialogResult` for basic OK/Cancel stuff, but is there a more general way in Windows Forms for a form to indicate "here's the data I collected"? | .net | gui | winforms | null | null | null | open | Is there a standard way to return values from custom dialogs in Windows Forms?
===
So right now my project has a few custom dialogs that do things like prompt the user for his birthday, or whatever. Right now they're just doing things like setting a `this.Birthday` property once they get an answer (which is of type `DateTime?`, with the null indicating a "Cancel"). Then the caller inspects the `Birthday` property of the dialog it created to figure out what the user answered.
My question is, *is there a more standard pattern for doing stuff like this?* I know we can set `this.DialogResult` for basic OK/Cancel stuff, but is there a more general way in Windows Forms for a form to indicate "here's the data I collected"? | 0 |
36,991 | 08/31/2008 17:45:46 | 2,386 | 08/22/2008 00:33:19 | 324 | 19 | Do you have to register a Dialog Box? | So, I am a total beginner in any kind of Windows related programming. I have been playing around with the Windows API and came across a couple of examples on how to initialize create windows and such.
One example creates a regular window (I abbreviated some of the code):
<pre>
int WINAPI WinMain( [...] )
{
[...]
// Windows Class setup
wndClass.cbSize = sizeof( wndClass );
wndClass.style = CS_HREDRAW | CS_VREDRAW;
[...]
// Register class
RegisterClassEx( &wndClass );
// Create window
hWnd = CreateWindow( szAppName, "Win32 App",
WS_OVERLAPPEDWINDOW,
0, 0, 512, 384,
NULL, NULL, hInstance, NULL );
[...]
}
</pre>
The second example creates a dialog box (no abbreviations except the WinMain arguments):
<pre>
int WINAPI WinMain( [...] )
{
// Create dialog box
DialogBox(hInstance,
MAKEINTRESOURCE(IDD_MAIN_DLG),
NULL,
(DLGPROC)DialogProc);
}
</pre>
The second example does not contain any call to the register function. It just creates the DialogBox with its DialogProc process attached.
This works fine, but I am wondering if there is a benefit of registering the window class and then creating the dialog box (if this is at all possible).
| windows-api | null | null | null | null | null | open | Do you have to register a Dialog Box?
===
So, I am a total beginner in any kind of Windows related programming. I have been playing around with the Windows API and came across a couple of examples on how to initialize create windows and such.
One example creates a regular window (I abbreviated some of the code):
<pre>
int WINAPI WinMain( [...] )
{
[...]
// Windows Class setup
wndClass.cbSize = sizeof( wndClass );
wndClass.style = CS_HREDRAW | CS_VREDRAW;
[...]
// Register class
RegisterClassEx( &wndClass );
// Create window
hWnd = CreateWindow( szAppName, "Win32 App",
WS_OVERLAPPEDWINDOW,
0, 0, 512, 384,
NULL, NULL, hInstance, NULL );
[...]
}
</pre>
The second example creates a dialog box (no abbreviations except the WinMain arguments):
<pre>
int WINAPI WinMain( [...] )
{
// Create dialog box
DialogBox(hInstance,
MAKEINTRESOURCE(IDD_MAIN_DLG),
NULL,
(DLGPROC)DialogProc);
}
</pre>
The second example does not contain any call to the register function. It just creates the DialogBox with its DialogProc process attached.
This works fine, but I am wondering if there is a benefit of registering the window class and then creating the dialog box (if this is at all possible).
| 0 |
36,999 | 08/31/2008 18:05:49 | 2,701 | 08/24/2008 15:51:24 | 131 | 13 | Best practices for versioning your services with WCF? | I'm starting to work with my model almost exclusively in WCF and wanted to get some practical approaches to versioning these services over time. Can anyone point me in the right direction? | wcf | null | null | null | null | null | open | Best practices for versioning your services with WCF?
===
I'm starting to work with my model almost exclusively in WCF and wanted to get some practical approaches to versioning these services over time. Can anyone point me in the right direction? | 0 |
37,011 | 08/31/2008 18:22:46 | 3,305 | 08/27/2008 18:56:35 | 159 | 11 | Protected member variables? | Should you ever use protected member variables? What are the the advantages and what issues can this cause? | c# | java | c++ | coding-style | null | null | open | Protected member variables?
===
Should you ever use protected member variables? What are the the advantages and what issues can this cause? | 0 |
37,015 | 08/31/2008 18:28:11 | 245 | 08/04/2008 00:38:47 | 542 | 11 | How can I find a user's location based on their IP address? (free and not free services) | If you need to locate a user based on their IP address, what services are available?
p.s. I understand that some users use proxies etc, that mean the result is not 100% accurate. That's ok. | geography | location | ip | address | null | null | open | How can I find a user's location based on their IP address? (free and not free services)
===
If you need to locate a user based on their IP address, what services are available?
p.s. I understand that some users use proxies etc, that mean the result is not 100% accurate. That's ok. | 0 |
37,026 | 08/31/2008 18:47:12 | 3,894 | 08/31/2008 18:32:32 | 1 | 0 | Java: notify() vs. notifyAll() all over again | If one google for "difference between notify() and notifyAll()" then a lot of explanations will pop up (leaving apart the javadoc paragraphs). It all boils down to the number of waiting threads being waken up: one in notify() and all in notifyAll().
However (if I do understand the difference between these methods right), only one thread is always selected for further monitor acquisition; in the first case the one selected by the VM, in the second case the one selected by the system thread scheduler. The exact selection procedures for both of them (in general case) are not known to the programmer.
What's is the **useful** difference between notify() and notifyAll() then? Am I missing something? | java | multithreading | null | null | null | null | open | Java: notify() vs. notifyAll() all over again
===
If one google for "difference between notify() and notifyAll()" then a lot of explanations will pop up (leaving apart the javadoc paragraphs). It all boils down to the number of waiting threads being waken up: one in notify() and all in notifyAll().
However (if I do understand the difference between these methods right), only one thread is always selected for further monitor acquisition; in the first case the one selected by the VM, in the second case the one selected by the system thread scheduler. The exact selection procedures for both of them (in general case) are not known to the programmer.
What's is the **useful** difference between notify() and notifyAll() then? Am I missing something? | 0 |
37,029 | 08/31/2008 18:56:42 | 3,898 | 08/31/2008 18:45:40 | 1 | 0 | SQL Server Fast Forward Cursors | It is generally accepted that the use of cursors in stored procedures should be avoided where possible (replaced with set based logic etc). If you take the cases where you need to iterate over some data, and can do in a read only manner, are fast forward (read only forward) cursor more or less inefficient than say while loops? From my investigations it looks as though the cursor option is generally faster and uses less reads and cpu time. I haven't done any extensive testing, but is this what others find? Do cursors of this type (fast forward) carry additional overhead or resource that could be expensive that I don't know about.
Is all the talk about not using cursors really about avoiding the use of cursors when set-based approaches are available, and the use of updatable cursors etc.
Thanks | sql | sql-server | stored-procedures | null | null | null | open | SQL Server Fast Forward Cursors
===
It is generally accepted that the use of cursors in stored procedures should be avoided where possible (replaced with set based logic etc). If you take the cases where you need to iterate over some data, and can do in a read only manner, are fast forward (read only forward) cursor more or less inefficient than say while loops? From my investigations it looks as though the cursor option is generally faster and uses less reads and cpu time. I haven't done any extensive testing, but is this what others find? Do cursors of this type (fast forward) carry additional overhead or resource that could be expensive that I don't know about.
Is all the talk about not using cursors really about avoiding the use of cursors when set-based approaches are available, and the use of updatable cursors etc.
Thanks | 0 |
37,030 | 08/31/2008 18:57:29 | 3,002 | 08/26/2008 11:21:07 | 551 | 21 | How to best implement software updates on windows? | I want to implement an "automatic update" system for a windows application.
Right now I'm semi-manually creating an ["appcast"][2] which my program checks, and notifies the user that a new version is available. (I'm using
[NSIS][1] for my installers).
Is there software that I can use that will handle the "automatic" part of the updates, perhaps similar to [Sparkle][3] on the mac? Any issues/pitfalls that I should be aware of?
[1]: http://nsis.sourceforge.net/Main_Page
[2]: http://connectedflow.com/appcasting/
[3]: http://sparkle.andymatuschak.org/ | windows | installation | null | null | null | null | open | How to best implement software updates on windows?
===
I want to implement an "automatic update" system for a windows application.
Right now I'm semi-manually creating an ["appcast"][2] which my program checks, and notifies the user that a new version is available. (I'm using
[NSIS][1] for my installers).
Is there software that I can use that will handle the "automatic" part of the updates, perhaps similar to [Sparkle][3] on the mac? Any issues/pitfalls that I should be aware of?
[1]: http://nsis.sourceforge.net/Main_Page
[2]: http://connectedflow.com/appcasting/
[3]: http://sparkle.andymatuschak.org/ | 0 |
37,041 | 08/31/2008 19:21:27 | 2,010 | 08/19/2008 19:22:15 | 326 | 20 | Exposing a remote interface or object model. | I have a question on the best way of exposing a remote interface.
As a means of improving my lacking skills in this area, I have started a [project](http://Telharmonium.devjavu.com/) to create an Eclipse-based front-end for [xmms2](http://xmms2.xmms.se).
I've implemented a protocol abstraction which I call ['client'](http://telharmonium.devjavu.com/browser/trunk/xmms2-client) (for legacy reasons) which allows me to access most exposed features using method calls which I am happy with even if it's far from perfect.
The features provided by the xmms2 daemon are things like track searching, meta-data retrieval and manipulation, change playback state, load playlists and so on and so forth.
I'm in the middle of updating to the latest stable release of xmms2, and I figured I might as well fix some of the glaring weaknesses of my current implementation.
My plan is to build a better abstraction on top of the protocol interface, one that allows a more natural interaction with the daemon. The current ['model'](http://telharmonium.devjavu.com/browser/trunk/xmms2-model) implementation is hard to use and is frankly quite ugly (not to mention the UI-code which is truly horrible atm).
So, the question is; how should I expose the remote interface as a neat data model (In particular track management and event handling)?
Today I have the [Tracks](http://telharmonium.devjavu.com/browser/trunk/xmms2-model/src/se/fnord/xmms2/model/Tracks.java) interface which I can use to get instances of [Track](http://telharmonium.devjavu.com/browser/trunk/xmms2-model/src/se/fnord/xmms2/model/Track.java) classes based on their id. Searching is performed through the [Collections](http://telharmonium.devjavu.com/browser/trunk/xmms2-model/src/se/fnord/xmms2/model/Collections.java) interface (unfortunate namespace clash) which I'd rather move to Tracks, I think.
Any data can be modified by a third party at any time, and this should be properly reflected in the model and change-notifications distributed
These interfaces are exposed when connecting, by returning an object hierarchy that looks like this:
* Connection
* Playback getPlayback()
* Play, pause, jump, current track etc
* Expose playback state changes
* Tracks getTracks()
* Track getTrack(id) etc
* Expose track updates
* Collections getCollection()
* Load and manipulate playlists or named collections
* Query media library
* Expose collection updates
I welcome anything from generic discussions to pattern name-dropping or concrete examples and patches :)
| java | osgi | eclipse | oop | null | null | open | Exposing a remote interface or object model.
===
I have a question on the best way of exposing a remote interface.
As a means of improving my lacking skills in this area, I have started a [project](http://Telharmonium.devjavu.com/) to create an Eclipse-based front-end for [xmms2](http://xmms2.xmms.se).
I've implemented a protocol abstraction which I call ['client'](http://telharmonium.devjavu.com/browser/trunk/xmms2-client) (for legacy reasons) which allows me to access most exposed features using method calls which I am happy with even if it's far from perfect.
The features provided by the xmms2 daemon are things like track searching, meta-data retrieval and manipulation, change playback state, load playlists and so on and so forth.
I'm in the middle of updating to the latest stable release of xmms2, and I figured I might as well fix some of the glaring weaknesses of my current implementation.
My plan is to build a better abstraction on top of the protocol interface, one that allows a more natural interaction with the daemon. The current ['model'](http://telharmonium.devjavu.com/browser/trunk/xmms2-model) implementation is hard to use and is frankly quite ugly (not to mention the UI-code which is truly horrible atm).
So, the question is; how should I expose the remote interface as a neat data model (In particular track management and event handling)?
Today I have the [Tracks](http://telharmonium.devjavu.com/browser/trunk/xmms2-model/src/se/fnord/xmms2/model/Tracks.java) interface which I can use to get instances of [Track](http://telharmonium.devjavu.com/browser/trunk/xmms2-model/src/se/fnord/xmms2/model/Track.java) classes based on their id. Searching is performed through the [Collections](http://telharmonium.devjavu.com/browser/trunk/xmms2-model/src/se/fnord/xmms2/model/Collections.java) interface (unfortunate namespace clash) which I'd rather move to Tracks, I think.
Any data can be modified by a third party at any time, and this should be properly reflected in the model and change-notifications distributed
These interfaces are exposed when connecting, by returning an object hierarchy that looks like this:
* Connection
* Playback getPlayback()
* Play, pause, jump, current track etc
* Expose playback state changes
* Tracks getTracks()
* Track getTrack(id) etc
* Expose track updates
* Collections getCollection()
* Load and manipulate playlists or named collections
* Query media library
* Expose collection updates
I welcome anything from generic discussions to pattern name-dropping or concrete examples and patches :)
| 0 |
37,043 | 08/31/2008 19:24:55 | 2,885 | 08/25/2008 17:52:09 | 18 | 3 | Flex MVC Frameworks | I'm currently using and enjoying using the Flex MVC framework [PureMVC][1]. I have heard some good things about Cairngorm, which is supported by Adobe and has first-to-market momentum. And there is a new player called Mate, which has a good deal of buzz.
Has anyone tried two or three of these frameworks and formed an opinion?
Thanks!
[1]: http://www.puremvc.org | flex | mvc | framework | null | null | null | open | Flex MVC Frameworks
===
I'm currently using and enjoying using the Flex MVC framework [PureMVC][1]. I have heard some good things about Cairngorm, which is supported by Adobe and has first-to-market momentum. And there is a new player called Mate, which has a good deal of buzz.
Has anyone tried two or three of these frameworks and formed an opinion?
Thanks!
[1]: http://www.puremvc.org | 0 |
37,048 | 08/31/2008 19:35:31 | 580 | 08/06/2008 22:30:28 | 955 | 80 | Image cropping C# | Can anyone advise on how to crop an image, let's say jpeg, without using any .NET framework constructs, just raw bytes? Since this is the recommended way in Silverlight...
Or point to a library? | silverlight | c# | null | null | null | null | open | Image cropping C#
===
Can anyone advise on how to crop an image, let's say jpeg, without using any .NET framework constructs, just raw bytes? Since this is the recommended way in Silverlight...
Or point to a library? | 0 |
37,053 | 08/31/2008 19:44:47 | 1,849 | 08/18/2008 21:46:57 | 8 | 3 | How can I get the localized name of a 'special' windows folder (Recycle bin etc.)? | I'm trying to find out the 'correct' windows API for finding out the localized name of 'special' folders, specifically the Recycle Bin. I want to be able to prompt the user with a suitably localized dialog box asking them if they want to send files to the recycle bin or delete them directly.
I've found lots on the internet (and on Stackoverflow) about how to do the actual deletion, and it seems simple enough, I just really want to be able to have the text localized. | winapi | localization | recycle-bin | null | null | null | open | How can I get the localized name of a 'special' windows folder (Recycle bin etc.)?
===
I'm trying to find out the 'correct' windows API for finding out the localized name of 'special' folders, specifically the Recycle Bin. I want to be able to prompt the user with a suitably localized dialog box asking them if they want to send files to the recycle bin or delete them directly.
I've found lots on the internet (and on Stackoverflow) about how to do the actual deletion, and it seems simple enough, I just really want to be able to have the text localized. | 0 |
37,056 | 08/31/2008 19:47:35 | 2,313 | 08/21/2008 15:27:23 | 47 | 5 | PostgreSQL perfomance monitoring tool | I'm setting up an web application with a FreeBSD PostgreSQL back-end. I'm looking for some database performance optimization tool/technique. Does someone know one? | postgresql | db | optimization | null | null | null | open | PostgreSQL perfomance monitoring tool
===
I'm setting up an web application with a FreeBSD PostgreSQL back-end. I'm looking for some database performance optimization tool/technique. Does someone know one? | 0 |
37,059 | 08/31/2008 19:53:14 | 2,041 | 08/19/2008 23:02:38 | 133 | 9 | Lucene.Net and SQL Server | Has anyone used Lucene.NET rather than using the full text search that comes with sql server?
If so I would be interested on how you implemented it.
Did you for example write a windows service that queried the database every hour then saved the results to the lucene.net index? | sql-server | lucene.net | null | null | null | null | open | Lucene.Net and SQL Server
===
Has anyone used Lucene.NET rather than using the full text search that comes with sql server?
If so I would be interested on how you implemented it.
Did you for example write a windows service that queried the database every hour then saved the results to the lucene.net index? | 0 |
37,067 | 08/31/2008 20:13:52 | 3,146 | 08/27/2008 00:25:15 | 41 | 5 | Task oriented thread pooling | I've created a model for executing worker tasks in a server application using a thread pool associated with an IO completion port such as shown in the posts below:
[http://weblogs.asp.net/kennykerr/archive/2008/01/03/parallel-programming-with-c-part-4-i-o-completion-ports.aspx][1]
[http://blogs.msdn.com/larryosterman/archive/2004/03/29/101329.aspx][2]
Are there any classes in boost that can help with this programming model?
[1]: http://weblogs.asp.net/kennykerr/archive/2008/01/03/parallel-programming-with-c-part-4-i-o-completion-ports.aspx
[2]: http://blogs.msdn.com/larryosterman/archive/2004/03/29/101329.aspx | c++ | multithreading | boost | null | null | null | open | Task oriented thread pooling
===
I've created a model for executing worker tasks in a server application using a thread pool associated with an IO completion port such as shown in the posts below:
[http://weblogs.asp.net/kennykerr/archive/2008/01/03/parallel-programming-with-c-part-4-i-o-completion-ports.aspx][1]
[http://blogs.msdn.com/larryosterman/archive/2004/03/29/101329.aspx][2]
Are there any classes in boost that can help with this programming model?
[1]: http://weblogs.asp.net/kennykerr/archive/2008/01/03/parallel-programming-with-c-part-4-i-o-completion-ports.aspx
[2]: http://blogs.msdn.com/larryosterman/archive/2004/03/29/101329.aspx | 0 |
37,069 | 08/31/2008 20:18:13 | 636 | 08/07/2008 12:32:33 | 446 | 30 | Apache - how do I build individual and/or all modules as shared modules | On Mac OS X 10.5 I downloaded the latest version of Apache 2.2.9. After the usual configure, make, make install dance I had a build of apache without mod_rewrite. This wasn't statically linked and the module was not built in the /modules folder either.
I had to do the following to build Apache and mod_rewrite:
./configure --prefix=/usr/local/apache2 --enable-rewrite=shared
* Is there a way to tell Apache to build all modules as Shared Modules (DSOs) so I can control loading from the Apache config?
* Now that I have built Apache and the mod_rewrite DSO, how can I build another shared module without building all of Apache?
(The last time I built Apache (2.2.8) on Solaris, by default it built everything as a shared module.) | unix | apache | mod-rewrite | configuration | null | null | open | Apache - how do I build individual and/or all modules as shared modules
===
On Mac OS X 10.5 I downloaded the latest version of Apache 2.2.9. After the usual configure, make, make install dance I had a build of apache without mod_rewrite. This wasn't statically linked and the module was not built in the /modules folder either.
I had to do the following to build Apache and mod_rewrite:
./configure --prefix=/usr/local/apache2 --enable-rewrite=shared
* Is there a way to tell Apache to build all modules as Shared Modules (DSOs) so I can control loading from the Apache config?
* Now that I have built Apache and the mod_rewrite DSO, how can I build another shared module without building all of Apache?
(The last time I built Apache (2.2.8) on Solaris, by default it built everything as a shared module.) | 0 |
37,070 | 08/31/2008 20:18:34 | 1,084 | 08/12/2008 11:01:49 | 356 | 34 | What is the meaning of "non temporal" memory accesses in x86 | This is a somewhat low-level question. In x86 assembly there are two SSE instructions:
MOVDQA *xmmi, m128*
and
MOVNTDQA *xmmi, m128*
The IA-32 Software Developer's Manual says that the *NT* in <code>MOVNTDQA<code> stands for *Non-Temporal*, and that it'otherwise it's the same as <code>MOVDQA<code>.
My question is, what does *Non-Temporal* mean? | x86 | sse | null | null | null | null | open | What is the meaning of "non temporal" memory accesses in x86
===
This is a somewhat low-level question. In x86 assembly there are two SSE instructions:
MOVDQA *xmmi, m128*
and
MOVNTDQA *xmmi, m128*
The IA-32 Software Developer's Manual says that the *NT* in <code>MOVNTDQA<code> stands for *Non-Temporal*, and that it'otherwise it's the same as <code>MOVDQA<code>.
My question is, what does *Non-Temporal* mean? | 0 |
37,073 | 08/31/2008 20:20:46 | 177 | 08/03/2008 02:15:39 | 55 | 3 | What is currently the best way to get a favicon to display in all browsers that support Favicons? | What is currently the best way to get a favicon to display in all browsers that currently support it?
Please include:
1. Which image formats are supported by which browsers.
2. Which lines are needed in what places for the various browsers.
Please post all the information directly not just by linking to other questions. | html | null | null | null | null | null | open | What is currently the best way to get a favicon to display in all browsers that support Favicons?
===
What is currently the best way to get a favicon to display in all browsers that currently support it?
Please include:
1. Which image formats are supported by which browsers.
2. Which lines are needed in what places for the various browsers.
Please post all the information directly not just by linking to other questions. | 0 |
37,089 | 08/31/2008 20:42:43 | 646 | 08/07/2008 13:12:40 | 71 | 2 | How can an app utilize multiple cores or CPUs in .Net or Java? | When launching a thread or a process in .Net or Java, is there a way to choose which processor or core it is launched on? How does the shared memory model work in such cases? | c# | java | multithreading | multithreaded | quadcore | null | open | How can an app utilize multiple cores or CPUs in .Net or Java?
===
When launching a thread or a process in .Net or Java, is there a way to choose which processor or core it is launched on? How does the shared memory model work in such cases? | 0 |
37,095 | 08/31/2008 20:54:19 | 116 | 08/02/2008 05:51:57 | 4,762 | 209 | How do I avoid read locks in my database? | Answers for multiple databases welcome! | sql | database | performance | locking | null | null | open | How do I avoid read locks in my database?
===
Answers for multiple databases welcome! | 0 |
37,101 | 08/31/2008 21:03:14 | 3,747 | 08/30/2008 14:33:59 | 55 | 12 | How to Clear OutputCache for Website without Restarting App | Is there a way clear or reset the outputcache for an entire website without a restart?
I'm just starting to use outputcache on a site and when I make a mistake in setting it up I need a page I can browse to that will reset it. | asp.net | outputcache | null | null | null | null | open | How to Clear OutputCache for Website without Restarting App
===
Is there a way clear or reset the outputcache for an entire website without a restart?
I'm just starting to use outputcache on a site and when I make a mistake in setting it up I need a page I can browse to that will reset it. | 0 |
37,103 | 08/31/2008 21:05:41 | 1,349,865 | 08/28/2008 22:42:35 | 65 | 10 | CSS - Make divs align horizontally | I have a container div with a fixed width and height, with overflow: hidden.
I want a horizontal row of float: left divs within this container. Divs which are floated left will naturally push onto the 'line' below after they read the right bound of their parent. This will happen even if the height of the parent should not allow this. This is how this looks:
![Wrong][1]
How I would like it to look:
![Right][2]
Note: the effect I want can be achieved by using inline elements & white-space: no-wrap (that is how I did it in the image shown). This, however, is no good to me (for reasons too lengthy to explain here), as the child divs need to be floated block level elements.
Help please!
[1]: http://img530.imageshack.us/img530/9063/wrongoh7.png
[2]: http://img391.imageshack.us/img391/8239/rightlk3.png | css | xhtml | null | null | null | null | open | CSS - Make divs align horizontally
===
I have a container div with a fixed width and height, with overflow: hidden.
I want a horizontal row of float: left divs within this container. Divs which are floated left will naturally push onto the 'line' below after they read the right bound of their parent. This will happen even if the height of the parent should not allow this. This is how this looks:
![Wrong][1]
How I would like it to look:
![Right][2]
Note: the effect I want can be achieved by using inline elements & white-space: no-wrap (that is how I did it in the image shown). This, however, is no good to me (for reasons too lengthy to explain here), as the child divs need to be floated block level elements.
Help please!
[1]: http://img530.imageshack.us/img530/9063/wrongoh7.png
[2]: http://img391.imageshack.us/img391/8239/rightlk3.png | 0 |
37,104 | 08/31/2008 21:05:48 | 116 | 08/02/2008 05:51:57 | 4,762 | 209 | Best Practices for versioning web site? | What's are the best practices for versioning web sites?
- Which revision control systems are well suited for such a job?
- What special-purpose tools exist?
- What other questions should I be asking?
- etc... | version-control | null | null | null | null | null | open | Best Practices for versioning web site?
===
What's are the best practices for versioning web sites?
- Which revision control systems are well suited for such a job?
- What special-purpose tools exist?
- What other questions should I be asking?
- etc... | 0 |
37,105 | 08/31/2008 21:08:34 | 109 | 08/02/2008 00:20:47 | 245 | 11 | How do you actually read source code? | [Reading source code][1] is a good way to improve as a programmer, but I've never seen a great explanation of how to do it. We often read textbooks & novels linearly, perhaps taking notes along the way. What do you do when trying to understand how a program works?
* Try the user-facing version of the program with your own inputs
* Read the API
* Trace through the core functions in your head, transforming imaginary inputs
* Start at "main" and fire off the debugger!
I read the Ruby on Rails source code when I studied the [MVC pattern][2]. Many discussions leave out critical parts of MVC as done in Rails:
* The **web server** negotiating the communication with the browser (the controller's HTML output has to get to the browser somehow)
* The **dispatcher** translating the incoming HTTP request to function parameters and instantiating the controller (you don't want this logic in the web server!)
When people say MVC they really mean "MVC + the subsystem to run it". Since I'd used Rails for a while before digging in, I had an idea of what to expect but this was nevertheless enlightening. But if I had never touched Rails (or MVC) and used it for a few projects I wouldn't be sure where to start.
I'm curious: How do you go about understanding the source for a project?
[1]: http://stackoverflow.com/questions/9603/what-are-some-great-source-code-to-read
[2]: http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ | ruby-on-rails | source | reading | education | null | null | open | How do you actually read source code?
===
[Reading source code][1] is a good way to improve as a programmer, but I've never seen a great explanation of how to do it. We often read textbooks & novels linearly, perhaps taking notes along the way. What do you do when trying to understand how a program works?
* Try the user-facing version of the program with your own inputs
* Read the API
* Trace through the core functions in your head, transforming imaginary inputs
* Start at "main" and fire off the debugger!
I read the Ruby on Rails source code when I studied the [MVC pattern][2]. Many discussions leave out critical parts of MVC as done in Rails:
* The **web server** negotiating the communication with the browser (the controller's HTML output has to get to the browser somehow)
* The **dispatcher** translating the incoming HTTP request to function parameters and instantiating the controller (you don't want this logic in the web server!)
When people say MVC they really mean "MVC + the subsystem to run it". Since I'd used Rails for a while before digging in, I had an idea of what to expect but this was nevertheless enlightening. But if I had never touched Rails (or MVC) and used it for a few projects I wouldn't be sure where to start.
I'm curious: How do you go about understanding the source for a project?
[1]: http://stackoverflow.com/questions/9603/what-are-some-great-source-code-to-read
[2]: http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.