question_id
int64
4
6.31M
answer_id
int64
7
6.31M
title
stringlengths
9
150
question_body
stringlengths
0
28.8k
answer_body
stringlengths
60
27.2k
question_text
stringlengths
40
28.9k
combined_text
stringlengths
124
39.6k
tags
listlengths
1
6
question_score
int64
0
26.3k
answer_score
int64
0
28.8k
view_count
int64
15
14M
answer_count
int64
0
182
favorite_count
int64
0
32
question_creation_date
stringdate
2008-07-31 21:42:52
2011-06-10 18:12:18
answer_creation_date
stringdate
2008-07-31 22:17:57
2011-06-10 18:14:17
12,332
12,408
In a C/C++ program, how does the system (Windows, Linux, and Mac OS X) call the main() function?
I am looking for a more technical explanation than the OS calls the function. Is there a website or book?
The.exe file (or equivalent on other platforms) contains an 'entry point' address. To a first approximation, the OS loads the relevant sections of the.EXE file into RAM, and then jumps to the entry point. As others have said, this entry point will not be 'main', but will instead be a part of the runtime library - it wi...
In a C/C++ program, how does the system (Windows, Linux, and Mac OS X) call the main() function? I am looking for a more technical explanation than the OS calls the function. Is there a website or book?
TITLE: In a C/C++ program, how does the system (Windows, Linux, and Mac OS X) call the main() function? QUESTION: I am looking for a more technical explanation than the OS calls the function. Is there a website or book? ANSWER: The.exe file (or equivalent on other platforms) contains an 'entry point' address. To a fi...
[ "c++", "c", "program-entry-point" ]
19
27
4,092
5
0
2008-08-15T15:08:48.560000
2008-08-15T15:50:12.457000
12,348
12,349
PHP / cURL on Windows install: "The specified module could not be found."
I'm running PHP 5.2.3 on Windows 2000 Server with IIS 5. I'm trying to get cURL working, so in my php.ini file, I have this line: extension_dir ="F:\PHP\ext" And later, I have: extension=php_curl.dll The file F:\PHP\ext\php_curl.dll exists, but when I try to run any PHP script, I get this in the error log: PHP Warning:...
Problem solved! Although the error message said The specified module could not be found, this is a little misleading -- it's not that it couldn't find php_curl.dll, but rather it couldn't find a module that php_curl.dll required. The 2 DLLs it requires are libeay32.dll and SSLeay32.dll. So, you have to put those 2 DLLs...
PHP / cURL on Windows install: "The specified module could not be found." I'm running PHP 5.2.3 on Windows 2000 Server with IIS 5. I'm trying to get cURL working, so in my php.ini file, I have this line: extension_dir ="F:\PHP\ext" And later, I have: extension=php_curl.dll The file F:\PHP\ext\php_curl.dll exists, but w...
TITLE: PHP / cURL on Windows install: "The specified module could not be found." QUESTION: I'm running PHP 5.2.3 on Windows 2000 Server with IIS 5. I'm trying to get cURL working, so in my php.ini file, I have this line: extension_dir ="F:\PHP\ext" And later, I have: extension=php_curl.dll The file F:\PHP\ext\php_curl...
[ "php", "windows", "curl" ]
30
35
40,430
6
0
2008-08-15T15:17:30.073000
2008-08-15T15:18:53.063000
12,368
12,394
How to dispose a class in .net?
The.NET garbage collector will eventually free up memory, but what if you want that memory back immediately? What code do you need to use in a class MyClass to call MyClass.Dispose() and free up all the used space by variables and objects in MyClass?
IDisposable has nothing to do with freeing memory. IDisposable is a pattern for freeing unmanaged resources -- and memory is quite definitely a managed resource. The links pointing to GC.Collect() are the correct answer, though use of this function is generally discouraged by the Microsoft.NET documentation. Edit: Havi...
How to dispose a class in .net? The.NET garbage collector will eventually free up memory, but what if you want that memory back immediately? What code do you need to use in a class MyClass to call MyClass.Dispose() and free up all the used space by variables and objects in MyClass?
TITLE: How to dispose a class in .net? QUESTION: The.NET garbage collector will eventually free up memory, but what if you want that memory back immediately? What code do you need to use in a class MyClass to call MyClass.Dispose() and free up all the used space by variables and objects in MyClass? ANSWER: IDisposabl...
[ ".net", "memory", "dispose" ]
45
103
90,313
20
0
2008-08-15T15:26:41.987000
2008-08-15T15:40:33.567000
12,374
25,204
Has anyone had any success in unit testing SQL stored procedures?
We’ve found that the unit tests we’ve written for our C#/C++ code have really paid off. But we still have thousands of lines of business logic in stored procedures, which only really get tested in anger when our product is rolled out to a large number of users. What makes this worse is that some of these stored procedu...
I ran into this same issue a while back and found that if I created a simple abstract base class for data access that allowed me to inject a connection and transaction, I could unit test my sprocs to see if they did the work in SQL that I asked them to do and then rollback so none of the test data is left in the db. Th...
Has anyone had any success in unit testing SQL stored procedures? We’ve found that the unit tests we’ve written for our C#/C++ code have really paid off. But we still have thousands of lines of business logic in stored procedures, which only really get tested in anger when our product is rolled out to a large number of...
TITLE: Has anyone had any success in unit testing SQL stored procedures? QUESTION: We’ve found that the unit tests we’ve written for our C#/C++ code have really paid off. But we still have thousands of lines of business logic in stored procedures, which only really get tested in anger when our product is rolled out to...
[ "sql", "unit-testing", "linq-to-sql" ]
37
12
7,437
16
0
2008-08-15T15:29:14.837000
2008-08-24T17:20:14.487000
12,385
12,436
How to attach a ChangeEvent handler to an inherited dependency property?
How would you attach a propertychanged callback to a property that is inherited? Like such: class A { DependencyProperty prop; } class B: A { //... prop.AddListener(PropertyChangeCallback); }
(edited to remove recommendation to use DependencyPropertyDescriptor, which is not available in Silverlight) PropertyDescriptor AddValueChanged Alternative
How to attach a ChangeEvent handler to an inherited dependency property? How would you attach a propertychanged callback to a property that is inherited? Like such: class A { DependencyProperty prop; } class B: A { //... prop.AddListener(PropertyChangeCallback); }
TITLE: How to attach a ChangeEvent handler to an inherited dependency property? QUESTION: How would you attach a propertychanged callback to a property that is inherited? Like such: class A { DependencyProperty prop; } class B: A { //... prop.AddListener(PropertyChangeCallback); } ANSWER: (edited to remove recommend...
[ ".net", "silverlight", "dependency-properties" ]
2
4
2,473
3
0
2008-08-15T15:34:20.367000
2008-08-15T16:14:18.913000
12,397
19,051
.NET VirtualPathProviders and Pre-Compilation
We've been working on an application that quite heavily relies on VirtualPathProviders in ASP.NET. We've just come to put the thing on a live server to demonstrate it and it appears that the VirtualPathProviders simply don't work when the site is pre-compiled!! I've been looking at the workaround which has been posted ...
Unfortunately that is not officially supported. See the following MSDN article. If a Web site is precompiled for deployment, content provided by a VirtualPathProvider instance is not compiled, and no VirtualPathProvider instances are used by the precompiled site. The site you referred to is an unofficial workaround. I ...
.NET VirtualPathProviders and Pre-Compilation We've been working on an application that quite heavily relies on VirtualPathProviders in ASP.NET. We've just come to put the thing on a live server to demonstrate it and it appears that the VirtualPathProviders simply don't work when the site is pre-compiled!! I've been lo...
TITLE: .NET VirtualPathProviders and Pre-Compilation QUESTION: We've been working on an application that quite heavily relies on VirtualPathProviders in ASP.NET. We've just come to put the thing on a live server to demonstrate it and it appears that the VirtualPathProviders simply don't work when the site is pre-compi...
[ "asp.net", "virtualpathprovider" ]
7
4
2,563
1
0
2008-08-15T15:41:53.160000
2008-08-20T23:03:37.457000
12,401
3,003,400
FOSS ASP.Net Session Replication Solution?
I've been searching (with little success) for a free/opensource session clustering and replication solution for asp.net. I've run across the usual suspects (indexus sharedcache, memcached), however, each has some limitations. Indexus - Very immature, stubbed session interface implementation. Its otherwise a great cachi...
BTW Windows Server AppFabric is out of beta. That's what i mentioned in my previous post. here is the link on general availability;- http://blogs.technet.com/b/appfabric/archive/2010/06/07/windows-server-appfabric-now-generally-available.aspx which specific features do you think one can get on NCache and not on AppFabr...
FOSS ASP.Net Session Replication Solution? I've been searching (with little success) for a free/opensource session clustering and replication solution for asp.net. I've run across the usual suspects (indexus sharedcache, memcached), however, each has some limitations. Indexus - Very immature, stubbed session interface ...
TITLE: FOSS ASP.Net Session Replication Solution? QUESTION: I've been searching (with little success) for a free/opensource session clustering and replication solution for asp.net. I've run across the usual suspects (indexus sharedcache, memcached), however, each has some limitations. Indexus - Very immature, stubbed ...
[ "asp.net", "session", "cluster-computing", "failover", "session-replication" ]
6
1
1,351
4
0
2008-08-15T15:45:21.217000
2010-06-09T06:00:07.663000
12,406
12,424
Is it possible to slipstream the Visual Studio 2008 SP1 install?
From what I've read, VS 2008 SP1 and Team Foundation Server SP1 packages are traditional service packs that require you to first install the original versions before you will be able to install the SP. Is there a way, supported or not, to slipstream the install?
Here's an MSDN forum post in which an MSFTie indicates it will be possible and that details are forthcoming. Another poster is relaying results of her almost-successful attempt. Looks like this will be doable soon. Related: how to slipstream Team Foundation Server 2008 SP1 (TFS 2008 SP1)
Is it possible to slipstream the Visual Studio 2008 SP1 install? From what I've read, VS 2008 SP1 and Team Foundation Server SP1 packages are traditional service packs that require you to first install the original versions before you will be able to install the SP. Is there a way, supported or not, to slipstream the i...
TITLE: Is it possible to slipstream the Visual Studio 2008 SP1 install? QUESTION: From what I've read, VS 2008 SP1 and Team Foundation Server SP1 packages are traditional service packs that require you to first install the original versions before you will be able to install the SP. Is there a way, supported or not, t...
[ "visual-studio-2008", "visual-studio-2008-sp1" ]
9
3
8,227
4
0
2008-08-15T15:48:58.527000
2008-08-15T16:06:39.427000
12,476
12,484
Why is my asp.net application throwing ThreadAbortException?
This is a self-explanatory question: Why does this thing bubble into my try catch's even when nothing is wrong? Why is it showing up in my log, hundreds of times? I know its a newb question, but if this site is gonna get search ranking and draw in newbs we have to ask them
This is probably coming from a Response.Redirect call. Check this link for an explanation: http://dotnet.org.za/armand/archive/2004/11/16/7088.aspx (In most cases, calling Response.Redirect(url, false) fixes the problem)
Why is my asp.net application throwing ThreadAbortException? This is a self-explanatory question: Why does this thing bubble into my try catch's even when nothing is wrong? Why is it showing up in my log, hundreds of times? I know its a newb question, but if this site is gonna get search ranking and draw in newbs we ha...
TITLE: Why is my asp.net application throwing ThreadAbortException? QUESTION: This is a self-explanatory question: Why does this thing bubble into my try catch's even when nothing is wrong? Why is it showing up in my log, hundreds of times? I know its a newb question, but if this site is gonna get search ranking and d...
[ "asp.net", "multithreading" ]
24
20
12,972
5
0
2008-08-15T17:02:44.867000
2008-08-15T17:11:32.213000
12,482
462,529
How can you publish a ClickOnce application through CruiseControl.NET?
I have CruiseControl.NET Version 1.4 set up on my development server. Whenever a developer checks in code, it makes a compile. Now we're at a place where we can start giving our application to the testers. We'd like to use ClickOnce to distribute the application, with the idea being that when a tester goes to test the ...
Thanks for all the help. The final solution we implemented took a bit from every answer. We found it easier to handle working with multiple environments using simple batch files. I'm not suggesting this is the best way to do this, but for our given scenario and requirements, this worked well. Supplement "Project" with ...
How can you publish a ClickOnce application through CruiseControl.NET? I have CruiseControl.NET Version 1.4 set up on my development server. Whenever a developer checks in code, it makes a compile. Now we're at a place where we can start giving our application to the testers. We'd like to use ClickOnce to distribute th...
TITLE: How can you publish a ClickOnce application through CruiseControl.NET? QUESTION: I have CruiseControl.NET Version 1.4 set up on my development server. Whenever a developer checks in code, it makes a compile. Now we're at a place where we can start giving our application to the testers. We'd like to use ClickOnc...
[ "msbuild", "clickonce", "cruisecontrol.net", "publish" ]
24
12
13,086
5
0
2008-08-15T17:08:19.583000
2009-01-20T18:37:54.870000
12,492
12,534
Pretty printing XML files on Emacs
I use emacs to edit my xml files (nxml-mode) and the files were generated by machine don't have any pretty formatting of the tags. I have searched for pretty printing the entire file with indentation and saving it, but wasn't able to find an automatic way. Is there a way? Or atleast some editor on linux which can do it...
I use nXML mode for editing and Tidy when I want to format and indent XML or HTML. There is also an Emacs interface to Tidy.
Pretty printing XML files on Emacs I use emacs to edit my xml files (nxml-mode) and the files were generated by machine don't have any pretty formatting of the tags. I have searched for pretty printing the entire file with indentation and saving it, but wasn't able to find an automatic way. Is there a way? Or atleast s...
TITLE: Pretty printing XML files on Emacs QUESTION: I use emacs to edit my xml files (nxml-mode) and the files were generated by machine don't have any pretty formatting of the tags. I have searched for pretty printing the entire file with indentation and saving it, but wasn't able to find an automatic way. Is there a...
[ "xml", "emacs", "editor" ]
90
25
45,470
15
0
2008-08-15T17:17:14.823000
2008-08-15T17:47:29.893000
12,509
12,586
Why Are People Still Creating RSS Feeds?
...instead of using the Atom syndication format? Atom is a well-defined, general-purpose XML syndication format. RSS is fractured into four different versions. All the major feed readers have supported Atom for as long as I can remember, so why isn't its use more prevalent? Worst of all are sites that provide feeds in ...
The fundamental thing that the Atom creators didn't understand (and that the Atom supporters still don't understand), is that Atom isn't somehow separate from RSS. There's this idea that RSS fractured, and that somehow Atom fixes that problem. But it doesn't. Atom is just another RSS splinter. A new name doesn't change...
Why Are People Still Creating RSS Feeds? ...instead of using the Atom syndication format? Atom is a well-defined, general-purpose XML syndication format. RSS is fractured into four different versions. All the major feed readers have supported Atom for as long as I can remember, so why isn't its use more prevalent? Wors...
TITLE: Why Are People Still Creating RSS Feeds? QUESTION: ...instead of using the Atom syndication format? Atom is a well-defined, general-purpose XML syndication format. RSS is fractured into four different versions. All the major feed readers have supported Atom for as long as I can remember, so why isn't its use mo...
[ "xml", "rss", "atom-feed" ]
40
111
6,083
12
0
2008-08-15T17:27:52.213000
2008-08-15T18:36:55.007000
12,516
12,861
Expression Evaluation and Tree Walking using polymorphism? (ala Steve Yegge)
This morning, I was reading Steve Yegge's: When Polymorphism Fails, when I came across a question that a co-worker of his used to ask potential employees when they came for their interview at Amazon. As an example of polymorphism in action, let's look at the classic "eval" interview question, which (as far as I know) w...
Polymorphic Tree Walking, Python version #!/usr/bin/python class Node: """base class, you should not process one of these""" def process(self): raise('you should not be processing a node') class BinaryNode(Node): """base class for binary nodes""" def __init__(self, _left, _right): self.left = _left self.right = _righ...
Expression Evaluation and Tree Walking using polymorphism? (ala Steve Yegge) This morning, I was reading Steve Yegge's: When Polymorphism Fails, when I came across a question that a co-worker of his used to ask potential employees when they came for their interview at Amazon. As an example of polymorphism in action, le...
TITLE: Expression Evaluation and Tree Walking using polymorphism? (ala Steve Yegge) QUESTION: This morning, I was reading Steve Yegge's: When Polymorphism Fails, when I came across a question that a co-worker of his used to ask potential employees when they came for their interview at Amazon. As an example of polymorp...
[ "oop", "recursion", "polymorphism", "binary-tree" ]
28
13
7,479
16
0
2008-08-15T17:31:39.427000
2008-08-15T22:56:41.813000
12,523
12,540
Tools for automating mouse and keyboard events sent to a windows application
What tools are useful for automating clicking through a windows form application? Is this even useful? I see the testers at my company doing this a great deal and it seems like a waste of time.
Check out https://github.com/TestStack/White and http://nunitforms.sourceforge.net/. We've used the White project with success.
Tools for automating mouse and keyboard events sent to a windows application What tools are useful for automating clicking through a windows form application? Is this even useful? I see the testers at my company doing this a great deal and it seems like a waste of time.
TITLE: Tools for automating mouse and keyboard events sent to a windows application QUESTION: What tools are useful for automating clicking through a windows form application? Is this even useful? I see the testers at my company doing this a great deal and it seems like a waste of time. ANSWER: Check out https://gith...
[ "testing", "automation" ]
10
7
14,538
5
0
2008-08-15T17:37:06.280000
2008-08-15T17:50:31.730000
12,556
16,222
What is your experience using the TIBCO General Interface?
It looks interesting and I've played around with it some --- but the development IDE in a web browser seems to be nightmare eventually. Does anyone have experience using it and what are your thoughts?
We evaluated GI a few months ago for a project but didn't end up selecting it. The IDE-in-a-browser (which is itself build with GI) actually works surprisingly well, though there are some features you normally expect from an editor that it lacks, most notably (and irritatingly) an Undo command. It's also impossible to ...
What is your experience using the TIBCO General Interface? It looks interesting and I've played around with it some --- but the development IDE in a web browser seems to be nightmare eventually. Does anyone have experience using it and what are your thoughts?
TITLE: What is your experience using the TIBCO General Interface? QUESTION: It looks interesting and I've played around with it some --- but the development IDE in a web browser seems to be nightmare eventually. Does anyone have experience using it and what are your thoughts? ANSWER: We evaluated GI a few months ago ...
[ "cross-browser", "tibco" ]
8
11
3,066
5
0
2008-08-15T18:00:04.020000
2008-08-19T14:06:46.810000
12,565
13,935
What do the different brackets in Ruby mean?
In Ruby, what's the difference between {} and []? {} seems to be used for both code blocks and hashes. Are [] only for arrays? The documention isn't very clear.
It depends on the context: When on their own, or assigning to a variable, [] creates arrays, and {} creates hashes. e.g. a = [1,2,3] # an array b = {1 => 2} # a hash [] can be overridden as a custom method, and is generally used to fetch things from hashes (the standard library sets up [] as a method on hashes which is...
What do the different brackets in Ruby mean? In Ruby, what's the difference between {} and []? {} seems to be used for both code blocks and hashes. Are [] only for arrays? The documention isn't very clear.
TITLE: What do the different brackets in Ruby mean? QUESTION: In Ruby, what's the difference between {} and []? {} seems to be used for both code blocks and hashes. Are [] only for arrays? The documention isn't very clear. ANSWER: It depends on the context: When on their own, or assigning to a variable, [] creates ar...
[ "ruby", "syntax" ]
88
76
54,725
6
0
2008-08-15T18:09:52.267000
2008-08-17T21:17:44.680000
12,569
12,571
Rigor in capturing test cases for unit testing
Let's say we have a simple function defined in a pseudo language. List SortNumbers(List unsorted, bool ascending); We pass in an unsorted list of numbers and a boolean specifying ascending or descending sort order. In return, we get a sorted list of numbers. In my experience, some people are better at capturing boundar...
Don't waste too much time trying to think of every boundry condition. Your tests won't be able to catch every bug first time around. The idea is to have tests that are pretty good, and then each time a bug does surface, write a new test specifically for that bug so that you never hear from it again. Another note I want...
Rigor in capturing test cases for unit testing Let's say we have a simple function defined in a pseudo language. List SortNumbers(List unsorted, bool ascending); We pass in an unsorted list of numbers and a boolean specifying ascending or descending sort order. In return, we get a sorted list of numbers. In my experien...
TITLE: Rigor in capturing test cases for unit testing QUESTION: Let's say we have a simple function defined in a pseudo language. List SortNumbers(List unsorted, bool ascending); We pass in an unsorted list of numbers and a boolean specifying ascending or descending sort order. In return, we get a sorted list of numbe...
[ "unit-testing", "testing", "sorting" ]
6
10
1,217
5
0
2008-08-15T18:14:28.327000
2008-08-15T18:17:17.387000
12,578
47,130
No trace info during processing of a cube in SSAS
When I process a cube in Visual Studio 2005 I get following message: Process succeeded. Trace information is still being transferred. If you do not want to wait for all of the information to arrive press Stop. and no trace info is displayed. Cube is processed OK by it is a little bit annoying. Any ideas? I access cubes...
I get the same message when I process a cube, but if I wait for a few seconds the trace information arrives. Are you dealing with a very large quantity of data or a very complex cube? Maybe this is a silly question, but have you tried waiting a few minutes?
No trace info during processing of a cube in SSAS When I process a cube in Visual Studio 2005 I get following message: Process succeeded. Trace information is still being transferred. If you do not want to wait for all of the information to arrive press Stop. and no trace info is displayed. Cube is processed OK by it i...
TITLE: No trace info during processing of a cube in SSAS QUESTION: When I process a cube in Visual Studio 2005 I get following message: Process succeeded. Trace information is still being transferred. If you do not want to wait for all of the information to arrive press Stop. and no trace info is displayed. Cube is pr...
[ "sql-server", "visual-studio-2005", "ssas", "trace", "olap" ]
5
1
3,132
3
0
2008-08-15T18:28:45.350000
2008-09-06T00:23:15.010000
12,592
12,609
Can you check that an exception is thrown with doctest in Python?
Is it possible to write a doctest unit test that will check that an exception is raised? For example, if I have a function foo(x) that is supposed to raise an exception if x < 0, how would I write the doctest for that?
Yes. You can do it. The doctest module documentation and Wikipedia has an example of it. >>> x Traceback (most recent call last):... NameError: name 'x' is not defined
Can you check that an exception is thrown with doctest in Python? Is it possible to write a doctest unit test that will check that an exception is raised? For example, if I have a function foo(x) that is supposed to raise an exception if x < 0, how would I write the doctest for that?
TITLE: Can you check that an exception is thrown with doctest in Python? QUESTION: Is it possible to write a doctest unit test that will check that an exception is raised? For example, if I have a function foo(x) that is supposed to raise an exception if x < 0, how would I write the doctest for that? ANSWER: Yes. You...
[ "python", "doctest" ]
88
117
21,181
3
0
2008-08-15T18:43:17.177000
2008-08-15T19:04:13.093000
12,593
12,596
Does System.Xml use MSXML?
I'm developing a C# application that uses a handful of XML files and some classes in System.Xml. A coworker insists on adding the MSXML6 redistributable to our install, along with the.NET framework but I don't think the.NET framework uses or needs MSXML in anyway. I am well aware that using MSXML from.NET is not suppor...
System.Xml doesn't use MSXML6. They are seperate xml processing engines. See post here: MSXML 6.0 vs. System.Xml: Schema handling differences
Does System.Xml use MSXML? I'm developing a C# application that uses a handful of XML files and some classes in System.Xml. A coworker insists on adding the MSXML6 redistributable to our install, along with the.NET framework but I don't think the.NET framework uses or needs MSXML in anyway. I am well aware that using M...
TITLE: Does System.Xml use MSXML? QUESTION: I'm developing a C# application that uses a handful of XML files and some classes in System.Xml. A coworker insists on adding the MSXML6 redistributable to our install, along with the.NET framework but I don't think the.NET framework uses or needs MSXML in anyway. I am well ...
[ ".net", "xml", "msxml" ]
11
14
3,627
5
0
2008-08-15T18:45:07.003000
2008-08-15T18:47:01.617000
12,594
12,599
Windows/C++: How do I determine the share name associated with a shared drive?
Let's say I have a drive such as C:\, and I want to find out if it's shared and what it's share name (e.g. C$ ) is. To find out if it's shared, I can use NetShareCheck. How do I then map the drive to its share name? I thought that NetShareGetInfo would do it, but it looks like that takes the share name, not the local d...
If all else fails, you could always use NetShareEnum and call NetShareGetInfo on each.
Windows/C++: How do I determine the share name associated with a shared drive? Let's say I have a drive such as C:\, and I want to find out if it's shared and what it's share name (e.g. C$ ) is. To find out if it's shared, I can use NetShareCheck. How do I then map the drive to its share name? I thought that NetShareGe...
TITLE: Windows/C++: How do I determine the share name associated with a shared drive? QUESTION: Let's say I have a drive such as C:\, and I want to find out if it's shared and what it's share name (e.g. C$ ) is. To find out if it's shared, I can use NetShareCheck. How do I then map the drive to its share name? I thoug...
[ "c++", "windows", "networking", "share" ]
1
3
1,712
3
0
2008-08-15T18:45:36.190000
2008-08-15T18:55:15.297000
12,603
12,606
Why was the Profile provider not built into Web Apps?
If you create an ASP.NET web file project you have direct access to the Profile information in the web.config file. If you convert that to a Web App and have been using ProfileCommon etc. then you have to jump through a whole bunch of hoops to get your web app to work. Why wasn't the Profile provider built into the ASP...
The profile provider uses the ASP.NET Build Provider system, which doesn't work with Web Application Projects. Adding a customized BuildProvider class to the Web.config file works in an ASP.NET Web site but does not work in an ASP.NET Web application project. In a Web application project, the code that is generated by ...
Why was the Profile provider not built into Web Apps? If you create an ASP.NET web file project you have direct access to the Profile information in the web.config file. If you convert that to a Web App and have been using ProfileCommon etc. then you have to jump through a whole bunch of hoops to get your web app to wo...
TITLE: Why was the Profile provider not built into Web Apps? QUESTION: If you create an ASP.NET web file project you have direct access to the Profile information in the web.config file. If you convert that to a Web App and have been using ProfileCommon etc. then you have to jump through a whole bunch of hoops to get ...
[ "asp.net" ]
2
3
1,016
2
0
2008-08-15T18:58:54.430000
2008-08-15T19:02:40.430000
12,612
12,707
Access Control Lists & Access Control Objects, good tutorial?
we're developing a web app to cover all aspects of a printing company from finances, to payroll, to job costing. Its important to be able to control who can access what parts of these applications. Don't want a line employee giving himself a raise, etc... I've heard of the concept of ACL & ACO, but haven't found a good...
A brief rundown on ACLs, where they should be used and how they should be structured and implemented for various applications and user levels can be found here: LINK
Access Control Lists & Access Control Objects, good tutorial? we're developing a web app to cover all aspects of a printing company from finances, to payroll, to job costing. Its important to be able to control who can access what parts of these applications. Don't want a line employee giving himself a raise, etc... I'...
TITLE: Access Control Lists & Access Control Objects, good tutorial? QUESTION: we're developing a web app to cover all aspects of a printing company from finances, to payroll, to job costing. Its important to be able to control who can access what parts of these applications. Don't want a line employee giving himself ...
[ "permissions", "acl" ]
2
2
850
3
0
2008-08-15T19:11:31.800000
2008-08-15T20:31:23.557000
12,633
12,677
What is the easiest way to parse an INI File in C++?
I'm trying to parse an INI file using C++. Any tips on what is the best way to achieve this? Should I use the Windows API tools for INI file processing (with which I am totally unfamiliar), an open-source solution or attempt to parse it manually?
You can use the Windows API functions, such as GetPrivateProfileString() and GetPrivateProfileInt().
What is the easiest way to parse an INI File in C++? I'm trying to parse an INI file using C++. Any tips on what is the best way to achieve this? Should I use the Windows API tools for INI file processing (with which I am totally unfamiliar), an open-source solution or attempt to parse it manually?
TITLE: What is the easiest way to parse an INI File in C++? QUESTION: I'm trying to parse an INI file using C++. Any tips on what is the best way to achieve this? Should I use the Windows API tools for INI file processing (with which I am totally unfamiliar), an open-source solution or attempt to parse it manually? A...
[ "c++", "winapi", "ini", "fileparse" ]
93
120
158,036
13
0
2008-08-15T19:31:01.747000
2008-08-15T20:06:53.140000
12,642
12,691
Upload binary data with Silverlight 2b2
I am trying to upload a file or stream of data to our web server and I cant find a decent way of doing this. I have tried both WebClient and WebRequest both have their problems. WebClient Nice and easy but you do not get any notification that the asynchronous upload has completed, and the UploadProgressChanged event do...
The way i get around it is through INotifyPropertyChanged and event notification. The essentials: public void DoIt(){ this.IsUploading = True; WebRequest postRequest = WebRequest.Create(new Uri(ServiceURL)); postRequest.BeginGetRequestStream(new AsyncCallback(RequestOpened), postRequest); } private void RequestOpene...
Upload binary data with Silverlight 2b2 I am trying to upload a file or stream of data to our web server and I cant find a decent way of doing this. I have tried both WebClient and WebRequest both have their problems. WebClient Nice and easy but you do not get any notification that the asynchronous upload has completed...
TITLE: Upload binary data with Silverlight 2b2 QUESTION: I am trying to upload a file or stream of data to our web server and I cant find a decent way of doing this. I have tried both WebClient and WebRequest both have their problems. WebClient Nice and easy but you do not get any notification that the asynchronous up...
[ ".net", "silverlight" ]
4
1
1,748
4
0
2008-08-15T19:37:57.863000
2008-08-15T20:17:44.257000
12,647
28,589
How do I tell if a variable has a numeric value in Perl?
Is there a simple way in Perl that will allow me to determine if a given variable is numeric? Something along the lines of: if (is_number($x)) {... } would be ideal. A technique that won't throw warnings when the -w switch is being used is certainly preferred.
Use Scalar::Util::looks_like_number() which uses the internal Perl C API's looks_like_number() function, which is probably the most efficient way to do this. Note that the strings "inf" and "infinity" are treated as numbers. Example: #!/usr/bin/perl use warnings; use strict; use Scalar::Util qw(looks_like_number); m...
How do I tell if a variable has a numeric value in Perl? Is there a simple way in Perl that will allow me to determine if a given variable is numeric? Something along the lines of: if (is_number($x)) {... } would be ideal. A technique that won't throw warnings when the -w switch is being used is certainly preferred.
TITLE: How do I tell if a variable has a numeric value in Perl? QUESTION: Is there a simple way in Perl that will allow me to determine if a given variable is numeric? Something along the lines of: if (is_number($x)) {... } would be ideal. A technique that won't throw warnings when the -w switch is being used is certa...
[ "perl", "numbers" ]
102
151
163,968
15
0
2008-08-15T19:43:15.293000
2008-08-26T16:53:34.377000
12,656
13,092
Variable parameter/result binding with prepared statements
In a project that I'm about to wrap up, I've written and implemented an object-relational mapping solution for PHP. Before the doubters and dreamers cry out "how on earth?", relax -- I haven't found a way to make late static binding work -- I'm just working around it in the best way that I possibly can. Anyway, I'm not...
In PHP you can pass a variable number of arguments to a function or method by using call_user_func_array. An example for a method would be: call_user_func_array(array(&$stmt, 'bindparams'), $array_of_params); The function will be called with each member in the array passed as its own argument.
Variable parameter/result binding with prepared statements In a project that I'm about to wrap up, I've written and implemented an object-relational mapping solution for PHP. Before the doubters and dreamers cry out "how on earth?", relax -- I haven't found a way to make late static binding work -- I'm just working aro...
TITLE: Variable parameter/result binding with prepared statements QUESTION: In a project that I'm about to wrap up, I've written and implemented an object-relational mapping solution for PHP. Before the doubters and dreamers cry out "how on earth?", relax -- I haven't found a way to make late static binding work -- I'...
[ "php", "mysql", "mysqli" ]
9
12
5,989
5
0
2008-08-15T19:50:52.517000
2008-08-16T10:58:05.587000
12,657
12,735
Can I create a ListView with dynamic GroupItemCount?
I'm using the new ASP.Net ListView control to list database items that will be grouped together in sections based on one of their columns like so: region1 store1 store2 store3 region2 store4 region3 store5 store6 Is this possible to do with the ListView's GroupItemTemplate? Every example I have seen uses a static numbe...
I haven't used GroupItemCount, but I have taken this example written up by Matt Berseth titled Building a Grouping Grid with the ASP.NET 3.5 LinqDataSource and ListView Controls and have grouped items by a key just like you want. It involves using an outer and inner ListView control. Works great, give it a try.
Can I create a ListView with dynamic GroupItemCount? I'm using the new ASP.Net ListView control to list database items that will be grouped together in sections based on one of their columns like so: region1 store1 store2 store3 region2 store4 region3 store5 store6 Is this possible to do with the ListView's GroupItemTe...
TITLE: Can I create a ListView with dynamic GroupItemCount? QUESTION: I'm using the new ASP.Net ListView control to list database items that will be grouped together in sections based on one of their columns like so: region1 store1 store2 store3 region2 store4 region3 store5 store6 Is this possible to do with the List...
[ "asp.net", ".net-3.5", "listview" ]
2
2
4,233
3
0
2008-08-15T19:51:05.417000
2008-08-15T20:56:08.033000
12,661
12,822
Efficient JPEG Image Resizing in PHP
What's the most efficient way to resize large images in PHP? I'm currently using the GD function imagecopyresampled to take high resolution images, and cleanly resize them down to a size for web viewing (roughly 700 pixels wide by 700 pixels tall). This works great on small (under 2 MB) photos and the entire resize ope...
People say that ImageMagick is much faster. At best just compare both libraries and measure that. Prepare 1000 typical images. Write two scripts -- one for GD, one for ImageMagick. Run both of them a few times. Compare results (total execution time, CPU and I/O usage, result image quality). Something which the best eve...
Efficient JPEG Image Resizing in PHP What's the most efficient way to resize large images in PHP? I'm currently using the GD function imagecopyresampled to take high resolution images, and cleanly resize them down to a size for web viewing (roughly 700 pixels wide by 700 pixels tall). This works great on small (under 2...
TITLE: Efficient JPEG Image Resizing in PHP QUESTION: What's the most efficient way to resize large images in PHP? I'm currently using the GD function imagecopyresampled to take high resolution images, and cleanly resize them down to a size for web viewing (roughly 700 pixels wide by 700 pixels tall). This works great...
[ "php", "image", "gd", "jpeg" ]
84
48
90,080
9
0
2008-08-15T19:55:17
2008-08-15T22:08:38.993000
12,669
12,693
Resources for getting started with web development?
Let's say I woke up today and wanted to create a clone of StackOverflow.com, and reap the financial windfall of millions $0.02 ad clicks. Where do I start? My understanding of web technologies are: HTML is what is ultimately displayed CSS is a mechanism for making HTML look pleasing ASP.NET lets you add functionality u...
I think that this series of Opera Articles will give you a good idea of web standards and basic concepts of web development. 2014 update: the Opera docs were relocated in 2012 to this section of webplatform.org: http://docs.webplatform.org/wiki/Main_Page
Resources for getting started with web development? Let's say I woke up today and wanted to create a clone of StackOverflow.com, and reap the financial windfall of millions $0.02 ad clicks. Where do I start? My understanding of web technologies are: HTML is what is ultimately displayed CSS is a mechanism for making HTM...
TITLE: Resources for getting started with web development? QUESTION: Let's say I woke up today and wanted to create a clone of StackOverflow.com, and reap the financial windfall of millions $0.02 ad clicks. Where do I start? My understanding of web technologies are: HTML is what is ultimately displayed CSS is a mechan...
[ "language-agnostic" ]
14
9
8,107
10
0
2008-08-15T20:00:28.660000
2008-08-15T20:18:46.860000
12,671
12,700
How can I pass data from an aspx page to an ascx modal popup?
I'm fairly new to ASP.NET and trying to learn how things are done. I come from a C# background so the code-behind portion is easy, but thinking like a web developer is unfamiliar. I have an aspx page that contains a grid of checkboxes. I have a button that is coded via a Button_Click event to collect a list of which ro...
All a usercontrol(.ascx) file is is a set of controls that you have grouped together to provide some reusable functionality. The controls defined in it are still added to the page's control collection (.aspx) durring the page lifecylce. The ModalPopupExtender uses javascript and dhtml to show and hide the controls in t...
How can I pass data from an aspx page to an ascx modal popup? I'm fairly new to ASP.NET and trying to learn how things are done. I come from a C# background so the code-behind portion is easy, but thinking like a web developer is unfamiliar. I have an aspx page that contains a grid of checkboxes. I have a button that i...
TITLE: How can I pass data from an aspx page to an ascx modal popup? QUESTION: I'm fairly new to ASP.NET and trying to learn how things are done. I come from a C# background so the code-behind portion is easy, but thinking like a web developer is unfamiliar. I have an aspx page that contains a grid of checkboxes. I ha...
[ "c#", "asp.net", "asp.net-ajax" ]
6
3
6,897
3
0
2008-08-15T20:01:23.010000
2008-08-15T20:25:28.017000
12,692
12,713
IronPython and ASP.NET
Has anyone built a website with IronPython and ASP.NET. What were your experiences and is the combination ready for prime-time?
The current version of ASP.NET integration for IronPython is not very up-to-date and is more of a "proof-of-concept." I don't think I'd build a production website based on it. Edit:: I have a very high level of expectation for how things like this should work, and might setting the bar a little high. Maybe you should t...
IronPython and ASP.NET Has anyone built a website with IronPython and ASP.NET. What were your experiences and is the combination ready for prime-time?
TITLE: IronPython and ASP.NET QUESTION: Has anyone built a website with IronPython and ASP.NET. What were your experiences and is the combination ready for prime-time? ANSWER: The current version of ASP.NET integration for IronPython is not very up-to-date and is more of a "proof-of-concept." I don't think I'd build ...
[ "asp.net", "ironpython" ]
7
7
755
3
0
2008-08-15T20:17:49.450000
2008-08-15T20:37:24.920000
12,702
42,332
Returning DataTables in WCF/.NET
I have a WCF service from which I want to return a DataTable. I know that this is often a highly-debated topic, as far as whether or not returning DataTables is a good practice. Let's put that aside for a moment. When I create a DataTable from scratch, as below, there are no problems whatsoever. The table is created, p...
For anyone having similar problems, I have solved my issue. It was several-fold. As Darren suggested and Paul backed up, the Max..Size properties in the configuration needed to be enlarged. The SvcTraceViewer utility helped in determining this, but it still does not always give the most helpful error messages. It also ...
Returning DataTables in WCF/.NET I have a WCF service from which I want to return a DataTable. I know that this is often a highly-debated topic, as far as whether or not returning DataTables is a good practice. Let's put that aside for a moment. When I create a DataTable from scratch, as below, there are no problems wh...
TITLE: Returning DataTables in WCF/.NET QUESTION: I have a WCF service from which I want to return a DataTable. I know that this is often a highly-debated topic, as far as whether or not returning DataTables is a good practice. Let's put that aside for a moment. When I create a DataTable from scratch, as below, there ...
[ "c#", ".net", "wcf", "web-services", "datatable" ]
51
85
57,442
8
0
2008-08-15T20:26:01.447000
2008-09-03T19:14:32.540000
12,706
12,719
Best way to custom edit records in ASP.NET?
I'm coming from a Rails background and doing some work on a ASP.NET project (not ASP MVC). Newbie question: what's the easiest way to make a custom editor for a table of records? For example: I have a bunch of data rows and want to change the "category" field on each -- maybe a dropdown, maybe a link, maybe the user ty...
You can REALLY cheat nowadays and take a peek at the new Dynamic Data that comes with.NET 3.5 SP1. Scott Guthrie has a blog entry demoing on how quick and easy it'll flow for you here: http://weblogs.asp.net/scottgu/archive/2007/12/14/new-asp-net-dynamic-data-support.aspx Without getting THAT cutting edge, I'd use the ...
Best way to custom edit records in ASP.NET? I'm coming from a Rails background and doing some work on a ASP.NET project (not ASP MVC). Newbie question: what's the easiest way to make a custom editor for a table of records? For example: I have a bunch of data rows and want to change the "category" field on each -- maybe...
TITLE: Best way to custom edit records in ASP.NET? QUESTION: I'm coming from a Rails background and doing some work on a ASP.NET project (not ASP MVC). Newbie question: what's the easiest way to make a custom editor for a table of records? For example: I have a bunch of data rows and want to change the "category" fiel...
[ "asp.net" ]
2
2
1,805
3
0
2008-08-15T20:30:37.663000
2008-08-15T20:42:30.230000
12,709
16,269
Load an XmlNodeList into an XmlDocument without looping?
I originally asked this question on RefactorMyCode, but got no responses there... Basically I'm just try to load an XmlNodeList into an XmlDocument and I was wondering if there's a more efficient method than looping. Private Function GetPreviousMonthsXml(ByVal months As Integer, ByVal startDate As Date, ByVal xDoc As X...
Dim returnXDoc As New XmlDocument(xDoc.NameTable) returnXDoc = xDoc.Clone() The first line here is redundant - you are creating an instance of an XmlDocument, then reassigning the variable: Dim returnXDoc As XmlDocument = xDoc.Clone() This does the same. Seeing as you appear to be inserting each XmlNode from your node ...
Load an XmlNodeList into an XmlDocument without looping? I originally asked this question on RefactorMyCode, but got no responses there... Basically I'm just try to load an XmlNodeList into an XmlDocument and I was wondering if there's a more efficient method than looping. Private Function GetPreviousMonthsXml(ByVal mo...
TITLE: Load an XmlNodeList into an XmlDocument without looping? QUESTION: I originally asked this question on RefactorMyCode, but got no responses there... Basically I'm just try to load an XmlNodeList into an XmlDocument and I was wondering if there's a more efficient method than looping. Private Function GetPrevious...
[ "xml", "vb.net", "xmldocument", "xmlnode", "xmlnodelist" ]
4
2
11,543
1
0
2008-08-15T20:33:33.833000
2008-08-19T14:28:49.483000
12,716
12,751
Problems with #import of .NET out-of-proc server
In C++ program, I am trying to #import TLB of.NET out-of-proc server. I get errors like: z:\server.tlh(111): error C2146: syntax error: missing ';' before identifier 'GetType' z:\server.tlh(111): error C2501: '_TypePtr': missing storage-class or type specifiers z:\server.tli(74): error C2143: syntax error: missing ';' ...
Added no_namespace and raw_interfaces_only to my #import: #import "server.tlb" no_namespace named_guids Also using TLBEXP.EXE instead of REGASM.EXE seems to help this issue.
Problems with #import of .NET out-of-proc server In C++ program, I am trying to #import TLB of.NET out-of-proc server. I get errors like: z:\server.tlh(111): error C2146: syntax error: missing ';' before identifier 'GetType' z:\server.tlh(111): error C2501: '_TypePtr': missing storage-class or type specifiers z:\server...
TITLE: Problems with #import of .NET out-of-proc server QUESTION: In C++ program, I am trying to #import TLB of.NET out-of-proc server. I get errors like: z:\server.tlh(111): error C2146: syntax error: missing ';' before identifier 'GetType' z:\server.tlh(111): error C2501: '_TypePtr': missing storage-class or type sp...
[ "c#", "c++", "com", "interop" ]
4
1
4,685
5
0
2008-08-15T20:40:11.980000
2008-08-15T21:06:51.660000
12,718
12,744
Setting up Subversion on Windows as a service
When installing subversion as a service, I used this command: c:\>svnservice -install --daemon --root "c:\documents and settings\my_repository" And then I got this error: Could not create service in service control manager. After looking at some MSDN docs on the service control manager, I tried granting full control to...
VisualSVN Server installs as a Windows service. It is free, includes Apache, OpenSSL, and a repository / permission management tool. It can also integrate with Active Directory for user authentication. I highly recommend it for hosting SVN on Windows.
Setting up Subversion on Windows as a service When installing subversion as a service, I used this command: c:\>svnservice -install --daemon --root "c:\documents and settings\my_repository" And then I got this error: Could not create service in service control manager. After looking at some MSDN docs on the service con...
TITLE: Setting up Subversion on Windows as a service QUESTION: When installing subversion as a service, I used this command: c:\>svnservice -install --daemon --root "c:\documents and settings\my_repository" And then I got this error: Could not create service in service control manager. After looking at some MSDN docs ...
[ "svn", "version-control" ]
1
6
3,774
7
0
2008-08-15T20:41:54.940000
2008-08-15T21:04:08.827000
12,720
12,728
Add .NET 2.0 SP1 as a prerequisite for deployment project
I have a.NET 2.0 application that has recently had contributions that are Service Pack 1 dependent. The deployment project has detected.NET 2.0 as a prerequisite, but NOT SP1. How do I include SP1 as a dependency/prerequisite in my deployment project?
You'll want to setup launch condition in your deployment project to make sure version 2.0 SP1 is installed. You'll want to set a requirement based off the MsiNetAssemblySupport variable, tied to the version number of.NET 2.0 SP1 (2.0.50727.1433 and above according to this page.) Bootstrapping the project to actually do...
Add .NET 2.0 SP1 as a prerequisite for deployment project I have a.NET 2.0 application that has recently had contributions that are Service Pack 1 dependent. The deployment project has detected.NET 2.0 as a prerequisite, but NOT SP1. How do I include SP1 as a dependency/prerequisite in my deployment project?
TITLE: Add .NET 2.0 SP1 as a prerequisite for deployment project QUESTION: I have a.NET 2.0 application that has recently had contributions that are Service Pack 1 dependent. The deployment project has detected.NET 2.0 as a prerequisite, but NOT SP1. How do I include SP1 as a dependency/prerequisite in my deployment p...
[ ".net-2.0", "installation", "dependencies" ]
2
3
938
1
0
2008-08-15T20:42:51.523000
2008-08-15T20:51:14.580000
12,765
12,769
Strange characters in PHP
This is driving me crazy. I have this one php file on a test server at work which does not work.. I kept deleting stuff from it till it became it outputs Hello if I create a new file and copy / paste the same script to it it works! Why does this one file give me the strange characters all the time?
That's the BOM (Byte Order Mark) you are seeing. In your editor, there should be a way to force saving without BOM which will remove the problem.
Strange characters in PHP This is driving me crazy. I have this one php file on a test server at work which does not work.. I kept deleting stuff from it till it became it outputs Hello if I create a new file and copy / paste the same script to it it works! Why does this one file give me the strange characters all t...
TITLE: Strange characters in PHP QUESTION: This is driving me crazy. I have this one php file on a test server at work which does not work.. I kept deleting stuff from it till it became it outputs Hello if I create a new file and copy / paste the same script to it it works! Why does this one file give me the strang...
[ "php", "encoding" ]
10
16
1,839
3
0
2008-08-15T21:18:30.843000
2008-08-15T21:20:49.870000
12,768
12,789
How is the HTML on this site so clean?
I work with C# at work but dislike how with webforms it spews out a lot of JavaScript not including the many lines for viewstate that it creates. That's why I like coding with PHP as I have full control. But I was just wondering how this sites HTML is so clean and elegant? Does using MVC have something to do with it? I...
One of the goals of ASP.NET MVC is to give you control of your markup. However, there have always been choices with ASP.NET which would allow you to generate relatively clean HTML. For instance, ASP.NET has always offered a choice with validator controls. Do you value development speed over markup? Use validators. Valu...
How is the HTML on this site so clean? I work with C# at work but dislike how with webforms it spews out a lot of JavaScript not including the many lines for viewstate that it creates. That's why I like coding with PHP as I have full control. But I was just wondering how this sites HTML is so clean and elegant? Does us...
TITLE: How is the HTML on this site so clean? QUESTION: I work with C# at work but dislike how with webforms it spews out a lot of JavaScript not including the many lines for viewstate that it creates. That's why I like coding with PHP as I have full control. But I was just wondering how this sites HTML is so clean an...
[ "html", "semantic-markup" ]
10
9
1,011
4
0
2008-08-15T21:19:48.437000
2008-08-15T21:30:36.043000
12,774
12,778
Attaching VisualSVN Server to an existing repository
All the recent VisualSVN Server posts made me want to check it out. I have SVN running right now through Apache, but I'd like to try out VisualSVN Server, mostly for the Active Directory integration. Their docs don't describe whether you can easily migrate an existing repository. Anyone done this before?
VisualSVN Server will use your existing SVN repositories with no problems. I have successfully migrated repositories from SVN + Apache to VisualSVN Server on multiple occasions.
Attaching VisualSVN Server to an existing repository All the recent VisualSVN Server posts made me want to check it out. I have SVN running right now through Apache, but I'd like to try out VisualSVN Server, mostly for the Active Directory integration. Their docs don't describe whether you can easily migrate an existin...
TITLE: Attaching VisualSVN Server to an existing repository QUESTION: All the recent VisualSVN Server posts made me want to check it out. I have SVN running right now through Apache, but I'd like to try out VisualSVN Server, mostly for the Active Directory integration. Their docs don't describe whether you can easily ...
[ "svn", "version-control", "visualsvn-server", "svn-repository" ]
3
4
3,825
4
0
2008-08-15T21:22:36.340000
2008-08-15T21:23:40.957000
12,794
12,983
How do I add a pre tag inside a code tag with jQuery?
I'm trying to use jQuery to format code blocks, specifically to add a tag inside the tag: $(document).ready(function() { $("code").wrapInner(" "); }); Firefox applies the formatting correctly, but IE puts the entire code block on one line. If I add an alert alert($("code").html()); I see that IE has inserted some addit...
That's the difference between block and inline elements. pre is a block level element. It's not legal to put it inside a code tag, which can only contain inline content. Because browsers have to support whatever godawful tag soup they might find on the real web, Firefox tries to do what you mean. IE happens to handle i...
How do I add a pre tag inside a code tag with jQuery? I'm trying to use jQuery to format code blocks, specifically to add a tag inside the tag: $(document).ready(function() { $("code").wrapInner(" "); }); Firefox applies the formatting correctly, but IE puts the entire code block on one line. If I add an alert alert($(...
TITLE: How do I add a pre tag inside a code tag with jQuery? QUESTION: I'm trying to use jQuery to format code blocks, specifically to add a tag inside the tag: $(document).ready(function() { $("code").wrapInner(" "); }); Firefox applies the formatting correctly, but IE puts the entire code block on one line. If I add...
[ "javascript", "jquery", "html", "internet-explorer" ]
13
11
7,946
5
0
2008-08-15T21:35:51.260000
2008-08-16T04:04:09.713000
12,807
14,604
How to register COM from VS Setup project?
I have marked my DLL as vsdraCOM, and I can see it in the registry after installing, but my application does not see the COM interface until I call RegAsm on it manually. Why could this be? The COM registration does not work on Vista (confirmed myself) and on XP (confirmed by a colleague). Using Visual Studio 2005 on X...
Well, I have found a solution: Run RegAsm.exe with the /regfile option to generate the registry entries. Manually import the.reg file into the VS Setup project by viewing the registry, right clicking, and choosing "Import..."
How to register COM from VS Setup project? I have marked my DLL as vsdraCOM, and I can see it in the registry after installing, but my application does not see the COM interface until I call RegAsm on it manually. Why could this be? The COM registration does not work on Vista (confirmed myself) and on XP (confirmed by ...
TITLE: How to register COM from VS Setup project? QUESTION: I have marked my DLL as vsdraCOM, and I can see it in the registry after installing, but my application does not see the COM interface until I call RegAsm on it manually. Why could this be? The COM registration does not work on Vista (confirmed myself) and on...
[ "com", "registry" ]
3
5
4,131
1
0
2008-08-15T21:51:29.480000
2008-08-18T13:37:12.923000
12,823
12,875
Filter by zip code, or other location based data retrieval strategies
My little site should be pooling list of items from a table using the active user's location as a filter. Think Craigslist, where you search for "dvd' but the results are not from all the DB, they are filtered by a location you select. My question has 2 levels: should I go a-la-craigslist, and ask users to use a city l...
Getting a Zip Code database is no problem. You can try this free one: http://zips.sourceforge.net/ Although I don't know how current it is, or you can use one of many providers. We have an annual subscription to ZipCodeDownload.com, and for maybe $100 we get monthly updates with the latest Zip Code data complete with L...
Filter by zip code, or other location based data retrieval strategies My little site should be pooling list of items from a table using the active user's location as a filter. Think Craigslist, where you search for "dvd' but the results are not from all the DB, they are filtered by a location you select. My question ha...
TITLE: Filter by zip code, or other location based data retrieval strategies QUESTION: My little site should be pooling list of items from a table using the active user's location as a filter. Think Craigslist, where you search for "dvd' but the results are not from all the DB, they are filtered by a location you sele...
[ "location", "zipcode" ]
4
5
4,665
5
0
2008-08-15T22:09:05.343000
2008-08-15T23:12:26.323000
12,836
12,935
C# Database Access: DBNull vs null
We have our own ORM we use here, and provide strongly typed wrappers for all of our db tables. We also allow weakly typed ad-hoc SQL to be executed, but these queries still go through the same class for getting values out of a data reader. In tweaking that class to work with Oracle, we've come across an interesting que...
I find it better to use null, instead of DB null. The reason is because, as you said, you're separating yourself from the DB world. It is generally good practice to check reference types to ensure they aren't null anyway. You're going to be checking for null for things other than DB data, and I find it is best to keep ...
C# Database Access: DBNull vs null We have our own ORM we use here, and provide strongly typed wrappers for all of our db tables. We also allow weakly typed ad-hoc SQL to be executed, but these queries still go through the same class for getting values out of a data reader. In tweaking that class to work with Oracle, w...
TITLE: C# Database Access: DBNull vs null QUESTION: We have our own ORM we use here, and provide strongly typed wrappers for all of our db tables. We also allow weakly typed ad-hoc SQL to be executed, but these queries still go through the same class for getting values out of a data reader. In tweaking that class to w...
[ "c#", "orm", "null", "dbnull" ]
13
15
15,243
4
0
2008-08-15T22:23:21.490000
2008-08-16T00:55:43.510000
12,843
20,591
How to combine two projects in Mercurial?
I have two separate mercurial repositories. At this point it makes sense that they "become one" because I want to work on the two projects simultaneously. I'd really like the two projects to each be a subdirectory in the new repository. How do I merge the two projects? Is this a good idea, or should I keep them separat...
I was able to combine my two repositories in this way: Use hg clone first_repository to clone one of the repositories. Use hg pull -f other_repository to pull the code in from the other repository. The -f (force) flag on the pull is the key -- it says to ignore the fact that the two repositories are not from the same s...
How to combine two projects in Mercurial? I have two separate mercurial repositories. At this point it makes sense that they "become one" because I want to work on the two projects simultaneously. I'd really like the two projects to each be a subdirectory in the new repository. How do I merge the two projects? Is this ...
TITLE: How to combine two projects in Mercurial? QUESTION: I have two separate mercurial repositories. At this point it makes sense that they "become one" because I want to work on the two projects simultaneously. I'd really like the two projects to each be a subdirectory in the new repository. How do I merge the two ...
[ "mercurial" ]
84
69
14,905
3
0
2008-08-15T22:29:44.770000
2008-08-21T17:23:08.013000
12,865
12,879
Mercurial stuck "waiting for lock"
Got a bluescreen in windows while cloning a mercurial repository. After reboot, I now get this message for almost all hg commands: c:\src\>hg commit waiting for lock on repository c:\src\McVrsServer held by '\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' interrupted! Google is no hel...
When "waiting for lock on repository", delete the repository file:.hg/wlock (or it may be in.hg/store/lock ) When deleting the lock file, you must make sure nothing else is accessing the repository. (If the lock is a string of zeros or blank, this is almost certainly true).
Mercurial stuck "waiting for lock" Got a bluescreen in windows while cloning a mercurial repository. After reboot, I now get this message for almost all hg commands: c:\src\>hg commit waiting for lock on repository c:\src\McVrsServer held by '\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...
TITLE: Mercurial stuck "waiting for lock" QUESTION: Got a bluescreen in windows while cloning a mercurial repository. After reboot, I now get this message for almost all hg commands: c:\src\>hg commit waiting for lock on repository c:\src\McVrsServer held by '\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x...
[ "mercurial" ]
361
509
118,965
11
0
2008-08-15T23:01:16.533000
2008-08-15T23:20:18.820000
12,870
12,878
Arrays of Arrays in Java
This is a nasty one for me... I'm a PHP guy working in Java on a JSP project. I know how to do what I'm attempting through too much code and a complete lack of finesse. I'd prefer to do it right. Here is the situation: I'm writing a small display to show customers what days they can water their lawns based on their wat...
You could do essentially the same code with Hashtables (or some other Map): Hashtable > schedule = new Hashtable >(); schedule.put("A", new Hashtable ()); schedule.put("B", new Hashtable ()); schedule.put("C", new Hashtable ()); schedule.put("D", new Hashtable ()); schedule.put("E", new Hashtable ()); schedule.get("A"...
Arrays of Arrays in Java This is a nasty one for me... I'm a PHP guy working in Java on a JSP project. I know how to do what I'm attempting through too much code and a complete lack of finesse. I'd prefer to do it right. Here is the situation: I'm writing a small display to show customers what days they can water their...
TITLE: Arrays of Arrays in Java QUESTION: This is a nasty one for me... I'm a PHP guy working in Java on a JSP project. I know how to do what I'm attempting through too much code and a complete lack of finesse. I'd prefer to do it right. Here is the situation: I'm writing a small display to show customers what days th...
[ "java", "php", "jsp", "tomcat" ]
17
11
1,449
12
0
2008-08-15T23:07:03.400000
2008-08-15T23:16:52.383000
12,877
12,959
Oracle SQL Developer not responsive when trying to view tables (or suggest an Oracle Mac client)
I just get the beach ball all day long (it's been doing nothing for hours). It's not taking CPU, not reading from disk, not using the network. I'm using Java 1.6 on Mac OS X 10.5.4. It worked once, now even restarts of the computer won't help. Activity Monitor says it's "(Not Responding)". Only thing that I can do is k...
I get the same problem after there's been an active connection sitting idle for a while. I solve it by restarting sql developer every once in a while. I also have Toad for Oracle running on a vmware XP session, and it works great. If you don't mind the money, try that.
Oracle SQL Developer not responsive when trying to view tables (or suggest an Oracle Mac client) I just get the beach ball all day long (it's been doing nothing for hours). It's not taking CPU, not reading from disk, not using the network. I'm using Java 1.6 on Mac OS X 10.5.4. It worked once, now even restarts of the ...
TITLE: Oracle SQL Developer not responsive when trying to view tables (or suggest an Oracle Mac client) QUESTION: I just get the beach ball all day long (it's been doing nothing for hours). It's not taking CPU, not reading from disk, not using the network. I'm using Java 1.6 on Mac OS X 10.5.4. It worked once, now eve...
[ "java", "oracle", "macos" ]
4
2
10,616
7
0
2008-08-15T23:15:27.470000
2008-08-16T02:10:30.613000
12,890
12,950
What is a good way to denormalize a mysql database?
I have a large database of normalized order data that is becoming very slow to query for reporting. Many of the queries that I use in reports join five or six tables and are having to examine tens or hundreds of thousands of lines. There are lots of queries and most have been optimized as much as possible to reduce ser...
I know more about mssql that mysql, but I don't think the number of joins or number of rows you are talking about should cause you too many problems with the correct indexes in place. Have you analyzed the query plan to see if you are missing any? http://dev.mysql.com/doc/refman/5.0/en/explain.html That being said, onc...
What is a good way to denormalize a mysql database? I have a large database of normalized order data that is becoming very slow to query for reporting. Many of the queries that I use in reports join five or six tables and are having to examine tens or hundreds of thousands of lines. There are lots of queries and most h...
TITLE: What is a good way to denormalize a mysql database? QUESTION: I have a large database of normalized order data that is becoming very slow to query for reporting. Many of the queries that I use in reports join five or six tables and are having to examine tens or hundreds of thousands of lines. There are lots of ...
[ "mysql", "database", "denormalization" ]
22
12
12,231
8
0
2008-08-15T23:36:30.207000
2008-08-16T01:36:31.040000
12,896
12,965
parsing raw email in php
I'm looking for good/working/simple to use PHP code for parsing raw email into parts. I've written a couple of brute force solutions, but every time, one small change/header/space/something comes along and my whole parser fails and the project falls apart. And before I get pointed at PEAR/PECL, I need actual code. My h...
What are you hoping to end up with at the end? The body, the subject, the sender, an attachment? You should spend some time with RFC2822 to understand the format of the mail, but here's the simplest rules for well formed email: HEADERS\n \n BODY That is, the first blank line (double newline) is the separator between th...
parsing raw email in php I'm looking for good/working/simple to use PHP code for parsing raw email into parts. I've written a couple of brute force solutions, but every time, one small change/header/space/something comes along and my whole parser fails and the project falls apart. And before I get pointed at PEAR/PECL,...
TITLE: parsing raw email in php QUESTION: I'm looking for good/working/simple to use PHP code for parsing raw email into parts. I've written a couple of brute force solutions, but every time, one small change/header/space/something comes along and my whole parser fails and the project falls apart. And before I get poi...
[ "php", "email" ]
35
24
61,692
15
0
2008-08-15T23:50:17.527000
2008-08-16T02:18:11.893000
12,905
31,828
Creating Infopath 2007 addins that manipulate the design-time form
I'm experimenting with creating an add-in for Infopath 2007. The documentation is very skimpy. What I'm trying to determine is what kind of actions an add-in can take while designing a form. Most of the discussion and samples are for when the user is filling out the form. Can I, for example, add a new field to the form...
There is no Object Model for the InfoPath designer. I believe the closest that you can get is the exposed API for the Visual Studio hosting that InfoPath supports; but I don't believe that this will give you the programatic control of the designer that you'd like. http://msdn.microsoft.com/en-us/library/aa813327.aspx#o...
Creating Infopath 2007 addins that manipulate the design-time form I'm experimenting with creating an add-in for Infopath 2007. The documentation is very skimpy. What I'm trying to determine is what kind of actions an add-in can take while designing a form. Most of the discussion and samples are for when the user is fi...
TITLE: Creating Infopath 2007 addins that manipulate the design-time form QUESTION: I'm experimenting with creating an add-in for Infopath 2007. The documentation is very skimpy. What I'm trying to determine is what kind of actions an add-in can take while designing a form. Most of the discussion and samples are for w...
[ "ms-office", "infopath" ]
2
0
609
2
0
2008-08-16T00:08:23.637000
2008-08-28T08:03:27.693000
12,906
12,915
Find out complete SQL Server database size
I need to know how much space occupies all the databases inside an SQL Server 2000. I did some research but could not found any script to help me out.
Source: http://searchsqlserver.techtarget.com/tip/0,289483,sid87_gci1313431,00.html Works with SQL2000,2005,2008 USE master; GO IF OBJECT_ID('dbo.sp_SDS', 'P') IS NOT NULL DROP PROCEDURE dbo.sp_SDS; GO CREATE PROCEDURE dbo.sp_SDS @TargetDatabase sysname = NULL, -- NULL: all dbs @Level varchar(10) = 'Database', -- or ...
Find out complete SQL Server database size I need to know how much space occupies all the databases inside an SQL Server 2000. I did some research but could not found any script to help me out.
TITLE: Find out complete SQL Server database size QUESTION: I need to know how much space occupies all the databases inside an SQL Server 2000. I did some research but could not found any script to help me out. ANSWER: Source: http://searchsqlserver.techtarget.com/tip/0,289483,sid87_gci1313431,00.html Works with SQL2...
[ "sql-server" ]
8
6
10,959
3
0
2008-08-16T00:10:24.443000
2008-08-16T00:19:14.863000
12,927
12,961
If you have a Java application that is consuming CPU when it isn't doing anything, how do you determine what it is doing?
I am calling a vendor's Java API, and on some servers it appears that the JVM goes into a low priority polling loop after logging into the API (CPU at 100% usage). The same app on other servers does not exhibit this behavior. This happens on WebSphere and Tomcat. The environment is tricky to set up so it is difficult t...
If you are using Java 5 or later, you can connect to your application using jconsole to view all running threads. jstack also will do a stack dump. I think this should still work even inside a container like Tomcat. Both of these tools are included with JDK5 and later (I assume the process needs to be at least Java 5, ...
If you have a Java application that is consuming CPU when it isn't doing anything, how do you determine what it is doing? I am calling a vendor's Java API, and on some servers it appears that the JVM goes into a low priority polling loop after logging into the API (CPU at 100% usage). The same app on other servers does...
TITLE: If you have a Java application that is consuming CPU when it isn't doing anything, how do you determine what it is doing? QUESTION: I am calling a vendor's Java API, and on some servers it appears that the JVM goes into a low priority polling loop after logging into the API (CPU at 100% usage). The same app on ...
[ "java", "profiling" ]
16
18
5,664
8
0
2008-08-16T00:45:38.210000
2008-08-16T02:12:04.090000
12,929
12,945
Is a Homogeneous development platform good for the industry?
Is it in best interests of the software development industry for one framework, browser or language to win the war and become the de facto standard? On one side it takes away the challenges of cross platform, but it opens it up for a single point of failure. Would it also result in a stagnation of innovation, or would ...
Defacto standards are bad because they are usually controlled by a single party. What is best for the industry is for there to be a foundation of open standards on top of which everyone can compete. The web is a perfect example. When IE won the browser war, it stagnated for years, and is only just now starting to impro...
Is a Homogeneous development platform good for the industry? Is it in best interests of the software development industry for one framework, browser or language to win the war and become the de facto standard? On one side it takes away the challenges of cross platform, but it opens it up for a single point of failure. ...
TITLE: Is a Homogeneous development platform good for the industry? QUESTION: Is it in best interests of the software development industry for one framework, browser or language to win the war and become the de facto standard? On one side it takes away the challenges of cross platform, but it opens it up for a single ...
[ "cross-platform" ]
5
11
511
4
0
2008-08-16T00:46:54.167000
2008-08-16T01:16:51.750000
12,936
16,749
Is using PHP accelerators such as MMCache or Zend Accelerator making PHP faster?
Does anybody have experience working with PHP accelerators such as MMCache or Zend Accelerator? I'd like to know if using either of these makes PHP comparable to faster web-technologies. Also, are there trade offs for using these?
Note that Zend Optimizer and MMCache (or similar applications) are totally different things. While Zend Optimizer tries to optimize the program opcode MMCache will cache the scripts in memory and reuse the precompiled code. I did some benchmarks some time ago and you can find the results in my blog (in German though). ...
Is using PHP accelerators such as MMCache or Zend Accelerator making PHP faster? Does anybody have experience working with PHP accelerators such as MMCache or Zend Accelerator? I'd like to know if using either of these makes PHP comparable to faster web-technologies. Also, are there trade offs for using these?
TITLE: Is using PHP accelerators such as MMCache or Zend Accelerator making PHP faster? QUESTION: Does anybody have experience working with PHP accelerators such as MMCache or Zend Accelerator? I'd like to know if using either of these makes PHP comparable to faster web-technologies. Also, are there trade offs for usi...
[ "php", "caching", "zend-optimizer" ]
17
13
3,003
10
0
2008-08-16T00:55:53.010000
2008-08-19T19:03:26.540000
12,946
12,979
Database replication. 2 servers, Master database and the 2nd is read-only
Say you have 2 database servers, one database is the 'master' database where all write operations are performed, it is treated as the 'real/original' database. The other server's database is to be a mirror copy of the master database (slave?), which will be used for read only operations for a certain part of the applic...
What you want is called Transactional Replication in SQL Server 2005. It will replicate changes in near real time as the publisher (i.e. "master") database is updated. Here is a pretty good walk through of how to set it up.
Database replication. 2 servers, Master database and the 2nd is read-only Say you have 2 database servers, one database is the 'master' database where all write operations are performed, it is treated as the 'real/original' database. The other server's database is to be a mirror copy of the master database (slave?), wh...
TITLE: Database replication. 2 servers, Master database and the 2nd is read-only QUESTION: Say you have 2 database servers, one database is the 'master' database where all write operations are performed, it is treated as the 'real/original' database. The other server's database is to be a mirror copy of the master dat...
[ "sql-server", "replication" ]
8
9
20,835
5
0
2008-08-16T01:18:46.007000
2008-08-16T03:31:52.867000
12,982
19,726
What is your preferred method of sending complex data over a web service?
It's 2008, and I'm still torn on this one. So I'm developing a web method that needs a complex type passed into it and returned from it. The two options I'm toying with are: Pass and return actual business objects with both data and behavior. When wsdl.exe is run, it will automatically create proxy classes that contain...
there is also an argument for separating the tiers - have a set of serializable objects that get passed to and from the web service and a translator to map and convert between that set and the business objects (which might have properties not suitable for passing over the wire) Its the approach favoured by the web serv...
What is your preferred method of sending complex data over a web service? It's 2008, and I'm still torn on this one. So I'm developing a web method that needs a complex type passed into it and returned from it. The two options I'm toying with are: Pass and return actual business objects with both data and behavior. Whe...
TITLE: What is your preferred method of sending complex data over a web service? QUESTION: It's 2008, and I'm still torn on this one. So I'm developing a web method that needs a complex type passed into it and returned from it. The two options I'm toying with are: Pass and return actual business objects with both data...
[ ".net", "web-services", "soap", "wsdl" ]
9
1
1,173
4
0
2008-08-16T03:58:24.687000
2008-08-21T12:31:34.190000
13,000
13,003
How to setup site-wide variables in php?
I want to define something like this in php: $EL = "\n \n"; and then use that variable as an "endline" marker all over my site, like this: echo "Blah blah blah{$EL}"; How do I define $EL once (in only 1 file), include it on every page on my site, and not have to reference it using the (strangely backwards) global $EL; ...
Most PHP sites should have a file (I call it a header) that you include on every single page of the site. If you put that first line of code in the header file, then include it like this on every page: include 'header.php'; you won't have to use the global keyword or anything, the second line of code you wrote should w...
How to setup site-wide variables in php? I want to define something like this in php: $EL = "\n \n"; and then use that variable as an "endline" marker all over my site, like this: echo "Blah blah blah{$EL}"; How do I define $EL once (in only 1 file), include it on every page on my site, and not have to reference it usi...
TITLE: How to setup site-wide variables in php? QUESTION: I want to define something like this in php: $EL = "\n \n"; and then use that variable as an "endline" marker all over my site, like this: echo "Blah blah blah{$EL}"; How do I define $EL once (in only 1 file), include it on every page on my site, and not have t...
[ "php" ]
8
7
7,858
11
0
2008-08-16T05:05:09.683000
2008-08-16T05:23:09.677000
13,021
13,193
Is there a "concise" way to do namespacing in JavaScript?
I've frequently encountered sites that put all of their JavaScript inside a namespace structure along the lines of: namespaces = { com: { example: { example.com's data} } However, setting this up safely with respect to other namespaced frameworks seems to require a relatively hefty amount of code (defined as > 2 lines)...
Javascript doesn't have stand-alone namespaces. It has functions, which can provide scope for resolving names, and objects, which can contribute to the named data accessible in a given scope. Here's your example, corrected: var namespaces = { com: { example: { /* example.com's data */ } } } This is a variable namespace...
Is there a "concise" way to do namespacing in JavaScript? I've frequently encountered sites that put all of their JavaScript inside a namespace structure along the lines of: namespaces = { com: { example: { example.com's data} } However, setting this up safely with respect to other namespaced frameworks seems to requir...
TITLE: Is there a "concise" way to do namespacing in JavaScript? QUESTION: I've frequently encountered sites that put all of their JavaScript inside a namespace structure along the lines of: namespaces = { com: { example: { example.com's data} } However, setting this up safely with respect to other namespaced framewor...
[ "javascript", "namespaces" ]
15
19
3,550
8
0
2008-08-16T05:57:37.487000
2008-08-16T16:04:18.260000
13,049
13,275
What's the difference between struct and class in .NET?
What's the difference between struct and class in.NET?
In.NET, there are two categories of types, reference types and value types. Structs are value types and classes are reference types. The general difference is that a reference type lives on the heap, and a value type lives inline, that is, wherever it is your variable or field is defined. A variable containing a value ...
What's the difference between struct and class in .NET? What's the difference between struct and class in.NET?
TITLE: What's the difference between struct and class in .NET? QUESTION: What's the difference between struct and class in.NET? ANSWER: In.NET, there are two categories of types, reference types and value types. Structs are value types and classes are reference types. The general difference is that a reference type l...
[ ".net", "class", "struct", "value-type", "reference-type" ]
901
1,271
523,683
19
0
2008-08-16T08:21:47.947000
2008-08-16T18:41:38.037000
13,055
25,324
What is boxing and unboxing and what are the trade offs?
I'm looking for a clear, concise and accurate answer. Ideally as the actual answer, although links to good explanations welcome.
Boxed values are data structures that are minimal wrappers around primitive types *. Boxed values are typically stored as pointers to objects on the heap. Thus, boxed values use more memory and take at minimum two memory lookups to access: once to get the pointer, and another to follow that pointer to the primitive. Ob...
What is boxing and unboxing and what are the trade offs? I'm looking for a clear, concise and accurate answer. Ideally as the actual answer, although links to good explanations welcome.
TITLE: What is boxing and unboxing and what are the trade offs? QUESTION: I'm looking for a clear, concise and accurate answer. Ideally as the actual answer, although links to good explanations welcome. ANSWER: Boxed values are data structures that are minimal wrappers around primitive types *. Boxed values are typic...
[ "language-agnostic", "boxing", "glossary", "unboxing" ]
153
215
63,825
9
0
2008-08-16T08:34:25.143000
2008-08-24T20:35:12.520000
13,060
13,100
What do ref, val and out mean on method parameters?
I'm looking for a clear, concise and accurate answer. Ideally as the actual answer, although links to good explanations welcome. This also applies to VB.Net, but the keywords are different - ByRef and ByVal.
By default (in C#), passing an object to a function actually passes a copy of the reference to that object. Changing the parameter itself only changes the value in the parameter, and not the variable that was specified. void Test1(string param) { param = "new value"; } string s1 = "initial value"; Test1(s1); // s1 == ...
What do ref, val and out mean on method parameters? I'm looking for a clear, concise and accurate answer. Ideally as the actual answer, although links to good explanations welcome. This also applies to VB.Net, but the keywords are different - ByRef and ByVal.
TITLE: What do ref, val and out mean on method parameters? QUESTION: I'm looking for a clear, concise and accurate answer. Ideally as the actual answer, although links to good explanations welcome. This also applies to VB.Net, but the keywords are different - ByRef and ByVal. ANSWER: By default (in C#), passing an ob...
[ "c#", ".net", "vb.net" ]
22
27
13,914
4
0
2008-08-16T08:46:16.633000
2008-08-16T12:06:17.337000
13,086
13,098
Delphi resources for existing .NET developer
Can anyone recommend some decent resources for a.NET developer who wishes to get a high level overview of the Delphi Programming Language? We are about acquire a small business whose main product is developed in Delphi and I am wanting to build up enough knowledge to be able to talk the talk with them. Books, websites ...
DelphiBasics gives a good overview of basic syntax, library functions etc. Essential Delphi is a free e-book by Marco Cantu that should give a good overview, also of the VCL Feel free to ask around here as well, or in the Delphi newsgroups, if you encounter specific issues:) [edit] @Martin: There's a free "Turbo" editi...
Delphi resources for existing .NET developer Can anyone recommend some decent resources for a.NET developer who wishes to get a high level overview of the Delphi Programming Language? We are about acquire a small business whose main product is developed in Delphi and I am wanting to build up enough knowledge to be able...
TITLE: Delphi resources for existing .NET developer QUESTION: Can anyone recommend some decent resources for a.NET developer who wishes to get a high level overview of the Delphi Programming Language? We are about acquire a small business whose main product is developed in Delphi and I am wanting to build up enough kn...
[ "delphi" ]
5
4
498
5
0
2008-08-16T10:24:05.797000
2008-08-16T11:46:16.050000
13,106
13,111
Should I support ASP.NET 1.1?
I've just started working on an ASP.NET project which I hope to open source once it gets to a suitable stage. It's basically going to be a library that can be used by existing websites. My preference is to support ASP.NET 2.0 through 3.5, but I wondered how many people I would be leaving out by not supporting ASP.NET 1...
Increasingly I think not. The kind of large rigid organisation currently still clinging to 1.1 (probably because they're only just upgraded to it) is also the kind that's highly unlikely to look at open source solutions. If I were starting a new ASP.Net project right now I'd stick with.Net 3.5 and probably the new MVC ...
Should I support ASP.NET 1.1? I've just started working on an ASP.NET project which I hope to open source once it gets to a suitable stage. It's basically going to be a library that can be used by existing websites. My preference is to support ASP.NET 2.0 through 3.5, but I wondered how many people I would be leaving o...
TITLE: Should I support ASP.NET 1.1? QUESTION: I've just started working on an ASP.NET project which I hope to open source once it gets to a suitable stage. It's basically going to be a library that can be used by existing websites. My preference is to support ASP.NET 2.0 through 3.5, but I wondered how many people I ...
[ "asp.net", ".net-1.1" ]
4
4
269
3
0
2008-08-16T12:34:58.060000
2008-08-16T12:43:39.493000
13,109
13,113
PHP: Access Array Value on the Fly
In php, I often need to map a variable using an array... but I can not seem to be able to do this in a one liner. c.f. example: // the following results in an error: echo array('a','b','c')[$key]; // this works, using an unnecessary variable: $variable = array('a','b','c'); echo $variable[$key]; This is a minor proble...
I wouldn't bother about that extra variable, really. If you want, though, you could also remove it from memory after you've used it: $variable = array('a','b','c'); echo $variable[$key]; unset($variable); Or, you could write a small function: function indexonce(&$ar, $index) { return $ar[$index]; } and call this with: ...
PHP: Access Array Value on the Fly In php, I often need to map a variable using an array... but I can not seem to be able to do this in a one liner. c.f. example: // the following results in an error: echo array('a','b','c')[$key]; // this works, using an unnecessary variable: $variable = array('a','b','c'); echo $var...
TITLE: PHP: Access Array Value on the Fly QUESTION: In php, I often need to map a variable using an array... but I can not seem to be able to do this in a one liner. c.f. example: // the following results in an error: echo array('a','b','c')[$key]; // this works, using an unnecessary variable: $variable = array('a','...
[ "php", "arrays", "coding-style" ]
50
19
19,534
9
0
2008-08-16T12:42:54.017000
2008-08-16T12:55:29.953000
13,128
13,140
How can I combine several C/C++ libraries into one?
I'm tired of adding ten link libraries into my project, or requiring eight of them to use my own. I'd like to take existing libraries like libpng.a, libz.a, libjpeg.a, and combine them into one single.a library. Is that possible? How about combining.lib libraries?
On Unix like systems, the ld and ar utilities can do this. Check out http://en.wikipedia.org/wiki/Ar_(Unix) or lookup the man pages on any Linux box or through Google, e.g., 'Unix man ar'. Please note that you might be better off linking to a shared (dynamic) library. This would add a dependency to your executable, but...
How can I combine several C/C++ libraries into one? I'm tired of adding ten link libraries into my project, or requiring eight of them to use my own. I'd like to take existing libraries like libpng.a, libz.a, libjpeg.a, and combine them into one single.a library. Is that possible? How about combining.lib libraries?
TITLE: How can I combine several C/C++ libraries into one? QUESTION: I'm tired of adding ten link libraries into my project, or requiring eight of them to use my own. I'd like to take existing libraries like libpng.a, libz.a, libjpeg.a, and combine them into one single.a library. Is that possible? How about combining....
[ "c++", "c", "archive" ]
47
9
39,628
6
0
2008-08-16T13:46:01.987000
2008-08-16T14:15:23.037000
13,160
13,164
Best practice for webservices
I've created a webservice and when I want to use its methods I instantiate it in the a procedure, call the method, and I finally I dispose it, however I think also it could be okay to instantiate the webservice in the "private void Main_Load(object sender, EventArgs e)" event. The thing is that if I do it the first way...
It depends on how often you are going to be calling the web service. If you're going to be calling it almost constantly, it would probably be better to use method #2. However, if it's not going to be getting called quite so often, you are better off using method #1, and only instantiating it when you need it.
Best practice for webservices I've created a webservice and when I want to use its methods I instantiate it in the a procedure, call the method, and I finally I dispose it, however I think also it could be okay to instantiate the webservice in the "private void Main_Load(object sender, EventArgs e)" event. The thing is...
TITLE: Best practice for webservices QUESTION: I've created a webservice and when I want to use its methods I instantiate it in the a procedure, call the method, and I finally I dispose it, however I think also it could be okay to instantiate the webservice in the "private void Main_Load(object sender, EventArgs e)" e...
[ "web-services" ]
2
2
773
2
0
2008-08-16T14:58:30.860000
2008-08-16T15:04:56.603000
13,170
13,255
A ThreadStateException occures when trying to restart a thread
From time to time I get a System.Threading.ThreadStateException when attempting to restart a thread. The code in question is as follows: // Make sure the thread is done stopping while (this.mThread.ThreadState == ThreadState.Running) { Thread.Sleep(0); } // Respawn a thread if the current one is stopped or doesn't exis...
The problem is that you have code that first checks if it should create a new thread object, and another piece of code that determines wether to start the thread object. Due to race conditions and similar things, your code might end up trying to call.Start on an existing thread object. Considering you don't post the de...
A ThreadStateException occures when trying to restart a thread From time to time I get a System.Threading.ThreadStateException when attempting to restart a thread. The code in question is as follows: // Make sure the thread is done stopping while (this.mThread.ThreadState == ThreadState.Running) { Thread.Sleep(0); } //...
TITLE: A ThreadStateException occures when trying to restart a thread QUESTION: From time to time I get a System.Threading.ThreadStateException when attempting to restart a thread. The code in question is as follows: // Make sure the thread is done stopping while (this.mThread.ThreadState == ThreadState.Running) { Thr...
[ "c#", ".net", "multithreading", "exception" ]
6
3
8,210
3
0
2008-08-16T15:24:19.153000
2008-08-16T17:56:47.147000
13,200
13,318
How do I integrate my continuous integration system with my bug tracking system?
I use cruisecontrol.rb for CI and FogBugz for bug tracking, but the more general the answers, the better. First is the technical problem: is there an API for FogBugz? Are there good tutorials, or better yet, pre-written code? Second is the procedural problem: what, exactly, should the CI put in the bug tracker when the...
All the CI setups I've worked with send an email (to a list), but if you did want—especially if your team uses FogBugz much as a todo system—you could just open a case in FogBugz 6. It has an API that lets you open cases. For that matter, you could just configure it to send the email to your FogBugz' email submission a...
How do I integrate my continuous integration system with my bug tracking system? I use cruisecontrol.rb for CI and FogBugz for bug tracking, but the more general the answers, the better. First is the technical problem: is there an API for FogBugz? Are there good tutorials, or better yet, pre-written code? Second is the...
TITLE: How do I integrate my continuous integration system with my bug tracking system? QUESTION: I use cruisecontrol.rb for CI and FogBugz for bug tracking, but the more general the answers, the better. First is the technical problem: is there an API for FogBugz? Are there good tutorials, or better yet, pre-written c...
[ "continuous-integration", "bug-tracking", "fogbugz", "cruisecontrol.rb" ]
6
3
2,127
3
0
2008-08-16T16:09:16.240000
2008-08-16T19:56:45.093000
13,204
13,220
Why Doesn't My Cron Job Work Properly?
I have a cron job on an Ubuntu Hardy VPS that only half works and I can't work out why. The job is a Ruby script that uses mysqldump to back up a MySQL database used by a Rails application, which is then gzipped and uploaded to a remote server using SFTP. The gzip file is created and copied successfully but it's always...
Are you sure the temporary file is being created correctly when running as a cron job? The working directory for your script will either be specified in the HOME environment variable, or the /etc/passwd entry for the user that installed the cron job. If deploy does not have write permissions for the directory in which ...
Why Doesn't My Cron Job Work Properly? I have a cron job on an Ubuntu Hardy VPS that only half works and I can't work out why. The job is a Ruby script that uses mysqldump to back up a MySQL database used by a Rails application, which is then gzipped and uploaded to a remote server using SFTP. The gzip file is created ...
TITLE: Why Doesn't My Cron Job Work Properly? QUESTION: I have a cron job on an Ubuntu Hardy VPS that only half works and I can't work out why. The job is a Ruby script that uses mysqldump to back up a MySQL database used by a Rails application, which is then gzipped and uploaded to a remote server using SFTP. The gzi...
[ "ruby-on-rails", "ruby", "linux", "ubuntu", "cron" ]
7
2
8,685
4
0
2008-08-16T16:15:18.363000
2008-08-16T16:34:37.357000
13,213
13,218
How to avoid conflict when not using ID in URLs
I see often (rewritten) URLs without ID in it, like on some wordpress installations. What is the best way of achieve this? Example: site.com/product/some-product-name/ Maybe to keep an array of page names and IDs in cache, to avoid DB query on every page request? How to avoid conflicts, and what are other issues on usi...
Using an ID presents the same conundrum, really--you're just checking for a different value in your database. The "some-product-name" part of your URL above is also something unique. Some people call them slugs (Wordpress, also permalinks). So instead of querying the database for a row that has the particular ID, you'r...
How to avoid conflict when not using ID in URLs I see often (rewritten) URLs without ID in it, like on some wordpress installations. What is the best way of achieve this? Example: site.com/product/some-product-name/ Maybe to keep an array of page names and IDs in cache, to avoid DB query on every page request? How to a...
TITLE: How to avoid conflict when not using ID in URLs QUESTION: I see often (rewritten) URLs without ID in it, like on some wordpress installations. What is the best way of achieve this? Example: site.com/product/some-product-name/ Maybe to keep an array of page names and IDs in cache, to avoid DB query on every page...
[ "url", "url-rewriting" ]
5
3
2,599
4
0
2008-08-16T16:24:58.827000
2008-08-16T16:32:16.787000
13,217
16,648
How do I update my UI from within HttpWebRequest.BeginGetRequestStream in Silverlight
I am uploading multiple files using the BeginGetRequestStream of HttpWebRequest but I want to update the progress control I have written whilst I post up the data stream. How should this be done, I have tried calling Dispatch.BeginInvoke (as below) from within the loop that pushes the data into the stream but it locks ...
I was going to say that, I didn't think that Silverlight 2's HttpWebRequest supported streaming, because the request data gets buffered into memory entirely. It had been a while since the last time I looked at it though, therefore I went back to see if Beta 2 supported it. Well turns out it does. I am glad I went back ...
How do I update my UI from within HttpWebRequest.BeginGetRequestStream in Silverlight I am uploading multiple files using the BeginGetRequestStream of HttpWebRequest but I want to update the progress control I have written whilst I post up the data stream. How should this be done, I have tried calling Dispatch.BeginInv...
TITLE: How do I update my UI from within HttpWebRequest.BeginGetRequestStream in Silverlight QUESTION: I am uploading multiple files using the BeginGetRequestStream of HttpWebRequest but I want to update the progress control I have written whilst I post up the data stream. How should this be done, I have tried calling...
[ "c#", "silverlight" ]
5
1
4,508
2
0
2008-08-16T16:32:06.257000
2008-08-19T18:09:03.233000
13,224
13,228
Mobile device is detected as non mobile device
I've included a mobile web form in my asp.net project, I thought that it could/should be seen just for my mobile users but I realize that it can also be seen from any browser, I don't see problem there cause I could diff the access using HttpBrowserCapabilities.IsMobileDevice=true and transferring to the appropiate asp...
Some are not recognized, because the UserAgent has been messed with or a new browser is being used. Such as Opera Mobile 9.5. To fix this you need to create a Browser (*.browser) file specifically for defining this. I had to do it for the new Mozilla based UserAgent that is being sent from Google.
Mobile device is detected as non mobile device I've included a mobile web form in my asp.net project, I thought that it could/should be seen just for my mobile users but I realize that it can also be seen from any browser, I don't see problem there cause I could diff the access using HttpBrowserCapabilities.IsMobileDev...
TITLE: Mobile device is detected as non mobile device QUESTION: I've included a mobile web form in my asp.net project, I thought that it could/should be seen just for my mobile users but I realize that it can also be seen from any browser, I don't see problem there cause I could diff the access using HttpBrowserCapabi...
[ "asp.net", "mobile", "mobile-website" ]
6
2
5,600
3
0
2008-08-16T16:42:27.827000
2008-08-16T16:46:28.270000
13,225
13,381
How can I refactor HTML markup out of my property files?
I've recently inherited a internationalized and text-heavy Struts 1.1 web application. Many of the JSP files look like: and the properties files look like: messages.properties alert=Please update your address and contact information. with the appropriate translations in N other languages (messages_fr.properties, etc). ...
Avoid creating links within long blocks of text. Prefer shorter text that can act as a logically complete and independent link. Generally, it will lead to fewer problems. Sometimes you have to compromise your UI design to accommodate localization; sometimes you need to compromise your localization process to accommodat...
How can I refactor HTML markup out of my property files? I've recently inherited a internationalized and text-heavy Struts 1.1 web application. Many of the JSP files look like: and the properties files look like: messages.properties alert=Please update your address and contact information. with the appropriate translat...
TITLE: How can I refactor HTML markup out of my property files? QUESTION: I've recently inherited a internationalized and text-heavy Struts 1.1 web application. Many of the JSP files look like: and the properties files look like: messages.properties alert=Please update your address and contact information. with the ap...
[ "java", "jsp", "internationalization", "struts" ]
9
2
2,781
4
0
2008-08-16T16:42:50.070000
2008-08-16T21:59:07.157000
13,279
47,187
Any good resources or advice for working with languages with different orientations? (such as Japanese or Chinese)
We have an enterprise web application where every bit of text in the system is localised to the user's browser's culture setting. So far we have only supported English, American (similar but mis-spelt;-) and French (for the Canadian Gov't - app in English or French depending on user preference). During development we a...
Read Globalization Step-by-Step by Microsoft. I can answer the specifics on CJKV, but you probably want a book on this topic. I haven't read it but CJKV Information Processing is from O'Reilly (2nd ed due Dec, 2008). I understand that these use phonetic input converted to written characters. How does that work on the w...
Any good resources or advice for working with languages with different orientations? (such as Japanese or Chinese) We have an enterprise web application where every bit of text in the system is localised to the user's browser's culture setting. So far we have only supported English, American (similar but mis-spelt;-) a...
TITLE: Any good resources or advice for working with languages with different orientations? (such as Japanese or Chinese) QUESTION: We have an enterprise web application where every bit of text in the system is localised to the user's browser's culture setting. So far we have only supported English, American (similar ...
[ "internationalization", "multilingual" ]
9
6
527
3
0
2008-08-16T18:57:53.887000
2008-09-06T02:04:37.263000
13,293
13,369
How can I determine CodeIgniter speed?
I am thinking of using a PHP framework called CodeIgniter. One of the things I am interested in is its speed. I have, however, no way to find out how fast it is, and would rather not simply take the word of their website for it. Does anybody know how I can determine its speed myself, or can someone tell me of a site th...
Code Igniter also has some built-in benchmarking tools: http://codeigniter.com/user_guide/general/profiling.html
How can I determine CodeIgniter speed? I am thinking of using a PHP framework called CodeIgniter. One of the things I am interested in is its speed. I have, however, no way to find out how fast it is, and would rather not simply take the word of their website for it. Does anybody know how I can determine its speed myse...
TITLE: How can I determine CodeIgniter speed? QUESTION: I am thinking of using a PHP framework called CodeIgniter. One of the things I am interested in is its speed. I have, however, no way to find out how fast it is, and would rather not simply take the word of their website for it. Does anybody know how I can determ...
[ "php", "performance", "codeigniter", "benchmarking" ]
19
17
7,145
7
0
2008-08-16T19:27:20.473000
2008-08-16T21:19:51.167000
13,299
136,925
Image manipulation in asp.net/c# without System.Drawing/GDI+
Is there any alternative image manipulation library for.net? I would prefer something that is managed and open source. I ask this because of two reasons: I have encountered hard to debug GDI+ errors with System.Drawing in the past I have read that using System.Drawing in asp.net web applications is not 100% supported. ...
I don't know of any fully-managed 2D drawing libraries that are either free or open-source (there appears to be a few commercially available, but OSS is the way to go). However, you might look into the Mono bindings to Cairo. Cairo is a platform independent 2D drawing API. You can find more information about it at the ...
Image manipulation in asp.net/c# without System.Drawing/GDI+ Is there any alternative image manipulation library for.net? I would prefer something that is managed and open source. I ask this because of two reasons: I have encountered hard to debug GDI+ errors with System.Drawing in the past I have read that using Syste...
TITLE: Image manipulation in asp.net/c# without System.Drawing/GDI+ QUESTION: Is there any alternative image manipulation library for.net? I would prefer something that is managed and open source. I ask this because of two reasons: I have encountered hard to debug GDI+ errors with System.Drawing in the past I have rea...
[ "asp.net", "system.drawing" ]
12
2
6,856
4
0
2008-08-16T19:42:42.937000
2008-09-25T23:41:34.683000
13,343
13,370
How much of your work day is spent coding?
I've been thinking about software estimation lately, and I have a bunch of questions around time spent coding. I'm curious to hear from people who have had at least a couple years of experience developing software. When you have to estimate the amount of time you'll spend working on something, how many hours of the day...
I'm a corporate developer, the kind Joel Spolsky called "depressed" in a couple of the StackOverflow podcasts. Because my company is not a software company it has little business reason to implement many of the measures software experts recommend companies engage for developer productivity. We don't get private offices...
How much of your work day is spent coding? I've been thinking about software estimation lately, and I have a bunch of questions around time spent coding. I'm curious to hear from people who have had at least a couple years of experience developing software. When you have to estimate the amount of time you'll spend work...
TITLE: How much of your work day is spent coding? QUESTION: I've been thinking about software estimation lately, and I have a bunch of questions around time spent coding. I'm curious to hear from people who have had at least a couple years of experience developing software. When you have to estimate the amount of time...
[ "estimation", "time-management" ]
28
21
11,843
9
0
2008-08-16T20:30:56.273000
2008-08-16T21:25:03.607000
13,345
13,351
Firefox plugin - sockets
I've always wanted a way to make a socket connection to a server and allow the server to manipulate the page DOM. For example, this could be used in a stock quotes page, so the server can push new quotes as they become available. I know this is a classic limitation (feature?) of HTTP's request/response protocol, but I ...
You may want to look at Comet which is a fancy name for a long running HTTP connection where the server can push updates to the page.
Firefox plugin - sockets I've always wanted a way to make a socket connection to a server and allow the server to manipulate the page DOM. For example, this could be used in a stock quotes page, so the server can push new quotes as they become available. I know this is a classic limitation (feature?) of HTTP's request/...
TITLE: Firefox plugin - sockets QUESTION: I've always wanted a way to make a socket connection to a server and allow the server to manipulate the page DOM. For example, this could be used in a stock quotes page, so the server can push new quotes as they become available. I know this is a classic limitation (feature?) ...
[ "firefox", "dom", "sockets", "plugins" ]
4
2
4,543
4
0
2008-08-16T20:31:44.867000
2008-08-16T20:47:26.553000
13,347
13,375
Developing for multiple monitors
We are currently working on a new version of our main application. one thing that I really wish to work on is providing support for multiple monitors. Increasingly, our target users are adding second screens to their desktops and I think our product could leverage this extra space to improve user performance. Our appli...
Few random tips: If multiple windows can be open at one time, allow users to have them on separate screens. Seems obvious, but some very popular apps (e.g. Visual Studio) fail miserably at this. Remember the position of the last opened window, and open new windows on the same screen as before. However, sometimes users ...
Developing for multiple monitors We are currently working on a new version of our main application. one thing that I really wish to work on is providing support for multiple monitors. Increasingly, our target users are adding second screens to their desktops and I think our product could leverage this extra space to im...
TITLE: Developing for multiple monitors QUESTION: We are currently working on a new version of our main application. one thing that I really wish to work on is providing support for multiple monitors. Increasingly, our target users are adding second screens to their desktops and I think our product could leverage this...
[ "user-interface", "hardware", "monitor", "environment" ]
9
14
1,531
7
0
2008-08-16T20:37:09.053000
2008-08-16T21:37:14.360000
13,348
13,352
What are the advantages of using a single database for EACH client?
In a database-centric application that is designed for multiple clients, I've always thought it was "better" to use a single database for ALL clients - associating records with proper indexes and keys. In listening to the Stack Overflow podcast, I heard Joel mention that FogBugz uses one database per client (so if ther...
Assume there's no scaling penalty for storing all the clients in one database; for most people, and well configured databases/queries, this will be fairly true these days. If you're not one of these people, well, then the benefit of a single database is obvious. In this situation, benefits come from the encapsulation o...
What are the advantages of using a single database for EACH client? In a database-centric application that is designed for multiple clients, I've always thought it was "better" to use a single database for ALL clients - associating records with proper indexes and keys. In listening to the Stack Overflow podcast, I hear...
TITLE: What are the advantages of using a single database for EACH client? QUESTION: In a database-centric application that is designed for multiple clients, I've always thought it was "better" to use a single database for ALL clients - associating records with proper indexes and keys. In listening to the Stack Overfl...
[ "database", "database-design", "multi-tenant" ]
68
53
21,273
8
0
2008-08-16T20:39:26.070000
2008-08-16T20:48:00.403000
13,353
13,358
Override tab behavior in WinForms
I have a UserControl that consists of three TextBoxes. On a form I can have one or more or my UserControl. I want to implement my own tab behavior so if the user presses Tab in the second TextBox I should only move to the third TextBox if the the second TextBox has anything entered. If nothing is entered in the second ...
As a general rule, I would say overriding the standard behavior of the TAB key would be a bad idea. Maybe you can do something like disabling the 3rd text box until a valid entry is made in the 2nd text box. Now, having said this, I've also broken this rule at the request of the customer. We made the enter key function...
Override tab behavior in WinForms I have a UserControl that consists of three TextBoxes. On a form I can have one or more or my UserControl. I want to implement my own tab behavior so if the user presses Tab in the second TextBox I should only move to the third TextBox if the the second TextBox has anything entered. If...
TITLE: Override tab behavior in WinForms QUESTION: I have a UserControl that consists of three TextBoxes. On a form I can have one or more or my UserControl. I want to implement my own tab behavior so if the user presses Tab in the second TextBox I should only move to the third TextBox if the the second TextBox has an...
[ "c#", ".net", "winforms" ]
5
3
3,630
5
0
2008-08-16T20:48:00.590000
2008-08-16T20:55:29.483000
13,362
13,365
Scrolling Overflowed DIVs with JavaScript
I've got a div that uses overflow:auto to keep the contents inside the div as it is resized and dragged around the page. I'm using some ajax to retrieve lines of text from the server, then append them to the end of the div, so the content is growing downwards. Every time this happens, I'd like to use JS to scroll the d...
scrollHeight should be the total height of content. scrollTop specifies the pixel offset into that content to be displayed at the top of the element's client area. So you really want (still using jQuery): $("#thediv").each( function() { // certain browsers have a bug such that scrollHeight is too small // when content ...
Scrolling Overflowed DIVs with JavaScript I've got a div that uses overflow:auto to keep the contents inside the div as it is resized and dragged around the page. I'm using some ajax to retrieve lines of text from the server, then append them to the end of the div, so the content is growing downwards. Every time this h...
TITLE: Scrolling Overflowed DIVs with JavaScript QUESTION: I've got a div that uses overflow:auto to keep the contents inside the div as it is resized and dragged around the page. I'm using some ajax to retrieve lines of text from the server, then append them to the end of the div, so the content is growing downwards....
[ "javascript", "jquery", "ajax", "html", "scroll" ]
50
46
75,042
6
0
2008-08-16T21:04:17.250000
2008-08-16T21:10:20.827000
13,396
13,435
Replacement for for... if array iteration
I love list comprehensions in Python, because they concisely represent a transformation of a list. However, in other languages, I frequently find myself writing something along the lines of: foreach (int x in intArray) if (x > 3) //generic condition on x x++ //do other processing This example is in C#, where I'm under ...
The increment in the original foreach loop will not affect the contents of the array, the only way to do this remains a for loop: for(int i = 0; i < intArray.Length; ++i) { if(intArray[i] > 3) ++intArray[i]; } Linq is not intended to modify existing collections or sequences. It creates new sequences based on existing o...
Replacement for for... if array iteration I love list comprehensions in Python, because they concisely represent a transformation of a list. However, in other languages, I frequently find myself writing something along the lines of: foreach (int x in intArray) if (x > 3) //generic condition on x x++ //do other processi...
TITLE: Replacement for for... if array iteration QUESTION: I love list comprehensions in Python, because they concisely represent a transformation of a list. However, in other languages, I frequently find myself writing something along the lines of: foreach (int x in intArray) if (x > 3) //generic condition on x x++ /...
[ ".net", "python", "arrays", "loops", "iteration" ]
12
7
665
6
0
2008-08-16T22:28:39.827000
2008-08-17T00:44:57.650000
13,409
13,412
Do you have "Slack" time?
The CodePlex team has a Slack time policy, and it's worked out very well for them. Jim Newkirk and myself used it to work on the xUnit.net project. Jonathan Wanagel used it to work on SvnBridge. Scott Densmore and myself used it to work on an ObjectBuilder 2.0 prototype. For others, it was a great time to explore thing...
I just want to mention Google's policy on the subject. 20% of the day should be used for private projects and research. I think it is time for managers to face the fact that most good developers are a bit lazy. If they weren't, we wouldn't have concepts like code reuse. If this laziness can be focused into a creative f...
Do you have "Slack" time? The CodePlex team has a Slack time policy, and it's worked out very well for them. Jim Newkirk and myself used it to work on the xUnit.net project. Jonathan Wanagel used it to work on SvnBridge. Scott Densmore and myself used it to work on an ObjectBuilder 2.0 prototype. For others, it was a g...
TITLE: Do you have "Slack" time? QUESTION: The CodePlex team has a Slack time policy, and it's worked out very well for them. Jim Newkirk and myself used it to work on the xUnit.net project. Jonathan Wanagel used it to work on SvnBridge. Scott Densmore and myself used it to work on an ObjectBuilder 2.0 prototype. For ...
[ "time-management" ]
21
19
2,814
6
0
2008-08-16T23:17:23.317000
2008-08-16T23:30:13.837000
13,430
13,759
Does CruiseControl.NET run on IIS 7.0?
I'm new to development (an admin by trade) and I'm setting up my development environment and I would like to set up a CruiseControl.Net server on Server 2008. A quick Google did not turn up any instructions for getting it running on IIS 7.0, so I was wondering if anyone had experience getting this set up.
What Dale Ragan said; it installed flawlessly on our Windows Server 2008 machine, including the Dashboard running on IIS 7. Just give it a shot; should work fine.
Does CruiseControl.NET run on IIS 7.0? I'm new to development (an admin by trade) and I'm setting up my development environment and I would like to set up a CruiseControl.Net server on Server 2008. A quick Google did not turn up any instructions for getting it running on IIS 7.0, so I was wondering if anyone had experi...
TITLE: Does CruiseControl.NET run on IIS 7.0? QUESTION: I'm new to development (an admin by trade) and I'm setting up my development environment and I would like to set up a CruiseControl.Net server on Server 2008. A quick Google did not turn up any instructions for getting it running on IIS 7.0, so I was wondering if...
[ "iis-7", "cruisecontrol.net" ]
8
4
3,721
4
0
2008-08-17T00:37:17.680000
2008-08-17T17:38:12.783000
13,460
13,465
The theory (and terminology) behind Source Control
I've tried using source control for a couple projects but still don't really understand it. For these projects, we've used TortoiseSVN and have only had one line of revisions. (No trunk, branch, or any of that.) If there is a recommended way to set up source control systems, what are they? What are the reasons and beni...
I recommend checking out the following from Eric Sink: http://www.ericsink.com/scm/source_control.html Having some sort of revision control system in place is probably the most important tool a programmer has for reviewing code changes and understanding who did what to whom. Even for single person projects, it is inval...
The theory (and terminology) behind Source Control I've tried using source control for a couple projects but still don't really understand it. For these projects, we've used TortoiseSVN and have only had one line of revisions. (No trunk, branch, or any of that.) If there is a recommended way to set up source control sy...
TITLE: The theory (and terminology) behind Source Control QUESTION: I've tried using source control for a couple projects but still don't really understand it. For these projects, we've used TortoiseSVN and have only had one line of revisions. (No trunk, branch, or any of that.) If there is a recommended way to set up...
[ "version-control" ]
7
6
1,225
5
0
2008-08-17T01:38:24.797000
2008-08-17T01:44:24.237000
13,470
13,484
Purpose of {1} in this regular expression to match url protocols
I was reading this question about how to parse URLs out of web pages and had a question about the accepted answer which offered this solution: ((mailto\:|(news|(ht|f)tp(s?))\://){1}\S+) The solution was offered by csmba and he credited it to regexlib.com. Whew. Credits done. I think this is a fairly naive regular expre...
@Jeff Atwood, your interpretation is a little off - the {1} means match exactly once, but has no effect on the "capturing" - the capturing occurs because of the parens - the braces only specify the number of times the pattern must match the source - once, as you say. I agree with @Marius, even if his answer is a little...
Purpose of {1} in this regular expression to match url protocols I was reading this question about how to parse URLs out of web pages and had a question about the accepted answer which offered this solution: ((mailto\:|(news|(ht|f)tp(s?))\://){1}\S+) The solution was offered by csmba and he credited it to regexlib.com....
TITLE: Purpose of {1} in this regular expression to match url protocols QUESTION: I was reading this question about how to parse URLs out of web pages and had a question about the accepted answer which offered this solution: ((mailto\:|(news|(ht|f)tp(s?))\://){1}\S+) The solution was offered by csmba and he credited i...
[ "regex" ]
4
1
938
4
0
2008-08-17T02:01:56.230000
2008-08-17T02:56:56.337000
13,473
13,481
How does one rank an array (sort) by value? *With a twist*
I would like to sort an array in ascending order using C/C++. The outcome is an array containing element indexes. Each index is corespondent to the element location in the sorted array. Example Input: 1, 3, 4, 9, 6 Output: 1, 2, 3, 5, 4 Edit: I am using shell sort procedure. The duplicate value indexes are arbitrarily ...
Since you're using C++, I would do it something like this. The SortIntPointers function can be any sort algorithm, the important part is that it sorts the array of pointers based on the int that they are pointing to. Once that is done, you can go through the array of pointers and assign their sorted index which will en...
How does one rank an array (sort) by value? *With a twist* I would like to sort an array in ascending order using C/C++. The outcome is an array containing element indexes. Each index is corespondent to the element location in the sorted array. Example Input: 1, 3, 4, 9, 6 Output: 1, 2, 3, 5, 4 Edit: I am using shell s...
TITLE: How does one rank an array (sort) by value? *With a twist* QUESTION: I would like to sort an array in ascending order using C/C++. The outcome is an array containing element indexes. Each index is corespondent to the element location in the sorted array. Example Input: 1, 3, 4, 9, 6 Output: 1, 2, 3, 5, 4 Edit: ...
[ "c++", "c", "arrays", "sorting" ]
6
7
16,867
7
0
2008-08-17T02:13:55.533000
2008-08-17T02:33:32.687000
13,485
13,495
How do you keep two related, but separate, systems in sync with each other?
My current development project has two aspects to it. First, there is a public website where external users can submit and update information for various purposes. This information is then saved to a local SQL Server at the colo facility. The second aspect is an internal application which employees use to manage those ...
This is a pretty common integration scenario, I believe. Personally, I think an asynchronous messaging solution using a queue is ideal. You should be able to achieve near real time synchronization without the overhead or complexity of something like replication. Synchronous web services are not ideal because your code ...
How do you keep two related, but separate, systems in sync with each other? My current development project has two aspects to it. First, there is a public website where external users can submit and update information for various purposes. This information is then saved to a local SQL Server at the colo facility. The s...
TITLE: How do you keep two related, but separate, systems in sync with each other? QUESTION: My current development project has two aspects to it. First, there is a public website where external users can submit and update information for various purposes. This information is then saved to a local SQL Server at the co...
[ "sql-server", "database", "synchronization", "distributed" ]
24
25
10,971
5
0
2008-08-17T02:57:46.633000
2008-08-17T03:22:49.017000
13,498
13,505
simultaneous Outlook reminders on multiple devices
Disclaimer: This is not actually a programming question, but I feel the audience on stackoverflow is more likely to have an answer than most question/answer sites out there. Please forgive me, Joel, for stealing your question. Joel asked this question on a podcast a while back but I don't think it ever got resolved. I'...
At least for PCs, the fact that you dismiss an item does get sync'd, and fairly quickly for me. I'm not sure why phones don't seem to do it, though. Maybe the ActiveSync protocol doesn't offer that option.
simultaneous Outlook reminders on multiple devices Disclaimer: This is not actually a programming question, but I feel the audience on stackoverflow is more likely to have an answer than most question/answer sites out there. Please forgive me, Joel, for stealing your question. Joel asked this question on a podcast a wh...
TITLE: simultaneous Outlook reminders on multiple devices QUESTION: Disclaimer: This is not actually a programming question, but I feel the audience on stackoverflow is more likely to have an answer than most question/answer sites out there. Please forgive me, Joel, for stealing your question. Joel asked this question...
[ "windows", "outlook", "synchronization", "reminders" ]
8
2
4,014
4
0
2008-08-17T03:25:36.607000
2008-08-17T04:05:15.403000
13,518
13,521
Browser Sync across many machines
Everyone remembers google browser sync right? I thought it was great. Unfortunately Google decided not to upgrade the service to Firefox 3.0. Mozilla is developing a replacement for google browser sync which will be a part of the Weave project. I have tried using Weave and found it to be very very slow or totally inope...
Mozilla Weave is capable of running on personal servers. It uses WebDAV to communicate with HTTP servers and can be configured to connect to private servers. I've tried setting it up on my own servers but with no success (Mainly because I'm not very good at working with Apache to configure WebDAV) I'm hoping Mozilla We...
Browser Sync across many machines Everyone remembers google browser sync right? I thought it was great. Unfortunately Google decided not to upgrade the service to Firefox 3.0. Mozilla is developing a replacement for google browser sync which will be a part of the Weave project. I have tried using Weave and found it to ...
TITLE: Browser Sync across many machines QUESTION: Everyone remembers google browser sync right? I thought it was great. Unfortunately Google decided not to upgrade the service to Firefox 3.0. Mozilla is developing a replacement for google browser sync which will be a part of the Weave project. I have tried using Weav...
[ "firefox", "browser", "synchronization" ]
2
7
1,744
4
0
2008-08-17T04:58:38.510000
2008-08-17T05:17:05.697000
13,537
13,552
Bootstrapping still requires outside support
I've heard of the idea of bootstrapping a language, that is, writing a compiler/interpreter for the language in itself. I was wondering how this could be accomplished and looked around a bit, and saw someone say that it could only be done by either writing an initial compiler in a different language. hand-coding an ini...
Is there a way to actually write a compiler in its own language? You have to have some existing language to write your new compiler in. If you were writing a new, say, C++ compiler, you would just write it in C++ and compile it with an existing compiler first. On the other hand, if you were creating a compiler for a ne...
Bootstrapping still requires outside support I've heard of the idea of bootstrapping a language, that is, writing a compiler/interpreter for the language in itself. I was wondering how this could be accomplished and looked around a bit, and saw someone say that it could only be done by either writing an initial compile...
TITLE: Bootstrapping still requires outside support QUESTION: I've heard of the idea of bootstrapping a language, that is, writing a compiler/interpreter for the language in itself. I was wondering how this could be accomplished and looked around a bit, and saw someone say that it could only be done by either writing ...
[ "compiler-construction", "language-agnostic", "bootstrapping" ]
104
114
19,995
12
0
2008-08-17T06:46:11.210000
2008-08-17T07:20:55.103000
13,540
13,554
Insert Update stored proc on SQL Server
I've written a stored proc that will do an update if a record exists, otherwise it will do an insert. It looks something like this: update myTable set Col1=@col1, Col2=@col2 where ID=@ID if @@rowcount = 0 insert into myTable (Col1, Col2) values (@col1, @col2) My logic behind writing it in this way is that the update wi...
Your assumption is right, this is the optimal way to do it and it's called upsert/merge. Importance of UPSERT - from sqlservercentral.com: For every update in the case mentioned above we are removing one additional read from the table if we use the UPSERT instead of EXISTS. Unfortunately for an Insert, both the UPSERT ...
Insert Update stored proc on SQL Server I've written a stored proc that will do an update if a record exists, otherwise it will do an insert. It looks something like this: update myTable set Col1=@col1, Col2=@col2 where ID=@ID if @@rowcount = 0 insert into myTable (Col1, Col2) values (@col1, @col2) My logic behind writ...
TITLE: Insert Update stored proc on SQL Server QUESTION: I've written a stored proc that will do an update if a record exists, otherwise it will do an insert. It looks something like this: update myTable set Col1=@col1, Col2=@col2 where ID=@ID if @@rowcount = 0 insert into myTable (Col1, Col2) values (@col1, @col2) My...
[ "sql", "sql-server", "stored-procedures", "upsert" ]
112
63
55,488
9
0
2008-08-17T06:48:50.487000
2008-08-17T07:22:43.960000
13,545
16,139
.NET 3.5 SP1 and aspnet_client Crystal Reports
I recently (a few days ago) installed.NET 3.5 SP1 and subsequently an aspnet_client folder with a bunch of Crystal Reports support code has been injected into my.net web apps. Anybody else experienced this? Am I correct in saying that this is a side effect of SP1? What is this?
No it is a side effect of Crystal Reports. If you don't need it, remove it from your computer it is nothing but a headache. It is safe to delete the aspnet_client folder.
.NET 3.5 SP1 and aspnet_client Crystal Reports I recently (a few days ago) installed.NET 3.5 SP1 and subsequently an aspnet_client folder with a bunch of Crystal Reports support code has been injected into my.net web apps. Anybody else experienced this? Am I correct in saying that this is a side effect of SP1? What is ...
TITLE: .NET 3.5 SP1 and aspnet_client Crystal Reports QUESTION: I recently (a few days ago) installed.NET 3.5 SP1 and subsequently an aspnet_client folder with a bunch of Crystal Reports support code has been injected into my.net web apps. Anybody else experienced this? Am I correct in saying that this is a side effec...
[ ".net", "asp.net", ".net-3.5", "crystal-reports" ]
0
1
1,957
2
0
2008-08-17T07:00:25.677000
2008-08-19T13:20:16.953000
13,550
13,668
Productivity gains of using CASE tools for development
I was using a CASE called MAGIC for a system I'm developing, I've never used this kind of tool before and at first sight I liked, a month later I had a lot of the application generated, I felt very productive and... I would say... satisfied. In some way a felt uncomfortable, cause, there is no code and everything I was...
We use a CASE tool at my current company for code generation and we are trying to move away from it. The benefits that it brings - a graphical representation of the code making components 'easier' to pick up for new developers - are outweighed by the disadvantges in my opinion. Those main disadvantages are: We cannot d...
Productivity gains of using CASE tools for development I was using a CASE called MAGIC for a system I'm developing, I've never used this kind of tool before and at first sight I liked, a month later I had a lot of the application generated, I felt very productive and... I would say... satisfied. In some way a felt unco...
TITLE: Productivity gains of using CASE tools for development QUESTION: I was using a CASE called MAGIC for a system I'm developing, I've never used this kind of tool before and at first sight I liked, a month later I had a lot of the application generated, I felt very productive and... I would say... satisfied. In so...
[ "case-tools" ]
2
1
566
4
0
2008-08-17T07:08:41.383000
2008-08-17T15:21:50.513000
13,578
13,600
Determining how long the user is logged on to Windows
The need arose, in our product, to determine how long the current user has been logged on to Windows (specifically, Vista). It seems there is no straight forward API function for this and I couldn't find anything relevant with WMI (although I'm no expert with WMI, so I might have missed something). Any ideas?
For people not familiar with WMI (like me), here are some links: MSDN page on using WMI from various languages: http://msdn.microsoft.com/en-us/library/aa393964(VS.85).aspx reference about Win32_Session: http://msdn.microsoft.com/en-us/library/aa394422(VS.85).aspx, but the objects in Win32_session are of type Win32_Log...
Determining how long the user is logged on to Windows The need arose, in our product, to determine how long the current user has been logged on to Windows (specifically, Vista). It seems there is no straight forward API function for this and I couldn't find anything relevant with WMI (although I'm no expert with WMI, s...
TITLE: Determining how long the user is logged on to Windows QUESTION: The need arose, in our product, to determine how long the current user has been logged on to Windows (specifically, Vista). It seems there is no straight forward API function for this and I couldn't find anything relevant with WMI (although I'm no ...
[ "windows" ]
9
4
30,751
5
0
2008-08-17T10:22:25.877000
2008-08-17T12:24:51.310000
13,586
13,605
Interpreted languages - leveraging the compiled language behind the interpreter
If there are any language designers out there (or people simply in the know), I'm curious about the methodology behind creating standard libraries for interpreted languages. Specifically, what seems to be the best approach? Defining standard functions/methods in the interpreted language, or performing the processing of...
The line between "interpreted" and "compiled" languages is really fuzzy these days. For example, the first thing Python does when it sees source code is compile it into a bytecode representation, essentially the same as what Java does when compiling class files. This is what *.pyc files contain. Then, the python runtim...
Interpreted languages - leveraging the compiled language behind the interpreter If there are any language designers out there (or people simply in the know), I'm curious about the methodology behind creating standard libraries for interpreted languages. Specifically, what seems to be the best approach? Defining standar...
TITLE: Interpreted languages - leveraging the compiled language behind the interpreter QUESTION: If there are any language designers out there (or people simply in the know), I'm curious about the methodology behind creating standard libraries for interpreted languages. Specifically, what seems to be the best approach...
[ "performance", "language-agnostic", "language-features", "interpreted-language" ]
5
6
1,166
4
0
2008-08-17T11:12:51.813000
2008-08-17T12:39:58.860000
13,589
32,081
ASP.net AJAX Drag/Drop?
I wonder if someone knows if there is a pre-made solution for this: I have a List on an ASP.net Website, and I want that the User is able to re-sort the list through Drag and Drop. Additionally, I would love to have a second list to which the user can drag items from the first list onto. So far, I found two solutions: ...
The Mootools sortables plugin does just that, and best of all, it's free;) http://demos.mootools.net/Sortables
ASP.net AJAX Drag/Drop? I wonder if someone knows if there is a pre-made solution for this: I have a List on an ASP.net Website, and I want that the User is able to re-sort the list through Drag and Drop. Additionally, I would love to have a second list to which the user can drag items from the first list onto. So far,...
TITLE: ASP.net AJAX Drag/Drop? QUESTION: I wonder if someone knows if there is a pre-made solution for this: I have a List on an ASP.net Website, and I want that the User is able to re-sort the list through Drag and Drop. Additionally, I would love to have a second list to which the user can drag items from the first ...
[ "asp.net", "ajax" ]
2
2
5,723
4
0
2008-08-17T11:40:38.963000
2008-08-28T12:30:02.403000