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
187,414
187,432
Can you explain lambda expressions?
I don't really get lambda expressions. While they've been around since the days of ALGOL, I didn't start hearing about them until fairly recently, when Python and Ruby became very popular. Now that C# has the => syntax, people in my world (.NET) are talking about lamdba expressions more and more. I've read the Wikipedi...
Basically as far as C# is concerned, lambda expressions are an easy way to create a delegate (or an expression tree, but let's leave those aside for now). In C# 1 we could only create delegate instances from normal methods. In C# 2 we gained anonymous methods. In C# 3 we gained lambda expressions, which are like more c...
Can you explain lambda expressions? I don't really get lambda expressions. While they've been around since the days of ALGOL, I didn't start hearing about them until fairly recently, when Python and Ruby became very popular. Now that C# has the => syntax, people in my world (.NET) are talking about lamdba expressions m...
TITLE: Can you explain lambda expressions? QUESTION: I don't really get lambda expressions. While they've been around since the days of ALGOL, I didn't start hearing about them until fairly recently, when Python and Ruby became very popular. Now that C# has the => syntax, people in my world (.NET) are talking about la...
[ "delegates", "lambda", "closures", "imperative-languages" ]
24
22
6,955
4
0
2008-10-09T14:05:06.420000
2008-10-09T14:08:38.893000
187,421
187,525
Virtual List Controls (MFC)
I am using a List Control to display a representation of elements within a vector. When the list is clicked on another control shows information about that element. The index of the element is currently determined by its index in the control, however if I wish to sort or filter the results this will no longer work. I h...
Frankly - tying data (the position in your data vector) to the presentation of the data in the list control (the position in the list ctrl) is something I would stay away from. In MFC each control has a "Data" DWORD member variable - when coding in MFC I Always called "SetItemData" for each item added and passed in a p...
Virtual List Controls (MFC) I am using a List Control to display a representation of elements within a vector. When the list is clicked on another control shows information about that element. The index of the element is currently determined by its index in the control, however if I wish to sort or filter the results t...
TITLE: Virtual List Controls (MFC) QUESTION: I am using a List Control to display a representation of elements within a vector. When the list is clicked on another control shows information about that element. The index of the element is currently determined by its index in the control, however if I wish to sort or fi...
[ "c++", "windows", "user-interface", "mfc", "controls" ]
1
5
3,533
4
0
2008-10-09T14:06:39.660000
2008-10-09T14:28:18.633000
187,433
187,468
Record Component Video
I've found plenty of simple, cheap solutions for recording composite video sources to my PC, a laptop. But I'd like to be able to record in HD and use component cables. I was wondering if anyone had a good solution for this. Required: Cheap Desired Portable, external hardware device
Depends on your definition of cheap, but there is the HD PVR from Hauppauge which works well from ~ $200.
Record Component Video I've found plenty of simple, cheap solutions for recording composite video sources to my PC, a laptop. But I'd like to be able to record in HD and use component cables. I was wondering if anyone had a good solution for this. Required: Cheap Desired Portable, external hardware device
TITLE: Record Component Video QUESTION: I've found plenty of simple, cheap solutions for recording composite video sources to my PC, a laptop. But I'd like to be able to record in HD and use component cables. I was wondering if anyone had a good solution for this. Required: Cheap Desired Portable, external hardware de...
[ "video" ]
1
1
334
1
0
2008-10-09T14:08:52.387000
2008-10-09T14:17:34.520000
187,434
187,502
How to make parts of a website under SSL and the rest not?
I need to create a cherrypy main page that has a login area. I want the login area to be secure, but not the rest of the page. How can I do this in CherryPy? Ideally, any suggestions will be compatible with http://web.archive.org/web/20170210040849/http://tools.cherrypy.org:80/wiki/AuthenticationAndAccessRestrictions
Assuming you only want parts of the actual page to be secure, you should create an iframe pointing to a HTTPS source. However, this shows a "secure and non-secure items on page" warning to the user.
How to make parts of a website under SSL and the rest not? I need to create a cherrypy main page that has a login area. I want the login area to be secure, but not the rest of the page. How can I do this in CherryPy? Ideally, any suggestions will be compatible with http://web.archive.org/web/20170210040849/http://tools...
TITLE: How to make parts of a website under SSL and the rest not? QUESTION: I need to create a cherrypy main page that has a login area. I want the login area to be secure, but not the rest of the page. How can I do this in CherryPy? Ideally, any suggestions will be compatible with http://web.archive.org/web/201702100...
[ "python", "ssl", "cherrypy" ]
1
2
552
2
0
2008-10-09T14:09:05.537000
2008-10-09T14:24:55.240000
187,438
187,457
change pgsql port
I have currently an installed pgsql instance that is running on port 1486. I want to change this port to 5433, how should I proceed for this?
There should be a line in your postgresql.conf file that says: port = 1486 Change that. The location of the file can vary depending on your install options. On Debian-based distros it is /etc/postgresql/8.3/main/ On Windows it is C:\Program Files\PostgreSQL\9.3\data Don't forget to sudo service postgresql restart for c...
change pgsql port I have currently an installed pgsql instance that is running on port 1486. I want to change this port to 5433, how should I proceed for this?
TITLE: change pgsql port QUESTION: I have currently an installed pgsql instance that is running on port 1486. I want to change this port to 5433, how should I proceed for this? ANSWER: There should be a line in your postgresql.conf file that says: port = 1486 Change that. The location of the file can vary depending o...
[ "postgresql" ]
121
213
214,933
2
0
2008-10-09T14:10:23.617000
2008-10-09T14:13:39.553000
187,453
187,467
Import package.* vs import package.SpecificType
Would it suppose any difference regarding overhead to write an import loading all the types within one package ( import java.* ); than just a specific type (i.e. import java.lang.ClassLoader )? Would the second one be a more advisable way to use than the other one?
There is not a performance or overhead cost to doing import.* vs importing specific types. However, I consider it to be a best practice to never use import.* My primary reason for this is I just like to keep things straightward, clean and with as little ambiguity as possible, and I think with a.* import you lose that.
Import package.* vs import package.SpecificType Would it suppose any difference regarding overhead to write an import loading all the types within one package ( import java.* ); than just a specific type (i.e. import java.lang.ClassLoader )? Would the second one be a more advisable way to use than the other one?
TITLE: Import package.* vs import package.SpecificType QUESTION: Would it suppose any difference regarding overhead to write an import loading all the types within one package ( import java.* ); than just a specific type (i.e. import java.lang.ClassLoader )? Would the second one be a more advisable way to use than the...
[ "java", "import", "overhead" ]
115
119
86,825
10
0
2008-10-09T14:12:44.953000
2008-10-09T14:17:00.530000
187,454
187,485
Subversion not merging changes into renamed files?
I have the following problem using subversion: I'm currently working on the trunk of my project and plan to do some refactoring (which includes renaming files or moving files to different directories). At the same time someone else is working on the same project on a branch. At some time I want to merge the changes mad...
I think this is an existing subversion bug - but don't hold your breath, its been open since 2002.
Subversion not merging changes into renamed files? I have the following problem using subversion: I'm currently working on the trunk of my project and plan to do some refactoring (which includes renaming files or moving files to different directories). At the same time someone else is working on the same project on a b...
TITLE: Subversion not merging changes into renamed files? QUESTION: I have the following problem using subversion: I'm currently working on the trunk of my project and plan to do some refactoring (which includes renaming files or moving files to different directories). At the same time someone else is working on the s...
[ "svn" ]
25
23
12,232
4
0
2008-10-09T14:12:48.353000
2008-10-09T14:20:58.133000
187,455
187,463
Counting array elements in Python
How can I count the number of elements in an array, because contrary to logic array.count(string) does not count all the elements in the array, it just searches for the number of occurrences of string.
The method len() returns the number of elements in the list. Syntax: len(myArray) Eg: myArray = [1, 2, 3] len(myArray) Output: 3
Counting array elements in Python How can I count the number of elements in an array, because contrary to logic array.count(string) does not count all the elements in the array, it just searches for the number of occurrences of string.
TITLE: Counting array elements in Python QUESTION: How can I count the number of elements in an array, because contrary to logic array.count(string) does not count all the elements in the array, it just searches for the number of occurrences of string. ANSWER: The method len() returns the number of elements in the li...
[ "python", "arrays" ]
205
365
784,424
5
0
2008-10-09T14:12:55.153000
2008-10-09T14:14:56.930000
187,462
187,488
Client side Callback in GWT
I'm trying to create a logger for a GWT application as an exercise to evaluate GWT. What I specifically want to do is have it so that I can post messages to a client side label at any point from the server side. So, if some interesting stuff has happened on the server the client can be updated. My First question is, is...
Well, there are a couple of Options. You need to get the data from the server... So you either need to poll the server, or use server push. Polling is pretty easy. Just use the Timer class to repeatedly call a service to see what value it should be displaying. Server push is done using something like comet. here is one...
Client side Callback in GWT I'm trying to create a logger for a GWT application as an exercise to evaluate GWT. What I specifically want to do is have it so that I can post messages to a client side label at any point from the server side. So, if some interesting stuff has happened on the server the client can be updat...
TITLE: Client side Callback in GWT QUESTION: I'm trying to create a logger for a GWT application as an exercise to evaluate GWT. What I specifically want to do is have it so that I can post messages to a client side label at any point from the server side. So, if some interesting stuff has happened on the server the c...
[ "java", "gwt", "callback", "server-push", "client-side" ]
6
10
4,978
2
0
2008-10-09T14:14:51.873000
2008-10-09T14:21:46.230000
187,465
608,964
Drive a POS printer via USB in c#
Any ideas how i can best drive a USB POS printer from c#. POS printers are usually serial, TCP/IP or USB based. I know how to accomplish serial and TCP/IP but have no idea about communications through USB in C#. I know that there is a layer available from Microsoft called POS.NET, but I want to try and avoid using this...
You should really consider using POS for.NET and OPOS or.NET service objects (Epson, for example provides both). POS for.NET conforms to the UnifiedPOS industry standard for interfacing with these devices.
Drive a POS printer via USB in c# Any ideas how i can best drive a USB POS printer from c#. POS printers are usually serial, TCP/IP or USB based. I know how to accomplish serial and TCP/IP but have no idea about communications through USB in C#. I know that there is a layer available from Microsoft called POS.NET, but ...
TITLE: Drive a POS printer via USB in c# QUESTION: Any ideas how i can best drive a USB POS printer from c#. POS printers are usually serial, TCP/IP or USB based. I know how to accomplish serial and TCP/IP but have no idea about communications through USB in C#. I know that there is a layer available from Microsoft ca...
[ "c#", "usb", "point-of-sale" ]
7
6
10,422
4
0
2008-10-09T14:16:45.303000
2009-03-04T01:46:26.097000
187,474
187,492
How is Oracle date implemented?
How is Oracle date implemented? Is it stored as milliseconds or something like that?
An Oracle DATE stores the date and time to the second. An Oracle TIMESTAMP stores the date and time to up to 9 digits of subsecond precision, depending on the available hardware. Both are implemented by storing the various components of the date and the time in a packed binary format. From the Oracle Concepts Guide sec...
How is Oracle date implemented? How is Oracle date implemented? Is it stored as milliseconds or something like that?
TITLE: How is Oracle date implemented? QUESTION: How is Oracle date implemented? Is it stored as milliseconds or something like that? ANSWER: An Oracle DATE stores the date and time to the second. An Oracle TIMESTAMP stores the date and time to up to 9 digits of subsecond precision, depending on the available hardwar...
[ "oracle" ]
18
27
18,491
3
0
2008-10-09T14:18:52.303000
2008-10-09T14:23:25.540000
187,495
187,529
How to read assembly attributes
In my program, how can I read the properties set in AssemblyInfo.cs: [assembly: AssemblyTitle("My Product")] [assembly: AssemblyDescription("...")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Radeldudel inc.")] [assembly: AssemblyProduct("My Product")] [assembly: AssemblyCopyright("Copyright @ me ...
This is reasonably easy. You have to use reflection. You need an instance of Assembly that represents the assembly with the attributes you want to read. An easy way of getting this is to do: typeof(MyTypeInAssembly).Assembly Then you can do this, for example: object[] attributes = assembly.GetCustomAttributes(typeof(As...
How to read assembly attributes In my program, how can I read the properties set in AssemblyInfo.cs: [assembly: AssemblyTitle("My Product")] [assembly: AssemblyDescription("...")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Radeldudel inc.")] [assembly: AssemblyProduct("My Product")] [assembly: As...
TITLE: How to read assembly attributes QUESTION: In my program, how can I read the properties set in AssemblyInfo.cs: [assembly: AssemblyTitle("My Product")] [assembly: AssemblyDescription("...")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Radeldudel inc.")] [assembly: AssemblyProduct("My Produc...
[ ".net", "reflection", "assemblies", "attributes" ]
73
72
54,621
8
0
2008-10-09T14:23:34.603000
2008-10-09T14:28:51.067000
187,505
187,845
Sharing Enum with WCF Service
I have few different applications among which I'd like to share a C# enum. I can't quite figure out how to share an enum declaration between a regular application and a WCF service. Here's the situation. I have 2 lightweight C# destop apps and a WCF webservice that all need to share enum values. Client 1 has Method1( M...
Using the Common library should be fine. Enumerations are serializable and the DataContract attributes are not needed. See: http://msdn.microsoft.com/en-us/library/ms731923.aspx Enumeration types. Enumerations, including flag enumerations, are serializable. Optionally, enumeration types can be marked with the DataContr...
Sharing Enum with WCF Service I have few different applications among which I'd like to share a C# enum. I can't quite figure out how to share an enum declaration between a regular application and a WCF service. Here's the situation. I have 2 lightweight C# destop apps and a WCF webservice that all need to share enum v...
TITLE: Sharing Enum with WCF Service QUESTION: I have few different applications among which I'd like to share a C# enum. I can't quite figure out how to share an enum declaration between a regular application and a WCF service. Here's the situation. I have 2 lightweight C# destop apps and a WCF webservice that all ne...
[ "c#", "wcf", "enums" ]
51
48
60,109
4
0
2008-10-09T14:25:26.220000
2008-10-09T15:34:57.517000
187,506
211,210
How do you use version control with Access development?
I'm involved with updating an Access solution. It has a good amount of VBA, a number of queries, a small amount of tables, and a few forms for data entry & report generation. It's an ideal candidate for Access. I want to make changes to the table design, the VBA, the queries, and the forms. How can I track my changes w...
We wrote our own script in VBScript, that uses the undocumented Application.SaveAsText() in Access to export all code, form, macro and report modules. Here it is, it should give you some pointers. (Beware: some of the messages are in german, but you can easily change that.) EDIT: To summarize various comments below: Ou...
How do you use version control with Access development? I'm involved with updating an Access solution. It has a good amount of VBA, a number of queries, a small amount of tables, and a few forms for data entry & report generation. It's an ideal candidate for Access. I want to make changes to the table design, the VBA, ...
TITLE: How do you use version control with Access development? QUESTION: I'm involved with updating an Access solution. It has a good amount of VBA, a number of queries, a small amount of tables, and a few forms for data entry & report generation. It's an ideal candidate for Access. I want to make changes to the table...
[ "ms-access", "version-control" ]
174
185
77,606
22
0
2008-10-09T14:25:29.047000
2008-10-17T06:15:50.267000
187,511
187,520
Mixing Visual Studio versions OK?
Can Visual Studio 2005 Team edition for Developer coexist peacefully with Visual Studio 2008 Database edition on my machine? Are they completely separate applications that won't interfere in any way with each other? Update: What about Visual Studio 2008 Developer edition? If I install this on the same machine as 2008 D...
2008 is side by side compatible with 2005. Also, be sure to apply 2008 SP1 as it will change the icon slightly so that you can tell the difference.
Mixing Visual Studio versions OK? Can Visual Studio 2005 Team edition for Developer coexist peacefully with Visual Studio 2008 Database edition on my machine? Are they completely separate applications that won't interfere in any way with each other? Update: What about Visual Studio 2008 Developer edition? If I install ...
TITLE: Mixing Visual Studio versions OK? QUESTION: Can Visual Studio 2005 Team edition for Developer coexist peacefully with Visual Studio 2008 Database edition on my machine? Are they completely separate applications that won't interfere in any way with each other? Update: What about Visual Studio 2008 Developer edit...
[ "visual-studio" ]
1
3
913
6
0
2008-10-09T14:25:57.203000
2008-10-09T14:27:42.147000
187,515
187,533
In PHP, how do I find the value associated with a specific key
I have two arrays. One contains id=>count and the other contains id=>name. I'm trying to produce a single array that is name=>count. Any suggestions on a straightforward way to do this? I have looked at the Array Functions in the PHP Manual and didn't see anything that stood out as doing what I want, so I'm guessing I'...
Something like: foreach($countA as $id => $count) { $newArray[$nameA[$id]] = $count; } This does assume that the keys are in correspondence between the two arrays, since your requirements are ambiguous otherwise.
In PHP, how do I find the value associated with a specific key I have two arrays. One contains id=>count and the other contains id=>name. I'm trying to produce a single array that is name=>count. Any suggestions on a straightforward way to do this? I have looked at the Array Functions in the PHP Manual and didn't see a...
TITLE: In PHP, how do I find the value associated with a specific key QUESTION: I have two arrays. One contains id=>count and the other contains id=>name. I'm trying to produce a single array that is name=>count. Any suggestions on a straightforward way to do this? I have looked at the Array Functions in the PHP Manua...
[ "php", "arrays", "associative-array" ]
0
4
325
2
0
2008-10-09T14:27:02.037000
2008-10-09T14:29:49.643000
187,526
198,830
Access aliases in Gnome "Run Application" dialog
I'd like to be able to run my aliases from my.bashrc in the "Run Application" dialog that comes up when you hit Alt+F2 in Ubuntu/Gnome. Does anyone know how to do this?
http://www.freedesktop.org/wiki/Specifications is probably a good place to start. I find these quite hard to follow most of the time, but sometimes you can figure it out. Specifically, the "Desktop Entry Specification". Also, I don't think you'll be able to use any aliases from.bashrc, at least not without writing some...
Access aliases in Gnome "Run Application" dialog I'd like to be able to run my aliases from my.bashrc in the "Run Application" dialog that comes up when you hit Alt+F2 in Ubuntu/Gnome. Does anyone know how to do this?
TITLE: Access aliases in Gnome "Run Application" dialog QUESTION: I'd like to be able to run my aliases from my.bashrc in the "Run Application" dialog that comes up when you hit Alt+F2 in Ubuntu/Gnome. Does anyone know how to do this? ANSWER: http://www.freedesktop.org/wiki/Specifications is probably a good place to ...
[ "ubuntu", "gnome" ]
13
4
7,959
11
0
2008-10-09T14:28:19.163000
2008-10-13T20:00:30.790000
187,531
187,625
How can I get Perl to give a warning message when a certain package/tag is imported?
I have a package that I just made and I have an "old-mode" that basically makes it work like it worked before: importing everything into the current namespace. One of the nice things about having this as a package is that we no longer have to do that. Anyway, what I would like to do is have it so that whenever anyone d...
Well, as you specifically state that you want to alarm in the cases of use Mod qw<:oldmode>; This works better: package Foo; use base qw; use Carp qw;... sub import { #if ( grep { $_ eq ':oldmode' } @_ ) { # Perl 5.8 if ( @_ ~~ ':oldmode' ) { # Perl 5.10 carp( 'import called with:oldmode!' ); } goto &{Exporter->can( 'i...
How can I get Perl to give a warning message when a certain package/tag is imported? I have a package that I just made and I have an "old-mode" that basically makes it work like it worked before: importing everything into the current namespace. One of the nice things about having this as a package is that we no longer ...
TITLE: How can I get Perl to give a warning message when a certain package/tag is imported? QUESTION: I have a package that I just made and I have an "old-mode" that basically makes it work like it worked before: importing everything into the current namespace. One of the nice things about having this as a package is ...
[ "perl", "import", "package", "warnings" ]
6
11
443
2
0
2008-10-09T14:29:37.680000
2008-10-09T14:56:10.747000
187,535
187,546
Is it important that Visual Studio 2008 thinks it's the wrong edition?
I installed Visual Studio 2008 Standard Edition a month or so ago after a reformat (on Vista64, if that matters). I got it for free from one of those "Heroes Happen Here" launch events. I then installed SQL Server 2008 Express Edition a week or so ago (we're supposed to be getting that for free in the mail but I gave u...
To be honest, I wouldn't tempt it. This is sort of like a knock in the engine, but the car drives fine. Then one day you get stranded on the side of the road (or maybe not.) I would suggest an uninstall and a reinstall to be safe. I've had a similar run in with Visual Studio 2008 and that's exactly what I ended up doin...
Is it important that Visual Studio 2008 thinks it's the wrong edition? I installed Visual Studio 2008 Standard Edition a month or so ago after a reformat (on Vista64, if that matters). I got it for free from one of those "Heroes Happen Here" launch events. I then installed SQL Server 2008 Express Edition a week or so a...
TITLE: Is it important that Visual Studio 2008 thinks it's the wrong edition? QUESTION: I installed Visual Studio 2008 Standard Edition a month or so ago after a reformat (on Vista64, if that matters). I got it for free from one of those "Heroes Happen Here" launch events. I then installed SQL Server 2008 Express Edit...
[ "sql-server", "visual-studio", "visual-studio-2008", "installation" ]
3
2
379
3
0
2008-10-09T14:29:57.257000
2008-10-09T14:35:00.477000
187,537
187,557
Is there a case insensitive jQuery :contains selector?
Is there a case insensitive version of the:contains jQuery selector or should I do the work manually by looping over all elements and comparing their.text() to my string?
What I ended up doing for jQuery 1.2 is: jQuery.extend( jQuery.expr[':'], { Contains: "jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0" }); This will extend jquery to have a:Contains selector that is case insensitive, the:contains selector remains unchanged. Edit: For jQuery 1.3 (thanks @user95227) and la...
Is there a case insensitive jQuery :contains selector? Is there a case insensitive version of the:contains jQuery selector or should I do the work manually by looping over all elements and comparing their.text() to my string?
TITLE: Is there a case insensitive jQuery :contains selector? QUESTION: Is there a case insensitive version of the:contains jQuery selector or should I do the work manually by looping over all elements and comparing their.text() to my string? ANSWER: What I ended up doing for jQuery 1.2 is: jQuery.extend( jQuery.expr...
[ "javascript", "jquery", "jquery-selectors" ]
151
128
79,817
12
0
2008-10-09T14:30:19.830000
2008-10-09T14:37:24.293000
187,550
189,299
Preprocessing source code as a part of a maven build
I have a lot of Java source code that requires custom pre-processing. I'd like rid of it but that's not feasible right now so I'm stuck with it. Given that I have an unfortunate problem that shouldn't have existed in the first place, how do I solve it using maven? (For the full story, I'm replacing a python-based build...
This is something that is very doable and I've done something very similar in the past. An example from a project of mine, where I used the antrun plug-in to execute an external program to process sources: org.apache.maven.plugins maven-antrun-plugin process-sources process-sources run Note the tag where I indicate the...
Preprocessing source code as a part of a maven build I have a lot of Java source code that requires custom pre-processing. I'd like rid of it but that's not feasible right now so I'm stuck with it. Given that I have an unfortunate problem that shouldn't have existed in the first place, how do I solve it using maven? (F...
TITLE: Preprocessing source code as a part of a maven build QUESTION: I have a lot of Java source code that requires custom pre-processing. I'd like rid of it but that's not feasible right now so I'm stuck with it. Given that I have an unfortunate problem that shouldn't have existed in the first place, how do I solve ...
[ "java", "maven-2", "build-process" ]
15
8
8,798
3
0
2008-10-09T14:35:28.120000
2008-10-09T21:34:14.360000
187,551
708,841
Does ASP.net health monitoring work with asmx web services
I'm trying to use ASP.net health monitoring to log unhandled exceptions from an asmx web service. I've enabled health monitoring in the web.config but it's not logging anything. Does health monitoring work with asmx web services? I've googled around and seems other people have asked the same question but never got a de...
Please do not post a response unless it answers the question being asked. Half answers to something other than the question confuses the reader. Health monitoring has nothing to do with either "really unhandled" ASP.NET exceptions or the Application_Error event. The answer is no. I have digged this a bit and for some r...
Does ASP.net health monitoring work with asmx web services I'm trying to use ASP.net health monitoring to log unhandled exceptions from an asmx web service. I've enabled health monitoring in the web.config but it's not logging anything. Does health monitoring work with asmx web services? I've googled around and seems o...
TITLE: Does ASP.net health monitoring work with asmx web services QUESTION: I'm trying to use ASP.net health monitoring to log unhandled exceptions from an asmx web service. I've enabled health monitoring in the web.config but it's not logging anything. Does health monitoring work with asmx web services? I've googled ...
[ "c#", "asp.net", "asmx", "health-monitoring" ]
4
9
2,188
5
0
2008-10-09T14:35:48.727000
2009-04-02T08:44:49.283000
187,552
187,563
How do I capture an mp3 stream with python
What's the best way of capturing an mp3 stream coming off of http and saving it to disk with python? Thus far I've tried target = open(target_path, "w") conn = urllib.urlopen(stream_url) while True: target.write(conn.read(buf_size)) This gives me data but its garbled or wont play in mp3 players.
If you're on Windows, you might accidentally be doing CRLF conversions, corrupting the binary data. Try opening target in binary mode: target = open(target_path, "wb")
How do I capture an mp3 stream with python What's the best way of capturing an mp3 stream coming off of http and saving it to disk with python? Thus far I've tried target = open(target_path, "w") conn = urllib.urlopen(stream_url) while True: target.write(conn.read(buf_size)) This gives me data but its garbled or wont p...
TITLE: How do I capture an mp3 stream with python QUESTION: What's the best way of capturing an mp3 stream coming off of http and saving it to disk with python? Thus far I've tried target = open(target_path, "w") conn = urllib.urlopen(stream_url) while True: target.write(conn.read(buf_size)) This gives me data but its...
[ "python", "streaming" ]
11
15
5,649
3
0
2008-10-09T14:36:02.003000
2008-10-09T14:40:25.037000
187,560
188,684
How to migrate a 3rd party web part from SharePoint 2 (2003) to SharePoint 3 (2007)
I am migrating a site from SharePoint 2 to 3 (in fact, from SharePoint Portal Server 2003 to Microsoft Office SharePoint Server 2007). There are a handful of 3rd party web parts and since this is a migration, not an in-place upgrade, I need to install these web parts on the new farm. How do I do this, given that I have...
You can still install.CAB files with WSSv3 using the same STSADM command as you used in WSSv2 STSADM -o addwppack -filename However, maybe you should get in touch with the providers of these 3rd party web parts? Perhaps they will have versions for WSSv3 packaged as WSP's? Also can you be sure that the WSSv2 versions wi...
How to migrate a 3rd party web part from SharePoint 2 (2003) to SharePoint 3 (2007) I am migrating a site from SharePoint 2 to 3 (in fact, from SharePoint Portal Server 2003 to Microsoft Office SharePoint Server 2007). There are a handful of 3rd party web parts and since this is a migration, not an in-place upgrade, I ...
TITLE: How to migrate a 3rd party web part from SharePoint 2 (2003) to SharePoint 3 (2007) QUESTION: I am migrating a site from SharePoint 2 to 3 (in fact, from SharePoint Portal Server 2003 to Microsoft Office SharePoint Server 2007). There are a handful of 3rd party web parts and since this is a migration, not an in...
[ "sharepoint", "web-parts", "sharepoint-upgrade" ]
0
2
563
2
0
2008-10-09T14:38:45.337000
2008-10-09T18:59:21.473000
187,567
187,931
How can I stop my MFC application from calling OnFileNew() when it starts?
I used Visual Studio's Application Wizard to create a skeleton MFC program with a multi-document interface. When I start this program, it automatically creates a child frame, which I don't want it to do - I need the main frame's client area to be empty until the user chooses to open a file. The debugger tells me that a...
This worked for me -- change if (!ProcessShellCommand(cmdInfo)) to if (cmdInfo.m_nShellCommand!= CCommandLineInfo::FileNew &&!ProcessShellCommand(cmdInfo)) in your app's InitInstance() function.
How can I stop my MFC application from calling OnFileNew() when it starts? I used Visual Studio's Application Wizard to create a skeleton MFC program with a multi-document interface. When I start this program, it automatically creates a child frame, which I don't want it to do - I need the main frame's client area to b...
TITLE: How can I stop my MFC application from calling OnFileNew() when it starts? QUESTION: I used Visual Studio's Application Wizard to create a skeleton MFC program with a multi-document interface. When I start this program, it automatically creates a child frame, which I don't want it to do - I need the main frame'...
[ "c++", "mfc" ]
2
4
3,850
4
0
2008-10-09T14:41:31.760000
2008-10-09T15:55:14.607000
187,576
187,909
How to read remote XML file the most efficiently way?
I am developing a little app that retrieves an XML file, located on a remote server ( http://example.com/myfile.xml ) This file is relatively big, and it contains a big list of geolocations with other information that I need to use for my app. So I read this file remotely once and insert it into a little SqlCE file ( d...
Re protobuf-net, there isn't a separate download for the CF version at the moment, but there is a csproj in the source for both CF 2.0 and CF 3.5. To clarify on your question; actually protobuf-net doesn't even use a.proto file (at the moment); a.proto file just describes what the data is - protobuf-net simply looks at...
How to read remote XML file the most efficiently way? I am developing a little app that retrieves an XML file, located on a remote server ( http://example.com/myfile.xml ) This file is relatively big, and it contains a big list of geolocations with other information that I need to use for my app. So I read this file re...
TITLE: How to read remote XML file the most efficiently way? QUESTION: I am developing a little app that retrieves an XML file, located on a remote server ( http://example.com/myfile.xml ) This file is relatively big, and it contains a big list of geolocations with other information that I need to use for my app. So I...
[ "c#", "xml", "compact-framework", "sdf", "sql-server-mobile" ]
2
1
3,146
3
0
2008-10-09T14:43:19.273000
2008-10-09T15:50:31.230000
187,583
187,591
Do I need to protect read access to an STL container in a multithreading environment?
I have one std::list<> container and these threads: One writer thread which adds elements indefinitely. One reader/writer thread which reads and removes elements while available. Several reader threads which access the SIZE of the container (by using the size() method) There is a normal mutex which protects the access ...
Yes, the read threads will need some sort of mutex control, otherwise the write will change things from under it. A reader/writer mutex should be enough. But strictly speaking this is an implmentation-specific issue. It's possible that an implementation may have mutable members even in const objects that are read-only ...
Do I need to protect read access to an STL container in a multithreading environment? I have one std::list<> container and these threads: One writer thread which adds elements indefinitely. One reader/writer thread which reads and removes elements while available. Several reader threads which access the SIZE of the con...
TITLE: Do I need to protect read access to an STL container in a multithreading environment? QUESTION: I have one std::list<> container and these threads: One writer thread which adds elements indefinitely. One reader/writer thread which reads and removes elements while available. Several reader threads which access t...
[ "c++", "multithreading", "visual-c++", "stl", "concurrency" ]
9
10
3,997
8
0
2008-10-09T14:47:05.007000
2008-10-09T14:49:21.150000
187,587
187,597
A Windows equivalent of the Unix tail command
I'm looking for the equivalent of the Unix 'tail' command that will allow me to watch the output of a log file while it is being written to.
I'd suggest installing something like GNU Utilities for Win32. It has most favourites, including tail.
A Windows equivalent of the Unix tail command I'm looking for the equivalent of the Unix 'tail' command that will allow me to watch the output of a log file while it is being written to.
TITLE: A Windows equivalent of the Unix tail command QUESTION: I'm looking for the equivalent of the Unix 'tail' command that will allow me to watch the output of a log file while it is being written to. ANSWER: I'd suggest installing something like GNU Utilities for Win32. It has most favourites, including tail.
[ "windows", "tail" ]
510
151
668,391
26
0
2008-10-09T14:48:15.240000
2008-10-09T14:50:45.030000
187,588
2,273,239
Self Signed Certificate in Windows without makecert?
We have a shrink wrap type Windows server application where we need to create a self signed certificate on the server to be used by some WCF web services. From our searches on the web, it appears that the makecert utility in the PlatformSDK from Microsoft cannot be distributed with our application, so we're looking for...
[Unfortunately, I can't comment on anything yet, so I'll post this as an answer.] I see that this post is a bit old, but I'm in a similar boat and I found this in the Visual Studio 2008 redist.txt file: Windows SDK Files Subject to the license terms for the software, the following files may be distributed unmodified: ...
Self Signed Certificate in Windows without makecert? We have a shrink wrap type Windows server application where we need to create a self signed certificate on the server to be used by some WCF web services. From our searches on the web, it appears that the makecert utility in the PlatformSDK from Microsoft cannot be d...
TITLE: Self Signed Certificate in Windows without makecert? QUESTION: We have a shrink wrap type Windows server application where we need to create a self signed certificate on the server to be used by some WCF web services. From our searches on the web, it appears that the makecert utility in the PlatformSDK from Mic...
[ ".net", "windows", "wcf", "openssl", "certificate" ]
8
8
11,929
5
0
2008-10-09T14:48:49.030000
2010-02-16T13:41:25.047000
187,593
187,611
Does the ASP.NET Development Server (a.k.a. Cassini) support SSL?
We are trying to get our.NET devs to use the ASP.NET Development Server (VS2008) for web development instead of a local instance of IIS. I received this response as a reason why some of our devs can't use it: "Our XXXX Online Sales application uses SSL to protect passwords. While Visual Studio does permit some basic we...
The web server built into VS doesn't not support SSL. It is meant to be a quick way to test an application. For SSL, you would need to use IIS and get a certificate.
Does the ASP.NET Development Server (a.k.a. Cassini) support SSL? We are trying to get our.NET devs to use the ASP.NET Development Server (VS2008) for web development instead of a local instance of IIS. I received this response as a reason why some of our devs can't use it: "Our XXXX Online Sales application uses SSL t...
TITLE: Does the ASP.NET Development Server (a.k.a. Cassini) support SSL? QUESTION: We are trying to get our.NET devs to use the ASP.NET Development Server (VS2008) for web development instead of a local instance of IIS. I received this response as a reason why some of our devs can't use it: "Our XXXX Online Sales appl...
[ "visual-studio-2008", "iis", "cassini" ]
5
7
1,782
2
0
2008-10-09T14:49:58.373000
2008-10-09T14:53:19.520000
187,594
188,405
Seriously, should I write bad PHP code?
I'm doing some PHP work recently, and in all the code I've seen, people tend to use few methods. (They also tend to use few variables, but that's another issue.) I was wondering why this is, and I found this note "A function call with one parameter and an empty function body takes about the same time as doing 7-8 $loca...
I think Joomla and Wordpress are not the greatest examples of good PHP code, with no offense. I have nothing personal against the people working on it and it's great how they enable people to have a website/blog and I know that a lot of people spend all their free time on either of those projects but the code quality i...
Seriously, should I write bad PHP code? I'm doing some PHP work recently, and in all the code I've seen, people tend to use few methods. (They also tend to use few variables, but that's another issue.) I was wondering why this is, and I found this note "A function call with one parameter and an empty function body take...
TITLE: Seriously, should I write bad PHP code? QUESTION: I'm doing some PHP work recently, and in all the code I've seen, people tend to use few methods. (They also tend to use few variables, but that's another issue.) I was wondering why this is, and I found this note "A function call with one parameter and an empty ...
[ "php", "optimization", "code-generation", "translation" ]
18
57
5,432
16
0
2008-10-09T14:50:10.930000
2008-10-09T17:53:27.003000
187,608
189,461
Software project manager: what is the best amount and quality of purely technical background?
We are looking at hiring a software development project manager. His job is going to be concerned with running multiple dedicated project teams focused on delivery of software for external customers. He will also need to provide support to our business development unit and oversee post-implementations support of the af...
As with any position, you need to assess first and foremost what skills and experience you need on the team for you to be successful. Then hire to fill the gap for the skills that you do not already have on your team. If you already have a team with strong technical and technical leadership skills then you don't need t...
Software project manager: what is the best amount and quality of purely technical background? We are looking at hiring a software development project manager. His job is going to be concerned with running multiple dedicated project teams focused on delivery of software for external customers. He will also need to provi...
TITLE: Software project manager: what is the best amount and quality of purely technical background? QUESTION: We are looking at hiring a software development project manager. His job is going to be concerned with running multiple dedicated project teams focused on delivery of software for external customers. He will ...
[ "project-management" ]
2
4
1,190
8
0
2008-10-09T14:53:10.363000
2008-10-09T22:35:34.157000
187,614
268,104
Using Delegates with Exchange Web Services
Has anyone used delegates with exchnage web services? I would like one user to be able to control other users' calendars in Exchange. I'm finding this problem to be a little tricky, and I'd like to see how others have been able to get it to work properly.
I'm just getting started here, but i managed to get access to Resource calendars via a delegate account. I used the recommendations from this article about delegate account and resource accounts. (Resource accounts are tricky because they are disabled in the AD, and you have to use a delegate account to get access to t...
Using Delegates with Exchange Web Services Has anyone used delegates with exchnage web services? I would like one user to be able to control other users' calendars in Exchange. I'm finding this problem to be a little tricky, and I'd like to see how others have been able to get it to work properly.
TITLE: Using Delegates with Exchange Web Services QUESTION: Has anyone used delegates with exchnage web services? I would like one user to be able to control other users' calendars in Exchange. I'm finding this problem to be a little tricky, and I'd like to see how others have been able to get it to work properly. AN...
[ "delegates", "exchange-server", "exchangewebservices" ]
1
3
4,721
1
0
2008-10-09T14:54:03.387000
2008-11-06T09:45:31.147000
187,619
187,946
Is there a JavaScript solution to generating a "table of contents" for a page?
I have headers in through tags. Is there a way that I can use JavaScript to generate a table of contents for the contents that serves as anchor tags as well? I would like the output to be something like: Header 1 Header 1 Header 2 Header 3 I am not currently using a JavaScript framework, but I don't see why I couldn't ...
I couldn't resist putting together a quick implementation. Add the following script anywhere on your page: window.onload = function () { var toc = ""; var level = 0; document.getElementById("contents").innerHTML = document.getElementById("contents").innerHTML.replace( / ([^<]+)<\/h([\d])>/gi, function (str, openLevel,...
Is there a JavaScript solution to generating a "table of contents" for a page? I have headers in through tags. Is there a way that I can use JavaScript to generate a table of contents for the contents that serves as anchor tags as well? I would like the output to be something like: Header 1 Header 1 Header 2 Header 3 I...
TITLE: Is there a JavaScript solution to generating a "table of contents" for a page? QUESTION: I have headers in through tags. Is there a way that I can use JavaScript to generate a table of contents for the contents that serves as anchor tags as well? I would like the output to be something like: Header 1 Header 1 H...
[ "javascript", "tableofcontents", "html-heading" ]
36
53
36,314
16
0
2008-10-09T14:54:31.700000
2008-10-09T15:59:43.427000
187,620
187,642
Can a WinForms app be configured to run as "x86" without recompiling?
Can a WinForms app compiled for "Any CPU" be configured to run as "x86" on a 64-bit server without recompiling the app? Specifically, I'm looking for an app.config setting or Control Panel applet to accomplish this end. All the customer's clients are x86, but the server is x64, and we like to install the WinForms app o...
From http://www.request-response.com/blog/PermaLink,guid,34966ef8-3142-46b2-84e0-372b5c36ddcc.aspx You can, however, control and override this default behaviour even after your code has been compiled. There's a handy tool called corflags.exe present in the SDK that allows you to force 'anycpu' compiled code to use 32-b...
Can a WinForms app be configured to run as "x86" without recompiling? Can a WinForms app compiled for "Any CPU" be configured to run as "x86" on a 64-bit server without recompiling the app? Specifically, I'm looking for an app.config setting or Control Panel applet to accomplish this end. All the customer's clients are...
TITLE: Can a WinForms app be configured to run as "x86" without recompiling? QUESTION: Can a WinForms app compiled for "Any CPU" be configured to run as "x86" on a 64-bit server without recompiling the app? Specifically, I'm looking for an app.config setting or Control Panel applet to accomplish this end. All the cust...
[ ".net", "winforms", "configuration", "x86", "x86-64" ]
4
11
1,565
2
0
2008-10-09T14:54:54.213000
2008-10-09T14:58:49.867000
187,621
187,660
How to make a python, command-line program autocomplete arbitrary things NOT interpreter
I am aware of how to setup autocompletion of python objects in the python interpreter (on unix). Google shows many hits for explanations on how to do this. Unfortunately, there are so many references to that it is difficult to find what I need to do, which is slightly different. I need to know how to enable, tab/auto c...
Use Python's readline bindings. For example, import readline def completer(text, state): options = [i for i in commands if i.startswith(text)] if state < len(options): return options[state] else: return None readline.parse_and_bind("tab: complete") readline.set_completer(completer) The official module docs aren't muc...
How to make a python, command-line program autocomplete arbitrary things NOT interpreter I am aware of how to setup autocompletion of python objects in the python interpreter (on unix). Google shows many hits for explanations on how to do this. Unfortunately, there are so many references to that it is difficult to find...
TITLE: How to make a python, command-line program autocomplete arbitrary things NOT interpreter QUESTION: I am aware of how to setup autocompletion of python objects in the python interpreter (on unix). Google shows many hits for explanations on how to do this. Unfortunately, there are so many references to that it is...
[ "python", "linux", "unix", "command-line", "autocomplete" ]
124
84
84,649
9
0
2008-10-09T14:55:02.480000
2008-10-09T15:01:38.597000
187,627
187,662
Problem with static library in C++
I'm trying to use a static library created by me in Visual C++ 2005 (unmanaged C++). I declare one function "int myF(int a);" into a.h file, I implement it in a.cpp file, I compile it - the.lib file is produced. I create a new project (a separate solution) in VC++ 2005 (also native C++), I add the paths for the include...
Try setting additional dependencies in the linker input for a project properties.
Problem with static library in C++ I'm trying to use a static library created by me in Visual C++ 2005 (unmanaged C++). I declare one function "int myF(int a);" into a.h file, I implement it in a.cpp file, I compile it - the.lib file is produced. I create a new project (a separate solution) in VC++ 2005 (also native C+...
TITLE: Problem with static library in C++ QUESTION: I'm trying to use a static library created by me in Visual C++ 2005 (unmanaged C++). I declare one function "int myF(int a);" into a.h file, I implement it in a.cpp file, I compile it - the.lib file is produced. I create a new project (a separate solution) in VC++ 20...
[ "visual-studio", "static", "linker" ]
1
0
2,065
4
0
2008-10-09T14:56:26.893000
2008-10-09T15:01:51.703000
187,629
187,766
How do I preserve installed applications when migrating Ubuntu to another platform?
I'm looking at maybe moving from an older AMD64 to a new Intel dual-core which is 32 bit. Installation isn't a problem but can I transfer all the installed apps? I haven't been able to find anything so far on Google except where the migration is to a similar platform and file-system. I won't change the filesystem but t...
You can save your list of packages easily: see "man dpkg" and search for --set-selections and --get-selections. The basic of it, though is that to save the list of packages: dpkg --get-selections > package_list To restore that list on another system: cat package_list | sudo dpkg --set-selections && sudo apt-get dselect...
How do I preserve installed applications when migrating Ubuntu to another platform? I'm looking at maybe moving from an older AMD64 to a new Intel dual-core which is 32 bit. Installation isn't a problem but can I transfer all the installed apps? I haven't been able to find anything so far on Google except where the mig...
TITLE: How do I preserve installed applications when migrating Ubuntu to another platform? QUESTION: I'm looking at maybe moving from an older AMD64 to a new Intel dual-core which is 32 bit. Installation isn't a problem but can I transfer all the installed apps? I haven't been able to find anything so far on Google ex...
[ "ubuntu", "migrate", "apt", "dpkg" ]
14
34
17,348
7
0
2008-10-09T14:57:09.433000
2008-10-09T15:19:51.680000
187,640
187,650
Default parameters with C++ constructors
Is it good practice to have a class constructor that uses default parameters, or should I use separate overloaded constructors? For example: // Use this... class foo { private: std::string name_; unsigned int age_; public: foo(const std::string& name = "", const unsigned int age = 0): name_(name), age_(age) {... } }; ...
Definitely a matter of style. I prefer constructors with default parameters, so long as the parameters make sense. Classes in the standard use them as well, which speaks in their favor. One thing to watch out for is if you have defaults for all but one parameter, your class can be implicitly converted from that paramet...
Default parameters with C++ constructors Is it good practice to have a class constructor that uses default parameters, or should I use separate overloaded constructors? For example: // Use this... class foo { private: std::string name_; unsigned int age_; public: foo(const std::string& name = "", const unsigned int age...
TITLE: Default parameters with C++ constructors QUESTION: Is it good practice to have a class constructor that uses default parameters, or should I use separate overloaded constructors? For example: // Use this... class foo { private: std::string name_; unsigned int age_; public: foo(const std::string& name = "", cons...
[ "c++", "constructor", "coding-style", "overloading" ]
144
102
318,397
12
0
2008-10-09T14:58:34.313000
2008-10-09T14:59:28.587000
187,644
1,567,768
Apply file structure diff/patch on remote system?
Is there a tool that creates a diff of a file structure, perhaps based on an MD5 manifest. My goal is to send a package across the wire that contains new/updated files and a list of files to remove. It needs to copy over new/updated files and remove files that have been deleted on the source file structure?
@vfilby I'm the process of implementing something similar. I've been using rsync for a while, but it gets funky when deploying to remote server with permission changes that are out of my control. With rsync you can choose to not include permissions, but they still endup being considered for some reason. I'm now using g...
Apply file structure diff/patch on remote system? Is there a tool that creates a diff of a file structure, perhaps based on an MD5 manifest. My goal is to send a package across the wire that contains new/updated files and a list of files to remove. It needs to copy over new/updated files and remove files that have been...
TITLE: Apply file structure diff/patch on remote system? QUESTION: Is there a tool that creates a diff of a file structure, perhaps based on an MD5 manifest. My goal is to send a package across the wire that contains new/updated files and a list of files to remove. It needs to copy over new/updated files and remove fi...
[ "filesystems", "diff" ]
1
1
581
2
0
2008-10-09T14:58:55.873000
2009-10-14T17:24:37.103000
187,655
187,679
Are HTTPS headers encrypted?
When sending data over HTTPS, I know the content is encrypted, however I hear mixed answers about whether the headers are encrypted, or how much of the header is encrypted. How much of HTTPS headers are encrypted? Including GET/POST request URLs, Cookies, etc.
All the HTTP headers are encrypted †. That's why SSL on vhosts doesn't work too well - you need a dedicated IP address because the Host header is encrypted. † The Server Name Identification (SNI) standard means that the hostname may not be encrypted if you're using TLS. Also, whether you're using SNI or not, the TCP an...
Are HTTPS headers encrypted? When sending data over HTTPS, I know the content is encrypted, however I hear mixed answers about whether the headers are encrypted, or how much of the header is encrypted. How much of HTTPS headers are encrypted? Including GET/POST request URLs, Cookies, etc.
TITLE: Are HTTPS headers encrypted? QUESTION: When sending data over HTTPS, I know the content is encrypted, however I hear mixed answers about whether the headers are encrypted, or how much of the header is encrypted. How much of HTTPS headers are encrypted? Including GET/POST request URLs, Cookies, etc. ANSWER: All...
[ "security", "post", "encryption", "https", "get" ]
780
705
327,781
9
0
2008-10-09T15:00:35.650000
2008-10-09T15:04:51.073000
187,676
187,738
Java equivalents of C# String.Format() and String.Join()
I know this is a bit of a newbie question, but are there equivalents to C#'s string operations in Java? Specifically, I'm talking about String.Format and String.Join.
The Java String object has a format method (as of 1.5), but no join method. To get a bunch of useful String utility methods not already included you could use org.apache.commons.lang.StringUtils.
Java equivalents of C# String.Format() and String.Join() I know this is a bit of a newbie question, but are there equivalents to C#'s string operations in Java? Specifically, I'm talking about String.Format and String.Join.
TITLE: Java equivalents of C# String.Format() and String.Join() QUESTION: I know this is a bit of a newbie question, but are there equivalents to C#'s string operations in Java? Specifically, I'm talking about String.Format and String.Join. ANSWER: The Java String object has a format method (as of 1.5), but no join m...
[ "c#", "java", "string" ]
112
91
76,733
16
0
2008-10-09T15:04:34.177000
2008-10-09T15:14:11.333000
187,683
1,013,036
Concurrency in RIA
This'll be my first question on this platform. I've done lots of development using Flex, WebORB and ASP.NET. We have solved Concurrency problems with messaging (Pessimistic Concurrency Control). This works pretty good but it also makes the whole application dependent of the messaging. No messaging, no concurrency contr...
This is something I've done before - as the original data was coming from an SQL Server database we just used a rowversion typed column in each DTO to determine if it had changed while the user was working on it. At this point you can either barf on the error or try and figure out a way to merge the changes, but at lea...
Concurrency in RIA This'll be my first question on this platform. I've done lots of development using Flex, WebORB and ASP.NET. We have solved Concurrency problems with messaging (Pessimistic Concurrency Control). This works pretty good but it also makes the whole application dependent of the messaging. No messaging, n...
TITLE: Concurrency in RIA QUESTION: This'll be my first question on this platform. I've done lots of development using Flex, WebORB and ASP.NET. We have solved Concurrency problems with messaging (Pessimistic Concurrency Control). This works pretty good but it also makes the whole application dependent of the messagin...
[ "concurrency", "weborb" ]
0
1
379
1
0
2008-10-09T15:05:20.713000
2009-06-18T14:40:29.580000
187,713
187,808
Converting floating point to fixed point
In C++, what's the generic way to convert any floating point value (float) to fixed point (int, 16:16 or 24:8)? EDIT: For clarification, fixed-point values have two parts to them: an integer part and a fractional part. The integer part can be represented by a signed or unsigned integer data type. The fractional part is...
Here you go: // A signed fixed-point 16:16 class class FixedPoint_16_16 { short intPart; unsigned short fracPart; public: FixedPoint_16_16(double d) { *this = d; // calls operator= } FixedPoint_16_16& operator=(double d) { intPart = static_cast (d); fracPart = static_cast (numeric_limits + 1.0)*d); return *this; } /...
Converting floating point to fixed point In C++, what's the generic way to convert any floating point value (float) to fixed point (int, 16:16 or 24:8)? EDIT: For clarification, fixed-point values have two parts to them: an integer part and a fractional part. The integer part can be represented by a signed or unsigned ...
TITLE: Converting floating point to fixed point QUESTION: In C++, what's the generic way to convert any floating point value (float) to fixed point (int, 16:16 or 24:8)? EDIT: For clarification, fixed-point values have two parts to them: an integer part and a fractional part. The integer part can be represented by a s...
[ "c++", "fixed-point" ]
27
31
55,882
6
0
2008-10-09T15:10:07.597000
2008-10-09T15:27:11.447000
187,736
1,674,175
Command Line Password Prompt in PHP
I'm writing a command line tool to help my web app. It needs a password to connect to the service. I'd like the script to show a password prompt so I don't have to pass it as a command line argument. That's easy enough, but I'd like it to not echo the password to the screen as it's typed. How can I do this with PHP? Bo...
Found on sitepoint. function prompt_silent($prompt = "Enter Password:") { if (preg_match('/^win/i', PHP_OS)) { $vbscript = sys_get_temp_dir(). 'prompt_password.vbs'; file_put_contents( $vbscript, 'wscript.echo(InputBox("'. addslashes($prompt). '", "", "password here"))'); $command = "cscript //nologo ". escapeshellarg(...
Command Line Password Prompt in PHP I'm writing a command line tool to help my web app. It needs a password to connect to the service. I'd like the script to show a password prompt so I don't have to pass it as a command line argument. That's easy enough, but I'd like it to not echo the password to the screen as it's t...
TITLE: Command Line Password Prompt in PHP QUESTION: I'm writing a command line tool to help my web app. It needs a password to connect to the service. I'd like the script to show a password prompt so I don't have to pass it as a command line argument. That's easy enough, but I'd like it to not echo the password to th...
[ "php", "passwords" ]
84
43
50,214
11
0
2008-10-09T15:13:38.043000
2009-11-04T14:41:55.480000
187,741
187,846
Continuous Integration with Nant
I am preparing to use continuous integration for the first time. I will be using Nant for the automated build and testing tasks, and am trying to find the appropriate CI tool to poll the repository and execute the Nant script. I have so far loosely researched the following: Hudson Cruise Control Draco My sense so far i...
We use CruiseControl.NET as our CI server along with our full build system being in NAnt. It has worked exceptionally well over the past 5 years. I've since looked into other alternatives and have not been able to find any compelling reason(s) to switch. CruiseControl.NET has amazing support for different source contro...
Continuous Integration with Nant I am preparing to use continuous integration for the first time. I will be using Nant for the automated build and testing tasks, and am trying to find the appropriate CI tool to poll the repository and execute the Nant script. I have so far loosely researched the following: Hudson Cruis...
TITLE: Continuous Integration with Nant QUESTION: I am preparing to use continuous integration for the first time. I will be using Nant for the automated build and testing tasks, and am trying to find the appropriate CI tool to poll the repository and execute the Nant script. I have so far loosely researched the follo...
[ "continuous-integration", "build-automation", "nant", "automated-tests" ]
3
4
1,667
10
0
2008-10-09T15:14:53.923000
2008-10-09T15:35:02.697000
187,742
187,793
How do I tell if a class property has a public set (.NET)?
I have this: public string Log { get { return log; } protected set { if (log!= value) { MarkModified(PropertyNames.Log, log); log = value; } } } And my utility class for databinding does this: PropertyInfo pi = ReflectionHelper.GetPropertyInfo(boundObjectType, sourceProperty); if (!pi.CanWrite) SetReadOnlyCharacteris...
An alternative to the suggested changes to ReflectionHelper in other answers is to call pi.GetSetMethod(false) and see if the result is null.
How do I tell if a class property has a public set (.NET)? I have this: public string Log { get { return log; } protected set { if (log!= value) { MarkModified(PropertyNames.Log, log); log = value; } } } And my utility class for databinding does this: PropertyInfo pi = ReflectionHelper.GetPropertyInfo(boundObjectType,...
TITLE: How do I tell if a class property has a public set (.NET)? QUESTION: I have this: public string Log { get { return log; } protected set { if (log!= value) { MarkModified(PropertyNames.Log, log); log = value; } } } And my utility class for databinding does this: PropertyInfo pi = ReflectionHelper.GetPropertyInf...
[ "c#", ".net", "data-binding", "reflection" ]
6
1
389
5
0
2008-10-09T15:14:54.857000
2008-10-09T15:24:13.717000
187,761
189,778
Recursive Lock (Mutex) vs Non-Recursive Lock (Mutex)
POSIX allows mutexes to be recursive. That means the same thread can lock the same mutex twice and won't deadlock. Of course it also needs to unlock it twice, otherwise no other thread can obtain the mutex. Not all systems supporting pthreads also support recursive mutexes, but if they want to be POSIX conform, they ha...
The difference between a recursive and non-recursive mutex has to do with ownership. In the case of a recursive mutex, the kernel has to keep track of the thread who actually obtained the mutex the first time around so that it can detect the difference between recursion vs. a different thread that should block instead....
Recursive Lock (Mutex) vs Non-Recursive Lock (Mutex) POSIX allows mutexes to be recursive. That means the same thread can lock the same mutex twice and won't deadlock. Of course it also needs to unlock it twice, otherwise no other thread can obtain the mutex. Not all systems supporting pthreads also support recursive m...
TITLE: Recursive Lock (Mutex) vs Non-Recursive Lock (Mutex) QUESTION: POSIX allows mutexes to be recursive. That means the same thread can lock the same mutex twice and won't deadlock. Of course it also needs to unlock it twice, otherwise no other thread can obtain the mutex. Not all systems supporting pthreads also s...
[ "multithreading", "locking", "mutex", "deadlock", "recursive-mutex" ]
208
170
137,150
8
0
2008-10-09T15:19:13.757000
2008-10-10T01:09:43.910000
187,768
187,842
Can I show file copy progress using FileInfo.CopyTo() in .NET?
I've created a copy utility in c# (.NET 2.0 Framework) that copies files, directories and recursive sub directories etc. The program has a GUI that shows the current file being copied, the current file number (sequence), the total number of files to be copied and the percentage completed for the copy operations. There ...
The FileInfo.CopyTo is basically a wrapper around the Win32 API call "CopyFile" in the kernel32.dll. This method does not support progress callback. However, the CopyFileEx method does, and you can write your own.NET wrapper around it in a few minutes, like it is described here: http://www.pinvoke.net/default.aspx/kern...
Can I show file copy progress using FileInfo.CopyTo() in .NET? I've created a copy utility in c# (.NET 2.0 Framework) that copies files, directories and recursive sub directories etc. The program has a GUI that shows the current file being copied, the current file number (sequence), the total number of files to be copi...
TITLE: Can I show file copy progress using FileInfo.CopyTo() in .NET? QUESTION: I've created a copy utility in c# (.NET 2.0 Framework) that copies files, directories and recursive sub directories etc. The program has a GUI that shows the current file being copied, the current file number (sequence), the total number o...
[ "c#", ".net", "copy", "fileinfo" ]
31
38
42,253
7
0
2008-10-09T15:20:53.130000
2008-10-09T15:34:07.487000
187,770
187,785
Copy tables from one database to another in SQL Server
I have a database called foo and a database called bar. I have a table in foo called tblFoobar that I want to move (data and all) to database bar from database foo. What is the SQL statement to do this?
On SQL Server? and on the same database server? Use three part naming. INSERT INTO bar..tblFoobar( *fieldlist* ) SELECT *fieldlist* FROM foo..tblFoobar This just moves the data. If you want to move the table definition (and other attributes such as permissions and indexes), you'll have to do something else.
Copy tables from one database to another in SQL Server I have a database called foo and a database called bar. I have a table in foo called tblFoobar that I want to move (data and all) to database bar from database foo. What is the SQL statement to do this?
TITLE: Copy tables from one database to another in SQL Server QUESTION: I have a database called foo and a database called bar. I have a table in foo called tblFoobar that I want to move (data and all) to database bar from database foo. What is the SQL statement to do this? ANSWER: On SQL Server? and on the same data...
[ "sql", "sql-server", "copy", "migrate", "database-table" ]
343
222
913,191
8
0
2008-10-09T15:20:58.170000
2008-10-09T15:22:46.263000
187,774
188,426
Testing whether a certain type of non-null element exists... somewhere
I have XML that looks like 1 3 2 2 2.3 3 3.... I'm formatting each answer using xsl:for-each. If there is a mean present I have a graphical representation of the mean. For some potential lists of answers the mean will always be null. At the bottom of the page I want to put a legend explaining the graphical representati...
Here's what finally worked for me: That is to say, "do there exist any answer elements for which the mean value is greater than zero". Fortunately I know that the mean value, if there is one, will in fact always be greater than zero -- unfortunately this isn't a generalized solution for this reason. I still think the a...
Testing whether a certain type of non-null element exists... somewhere I have XML that looks like 1 3 2 2 2.3 3 3.... I'm formatting each answer using xsl:for-each. If there is a mean present I have a graphical representation of the mean. For some potential lists of answers the mean will always be null. At the bottom o...
TITLE: Testing whether a certain type of non-null element exists... somewhere QUESTION: I have XML that looks like 1 3 2 2 2.3 3 3.... I'm formatting each answer using xsl:for-each. If there is a mean present I have a graphical representation of the mean. For some potential lists of answers the mean will always be nul...
[ "xml", "xslt" ]
1
1
5,987
5
0
2008-10-09T15:21:28.840000
2008-10-09T18:01:47.097000
187,777
187,867
Get BSSID (MAC address) of wireless access point from C#
How can I get the BSSID / MAC (Media Access Control) address of the wireless access point my system is connected to using C#? Note that I'm interested in the BSSID of the WAP. This is different from the MAC address of the networking portion of the WAP.
The following needs to be executed programmatically: netsh wlan show networks mode=Bssid | findstr "BSSID" The above shows the access point's wireless MAC addresses which is different from: arp -a | findstr 192.168.1.254 This is because the access point has 2 MAC addresses. One for the wireless device and one for the n...
Get BSSID (MAC address) of wireless access point from C# How can I get the BSSID / MAC (Media Access Control) address of the wireless access point my system is connected to using C#? Note that I'm interested in the BSSID of the WAP. This is different from the MAC address of the networking portion of the WAP.
TITLE: Get BSSID (MAC address) of wireless access point from C# QUESTION: How can I get the BSSID / MAC (Media Access Control) address of the wireless access point my system is connected to using C#? Note that I'm interested in the BSSID of the WAP. This is different from the MAC address of the networking portion of t...
[ "c#", "wifi" ]
15
26
85,860
3
0
2008-10-09T15:21:58.963000
2008-10-09T15:38:38.710000
187,779
187,802
Upgrading IIS 5.1 To IIS 6 on Windows XP
Is it possible to update IIS on Windows XP from 5.1 to 6? If so how? Thanks.
No, it is not possible. The version of IIS is tied to a specific version of Windows. XP = IIS 5.1 2003 = IIS 6 2008 = IIS 7 More information available at http://support.microsoft.com/kb/224609.
Upgrading IIS 5.1 To IIS 6 on Windows XP Is it possible to update IIS on Windows XP from 5.1 to 6? If so how? Thanks.
TITLE: Upgrading IIS 5.1 To IIS 6 on Windows XP QUESTION: Is it possible to update IIS on Windows XP from 5.1 to 6? If so how? Thanks. ANSWER: No, it is not possible. The version of IIS is tied to a specific version of Windows. XP = IIS 5.1 2003 = IIS 6 2008 = IIS 7 More information available at http://support.micros...
[ "iis", "iis-6", "windows-xp", "iis-5" ]
16
29
42,956
4
0
2008-10-09T15:22:13.300000
2008-10-09T15:26:07.067000
187,782
336,653
Errors in Aspect Oriented Programming with Policy Injection
When using Aspect Oriented Programming with Policy injection, how do you deal with policy errors gracefully in your design? In Aspect Oriented Programming the objects should be unconcerned with how a particular policy is configured, but a particular policy may throw particular errors. What's the most graceful design to...
If you consider the policy to be an "aspect" of the system then the specific aspect should handle everything that has to do with that policy. The objects should be unaware of the specific policy. This way, if you you need to change the policy in the future, you won't need to change anything in the objects.
Errors in Aspect Oriented Programming with Policy Injection When using Aspect Oriented Programming with Policy injection, how do you deal with policy errors gracefully in your design? In Aspect Oriented Programming the objects should be unconcerned with how a particular policy is configured, but a particular policy may...
TITLE: Errors in Aspect Oriented Programming with Policy Injection QUESTION: When using Aspect Oriented Programming with Policy injection, how do you deal with policy errors gracefully in your design? In Aspect Oriented Programming the objects should be unconcerned with how a particular policy is configured, but a par...
[ "aop", "policy-injection" ]
0
2
201
2
0
2008-10-09T15:22:18.963000
2008-12-03T09:41:09.410000
187,795
187,914
Flex: Accessing functions / components accross mxml pages
For simplicity lets say I have two flex mxml pages. form.mxml button.mxml If the form.mxml page had the following code, it should work fine: button.mxml
You could write a custom method that handles the button click events and raises a custom event. Then in form.mxml you can handle that event. Splitting it up like this is a bit cleaner, as it makes the button.mxml file work on its own. Having Button.mxml have a direct reference to your form causes a tight-coupling betwe...
Flex: Accessing functions / components accross mxml pages For simplicity lets say I have two flex mxml pages. form.mxml button.mxml If the form.mxml page had the following code, it should work fine: button.mxml
TITLE: Flex: Accessing functions / components accross mxml pages QUESTION: For simplicity lets say I have two flex mxml pages. form.mxml button.mxml If the form.mxml page had the following code, it should work fine: button.mxml ANSWER: You could write a custom method that handles the button click events and raises a ...
[ "apache-flex", "mxml" ]
3
4
5,156
3
0
2008-10-09T15:24:29.957000
2008-10-09T15:51:49.527000
187,797
187,951
Are data members allocated in the same memory space as their objects in C++?
Say I've got a class like this: class Test { int x; SomeClass s; } And I instantiate it like this: Test* t = new Test; Is x on the stack, or the heap? What about s?
Each time you "instantiate" an object/symbol using a new (we are speaking C++ here), a new memory zone will be allocated for this object. If not, it will be put on the "local" memory zone. The problem is that I have no standard definition for "local" memory zone. An example This means that, for example: struct A { A() ...
Are data members allocated in the same memory space as their objects in C++? Say I've got a class like this: class Test { int x; SomeClass s; } And I instantiate it like this: Test* t = new Test; Is x on the stack, or the heap? What about s?
TITLE: Are data members allocated in the same memory space as their objects in C++? QUESTION: Say I've got a class like this: class Test { int x; SomeClass s; } And I instantiate it like this: Test* t = new Test; Is x on the stack, or the heap? What about s? ANSWER: Each time you "instantiate" an object/symbol using ...
[ "c++", "memory-management" ]
7
10
1,160
6
0
2008-10-09T15:25:05.523000
2008-10-09T16:02:05.903000
187,799
222,686
Test Data Builder pattern: more useful or more upkeep?
Let me start by saying I'm a huge fan of the elegance of this pattern -- I have a group of basic entities that I have implemented builders for (specifically for testing). However I have found (and this may be the caveat) that as my program evolved I kept having to go back and re-work the builders. In the end, it really...
I like using fluent builders for the object under test to express the nature of the object I'm creating. ObjectMothers tend to get unwieldy and tend to (in the implementations I've come across) end up hiding details of the objects creation. Compare: User fred = CreateUser("fred").WithReputation(900).WithScholarBadge()....
Test Data Builder pattern: more useful or more upkeep? Let me start by saying I'm a huge fan of the elegance of this pattern -- I have a group of basic entities that I have implemented builders for (specifically for testing). However I have found (and this may be the caveat) that as my program evolved I kept having to ...
TITLE: Test Data Builder pattern: more useful or more upkeep? QUESTION: Let me start by saying I'm a huge fan of the elegance of this pattern -- I have a group of basic entities that I have implemented builders for (specifically for testing). However I have found (and this may be the caveat) that as my program evolved...
[ ".net", "unit-testing", "design-patterns" ]
4
8
1,372
3
0
2008-10-09T15:25:23.073000
2008-10-21T17:13:02.480000
187,804
187,824
Automatically kill process that consume too much memory or stall on linux
I would like a "system" that monitors a process and would kill said process if: the process exceeds some memory requirements the process does not respond to a message from the "system" in some period of time I assume this "system" could be something as simple as a monitoring process? A code example of how this could be...
For the first requirement, you might want to look into either using ulimit, or tweaking the kernel OOM-killer settings on your system. Monitoring daemons exist for this sort of thing as well. God is a recent example.
Automatically kill process that consume too much memory or stall on linux I would like a "system" that monitors a process and would kill said process if: the process exceeds some memory requirements the process does not respond to a message from the "system" in some period of time I assume this "system" could be someth...
TITLE: Automatically kill process that consume too much memory or stall on linux QUESTION: I would like a "system" that monitors a process and would kill said process if: the process exceeds some memory requirements the process does not respond to a message from the "system" in some period of time I assume this "syste...
[ "linux", "project-management", "process" ]
7
9
14,304
7
0
2008-10-09T15:26:18.703000
2008-10-09T15:29:19.713000
187,827
188,179
SQL Server STATISTICS
So for this one project, we have a bunch of queries that are executed on a regular basis (every minute or so. I used the "Analyze Query in Database Engine " to check on them. They are pretty simple: select * from tablex where processed='0' There is an index on processed, and each query should return <1000 rows on a tab...
Statistics are what SQL Server uses to determine the viability of how to get data. Let's say, for instance, that you have a table that only has a clustered index on the primary key. When you execute SELECT * FROM tablename WHERE col1=value, SQL Server only has one option, to scan every row in the table to find the matc...
SQL Server STATISTICS So for this one project, we have a bunch of queries that are executed on a regular basis (every minute or so. I used the "Analyze Query in Database Engine " to check on them. They are pretty simple: select * from tablex where processed='0' There is an index on processed, and each query should retu...
TITLE: SQL Server STATISTICS QUESTION: So for this one project, we have a bunch of queries that are executed on a regular basis (every minute or so. I used the "Analyze Query in Database Engine " to check on them. They are pretty simple: select * from tablex where processed='0' There is an index on processed, and each...
[ "sql-server", "database", "indexing", "statistics" ]
14
24
3,169
2
0
2008-10-09T15:30:17.307000
2008-10-09T16:55:08.447000
187,836
187,854
How do I restart a service on a remote machine in Windows?
Sometimes while debugging, I need to restart a service on a remote machine. Currently, I'm doing this via Remote Desktop. How can it be done from the command line on my local machine?
You can use the services console, clicking on the left hand side and then selecting the "Connect to another computer" option in the Action menu. If you wish to use the command line only, you can use sc \\machine stop
How do I restart a service on a remote machine in Windows? Sometimes while debugging, I need to restart a service on a remote machine. Currently, I'm doing this via Remote Desktop. How can it be done from the command line on my local machine?
TITLE: How do I restart a service on a remote machine in Windows? QUESTION: Sometimes while debugging, I need to restart a service on a remote machine. Currently, I'm doing this via Remote Desktop. How can it be done from the command line on my local machine? ANSWER: You can use the services console, clicking on the ...
[ "windows-services" ]
145
225
493,170
8
0
2008-10-09T15:32:35.680000
2008-10-09T15:36:55.640000
187,838
194,235
Is it possible to enable compression with SQL Server 2005 Replication
I am sending data across a link with very little bandwidth and I will probably be sending large data files. I have Merge Replication and Snapshot replication configured at present. Is it possible to enable compression in SQL Server 2005 replication and if so, how? Thanks.
Google turned up this article on the Microsoft SQL Server Development Customer Advisory Team [sic!] Blog: SQL Server 2005 Transactional Replication: Benefit of using SubscriptionStreams for low bandwidth, high latency environments Not exactly what you were asking for, but maybe of value still.
Is it possible to enable compression with SQL Server 2005 Replication I am sending data across a link with very little bandwidth and I will probably be sending large data files. I have Merge Replication and Snapshot replication configured at present. Is it possible to enable compression in SQL Server 2005 replication a...
TITLE: Is it possible to enable compression with SQL Server 2005 Replication QUESTION: I am sending data across a link with very little bandwidth and I will probably be sending large data files. I have Merge Replication and Snapshot replication configured at present. Is it possible to enable compression in SQL Server ...
[ "sql", "sql-server", "configuration", "compression", "replication" ]
2
2
1,633
1
0
2008-10-09T15:33:00.873000
2008-10-11T15:55:19.443000
187,850
200,189
Relocate JSF-generated javascript
I am using lots of commandLinks in my app. For them to work, JSF generates some wild Javascript ( function dpf(f) {var adp... ). Sadly, the script-tag destroys my layout. (It really does - I am sure about that). Is there a way to force JSF to generate the script-tag somewhere else?
Maybe you can try to externalize your Javascript. Instead of putting the Javascript code within your page, it will only include a script tag that points to a Javascript file. To do that, modify your web.xml file to have that: com.sun.faces.externalizeJavaScript true
Relocate JSF-generated javascript I am using lots of commandLinks in my app. For them to work, JSF generates some wild Javascript ( function dpf(f) {var adp... ). Sadly, the script-tag destroys my layout. (It really does - I am sure about that). Is there a way to force JSF to generate the script-tag somewhere else?
TITLE: Relocate JSF-generated javascript QUESTION: I am using lots of commandLinks in my app. For them to work, JSF generates some wild Javascript ( function dpf(f) {var adp... ). Sadly, the script-tag destroys my layout. (It really does - I am sure about that). Is there a way to force JSF to generate the script-tag s...
[ "jsf" ]
1
4
891
1
0
2008-10-09T15:35:54.660000
2008-10-14T06:43:09.230000
187,851
188,466
Synchronous dialogs in Flex?
How can I open a synchronous dialog in Flex? I need to call a function from an External Interface (JavaScript) that will open a simple dialog in the Flex application and returns an value according to the button the user has clicked (OK/Cancel). So it should by a synchronous call to a dialog, i.e. the call waits until t...
You can't do that in Flex. As David mentioned, Flex is single-threaded, so you can't have your function block while the dialog is being processed. Your best bet might be to use a Javascript popup. You'll have a lot less control over the window, but it should behave the way you want (blocking the function until it's bee...
Synchronous dialogs in Flex? How can I open a synchronous dialog in Flex? I need to call a function from an External Interface (JavaScript) that will open a simple dialog in the Flex application and returns an value according to the button the user has clicked (OK/Cancel). So it should by a synchronous call to a dialog...
TITLE: Synchronous dialogs in Flex? QUESTION: How can I open a synchronous dialog in Flex? I need to call a function from an External Interface (JavaScript) that will open a simple dialog in the Flex application and returns an value according to the button the user has clicked (OK/Cancel). So it should by a synchronou...
[ "apache-flex", "synchronous", "function-calls", "dialog" ]
3
2
5,271
7
0
2008-10-09T15:36:08.967000
2008-10-09T18:12:36.403000
187,855
195,769
What Does the DRY Principle Actually Look Like in ASP.NET MVC?
I keep hearing about the DRY Principle and how it is so important in ASP.NET MVC, but when I do research on Google I don't seem to quite understand exactly how it applies to MVC. From what I've read its not really the copy & paste code smell, which I thought it was, but it is more than that. Can any of you give some in...
use filter attributes to manage aspects (authentication, navigation, breadcrumbs, etc) use a layer supertype controller (apply common controller-level filters to it, see mvccontrib for an example ) write custom actionresults (like in mvccontrib - for example we made one called logoutresult that just does a FormsAuthent...
What Does the DRY Principle Actually Look Like in ASP.NET MVC? I keep hearing about the DRY Principle and how it is so important in ASP.NET MVC, but when I do research on Google I don't seem to quite understand exactly how it applies to MVC. From what I've read its not really the copy & paste code smell, which I though...
TITLE: What Does the DRY Principle Actually Look Like in ASP.NET MVC? QUESTION: I keep hearing about the DRY Principle and how it is so important in ASP.NET MVC, but when I do research on Google I don't seem to quite understand exactly how it applies to MVC. From what I've read its not really the copy & paste code sme...
[ "asp.net", "asp.net-mvc", "dry" ]
5
4
4,937
8
0
2008-10-09T15:36:58.743000
2008-10-12T17:47:39.513000
187,857
210,357
TIBCO EMS Failover reconnect for C# (TIBCO.EMS.dll)
We have a TIBCO EMS solution that uses built-in server failover in a 2-4 server environment. If the TIBCO admins fail-over services from one EMS server to another, connections are supposed to be transfered to the new server automatically at the EMS service level. For our C# applications using the EMS service, this is n...
This post should sum up my current comments and explain my approach in more detail... The TIBCO 'ConnectionFactory' and 'Connection' types are heavyweight, thread-safe types. TIBCO suggests that you maintain the use of one ConnectionFactory (per server configured factory) and one Connection per factory. The server also...
TIBCO EMS Failover reconnect for C# (TIBCO.EMS.dll) We have a TIBCO EMS solution that uses built-in server failover in a 2-4 server environment. If the TIBCO admins fail-over services from one EMS server to another, connections are supposed to be transfered to the new server automatically at the EMS service level. For ...
TITLE: TIBCO EMS Failover reconnect for C# (TIBCO.EMS.dll) QUESTION: We have a TIBCO EMS solution that uses built-in server failover in a 2-4 server environment. If the TIBCO admins fail-over services from one EMS server to another, connections are supposed to be transfered to the new server automatically at the EMS s...
[ "c#", "tibco", "tibco-ems", "ems" ]
14
6
11,431
3
0
2008-10-09T15:37:02.863000
2008-10-16T21:19:00.443000
187,886
189,496
Grant Select on all Tables Owned By Specific User
I need to grant select permission for all tables owned by a specific user to another user. Can I do this with a single command along the lines of: Grant Select on OwningUser.* to ReceivingUser Or do I have to generate the sql for each table with something along the lines of: Select 'GRANT SELECT ON OwningUser.'||Table_...
Well, it's not a single statement, but it's about as close as you can get with oracle: BEGIN FOR R IN (SELECT owner, table_name FROM all_tables WHERE owner='TheOwner') LOOP EXECUTE IMMEDIATE 'grant select on '||R.owner||'.'||R.table_name||' to TheUser'; END LOOP; END;
Grant Select on all Tables Owned By Specific User I need to grant select permission for all tables owned by a specific user to another user. Can I do this with a single command along the lines of: Grant Select on OwningUser.* to ReceivingUser Or do I have to generate the sql for each table with something along the line...
TITLE: Grant Select on all Tables Owned By Specific User QUESTION: I need to grant select permission for all tables owned by a specific user to another user. Can I do this with a single command along the lines of: Grant Select on OwningUser.* to ReceivingUser Or do I have to generate the sql for each table with someth...
[ "oracle" ]
45
70
207,708
5
0
2008-10-09T15:44:29.963000
2008-10-09T22:49:13.850000
187,888
873,876
Control Visual Studio plugins from the command line
Is there a way to control the addins Visual Studio 2008 loads via the command line? I am looking for a way to load my DevExpress plug in when I am working with VB or C# and alternatively load Visual Assist X when I am working on a c++ project.
Not a direct answer but you can disable Visual Assist X either via the menu (VAssistX | Enable/Disable ) or via the command VAssistX.EnableDisable (both of these toggle between on and off). Alternatively, you can add.cs and.vb file extensions to the "Extension to ignore" list in Visual Assist Options | Projects | File ...
Control Visual Studio plugins from the command line Is there a way to control the addins Visual Studio 2008 loads via the command line? I am looking for a way to load my DevExpress plug in when I am working with VB or C# and alternatively load Visual Assist X when I am working on a c++ project.
TITLE: Control Visual Studio plugins from the command line QUESTION: Is there a way to control the addins Visual Studio 2008 loads via the command line? I am looking for a way to load my DevExpress plug in when I am working with VB or C# and alternatively load Visual Assist X when I am working on a c++ project. ANSWE...
[ "visual-studio-2008" ]
2
0
707
2
0
2008-10-09T15:44:38.013000
2009-05-17T04:06:26.103000
187,894
187,929
How do I obtain the physical (MAC) address of an IP address using C#?
From C#, I want to do the equivalent of the following: arp -a |findstr 192.168.1.254 Alternatively, the answer could call the SendARP function and get the results. This will allow my application to do some other processing that requires the MAC address.
SendARP P/Invoke goes like this: [DllImport("iphlpapi.dll", ExactSpelling=true)] public static extern int SendARP( int destIp, int srcIP, byte[] macAddr, ref uint physicalAddrLen ); PInvoke.NET has this example: IPAddress dst = IPAddress.Parse("192.168.2.1"); // the destination IP address byte[] macAddr = new byte[6];...
How do I obtain the physical (MAC) address of an IP address using C#? From C#, I want to do the equivalent of the following: arp -a |findstr 192.168.1.254 Alternatively, the answer could call the SendARP function and get the results. This will allow my application to do some other processing that requires the MAC addre...
TITLE: How do I obtain the physical (MAC) address of an IP address using C#? QUESTION: From C#, I want to do the equivalent of the following: arp -a |findstr 192.168.1.254 Alternatively, the answer could call the SendARP function and get the results. This will allow my application to do some other processing that requ...
[ "c#", "networking" ]
12
28
22,935
4
0
2008-10-09T15:47:06.807000
2008-10-09T15:54:29.507000
187,901
194,217
Chart on MS Access 2003 ADP report
What's the best method of displaying report data in a chart format in an Access 2003 ADP project? I know this can be done in normal MDBs but this seems to use a Jet Crosstab query behind the scenes and this is not available in the ADP. I've experimented with the Office 11 Chart control but this seems a bit hit and miss...
Hit a bit of a blank with this one but after some experimentation I've had some success with the Office 11 Chart. It's a bit inflexible programmatically but it's charting capabilities are very much like Excel's and it works quite well for static (non-parameterised) reports.
Chart on MS Access 2003 ADP report What's the best method of displaying report data in a chart format in an Access 2003 ADP project? I know this can be done in normal MDBs but this seems to use a Jet Crosstab query behind the scenes and this is not available in the ADP. I've experimented with the Office 11 Chart contro...
TITLE: Chart on MS Access 2003 ADP report QUESTION: What's the best method of displaying report data in a chart format in an Access 2003 ADP project? I know this can be done in normal MDBs but this seems to use a Jet Crosstab query behind the scenes and this is not available in the ADP. I've experimented with the Offi...
[ "ms-access", "excel", "vba" ]
0
0
910
1
0
2008-10-09T15:49:32.153000
2008-10-11T15:40:43.107000
187,913
187,923
Fastest Convert from Collection to List<T>
What I'd like to avoid: ManagementClass m = new ManagementClass("Win32_LogicalDisk"); ManagementObjectCollection managementObjects = m.GetInstances(); List managementList = new List (); foreach(ManagementObject m in managementObjects){ managementList.Add(m); } Isn't there a way to get that collection into a List t...
What version of the framework? With 3.5 you could presumably use: List managementList = managementObjects.Cast ().ToList(); (edited to remove simpler version; I checked and ManagementObjectCollection only implements the non-generic IEnumerable form)
Fastest Convert from Collection to List<T> What I'd like to avoid: ManagementClass m = new ManagementClass("Win32_LogicalDisk"); ManagementObjectCollection managementObjects = m.GetInstances(); List managementList = new List (); foreach(ManagementObject m in managementObjects){ managementList.Add(m); } Isn't there...
TITLE: Fastest Convert from Collection to List<T> QUESTION: What I'd like to avoid: ManagementClass m = new ManagementClass("Win32_LogicalDisk"); ManagementObjectCollection managementObjects = m.GetInstances(); List managementList = new List (); foreach(ManagementObject m in managementObjects){ managementList.Add(...
[ "c#", "collections" ]
76
141
157,748
8
0
2008-10-09T15:51:37.670000
2008-10-09T15:53:42.487000
187,920
198,027
DBCC CHECKIDENT on a temporary table throwing permissions error for wrong user
I'm logged into a SQL Server 2005 database as a non-sa user, 'bhk', that is a member of the 'public' server role only. The following code tries to execute within a stored procedure called by user 'bhk'. This line of code... TRUNCATE TABLE #Table1 DBCC CHECKIDENT('#Table1', RESEED, @SequenceNumber) WITH NO_INFOMSGS caus...
Here is an alternate solution, that may work if you need to re-seed with a sequence number of more than 1. TRUNCATE #Table1 SET IDENTITY_INSERT #Table1 ON INSERT INTO #Table1 (TableID) -- This is your primary key field VALUES (@SequenceNumber - 1) SET IDENTITY_INSERT #Table1 OFF DELETE FROM #Table1 What this is doi...
DBCC CHECKIDENT on a temporary table throwing permissions error for wrong user I'm logged into a SQL Server 2005 database as a non-sa user, 'bhk', that is a member of the 'public' server role only. The following code tries to execute within a stored procedure called by user 'bhk'. This line of code... TRUNCATE TABLE #T...
TITLE: DBCC CHECKIDENT on a temporary table throwing permissions error for wrong user QUESTION: I'm logged into a SQL Server 2005 database as a non-sa user, 'bhk', that is a member of the 'public' server role only. The following code tries to execute within a stored procedure called by user 'bhk'. This line of code......
[ "sql-server-2005", "stored-procedures", "permissions", "temp-tables" ]
8
11
12,787
5
0
2008-10-09T15:53:14.843000
2008-10-13T15:39:05.857000
187,921
203,817
Formats for Saving Vector-based 3D Graphics
I have written a vector-based 3D editor (UI customized somewhat like technical drawings). I now want save the vectors/drawing data in portable formats. Which formats are available; which (one?) of them are the most widely accepted, and where can I get hold of the format specifications?
Commercially, many users will look for AutoCAD DWG and Bentley DGN formats. While not free, libraries for producing these formats can be found from the open design alliance The GIS community use shape files quite a bit for vectorised 3d models, a free SDK for shape files can be found here. The OSG library is also free ...
Formats for Saving Vector-based 3D Graphics I have written a vector-based 3D editor (UI customized somewhat like technical drawings). I now want save the vectors/drawing data in portable formats. Which formats are available; which (one?) of them are the most widely accepted, and where can I get hold of the format speci...
TITLE: Formats for Saving Vector-based 3D Graphics QUESTION: I have written a vector-based 3D editor (UI customized somewhat like technical drawings). I now want save the vectors/drawing data in portable formats. Which formats are available; which (one?) of them are the most widely accepted, and where can I get hold o...
[ "file-format", "vector-graphics" ]
6
2
1,769
3
0
2008-10-09T15:53:25.747000
2008-10-15T05:45:56.223000
187,936
187,954
How can I add SQL Server database objects to TFS?
We don't currently have our SQL Server objects in any form of source control. We recently installed TFS 2008 and I'd like to get our SQL server code added. I think I could script all of the database and create script files for each object, but I'm hoping there is a way to point to a database in SSMS and create a projec...
If you have a visual studio Team Developer license you can download the Database edition. It has a project type that can bring your tables, sprocs, triggers, etc under source control and check it into TFS. update: Redgate has a product called SQL Source Control. Which ties back into several source control systems like ...
How can I add SQL Server database objects to TFS? We don't currently have our SQL Server objects in any form of source control. We recently installed TFS 2008 and I'd like to get our SQL server code added. I think I could script all of the database and create script files for each object, but I'm hoping there is a way ...
TITLE: How can I add SQL Server database objects to TFS? QUESTION: We don't currently have our SQL Server objects in any form of source control. We recently installed TFS 2008 and I'd like to get our SQL server code added. I think I could script all of the database and create script files for each object, but I'm hopi...
[ "sql-server", "version-control", "tfs", "ssms" ]
15
14
35,314
6
0
2008-10-09T15:56:41.683000
2008-10-09T16:02:31.313000
187,965
189,181
Is there a way to detect Flash playback progress, using the Flash ActiveX object, when progress is NOT on the main timeline?
I've done some programming where I've embedded the Flash ActiveX control into my program. I'll play SWF files in a "playlist" provided by the user. Typically, I've kept a timer going that looks at the CurrentFrame vs. TotalFrames to detect forward motion. I don't allow for looping - if the CurrentFrame ever decreases, ...
Not much you can do about this. Basically you'd have to know what the duration is somehow and if the swf doesn't provide that information, i can't come up with a solution. If you have control over the loaded swf's you can communicate back to the host using ExternalInterface when the swf has finished. This of course won...
Is there a way to detect Flash playback progress, using the Flash ActiveX object, when progress is NOT on the main timeline? I've done some programming where I've embedded the Flash ActiveX control into my program. I'll play SWF files in a "playlist" provided by the user. Typically, I've kept a timer going that looks a...
TITLE: Is there a way to detect Flash playback progress, using the Flash ActiveX object, when progress is NOT on the main timeline? QUESTION: I've done some programming where I've embedded the Flash ActiveX control into my program. I'll play SWF files in a "playlist" provided by the user. Typically, I've kept a timer ...
[ "activex", "flash" ]
0
1
477
1
0
2008-10-09T16:04:49.890000
2008-10-09T20:56:24.530000
187,974
188,060
MSBUILD Task Items in subdirectories: Are incremental builds not possible on these?
I have a simple Word to Pdf converter as an MSBuild Task. The task takes Word files (ITaskItems) as input and Pdf files (ITaskItems) as output. The script uses a Target transform for conversion: What's happening is that SubDir\Two.doc gets converted on every incremental build, One.doc does not (ie MSBuild correctly ski...
I found the problem. It turns out that I had some logic in the Task that would turn any relative path specified for a PDF file into an absolute path. Once I removed that and changed the script to this: I got the behaviour I expected.
MSBUILD Task Items in subdirectories: Are incremental builds not possible on these? I have a simple Word to Pdf converter as an MSBuild Task. The task takes Word files (ITaskItems) as input and Pdf files (ITaskItems) as output. The script uses a Target transform for conversion: What's happening is that SubDir\Two.doc g...
TITLE: MSBUILD Task Items in subdirectories: Are incremental builds not possible on these? QUESTION: I have a simple Word to Pdf converter as an MSBuild Task. The task takes Word files (ITaskItems) as input and Pdf files (ITaskItems) as output. The script uses a Target transform for conversion: What's happening is tha...
[ "msbuild" ]
0
3
1,378
2
0
2008-10-09T16:06:24.957000
2008-10-09T16:27:10.283000
187,981
188,022
What do these Unicode characters (codepoints) mean in this regex?
I have the following regular expression: I figured out most of the part which is as follows: ValidationExpression="^[\u0020\u0027\u002C\u002D\u0030-\u0039\u0041-\u005A\u005F\u0061-\u007A\u00C0-\u00FF°./]{1,256}$" u0020: SPACE u0027: APOSTROPHE u002C: COMMA u002D: HYPHEN / MINUS u0030-\u0039\: 0-9 u0041-\u005A: A - Z u...
weird... according to the character map on Windows I'd say "À to ÿ" Those are some variations (accents, cedillas) on A, C, E, I, D, N, O, U, Y, the german Sharp s,...
What do these Unicode characters (codepoints) mean in this regex? I have the following regular expression: I figured out most of the part which is as follows: ValidationExpression="^[\u0020\u0027\u002C\u002D\u0030-\u0039\u0041-\u005A\u005F\u0061-\u007A\u00C0-\u00FF°./]{1,256}$" u0020: SPACE u0027: APOSTROPHE u002C: CO...
TITLE: What do these Unicode characters (codepoints) mean in this regex? QUESTION: I have the following regular expression: I figured out most of the part which is as follows: ValidationExpression="^[\u0020\u0027\u002C\u002D\u0030-\u0039\u0041-\u005A\u005F\u0061-\u007A\u00C0-\u00FF°./]{1,256}$" u0020: SPACE u0027: AP...
[ "regex", "unicode", "diacritics", "codepoint" ]
5
3
18,711
6
0
2008-10-09T16:09:52.190000
2008-10-09T16:18:54.400000
187,983
188,039
How do I hide a process in Task Manager in C#?
I have a requirement to hide a process in Task Manager. It is for Intranet scenario. So, everything is legitimate.:) Please feel free to share any code you have (preferably in C#) or any other techniques or any issues in going with this route. Update1: Most of the users have admin privileges in order to run some legacy...
There is no supported way to accomplish this. The process list can be read at any privilege level. If you were hoping to hide a process from even Administrators, then this is doubly unsupported. To get this to work, you would need to write a kernel mode rootkit to intercept calls to NtQuerySystemInformation so that the...
How do I hide a process in Task Manager in C#? I have a requirement to hide a process in Task Manager. It is for Intranet scenario. So, everything is legitimate.:) Please feel free to share any code you have (preferably in C#) or any other techniques or any issues in going with this route. Update1: Most of the users ha...
TITLE: How do I hide a process in Task Manager in C#? QUESTION: I have a requirement to hide a process in Task Manager. It is for Intranet scenario. So, everything is legitimate.:) Please feel free to share any code you have (preferably in C#) or any other techniques or any issues in going with this route. Update1: Mo...
[ "c#", ".net", "taskmanager" ]
36
50
94,595
16
0
2008-10-09T16:10:11.033000
2008-10-09T16:22:03.693000
187,989
188,017
Method parameters value through Reflection
I am trying to log a method's parameters by using reflection. I read the earlier question posted about this issue on StackOverflow as well which pointed me to CLR API's. Is it possible, someone can point me to the right direction, as to how will I get the values of parameters passed using API?
Basically you can't in "vanilla".NET code. Parameters are just local variables, and their values can't be fetched without delving into the debugger API mentioned in the other thread. What you may be able to do is use PostSharp to insert the logging code. I'd suggest going that route before looking at the debugging API!
Method parameters value through Reflection I am trying to log a method's parameters by using reflection. I read the earlier question posted about this issue on StackOverflow as well which pointed me to CLR API's. Is it possible, someone can point me to the right direction, as to how will I get the values of parameters ...
TITLE: Method parameters value through Reflection QUESTION: I am trying to log a method's parameters by using reflection. I read the earlier question posted about this issue on StackOverflow as well which pointed me to CLR API's. Is it possible, someone can point me to the right direction, as to how will I get the val...
[ "api", "reflection", ".net-3.5", "clr" ]
2
3
1,373
3
0
2008-10-09T16:11:18.583000
2008-10-09T16:18:41.063000
187,998
188,044
Row Offset in SQL Server
Is there any way in SQL Server to get the results starting at a given offset? For example, in another type of SQL database, it's possible to do: SELECT * FROM MyTable OFFSET 50 LIMIT 25 to get results 51-75. This construct does not appear to exist in SQL Server. How can I accomplish this without loading all the rows I ...
I would avoid using SELECT *. Specify columns you actually want even though it may be all of them. SQL Server 2005+ SELECT col1, col2 FROM ( SELECT col1, col2, ROW_NUMBER() OVER (ORDER BY ID) AS RowNum FROM MyTable ) AS MyDerivedTable WHERE MyDerivedTable.RowNum BETWEEN @startRow AND @endRow SQL Server 2000 Efficiently...
Row Offset in SQL Server Is there any way in SQL Server to get the results starting at a given offset? For example, in another type of SQL database, it's possible to do: SELECT * FROM MyTable OFFSET 50 LIMIT 25 to get results 51-75. This construct does not appear to exist in SQL Server. How can I accomplish this withou...
TITLE: Row Offset in SQL Server QUESTION: Is there any way in SQL Server to get the results starting at a given offset? For example, in another type of SQL database, it's possible to do: SELECT * FROM MyTable OFFSET 50 LIMIT 25 to get results 51-75. This construct does not appear to exist in SQL Server. How can I acco...
[ "sql", "sql-server" ]
147
160
253,609
17
0
2008-10-09T16:13:03.757000
2008-10-09T16:23:10.663000
187,999
188,038
How do I get the version of an assembly without loading it?
One small function of a large program examines assemblies in a folder and replaces out-of-date assemblies with the latest versions. To accomplish this, it needs to read the version numbers of the existing assembly files without actually loading those assemblies into the executing process.
I found the following in this article. using System.Reflection; using System.IO;... // Get current and updated assemblies AssemblyName currentAssemblyName = AssemblyName.GetAssemblyName(currentAssemblyPath); AssemblyName updatedAssemblyName = AssemblyName.GetAssemblyName(updatedAssemblyPath); // Compare both versions...
How do I get the version of an assembly without loading it? One small function of a large program examines assemblies in a folder and replaces out-of-date assemblies with the latest versions. To accomplish this, it needs to read the version numbers of the existing assembly files without actually loading those assemblie...
TITLE: How do I get the version of an assembly without loading it? QUESTION: One small function of a large program examines assemblies in a folder and replaces out-of-date assemblies with the latest versions. To accomplish this, it needs to read the version numbers of the existing assembly files without actually loadi...
[ ".net", "assemblies", "versions" ]
27
44
15,800
5
0
2008-10-09T16:13:11.917000
2008-10-09T16:21:53.833000
188,001
188,084
Two-way binding of Xml data to the WPF TreeView
I am attempting to rewrite my ForestPad application utilizing WPF for the presentation layer. In WinForms, I am populating each node programmatically but I would like to take advantage of the databinding capabilities of WPF, if possible. In general, what is the best way to two-way databind the WPF TreeView to an Xml do...
Well, it would be easier if your element hierarchy was more like.........rather than your current schema. As-is, you'll need 4 HierarchicalDataTemplate s, one for each hierarchical element including the root, and one DataTemplate for leaf elements: You can instead set the Source of the XmlDataProvider programmatically:...
Two-way binding of Xml data to the WPF TreeView I am attempting to rewrite my ForestPad application utilizing WPF for the presentation layer. In WinForms, I am populating each node programmatically but I would like to take advantage of the databinding capabilities of WPF, if possible. In general, what is the best way t...
TITLE: Two-way binding of Xml data to the WPF TreeView QUESTION: I am attempting to rewrite my ForestPad application utilizing WPF for the presentation layer. In WinForms, I am populating each node programmatically but I would like to take advantage of the databinding capabilities of WPF, if possible. In general, what...
[ "c#", "wpf", "xml", "data-binding", "treeview" ]
4
9
24,039
3
0
2008-10-09T16:13:28.670000
2008-10-09T16:33:40.270000
188,007
188,056
Creating an asp:Button programmatically?
I'm using my code-behind page to create a save button programmatically: Button btnSave = new Button(); btnSave.ID = "btnSave"; btnSave.Text = "Save"; However I think this must create an html button or perhaps needs something else as I cannot seem to set the OnClick attribute in the following line, I can specify OnClien...
Button btnSave = new Button(); btnSave.ID = "btnSave"; btnSave.Text = "Save"; btnSave.Click += new System.EventHandler(btnSave_Click); protected void btnSave_Click(object sender, EventArgs e) { //do something when button clicked. }
Creating an asp:Button programmatically? I'm using my code-behind page to create a save button programmatically: Button btnSave = new Button(); btnSave.ID = "btnSave"; btnSave.Text = "Save"; However I think this must create an html button or perhaps needs something else as I cannot seem to set the OnClick attribute in ...
TITLE: Creating an asp:Button programmatically? QUESTION: I'm using my code-behind page to create a save button programmatically: Button btnSave = new Button(); btnSave.ID = "btnSave"; btnSave.Text = "Save"; However I think this must create an html button or perhaps needs something else as I cannot seem to set the OnC...
[ "c#", "asp.net", ".net", "servercontrols" ]
7
14
8,665
3
0
2008-10-09T16:14:52.240000
2008-10-09T16:26:32.607000
188,043
188,112
Security, cryptography: Stupid Challenge - Response protocol?
Ok guys just a small game: I have some specifications for a project. At some point they ask for the following to encrypt a password over the net, saying that it is a challenge response protocol: CLIENT ----------------------------- SERVER (1)ask for challenge --------------> (2) <---------------------------- send SHA...
How about the following: Server sends a random challenge Client sends SHA1 checksum of (challenge+password) Servers compares against SHA1 checksum of (challenge+stored password)
Security, cryptography: Stupid Challenge - Response protocol? Ok guys just a small game: I have some specifications for a project. At some point they ask for the following to encrypt a password over the net, saying that it is a challenge response protocol: CLIENT ----------------------------- SERVER (1)ask for challen...
TITLE: Security, cryptography: Stupid Challenge - Response protocol? QUESTION: Ok guys just a small game: I have some specifications for a project. At some point they ask for the following to encrypt a password over the net, saying that it is a challenge response protocol: CLIENT ----------------------------- SERVER ...
[ "security", "cryptography", "challenge-response" ]
2
3
1,565
10
0
2008-10-09T16:23:09.370000
2008-10-09T16:40:08.947000
188,046
188,507
Java GUI Resolution Independent Scaling
I'm working on a large legacy java application for which an important feature was automatic scaling of GUI Components based on monitor resolution. We are upgrading the JVM on which it runs from 1.4.2 to 1.6 and now the scaling is broken due to a change in the implementation of java.awt.Container.getPreferredSize(). get...
It sounds like they are protecting the internal state of the component better in 1.6 than before. Maybe they ran FindBugs on it and fix the bug. When I first read this question, I thought of Java 1.6u10. It includes a new look and feel called Nimbus which supports High DPI displays by way of using vector graphics to dr...
Java GUI Resolution Independent Scaling I'm working on a large legacy java application for which an important feature was automatic scaling of GUI Components based on monitor resolution. We are upgrading the JVM on which it runs from 1.4.2 to 1.6 and now the scaling is broken due to a change in the implementation of ja...
TITLE: Java GUI Resolution Independent Scaling QUESTION: I'm working on a large legacy java application for which an important feature was automatic scaling of GUI Components based on monitor resolution. We are upgrading the JVM on which it runs from 1.4.2 to 1.6 and now the scaling is broken due to a change in the im...
[ "java", "user-interface", "scaling" ]
1
2
4,091
2
0
2008-10-09T16:23:39.587000
2008-10-09T18:19:06.857000
188,057
188,066
Internet Explorer 8 and CSS
Quick question. What do you think, I have a few sites that use a 3 level drop-down menu that will be broken if IE8 released with its current CSS standards in IE8 beta2. So do I take the time to redo those drop downs now? I realize that the way they rendered CSS changed completely between beta 1 and 2, but 2 was/is supp...
You can add the meta tag to force IE7 compatible rendering. Your site continues to work, no changes are made to the web site and life is happy for everyone. That said, i'm curious about the "forced to properly handle CSS" bit; IE8 has been pretty big win for CSS standards, but I could be missing the bandwagon.;) HTML c...
Internet Explorer 8 and CSS Quick question. What do you think, I have a few sites that use a 3 level drop-down menu that will be broken if IE8 released with its current CSS standards in IE8 beta2. So do I take the time to redo those drop downs now? I realize that the way they rendered CSS changed completely between bet...
TITLE: Internet Explorer 8 and CSS QUESTION: Quick question. What do you think, I have a few sites that use a 3 level drop-down menu that will be broken if IE8 released with its current CSS standards in IE8 beta2. So do I take the time to redo those drop downs now? I realize that the way they rendered CSS changed comp...
[ "css", "internet-explorer-8" ]
1
5
1,140
3
0
2008-10-09T16:26:36.460000
2008-10-09T16:28:36.817000
188,091
188,104
Changing target framework in Visual Studio 2008
What's the deal with Visual Studio? I tried importing the Caching App Block and got this message: The assembly or one of its dependencies you're are trying to import requires a later version of.NET Framework. I went to the properties of my application in Visual Studio, but I can't find the dropdown to switch....what's ...
Found it....went to "Advanced Compile Options" on Compile Tab.....weird!
Changing target framework in Visual Studio 2008 What's the deal with Visual Studio? I tried importing the Caching App Block and got this message: The assembly or one of its dependencies you're are trying to import requires a later version of.NET Framework. I went to the properties of my application in Visual Studio, bu...
TITLE: Changing target framework in Visual Studio 2008 QUESTION: What's the deal with Visual Studio? I tried importing the Caching App Block and got this message: The assembly or one of its dependencies you're are trying to import requires a later version of.NET Framework. I went to the properties of my application in...
[ ".net", "visual-studio", "target-framework" ]
3
7
22,181
5
0
2008-10-09T16:35:04.930000
2008-10-09T16:38:27.420000
188,098
190,269
Visual Studio 2008 - Application closes when unhandled exception occurs
I have a problem when an unhandeld exception occurs while debugging a WinForm VB.NET project. The problem is that my application terminates and I have to start the application again, instead of retrying the action as was the case in VS2003 The unhandeld exception is implemented in the new My.MyApplication class found i...
Ok I found the answer to this issue in this blog post: Handling "Unhandled Exceptions" in.NET 2.0 Thank you Mark! The short answer is: Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); This causes the same behaviour during debug and run mode. Resulting in VS not closing while debugging
Visual Studio 2008 - Application closes when unhandled exception occurs I have a problem when an unhandeld exception occurs while debugging a WinForm VB.NET project. The problem is that my application terminates and I have to start the application again, instead of retrying the action as was the case in VS2003 The unha...
TITLE: Visual Studio 2008 - Application closes when unhandled exception occurs QUESTION: I have a problem when an unhandeld exception occurs while debugging a WinForm VB.NET project. The problem is that my application terminates and I have to start the application again, instead of retrying the action as was the case ...
[ "c#", "vb.net", "visual-studio-2008", "debugging" ]
2
1
4,934
3
0
2008-10-09T16:35:59.313000
2008-10-10T05:47:51.087000
188,099
188,107
PL/SQL Evaluation Order
Howdy. Consider the following: SQL> DECLARE 2 b1 BOOLEAN; 3 b2 BOOLEAN; 4 FUNCTION checkit RETURN BOOLEAN IS 5 BEGIN 6 dbms_output.put_line('inside checkit'); 7 RETURN TRUE; 8 END checkit; 9 10 PROCEDURE outp(n VARCHAR2, p BOOLEAN) IS 11 BEGIN 12 IF p THEN 13 dbms_output.put_line(n||' is true'); 14 ELSE 15 dbms_output....
Yes. PL/SQL performs short circuit evaluation of logical expressions from left to right.
PL/SQL Evaluation Order Howdy. Consider the following: SQL> DECLARE 2 b1 BOOLEAN; 3 b2 BOOLEAN; 4 FUNCTION checkit RETURN BOOLEAN IS 5 BEGIN 6 dbms_output.put_line('inside checkit'); 7 RETURN TRUE; 8 END checkit; 9 10 PROCEDURE outp(n VARCHAR2, p BOOLEAN) IS 11 BEGIN 12 IF p THEN 13 dbms_output.put_line(n||' is true');...
TITLE: PL/SQL Evaluation Order QUESTION: Howdy. Consider the following: SQL> DECLARE 2 b1 BOOLEAN; 3 b2 BOOLEAN; 4 FUNCTION checkit RETURN BOOLEAN IS 5 BEGIN 6 dbms_output.put_line('inside checkit'); 7 RETURN TRUE; 8 END checkit; 9 10 PROCEDURE outp(n VARCHAR2, p BOOLEAN) IS 11 BEGIN 12 IF p THEN 13 dbms_output.put_li...
[ "oracle", "plsql" ]
5
9
2,576
6
0
2008-10-09T16:36:11.013000
2008-10-09T16:39:07.480000
188,114
188,125
UnauthorizedAccessException with IIS7
I'm trying to write a log file from an ASP.NET application under IIS7, but keep getting the following exception: UnauthorizedAccessException "Access to the path 'C:\Users\Brady\Exports' is denied." I have given write access to the iis_iusrs, iis_wpg, and aspnet users, based on various advices found by Google, but still...
You need to grant permission to one of the following accounts ASPNET - Win XP and Win 2000 NETWORK SERVICE - Win Vista and 2003 These are the defaults, if the application pool has been configured for a different process account then you would need to work with that specific account.
UnauthorizedAccessException with IIS7 I'm trying to write a log file from an ASP.NET application under IIS7, but keep getting the following exception: UnauthorizedAccessException "Access to the path 'C:\Users\Brady\Exports' is denied." I have given write access to the iis_iusrs, iis_wpg, and aspnet users, based on vari...
TITLE: UnauthorizedAccessException with IIS7 QUESTION: I'm trying to write a log file from an ASP.NET application under IIS7, but keep getting the following exception: UnauthorizedAccessException "Access to the path 'C:\Users\Brady\Exports' is denied." I have given write access to the iis_iusrs, iis_wpg, and aspnet us...
[ "asp.net", "security", "iis-7" ]
3
4
2,901
3
0
2008-10-09T16:40:33.047000
2008-10-09T16:42:32.170000
188,120
188,130
Can I specify my explicit type comparator inline?
So.NET 3.0/3.5 provides us with lots of new ways to query, sort, and manipulate data, thanks to all the neat functions supplied with LINQ. Sometimes, I need to compare user-defined types that don't have a built-in comparison operator. In many cases, the comparison is really simple -- something like foo1.key?= foo2.key....
My MiscUtil library contains a ProjectionComparer to build an IComparer from a projection delegate. It would be the work of 10 minutes to make a ProjectionEqualityComparer to do the same thing. EDIT: Here's the code for ProjectionEqualityComparer: using System; using System.Collections.Generic; /// /// Non-generic cla...
Can I specify my explicit type comparator inline? So.NET 3.0/3.5 provides us with lots of new ways to query, sort, and manipulate data, thanks to all the neat functions supplied with LINQ. Sometimes, I need to compare user-defined types that don't have a built-in comparison operator. In many cases, the comparison is re...
TITLE: Can I specify my explicit type comparator inline? QUESTION: So.NET 3.0/3.5 provides us with lots of new ways to query, sort, and manipulate data, thanks to all the neat functions supplied with LINQ. Sometimes, I need to compare user-defined types that don't have a built-in comparison operator. In many cases, th...
[ "c#", ".net", "linq", "lambda" ]
71
78
55,182
9
0
2008-10-09T16:41:57.740000
2008-10-09T16:43:50.827000
188,124
188,173
Programmatic solution to change navigation id to highlight current page ASP.NET
I am writing a website with Visual Studio 2008 and ASP.NET 3.5. I have a masterpage set up to simplify the layout and to keep the content pages for content rather than content and layout. The navigation is list, css'd so it looks like a bar. In order to highlight the page on the bar, the list item needs to look like th...
Add a property to your master page called Page Section public string PageSection { get; set; } Add a MasterType page directive to the top of your content pages <%@ MasterType VirtualPath="~/foo.master" %> In your content page code behind, set the PageSection property of the master page Master.PageSection = "home"; In y...
Programmatic solution to change navigation id to highlight current page ASP.NET I am writing a website with Visual Studio 2008 and ASP.NET 3.5. I have a masterpage set up to simplify the layout and to keep the content pages for content rather than content and layout. The navigation is list, css'd so it looks like a bar...
TITLE: Programmatic solution to change navigation id to highlight current page ASP.NET QUESTION: I am writing a website with Visual Studio 2008 and ASP.NET 3.5. I have a masterpage set up to simplify the layout and to keep the content pages for content rather than content and layout. The navigation is list, css'd so i...
[ "asp.net", "css", "navigation" ]
10
10
13,766
7
0
2008-10-09T16:42:26.147000
2008-10-09T16:54:20.727000
188,127
188,145
In MySQL, is there any difference (performance-wise) between decimal and double?
In my database, I would like to store a decimal score. A score can have a value from 0 to 10, and values in between, such as 2.3 or 9.4. I recently learned that int only stores whole numbers and not decimals. I found out that you could use either double or decimal, but what I would like to know is if there is any diffe...
Decimals are more precise, doubles are more efficient, usually. With decimal you can set how many digits you want to use before and after the decimal point. Edit: You can set digit count for decimal and double, my bad. Decimals are better for things like money calculations where exactitude is absolutely necessary. Doub...
In MySQL, is there any difference (performance-wise) between decimal and double? In my database, I would like to store a decimal score. A score can have a value from 0 to 10, and values in between, such as 2.3 or 9.4. I recently learned that int only stores whole numbers and not decimals. I found out that you could use...
TITLE: In MySQL, is there any difference (performance-wise) between decimal and double? QUESTION: In my database, I would like to store a decimal score. A score can have a value from 0 to 10, and values in between, such as 2.3 or 9.4. I recently learned that int only stores whole numbers and not decimals. I found out ...
[ "mysql", "types" ]
3
7
4,548
2
0
2008-10-09T16:42:35.837000
2008-10-09T16:48:29.567000
188,134
188,148
Are there anonymous, type-safe, generic delegate signatures in C# 2.0?
Consider the delegate for a generic A to B function: public delegate B Fun (A x); I can then write a function that accepts and invokes the Fun delegate: public static B invokeFun (A x, Fun f) { return f(x); } (Never mind whether it is wise to write invokeFun.) Can I write invokeFun without naming the Fun delegate? I wo...
No, there aren't. The closest you can get is the two generic delegate families in.NET 3.5: Func and Action. Obviously they're not actually present in.NET 2.0 (except Action ), but they're trivial to write - and indeed I've done so for you:) Personally I'm glad the "uber-short" syntax is invalid - I find it harder to un...
Are there anonymous, type-safe, generic delegate signatures in C# 2.0? Consider the delegate for a generic A to B function: public delegate B Fun (A x); I can then write a function that accepts and invokes the Fun delegate: public static B invokeFun (A x, Fun f) { return f(x); } (Never mind whether it is wise to write ...
TITLE: Are there anonymous, type-safe, generic delegate signatures in C# 2.0? QUESTION: Consider the delegate for a generic A to B function: public delegate B Fun (A x); I can then write a function that accepts and invokes the Fun delegate: public static B invokeFun (A x, Fun f) { return f(x); } (Never mind whether it...
[ "c#", "generics", "delegates" ]
5
7
1,542
1
0
2008-10-09T16:44:25.503000
2008-10-09T16:48:37.680000
188,138
188,216
How to link to a gzipped javascript in an html document?
I've seen a number of references to gzipping a javascript to save download time. But I also see a number of warnings that certain browsers do not support this. I have two different methods at my disposal: use mod_deflate to make Apache compress JS/CSS files in a given directory through htaccess use ob_start('gzhandler'...
mod_deflate and php's gzhandler both are based on zlib, so in that sense there is little difference to a browser how the content is being compressed. in response to your first concern, you can set module specific.htaccess info like this: # stuff in response to your second concern, you can detect for browser support in ...
How to link to a gzipped javascript in an html document? I've seen a number of references to gzipping a javascript to save download time. But I also see a number of warnings that certain browsers do not support this. I have two different methods at my disposal: use mod_deflate to make Apache compress JS/CSS files in a ...
TITLE: How to link to a gzipped javascript in an html document? QUESTION: I've seen a number of references to gzipping a javascript to save download time. But I also see a number of warnings that certain browsers do not support this. I have two different methods at my disposal: use mod_deflate to make Apache compress ...
[ "php", "javascript", "compression" ]
7
11
11,996
3
0
2008-10-09T16:46:00.197000
2008-10-09T17:04:53.590000
188,141
188,155
List<T> OrderBy Alphabetical Order
I'm using C# on Framework 3.5. I'm looking to quickly sort a Generic List. For the sake of this example, let's say I have a List of a Person type with a property of lastname. How would I sort this List using a lambda expression? List people = PopulateList(); people.OrderBy(???? =>?????)
If you mean an in-place sort (i.e. the list is updated): people.Sort((x, y) => string.Compare(x.LastName, y.LastName)); If you mean a new list: var newList = people.OrderBy(x=>x.LastName).ToList(); // ToList optional
List<T> OrderBy Alphabetical Order I'm using C# on Framework 3.5. I'm looking to quickly sort a Generic List. For the sake of this example, let's say I have a List of a Person type with a property of lastname. How would I sort this List using a lambda expression? List people = PopulateList(); people.OrderBy(???? =>????...
TITLE: List<T> OrderBy Alphabetical Order QUESTION: I'm using C# on Framework 3.5. I'm looking to quickly sort a Generic List. For the sake of this example, let's say I have a List of a Person type with a property of lastname. How would I sort this List using a lambda expression? List people = PopulateList(); people.O...
[ "c#", "generics", "list", "lambda", "sorting" ]
485
745
796,186
10
0
2008-10-09T16:48:03.313000
2008-10-09T16:49:55.587000
188,147
194,491
Rake aborting with error
Trying to setup the exception_logger plugin on a production server. Everything worked fine on the dev machine. Trying to rake db:migrate on the prod server and i get this error: rake aborted! no such file to load -- pagination What am i missing?
Classic Pagination is not supported in 2.1 - or at least it is a dead library http://workingwithrails.com/railsplugin/5289-classic-pagination Have a look at will_paginate - http://github.com/mislav/will_paginate/wikis that's what all the cool kids are using:-)
Rake aborting with error Trying to setup the exception_logger plugin on a production server. Everything worked fine on the dev machine. Trying to rake db:migrate on the prod server and i get this error: rake aborted! no such file to load -- pagination What am i missing?
TITLE: Rake aborting with error QUESTION: Trying to setup the exception_logger plugin on a production server. Everything worked fine on the dev machine. Trying to rake db:migrate on the prod server and i get this error: rake aborted! no such file to load -- pagination What am i missing? ANSWER: Classic Pagination is ...
[ "ruby-on-rails", "rake" ]
0
2
1,745
4
0
2008-10-09T16:48:36.837000
2008-10-11T19:39:47.073000
188,162
188,183
What is the most useful script you've written for everyday life?
Just wondering what little scripts/programs people here have written that helps one with his or her everyday life (aka not work related). Anything goes, groundbreaking or not. For me right now, it's a small python script to calculate running pace given distance and time elapsed.
My o key fell off on my laptop; so I wrote a program that replaces two 0 keystrokes within 200 MS of each other as an o, two 0 keystrokes within 700 MS of each other as a 0 and ignore the rest; so I could use my laptop before I get around to replacing the keyboard. Wow; I didn't know this would be so popular:p As for h...
What is the most useful script you've written for everyday life? Just wondering what little scripts/programs people here have written that helps one with his or her everyday life (aka not work related). Anything goes, groundbreaking or not. For me right now, it's a small python script to calculate running pace given di...
TITLE: What is the most useful script you've written for everyday life? QUESTION: Just wondering what little scripts/programs people here have written that helps one with his or her everyday life (aka not work related). Anything goes, groundbreaking or not. For me right now, it's a small python script to calculate run...
[ "scripting" ]
133
117
124,249
78
0
2008-10-09T16:51:40.343000
2008-10-09T16:56:12.393000
188,166
190,722
Team Foundation Server (TFS) File Difference viewer - customize with other tool
I am using Team Foundation Server (TFS) for Visual Studio 2005. Whenever i wish to compare two file's versions TFS displays a window with the differences. The problem is that it is always split vertically. In fact, almost every time, i would prefer to have it split horizontally. I've already looked at TFS options and g...
I've found the built in differencing tool in TFS woefully lacking so I set up WinMerge ( http://www.winmerge.org/ ) in my environment in Tools -> Options -> Source COntrol -> Visual Studio Team Foundation. A nice blog post exists below: http://www.vitalygorn.com/blog/post/2007/12/Better-DiffMerge-tool-for-TFS.aspx
Team Foundation Server (TFS) File Difference viewer - customize with other tool I am using Team Foundation Server (TFS) for Visual Studio 2005. Whenever i wish to compare two file's versions TFS displays a window with the differences. The problem is that it is always split vertically. In fact, almost every time, i woul...
TITLE: Team Foundation Server (TFS) File Difference viewer - customize with other tool QUESTION: I am using Team Foundation Server (TFS) for Visual Studio 2005. Whenever i wish to compare two file's versions TFS displays a window with the differences. The problem is that it is always split vertically. In fact, almost ...
[ "visual-studio", "tfs", "merge", "diff" ]
19
22
11,191
5
0
2008-10-09T16:52:37.047000
2008-10-10T10:20:51.237000
188,176
390,090
Named Entity Recognition Libraries for Java
I am looking for a simple but "good enough" Named Entity Recognition library (and dictionary) for java, I am looking to process emails and documents and extract some "basic information" like: Names, places, Address and Dates I've been looking around, and most seems to be on the heavy side and full NLP kind of projects....
BTW, I recently ran across OpenCalais which seems to havethe functionality I was looking after.
Named Entity Recognition Libraries for Java I am looking for a simple but "good enough" Named Entity Recognition library (and dictionary) for java, I am looking to process emails and documents and extract some "basic information" like: Names, places, Address and Dates I've been looking around, and most seems to be on t...
TITLE: Named Entity Recognition Libraries for Java QUESTION: I am looking for a simple but "good enough" Named Entity Recognition library (and dictionary) for java, I am looking to process emails and documents and extract some "basic information" like: Names, places, Address and Dates I've been looking around, and mos...
[ "java", "nlp", "named-entity-recognition" ]
27
1
23,484
4
0
2008-10-09T16:54:54.080000
2008-12-23T21:15:22.443000
188,184
188,197
How to convert ArrayList to an array of structure?
Here I have: Public Structure MyStruct Public Name as String Public Content as String End Structure Dim oStruct as MyStruct = New MyStruct() oStruct.Name =... oStruct.Content =... Dim alList as ArrayList = new ArrayList() alList.Add(oStruct) I'd like to convert the ArrayList to a static strongly-typed Array of type M...
I assume that since you are using ArrayList, you are using 1.1? In which case, I suspect the following would work: ArrayList list = new ArrayList(); MyStruct[] array = new MyStruct[list.Count]; list.CopyTo(array); (edit - Bill's ToArray usage is more convenient - I didn't know about that one, but then, I very rarely [i...
How to convert ArrayList to an array of structure? Here I have: Public Structure MyStruct Public Name as String Public Content as String End Structure Dim oStruct as MyStruct = New MyStruct() oStruct.Name =... oStruct.Content =... Dim alList as ArrayList = new ArrayList() alList.Add(oStruct) I'd like to convert the A...
TITLE: How to convert ArrayList to an array of structure? QUESTION: Here I have: Public Structure MyStruct Public Name as String Public Content as String End Structure Dim oStruct as MyStruct = New MyStruct() oStruct.Name =... oStruct.Content =... Dim alList as ArrayList = new ArrayList() alList.Add(oStruct) I'd lik...
[ "c#", ".net", "vb.net", "arrays", "arraylist" ]
5
1
7,084
6
0
2008-10-09T16:56:38.647000
2008-10-09T16:59:58.047000