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
202,971
202,997
Formula or API for calulating desktop icon spacing on Windows XP
I've built a simple application that applies grid-lines to an image or just simple colors for use as desktop wallpaper. The idea is that the desktop icons can be arranged within the grid. The problem is that depending on more things than I understand the actual spacing in pixels seems to be different from system to sys...
there are a 1001 ways to get/set this (but I only know 2):-D Windows Register: HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics values are IconSpacing and IconVerticalSpacing by code: using System.Management; public string GetWinIconSpace() { ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\...
Formula or API for calulating desktop icon spacing on Windows XP I've built a simple application that applies grid-lines to an image or just simple colors for use as desktop wallpaper. The idea is that the desktop icons can be arranged within the grid. The problem is that depending on more things than I understand the ...
TITLE: Formula or API for calulating desktop icon spacing on Windows XP QUESTION: I've built a simple application that applies grid-lines to an image or just simple colors for use as desktop wallpaper. The idea is that the desktop icons can be arranged within the grid. The problem is that depending on more things than...
[ "windows-xp", "desktop-wallpaper" ]
1
3
1,811
2
0
2008-10-14T21:43:21.207000
2008-10-14T21:55:27.030000
202,974
202,991
What is your version control and deployment workflow with Rails?
Especially when considering a fresh Rails project, what does your version control and deployment workflow look like? What tools do you use? I'm interested in answers for Mac, *nix and Windows work machines. Assume a *nix server. I'll edit for clarity if need be.
Create a copy of my personal Rails 2.1.1 template with preinstalled plugins and frozen gems. Change DB passwords, session secret/name and deploy.rb. Create a private or public repository on GitHub as needed. Push the empty rails project to GitHub. SSH to Server and configure apache (copy Virtual Host file and mongrel c...
What is your version control and deployment workflow with Rails? Especially when considering a fresh Rails project, what does your version control and deployment workflow look like? What tools do you use? I'm interested in answers for Mac, *nix and Windows work machines. Assume a *nix server. I'll edit for clarity if n...
TITLE: What is your version control and deployment workflow with Rails? QUESTION: Especially when considering a fresh Rails project, what does your version control and deployment workflow look like? What tools do you use? I'm interested in answers for Mac, *nix and Windows work machines. Assume a *nix server. I'll edi...
[ "ruby-on-rails", "ruby", "version-control", "deployment", "workflow" ]
13
11
1,569
3
0
2008-10-14T21:46:03.417000
2008-10-14T21:53:07.567000
202,990
232,876
Is there really no way to follow up dataset parent relation in xaml binding?
Suppose I have a dataset with those two immortal tables: Employee & Order Emp -> ID, Name Ord -> Something, Anotherthing, EmpID And relation Rel: Ord (EmpID) -> Emp (ID) It works great in standard master/detail scenario (show employees, follow down the relation, show related orders), but what when I wan't to go the opp...
If you want to synchronize the contents of multiple controls, you will need to have them share the same binding source through the DataContext set on a common parent control. Here is an example: Setting the IsSynchronizedWithCurrentItem property to 'True' will cause the ListBox.SelectedItem property to be automatically...
Is there really no way to follow up dataset parent relation in xaml binding? Suppose I have a dataset with those two immortal tables: Employee & Order Emp -> ID, Name Ord -> Something, Anotherthing, EmpID And relation Rel: Ord (EmpID) -> Emp (ID) It works great in standard master/detail scenario (show employees, follow...
TITLE: Is there really no way to follow up dataset parent relation in xaml binding? QUESTION: Suppose I have a dataset with those two immortal tables: Employee & Order Emp -> ID, Name Ord -> Something, Anotherthing, EmpID And relation Rel: Ord (EmpID) -> Emp (ID) It works great in standard master/detail scenario (show...
[ "wpf", "data-binding", "xaml", "dataset" ]
1
1
1,888
3
0
2008-10-14T21:51:28.803000
2008-10-24T08:56:43.573000
203,018
203,028
Counting instances of a class in the AppDomain
I wonder if there is a way to either programatically or using a third party tool (profiler?) get an overview of how many instances of a class are currently active in the AppDomain (including or excluding derived classes), and even better, where they are allocated (not sure if that is even possible). I know that I could...
I think what you would want to use is SOS and the Windows Debugging Toolkit. There is a great blog from Tess Ferandez which has tons of information on using it. http://blogs.msdn.com/tess/
Counting instances of a class in the AppDomain I wonder if there is a way to either programatically or using a third party tool (profiler?) get an overview of how many instances of a class are currently active in the AppDomain (including or excluding derived classes), and even better, where they are allocated (not sure...
TITLE: Counting instances of a class in the AppDomain QUESTION: I wonder if there is a way to either programatically or using a third party tool (profiler?) get an overview of how many instances of a class are currently active in the AppDomain (including or excluding derived classes), and even better, where they are a...
[ ".net", "appdomain" ]
1
4
234
3
0
2008-10-14T22:02:53.913000
2008-10-14T22:04:47.043000
203,022
203,850
How can I intercept the HTML from a ViewResult, modify it and serve it up?
I'm writing a simple CMS. I want to be able to load a View, having it included inside a master page, and then scan the HTML so that I can replace some custom tags (like {{blog}} with my own blog output) and then serve it up to the browser. How can I get access to the HTML from the ViewResult in order to intercept it?
Sounds like you want to write an ActionFilterAttribute. This attribute has the following methods: OnActionExecuting - called just before the decorated action is executed OnActionExecuted - called after the action method is called, but before the ActionResult is rendered. OnResultExecuting - callled before the result is...
How can I intercept the HTML from a ViewResult, modify it and serve it up? I'm writing a simple CMS. I want to be able to load a View, having it included inside a master page, and then scan the HTML so that I can replace some custom tags (like {{blog}} with my own blog output) and then serve it up to the browser. How c...
TITLE: How can I intercept the HTML from a ViewResult, modify it and serve it up? QUESTION: I'm writing a simple CMS. I want to be able to load a View, having it included inside a master page, and then scan the HTML so that I can replace some custom tags (like {{blog}} with my own blog output) and then serve it up to ...
[ "c#", "asp.net-mvc" ]
3
4
2,503
2
0
2008-10-14T22:03:54.533000
2008-10-15T06:17:58.560000
203,030
203,057
Best way to list files in Java, sorted by Date Modified?
I want to get a list of files in a directory, but I want to sort it such that the oldest files are first. My solution was to call File.listFiles and just resort the list based on File.lastModified, but I was wondering if there was a better way. Edit: My current solution, as suggested, is to use an anonymous Comparator:...
I think your solution is the only sensible way. The only way to get the list of files is to use File.listFiles() and the documentation states that this makes no guarantees about the order of the files returned. Therefore you need to write a Comparator that uses File.lastModified() and pass this, along with the array of...
Best way to list files in Java, sorted by Date Modified? I want to get a list of files in a directory, but I want to sort it such that the oldest files are first. My solution was to call File.listFiles and just resort the list based on File.lastModified, but I was wondering if there was a better way. Edit: My current s...
TITLE: Best way to list files in Java, sorted by Date Modified? QUESTION: I want to get a list of files in a directory, but I want to sort it such that the oldest files are first. My solution was to call File.listFiles and just resort the list based on File.lastModified, but I was wondering if there was a better way. ...
[ "java", "file", "sorting" ]
273
109
258,861
21
0
2008-10-14T22:04:56.200000
2008-10-14T22:12:55.687000
203,036
203,066
File security attributes getting screwed up on file copy
I've a windows service that updates our product. It copies the product files into a temp directory, usually "C:\Windows\Temp", patches the binaries, and then uses MoveFileEx to copy the files back to the install directory on a reboot, usually "C:\Program Files\Product". The files in the install directory are inheriting...
In Windows if you copy a file the file takes on the ACLs of the destination directory. If you move a file the ACL goes with it overriding any it might inherit from that directory. I'm not sure how MoveFileEx might operate differently on a file. The temp directory is usually located under the user profile (both %TMP% an...
File security attributes getting screwed up on file copy I've a windows service that updates our product. It copies the product files into a temp directory, usually "C:\Windows\Temp", patches the binaries, and then uses MoveFileEx to copy the files back to the install directory on a reboot, usually "C:\Program Files\Pr...
TITLE: File security attributes getting screwed up on file copy QUESTION: I've a windows service that updates our product. It copies the product files into a temp directory, usually "C:\Windows\Temp", patches the binaries, and then uses MoveFileEx to copy the files back to the install directory on a reboot, usually "C...
[ "windows", "winapi", "file", "copy", "acl" ]
3
4
2,063
2
0
2008-10-14T22:06:20.053000
2008-10-14T22:16:41.777000
203,040
203,290
Anybody know why SQL Server 2005 throws "'SQLOLEDB' failed with no error message available, result code: E_FAIL(0x80004005). "?
We've got a web system running SQL Server 2005 for the back end, and ASP.Net for the front end (using.net 2.0). Every now and then, the system barfs out the error in the title: 'SQLOLEDB' failed with no error message available, result code: E_FAIL(0x80004005). The web system runs just fine 24/7, and then every now and ...
Firstly, it's probably not SQL Server throwing out the error, and if it is, it's probably not while running the SQL statement itself, but if it is, it's almost certainly going to be peculiar to a login that doesn't have permissions, not the SQL command itself. The 0x80004005 error is a general permissions failure, and ...
Anybody know why SQL Server 2005 throws "'SQLOLEDB' failed with no error message available, result code: E_FAIL(0x80004005). "? We've got a web system running SQL Server 2005 for the back end, and ASP.Net for the front end (using.net 2.0). Every now and then, the system barfs out the error in the title: 'SQLOLEDB' fail...
TITLE: Anybody know why SQL Server 2005 throws "'SQLOLEDB' failed with no error message available, result code: E_FAIL(0x80004005). "? QUESTION: We've got a web system running SQL Server 2005 for the back end, and ASP.Net for the front end (using.net 2.0). Every now and then, the system barfs out the error in the titl...
[ "asp.net", "sql-server" ]
1
2
3,223
1
0
2008-10-14T22:07:55.463000
2008-10-15T00:08:28.307000
203,050
203,782
Best way of doing an SVn checkout/update on a web hosting package
I want to deploy my site on my web hosting package by doing a checkout through subversion. I do not have SSH access to my hosting package, which is just a basic LAMP web hosting package, but I do know that there is an SVN client installed on the web server. I was thinking of writing some sort of script (PHP or Shell) t...
The good news is that svn is very easily scriptable, but the bad news is that you are likely to have a difficult time without shell access. If you do this without shell access, be careful of anything that can change a file in a directory under svn. This can lead to conflicts between working copy and latest version and ...
Best way of doing an SVn checkout/update on a web hosting package I want to deploy my site on my web hosting package by doing a checkout through subversion. I do not have SSH access to my hosting package, which is just a basic LAMP web hosting package, but I do know that there is an SVN client installed on the web serv...
TITLE: Best way of doing an SVn checkout/update on a web hosting package QUESTION: I want to deploy my site on my web hosting package by doing a checkout through subversion. I do not have SSH access to my hosting package, which is just a basic LAMP web hosting package, but I do know that there is an SVN client install...
[ "svn", "deployment" ]
0
2
2,536
2
0
2008-10-14T22:11:36.313000
2008-10-15T05:11:59.427000
203,054
203,059
Saving the time the user is logged on
In the application I am developing I have to store the time some particular users remain logged into the application, unfortunately, in web applications, there are several ways the user can log off. User clicks log off. User session expires. User closes the window. User types another site URL in the address bar. The fi...
On each page view, update your count. If they log out, then you've got an accurate measure. If they navigate away, or any other method, then the most that you're out is the length of time they were on one page. If it were really really important to have an accurate measure, then perhaps an AJAX "heartbeat" every minute...
Saving the time the user is logged on In the application I am developing I have to store the time some particular users remain logged into the application, unfortunately, in web applications, there are several ways the user can log off. User clicks log off. User session expires. User closes the window. User types anoth...
TITLE: Saving the time the user is logged on QUESTION: In the application I am developing I have to store the time some particular users remain logged into the application, unfortunately, in web applications, there are several ways the user can log off. User clicks log off. User session expires. User closes the window...
[ "javascript", "time", "frontend", "logoff" ]
6
8
321
2
0
2008-10-14T22:12:24.283000
2008-10-14T22:14:36.727000
203,058
203,111
How can I overcome the "error C2100: illegal indirection" when accessing the contents of a void* in VS2008
I have a C application that I've created in VS2008. I am creating a mock creation function that overrides function references in a struct. However if I try and do this in a straight forward fashion with something like: void *ptr = &(*env)->GetVersion; *ptr = then I get a "error C2100: illegal indirection" error as *ptr...
Then how about: void **ptr = (void **) &(*env)->GetVersion; *ptr = The right way to do this is to work with the type system, avoid all the casting and declare actual pointers to functions like: typedef int (*fncPtr)(void); fncPtr *ptr = &(*env)->GetVersion; *ptr = NewFunction; The above assumes GetVersion is of type fn...
How can I overcome the "error C2100: illegal indirection" when accessing the contents of a void* in VS2008 I have a C application that I've created in VS2008. I am creating a mock creation function that overrides function references in a struct. However if I try and do this in a straight forward fashion with something ...
TITLE: How can I overcome the "error C2100: illegal indirection" when accessing the contents of a void* in VS2008 QUESTION: I have a C application that I've created in VS2008. I am creating a mock creation function that overrides function references in a struct. However if I try and do this in a straight forward fashi...
[ "c", "visual-studio-2008" ]
4
4
18,480
4
0
2008-10-14T22:13:35.700000
2008-10-14T22:33:19.357000
203,061
203,584
How to run a program in 32-bit mode on Vista 64?
I am building an app that talks to an Access database via OleDB/Jet. There is only a 32-bit Jet provider, no 64-bit provider, so the app needs to be running in 32-bit mode. My dev box is Vista 64, so I set the project to build for x86 instead of any cpu. That gets my app running and talking to the database. But now I w...
Turns out the trick was using CorFlags.exe to mark Gallio.Host.exe as 32bit only.
How to run a program in 32-bit mode on Vista 64? I am building an app that talks to an Access database via OleDB/Jet. There is only a 32-bit Jet provider, no 64-bit provider, so the app needs to be running in 32-bit mode. My dev box is Vista 64, so I set the project to build for x86 instead of any cpu. That gets my app...
TITLE: How to run a program in 32-bit mode on Vista 64? QUESTION: I am building an app that talks to an Access database via OleDB/Jet. There is only a 32-bit Jet provider, no 64-bit provider, so the app needs to be running in 32-bit mode. My dev box is Vista 64, so I set the project to build for x86 instead of any cpu...
[ ".net", "64-bit" ]
1
3
9,785
3
0
2008-10-14T22:15:03.483000
2008-10-15T03:03:37.457000
203,068
208,086
XMLSocket working in firefox but not IE
I'm helping a customer who has a problem with a flash app. The flash app uses an XMLSocket to connect to a service running on localhost. It works fine under firefox. It uses the following line to setup the security policy: System.security.loadPolicyFile("xmlsocket://localhost:10032"); Running the flash app under firefo...
Are you certain the exact same version of flash is running on both browsers? The requirements for network security seem to have changed significantly between versions. It's entirely possible to have different versions of flash player installed into IE and firefox as one is an activeX control and the other a browser plu...
XMLSocket working in firefox but not IE I'm helping a customer who has a problem with a flash app. The flash app uses an XMLSocket to connect to a service running on localhost. It works fine under firefox. It uses the following line to setup the security policy: System.security.loadPolicyFile("xmlsocket://localhost:100...
TITLE: XMLSocket working in firefox but not IE QUESTION: I'm helping a customer who has a problem with a flash app. The flash app uses an XMLSocket to connect to a service running on localhost. It works fine under firefox. It uses the following line to setup the security policy: System.security.loadPolicyFile("xmlsock...
[ "flash", "internet-explorer", "firefox", "actionscript", "xmlsocket" ]
0
1
1,187
2
0
2008-10-14T22:17:07.160000
2008-10-16T10:52:03.220000
203,069
203,133
What is the best CSS Framework and are they worth the effort?
Reading on another forum I've came across the world of CSS Frameworks. The one I've been specifically looking at is BluePrint. I was wondering if anyone else had come across CSS frameworks, suggest which is the best and if they are worth the effort?
CSS 'frameworks' are completely missing the point. CSS is not like JavaScript, where you can include a base library/framework and then call functions and objects from it to do higher-level work. All a CSS framework can give you is declarative rules: some default browser-rule-reset stuff, some class styles to be forced ...
What is the best CSS Framework and are they worth the effort? Reading on another forum I've came across the world of CSS Frameworks. The one I've been specifically looking at is BluePrint. I was wondering if anyone else had come across CSS frameworks, suggest which is the best and if they are worth the effort?
TITLE: What is the best CSS Framework and are they worth the effort? QUESTION: Reading on another forum I've came across the world of CSS Frameworks. The one I've been specifically looking at is BluePrint. I was wondering if anyone else had come across CSS frameworks, suggest which is the best and if they are worth th...
[ "css", "css-frameworks" ]
106
140
43,934
23
0
2008-10-14T22:17:26.847000
2008-10-14T22:45:21.987000
203,075
203,176
Should I use "glass box" testing when it leads to *fewer* tests?
For example, I'm writing tests against a CsvReader. It's a simple class that enumerates and splits rows of text. Its only raison d'être is ignoring commas within quotes. It's less than a page. By "black box" testing the class, I've checked things like What if the file doesn't exist? What if I don't have permission on t...
This really depends on the interface of your CsvReader, you need to consider what the user of the class is expecting. For example, if one of the parameters is a file name and the file does not exist what should happen? This should not be dependent upon whether you use a stream reader or not. The unit tests should test ...
Should I use "glass box" testing when it leads to *fewer* tests? For example, I'm writing tests against a CsvReader. It's a simple class that enumerates and splits rows of text. Its only raison d'être is ignoring commas within quotes. It's less than a page. By "black box" testing the class, I've checked things like Wha...
TITLE: Should I use "glass box" testing when it leads to *fewer* tests? QUESTION: For example, I'm writing tests against a CsvReader. It's a simple class that enumerates and splits rows of text. Its only raison d'être is ignoring commas within quotes. It's less than a page. By "black box" testing the class, I've check...
[ "unit-testing", "black-box", "white-box" ]
3
3
692
6
0
2008-10-14T22:21:31.097000
2008-10-14T23:11:18.250000
203,085
203,092
C# for 64bit OS?
How can I make my compilation optimized for Windows 64 bit?
A managed project is automatically built according to the architecture selected => default C# project created on AMD64 will be AMD64, X86 on X86. The native one is always 32-bit by default. To explicitly set a platform: 1 open the solution explorer, select solution, right click->Configuration Manager. 2 go to 'Active S...
C# for 64bit OS? How can I make my compilation optimized for Windows 64 bit?
TITLE: C# for 64bit OS? QUESTION: How can I make my compilation optimized for Windows 64 bit? ANSWER: A managed project is automatically built according to the architecture selected => default C# project created on AMD64 will be AMD64, X86 on X86. The native one is always 32-bit by default. To explicitly set a platfo...
[ "c#", ".net", "64-bit" ]
2
4
4,315
4
0
2008-10-14T22:24:09.097000
2008-10-14T22:25:39.793000
203,090
203,116
How do I get current date/time on the Windows command line in a suitable format for usage in a file/folder name?
Update: Now that it's 2016 I'd use PowerShell for this unless there's a really compelling backwards-compatible reason for it, particularly because of the regional settings issue with using date. See @npocmaka's https://stackoverflow.com/a/19799236/8479 What's a Windows command line statement(s) I can use to get the cur...
See Windows Batch File (.bat) to get current date in MMDDYYYY format: @echo off For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b) For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a%%b) echo %mydate%_%mytime% If you prefer the time in 24 hour/military format, you can replace t...
How do I get current date/time on the Windows command line in a suitable format for usage in a file/folder name? Update: Now that it's 2016 I'd use PowerShell for this unless there's a really compelling backwards-compatible reason for it, particularly because of the regional settings issue with using date. See @npocmak...
TITLE: How do I get current date/time on the Windows command line in a suitable format for usage in a file/folder name? QUESTION: Update: Now that it's 2016 I'd use PowerShell for this unless there's a really compelling backwards-compatible reason for it, particularly because of the regional settings issue with using ...
[ "windows", "datetime", "batch-file", "cmd" ]
637
745
1,729,113
30
0
2008-10-14T22:25:34.303000
2008-10-14T22:36:53.733000
203,096
227,658
Interop Controls not picking up XP Styles
I created an Interop user control in VS2005. When the user control is shown inside VB6, it does not pickup/use the XP styles (The buttons and the tabs look like VB6 buttons/tabs). How do I get the XP styles to work with my control while it is in VB6?
The manifest file only works for earlier versions of.net and after.net 1.1 you can activate them programmatically. I had to add the line Application.EnableVisualStyles() in the default constructor of the interop user control. Public Sub New() Application.EnableVisualStyles() '-- I added this line ' This call is require...
Interop Controls not picking up XP Styles I created an Interop user control in VS2005. When the user control is shown inside VB6, it does not pickup/use the XP styles (The buttons and the tabs look like VB6 buttons/tabs). How do I get the XP styles to work with my control while it is in VB6?
TITLE: Interop Controls not picking up XP Styles QUESTION: I created an Interop user control in VS2005. When the user control is shown inside VB6, it does not pickup/use the XP styles (The buttons and the tabs look like VB6 buttons/tabs). How do I get the XP styles to work with my control while it is in VB6? ANSWER: ...
[ ".net", "winforms", "vb6", "interop" ]
1
1
286
2
0
2008-10-14T22:27:23.410000
2008-10-22T21:45:52.040000
203,117
209,240
WCF - NetTcp and basicHttp with SSL in single setup possible without IIS7
Is it possible to have both NetTcp bound endpoints, and basicHttp bound endpoints with SSL within a single deployment, either using Windows Service or IIS6?
Yes, a single service host can expose multiple endpoints with different bindings. However, normal IIS restrictions apply to IIS, so IIS 6 doesn't support NetTcp bindings to begin with.
WCF - NetTcp and basicHttp with SSL in single setup possible without IIS7 Is it possible to have both NetTcp bound endpoints, and basicHttp bound endpoints with SSL within a single deployment, either using Windows Service or IIS6?
TITLE: WCF - NetTcp and basicHttp with SSL in single setup possible without IIS7 QUESTION: Is it possible to have both NetTcp bound endpoints, and basicHttp bound endpoints with SSL within a single deployment, either using Windows Service or IIS6? ANSWER: Yes, a single service host can expose multiple endpoints with ...
[ ".net", "asp.net", "wcf" ]
0
1
1,045
2
0
2008-10-14T22:37:30.580000
2008-10-16T16:07:03.660000
203,126
203,136
How does the C++ compiler know which implementation of a virtual function to call?
Here is an example of polymorphism from http://www.cplusplus.com/doc/tutorial/polymorphism.html (edited for readability): // abstract base class #include using namespace std; class Polygon { protected: int width; int height; public: void set_values(int a, int b) { width = a; height = b; } virtual int area(void) =0; };...
Each object (that belongs to a class with at least one virtual function) has a pointer, called a vptr. It points to the vtbl of its actual class (which each class with virtual functions has at least one of; possibly more than one for some multiple-inheritance scenarios). The vtbl contains a bunch of pointers, one for e...
How does the C++ compiler know which implementation of a virtual function to call? Here is an example of polymorphism from http://www.cplusplus.com/doc/tutorial/polymorphism.html (edited for readability): // abstract base class #include using namespace std; class Polygon { protected: int width; int height; public: voi...
TITLE: How does the C++ compiler know which implementation of a virtual function to call? QUESTION: Here is an example of polymorphism from http://www.cplusplus.com/doc/tutorial/polymorphism.html (edited for readability): // abstract base class #include using namespace std; class Polygon { protected: int width; int h...
[ "c++", "oop", "polymorphism" ]
11
27
6,997
6
0
2008-10-14T22:43:23.767000
2008-10-14T22:46:42.170000
203,147
203,160
Is it possible to convert between Socket and TcpClient objects?
Here's another C#/.NET question based merely on curiousity more than an immediate need... If you had a Socket instance and you wanted to wrap it in the higher-level TcpClient class, is that possible and how would you do it? Conversely if you have an instance of TcpClient, is it possible to get the underlying Socket?
If you had a Socket instance and you wanted to wrap it in the higher-level TcpClient class, is that possible and how would you do it? Socket socket =...; TcpClient client = new TcpClient(); client.Client = socket; Conversely if you have an instance of TcpClient, is it possible to get the underlying Socket? Get the unde...
Is it possible to convert between Socket and TcpClient objects? Here's another C#/.NET question based merely on curiousity more than an immediate need... If you had a Socket instance and you wanted to wrap it in the higher-level TcpClient class, is that possible and how would you do it? Conversely if you have an instan...
TITLE: Is it possible to convert between Socket and TcpClient objects? QUESTION: Here's another C#/.NET question based merely on curiousity more than an immediate need... If you had a Socket instance and you wanted to wrap it in the higher-level TcpClient class, is that possible and how would you do it? Conversely if ...
[ "c#", ".net", "sockets", "tcpclient", "system.net" ]
13
31
12,214
2
0
2008-10-14T22:49:45.470000
2008-10-14T23:00:07.260000
203,151
203,365
Prevent series from using clWhite with Delphi TChart
I have a report that uses a TChart that I am maintaining. One of the TLineSeries that gets added automatically gets assigned the color clWhite, which is too close to the background (clBtnFace). If I change it, then the next series that gets added takes clWhite. So short of going back and changing it after all the other...
OK not one to give up easily, I did some more searching. There is a unit variable called ColorPalette of type TColorArray in the TeeProcs unit. If I find and replace white with a different color that fixes it. There may be an instance copy of it. I'll keep looking since that would be preferred. To revert the ColorPalet...
Prevent series from using clWhite with Delphi TChart I have a report that uses a TChart that I am maintaining. One of the TLineSeries that gets added automatically gets assigned the color clWhite, which is too close to the background (clBtnFace). If I change it, then the next series that gets added takes clWhite. So sh...
TITLE: Prevent series from using clWhite with Delphi TChart QUESTION: I have a report that uses a TChart that I am maintaining. One of the TLineSeries that gets added automatically gets assigned the color clWhite, which is too close to the background (clBtnFace). If I change it, then the next series that gets added ta...
[ "delphi", "charts", "colors", "teechart" ]
2
6
2,978
3
0
2008-10-14T22:55:21.420000
2008-10-15T00:49:11.017000
203,161
204,039
How to get around a 'NS_ERROR_ILLEGAL_VALUE' error using Ajax?
Im just writing a small Ajax framework for re-usability in small projects and i've hit a problem. Basically i get a ' NS_ERROR_ILLEGAL_VALUE ' error while sending the request and i've no idea what is happening. The HTML Page (trimmed but shows the error) Ajax Test The PHP File: PROLOG; $XML.= " "; $XML.= " "; $XML.= "...
The exception "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE)" is caused by an illegal value being passed into the call of open method. Looking through your code I found misspelling: this.RequestedMethod = p_RequestMethod; this.DestinationURL = p_DestinationURL; this.XMLHttpRequestObject.open(thi...
How to get around a 'NS_ERROR_ILLEGAL_VALUE' error using Ajax? Im just writing a small Ajax framework for re-usability in small projects and i've hit a problem. Basically i get a ' NS_ERROR_ILLEGAL_VALUE ' error while sending the request and i've no idea what is happening. The HTML Page (trimmed but shows the error) Aj...
TITLE: How to get around a 'NS_ERROR_ILLEGAL_VALUE' error using Ajax? QUESTION: Im just writing a small Ajax framework for re-usability in small projects and i've hit a problem. Basically i get a ' NS_ERROR_ILLEGAL_VALUE ' error while sending the request and i've no idea what is happening. The HTML Page (trimmed but s...
[ "javascript", "ajax" ]
10
7
32,986
2
0
2008-10-14T23:00:13.547000
2008-10-15T08:33:41.767000
203,171
203,179
Bookmarklet link in Markdown document
How can I include a bookmarklet in a Markdown parsed document? Is there any "tag" for markdown that basically says "don't parse this"?? For example you could have something like: Hello But if I try to past the javascript from that into a link in markdown like this: [Hello World!](javascript:function my_bookmarklet(){al...
Markdown will leave any HTML alone, so you can just enter Hello and get Hello. Edit: No longer works on SO, which is a good thing You can also escape special characters with a backslash (in this case it's seeing the ")"s in your Javascript as the end of the URL) and the link syntax will work: [Hello](javascript:functio...
Bookmarklet link in Markdown document How can I include a bookmarklet in a Markdown parsed document? Is there any "tag" for markdown that basically says "don't parse this"?? For example you could have something like: Hello But if I try to past the javascript from that into a link in markdown like this: [Hello World!](j...
TITLE: Bookmarklet link in Markdown document QUESTION: How can I include a bookmarklet in a Markdown parsed document? Is there any "tag" for markdown that basically says "don't parse this"?? For example you could have something like: Hello But if I try to past the javascript from that into a link in markdown like this...
[ "markdown", "bookmarklet" ]
18
6
6,678
3
0
2008-10-14T23:07:45.683000
2008-10-14T23:14:03.333000
203,172
261,472
How to get doxygen to run faster?
Doxygen is a bit slow - it takes about a couple of minutes to process my whole project, so for small incremental changes this is longer than actually building the rest of my code. There are thousands of files without any documentation so I guess it is spending most of its time processing them. Is there any way to get i...
From Doxygen documentation: How can I exclude all test directories from my directory tree? Simply put an exclude pattern like this in the configuration file: EXCLUDE_PATTERNS = /test/ So, you should be using patterns to exclude files. It's been a long time since I've used Doxygen, but i don't remember any option to pro...
How to get doxygen to run faster? Doxygen is a bit slow - it takes about a couple of minutes to process my whole project, so for small incremental changes this is longer than actually building the rest of my code. There are thousands of files without any documentation so I guess it is spending most of its time processi...
TITLE: How to get doxygen to run faster? QUESTION: Doxygen is a bit slow - it takes about a couple of minutes to process my whole project, so for small incremental changes this is longer than actually building the rest of my code. There are thousands of files without any documentation so I guess it is spending most of...
[ "build-process", "doxygen" ]
22
13
10,218
5
0
2008-10-14T23:09:34.307000
2008-11-04T10:34:39.303000
203,174
257,001
Is there a Java API that can create rich Word documents?
I have a new app I'll be working on where I have to generate a Word document that contains tables, graphs, a table of contents and text. What's a good API to use for this? How sure are you that it supports graphs, ToCs, and tables? What are some hidden gotcha's in using them? Some clarifications: I can't output a PDF, ...
In 2007 my project successfully used OpenOffice.org's Universal Network Objects (UNO) interface to programmatically generate MS-Word compatible documents (*.doc), as well as corresponding PDF documents, from a Java Web application (a Struts/JSP framework). OpenOffice UNO also lets you build MS-Office-compatible charts,...
Is there a Java API that can create rich Word documents? I have a new app I'll be working on where I have to generate a Word document that contains tables, graphs, a table of contents and text. What's a good API to use for this? How sure are you that it supports graphs, ToCs, and tables? What are some hidden gotcha's i...
TITLE: Is there a Java API that can create rich Word documents? QUESTION: I have a new app I'll be working on where I have to generate a Word document that contains tables, graphs, a table of contents and text. What's a good API to use for this? How sure are you that it supports graphs, ToCs, and tables? What are some...
[ "java", "ms-word", "docx", "doc" ]
113
56
156,691
16
0
2008-10-14T23:09:59.847000
2008-11-02T16:05:55.173000
203,180
203,552
compiling only part of the source tree with ant
Say I have my sources in my src/ tree (and possibly in my test/ tree). Say I would like to compile only part of that tree. The reasons why I might want to do that are various. Just as an example, I might want to create the smallest possible jar (without including certain classes), or I might want the fastest compile ti...
Why are you excluding as well as including? If you have at least one include, then files are only compiled if they're explicitly included. So this should work: Or more flexibly: To include only certain packages or classes in a jar, use a fileset attribute Again, you can use multiple includes to combine separate package...
compiling only part of the source tree with ant Say I have my sources in my src/ tree (and possibly in my test/ tree). Say I would like to compile only part of that tree. The reasons why I might want to do that are various. Just as an example, I might want to create the smallest possible jar (without including certain ...
TITLE: compiling only part of the source tree with ant QUESTION: Say I have my sources in my src/ tree (and possibly in my test/ tree). Say I would like to compile only part of that tree. The reasons why I might want to do that are various. Just as an example, I might want to create the smallest possible jar (without ...
[ "java", "ant", "jar", "javac" ]
10
13
15,242
4
0
2008-10-14T23:14:03.580000
2008-10-15T02:39:07.927000
203,188
203,271
Integrating "really simple history" with Rails
In trying to solve the "ajax back button" problem I have found the Really Simply History library. Has anyone tried to integrate it with Rails? It's plain old javascript so it seems like it should integrate just fine, but I know next to nothing about JS itself, so I'm not too confident in trying to do the integration wi...
this blog (which doesn't show up at all when i google or search yahoo for "Rails really simple history"
Integrating "really simple history" with Rails In trying to solve the "ajax back button" problem I have found the Really Simply History library. Has anyone tried to integrate it with Rails? It's plain old javascript so it seems like it should integrate just fine, but I know next to nothing about JS itself, so I'm not t...
TITLE: Integrating "really simple history" with Rails QUESTION: In trying to solve the "ajax back button" problem I have found the Really Simply History library. Has anyone tried to integrate it with Rails? It's plain old javascript so it seems like it should integrate just fine, but I know next to nothing about JS it...
[ "javascript", "ruby-on-rails", "ajax" ]
0
2
781
1
0
2008-10-14T23:18:01.233000
2008-10-15T00:01:15.030000
203,193
203,251
Good image gallery engines
What are the best open source image gallery engines? Both stand-alone, and for existing frameworks such as Wordpress or Drupal. Hopefully we can build a good list here over time.
Gallery is the classic choice. It has skins, security layers, heaps of plugins, etc, but can be run with the default settings easily if you want to. I've used it for years.
Good image gallery engines What are the best open source image gallery engines? Both stand-alone, and for existing frameworks such as Wordpress or Drupal. Hopefully we can build a good list here over time.
TITLE: Good image gallery engines QUESTION: What are the best open source image gallery engines? Both stand-alone, and for existing frameworks such as Wordpress or Drupal. Hopefully we can build a good list here over time. ANSWER: Gallery is the classic choice. It has skins, security layers, heaps of plugins, etc, bu...
[ "graphics", "image-gallery" ]
3
4
658
2
0
2008-10-14T23:21:07.547000
2008-10-14T23:49:24.087000
203,194
205,350
using a named function as the callback for $.getJSON in jQuery to satisfy Facebook request signing demands
I'm trying to access the Facebook API Admin.getMetrics method via jQuery. I'm correctly composing the request url on the server side (in order to keep my app secret secret). I'm then sending the url over to the browser to be request using jQuery.getJSON(). Facebook requires that I send a copy of all of my request param...
The use of jQuery.getScript turned out to be close to -- but not quite -- the answer. Using getScript eliminates jQuery's need to add the dynamically named anonymous function to the request params (though it will still do that if you go ahead and pass it an anonymous function as in the above code). However, the default...
using a named function as the callback for $.getJSON in jQuery to satisfy Facebook request signing demands I'm trying to access the Facebook API Admin.getMetrics method via jQuery. I'm correctly composing the request url on the server side (in order to keep my app secret secret). I'm then sending the url over to the br...
TITLE: using a named function as the callback for $.getJSON in jQuery to satisfy Facebook request signing demands QUESTION: I'm trying to access the Facebook API Admin.getMetrics method via jQuery. I'm correctly composing the request url on the server side (in order to keep my app secret secret). I'm then sending the ...
[ "javascript", "jquery", "json", "facebook", "jsonp" ]
4
3
12,101
4
0
2008-10-14T23:21:23.957000
2008-10-15T16:12:22.370000
203,195
657,693
How to detect VC++ 2008 redistributable?
Is there a Registry setting that I can look for to determine whether or not the Visual C++ redistributable is installed, whether standalone or as part of Visual Studio 2008? I know that I could launch the VC++ 2008 redistributable installer and let it handle the detection, but it would look cleaner if I can check for i...
Check the registry: VC++2008 (sp1): HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3C3D696B-0DB7-3C6D-A356-3DB8CE541918} or VC++2008 (original): HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FF66E9F6-83E7-3A3E-AF14-8DE9A809A6A4}
How to detect VC++ 2008 redistributable? Is there a Registry setting that I can look for to determine whether or not the Visual C++ redistributable is installed, whether standalone or as part of Visual Studio 2008? I know that I could launch the VC++ 2008 redistributable installer and let it handle the detection, but i...
TITLE: How to detect VC++ 2008 redistributable? QUESTION: Is there a Registry setting that I can look for to determine whether or not the Visual C++ redistributable is installed, whether standalone or as part of Visual Studio 2008? I know that I could launch the VC++ 2008 redistributable installer and let it handle th...
[ "visual-c++", "redistributable" ]
33
16
62,367
13
0
2008-10-14T23:22:07.420000
2009-03-18T10:24:32.293000
203,198
1,207,393
Event binding on dynamically created elements?
I have a bit of code where I am looping through all the select boxes on a page and binding a.hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on page ready and works just fine. The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have ...
As of jQuery 1.7 you should use jQuery.fn.on with the selector parameter filled: $(staticAncestors).on(eventName, dynamicChild, function() {}); Explanation: This is called event delegation and works as followed. The event is attached to a static parent ( staticAncestors ) of the element that should be handled. This jQu...
Event binding on dynamically created elements? I have a bit of code where I am looping through all the select boxes on a page and binding a.hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on page ready and works just fine. The problem I have is that any select boxes I add via...
TITLE: Event binding on dynamically created elements? QUESTION: I have a bit of code where I am looping through all the select boxes on a page and binding a.hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on page ready and works just fine. The problem I have is that any sele...
[ "javascript", "jquery", "events", "unobtrusive-javascript" ]
1,675
2,566
1,084,953
23
0
2008-10-14T23:25:19.113000
2009-07-30T15:34:49.733000
203,199
203,213
Is it possible to get Message Box in web forms?
I tried but I guess Message Box only works with win forms. What is the best alternative to use in web forms?
You can use confirm for yes/no questions and alert for "OK" messages in JavaScript. The other alternative is to use JavaScript to pop up a new window that looks and acts like a message box. Modality in this case varied by browser. In Internet Explorer, the method window.showModalDialog(url,name,params) will display a m...
Is it possible to get Message Box in web forms? I tried but I guess Message Box only works with win forms. What is the best alternative to use in web forms?
TITLE: Is it possible to get Message Box in web forms? QUESTION: I tried but I guess Message Box only works with win forms. What is the best alternative to use in web forms? ANSWER: You can use confirm for yes/no questions and alert for "OK" messages in JavaScript. The other alternative is to use JavaScript to pop up...
[ "javascript", "user-interface", "dialog" ]
0
6
790
5
0
2008-10-14T23:25:28.567000
2008-10-14T23:29:34.347000
203,200
203,219
Undo changes to SQL Server 2005 database
I've ran some "ALTER" scripts on the database [SQL Server Server 2005], and overwrote some sprocs. Is there any way to undo changes and get my old sprocs back? Is there a way to get the scripts that were executed out of the.LDf file? That way i can re-run my initial "create" script for my sprocs. I don't have a backup ...
FIRST: DO NOT TAKE ANY BACKUPS JUST YET. There are several tools on the market to do this sort of thing. You might try this one: ApexSQL Log
Undo changes to SQL Server 2005 database I've ran some "ALTER" scripts on the database [SQL Server Server 2005], and overwrote some sprocs. Is there any way to undo changes and get my old sprocs back? Is there a way to get the scripts that were executed out of the.LDf file? That way i can re-run my initial "create" scr...
TITLE: Undo changes to SQL Server 2005 database QUESTION: I've ran some "ALTER" scripts on the database [SQL Server Server 2005], and overwrote some sprocs. Is there any way to undo changes and get my old sprocs back? Is there a way to get the scripts that were executed out of the.LDf file? That way i can re-run my in...
[ "sql", "sql-server", "sql-server-2005", "recovery" ]
2
4
1,882
4
0
2008-10-14T23:25:48.830000
2008-10-14T23:31:35.997000
203,208
203,245
CSS Browser Support Chart
Is there any resource that provides a chart of CSS properties and their support through most browser/OS combinations? For example, if I want to know what browser supports overflow or min-height and any quirks to be aware of in the implementation of these properties and their values, what is the best place to get all th...
http://www.quirksmode.org/css/contents.html Quriks mode is also a really good resource for this sort of information.
CSS Browser Support Chart Is there any resource that provides a chart of CSS properties and their support through most browser/OS combinations? For example, if I want to know what browser supports overflow or min-height and any quirks to be aware of in the implementation of these properties and their values, what is th...
TITLE: CSS Browser Support Chart QUESTION: Is there any resource that provides a chart of CSS properties and their support through most browser/OS combinations? For example, if I want to know what browser supports overflow or min-height and any quirks to be aware of in the implementation of these properties and their ...
[ "css", "browser", "cross-browser" ]
7
22
8,987
4
0
2008-10-14T23:27:47.330000
2008-10-14T23:46:50.800000
203,229
5,398,120
Preventing copy protection circumvention
Anyone visiting a torrent tracker is sure to find droves of "cracked" programs ranging from simple shareware to software suites costing thousands of dollars. It seems that as long as the program does not rely on a remote service (e.g. an MMORPG) that any built-in copy protection or user authentication is useless. Is it...
Sorry to bust in on an ancient thread, but this is what we do for a living and we're really really good at it. It's all we do. So some of the information here is wrong and I want to set the record straight. Theoretically uncrackable protection is not only possible it's what we sell. The basic model the major copy prote...
Preventing copy protection circumvention Anyone visiting a torrent tracker is sure to find droves of "cracked" programs ranging from simple shareware to software suites costing thousands of dollars. It seems that as long as the program does not rely on a remote service (e.g. an MMORPG) that any built-in copy protection...
TITLE: Preventing copy protection circumvention QUESTION: Anyone visiting a torrent tracker is sure to find droves of "cracked" programs ranging from simple shareware to software suites costing thousands of dollars. It seems that as long as the program does not rely on a remote service (e.g. an MMORPG) that any built-...
[ "drm", "copy-protection" ]
16
7
4,830
18
0
2008-10-14T23:37:33.533000
2011-03-22T21:35:21.720000
203,246
203,289
How can I keep a console open until CancelKeyPress event is fired?
What is the best way to keep a console application open as long as the CancelKeyPress event has not been fired? I would prefer to not use Console.Read or Console.ReadLine as I do not want to accept input. I just want to enable the underlying application to print to the console event details as they are fired. Then once...
I'm assuming that "gracefully shut down the application" is the part you are struggling with here. Otherwise your application will automatically exit on ctrl-c. You should change the title. Here's a quick demo of what I think you need. It could be refined a bit more with use of locking and Monitors for notification. I'...
How can I keep a console open until CancelKeyPress event is fired? What is the best way to keep a console application open as long as the CancelKeyPress event has not been fired? I would prefer to not use Console.Read or Console.ReadLine as I do not want to accept input. I just want to enable the underlying application...
TITLE: How can I keep a console open until CancelKeyPress event is fired? QUESTION: What is the best way to keep a console application open as long as the CancelKeyPress event has not been fired? I would prefer to not use Console.Read or Console.ReadLine as I do not want to accept input. I just want to enable the unde...
[ "c#", ".net", "console" ]
9
13
24,352
5
0
2008-10-14T23:47:05.700000
2008-10-15T00:08:11.617000
203,254
212,405
What's the best audio compression library for .NET?
I'm looking for a good audio compression library for.NET. Anything using MP3 is out (because of the licensing issue). Basically I just need to be able to compress regular WAV audio data into some format, and decompress back to WAV. Preferably the code would be all.NET (C# or VB.NET), but I don't think this is likely. I...
Have you thought about using WMA? If you use managed C++ or C++/CLI it's very easy to write a managed wrapper around the Windows Media Format SDK. This assembly can then be easily used by a higher level VB.Net or C# assembly. As long as you have WMP installed it even has the advantage of not requiring any additional de...
What's the best audio compression library for .NET? I'm looking for a good audio compression library for.NET. Anything using MP3 is out (because of the licensing issue). Basically I just need to be able to compress regular WAV audio data into some format, and decompress back to WAV. Preferably the code would be all.NET...
TITLE: What's the best audio compression library for .NET? QUESTION: I'm looking for a good audio compression library for.NET. Anything using MP3 is out (because of the licensing issue). Basically I just need to be able to compress regular WAV audio data into some format, and decompress back to WAV. Preferably the cod...
[ "c#", ".net", "vb.net", "audio", "compression" ]
4
3
8,332
6
0
2008-10-14T23:50:56.160000
2008-10-17T14:34:05.097000
203,274
203,298
CSS Performance
Usually when I build a site, I put all the CSS into one file, and all the properties that relate to a set of elements are defined at once. Like this: #myElement { color: #fff; background-color: #000; padding: 10px; border: 1px solid #ccc; font-size: 14pt; }.myClass { font-size: 12pt; padding: 5px; color: #ee3; } I've b...
The browser will have to find all the definitions and then add them up and override the different properties based on the latest definition. So there will be a slight overhead. That being said it would be rather minimal and not very noticeable even on hardware 5 years old. The browsers are quite efficient at it these d...
CSS Performance Usually when I build a site, I put all the CSS into one file, and all the properties that relate to a set of elements are defined at once. Like this: #myElement { color: #fff; background-color: #000; padding: 10px; border: 1px solid #ccc; font-size: 14pt; }.myClass { font-size: 12pt; padding: 5px; color...
TITLE: CSS Performance QUESTION: Usually when I build a site, I put all the CSS into one file, and all the properties that relate to a set of elements are defined at once. Like this: #myElement { color: #fff; background-color: #000; padding: 10px; border: 1px solid #ccc; font-size: 14pt; }.myClass { font-size: 12pt; p...
[ "css", "performance", "optimization" ]
4
3
460
4
0
2008-10-15T00:02:04.577000
2008-10-15T00:09:59.427000
203,288
203,523
How does ruby on rails work?
I'm a PHP developer who knows a little bit of Ruby. I want to learn Ruby on Rails, but most of the resources I've come across treat RoR functionality as "magic" -- i.e., it has a certain internal consistency, but don't bother asking how it works in terms of Ruby, MySQL, etc. Anyway, I want a deep understanding of how R...
The books "Agile Web Development with Rails" and "The Rails Way" are both pretty good. "Pro Active Record" goes really in depth for Active Record, but doesn't touch on too much else. The podcast Railscasts sometimes just uses the magic, but sometimes it explains what is really going on. Various blogs such as Art of Mis...
How does ruby on rails work? I'm a PHP developer who knows a little bit of Ruby. I want to learn Ruby on Rails, but most of the resources I've come across treat RoR functionality as "magic" -- i.e., it has a certain internal consistency, but don't bother asking how it works in terms of Ruby, MySQL, etc. Anyway, I want ...
TITLE: How does ruby on rails work? QUESTION: I'm a PHP developer who knows a little bit of Ruby. I want to learn Ruby on Rails, but most of the resources I've come across treat RoR functionality as "magic" -- i.e., it has a certain internal consistency, but don't bother asking how it works in terms of Ruby, MySQL, et...
[ "ruby-on-rails", "ruby" ]
33
22
14,366
10
0
2008-10-15T00:07:42.553000
2008-10-15T02:21:38.617000
203,294
207,307
Multiple NSURLConnection delegates in Objective-C
I have two NSURLConnections. The second one depends on the content of the first, so handling the data received from the connection will be different for the two connections. I'm just picking up Objective-C and I would like to know what the proper way to implement the delegates is. Right now I'm using: NSURL *url=[NSURL...
In your sample, you alloc a DownloadDelegate object without ever init'ing it. DownloadDelegate *dd = [DownloadDelegate alloc]; This is dangerous. Instead: DownloadDelegate *dd = [[DownloadDelegate alloc] init]; Also, it's not strictly necessary to declare your delegate response methods in your @interface declaration (t...
Multiple NSURLConnection delegates in Objective-C I have two NSURLConnections. The second one depends on the content of the first, so handling the data received from the connection will be different for the two connections. I'm just picking up Objective-C and I would like to know what the proper way to implement the de...
TITLE: Multiple NSURLConnection delegates in Objective-C QUESTION: I have two NSURLConnections. The second one depends on the content of the first, so handling the data received from the connection will be different for the two connections. I'm just picking up Objective-C and I would like to know what the proper way t...
[ "ios", "objective-c", "macos", "cocoa" ]
15
4
20,432
6
0
2008-10-15T00:08:53.783000
2008-10-16T03:07:50.660000
203,296
1,113,278
Colour blindness simulator
Like any responsible developer, I'd like to make sure that the sites I produce are accessible to the widest possible audience, and that includes the significant fraction of the population with some form of colour blindness. There are many websites which offer to filter a URL you feed it, either by rendering a picture o...
I came across Color Oracle and thought it might help. Here is the short description: Color Oracle is a colorblindness simulator for Windows, Mac and Linux. It takes the guesswork out of designing for color blindness by showing you in real time what people with common color vision impairments will see.
Colour blindness simulator Like any responsible developer, I'd like to make sure that the sites I produce are accessible to the widest possible audience, and that includes the significant fraction of the population with some form of colour blindness. There are many websites which offer to filter a URL you feed it, eith...
TITLE: Colour blindness simulator QUESTION: Like any responsible developer, I'd like to make sure that the sites I produce are accessible to the widest possible audience, and that includes the significant fraction of the population with some form of colour blindness. There are many websites which offer to filter a URL...
[ "colors", "accessibility", "color-blindness" ]
24
17
9,794
7
0
2008-10-15T00:09:38.057000
2009-07-11T08:47:55.667000
203,302
204,397
What is the SQL for 'next' and 'previous' in a table?
I have a table of items, each of which has a date associated with it. If I have the date associated with one item, how do I query the database with SQL to get the 'previous' and 'subsequent' items in the table? It is not possible to simply add (or subtract) a value, as the dates do not have a regular gap between them. ...
My own attempt at the set solution, based on TheSoftwareJedi. First question: select date from test where date = 8 union all select max(date) from test where date < 8 union all select min(date) from test where date > 8 order by date; Second question: While debugging this, I used the data set: (key:date) 1:1,2:3,3:8,4:8...
What is the SQL for 'next' and 'previous' in a table? I have a table of items, each of which has a date associated with it. If I have the date associated with one item, how do I query the database with SQL to get the 'previous' and 'subsequent' items in the table? It is not possible to simply add (or subtract) a value,...
TITLE: What is the SQL for 'next' and 'previous' in a table? QUESTION: I have a table of items, each of which has a date associated with it. If I have the date associated with one item, how do I query the database with SQL to get the 'previous' and 'subsequent' items in the table? It is not possible to simply add (or ...
[ "sql" ]
11
1
7,187
7
0
2008-10-15T00:13:06.927000
2008-10-15T11:30:16.573000
203,316
203,329
Find leaf nodes in hierarchical tree
I have a table in my database which stores a tree structure. Here are the relevant fields: mytree (id, parentid, otherfields...) I want to find all the leaf nodes (that is, any record whose id is not another record's parentid ) I've tried this: SELECT * FROM mytree WHERE `id` NOT IN (SELECT DISTINCT `parentid` FROM `my...
Your query didn't work because the sub-query includes NULL. The following slight modification works for me: SELECT * FROM `mytree` WHERE `id` NOT IN ( SELECT DISTINCT `parentid` FROM `mytree` WHERE `parentid` IS NOT NULL)
Find leaf nodes in hierarchical tree I have a table in my database which stores a tree structure. Here are the relevant fields: mytree (id, parentid, otherfields...) I want to find all the leaf nodes (that is, any record whose id is not another record's parentid ) I've tried this: SELECT * FROM mytree WHERE `id` NOT IN...
TITLE: Find leaf nodes in hierarchical tree QUESTION: I have a table in my database which stores a tree structure. Here are the relevant fields: mytree (id, parentid, otherfields...) I want to find all the leaf nodes (that is, any record whose id is not another record's parentid ) I've tried this: SELECT * FROM mytree...
[ "sql", "database", "tree" ]
19
25
19,226
6
0
2008-10-15T00:20:41.107000
2008-10-15T00:30:26.750000
203,333
220,784
TSQL Extended Procedure 'xp_dirscan'?
What is the equivalent of the extended procedure 'xp_dirscan' in SQL Server 2005?
It's not native shipped code in SQL Server. It's a 3rd party extenfed stored proc (which is a DLL). You can register on SQL Server Central and see this article with download and instructions. It's for SQL 2000 but registering the DLL should be the same (I've not tried it on '2005)
TSQL Extended Procedure 'xp_dirscan'? What is the equivalent of the extended procedure 'xp_dirscan' in SQL Server 2005?
TITLE: TSQL Extended Procedure 'xp_dirscan'? QUESTION: What is the equivalent of the extended procedure 'xp_dirscan' in SQL Server 2005? ANSWER: It's not native shipped code in SQL Server. It's a 3rd party extenfed stored proc (which is a DLL). You can register on SQL Server Central and see this article with download...
[ "sql", "sql-server", "sql-server-2005", "t-sql" ]
1
1
243
2
0
2008-10-15T00:31:22.333000
2008-10-21T04:47:43.653000
203,336
203,359
Creating the Singleton design pattern in PHP5
How would one create a Singleton class using PHP5 classes?
/** * Singleton class * */ final class UserFactory { private static $inst = null; // Prevent cloning and de-serializing private function __clone(){} private function __wakeup(){} /** * Call this method to get singleton * * @return UserFactory */ public static function Instance() { if ($inst === null) { $inst = new Us...
Creating the Singleton design pattern in PHP5 How would one create a Singleton class using PHP5 classes?
TITLE: Creating the Singleton design pattern in PHP5 QUESTION: How would one create a Singleton class using PHP5 classes? ANSWER: /** * Singleton class * */ final class UserFactory { private static $inst = null; // Prevent cloning and de-serializing private function __clone(){} private function __wakeup(){} /** * C...
[ "php", "oop", "design-patterns", "singleton" ]
213
271
203,619
22
0
2008-10-15T00:33:27.650000
2008-10-15T00:45:17.190000
203,340
568,307
JQuery: Current, Well-Formatted, Printable Documentation?
I'm looking for a current (1.2), well-formatted, printable version of the jQuery documentation. I've checked the alternative resources page and see the PDF versions from CF and Java, but both are out of date. The jQuery site has the API browser with "Printable Version" in the toolbox, but it prints terribly, and I don'...
take a look at this page. it has compiled html help file (CHM) for latest jQuery 1.3. that guy also compiles another useful CHM manuals.
JQuery: Current, Well-Formatted, Printable Documentation? I'm looking for a current (1.2), well-formatted, printable version of the jQuery documentation. I've checked the alternative resources page and see the PDF versions from CF and Java, but both are out of date. The jQuery site has the API browser with "Printable V...
TITLE: JQuery: Current, Well-Formatted, Printable Documentation? QUESTION: I'm looking for a current (1.2), well-formatted, printable version of the jQuery documentation. I've checked the alternative resources page and see the PDF versions from CF and Java, but both are out of date. The jQuery site has the API browser...
[ "jquery" ]
32
16
2,471
11
0
2008-10-15T00:35:54.413000
2009-02-20T04:48:41.250000
203,355
204,453
Is there any way to detect the monitor state in Windows (on or off)?
Does anyone know if there is an API to get the current monitor state (on or off) in Windows (XP/Vista/2000/2003)? All of my searches seem to indicate there is no real way of doing this. This thread tries to use GetDevicePowerState which according to Microsoft's docs does not work for display devices. In Vista I can lis...
GetDevicePowerState sometimes works for monitors. If it's present, you can open the \\.\LCD device. Close it immediately after you've finished with it. Essentially, you're out of luck—there is no reliable way to detect the monitor power state, short of writing a device driver and filtering all of the power IRPs up and ...
Is there any way to detect the monitor state in Windows (on or off)? Does anyone know if there is an API to get the current monitor state (on or off) in Windows (XP/Vista/2000/2003)? All of my searches seem to indicate there is no real way of doing this. This thread tries to use GetDevicePowerState which according to M...
TITLE: Is there any way to detect the monitor state in Windows (on or off)? QUESTION: Does anyone know if there is an API to get the current monitor state (on or off) in Windows (XP/Vista/2000/2003)? All of my searches seem to indicate there is no real way of doing this. This thread tries to use GetDevicePowerState wh...
[ "windows", "winapi" ]
24
16
34,880
9
0
2008-10-15T00:42:49.330000
2008-10-15T12:00:32.350000
203,376
203,381
Unit Testing Framework for Oracle PL/SQL?
I've seen the question (and answer) when posed for MS SQL Server, though I don't yet know of one for Oracle and PL/SQL. Are there xUnit style testing frameworks for Oracle's PL/SQL? What are they?
The most commonly used is probably utPLSQL The original author of this toolkit now works for Quest, which has a commercial PL/SQL unit testing application.
Unit Testing Framework for Oracle PL/SQL? I've seen the question (and answer) when posed for MS SQL Server, though I don't yet know of one for Oracle and PL/SQL. Are there xUnit style testing frameworks for Oracle's PL/SQL? What are they?
TITLE: Unit Testing Framework for Oracle PL/SQL? QUESTION: I've seen the question (and answer) when posed for MS SQL Server, though I don't yet know of one for Oracle and PL/SQL. Are there xUnit style testing frameworks for Oracle's PL/SQL? What are they? ANSWER: The most commonly used is probably utPLSQL The origina...
[ "sql", "oracle", "unit-testing", "plsql" ]
24
15
19,240
10
0
2008-10-15T00:58:07.630000
2008-10-15T01:02:07.293000
203,377
203,389
Getting the max value of an enum
How do you get the max value of an enum?
Enum.GetValues() seems to return the values in order, so you can do something like this: // given this enum: public enum Foo { Fizz = 3, Bar = 1, Bang = 2 } // this gets Fizz var lastFoo = Enum.GetValues(typeof(Foo)).Cast ().Last(); Edit For those not willing to read through the comments: You can also do it this way: ...
Getting the max value of an enum How do you get the max value of an enum?
TITLE: Getting the max value of an enum QUESTION: How do you get the max value of an enum? ANSWER: Enum.GetValues() seems to return the values in order, so you can do something like this: // given this enum: public enum Foo { Fizz = 3, Bar = 1, Bang = 2 } // this gets Fizz var lastFoo = Enum.GetValues(typeof(Foo)).C...
[ "c#", "enums" ]
195
272
125,466
11
0
2008-10-15T00:59:33.837000
2008-10-15T01:05:10.003000
203,382
203,646
Do stateless random number generators exist?
Is there a difference between generating multiple numbers using a single random number generator (RNG) versus generating one number per generator and discarding it? Do both implementations generate numbers which are equally random? Is there a difference between the normal RNGs and the secure RNGs for this? I have a web...
A random number generator has a state -- that's actually a necessary feature. The next "random" number is a function of the previous number and the seed/state. The purists call them pseudo-random number generators. The numbers will pass statistical tests for randomness, but aren't -- actually -- random. The sequence of...
Do stateless random number generators exist? Is there a difference between generating multiple numbers using a single random number generator (RNG) versus generating one number per generator and discarding it? Do both implementations generate numbers which are equally random? Is there a difference between the normal RN...
TITLE: Do stateless random number generators exist? QUESTION: Is there a difference between generating multiple numbers using a single random number generator (RNG) versus generating one number per generator and discarding it? Do both implementations generate numbers which are equally random? Is there a difference bet...
[ "random", "prng", "stateless" ]
20
22
7,429
10
0
2008-10-15T01:02:45.657000
2008-10-15T03:37:39.650000
203,383
203,414
Best name for array indexed by id with boolean value
I get obsessed with the best names for arrays and variables that I use, I'll look up words in the thesaurus, dictionary, etc.. So I'm trying to name this array / structure: $nameMe = array( '392' => TRUE, '234' => TRUE, '754' => TRUE, '464' => TRUE, ); and it's used to check if that id has a certain property, like so i...
$hasProperty[$id] or $isSomething[$id] What is the property exactly? $isOdd[$id] $isWriteable[$id] $hasAssociatedFile[$id]
Best name for array indexed by id with boolean value I get obsessed with the best names for arrays and variables that I use, I'll look up words in the thesaurus, dictionary, etc.. So I'm trying to name this array / structure: $nameMe = array( '392' => TRUE, '234' => TRUE, '754' => TRUE, '464' => TRUE, ); and it's used ...
TITLE: Best name for array indexed by id with boolean value QUESTION: I get obsessed with the best names for arrays and variables that I use, I'll look up words in the thesaurus, dictionary, etc.. So I'm trying to name this array / structure: $nameMe = array( '392' => TRUE, '234' => TRUE, '754' => TRUE, '464' => TRUE,...
[ "naming-conventions", "variables" ]
2
4
2,319
9
0
2008-10-15T01:03:28.400000
2008-10-15T01:15:21.607000
203,384
203,420
How to tell when Windows is inactive
Various programs can do stuff only when you haven't used the computer for a while (eg screensaver, Google Desktop indexing, etc). How do they know when it has been inactive? Is there some function in Windows that tells you how long it has been inactive, or do you have to use some kind of keyboard/mouse hook to track ac...
EDIT: changed answer, providing text and detail behind Shy's answer (which should be and was accepted). Feel free to merge and delete this one. GetLastInputInfo Function The GetLastInputInfo function retrieves the time of the last input event. Pasted here from P/Invoke This function retrieves the time since last user i...
How to tell when Windows is inactive Various programs can do stuff only when you haven't used the computer for a while (eg screensaver, Google Desktop indexing, etc). How do they know when it has been inactive? Is there some function in Windows that tells you how long it has been inactive, or do you have to use some ki...
TITLE: How to tell when Windows is inactive QUESTION: Various programs can do stuff only when you haven't used the computer for a while (eg screensaver, Google Desktop indexing, etc). How do they know when it has been inactive? Is there some function in Windows that tells you how long it has been inactive, or do you h...
[ ".net", "windows" ]
11
14
8,652
3
0
2008-10-15T01:04:15.403000
2008-10-15T01:18:25.687000
203,397
211,389
Context help in Visual Studio
Is there a way to change the context sensitive help in Visual Studio so that it will only search against the text under the caret instead of a compilation error in your code? More info: After you compile and receive a compilation error(underlined), placing the caret within the underlined text and pressing F1 will take ...
The only solution I've found is to fix the compile error;-) A workaround is to use the 'Dynamic Help' window (from the help menu, or CTRL - F1, D ), the compile error is top of the list but the usual item will be listed next. For those that don't understand the question, here's a trivial, unrealistic example: int myInt...
Context help in Visual Studio Is there a way to change the context sensitive help in Visual Studio so that it will only search against the text under the caret instead of a compilation error in your code? More info: After you compile and receive a compilation error(underlined), placing the caret within the underlined t...
TITLE: Context help in Visual Studio QUESTION: Is there a way to change the context sensitive help in Visual Studio so that it will only search against the text under the caret instead of a compilation error in your code? More info: After you compile and receive a compilation error(underlined), placing the caret withi...
[ "c#", "visual-studio", "visual-studio-2008", "helpfile" ]
4
2
1,958
2
0
2008-10-15T01:10:14.690000
2008-10-17T08:20:13.243000
203,399
203,419
How do you write a case insensitive query for both MySQL and Postgres?
I'm running a MySQL database locally for development, but deploying to Heroku which uses Postgres. Heroku handles almost everything, but my case-insensitive Like statements become case sensitive. I could use iLike statements, but my local MySQL database can't handle that. What is the best way to write a case insensitiv...
select * from foo where upper(bar) = upper(?); If you set the parameter to upper case in the caller, you can avoid the second function call.
How do you write a case insensitive query for both MySQL and Postgres? I'm running a MySQL database locally for development, but deploying to Heroku which uses Postgres. Heroku handles almost everything, but my case-insensitive Like statements become case sensitive. I could use iLike statements, but my local MySQL data...
TITLE: How do you write a case insensitive query for both MySQL and Postgres? QUESTION: I'm running a MySQL database locally for development, but deploying to Heroku which uses Postgres. Heroku handles almost everything, but my case-insensitive Like statements become case sensitive. I could use iLike statements, but m...
[ "mysql", "ruby-on-rails", "database", "postgresql", "heroku" ]
64
58
53,519
11
0
2008-10-15T01:10:29.273000
2008-10-15T01:16:19.450000
203,446
206,432
MAPI: Format of PR_SEARCH_KEY
Does anyone know the format of the MAPI property PR_SEARCH_KEY? The online documentation has this to say about it: The search key is formed by concatenating the address type (in uppercase characters), the colon character ':', the e-mail address in canonical form, and the terminating null character. And the exchange doc...
I believe that the property PR_SEARCH_KEY will be of different formats for different objects (as alluded to by Moishe). A MAPI message object will have a unique value assigned on creation for PR_SEARCH_KEY, however if the object is copied this property value is copied also. I presume when you reply to an e-mail, Exchan...
MAPI: Format of PR_SEARCH_KEY Does anyone know the format of the MAPI property PR_SEARCH_KEY? The online documentation has this to say about it: The search key is formed by concatenating the address type (in uppercase characters), the colon character ':', the e-mail address in canonical form, and the terminating null c...
TITLE: MAPI: Format of PR_SEARCH_KEY QUESTION: Does anyone know the format of the MAPI property PR_SEARCH_KEY? The online documentation has this to say about it: The search key is formed by concatenating the address type (in uppercase characters), the colon character ':', the e-mail address in canonical form, and the ...
[ "outlook", "exchange-server", "mapi", "msg" ]
0
2
2,387
2
0
2008-10-15T01:33:28.073000
2008-10-15T20:52:16.627000
203,453
203,488
Does LISTSERV have an API?
I have a custom application that was built to send opt-in newsletters and marketing emails. It does a pretty good job sending mail, but it doesn't respond at all to bounces or unsubscribe requests. It seems to me that rather than building that functionality myself I should use a mailing list manager such as LISTSERV. H...
LISTSERV does have a powerful (if baroque) programming interface; see http://www.lsoft.com/manuals/15.5/LISTSERV15.5_AdvancedTopicsManual.pdf. mailman doesn't have an API per se, but it does have a complete set of command line tools, which makes it very scriptable. And, of course, both mailman and majordomo come with a...
Does LISTSERV have an API? I have a custom application that was built to send opt-in newsletters and marketing emails. It does a pretty good job sending mail, but it doesn't respond at all to bounces or unsubscribe requests. It seems to me that rather than building that functionality myself I should use a mailing list ...
TITLE: Does LISTSERV have an API? QUESTION: I have a custom application that was built to send opt-in newsletters and marketing emails. It does a pretty good job sending mail, but it doesn't respond at all to bounces or unsubscribe requests. It seems to me that rather than building that functionality myself I should u...
[ "email", "mailing-list", "listserv" ]
0
4
2,075
2
0
2008-10-15T01:39:32.117000
2008-10-15T02:01:21.030000
203,456
203,490
How can I get the icon from the executable file only having an instance of it's Process in C#
I can get the executable location from the process, how do I get the icon from file? Maybe use windows api LoadIcon(). I wonder if there is.NET way...
Icon ico = Icon.ExtractAssociatedIcon(theProcess.MainModule.FileName);
How can I get the icon from the executable file only having an instance of it's Process in C# I can get the executable location from the process, how do I get the icon from file? Maybe use windows api LoadIcon(). I wonder if there is.NET way...
TITLE: How can I get the icon from the executable file only having an instance of it's Process in C# QUESTION: I can get the executable location from the process, how do I get the icon from file? Maybe use windows api LoadIcon(). I wonder if there is.NET way... ANSWER: Icon ico = Icon.ExtractAssociatedIcon(theProcess...
[ "c#" ]
29
43
28,221
3
0
2008-10-15T01:41:28.853000
2008-10-15T02:02:40.200000
203,468
206,178
Scalable/Reusable Authorization Model
Ok, so I'm looking for a bit of architecture guidance, my team is getting a chance to re-cast certain decisions with a new feature that we're building, and I wanted to see what SO thought:-) There are of course certain things that we're not changing, so the solution would have to fit in this model. Namely, that we've g...
Moving from the traditional group, role, or operation-level permission, there is a push to "claims-based" authorization, like what was delivered with WCF. Zermatt is the codename for the Microsoft class-library that will help developers build claims-based applications on the server and client. Active Directory will bec...
Scalable/Reusable Authorization Model Ok, so I'm looking for a bit of architecture guidance, my team is getting a chance to re-cast certain decisions with a new feature that we're building, and I wanted to see what SO thought:-) There are of course certain things that we're not changing, so the solution would have to f...
TITLE: Scalable/Reusable Authorization Model QUESTION: Ok, so I'm looking for a bit of architecture guidance, my team is getting a chance to re-cast certain decisions with a new feature that we're building, and I wanted to see what SO thought:-) There are of course certain things that we're not changing, so the soluti...
[ "asp.net", "ajax", "authorization", "script#" ]
2
1
500
2
0
2008-10-15T01:48:29.510000
2008-10-15T20:01:15.513000
203,469
203,547
How to use enums in Oracle?
How do you use enums in Oracle using SQL only? (No PSQL) In MySQL you can do: CREATE TABLE sizes ( name ENUM('small', 'medium', 'large') ); What would be a similar way to do this in Oracle?
Reading a bit about the MySQL enum, I'm guessing the closest equivalent would be a simple check constraint CREATE TABLE sizes ( name VARCHAR2(10) CHECK( name IN ('small','medium','large') ) ); but that doesn't allow you to reference the value by the index. A more complicated foreign key relationship would also be possi...
How to use enums in Oracle? How do you use enums in Oracle using SQL only? (No PSQL) In MySQL you can do: CREATE TABLE sizes ( name ENUM('small', 'medium', 'large') ); What would be a similar way to do this in Oracle?
TITLE: How to use enums in Oracle? QUESTION: How do you use enums in Oracle using SQL only? (No PSQL) In MySQL you can do: CREATE TABLE sizes ( name ENUM('small', 'medium', 'large') ); What would be a similar way to do this in Oracle? ANSWER: Reading a bit about the MySQL enum, I'm guessing the closest equivalent wou...
[ "database", "oracle", "enums" ]
49
63
90,051
3
0
2008-10-15T01:48:37.780000
2008-10-15T02:36:05.763000
203,473
203,669
How do I group by date in Crystal Reports 8.0?
I have a Crystal Report that looks like: Date | Person | Ticket | Summary Date | Person | Ticket | Summary Date | Person | Ticket | Summary I would like it to look like: Date Person | Ticket | Summary Person | Ticket | Summary Date Person | Ticket | Summary All values are pulled from a MS SQL 2000 database, the applica...
Crystal has a function to add a grouping and all you need to do is select your date field into it. You should be able to do this by right-clicking on the date field and selecting the 'group by' option!
How do I group by date in Crystal Reports 8.0? I have a Crystal Report that looks like: Date | Person | Ticket | Summary Date | Person | Ticket | Summary Date | Person | Ticket | Summary I would like it to look like: Date Person | Ticket | Summary Person | Ticket | Summary Date Person | Ticket | Summary All values are ...
TITLE: How do I group by date in Crystal Reports 8.0? QUESTION: I have a Crystal Report that looks like: Date | Person | Ticket | Summary Date | Person | Ticket | Summary Date | Person | Ticket | Summary I would like it to look like: Date Person | Ticket | Summary Person | Ticket | Summary Date Person | Ticket | Summa...
[ "crystal-reports", "sql-server-2000" ]
2
1
5,010
2
0
2008-10-15T01:53:13.633000
2008-10-15T03:47:02.640000
203,475
203,571
How do I identify immutable objects in Java
In my code, I am creating a collection of objects which will be accessed by various threads in a fashion that is only safe if the objects are immutable. When an attempt is made to insert a new object into my collection, I want to test to see if it is immutable (if not, I'll throw an exception). One thing I can do is to...
There is no reliable way to detect if a class is immutable. This is because there are so many ways a property of a class might be altered and you can't detect all of them via reflection. The only way to get close to this is: Only allow final properties of types that are immutable (primitive types and classes you know a...
How do I identify immutable objects in Java In my code, I am creating a collection of objects which will be accessed by various threads in a fashion that is only safe if the objects are immutable. When an attempt is made to insert a new object into my collection, I want to test to see if it is immutable (if not, I'll t...
TITLE: How do I identify immutable objects in Java QUESTION: In my code, I am creating a collection of objects which will be accessed by various threads in a fashion that is only safe if the objects are immutable. When an attempt is made to insert a new object into my collection, I want to test to see if it is immutab...
[ "java", "functional-programming", "immutability" ]
47
32
28,642
14
0
2008-10-15T01:55:00.637000
2008-10-15T02:52:21.130000
203,477
208,902
How does CSS formatting in a Google Maps bubble work?
I'm using KML and the GGeoXml object to overlay some shapes on an embedded Google map. The placemarks in the KML file have some custom descriptive information that shows up in the balloons. <div class="MapPopup"> <h6>Concession</h6> <h4>~Name~</h4> <p>Description goes here</p> <a class="Button GoRight FloatRight" href=...
As suggested I've gone in with Firebug to see what's going on. It looks like Google is doing two obnoxious things: It's stripping out all class attributes from my HTML. It's throwing all kinds of hard-coded styles around. Here's my HTML along with the first couple of wrappers inserted by Google: Concession BOIS KASSA 1...
How does CSS formatting in a Google Maps bubble work? I'm using KML and the GGeoXml object to overlay some shapes on an embedded Google map. The placemarks in the KML file have some custom descriptive information that shows up in the balloons. <div class="MapPopup"> <h6>Concession</h6> <h4>~Name~</h4> <p>Description go...
TITLE: How does CSS formatting in a Google Maps bubble work? QUESTION: I'm using KML and the GGeoXml object to overlay some shapes on an embedded Google map. The placemarks in the KML file have some custom descriptive information that shows up in the balloons. <div class="MapPopup"> <h6>Concession</h6> <h4>~Name~</h4>...
[ "css", "google-maps", "kml" ]
4
6
16,294
4
0
2008-10-15T01:55:36.580000
2008-10-16T14:56:50.790000
203,484
203,512
Oracle 10gr2: enforce dates entered are between 9am and 5pm?
I want to enforce that date-times that are entered fall between 9am and 5pm. How do I enforce this with ORACLE CHECK constraints?
SQL> ed Wrote file afiedt.buf 1 create table date_check ( 2 dt date check( to_number( to_char( dt, 'HH24' ) ) between 9 and 16 ) 3* ) SQL> / Table created. SQL> ed Wrote file afiedt.buf 1* insert into date_check values( to_date( '01/01/2008 08:30', 'DD/MM/YYYY HH2 4:MI' ) ) SQL> / insert into date_check values( to_...
Oracle 10gr2: enforce dates entered are between 9am and 5pm? I want to enforce that date-times that are entered fall between 9am and 5pm. How do I enforce this with ORACLE CHECK constraints?
TITLE: Oracle 10gr2: enforce dates entered are between 9am and 5pm? QUESTION: I want to enforce that date-times that are entered fall between 9am and 5pm. How do I enforce this with ORACLE CHECK constraints? ANSWER: SQL> ed Wrote file afiedt.buf 1 create table date_check ( 2 dt date check( to_number( to_char( dt, 'H...
[ "oracle", "date", "time", "constraints" ]
3
5
542
1
0
2008-10-15T01:59:11.970000
2008-10-15T02:16:53.150000
203,487
203,514
Creating self-contained python applications
I'm trying to create a self-contained version of pisa (html to pdf converter, latest version ), but I can't succeed due to several errors. I've tried py2exe, bb-freeze and cxfreeze. This has to be in windows, which makes my life a bit harder. I remember that a couple of months ago the author had a zip file containing t...
Check out pyinstaller, it makes standalone executables (as in one.EXE file, and that's it).
Creating self-contained python applications I'm trying to create a self-contained version of pisa (html to pdf converter, latest version ), but I can't succeed due to several errors. I've tried py2exe, bb-freeze and cxfreeze. This has to be in windows, which makes my life a bit harder. I remember that a couple of month...
TITLE: Creating self-contained python applications QUESTION: I'm trying to create a self-contained version of pisa (html to pdf converter, latest version ), but I can't succeed due to several errors. I've tried py2exe, bb-freeze and cxfreeze. This has to be in windows, which makes my life a bit harder. I remember that...
[ "python", "windows", "executable", "self-contained" ]
22
28
20,312
1
0
2008-10-15T02:00:27.553000
2008-10-15T02:17:35.520000
203,489
203,726
Find records with more than one ActiveRecord HABTM Association
I've got two models, joined by a Has and Belongs To Many join table. Lets call these models User and Event. The majority of Users have 0 events, while few have one or more. I want to do something like: User.find(:all,:joins =>:events,:conditions => [" 'Something that count the events' >?"], 0) The problem is, I'm not s...
I've found the answer: User.find(:all,:joins =>:events,:select => 'DISTINCT `users`.*') Basically, the users.* restricts the result set to just the users table, and the DISTINCT keyword makes sure each user is only returned once.
Find records with more than one ActiveRecord HABTM Association I've got two models, joined by a Has and Belongs To Many join table. Lets call these models User and Event. The majority of Users have 0 events, while few have one or more. I want to do something like: User.find(:all,:joins =>:events,:conditions => [" 'Some...
TITLE: Find records with more than one ActiveRecord HABTM Association QUESTION: I've got two models, joined by a Has and Belongs To Many join table. Lets call these models User and Event. The majority of Users have 0 events, while few have one or more. I want to do something like: User.find(:all,:joins =>:events,:cond...
[ "sql", "ruby-on-rails", "ruby", "activerecord" ]
4
4
976
1
0
2008-10-15T02:01:51.573000
2008-10-15T04:31:53.220000
203,493
203,536
Why does Oracle 9i treat an empty string as NULL?
I know that it does consider ' ' as NULL, but that doesn't do much to tell me why this is the case. As I understand the SQL specifications, ' ' is not the same as NULL -- one is a valid datum, and the other is indicating the absence of that same information. Feel free to speculate, but please indicate if that's the cas...
I believe the answer is that Oracle is very, very old. Back in the olden days before there was a SQL standard, Oracle made the design decision that empty strings in VARCHAR / VARCHAR2 columns were NULL and that there was only one sense of NULL (there are relational theorists that would differentiate between data that h...
Why does Oracle 9i treat an empty string as NULL? I know that it does consider ' ' as NULL, but that doesn't do much to tell me why this is the case. As I understand the SQL specifications, ' ' is not the same as NULL -- one is a valid datum, and the other is indicating the absence of that same information. Feel free t...
TITLE: Why does Oracle 9i treat an empty string as NULL? QUESTION: I know that it does consider ' ' as NULL, but that doesn't do much to tell me why this is the case. As I understand the SQL specifications, ' ' is not the same as NULL -- one is a valid datum, and the other is indicating the absence of that same inform...
[ "sql", "oracle", "null", "string" ]
242
240
75,053
10
0
2008-10-15T02:04:18.840000
2008-10-15T02:30:04.560000
203,495
1,037,408
Testing REST webservices
My organization is working on building RESTful webservices on JBoss appserver. The QA team is used to testing SOAP webservices so far using SoapUI. SoapUI has a new version that has REST capabilities. We're considering using that. Are there any publicly available RESTful services available on the net for free that some...
soapUI will do the job as well, check out this blog post to get started.
Testing REST webservices My organization is working on building RESTful webservices on JBoss appserver. The QA team is used to testing SOAP webservices so far using SoapUI. SoapUI has a new version that has REST capabilities. We're considering using that. Are there any publicly available RESTful services available on t...
TITLE: Testing REST webservices QUESTION: My organization is working on building RESTful webservices on JBoss appserver. The QA team is used to testing SOAP webservices so far using SoapUI. SoapUI has a new version that has REST capabilities. We're considering using that. Are there any publicly available RESTful servi...
[ "java", "web-services", "rest", "testing", "rest-client" ]
63
28
58,391
24
0
2008-10-15T02:06:56.057000
2009-06-24T09:52:03.133000
203,497
203,505
How to update a record without changing rowversion
If a table has a rowversion column in it and you make an update to that row, the value of the rowversion column increases. I know that this is by design and the purpose of rowversion columns, however is there any way to make it such that an update operation will have no effect on rowversion value? Edit: Tracking of upd...
No. See MSDN. "Every time that a row with a rowversion column is modified or inserted, the incremented database rowversion value is inserted in the rowversion column."
How to update a record without changing rowversion If a table has a rowversion column in it and you make an update to that row, the value of the rowversion column increases. I know that this is by design and the purpose of rowversion columns, however is there any way to make it such that an update operation will have n...
TITLE: How to update a record without changing rowversion QUESTION: If a table has a rowversion column in it and you make an update to that row, the value of the rowversion column increases. I know that this is by design and the purpose of rowversion columns, however is there any way to make it such that an update ope...
[ "sql-server", "t-sql", "rowversion" ]
6
4
4,521
2
0
2008-10-15T02:10:29.997000
2008-10-15T02:14:32.563000
203,516
203,522
Disabling +S filetype in Perforce
Perforce's filetype system includes the +S modified to denote that a file is a temporary file. The implication of this is that no file history is stored for that file - only the most recent version is maintained, and it is replaced with each new checkin. This is obviously a dangerous flag to set accidentally, which we ...
You can write a pre-commit trigger that looks at the file list for this flag, rejecting the commit if this is the case. See this chapter of the Perforce manual for details.
Disabling +S filetype in Perforce Perforce's filetype system includes the +S modified to denote that a file is a temporary file. The implication of this is that no file history is stored for that file - only the most recent version is maintained, and it is replaced with each new checkin. This is obviously a dangerous f...
TITLE: Disabling +S filetype in Perforce QUESTION: Perforce's filetype system includes the +S modified to denote that a file is a temporary file. The implication of this is that no file history is stored for that file - only the most recent version is maintained, and it is replaced with each new checkin. This is obvio...
[ "perforce" ]
3
5
227
1
0
2008-10-15T02:18:17.530000
2008-10-15T02:21:17.480000
203,528
203,581
What is the simplest way to get indented XML with line breaks from XmlDocument?
When I build XML up from scratch with XmlDocument, the OuterXml property already has everything nicely indented with line breaks. However, if I call LoadXml on some very "compressed" XML (no line breaks or indention) then the output of OuterXml stays that way. So... What is the simplest way to get beautified XML output...
Based on the other answers, I looked into XmlTextWriter and came up with the following helper method: static public string Beautify(this XmlDocument doc) { StringBuilder sb = new StringBuilder(); XmlWriterSettings settings = new XmlWriterSettings { Indent = true, IndentChars = " ", NewLineChars = "\r\n", NewLineHandlin...
What is the simplest way to get indented XML with line breaks from XmlDocument? When I build XML up from scratch with XmlDocument, the OuterXml property already has everything nicely indented with line breaks. However, if I call LoadXml on some very "compressed" XML (no line breaks or indention) then the output of Oute...
TITLE: What is the simplest way to get indented XML with line breaks from XmlDocument? QUESTION: When I build XML up from scratch with XmlDocument, the OuterXml property already has everything nicely indented with line breaks. However, if I call LoadXml on some very "compressed" XML (no line breaks or indention) then ...
[ "c#", ".net", "xmldocument", "outerxml" ]
123
233
166,897
12
0
2008-10-15T02:25:59.683000
2008-10-15T03:01:29.287000
203,538
251,582
Ajax and GridView-Fu -- how to make AccordionPanes work with GridViews?
Ok, I know someone here has tried this ninja-elite level of coding before. Essentially what I want to do is this: I want a GridView where each row returned becomes the header portion of an asp.net-ajax AccordionPane. Each row also has some unique key, and when you click on each of those AcccordionPane headers, that wil...
Have you tried a ListView instead? I would think you could define the AccordianPanes in the ItemTemplate, then bind an inner GridView or ListView inside each row. The only downside would be that it would populate all Grid/ListViews on load.
Ajax and GridView-Fu -- how to make AccordionPanes work with GridViews? Ok, I know someone here has tried this ninja-elite level of coding before. Essentially what I want to do is this: I want a GridView where each row returned becomes the header portion of an asp.net-ajax AccordionPane. Each row also has some unique k...
TITLE: Ajax and GridView-Fu -- how to make AccordionPanes work with GridViews? QUESTION: Ok, I know someone here has tried this ninja-elite level of coding before. Essentially what I want to do is this: I want a GridView where each row returned becomes the header portion of an asp.net-ajax AccordionPane. Each row also...
[ "gridview", "asp.net-ajax" ]
2
1
1,553
1
0
2008-10-15T02:30:28.910000
2008-10-30T20:13:12.107000
203,543
203,557
Is it necessary in any circumstance to modify Wordpress other than writing plugins and themes?
I recently had to work on a project where the previous developer modified the wp-admin directory. It seems like a bad idea to me, since Wordpress is constantly updated. Am I just not at that level of expertise with modifying Wordpress?
Being open source, I think it's a common thing for software like WordPress to be modified and extended at any point. To modify or not to modify is a choice between trade-offs. New features can be encapsulated as modules, which may, perhaps, cause their functionality to be less integrated than desired. However, fully in...
Is it necessary in any circumstance to modify Wordpress other than writing plugins and themes? I recently had to work on a project where the previous developer modified the wp-admin directory. It seems like a bad idea to me, since Wordpress is constantly updated. Am I just not at that level of expertise with modifying ...
TITLE: Is it necessary in any circumstance to modify Wordpress other than writing plugins and themes? QUESTION: I recently had to work on a project where the previous developer modified the wp-admin directory. It seems like a bad idea to me, since Wordpress is constantly updated. Am I just not at that level of experti...
[ "php", "wordpress" ]
2
6
297
5
0
2008-10-15T02:34:18.840000
2008-10-15T02:41:46.143000
203,548
203,550
Undefined Symbol ___gxx_personality_v0 on link
I've been getting this undefined symbol building with this command line: $ gcc test.cpp Undefined symbols: "___gxx_personality_v0", referenced from: etc... test.cpp is simple and should build fine. What is the deal?
Use g++ test.cpp instead, since this is c++ code. Or, if you really want to use gcc, add -lstdc++ to the command line, like so: gcc test.cpp -lstdc++ Running md5 against the a.out produced under each scenario shows that it's the same output. But, yeah, g++ probably makes your world a simpler place.
Undefined Symbol ___gxx_personality_v0 on link I've been getting this undefined symbol building with this command line: $ gcc test.cpp Undefined symbols: "___gxx_personality_v0", referenced from: etc... test.cpp is simple and should build fine. What is the deal?
TITLE: Undefined Symbol ___gxx_personality_v0 on link QUESTION: I've been getting this undefined symbol building with this command line: $ gcc test.cpp Undefined symbols: "___gxx_personality_v0", referenced from: etc... test.cpp is simple and should build fine. What is the deal? ANSWER: Use g++ test.cpp instead, sinc...
[ "c++", "c", "gcc", "g++" ]
57
92
36,543
4
0
2008-10-15T02:36:38.213000
2008-10-15T02:38:09.393000
203,549
209,236
What's the benefit of Connectedness?
What is the benefit of Connectedness as defined by Resource Oriented Architecture (ROA)? The way I understand it, the crux of Connectedness is the ability to crawl the entire application state using only the root URIs. But how useful is that really? For example, imagine that HTTP GET http://example.com/users/joe return...
You are right that changing Uris is not desirable but it does happen and using complete Uris instead of constructing them makes change easier to deal with. One other benefit is that your client application can easily retrieve resources from multiple hosts. If you allowed your client to build the URI's the client would ...
What's the benefit of Connectedness? What is the benefit of Connectedness as defined by Resource Oriented Architecture (ROA)? The way I understand it, the crux of Connectedness is the ability to crawl the entire application state using only the root URIs. But how useful is that really? For example, imagine that HTTP GE...
TITLE: What's the benefit of Connectedness? QUESTION: What is the benefit of Connectedness as defined by Resource Oriented Architecture (ROA)? The way I understand it, the crux of Connectedness is the ability to crawl the entire application state using only the root URIs. But how useful is that really? For example, im...
[ "rest" ]
2
1
724
3
0
2008-10-15T02:37:29.410000
2008-10-16T16:05:39.920000
203,577
203,604
Graphics.MeasureString returns different values than Win32 GetTextExtent
i've been trying to find a method in C# to measure the size of a string. The standard method to measure a string in Win32 is to use GetTextExtent. The real goal is to find the average width and height of a font character. The standard method to find the average width of a character starts from getting the width of all ...
I suspect this is because the text rendering engine is different in.NET. You might want to lookup the differences between GDI and GDI+. Things also might change again for you if you call the Application.SetCompatibleTextRenderingDefault( ) method, with true or false as the parameter (I believe the default is true). In ...
Graphics.MeasureString returns different values than Win32 GetTextExtent i've been trying to find a method in C# to measure the size of a string. The standard method to measure a string in Win32 is to use GetTextExtent. The real goal is to find the average width and height of a font character. The standard method to fi...
TITLE: Graphics.MeasureString returns different values than Win32 GetTextExtent QUESTION: i've been trying to find a method in C# to measure the size of a string. The standard method to measure a string in Win32 is to use GetTextExtent. The real goal is to find the average width and height of a font character. The sta...
[ ".net", "winforms", "dpi", "highdpi" ]
3
3
5,229
1
0
2008-10-15T02:59:03.143000
2008-10-15T03:09:37.553000
203,586
203,593
Java Servlets: Performance
I am working on a web application in Java which gets data from servlets via AJAX calls. This application features several page elements which get new data from the server at fairly rapid intervals. With a lot of users, the demand on the server has a potential to get fairly high, so I am curious: Which approach offers t...
There is no performance reason to have more than one servlet. In a web application, only a single instance of a servlet class is instantitated, no matter how many requests. Requests are not serialized, they are handled concurrently, hence the need for your servlet to be thread safe.
Java Servlets: Performance I am working on a web application in Java which gets data from servlets via AJAX calls. This application features several page elements which get new data from the server at fairly rapid intervals. With a lot of users, the demand on the server has a potential to get fairly high, so I am curio...
TITLE: Java Servlets: Performance QUESTION: I am working on a web application in Java which gets data from servlets via AJAX calls. This application features several page elements which get new data from the server at fairly rapid intervals. With a lot of users, the demand on the server has a potential to get fairly h...
[ "java", "ajax", "servlets" ]
4
11
1,524
6
0
2008-10-15T03:04:16.830000
2008-10-15T03:07:09.057000
203,589
203,663
iPhone SDK: Assertion failure in -[UILabel setFont:]
I have an iPhone app that compiles and runs fine in the Simulator on my laptop. Now, I try to build and run the same code in the Simulator on an iMac, and it starts up and lets me click a button, but then I get an assertion failure. Here is what is in the console: *** Assertion failure in -[UILabel setFont:], /SourceCa...
If you've got UILabels in your xib file, they may be somehow corrupt, or you may have set a font to them that doesn't exist on both your machines (you can use command-T when editing a UILabel to bring up the font picker; not sure it's possible to set a non-iPhone font, but it may be). Otherwise, try removing UILabels f...
iPhone SDK: Assertion failure in -[UILabel setFont:] I have an iPhone app that compiles and runs fine in the Simulator on my laptop. Now, I try to build and run the same code in the Simulator on an iMac, and it starts up and lets me click a button, but then I get an assertion failure. Here is what is in the console: **...
TITLE: iPhone SDK: Assertion failure in -[UILabel setFont:] QUESTION: I have an iPhone app that compiles and runs fine in the Simulator on my laptop. Now, I try to build and run the same code in the Simulator on an iMac, and it starts up and lets me click a button, but then I get an assertion failure. Here is what is ...
[ "iphone" ]
1
1
4,444
5
0
2008-10-15T03:04:44.927000
2008-10-15T03:45:05.233000
203,591
203,624
Projection/Replication in SQL Query?
My SQL is a bit rusty -- is there a SQL way to project an input table that looks something like this: Name SlotValue Slots ---- --------- ----- ABC 3 1 ABC 4 2 ABC 6 5 Into a 'projected' result table that looks like this: Name SlotSum Slot ---- ------- ---- ABC 13 1 ABC 10 2 ABC 6 3 ABC 6 4 ABC 6 5 In other words, the ...
I'm not sure you'll be able to do this in a view. You'd have to use a procedure. You could make ProjectedTable a temporary/variable table in the procedure as well. I'd be really interested to see how you'd get this into a view because you need to dynamically generate a range of numbers. declare @maxSlot int set @maxSlo...
Projection/Replication in SQL Query? My SQL is a bit rusty -- is there a SQL way to project an input table that looks something like this: Name SlotValue Slots ---- --------- ----- ABC 3 1 ABC 4 2 ABC 6 5 Into a 'projected' result table that looks like this: Name SlotSum Slot ---- ------- ---- ABC 13 1 ABC 10 2 ABC 6 3...
TITLE: Projection/Replication in SQL Query? QUESTION: My SQL is a bit rusty -- is there a SQL way to project an input table that looks something like this: Name SlotValue Slots ---- --------- ----- ABC 3 1 ABC 4 2 ABC 6 5 Into a 'projected' result table that looks like this: Name SlotSum Slot ---- ------- ---- ABC 13 ...
[ "sql", "t-sql" ]
0
0
1,205
2
0
2008-10-15T03:06:19.930000
2008-10-15T03:28:31.603000
203,605
203,801
How do I match only fully-composed characters in a Unicode string in Perl?
I'm looking for a way to match only fully composed characters in a Unicode string. Is [:print:] dependent upon locale in any regular expression implementation that incorporates this character class? For example, will it match Japanese character 'あ', since it is not a control character, or is [:print:] always going to b...
echo あ| perl -nle 'BEGIN{binmode STDIN,":utf8"} print"[$_]"; print /[[:print:]]/? "YES": "NO"' This mostly works, though it generates a warning about a wide character. But it gives you the idea: you must be sure you're dealing with a real unicode string (check utf8::is_utf8). Or just check perlunicode at all - the whol...
How do I match only fully-composed characters in a Unicode string in Perl? I'm looking for a way to match only fully composed characters in a Unicode string. Is [:print:] dependent upon locale in any regular expression implementation that incorporates this character class? For example, will it match Japanese character ...
TITLE: How do I match only fully-composed characters in a Unicode string in Perl? QUESTION: I'm looking for a way to match only fully composed characters in a Unicode string. Is [:print:] dependent upon locale in any regular expression implementation that incorporates this character class? For example, will it match J...
[ "regex", "perl", "unicode", "locale", "character-properties" ]
8
6
2,471
5
0
2008-10-15T03:10:13.510000
2008-10-15T05:27:30.287000
203,616
203,655
Why does C# not provide the C++ style 'friend' keyword?
The C++ friend keyword allows a class A to designate class B as its friend. This allows Class B to access the private / protected members of class A. I've never read anything as to why this was left out of C# (and VB.NET). Most answers to this earlier StackOverflow question seem to be saying it is a useful part of C++ ...
Having friends in programming is more-or-less considered "dirty" and easy to abuse. It breaks the relationships between classes and undermines some fundamental attributes of an OO language. That being said, it is a nice feature and I've used it plenty of times myself in C++; and would like to use it in C# too. But I be...
Why does C# not provide the C++ style 'friend' keyword? The C++ friend keyword allows a class A to designate class B as its friend. This allows Class B to access the private / protected members of class A. I've never read anything as to why this was left out of C# (and VB.NET). Most answers to this earlier StackOverflo...
TITLE: Why does C# not provide the C++ style 'friend' keyword? QUESTION: The C++ friend keyword allows a class A to designate class B as its friend. This allows Class B to access the private / protected members of class A. I've never read anything as to why this was left out of C# (and VB.NET). Most answers to this ea...
[ "c#", "c++", "design-patterns", "oop", "friend" ]
224
70
63,308
22
0
2008-10-15T03:23:43.360000
2008-10-15T03:40:47.333000
203,620
203,647
How to make a bilingual site without creating a separate ASP page for each language?
I need ideas on how to go about table layout problem. I want to set different width of the columns dependent on the picked language.
A variable switch, such as: <% dim columnWidth if session("lang") = "eng" then columnWidth = 50 else columnWidth = 100 end if %> [content] For c#, the code would be: <% private int columnWidth; if (session("lang") == "eng") { columnWidth = 50; } else { columnWidth = 100; } %>
How to make a bilingual site without creating a separate ASP page for each language? I need ideas on how to go about table layout problem. I want to set different width of the columns dependent on the picked language.
TITLE: How to make a bilingual site without creating a separate ASP page for each language? QUESTION: I need ideas on how to go about table layout problem. I want to set different width of the columns dependent on the picked language. ANSWER: A variable switch, such as: <% dim columnWidth if session("lang") = "eng" t...
[ "layout", "internationalization" ]
2
1
632
3
0
2008-10-15T03:25:18.503000
2008-10-15T03:38:08.213000
203,667
203,703
C++ "Named Parameter Idiom" vs. Boost::Parameter library
I've looked at both the Named Parameter Idiom and the Boost::Parameter library. What advantages does each one have over the other? Is there a good reason to always choose one over the other, or might each of them be better than the other in some situations (and if so, what situations)?
Implementing the Named Parameter Idiom is really easy, almost about as easy as using Boost::Parameter, so it kind of boils down to one main point. -Do you already have boost dependencies? If you don't, Boost::parameter isn't special enough to merit adding the dependency. Personally I've never seen Boost::parameter in p...
C++ "Named Parameter Idiom" vs. Boost::Parameter library I've looked at both the Named Parameter Idiom and the Boost::Parameter library. What advantages does each one have over the other? Is there a good reason to always choose one over the other, or might each of them be better than the other in some situations (and i...
TITLE: C++ "Named Parameter Idiom" vs. Boost::Parameter library QUESTION: I've looked at both the Named Parameter Idiom and the Boost::Parameter library. What advantages does each one have over the other? Is there a good reason to always choose one over the other, or might each of them be better than the other in some...
[ "c++", "named-parameters", "boost-parameter" ]
35
19
8,592
6
0
2008-10-15T03:46:56.557000
2008-10-15T04:14:09.390000
203,677
204,456
Can't compile class calling a method in an interface with a generic list argument
Just got a question about generics, why doesn't this compile when using a generic List? If its not possible, anyway around it? Much appreciate any answer. // Interface used in the ServiceAsync inteface. public interface BaseObject { public String getId(); } // Class that implements the interface public class _ModelDto...
This has got to do with the subtyping rules for parametrized types. I'll explain it in three steps: Non-nested case When you have the following subtype relation (where <: is the symbol for "is a subtype of"): _ModelDto <: BaseObject The following relation does not hold: List<_ModelDto> <: List But the following relatio...
Can't compile class calling a method in an interface with a generic list argument Just got a question about generics, why doesn't this compile when using a generic List? If its not possible, anyway around it? Much appreciate any answer. // Interface used in the ServiceAsync inteface. public interface BaseObject { publi...
TITLE: Can't compile class calling a method in an interface with a generic list argument QUESTION: Just got a question about generics, why doesn't this compile when using a generic List? If its not possible, anyway around it? Much appreciate any answer. // Interface used in the ServiceAsync inteface. public interface ...
[ "java", "generics" ]
2
1
547
3
0
2008-10-15T03:53:23.003000
2008-10-15T12:02:36.650000
203,694
203,924
Stability of .NET serialization across different framework versions
A project I'm working on requires serializing a data structure before shutting down and restores its state from this serialized data when it start up again. Last year, we were building for.NET 1.1, and ran into a tricky issue where our code ran on.NET 2.0 a customer upgraded with some software that somehow set 1.1 as d...
The chances are low (but not zero!) that there will be changes between framework versions. The intention would be that you should be able to use binary serialization and remoting to communicate between a client and a server running different framework versions. The incompatibility between.NET 1.x and 2.0 is a bug for w...
Stability of .NET serialization across different framework versions A project I'm working on requires serializing a data structure before shutting down and restores its state from this serialized data when it start up again. Last year, we were building for.NET 1.1, and ran into a tricky issue where our code ran on.NET ...
TITLE: Stability of .NET serialization across different framework versions QUESTION: A project I'm working on requires serializing a data structure before shutting down and restores its state from this serialized data when it start up again. Last year, we were building for.NET 1.1, and ran into a tricky issue where ou...
[ ".net", "serialization", "upgrade", "versions", "stability" ]
9
7
3,298
7
0
2008-10-15T04:09:24.313000
2008-10-15T07:09:45.960000
203,695
204,009
Does using "new" on a struct allocate it on the heap or stack?
When you create an instance of a class with the new operator, memory gets allocated on the heap. When you create an instance of a struct with the new operator where does the memory get allocated, on the heap or on the stack?
Okay, let's see if I can make this any clearer. Firstly, Ash is right: the question is not about where value type variables are allocated. That's a different question - and one to which the answer isn't just "on the stack". It's more complicated than that (and made even more complicated by C# 2). I have an article on t...
Does using "new" on a struct allocate it on the heap or stack? When you create an instance of a class with the new operator, memory gets allocated on the heap. When you create an instance of a struct with the new operator where does the memory get allocated, on the heap or on the stack?
TITLE: Does using "new" on a struct allocate it on the heap or stack? QUESTION: When you create an instance of a class with the new operator, memory gets allocated on the heap. When you create an instance of a struct with the new operator where does the memory get allocated, on the heap or on the stack? ANSWER: Okay,...
[ "c#", ".net", "memory-management" ]
311
333
95,382
8
0
2008-10-15T04:09:30.443000
2008-10-15T08:21:51.510000
203,702
203,715
Any way to ignore files coming from the repository for NTFS?
Ok, so at some point in time, somebody checked in some files with names that require a case sensitive file system into the trunk of a repository that I constantly check out. This of course leads to my local working copy locking up when I try to check it out (on my Windows computer). Is there any way that I can set my l...
You can use the repository browser to remove/rename the offending file then update your working copy as per normal, fix up any references to the file you renamed that may need fixing up, and commit the fixes. Then drag up a shotgun and shoot whoever did this in the first place. Case sensitivity abuse is one of the few ...
Any way to ignore files coming from the repository for NTFS? Ok, so at some point in time, somebody checked in some files with names that require a case sensitive file system into the trunk of a repository that I constantly check out. This of course leads to my local working copy locking up when I try to check it out (...
TITLE: Any way to ignore files coming from the repository for NTFS? QUESTION: Ok, so at some point in time, somebody checked in some files with names that require a case sensitive file system into the trunk of a repository that I constantly check out. This of course leads to my local working copy locking up when I try...
[ "svn", "ntfs" ]
4
2
206
3
0
2008-10-15T04:14:01.993000
2008-10-15T04:23:25.190000
203,707
203,713
Difference between jQuery selectors "ancestor descendant" and "parent > child"
The following two forms of jQuery selectors seem to do the same thing: $("div > ul.posts") $("div ul.posts") which is to select all the "ul" elements of class "posts" under "div" elements. Is there any difference?
Concerning $("div > ul.posts"), only direct descendants of DIV s will be selected. List Item Sub list item List item List item while $("div ul.posts") will select all descendants matching the criteria. So all and any ul.posts will be selected, whatever their nesting level is as long as somewhere along the chain, they a...
Difference between jQuery selectors "ancestor descendant" and "parent > child" The following two forms of jQuery selectors seem to do the same thing: $("div > ul.posts") $("div ul.posts") which is to select all the "ul" elements of class "posts" under "div" elements. Is there any difference?
TITLE: Difference between jQuery selectors "ancestor descendant" and "parent > child" QUESTION: The following two forms of jQuery selectors seem to do the same thing: $("div > ul.posts") $("div ul.posts") which is to select all the "ul" elements of class "posts" under "div" elements. Is there any difference? ANSWER: ...
[ "jquery" ]
14
28
8,278
4
0
2008-10-15T04:17:29.960000
2008-10-15T04:22:35.800000
203,732
203,744
Error Log information in VB Script while processing
I am having an VBScript files which runs by many instance of jobs. I need to log the error information if any error occurs in the script processing. If i maintain a log file then how can i differentiate the log file for each instances (around 10 simultaneous instances) of vb script calling. I dont go for any db logging...
I would use the same log file for all instances. I would then have each instance create a GUID: http://www.microsoft.com/technet/scriptcenter/resources/qanda/feb05/hey0221.mspx When an error is logged by an instance, it uses the GUID to identify itself. This way it shouldn't matter if you have 10 or 50 instances, they ...
Error Log information in VB Script while processing I am having an VBScript files which runs by many instance of jobs. I need to log the error information if any error occurs in the script processing. If i maintain a log file then how can i differentiate the log file for each instances (around 10 simultaneous instances...
TITLE: Error Log information in VB Script while processing QUESTION: I am having an VBScript files which runs by many instance of jobs. I need to log the error information if any error occurs in the script processing. If i maintain a log file then how can i differentiate the log file for each instances (around 10 simu...
[ "asp.net", "vbscript", "error-handling" ]
0
0
1,277
1
0
2008-10-15T04:38:08.763000
2008-10-15T04:47:47.963000
203,739
203,757
Why does instanceof return false for some literals?
"foo" instanceof String //=> false "foo" instanceof Object //=> false true instanceof Boolean //=> false true instanceof Object //=> false false instanceof Boolean //=> false false instanceof Object //=> false 12.21 instanceof Number //=> false /foo/ instanceof RegExp //=> true // the tests against Object really don...
Primitives are a different kind of type than objects created from within Javascript. From the Mozilla API docs: var color1 = new String("green"); color1 instanceof String; // returns true var color2 = "coral"; color2 instanceof String; // returns false (color2 is not a String object) I can't find any way to construct p...
Why does instanceof return false for some literals? "foo" instanceof String //=> false "foo" instanceof Object //=> false true instanceof Boolean //=> false true instanceof Object //=> false false instanceof Boolean //=> false false instanceof Object //=> false 12.21 instanceof Number //=> false /foo/ instanceof RegE...
TITLE: Why does instanceof return false for some literals? QUESTION: "foo" instanceof String //=> false "foo" instanceof Object //=> false true instanceof Boolean //=> false true instanceof Object //=> false false instanceof Boolean //=> false false instanceof Object //=> false 12.21 instanceof Number //=> false /fo...
[ "javascript", "literals", "instanceof" ]
342
520
134,088
11
0
2008-10-15T04:44:20.997000
2008-10-15T04:54:52.020000
203,756
203,768
How do I debug javascript in visual studio when an asp.net application is run under firefox?
How to debug javascript in visual studio when an asp.net application is run under mozilla firefox browser? IE supports by enabling javascript debug option.
At the moment, there is no Firefox extension that allows you to debug JavaScript directly in Visual Studio. Visual Studio 2008 came with a very nice JavaScript debugger, but you have to use it in Internet Explorer. For debugging JavaScript on Firefox I highly recommend you Firebug, it's a really good JavaScript debugge...
How do I debug javascript in visual studio when an asp.net application is run under firefox? How to debug javascript in visual studio when an asp.net application is run under mozilla firefox browser? IE supports by enabling javascript debug option.
TITLE: How do I debug javascript in visual studio when an asp.net application is run under firefox? QUESTION: How to debug javascript in visual studio when an asp.net application is run under mozilla firefox browser? IE supports by enabling javascript debug option. ANSWER: At the moment, there is no Firefox extension...
[ "javascript", "debugging" ]
7
17
10,885
1
0
2008-10-15T04:54:42.833000
2008-10-15T04:59:25.723000
203,758
203,933
Receive socket size limits good?
I am writing a program in Python that will act as a server and accept data from a client, is it a good idea to impose a hard limit as to the amount of data, if so why? More info: So certain chat programs limit the amount of text one can send per send (i.e. per time user presses send) so the question comes down to is th...
Most likely you've seen code which protects against "extra" incoming data. This is often due to the possibility of buffer overruns, where the extra data being copied into memory overruns the pre-allocated array and overwrites executable code with attacker code. Code written in languages like C typically has a lot of le...
Receive socket size limits good? I am writing a program in Python that will act as a server and accept data from a client, is it a good idea to impose a hard limit as to the amount of data, if so why? More info: So certain chat programs limit the amount of text one can send per send (i.e. per time user presses send) so...
TITLE: Receive socket size limits good? QUESTION: I am writing a program in Python that will act as a server and accept data from a client, is it a good idea to impose a hard limit as to the amount of data, if so why? More info: So certain chat programs limit the amount of text one can send per send (i.e. per time use...
[ "python", "sockets" ]
2
2
1,421
3
0
2008-10-15T04:55:33.843000
2008-10-15T07:17:11.187000
203,771
203,889
Recovering from exceptions using CPPUnit
I have been using CPPUnit as a unit testing framework and am now trying to use it in an automated build and package system. However a problem holding me back is that if a crash occurs during the running of the unit tests, e.g. a null pointer dereferencing, it halts the remainder of the automation. Is there any way for ...
You're automating the execution of your cppunit-based unit-tests during your build process, right? If you were trying to use CppUnit to execute the build process, I would be tempted to say don't do that! Could you tell us what is stopping the build process when the unit tests crash? And what are your unit tests started...
Recovering from exceptions using CPPUnit I have been using CPPUnit as a unit testing framework and am now trying to use it in an automated build and package system. However a problem holding me back is that if a crash occurs during the running of the unit tests, e.g. a null pointer dereferencing, it halts the remainder...
TITLE: Recovering from exceptions using CPPUnit QUESTION: I have been using CPPUnit as a unit testing framework and am now trying to use it in an automated build and package system. However a problem holding me back is that if a crash occurs during the running of the unit tests, e.g. a null pointer dereferencing, it h...
[ "unit-testing", "exception", "testing", "cppunit" ]
2
3
2,622
5
0
2008-10-15T05:01:12.337000
2008-10-15T06:40:50.590000
203,780
203,798
What is the best datatype to use for storing moderate amounts of text in SQL Server (2005)?
What is the best datatype to use for storing moderate amounts of text in SQL Server (2005)? For example, imagine a table, storing information on downloads available on a website. I want a title for the download which is brief, say varchar(20). A path, say varchar(255) then I want to store some user friendly text about ...
The PAD (Portable Application Description) specification highest character limit for program description is 2000 chars *see Program Descriptions section. http://www.asp-shareware.org/pad/spec/spec.php Download site submission tools use this spec to make it easier for authors to submit their software. Also I think there...
What is the best datatype to use for storing moderate amounts of text in SQL Server (2005)? What is the best datatype to use for storing moderate amounts of text in SQL Server (2005)? For example, imagine a table, storing information on downloads available on a website. I want a title for the download which is brief, s...
TITLE: What is the best datatype to use for storing moderate amounts of text in SQL Server (2005)? QUESTION: What is the best datatype to use for storing moderate amounts of text in SQL Server (2005)? For example, imagine a table, storing information on downloads available on a website. I want a title for the download...
[ "sql-server-2005", "types" ]
1
4
324
3
0
2008-10-15T05:11:17.137000
2008-10-15T05:26:02.643000
203,781
203,883
Is Wireframing Overplanning?
37 Signal's Getting Real convinced me that wireframing and writing functional specification documents are middleman steps unnecessary for building web applications and dynamic websites. Is the overhead for these steps worth its weight? Is prototyping in HTML/CSS or even PhotoShop documents (so designers can work on the...
"Fail to plan is plan to fail" - or something like that. Wireframing is not limited to web-apps; it is pervasively used wherever a high-level overview of any system is needed (it's just called something else). Functional specs, when you know what is to be done & how to do it would indeed be overkill. A high-level diagr...
Is Wireframing Overplanning? 37 Signal's Getting Real convinced me that wireframing and writing functional specification documents are middleman steps unnecessary for building web applications and dynamic websites. Is the overhead for these steps worth its weight? Is prototyping in HTML/CSS or even PhotoShop documents ...
TITLE: Is Wireframing Overplanning? QUESTION: 37 Signal's Getting Real convinced me that wireframing and writing functional specification documents are middleman steps unnecessary for building web applications and dynamic websites. Is the overhead for these steps worth its weight? Is prototyping in HTML/CSS or even Ph...
[ "project-planning", "wireframe" ]
5
5
808
6
0
2008-10-15T05:11:24.140000
2008-10-15T06:39:10.767000
203,787
203,802
How can I check if one game object can see another?
I have an object, that is facing a particular direction with (for instance) a 45 degree field of view, and a limit view range. I have done all the initial checks (Quadtree node, and distance), but now I need to check if a particular object is within that view cone, (In this case to decide only to follow that object if ...
Compute the angle between your view direction (understood as a vector) and the vector that starts at you and ends at the object. If it falls under FieldOfView/2, you can view the object. That angle is: arccos(scalarProduct(viewDirection, (object - you)) / (norm(viewDirection)*norm(object - you))).
How can I check if one game object can see another? I have an object, that is facing a particular direction with (for instance) a 45 degree field of view, and a limit view range. I have done all the initial checks (Quadtree node, and distance), but now I need to check if a particular object is within that view cone, (I...
TITLE: How can I check if one game object can see another? QUESTION: I have an object, that is facing a particular direction with (for instance) a 45 degree field of view, and a limit view range. I have done all the initial checks (Quadtree node, and distance), but now I need to check if a particular object is within ...
[ "artificial-intelligence", "visibility" ]
11
9
5,637
5
0
2008-10-15T05:16:35.190000
2008-10-15T05:28:02
203,800
203,964
Are there limitations on the amount of memory that Flash player can use?
Are there any limitations on the amount of memory that the Flash player can use? If you have a SWF that over time gets a lot of data from the server, then more and more data will be kept in memory. Is there a limitation on this?
Not in any version of Flash that runs on desktop PCs. As long as your application keeps using more memory, desktop Flash will keep requesting it from the OS, until the OS runs out of memory or something crashes. Of course you the developer should limit your memory usage as appropriate, but Flash won't force you to do s...
Are there limitations on the amount of memory that Flash player can use? Are there any limitations on the amount of memory that the Flash player can use? If you have a SWF that over time gets a lot of data from the server, then more and more data will be kept in memory. Is there a limitation on this?
TITLE: Are there limitations on the amount of memory that Flash player can use? QUESTION: Are there any limitations on the amount of memory that the Flash player can use? If you have a SWF that over time gets a lot of data from the server, then more and more data will be kept in memory. Is there a limitation on this? ...
[ "flash", "memory" ]
9
6
9,409
3
0
2008-10-15T05:26:50.880000
2008-10-15T07:45:45.250000
203,807
203,814
CSV date format
I have a VB application which extracts data and creates 3 CSV files (a.csv, b.csv, c.csv). Then I use another Excel spreadsheet (import.xls) to import all the data from the above CSV files into this sheet. import.xls file has a macro which opens the CSV files one by one and copies the data. The problem I am facing is t...
You can use the Format VBA function: Format(DateText, "dd/mm/yyyy") That will format it how ever you like. For a more permanant solution, try changing your regional settings in windows itself, Excel uses this for its date formatting. Start -> Settings -> Control Panel -> Regional Options. Make sure that the language is...
CSV date format I have a VB application which extracts data and creates 3 CSV files (a.csv, b.csv, c.csv). Then I use another Excel spreadsheet (import.xls) to import all the data from the above CSV files into this sheet. import.xls file has a macro which opens the CSV files one by one and copies the data. The problem ...
TITLE: CSV date format QUESTION: I have a VB application which extracts data and creates 3 CSV files (a.csv, b.csv, c.csv). Then I use another Excel spreadsheet (import.xls) to import all the data from the above CSV files into this sheet. import.xls file has a macro which opens the CSV files one by one and copies the ...
[ "excel", "csv", "vba" ]
2
8
36,314
4
0
2008-10-15T05:37:38.470000
2008-10-15T05:42:51.767000
203,809
203,892
How would I write this 3 level deep mysql query?
This might be a little hard to explain, but I will try. I want to display a list of categories (stored in 1 table), and number of domains associated with each category (stored in another table). The monkey wrench in this case is that each domain has a set of records associated with it (which are stored in a 3rd table)....
SELECT Categories.Name,count(DISTINCT categories.name) FROM Categories JOIN Domains ON Categories.ID=Domains.CID JOIN Records ON Records.DID=Domains.ID GROUP BY Categories.Name Tested with following setup: CREATE TABLE Categories (Name nvarchar(50), ID int NOT NULL IDENTITY(1,1)) CREATE TABLE Domains (Name nvarchar(50)...
How would I write this 3 level deep mysql query? This might be a little hard to explain, but I will try. I want to display a list of categories (stored in 1 table), and number of domains associated with each category (stored in another table). The monkey wrench in this case is that each domain has a set of records asso...
TITLE: How would I write this 3 level deep mysql query? QUESTION: This might be a little hard to explain, but I will try. I want to display a list of categories (stored in 1 table), and number of domains associated with each category (stored in another table). The monkey wrench in this case is that each domain has a s...
[ "sql", "mysql" ]
4
4
3,072
5
0
2008-10-15T05:38:52.197000
2008-10-15T06:43:37.497000
203,823
203,830
C++ headers - separation between interface and implementation details
One of classes in my program uses some third-party library. Library object is a private member of my class: // My.h #include <3pheader.h> class My {... private: 3pObject m_object; } The problem with this - any other unit in my program that uses My class should be configured to include 3p headers. Moving to another kin...
Use the "pimpl" idiom: // header class My { class impl; std::auto_ptr _impl; }; // cpp #include <3pheader.h> class My::impl { 3pObject _object; };
C++ headers - separation between interface and implementation details One of classes in my program uses some third-party library. Library object is a private member of my class: // My.h #include <3pheader.h> class My {... private: 3pObject m_object; } The problem with this - any other unit in my program that uses My c...
TITLE: C++ headers - separation between interface and implementation details QUESTION: One of classes in my program uses some third-party library. Library object is a private member of my class: // My.h #include <3pheader.h> class My {... private: 3pObject m_object; } The problem with this - any other unit in my prog...
[ "c++", "coding-style" ]
5
10
1,281
3
0
2008-10-15T05:49:23.923000
2008-10-15T05:58:21.283000