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
191,881
912,247
Serializing to JSON in jQuery
I need to serialize an object to JSON. I'm using jQuery. Is there a "standard" way to do this? My specific situation: I have an array defined as shown below: var countries = new Array(); countries[0] = 'ga'; countries[1] = 'cd';... and I need to turn this into a string to pass to $.ajax() like this: $.ajax({ type: "POS...
JSON-js - JSON in JavaScript. To convert an object to a string, use JSON.stringify: var json_text = JSON.stringify(your_object, null, 2); To convert a JSON string to object, use JSON.parse: var your_object = JSON.parse(json_text); It was recently recommended by John Resig:...PLEASE start migrating your JSON-using appli...
Serializing to JSON in jQuery I need to serialize an object to JSON. I'm using jQuery. Is there a "standard" way to do this? My specific situation: I have an array defined as shown below: var countries = new Array(); countries[0] = 'ga'; countries[1] = 'cd';... and I need to turn this into a string to pass to $.ajax() ...
TITLE: Serializing to JSON in jQuery QUESTION: I need to serialize an object to JSON. I'm using jQuery. Is there a "standard" way to do this? My specific situation: I have an array defined as shown below: var countries = new Array(); countries[0] = 'ga'; countries[1] = 'cd';... and I need to turn this into a string to...
[ "javascript", "jquery", "ajax", "json", "serialization" ]
1,233
1,158
929,690
11
0
2008-10-10T15:29:56.750000
2009-05-26T19:22:40.907000
191,883
191,947
Set element on last reference in an array of references
I want to be able to do the following: $normal_array = array(); $array_of_arrayrefs = array(&$normal_array); // Here I want to access the $normal_array reference **as a reference**, // but that doesn't work obviously. How to do it? end($array_of_arrayrefs)["one"] = 1; // choking on this one print $normal_array["one"]...
end() doesn't return a reference of the last value, but rather the last value itself. Here is a workaround: $normal_array = array(); $array_of_arrayrefs = array( &$normal_array ); $refArray = &end_byref( $array_of_arrayrefs ); $refArray["one"] = 1; print $normal_array["one"]; // should output 1 function &end_byref( ...
Set element on last reference in an array of references I want to be able to do the following: $normal_array = array(); $array_of_arrayrefs = array(&$normal_array); // Here I want to access the $normal_array reference **as a reference**, // but that doesn't work obviously. How to do it? end($array_of_arrayrefs)["one"]...
TITLE: Set element on last reference in an array of references QUESTION: I want to be able to do the following: $normal_array = array(); $array_of_arrayrefs = array(&$normal_array); // Here I want to access the $normal_array reference **as a reference**, // but that doesn't work obviously. How to do it? end($array_of...
[ "php", "arrays", "reference", "pass-by-reference" ]
3
4
2,315
6
0
2008-10-10T15:30:36.203000
2008-10-10T15:44:00.980000
191,894
197,501
Castle Windsor: How to wire up a component to a factory property rather than method
I have the following component public class MyTimer: IMyTimer { public MyTimer(TimeSpan timespan){...} } Where timespan should be provided by the property ISettings.MyTimerFrequency. How do I wire this up in windsor container xml? I thought I could do something like this: 1 ${my_timer_frequency} but I am getting an err...
The solution actually came to me in a dream. Keep in mind that properties are not a CLR construct but rather C# syntactic sugar. If you don't believe me just try compiling public class MyClass { public object Item { get; } public object get_Item() {return null;} } results in a Error: Type 'TestApp.MyClass' already rese...
Castle Windsor: How to wire up a component to a factory property rather than method I have the following component public class MyTimer: IMyTimer { public MyTimer(TimeSpan timespan){...} } Where timespan should be provided by the property ISettings.MyTimerFrequency. How do I wire this up in windsor container xml? I tho...
TITLE: Castle Windsor: How to wire up a component to a factory property rather than method QUESTION: I have the following component public class MyTimer: IMyTimer { public MyTimer(TimeSpan timespan){...} } Where timespan should be provided by the property ISettings.MyTimerFrequency. How do I wire this up in windsor co...
[ ".net", "xml", "inversion-of-control", "castle-windsor" ]
2
4
1,110
2
0
2008-10-10T15:32:04.607000
2008-10-13T12:56:39.927000
191,897
192,020
Best Way to Store/Access a Directed Graph
I have around 3500 flood control facilities that I would like to represent as a network to determine flow paths (essentially a directed graph). I'm currently using SqlServer and a CTE to recursively examine all the nodes and their upstream components and this works as long as the upstream path doesn't fork alot. Howeve...
I know nothing about flood control facilities. But I would take the first facility. And use a temp table and a while loop to generate the path. -- Pseudo Code TempTable (LastNode, CurrentNode, N) DECLARE @intN INT SET @intN = 1 INSERT INTO TempTable(LastNode, CurrentNode, N) -- Insert first item in list with no up stre...
Best Way to Store/Access a Directed Graph I have around 3500 flood control facilities that I would like to represent as a network to determine flow paths (essentially a directed graph). I'm currently using SqlServer and a CTE to recursively examine all the nodes and their upstream components and this works as long as t...
TITLE: Best Way to Store/Access a Directed Graph QUESTION: I have around 3500 flood control facilities that I would like to represent as a network to determine flow paths (essentially a directed graph). I'm currently using SqlServer and a CTE to recursively examine all the nodes and their upstream components and this ...
[ "rdbms", "common-table-expression", "directed-graph" ]
12
4
5,232
6
0
2008-10-10T15:33:05.807000
2008-10-10T15:57:30.547000
191,903
191,914
Which .Net Timer() to use
I have a legacy WinForms Mdi App in VB.Net 2.0 which I am adding functionality to. One of the additions is a warning which needs to be raised when the current time nears a specified value (a deadline). My intention is to check the time once an hour until there is less than an hour until the deadline, then display warni...
I would just use the Forms timer. I think I read that it's not as accurate, but it sounds like you don't need it to be.
Which .Net Timer() to use I have a legacy WinForms Mdi App in VB.Net 2.0 which I am adding functionality to. One of the additions is a warning which needs to be raised when the current time nears a specified value (a deadline). My intention is to check the time once an hour until there is less than an hour until the de...
TITLE: Which .Net Timer() to use QUESTION: I have a legacy WinForms Mdi App in VB.Net 2.0 which I am adding functionality to. One of the additions is a warning which needs to be raised when the current time nears a specified value (a deadline). My intention is to check the time once an hour until there is less than an...
[ "vb.net", "winforms", "multithreading", "timer" ]
6
6
10,033
5
0
2008-10-10T15:33:50.563000
2008-10-10T15:36:40.153000
191,923
192,015
How do I iterate through DOM elements in PHP?
I have an XML file loaded into a DOM document, I wish to iterate through all 'foo' tags, getting values from every tag below it. I know I can get values via $element = $dom->getElementsByTagName('foo')->item(0); foreach($element->childNodes as $node){ $data[$node->nodeName] = $node->nodeValue; } However, what I'm tryin...
Not tested, but what about: $elements = $dom->getElementsByTagName('foo'); $data = array(); foreach($elements as $node){ foreach($node->childNodes as $child) { $data[] = array($child->nodeName => $child->nodeValue); } }
How do I iterate through DOM elements in PHP? I have an XML file loaded into a DOM document, I wish to iterate through all 'foo' tags, getting values from every tag below it. I know I can get values via $element = $dom->getElementsByTagName('foo')->item(0); foreach($element->childNodes as $node){ $data[$node->nodeName]...
TITLE: How do I iterate through DOM elements in PHP? QUESTION: I have an XML file loaded into a DOM document, I wish to iterate through all 'foo' tags, getting values from every tag below it. I know I can get values via $element = $dom->getElementsByTagName('foo')->item(0); foreach($element->childNodes as $node){ $dat...
[ "php", "xml", "dom" ]
32
45
41,755
4
0
2008-10-10T15:38:35.330000
2008-10-10T15:56:45.183000
191,934
192,052
Does anyone have database, programming language/framework suggestions for a GUI point of sale system?
Our company has a point of sale system with many extras, such as ordering and receiving functionality, sales and order history etc. Our main issue is that the system was not designed properly from the ground up, so it takes too long to make fixes and handle requests from our customers. Also, the current technology we a...
I suggest you first research your constraints a bit more - you made a passing reference to a client using a particular type of terminal - this may limit your options, unless the client agrees to upgrade. You need to do a lot more legwork on this. It's great to get opinions from web forums, but we can't possibly know yo...
Does anyone have database, programming language/framework suggestions for a GUI point of sale system? Our company has a point of sale system with many extras, such as ordering and receiving functionality, sales and order history etc. Our main issue is that the system was not designed properly from the ground up, so it ...
TITLE: Does anyone have database, programming language/framework suggestions for a GUI point of sale system? QUESTION: Our company has a point of sale system with many extras, such as ordering and receiving functionality, sales and order history etc. Our main issue is that the system was not designed properly from the...
[ "database", "frameworks", "client-server", "point-of-sale" ]
7
1
3,099
5
0
2008-10-10T15:40:57.553000
2008-10-10T16:04:48.707000
191,940
191,949
C# Generics won't allow Delegate Type Constraints
Is it possible to define a class in C# such that class GenericCollection: SomeBaseCollection where T: Delegate I couldn't for the life of me accomplish this last night in.NET 3.5. I tried using delegate, Delegate, Action and Func It seems to me that this should be allowable in some way. I'm trying to implement my own E...
A number of classes are unavailable as generic contraints - Enum being another. For delegates, the closest you can get is ": class", perhaps using reflection to check (for example, in the static constructor) that the T is a delegate: static GenericCollection() { if (!typeof(T).IsSubclassOf(typeof(Delegate))) { throw ne...
C# Generics won't allow Delegate Type Constraints Is it possible to define a class in C# such that class GenericCollection: SomeBaseCollection where T: Delegate I couldn't for the life of me accomplish this last night in.NET 3.5. I tried using delegate, Delegate, Action and Func It seems to me that this should be allow...
TITLE: C# Generics won't allow Delegate Type Constraints QUESTION: Is it possible to define a class in C# such that class GenericCollection: SomeBaseCollection where T: Delegate I couldn't for the life of me accomplish this last night in.NET 3.5. I tried using delegate, Delegate, Action and Func It seems to me that th...
[ "c#", "generics", "events", "delegates", "constraints" ]
85
68
31,500
8
0
2008-10-10T15:42:23.433000
2008-10-10T15:44:28.827000
191,946
191,975
CIL stack exchange instruction
Is there a CIL instruction to exchange the first two elements in the stack?
There is no single instruction exchange. However, using stloc, pop, and ldloc, you should be able to accomplish your exchange.
CIL stack exchange instruction Is there a CIL instruction to exchange the first two elements in the stack?
TITLE: CIL stack exchange instruction QUESTION: Is there a CIL instruction to exchange the first two elements in the stack? ANSWER: There is no single instruction exchange. However, using stloc, pop, and ldloc, you should be able to accomplish your exchange.
[ "cil" ]
11
11
1,382
4
0
2008-10-10T15:43:47.020000
2008-10-10T15:49:26.117000
191,950
369,770
How to resolve incorrect "Ambiguous reference" from ReSharper on class inheritance?
In my project I have a class that is inherited by many other classes. We'll call it ClassBase. public class ClassInheritFromBase: ClassBase When ClassBase is being inherited, ReSharper throws an "Ambiguous reference" warning on the ClassBase, and anything inside the new class that inherited from ClassBase does not have...
This is a bug in ReSharper 4.1 and is fixed in one of the later nightly builds. Download the last nightly build at http://www.jetbrains.net/confluence/display/ReSharper/ReSharper+4.0+Nightly+Builds.
How to resolve incorrect "Ambiguous reference" from ReSharper on class inheritance? In my project I have a class that is inherited by many other classes. We'll call it ClassBase. public class ClassInheritFromBase: ClassBase When ClassBase is being inherited, ReSharper throws an "Ambiguous reference" warning on the Clas...
TITLE: How to resolve incorrect "Ambiguous reference" from ReSharper on class inheritance? QUESTION: In my project I have a class that is inherited by many other classes. We'll call it ClassBase. public class ClassInheritFromBase: ClassBase When ClassBase is being inherited, ReSharper throws an "Ambiguous reference" w...
[ "resharper" ]
30
1
20,670
14
0
2008-10-10T15:44:58.140000
2008-12-15T21:29:03.923000
191,952
193,078
Index of Linq Error
If I have the following Linq code: context.Table1s.InsertOnSubmit(t); context.Table1s.InsertOnSubmit(t2); context.Table1s.InsertOnSubmit(t3); context.SubmitChanges(); And I get a database error due to the 2nd insert, Linq throws an exception that there was an error. But, is there a way to find out that it was the 2nd ...
You can specify explicitly a conflict mode like this one: context.SubmitChanges(ConflictMode.ContinueOnConflict); if you want to insert what is valid and not fail on the first conflict, then use the context.ChangeConflicts collection to find out which objects conflicted during the insertion.
Index of Linq Error If I have the following Linq code: context.Table1s.InsertOnSubmit(t); context.Table1s.InsertOnSubmit(t2); context.Table1s.InsertOnSubmit(t3); context.SubmitChanges(); And I get a database error due to the 2nd insert, Linq throws an exception that there was an error. But, is there a way to find out ...
TITLE: Index of Linq Error QUESTION: If I have the following Linq code: context.Table1s.InsertOnSubmit(t); context.Table1s.InsertOnSubmit(t2); context.Table1s.InsertOnSubmit(t3); context.SubmitChanges(); And I get a database error due to the 2nd insert, Linq throws an exception that there was an error. But, is there ...
[ "c#", ".net", "sql", "linq", "linq-to-sql" ]
1
1
647
2
0
2008-10-10T15:45:28.777000
2008-10-10T21:27:01.757000
191,955
191,971
Using a tristate parameter in a stored procedure
What is the correct way to do this? For example, how would I change a stored procedure with this signature: CREATE PROCEDURE dbo.MyProcedure @Param BIT = NULL AS SELECT * FROM dbo.SomeTable T WHERE T.SomeColumn = @Param So that giving @Param with a value of 1 or 0 performs the filter, but not specifying it or passing N...
Assuming that NULL means "don't care" then use CREATE PROCEDURE dbo.MyProcedure @Param BIT = NULL AS SELECT * FROM dbo.SomeTable T WHERE T.SomeColumn = @Param OR @Param IS NULL
Using a tristate parameter in a stored procedure What is the correct way to do this? For example, how would I change a stored procedure with this signature: CREATE PROCEDURE dbo.MyProcedure @Param BIT = NULL AS SELECT * FROM dbo.SomeTable T WHERE T.SomeColumn = @Param So that giving @Param with a value of 1 or 0 perfor...
TITLE: Using a tristate parameter in a stored procedure QUESTION: What is the correct way to do this? For example, how would I change a stored procedure with this signature: CREATE PROCEDURE dbo.MyProcedure @Param BIT = NULL AS SELECT * FROM dbo.SomeTable T WHERE T.SomeColumn = @Param So that giving @Param with a valu...
[ "sql", "stored-procedures" ]
1
5
754
3
0
2008-10-10T15:46:22.270000
2008-10-10T15:48:32.953000
191,967
192,014
Would you show things an Actor cannot do on a Use Case diagram?
On a Use Case diagram can you show things that an actor cannot do, for example because they won't have permissions to do it? Or is it just implied due to the fact that they won't have a line joining them to the particular use case?
If the Use Case you are diagramming is the case where an actor attempts to do something that is not permitted and is then denied, then yes, I would show it. Otherwise, I would stick to only including things that are actually part of the use case.
Would you show things an Actor cannot do on a Use Case diagram? On a Use Case diagram can you show things that an actor cannot do, for example because they won't have permissions to do it? Or is it just implied due to the fact that they won't have a line joining them to the particular use case?
TITLE: Would you show things an Actor cannot do on a Use Case diagram? QUESTION: On a Use Case diagram can you show things that an actor cannot do, for example because they won't have permissions to do it? Or is it just implied due to the fact that they won't have a line joining them to the particular use case? ANSWE...
[ "uml", "use-case" ]
8
5
789
5
0
2008-10-10T15:48:04.780000
2008-10-10T15:56:03.593000
191,970
192,029
NT AUTHORITY\NETWORK SERVICE issue when deploying on remote server SQL 2005
I am getting a very non specific error when trying to connect to SQL server on remote server. I feel like I have made all the correct settings, allow TCP/IP, restarted the service, added rights to NT AUTHORITY\NETWORK SERVICE and other related users for the database. I can get to the aspx page, but as soon as I hit sub...
On the remote server, create an alias for the server instance that forces TCP/IP and the port, and use that alias in the connection string. That way it won't even try to use DBNMP. Also you can try forcing the issue in the connection string: http://connectionstrings.com/article.aspx?article=howtodefinewichnetworkprotoc...
NT AUTHORITY\NETWORK SERVICE issue when deploying on remote server SQL 2005 I am getting a very non specific error when trying to connect to SQL server on remote server. I feel like I have made all the correct settings, allow TCP/IP, restarted the service, added rights to NT AUTHORITY\NETWORK SERVICE and other related ...
TITLE: NT AUTHORITY\NETWORK SERVICE issue when deploying on remote server SQL 2005 QUESTION: I am getting a very non specific error when trying to connect to SQL server on remote server. I feel like I have made all the correct settings, allow TCP/IP, restarted the service, added rights to NT AUTHORITY\NETWORK SERVICE ...
[ "sql-server", "remoting" ]
1
1
807
1
0
2008-10-10T15:48:21.160000
2008-10-10T15:58:58.970000
191,974
195,421
What relational database innovations have there been in the last 10 years
The SQL implementation of relational databases has been around in their current form for something like 25 years (since System R and Ingres). Even the main (loosely adhered to) standard is ANSI-92 (although there were later updates) is a good 15 years old. What innovations can you think of with SQL based databases in t...
Hash joins Cost-based optimizers (pretty much turned query-writing on its head) Partitioning (enables much better VLDB management) Parallel (multi-threaded) query processing Clustering (not just availability but scalability too) More flexibility in SQL as well as easier integration of SQL with 3GL languages Better diag...
What relational database innovations have there been in the last 10 years The SQL implementation of relational databases has been around in their current form for something like 25 years (since System R and Ingres). Even the main (loosely adhered to) standard is ANSI-92 (although there were later updates) is a good 15 ...
TITLE: What relational database innovations have there been in the last 10 years QUESTION: The SQL implementation of relational databases has been around in their current form for something like 25 years (since System R and Ingres). Even the main (loosely adhered to) standard is ANSI-92 (although there were later upda...
[ "sql", "database", "relational" ]
6
8
1,244
9
0
2008-10-10T15:49:24.213000
2008-10-12T12:21:33.133000
191,980
191,992
In an MFC application, what's the easiest way to copy a file from one directory to another?
Should I create two CFile objects and copy one into the other character by character? Or is there something in the library that will do this for me?
I would just use the CopyFile Win32 API function, but the example code in the CFile::Open documentation shows how to copy files with CFile (using pretty much the method you suggest).
In an MFC application, what's the easiest way to copy a file from one directory to another? Should I create two CFile objects and copy one into the other character by character? Or is there something in the library that will do this for me?
TITLE: In an MFC application, what's the easiest way to copy a file from one directory to another? QUESTION: Should I create two CFile objects and copy one into the other character by character? Or is there something in the library that will do this for me? ANSWER: I would just use the CopyFile Win32 API function, bu...
[ "c++", "windows", "mfc", "file" ]
10
14
12,542
4
0
2008-10-10T15:50:00.767000
2008-10-10T15:52:21.057000
191,982
191,988
Winforms navigation bar control - like Explorer Address Bar
Can anyone recommend a.NET winforms control that offers similar functionality to the address bar in Windows Explorer, auto-completing file paths? I'm not too bothered about Vista-style breadcrumbs - quite happy with a simple XP-style textbox-only appearance, but I'd like it to offer auto-complete suggestions based on t...
The built-in ComboBox has an AutoCompleteSource property which can be set to FileSystem.
Winforms navigation bar control - like Explorer Address Bar Can anyone recommend a.NET winforms control that offers similar functionality to the address bar in Windows Explorer, auto-completing file paths? I'm not too bothered about Vista-style breadcrumbs - quite happy with a simple XP-style textbox-only appearance, b...
TITLE: Winforms navigation bar control - like Explorer Address Bar QUESTION: Can anyone recommend a.NET winforms control that offers similar functionality to the address bar in Windows Explorer, auto-completing file paths? I'm not too bothered about Vista-style breadcrumbs - quite happy with a simple XP-style textbox-...
[ "winforms", "controls", "autocomplete" ]
2
3
1,895
1
0
2008-10-10T15:50:17.147000
2008-10-10T15:51:45.613000
191,995
192,047
Visual Studio 2005 quick file search
In Eclispe you can do Ctrl+Shift+R and a Window popup where you can write the name of the file (or just the beginning of it) and to press enter to go directly to the file. What is the equivalence in Visual Studio 2005? (Ctrl+Shift+F is not what I would like).
I am not sure if there is a built-in command but there are some addons like VS File Finder
Visual Studio 2005 quick file search In Eclispe you can do Ctrl+Shift+R and a Window popup where you can write the name of the file (or just the beginning of it) and to press enter to go directly to the file. What is the equivalence in Visual Studio 2005? (Ctrl+Shift+F is not what I would like).
TITLE: Visual Studio 2005 quick file search QUESTION: In Eclispe you can do Ctrl+Shift+R and a Window popup where you can write the name of the file (or just the beginning of it) and to press enter to go directly to the file. What is the equivalence in Visual Studio 2005? (Ctrl+Shift+F is not what I would like). ANSW...
[ "visual-studio-2005" ]
0
3
3,038
7
0
2008-10-10T15:52:31.930000
2008-10-10T16:03:41.923000
191,997
192,204
Which Gantt chart/Project management tool would you recommend for linux?
I need a Project management tool that works in Linux, and has Gantt charts. It doesn't have to be free, just not expensive. I don't care how it stores the information I give it, as long as I can access it. I must be able to print the Gantt charts. Must work in Linux. With those requirements, what can you recommend? The...
Planner, and OpenSched, in that order. There are some decent online Gantt (this is the correct spelling) chart tools online as well, usually integrated within a project management or bug-tracking web app or software package.
Which Gantt chart/Project management tool would you recommend for linux? I need a Project management tool that works in Linux, and has Gantt charts. It doesn't have to be free, just not expensive. I don't care how it stores the information I give it, as long as I can access it. I must be able to print the Gantt charts....
TITLE: Which Gantt chart/Project management tool would you recommend for linux? QUESTION: I need a Project management tool that works in Linux, and has Gantt charts. It doesn't have to be free, just not expensive. I don't care how it stores the information I give it, as long as I can access it. I must be able to print...
[ "linux", "project-management", "charts", "gantt-chart" ]
28
22
43,663
7
0
2008-10-10T15:52:59.980000
2008-10-10T16:43:07.443000
191,998
193,385
Attach Source Issue in Eclipse
In Eclipse (Ganymede) I'm debugging some code that uses Apache Commons HttpClient and would like to step into the HttpClient code. I've downloaded the source code and tried to attach it in the normal fashion (CTRL-click on the method name and use the Attach Source button). I've tried to attach both as external file and...
Try pointing it at a directory containing the top level package directly, "D:/Data/Download/commons-httpclient-3.1/src/java" for you. What worked for me was creating a new src zip file containing the "org" folder and everything beneath it. Here's my.classpath entry, (which works for me) in case it helps:
Attach Source Issue in Eclipse In Eclipse (Ganymede) I'm debugging some code that uses Apache Commons HttpClient and would like to step into the HttpClient code. I've downloaded the source code and tried to attach it in the normal fashion (CTRL-click on the method name and use the Attach Source button). I've tried to a...
TITLE: Attach Source Issue in Eclipse QUESTION: In Eclipse (Ganymede) I'm debugging some code that uses Apache Commons HttpClient and would like to step into the HttpClient code. I've downloaded the source code and tried to attach it in the normal fashion (CTRL-click on the method name and use the Attach Source button...
[ "java", "eclipse", "eclipse-3.4", "ganymede" ]
5
6
15,939
6
0
2008-10-10T15:53:53.643000
2008-10-10T23:47:10.273000
192,021
192,046
Why are pipes considered dangerous to use in Windows/unix/linux?
Why are pipes considered dangerous to use? What can be done to avoid these security issues? I'm mostly interested in Windows, but if you have other OS information, please provide.
(assuming you're talking about Unix named pipes from the mention of 'c' and 'IPC'. Windows named pipes work somewhat differently) Anyone with permissions can write to a named pipe, so you have to be careful with permissions and locking (see flock() ). If an application trusts the input it's getting from the named pipe ...
Why are pipes considered dangerous to use in Windows/unix/linux? Why are pipes considered dangerous to use? What can be done to avoid these security issues? I'm mostly interested in Windows, but if you have other OS information, please provide.
TITLE: Why are pipes considered dangerous to use in Windows/unix/linux? QUESTION: Why are pipes considered dangerous to use? What can be done to avoid these security issues? I'm mostly interested in Windows, but if you have other OS information, please provide. ANSWER: (assuming you're talking about Unix named pipes ...
[ "c++", "c", "ipc", "pipe", "named-pipes" ]
7
16
4,274
1
0
2008-10-10T15:57:30.547000
2008-10-10T16:03:39.147000
192,028
192,057
From String to Blob
I am trying to use concat_ws inside a group_concat command. With a query, which simplified looks like: SELECT item.title, GROUP_CONCAT( CONCAT_WS( ',', attachments.id, attachments.type, attachments.name ) ) as attachments FROM story AS item LEFT OUTER JOIN story_attachment AS attachments ON item.id = attachments.item_i...
You need to cast as a char.. SELECT item.title, GROUP_CONCAT( CAST(CONCAT_WS(',', attachments.id, attachments.type, attachments.name ) as CHAR ) ) as attachments FROM story AS item LEFT OUTER JOIN story_attachment AS attachments ON item.id = attachments.item_id GROUP BY item.id
From String to Blob I am trying to use concat_ws inside a group_concat command. With a query, which simplified looks like: SELECT item.title, GROUP_CONCAT( CONCAT_WS( ',', attachments.id, attachments.type, attachments.name ) ) as attachments FROM story AS item LEFT OUTER JOIN story_attachment AS attachments ON item.id ...
TITLE: From String to Blob QUESTION: I am trying to use concat_ws inside a group_concat command. With a query, which simplified looks like: SELECT item.title, GROUP_CONCAT( CONCAT_WS( ',', attachments.id, attachments.type, attachments.name ) ) as attachments FROM story AS item LEFT OUTER JOIN story_attachment AS attac...
[ "sql", "mysql", "blob" ]
2
2
2,304
2
0
2008-10-10T15:58:35.100000
2008-10-10T16:06:46.550000
192,048
192,066
Can an HTML element have multiple ids?
I understand that an id must be unique within an HTML/XHTML page. For a given element, can I assign multiple ids to it? I realize I have an easy solution with simply using a class. I'm just curious about using ids in this manner.
No. From the XHTML 1.0 Spec In XML, fragment identifiers are of type ID, and there can only be a single attribute of type ID per element. Therefore, in XHTML 1.0 the id attribute is defined to be of type ID. In order to ensure that XHTML 1.0 documents are well-structured XML documents, XHTML 1.0 documents MUST use the ...
Can an HTML element have multiple ids? I understand that an id must be unique within an HTML/XHTML page. For a given element, can I assign multiple ids to it? I realize I have an easy solution with simply using a class. I'm just curious about using ids in this manner.
TITLE: Can an HTML element have multiple ids? QUESTION: I understand that an id must be unique within an HTML/XHTML page. For a given element, can I assign multiple ids to it? I realize I have an easy solution with simply using a class. I'm just curious about using ids in this manner. ANSWER: No. From the XHTML 1.0 S...
[ "html", "xhtml", "standards-compliance" ]
368
233
482,688
19
0
2008-10-10T16:04:16.057000
2008-10-10T16:09:16.577000
192,049
192,336
Is it possible to have an alias for the function name in Lisp?
...just like packages do. I use Emacs (maybe, it can offer some kind of solution). For example (defun the-very-very-long-but-good-name ()...) is not to useful later in code. But the name like Fn-15 or the first letters abbreviation is not useful too. Is it possible either to have an alias like for packages or to access...
You want defalias. (defalias 'newname 'oldname) will preserve documentation and even show "newname is an alias for `oldname'" when its documentation is requested.
Is it possible to have an alias for the function name in Lisp? ...just like packages do. I use Emacs (maybe, it can offer some kind of solution). For example (defun the-very-very-long-but-good-name ()...) is not to useful later in code. But the name like Fn-15 or the first letters abbreviation is not useful too. Is it ...
TITLE: Is it possible to have an alias for the function name in Lisp? QUESTION: ...just like packages do. I use Emacs (maybe, it can offer some kind of solution). For example (defun the-very-very-long-but-good-name ()...) is not to useful later in code. But the name like Fn-15 or the first letters abbreviation is not ...
[ "emacs", "lisp" ]
17
45
5,685
8
0
2008-10-10T16:04:19.613000
2008-10-10T17:23:04.573000
192,055
193,933
How do I create compound keyboard shortcuts in a Windows Forms application?
I want to create a component that allows us to have compound keyboard shortcuts associated with an arbitrary command, like the Visual Studio IDE and Microsoft Office do. That is, keyboard shortcuts consisting of a sequence of multiple keystrokes, such as Ctrl + W + C. In Visual Studio this opens the class-view. When th...
In answer to the question of keyboard chords specifically, I do not believe there is a ready-made option available to you at this point. However, it should be simple enough to model. I would create a single class, perhaps KeyboardChordProvider. It will need to know about keyboard events at the form level. As stated els...
How do I create compound keyboard shortcuts in a Windows Forms application? I want to create a component that allows us to have compound keyboard shortcuts associated with an arbitrary command, like the Visual Studio IDE and Microsoft Office do. That is, keyboard shortcuts consisting of a sequence of multiple keystroke...
TITLE: How do I create compound keyboard shortcuts in a Windows Forms application? QUESTION: I want to create a component that allows us to have compound keyboard shortcuts associated with an arbitrary command, like the Visual Studio IDE and Microsoft Office do. That is, keyboard shortcuts consisting of a sequence of ...
[ ".net", "winforms", "keyboard-shortcuts" ]
15
14
5,941
5
0
2008-10-10T16:05:18.160000
2008-10-11T10:17:49.623000
192,073
192,187
What are the differences between pipes in Windows and Linux?
What are the differences between pipes in Windows and Linux?
One difference that I know of, is that named pipes under Linux are actual entries in the filesystem (you'll see it in a directory listing, they have a special type), whereas on Windows they are stored in some magical repository somewhere (they are all accessed via the path "\\.\pipe\". Secondly, in Linux you can just w...
What are the differences between pipes in Windows and Linux? What are the differences between pipes in Windows and Linux?
TITLE: What are the differences between pipes in Windows and Linux? QUESTION: What are the differences between pipes in Windows and Linux? ANSWER: One difference that I know of, is that named pipes under Linux are actual entries in the filesystem (you'll see it in a directory listing, they have a special type), where...
[ "language-agnostic", "ipc", "pipe", "named-pipes" ]
21
25
19,514
4
0
2008-10-10T16:12:22.030000
2008-10-10T16:37:26.707000
192,078
192,104
How do I get the size of a java.sql.ResultSet?
Shouldn't this be a pretty straightforward operation? However, I see there's neither a size() nor length() method.
Do a SELECT COUNT(*) FROM... query instead. OR int size =0; if (rs!= null) { rs.last(); // moves cursor to the last row size = rs.getRow(); // get row id } In either of the case, you won't have to loop over the entire data.
How do I get the size of a java.sql.ResultSet? Shouldn't this be a pretty straightforward operation? However, I see there's neither a size() nor length() method.
TITLE: How do I get the size of a java.sql.ResultSet? QUESTION: Shouldn't this be a pretty straightforward operation? However, I see there's neither a size() nor length() method. ANSWER: Do a SELECT COUNT(*) FROM... query instead. OR int size =0; if (rs!= null) { rs.last(); // moves cursor to the last row size = rs.g...
[ "java", "sql", "jdbc", "resultset", "record-count" ]
320
304
568,131
16
0
2008-10-10T16:12:46.430000
2008-10-10T16:17:36.403000
192,083
192,093
Can php.ini settings be overridden in by a website using PHP + IIS6?
We have PHP 5.2.6 deployed to c:\php and in that folder there is the php.ini file. On Windows, can a website override these settings similar to the way that apache has.htaccess? e.g. DirectoryIndex index.php index.html php_flag magic_quotes_gpc off php_flag register_globals off php_flag magic_quotes_gpc off php_flag re...
I would recommend doing all you can to avoid changing r egister_globals to on as it's a major security hole. But you can try using init_set() to change the settings within your PHP code, although some settings cannot be changed once PHP has started running. (These are somewhat server dependent I believe.)
Can php.ini settings be overridden in by a website using PHP + IIS6? We have PHP 5.2.6 deployed to c:\php and in that folder there is the php.ini file. On Windows, can a website override these settings similar to the way that apache has.htaccess? e.g. DirectoryIndex index.php index.html php_flag magic_quotes_gpc off ph...
TITLE: Can php.ini settings be overridden in by a website using PHP + IIS6? QUESTION: We have PHP 5.2.6 deployed to c:\php and in that folder there is the php.ini file. On Windows, can a website override these settings similar to the way that apache has.htaccess? e.g. DirectoryIndex index.php index.html php_flag magic...
[ "php", "windows", "iis", "configuration" ]
1
3
4,258
6
0
2008-10-10T16:13:39.923000
2008-10-10T16:16:17.750000
192,085
192,141
Test to see if an image exists in C#
I am writing a diagnostic page for SiteScope and one area we need to test is if the connection to the file/media assets are accesible from the web server. One way I think I can do this is load the image via code behind and test to see if the IIS status message is 200. So basically I should be able to navigate to within...
Just use HEAD. No need to download the entire image if you don't need it. Here some boilerplate code. HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("url"); request.Method = "HEAD"; bool exists; try { request.GetResponse(); exists = true; } catch { exists = false; }
Test to see if an image exists in C# I am writing a diagnostic page for SiteScope and one area we need to test is if the connection to the file/media assets are accesible from the web server. One way I think I can do this is load the image via code behind and test to see if the IIS status message is 200. So basically I...
TITLE: Test to see if an image exists in C# QUESTION: I am writing a diagnostic page for SiteScope and one area we need to test is if the connection to the file/media assets are accesible from the web server. One way I think I can do this is load the image via code behind and test to see if the IIS status message is 2...
[ "c#", ".net", "iis" ]
28
54
45,093
8
0
2008-10-10T16:13:53.183000
2008-10-10T16:26:36.450000
192,100
197,239
Is there a way to extract .NET 2.0 from the .NET 3.5?
.NET Framework 3.5 SP1 installs the.NET Framework 2.0 SP2 and the.NET Framework 3.0 SP2 behind the scenes. These installation packages (especially.NET Framework 2.0 SP2) are not available directly from Microsoft. Is there a way to extract them from the.NET Framework 3.5 SP1 installation package?
Take a look on http://msdn.microsoft.com/en-us/vs2008/bb898654.aspx or download.NET Frameworks 2.0 SP2 and 3.0 SP2 bootstrapper packages. These packages give you separate.NET Framework 2.0 SP2 and.NET Framework 3.0 SP2 installation packages.
Is there a way to extract .NET 2.0 from the .NET 3.5? .NET Framework 3.5 SP1 installs the.NET Framework 2.0 SP2 and the.NET Framework 3.0 SP2 behind the scenes. These installation packages (especially.NET Framework 2.0 SP2) are not available directly from Microsoft. Is there a way to extract them from the.NET Framework...
TITLE: Is there a way to extract .NET 2.0 from the .NET 3.5? QUESTION: .NET Framework 3.5 SP1 installs the.NET Framework 2.0 SP2 and the.NET Framework 3.0 SP2 behind the scenes. These installation packages (especially.NET Framework 2.0 SP2) are not available directly from Microsoft. Is there a way to extract them from...
[ ".net", "deployment", ".net-2.0", ".net-3.5" ]
6
7
5,444
7
0
2008-10-10T16:16:54.127000
2008-10-13T10:52:20.507000
192,109
192,365
Is there a built-in function to print all the current properties and values of an object?
So what I'm looking for here is something like PHP's print_r function. This is so I can debug my scripts by seeing what's the state of the object in question.
You are really mixing together two different things. Use dir(), vars() or the inspect module to get what you are interested in (I use __builtins__ as an example; you can use any object instead). >>> l = dir(__builtins__) >>> d = __builtins__.__dict__ Print that dictionary however fancy you like: >>> print l ['Arithmeti...
Is there a built-in function to print all the current properties and values of an object? So what I'm looking for here is something like PHP's print_r function. This is so I can debug my scripts by seeing what's the state of the object in question.
TITLE: Is there a built-in function to print all the current properties and values of an object? QUESTION: So what I'm looking for here is something like PHP's print_r function. This is so I can debug my scripts by seeing what's the state of the object in question. ANSWER: You are really mixing together two different...
[ "python", "debugging", "introspection", "pretty-print", "python-datamodel" ]
1,482
807
1,315,134
32
0
2008-10-10T16:19:27.850000
2008-10-10T17:27:06.077000
192,111
192,123
Reference to static method in PHP?
In PHP, I am able to use a normal function as a variable without problem, but I haven't figured out how to use a static method. Am I just missing the right syntax, or is this not possible? (EDIT: the first suggested answer does not seem to work. I've extended my example to show the errors returned.) function foo1($a,$b...
PHP handles callbacks as strings, not function pointers. The reason your first test works is because the PHP interpreter assumes foo1 as a string. If you have E_NOTICE level error enabled, you should see proof of that. "Use of undefined constant foo1 - assumed 'foo1'" You can't call static methods this way, unfortunate...
Reference to static method in PHP? In PHP, I am able to use a normal function as a variable without problem, but I haven't figured out how to use a static method. Am I just missing the right syntax, or is this not possible? (EDIT: the first suggested answer does not seem to work. I've extended my example to show the er...
TITLE: Reference to static method in PHP? QUESTION: In PHP, I am able to use a normal function as a variable without problem, but I haven't figured out how to use a static method. Am I just missing the right syntax, or is this not possible? (EDIT: the first suggested answer does not seem to work. I've extended my exam...
[ "php", "syntax" ]
22
30
32,112
8
0
2008-10-10T16:20:15.837000
2008-10-10T16:22:25.130000
192,121
192,146
How do I use DateTime.TryParse with a Nullable<DateTime>?
I want to use the DateTime.TryParse method to get the datetime value of a string into a Nullable. But when I try this: DateTime? d; bool success = DateTime.TryParse("some date text", out (DateTime)d); the compiler tells me 'out' argument is not classified as a variable Not sure what I need to do here. I've also tried: ...
DateTime? d=null; DateTime d2; bool success = DateTime.TryParse("some date text", out d2); if (success) d=d2; (There might be more elegant solutions, but why don't you simply do something as above?)
How do I use DateTime.TryParse with a Nullable<DateTime>? I want to use the DateTime.TryParse method to get the datetime value of a string into a Nullable. But when I try this: DateTime? d; bool success = DateTime.TryParse("some date text", out (DateTime)d); the compiler tells me 'out' argument is not classified as a v...
TITLE: How do I use DateTime.TryParse with a Nullable<DateTime>? QUESTION: I want to use the DateTime.TryParse method to get the datetime value of a string into a Nullable. But when I try this: DateTime? d; bool success = DateTime.TryParse("some date text", out (DateTime)d); the compiler tells me 'out' argument is not...
[ "c#", "datetime", "nullable" ]
139
140
124,889
9
0
2008-10-10T16:21:14.027000
2008-10-10T16:27:38.897000
192,122
192,611
MOSS 2007 -- Invalid URL Exception SPSite.OpenWeb(...)
This may seem a bit trivial, but I have not been able to figure it out. I am opening up a SPSite and then trying to open up a SPWeb under that SPSite. This is working fine on the VPC, which has the same Site Collection/Site hierarchy, but on production, I get an exception telling me that the URL is invalid when I try t...
Looks at the examples table at the bottom of this page. Try not sending any parameters into the OpenWeb() method (2nd row).
MOSS 2007 -- Invalid URL Exception SPSite.OpenWeb(...) This may seem a bit trivial, but I have not been able to figure it out. I am opening up a SPSite and then trying to open up a SPWeb under that SPSite. This is working fine on the VPC, which has the same Site Collection/Site hierarchy, but on production, I get an ex...
TITLE: MOSS 2007 -- Invalid URL Exception SPSite.OpenWeb(...) QUESTION: This may seem a bit trivial, but I have not been able to figure it out. I am opening up a SPSite and then trying to open up a SPWeb under that SPSite. This is working fine on the VPC, which has the same Site Collection/Site hierarchy, but on produ...
[ "c#", "sharepoint", "sharepoint-2007", "moss", "wss" ]
0
3
4,270
3
0
2008-10-10T16:21:31
2008-10-10T18:45:00.460000
192,124
192,568
How do I load and save an image from an SQL Server database using GDI+ and C++?
I need specifically to load a JPG image that was saved as a blob. GDI+ makes it very easy to retrieve images from files but not from databases...
Take a look at Image::Image(IStream *, BOOL). This takes a pointer to a COM object implementing the IStream interface. You can get one of these by allocating some global memory with GlobalAlloc and then calling CreateStreamOnHGlobal on the returned handle. It'll look something like this: shared_ptr CreateImage(BYTE *bl...
How do I load and save an image from an SQL Server database using GDI+ and C++? I need specifically to load a JPG image that was saved as a blob. GDI+ makes it very easy to retrieve images from files but not from databases...
TITLE: How do I load and save an image from an SQL Server database using GDI+ and C++? QUESTION: I need specifically to load a JPG image that was saved as a blob. GDI+ makes it very easy to retrieve images from files but not from databases... ANSWER: Take a look at Image::Image(IStream *, BOOL). This takes a pointer ...
[ "c++", "sql", "sql-server", "image", "gdi+" ]
6
3
1,477
2
0
2008-10-10T16:22:34.040000
2008-10-10T18:32:53.183000
192,126
192,172
LIKE in Linq to SQL
I have a method that needs to accept an array of country names, and return a list of records that match one of those country names. I'm trying this Public Shared Function GetConcessions(ByVal Countries As String()) As IEnumerable Dim CountryList As String = Utility.JoinArray(Countries) ' turns string array into comma-s...
I think what you want to do is construct a List from Countries and use List ListOfCountries = new List(Countries)...ListOfCountries.Contains(t.Country) This would translate into t.Country IN ('yyy','zzz',...) Please excuse my C#-ishness..
LIKE in Linq to SQL I have a method that needs to accept an array of country names, and return a list of records that match one of those country names. I'm trying this Public Shared Function GetConcessions(ByVal Countries As String()) As IEnumerable Dim CountryList As String = Utility.JoinArray(Countries) ' turns strin...
TITLE: LIKE in Linq to SQL QUESTION: I have a method that needs to accept an array of country names, and return a list of records that match one of those country names. I'm trying this Public Shared Function GetConcessions(ByVal Countries As String()) As IEnumerable Dim CountryList As String = Utility.JoinArray(Countr...
[ "vb.net", "linq-to-sql" ]
3
2
3,760
2
0
2008-10-10T16:22:40.170000
2008-10-10T16:33:58.633000
192,128
192,164
In Actionscript 2 how can I get 302 redirect from a XML object?
I am working on an Actionscript 2 project - trying to use the XML object to find a url which is returned as a 302 redirect. Is there a way to do this in actionscript 2? code: var urlone:XML = new XML(); urlone.load("http://mydomain.com/file.py"); urlone.onLoad = function (success) { trace("I want to print the 302 redir...
I don't think it's possible from AS2, I think the browser will redirect to the new URL automatically & just return the data from that URL. It may be possible in AS3, they added several new features such as reading HTTP headers and so on. Perhaps what you should do is instead of returning a 302 redirect, just return the...
In Actionscript 2 how can I get 302 redirect from a XML object? I am working on an Actionscript 2 project - trying to use the XML object to find a url which is returned as a 302 redirect. Is there a way to do this in actionscript 2? code: var urlone:XML = new XML(); urlone.load("http://mydomain.com/file.py"); urlone.on...
TITLE: In Actionscript 2 how can I get 302 redirect from a XML object? QUESTION: I am working on an Actionscript 2 project - trying to use the XML object to find a url which is returned as a 302 redirect. Is there a way to do this in actionscript 2? code: var urlone:XML = new XML(); urlone.load("http://mydomain.com/fi...
[ "actionscript", "actionscript-2", "http-status-code-302" ]
0
0
1,025
2
0
2008-10-10T16:23:05.800000
2008-10-10T16:32:13.550000
192,134
192,221
How do I get a SVN checkout using a Public/Private key pair?
I have to check some code and run it. I have the URL: svn+ssh://myuser@www.myclient.com/home/svn/project/trunk I have a file with their private key. What do I do to get this code?
The private key goes on the client machine, often named as ~/.ssh/id_rsa, ~/.ssh/id_dsa, or ~/.ssh/identity depending on the SSH version and the type of key. However, you can just use ssh -i path/to/private.key. This is presuming that the corresponding public key exists on the server in ~/.ssh/authorized_keys, and that...
How do I get a SVN checkout using a Public/Private key pair? I have to check some code and run it. I have the URL: svn+ssh://myuser@www.myclient.com/home/svn/project/trunk I have a file with their private key. What do I do to get this code?
TITLE: How do I get a SVN checkout using a Public/Private key pair? QUESTION: I have to check some code and run it. I have the URL: svn+ssh://myuser@www.myclient.com/home/svn/project/trunk I have a file with their private key. What do I do to get this code? ANSWER: The private key goes on the client machine, often na...
[ "svn", "ssh", "key" ]
30
5
73,963
8
0
2008-10-10T16:24:43.613000
2008-10-10T16:47:43.287000
192,138
192,189
What is the name of this data structure or technique of using relative difference between sequence members
Let's say I have a sequence of values (e.g., 3, 5, 8, 12, 15) and I want to occasionally decrease all of them by a certain value. If I store them as the sequence (0, 2, 3, 4, 3) and keep a variable as a base of 3, I now only have to change the base (and check the first items) whenever I want to decrease them instead of...
Differential Coding / Delta Encoding? I don't know a name for the data structure, but it's basically just base+offset:-)
What is the name of this data structure or technique of using relative difference between sequence members Let's say I have a sequence of values (e.g., 3, 5, 8, 12, 15) and I want to occasionally decrease all of them by a certain value. If I store them as the sequence (0, 2, 3, 4, 3) and keep a variable as a base of 3,...
TITLE: What is the name of this data structure or technique of using relative difference between sequence members QUESTION: Let's say I have a sequence of values (e.g., 3, 5, 8, 12, 15) and I want to occasionally decrease all of them by a certain value. If I store them as the sequence (0, 2, 3, 4, 3) and keep a variab...
[ "terminology" ]
0
4
239
4
0
2008-10-10T16:25:53.517000
2008-10-10T16:37:46.893000
192,153
192,270
What is the best way to read the Rails session secret?
I would like to access the Rails session secret programmatically (I am using it to generate a sign-on token). Here's what I've come up with: ActionController::Base.session.first[:secret] This returns the session secret. However, every time you call ActionController::Base.session it adds another entry to an array so you...
ActionController::Base.session_options_for(request,params[:action])[:secret]
What is the best way to read the Rails session secret? I would like to access the Rails session secret programmatically (I am using it to generate a sign-on token). Here's what I've come up with: ActionController::Base.session.first[:secret] This returns the session secret. However, every time you call ActionController...
TITLE: What is the best way to read the Rails session secret? QUESTION: I would like to access the Rails session secret programmatically (I am using it to generate a sign-on token). Here's what I've come up with: ActionController::Base.session.first[:secret] This returns the session secret. However, every time you cal...
[ "ruby-on-rails", "ruby", "session" ]
9
2
2,822
5
0
2008-10-10T16:29:16.943000
2008-10-10T17:05:08.743000
192,188
193,944
Using Xdebug & Zend Debugger Simultaneously?
Is it possible to run both debuggers within the same PHP installation simultaneously. They both use different ports so communication with the client IDEs/other apps wouldn't be an issue. I ask only because using the Zend Debugger with ZendStudio has proven to be much easier (fewer steps to start/stop debugging from the...
http://www.suspekt.org/2008/08/04/xdebug-203-stealth-patch/ (in particular the last comment) seems to indicate that the profiling parts of Xedebug will work fine alongside Zend Debugger, with the patch installed.
Using Xdebug & Zend Debugger Simultaneously? Is it possible to run both debuggers within the same PHP installation simultaneously. They both use different ports so communication with the client IDEs/other apps wouldn't be an issue. I ask only because using the Zend Debugger with ZendStudio has proven to be much easier ...
TITLE: Using Xdebug & Zend Debugger Simultaneously? QUESTION: Is it possible to run both debuggers within the same PHP installation simultaneously. They both use different ports so communication with the client IDEs/other apps wouldn't be an issue. I ask only because using the Zend Debugger with ZendStudio has proven ...
[ "php", "profiling", "xdebug", "zend-studio", "zend-debugger" ]
3
5
5,135
3
0
2008-10-10T16:37:28.597000
2008-10-11T10:37:30.833000
192,203
192,209
What's the Linq to SQL equivalent to TOP or LIMIT/OFFSET?
How do I do this Select top 10 Foo from MyTable in Linq to SQL?
In VB: from m in MyTable take 10 select m.Foo This assumes that MyTable implements IQueryable. You may have to access that through a DataContext or some other provider. It also assumes that Foo is a column in MyTable that gets mapped to a property name. See http://blogs.msdn.com/vbteam/archive/2008/01/08/converting-sql...
What's the Linq to SQL equivalent to TOP or LIMIT/OFFSET? How do I do this Select top 10 Foo from MyTable in Linq to SQL?
TITLE: What's the Linq to SQL equivalent to TOP or LIMIT/OFFSET? QUESTION: How do I do this Select top 10 Foo from MyTable in Linq to SQL? ANSWER: In VB: from m in MyTable take 10 select m.Foo This assumes that MyTable implements IQueryable. You may have to access that through a DataContext or some other provider. It...
[ "linq-to-sql" ]
200
147
187,758
13
0
2008-10-10T16:42:22.250000
2008-10-10T16:45:20.263000
192,220
192,462
What is the most efficient/elegant way to parse a flat table into a tree?
Assume you have a flat table that stores an ordered tree hierarchy: Id Name ParentId Order 1 'Node 1' 0 10 2 'Node 1.1' 1 10 3 'Node 2' 0 20 4 'Node 1.1.1' 2 10 5 'Node 2.1' 3 10 6 'Node 1.2' 1 20 Here's a diagram, where we have [id] Name. Root node 0 is fictional. [0] ROOT / \ [1] Node 1 [3] Node 2 / \ \ [2] Node 1.1 ...
Now that MySQL 8.0 supports recursive queries, we can say that all popular SQL databases support recursive queries in standard syntax. WITH RECURSIVE MyTree AS ( SELECT * FROM MyTable WHERE ParentId IS NULL UNION ALL SELECT m.* FROM MyTABLE AS m JOIN MyTree AS t ON m.ParentId = t.Id ) SELECT * FROM MyTree; I tested rec...
What is the most efficient/elegant way to parse a flat table into a tree? Assume you have a flat table that stores an ordered tree hierarchy: Id Name ParentId Order 1 'Node 1' 0 10 2 'Node 1.1' 1 10 3 'Node 2' 0 20 4 'Node 1.1.1' 2 10 5 'Node 2.1' 3 10 6 'Node 1.2' 1 20 Here's a diagram, where we have [id] Name. Root n...
TITLE: What is the most efficient/elegant way to parse a flat table into a tree? QUESTION: Assume you have a flat table that stores an ordered tree hierarchy: Id Name ParentId Order 1 'Node 1' 0 10 2 'Node 1.1' 1 10 3 'Node 2' 0 20 4 'Node 1.1.1' 2 10 5 'Node 2.1' 3 10 6 'Node 1.2' 1 20 Here's a diagram, where we have...
[ "sql", "algorithm", "recursion", "tree", "hierarchical-data" ]
576
508
140,374
15
0
2008-10-10T16:47:43.223000
2008-10-10T17:58:07.263000
192,238
192,494
Why does declaring content as a string cause WinHttp to not send HTTP content in Excel VBA?
I have an Excel VBA macro which does the equivalent of the following HTTP POST which works successfully: Set WebClient = CreateObject("WinHttp.WinHttpRequest.5.1") '... Configure WebClient for a POST request RequestBody = " " WebClient.send RequestBody Previously, I had explicitly set the type of RequestBody as a Strin...
Hmm... Try to add the reference to WinHTTP library (Tools - References). For no obvious reason sometimes it matters. But Send method is declared as using a Variant parameter anyway, so making it String doesn't make sense.
Why does declaring content as a string cause WinHttp to not send HTTP content in Excel VBA? I have an Excel VBA macro which does the equivalent of the following HTTP POST which works successfully: Set WebClient = CreateObject("WinHttp.WinHttpRequest.5.1") '... Configure WebClient for a POST request RequestBody = " " We...
TITLE: Why does declaring content as a string cause WinHttp to not send HTTP content in Excel VBA? QUESTION: I have an Excel VBA macro which does the equivalent of the following HTTP POST which works successfully: Set WebClient = CreateObject("WinHttp.WinHttpRequest.5.1") '... Configure WebClient for a POST request Re...
[ "excel", "winhttp", "vba" ]
1
3
1,118
1
0
2008-10-10T16:53:01.123000
2008-10-10T18:08:53.420000
192,241
605,019
Issue with database connection from sharepoint workflow with integrated security options
Good morning everyone, I'm running into an issue using a SharePoint workflow project (C#, VS 2008) and connecting to a database. Here is my database connection string: Data Source=DBSERVER;Initial Catalog=DBNAME;Integrated Security=True; When I attempt to run the following code I get the following error... SqlConnectio...
Any DB access should run as a Windows Service account for security and connection pooling reasons. Regarding the Workflow Security Context, see: SharePoint, Workflows and Security http://cglessner.blogspot.com/2008/09/sharepoint-workflows-and-security.html Declarative Workflows and User Context http://blogs.msdn.com/sh...
Issue with database connection from sharepoint workflow with integrated security options Good morning everyone, I'm running into an issue using a SharePoint workflow project (C#, VS 2008) and connecting to a database. Here is my database connection string: Data Source=DBSERVER;Initial Catalog=DBNAME;Integrated Security...
TITLE: Issue with database connection from sharepoint workflow with integrated security options QUESTION: Good morning everyone, I'm running into an issue using a SharePoint workflow project (C#, VS 2008) and connecting to a database. Here is my database connection string: Data Source=DBSERVER;Initial Catalog=DBNAME;I...
[ "sharepoint" ]
0
1
2,347
3
0
2008-10-10T16:54:13.053000
2009-03-03T03:38:57.910000
192,261
193,153
How do I log an exception at warning- or info-level with traceback using the python logging framework?
Using something like this: try: # Something... except Exception as excep: logger = logging.getLogger("component") logger.warning("something raised an exception: " + excep) logger.info("something raised an exception: " + excep) I would rather not have it on the error-level cause in my special case it is not an error.
From the logging documentation: There are three keyword arguments in kwargs which are inspected: exc_info, stack_info, and extra. If exc_info does not evaluate as false, it causes exception information to be added to the logging message. If an exception tuple (in the format returned by sys.exc_info() ) or an exception ...
How do I log an exception at warning- or info-level with traceback using the python logging framework? Using something like this: try: # Something... except Exception as excep: logger = logging.getLogger("component") logger.warning("something raised an exception: " + excep) logger.info("something raised an exception: "...
TITLE: How do I log an exception at warning- or info-level with traceback using the python logging framework? QUESTION: Using something like this: try: # Something... except Exception as excep: logger = logging.getLogger("component") logger.warning("something raised an exception: " + excep) logger.info("something rais...
[ "python", "exception", "logging", "python-logging" ]
78
125
44,498
3
0
2008-10-10T17:02:08.373000
2008-10-10T21:49:50.150000
192,264
192,316
Asp.Net Static method to refresh page
I have a page that is hitting a webservice every 5 seconds to update the information on the page. I'm using the DynamicPopulateExtender from the Ajax Control Toolkit to just populate a panel with some text. What I was wanting to do, is if a certain condition is met, to refresh the page completely. Am I going to be able...
You can't do anything from your ASMX. You can refresh the page from JavaScript by using a conventional page reload or by doing a postback that would perform server-side changes and then update via your UpdatePanel or, more simply, a Response.Redirect.
Asp.Net Static method to refresh page I have a page that is hitting a webservice every 5 seconds to update the information on the page. I'm using the DynamicPopulateExtender from the Ajax Control Toolkit to just populate a panel with some text. What I was wanting to do, is if a certain condition is met, to refresh the ...
TITLE: Asp.Net Static method to refresh page QUESTION: I have a page that is hitting a webservice every 5 seconds to update the information on the page. I'm using the DynamicPopulateExtender from the Ajax Control Toolkit to just populate a panel with some text. What I was wanting to do, is if a certain condition is me...
[ "c#", "asp.net", "javascript", "static", "methods" ]
2
4
9,928
2
0
2008-10-10T17:02:42.053000
2008-10-10T17:20:09.273000
192,292
192,305
How best to include other scripts?
The way you would normally include a script is with "source" eg: main.sh: #!/bin/bash source incl.sh echo "The main script" incl.sh: echo "The included script" The output of executing "./main.sh" is: The included script The main script... Now, if you attempt to execute that shell script from another location, it can'...
I tend to make my scripts all be relative to one another. That way I can use dirname: #!/bin/sh my_dir="$(dirname "$0")" "$my_dir/other_script.sh"
How best to include other scripts? The way you would normally include a script is with "source" eg: main.sh: #!/bin/bash source incl.sh echo "The main script" incl.sh: echo "The included script" The output of executing "./main.sh" is: The included script The main script... Now, if you attempt to execute that shell sc...
TITLE: How best to include other scripts? QUESTION: The way you would normally include a script is with "source" eg: main.sh: #!/bin/bash source incl.sh echo "The main script" incl.sh: echo "The included script" The output of executing "./main.sh" is: The included script The main script... Now, if you attempt to exe...
[ "bash" ]
457
269
417,954
23
0
2008-10-10T17:14:38.537000
2008-10-10T17:17:52.290000
192,313
192,321
Application window sent behind other windows on closing different thread (C#)
I'm writing a Windows Forms Application in C#.NET On startup, the application displays a splash screen which is running in a separate thread. Whilst the splash screen is showing, the main application is initialising. Once the main application has finished initialising, the main form of the application is displayed, and...
Try calling.Activate() on your main window when your thread closes. It's never been active, and thus has low Z-Order, so whatever is higher will naturally be above it. I had to fix this exact scenario in our app. Don't forget! You may need to marshal the call to the correct thread using an Invoke()!
Application window sent behind other windows on closing different thread (C#) I'm writing a Windows Forms Application in C#.NET On startup, the application displays a splash screen which is running in a separate thread. Whilst the splash screen is showing, the main application is initialising. Once the main application...
TITLE: Application window sent behind other windows on closing different thread (C#) QUESTION: I'm writing a Windows Forms Application in C#.NET On startup, the application displays a splash screen which is running in a separate thread. Whilst the splash screen is showing, the main application is initialising. Once th...
[ "c#", "winforms", "multithreading", "splash-screen" ]
16
11
6,765
4
0
2008-10-10T17:19:20.150000
2008-10-10T17:21:17.383000
192,319
192,337
How do I know the script file name in a Bash script?
How can I determine the name of the Bash script file inside the script itself? Like if my script is in file runme.sh, then how would I make it to display "You are running runme.sh" message without hardcoding that?
me=$(basename "$0") For reading through a symlink 1, which is usually not what you want (you usually don't want to confuse the user this way), try: me="$(basename "$(test -L "$0" && readlink "$0" || echo "$0")")" IMO, that'll produce confusing output. "I ran foo.sh, but it's saying I'm running bar.sh!? Must be a bug!" ...
How do I know the script file name in a Bash script? How can I determine the name of the Bash script file inside the script itself? Like if my script is in file runme.sh, then how would I make it to display "You are running runme.sh" message without hardcoding that?
TITLE: How do I know the script file name in a Bash script? QUESTION: How can I determine the name of the Bash script file inside the script itself? Like if my script is in file runme.sh, then how would I make it to display "You are running runme.sh" message without hardcoding that? ANSWER: me=$(basename "$0") For re...
[ "linux", "bash", "shell", "scripting" ]
775
802
645,356
26
0
2008-10-10T17:20:41.503000
2008-10-10T17:23:08.660000
192,329
193,609
Simple WPF sample causes uncontrolled memory growth
I have boiled down an issue I'm seeing in one of my applications to an incredibly simple reproduction sample. I need to know if there's something amiss or something I'm missing. Anyway, below is the code. The behavior is that the code runs and steadily grows in memory until it crashes with an OutOfMemoryException. That...
I was able to reproduce your problem using the code you provided. Memory keeps growing because the Canvas objects are never released; a memory profiler indicates that the Dispatcher's ContextLayoutManager is holding on to them all (so that it can invoke OnRenderSizeChanged when necessary). It seems that a simple workar...
Simple WPF sample causes uncontrolled memory growth I have boiled down an issue I'm seeing in one of my applications to an incredibly simple reproduction sample. I need to know if there's something amiss or something I'm missing. Anyway, below is the code. The behavior is that the code runs and steadily grows in memory...
TITLE: Simple WPF sample causes uncontrolled memory growth QUESTION: I have boiled down an issue I'm seeing in one of my applications to an incredibly simple reproduction sample. I need to know if there's something amiss or something I'm missing. Anyway, below is the code. The behavior is that the code runs and steadi...
[ "c#", "wpf", "memory-leaks" ]
14
11
7,288
4
0
2008-10-10T17:22:19.190000
2008-10-11T02:17:13.450000
192,332
192,356
Is there a way in .NET to have a method called automatically after another method has been invoked but before it is entered
What I am looking for is a way to call a method after another method has been invoked but before it is entered. Example: public class Test { public void Tracer (... ) { } public int SomeFunction( string str ) { return 0; } public void TestFun() { SomeFunction( "" ); } } In the example above I would like to have Tra...
You can use a dynamic proxy ( Castle's DynamicProxy for example) to intercept the call, run whatever code you wish, and then either invoke your method or not, depending on your needs.
Is there a way in .NET to have a method called automatically after another method has been invoked but before it is entered What I am looking for is a way to call a method after another method has been invoked but before it is entered. Example: public class Test { public void Tracer (... ) { } public int SomeFunction...
TITLE: Is there a way in .NET to have a method called automatically after another method has been invoked but before it is entered QUESTION: What I am looking for is a way to call a method after another method has been invoked but before it is entered. Example: public class Test { public void Tracer (... ) { } publi...
[ "c#", ".net" ]
6
5
537
8
0
2008-10-10T17:22:29.283000
2008-10-10T17:25:50.480000
192,345
3,957,876
Pylons with Elixir
I would like to use Pylons with Elixir, however, I am not sure what is the best way to get about doing this. There are several blog posts ( cleverdevil, beachcoder, adam hoscilo ) and even an entire new framework about how to go about doing this; however, I am not certain about the differences between them. Which one i...
Graham Higgins wrote about a pylon's template for this (do we call them templates? you know, the packages that get installed depending on what arguments you give to paster create...). I used it and it worked fine. You may also want to check this discussion on pylons list
Pylons with Elixir I would like to use Pylons with Elixir, however, I am not sure what is the best way to get about doing this. There are several blog posts ( cleverdevil, beachcoder, adam hoscilo ) and even an entire new framework about how to go about doing this; however, I am not certain about the differences betwee...
TITLE: Pylons with Elixir QUESTION: I would like to use Pylons with Elixir, however, I am not sure what is the best way to get about doing this. There are several blog posts ( cleverdevil, beachcoder, adam hoscilo ) and even an entire new framework about how to go about doing this; however, I am not certain about the ...
[ "python", "sqlalchemy", "pylons", "python-elixir" ]
8
1
1,006
2
0
2008-10-10T17:24:23.773000
2010-10-18T09:28:16.507000
192,367
192,525
In Django how do I notify a parent when a child is saved in a foreign key relationship?
I have the following two models: class Activity(models.Model): name = models.CharField(max_length=50, help_text='Some help.') entity = models.ForeignKey(CancellationEntity)... class Cancellation(models.Model): activity = models.ForeignKey(Activity) date = models.DateField(default=datetime.now().date()) description = m...
What you want to look into is Django's signals (check out this page too), specifically the model signals--more specifically, the post_save signal. Signals are Django's version of a plugin/hook system. The post_save signal gets sent every time a model is saved, whether it's updated or created (and it'll let you know if ...
In Django how do I notify a parent when a child is saved in a foreign key relationship? I have the following two models: class Activity(models.Model): name = models.CharField(max_length=50, help_text='Some help.') entity = models.ForeignKey(CancellationEntity)... class Cancellation(models.Model): activity = models.For...
TITLE: In Django how do I notify a parent when a child is saved in a foreign key relationship? QUESTION: I have the following two models: class Activity(models.Model): name = models.CharField(max_length=50, help_text='Some help.') entity = models.ForeignKey(CancellationEntity)... class Cancellation(models.Model): act...
[ "python", "django", "django-models" ]
18
18
4,290
3
0
2008-10-10T17:27:35.357000
2008-10-10T18:18:56.923000
192,373
192,418
Force Garbage Collection in AS3?
Is it possible to programmatically force a full garbage collection run in ActionScript 3.0? Let's say I've created a bunch of Display objects with eventListeners and some of the DO's have been removed, some of the eventListeners have been triggered and removed etc... Is there a way to force garbage collection to run an...
Yes, it's possible, but it is generally a bad idea. The GC should have a better idea of when is a good time to run than you should, and except for a very specific case, like you just used 500MB of memory and you need to get it back ASAP, you shouldn't call the GC yourself. In Flash 10, there is a System.gc() method you...
Force Garbage Collection in AS3? Is it possible to programmatically force a full garbage collection run in ActionScript 3.0? Let's say I've created a bunch of Display objects with eventListeners and some of the DO's have been removed, some of the eventListeners have been triggered and removed etc... Is there a way to f...
TITLE: Force Garbage Collection in AS3? QUESTION: Is it possible to programmatically force a full garbage collection run in ActionScript 3.0? Let's say I've created a bunch of Display objects with eventListeners and some of the DO's have been removed, some of the eventListeners have been triggered and removed etc... I...
[ "apache-flex", "flash", "actionscript-3", "garbage-collection" ]
18
25
33,575
8
0
2008-10-10T17:30:44.197000
2008-10-10T17:45:09.223000
192,398
193,625
Select XML nodes as rows
I am selecting from a table that has an XML column using T-SQL. I would like to select a certain type of node and have a row created for each one. For instance, suppose I am selecting from a people table. This table has an XML column for addresses. The XML is formated similar to the following: Street 1 City 1 State 1 Z...
Here is your solution: /* TEST TABLE */ DECLARE @PEOPLE AS TABLE ([Name] VARCHAR(20), [Address] XML ) INSERT INTO @PEOPLE SELECT 'Joel', ' Street 1 City 1 State 1 Zip Code 1 Street 2 City 2 State 2 Zip Code 2 ' UNION ALL SELECT 'Kim', ' Street 3 City 3 State 3 Zip Code 3 ' SELECT * FROM @PEOPLE -- BUILD XML DECLARE @...
Select XML nodes as rows I am selecting from a table that has an XML column using T-SQL. I would like to select a certain type of node and have a row created for each one. For instance, suppose I am selecting from a people table. This table has an XML column for addresses. The XML is formated similar to the following: ...
TITLE: Select XML nodes as rows QUESTION: I am selecting from a table that has an XML column using T-SQL. I would like to select a certain type of node and have a row created for each one. For instance, suppose I am selecting from a people table. This table has an XML column for addresses. The XML is formated similar ...
[ "sql", "xml", "t-sql", "xpath" ]
15
32
62,124
5
0
2008-10-10T17:37:03.250000
2008-10-11T04:11:04.857000
192,432
194,403
Using new Groovy Grape capability results in "unable to resolve class" error
I've tried to use the new Groovy Grape capability in Groovy 1.6-beta-2 but I get an error message; unable to resolve class com.jidesoft.swing.JideSplitButton from the Groovy Console (/opt/groovy/groovy-1.6-beta-2/bin/groovyConsole) when running the stock example; import com.jidesoft.swing.JideSplitButton @Grab(group='c...
There is still some kinks in working out the startup/kill switch routine. For Beta-2 do this in it's own script first: groovy.grape.Grape.initGrape() Another issue you will run into deals with the joys of using an unbounded upper range. Jide-oss from 2.3.0 onward has been compiling their code to Java 6 bytecodes, so yo...
Using new Groovy Grape capability results in "unable to resolve class" error I've tried to use the new Groovy Grape capability in Groovy 1.6-beta-2 but I get an error message; unable to resolve class com.jidesoft.swing.JideSplitButton from the Groovy Console (/opt/groovy/groovy-1.6-beta-2/bin/groovyConsole) when runnin...
TITLE: Using new Groovy Grape capability results in "unable to resolve class" error QUESTION: I've tried to use the new Groovy Grape capability in Groovy 1.6-beta-2 but I get an error message; unable to resolve class com.jidesoft.swing.JideSplitButton from the Groovy Console (/opt/groovy/groovy-1.6-beta-2/bin/groovyCo...
[ "grails", "groovy", "groovy-grape" ]
13
5
17,817
7
0
2008-10-10T17:49:56.017000
2008-10-11T18:24:28.847000
192,454
200,657
How can KDiff3 be used properly with TortoiseSVN to resolve conflicts?
I have TortoiseSVN set up to use KDiff3 as the conflict resolution tool (I find it shows more information useful to the merge than the built-in TortoiseMerge does). When I open a file with Tortoise's "Edit Conflicts" command it shows me the three files and I have to select "Merge->Merge Current File" manually. The prob...
Mine is a bit longer: "C:\Program Files\KDiff3\kdiff3.exe" %base %mine %theirs -o %merged --L1 Base --L2 Mine --L3 Theirs
How can KDiff3 be used properly with TortoiseSVN to resolve conflicts? I have TortoiseSVN set up to use KDiff3 as the conflict resolution tool (I find it shows more information useful to the merge than the built-in TortoiseMerge does). When I open a file with Tortoise's "Edit Conflicts" command it shows me the three fi...
TITLE: How can KDiff3 be used properly with TortoiseSVN to resolve conflicts? QUESTION: I have TortoiseSVN set up to use KDiff3 as the conflict resolution tool (I find it shows more information useful to the merge than the built-in TortoiseMerge does). When I open a file with Tortoise's "Edit Conflicts" command it sho...
[ "svn", "tortoisesvn", "diff", "conflict" ]
30
44
11,470
4
0
2008-10-10T17:56:32.383000
2008-10-14T10:28:08.183000
192,464
192,555
Improving really bad systems
How would you begin improving on a really bad system? Let me explain what I mean before you recommend creating unit tests and refactoring. I could use those techniques but that would be pointless in this case. Actually the system is so broken it doesn't do what it needs to do. For example the system should count how ma...
Put out the fires. If there are any issues of critical priority, whatever they are, you've got to handle them first. Hack it in if you must, with a smelly codebase it's ok. You know you'll improve it going forward. This is your sales technique targeted at whomever you're reporting to. Pick some low-hanging fruit. I ass...
Improving really bad systems How would you begin improving on a really bad system? Let me explain what I mean before you recommend creating unit tests and refactoring. I could use those techniques but that would be pointless in this case. Actually the system is so broken it doesn't do what it needs to do. For example t...
TITLE: Improving really bad systems QUESTION: How would you begin improving on a really bad system? Let me explain what I mean before you recommend creating unit tests and refactoring. I could use those techniques but that would be pointless in this case. Actually the system is so broken it doesn't do what it needs to...
[ "refactoring", "system" ]
13
14
637
9
0
2008-10-10T17:59:15.327000
2008-10-10T18:27:55.313000
192,465
2,455,409
How to localize ASP.NET MVC application?
What would be best practice to localize your ASP.NET MVC application? I would like to cover two situations: one application deployment in IIS which would handle multiple languages one language/application deployment. In first situation should you go with some kind of view based thing like, ~/View/EN, ~/View/FI, ~/View/...
You can also take a look here ASP.NET MVC 2 Localization complete guide and ASP.NET MVC 2 Model Validation With Localization these entires will help you if you working with ASP.NET MVC 2.
How to localize ASP.NET MVC application? What would be best practice to localize your ASP.NET MVC application? I would like to cover two situations: one application deployment in IIS which would handle multiple languages one language/application deployment. In first situation should you go with some kind of view based ...
TITLE: How to localize ASP.NET MVC application? QUESTION: What would be best practice to localize your ASP.NET MVC application? I would like to cover two situations: one application deployment in IIS which would handle multiple languages one language/application deployment. In first situation should you go with some k...
[ "asp.net-mvc", "localization", "globalization" ]
123
73
69,453
9
0
2008-10-10T17:59:30.693000
2010-03-16T14:58:37.927000
192,477
192,515
Connecting to Informix database from .Net
What's the best way to connect to a Informix database from.Net? I'm developing a client-server application based on a legacy Informix DB which used to be connected by JDBC. I need it, from the most important to the least: To be fast DB server changes not needed No ODBC and no dependencies, other than de.Net Framework 2...
The connections strings to use with OleDb or ADO.NET can be found here. Take a look at this article on how to connect to an Informix database using ADO.NET.
Connecting to Informix database from .Net What's the best way to connect to a Informix database from.Net? I'm developing a client-server application based on a legacy Informix DB which used to be connected by JDBC. I need it, from the most important to the least: To be fast DB server changes not needed No ODBC and no d...
TITLE: Connecting to Informix database from .Net QUESTION: What's the best way to connect to a Informix database from.Net? I'm developing a client-server application based on a legacy Informix DB which used to be connected by JDBC. I need it, from the most important to the least: To be fast DB server changes not neede...
[ "c#", ".net", "database-connection", "informix" ]
4
5
12,444
4
0
2008-10-10T18:02:22.387000
2008-10-10T18:14:59.380000
192,484
207,435
Getting a useful report from SVN - non-code files messing the stats up
I have a SVN repository for my project; it keeps code, docs, graphs, etc. Everything related to the project is there and versioned. However, I am trying to get some kind of intelligent stats for my code. The stat program I am using is StatSVN - they seem to be best of breed as far as I can tell. However, I am getting r...
I built StatSVN and currently maintain it:) You can use exclude based on filenames and folders. Take a look at our wiki!
Getting a useful report from SVN - non-code files messing the stats up I have a SVN repository for my project; it keeps code, docs, graphs, etc. Everything related to the project is there and versioned. However, I am trying to get some kind of intelligent stats for my code. The stat program I am using is StatSVN - they...
TITLE: Getting a useful report from SVN - non-code files messing the stats up QUESTION: I have a SVN repository for my project; it keeps code, docs, graphs, etc. Everything related to the project is there and versioned. However, I am trying to get some kind of intelligent stats for my code. The stat program I am using...
[ "svn", "logging", "metrics" ]
2
2
766
3
0
2008-10-10T18:05:48.213000
2008-10-16T04:15:56.827000
192,502
194,193
trac and svn (tortoise) - "Issue Tracker Plugin" - ( yes, yet another svn and trac question)
I would like to be able to "get information from the issue tracker" as described in the section "Getting Information from the Issue Tracker" at: http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-bugtracker.html (display a dlg box to the user when they start a commit action in svn so they can choose form a lis...
There are example implementations of IBugTraqProvider in the contrib/ directory of the TSVN source. One's in ATL; it runs an EXE, passing (among other things) a temporary filename for the provider to write a commit message to. That EXE should talk to your issue tracker. The other's in C#; it displays some mocked up dat...
trac and svn (tortoise) - "Issue Tracker Plugin" - ( yes, yet another svn and trac question) I would like to be able to "get information from the issue tracker" as described in the section "Getting Information from the Issue Tracker" at: http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-bugtracker.html (displ...
TITLE: trac and svn (tortoise) - "Issue Tracker Plugin" - ( yes, yet another svn and trac question) QUESTION: I would like to be able to "get information from the issue tracker" as described in the section "Getting Information from the Issue Tracker" at: http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-bugt...
[ "tortoisesvn", "bug-tracking", "trac" ]
2
4
2,756
1
0
2008-10-10T18:11:17.157000
2008-10-11T15:20:51.043000
192,527
192,854
What are the advantages of memory-mapped files?
I've been researching memory mapped files for a project and would appreciate any thoughts from people who have either used them before, or decided against using them, and why? In particular, I am concerned about the following, in order of importance: concurrency random access performance ease of use portability
I think the advantage is really that you reduce the amount of data copying required over traditional methods of reading a file. If your application can use the data "in place" in a memory-mapped file, it can come in without being copied; if you use a system call (e.g. Linux's pread() ) then that typically involves the ...
What are the advantages of memory-mapped files? I've been researching memory mapped files for a project and would appreciate any thoughts from people who have either used them before, or decided against using them, and why? In particular, I am concerned about the following, in order of importance: concurrency random ac...
TITLE: What are the advantages of memory-mapped files? QUESTION: I've been researching memory mapped files for a project and would appreciate any thoughts from people who have either used them before, or decided against using them, and why? In particular, I am concerned about the following, in order of importance: con...
[ "language-agnostic", "memory", "filesystems" ]
102
61
57,256
4
0
2008-10-10T18:19:29.823000
2008-10-10T20:01:06.780000
192,538
194,018
In the hCalendar microformat, what markup is allowed in a description?
I am working on a calendar application that outputs a list of events in hCalendar format. This includes an element that has a class of " description " which should be used for the event's description. My question is, what markup is allowed in my hCalendar event's description? I found one example on the hCalendar websit...
As far as Microformats are concerned, you can use any valid HTML markup in the description (and everywhere else). However, the iCalendar format, which is often used for extraction of hCalendars, only allows plain text in the description. Use any markup you need, but be prepared that Microformat parsers will convert it ...
In the hCalendar microformat, what markup is allowed in a description? I am working on a calendar application that outputs a list of events in hCalendar format. This includes an element that has a class of " description " which should be used for the event's description. My question is, what markup is allowed in my hCa...
TITLE: In the hCalendar microformat, what markup is allowed in a description? QUESTION: I am working on a calendar application that outputs a list of events in hCalendar format. This includes an element that has a class of " description " which should be used for the event's description. My question is, what markup is...
[ "xhtml", "microformats", "hcalendar" ]
1
2
155
1
0
2008-10-10T18:22:54.060000
2008-10-11T12:15:34.740000
192,539
192,580
Use asynchronous delegates or ThreadPool.QueueUserWorkItem for massive parallelism?
I have a.NET application that processes around 300,000 records in a batch import, and it takes a few seconds per record so I would like to parallelize this. In the following code, what's the difference between ProcessWithAnsycDelegates() and ProcessWithThreadPool()? public class ResultNotification { public EventHandler...
In this case, not a lot as they both use the threadpool under the hood. I'd say that the QueueUserWorkItem() is easier to read and see what's going on vs. BeginInvoke(). This link may help. It's older information, but still mostly applicable: https://jonskeet.uk/csharp/threads/threadpool.html
Use asynchronous delegates or ThreadPool.QueueUserWorkItem for massive parallelism? I have a.NET application that processes around 300,000 records in a batch import, and it takes a few seconds per record so I would like to parallelize this. In the following code, what's the difference between ProcessWithAnsycDelegates(...
TITLE: Use asynchronous delegates or ThreadPool.QueueUserWorkItem for massive parallelism? QUESTION: I have a.NET application that processes around 300,000 records in a batch import, and it takes a few seconds per record so I would like to parallelize this. In the following code, what's the difference between ProcessW...
[ ".net", "multithreading", "asynchronous", "threadpool" ]
6
6
2,994
2
0
2008-10-10T18:23:13.017000
2008-10-10T18:36:29.323000
192,549
197,094
How can I use different RJS templates from the same rails controller?
I have a controller method that returns a list for a drop down that gets rendered in a partial, but depending on where the partial is being used, the RJS template needs to be different. Can I pass a parameter to the controller that will determine which RJS gets used? Here is the controller method, it is very simple: de...
What about placing the conditional logic in one rjs template? # services.rjs if @type == "your conditions" # your rjs updates else # your other rjs updates end This gives you a cleaner controller and saves you the headache of maintaining multiple rjs templates.
How can I use different RJS templates from the same rails controller? I have a controller method that returns a list for a drop down that gets rendered in a partial, but depending on where the partial is being used, the RJS template needs to be different. Can I pass a parameter to the controller that will determine whi...
TITLE: How can I use different RJS templates from the same rails controller? QUESTION: I have a controller method that returns a list for a drop down that gets rendered in a partial, but depending on where the partial is being used, the RJS template needs to be different. Can I pass a parameter to the controller that ...
[ "ruby-on-rails", "ruby", "rjs" ]
2
2
3,052
4
0
2008-10-10T18:25:14.773000
2008-10-13T09:27:56.103000
192,553
192,594
ASP.net MVC custom string output overloaded operator <%=h
I am currently in the process of making a new ASP.net MVC website, and find myself using Html.Encode all over the place, which is good practice, but gets pretty messy. I think a good way to clean this up would be if I could overload an operator to automatically do Html encoding. Previously: <%= Html.Encode( ViewData['u...
It's not so clean as an operator overload, but I used the following extension method: public static string Safe(this string sz) { return HttpUtility.HtmlEncode(sz); } So in my aspx id do: <%= this.ViewData["username"].Safe() %> Tacking the extra method onto the end of the expression just looks prettier to me than sendi...
ASP.net MVC custom string output overloaded operator <%=h I am currently in the process of making a new ASP.net MVC website, and find myself using Html.Encode all over the place, which is good practice, but gets pretty messy. I think a good way to clean this up would be if I could overload an operator to automatically ...
TITLE: ASP.net MVC custom string output overloaded operator <%=h QUESTION: I am currently in the process of making a new ASP.net MVC website, and find myself using Html.Encode all over the place, which is good practice, but gets pretty messy. I think a good way to clean this up would be if I could overload an operator...
[ "asp.net-mvc", "html-encode" ]
0
7
1,501
2
0
2008-10-10T18:26:33.070000
2008-10-10T18:39:49.783000
192,561
192,571
Is there a Visual Studio plugin for sorting build output (scrambled from multi-threaded builds)?
My work just gave me a quad core computer, and WOW build times are fast! (What used to take 20+ minutes now takes 7 minutes). Anyway, Visual Studio builds project in parallel (great for build times), but scrambles the output: 1>Performing Makefile project actions 3>arg.c 2>msg.c 3>log.c 4>test.c (and so on....) Is the...
Selecting the "Build order" item in the "Show output from" dropdown list in the output and errors panes probably does what you are looking for.
Is there a Visual Studio plugin for sorting build output (scrambled from multi-threaded builds)? My work just gave me a quad core computer, and WOW build times are fast! (What used to take 20+ minutes now takes 7 minutes). Anyway, Visual Studio builds project in parallel (great for build times), but scrambles the outpu...
TITLE: Is there a Visual Studio plugin for sorting build output (scrambled from multi-threaded builds)? QUESTION: My work just gave me a quad core computer, and WOW build times are fast! (What used to take 20+ minutes now takes 7 minutes). Anyway, Visual Studio builds project in parallel (great for build times), but s...
[ "visual-studio", "plugins" ]
2
9
962
1
0
2008-10-10T18:30:20.503000
2008-10-10T18:33:53.727000
192,575
192,695
Transfering User Names from One Forum to Another?
How do I transfer the users of a vBulletin forum to a new installation of IceBB?
Presumably, they both have a database back-end of some sort, right? SQL dump, followed by patching stuff up in your favorite scripting language, followed by SQL load, seems do-able.
Transfering User Names from One Forum to Another? How do I transfer the users of a vBulletin forum to a new installation of IceBB?
TITLE: Transfering User Names from One Forum to Another? QUESTION: How do I transfer the users of a vBulletin forum to a new installation of IceBB? ANSWER: Presumably, they both have a database back-end of some sort, right? SQL dump, followed by patching stuff up in your favorite scripting language, followed by SQL l...
[ "data-transfer", "vbulletin" ]
0
1
141
2
0
2008-10-10T18:34:53.773000
2008-10-10T19:13:17.267000
192,584
192,654
How can I set different Tooltip text for each item in a listbox?
I have a listbox that is databound to a Collection of objects. The listbox is configured to display an identifier property of each object. I would like to show a tooltip with information specific to the item within the listbox that is being hovered over rather than one tooltip for the listbox as a whole. I am working w...
There are two main sub-problems one must solve in order to solve this problem: Determine which item is being hovered over Get the MouseHover event to fire when the user has hovered over one item, then moved the cursor within the listbox and hovered over another item. The first problem is rather simple to solve. By call...
How can I set different Tooltip text for each item in a listbox? I have a listbox that is databound to a Collection of objects. The listbox is configured to display an identifier property of each object. I would like to show a tooltip with information specific to the item within the listbox that is being hovered over r...
TITLE: How can I set different Tooltip text for each item in a listbox? QUESTION: I have a listbox that is databound to a Collection of objects. The listbox is configured to display an identifier property of each object. I would like to show a tooltip with information specific to the item within the listbox that is be...
[ "c#", ".net", "winforms", "winapi", "listbox" ]
27
20
49,469
7
0
2008-10-10T18:37:59.820000
2008-10-10T18:58:20.887000
192,599
192,615
What are some of the advantage/disadvantages of using SQLDataReader?
SqlDataReader is a faster way to process the stored procedure. What are some of the advantage/disadvantages of using SQLDataReader?
I assume you mean "instead of loading the results into a DataTable"? Advantages: you're in control of how the data is loaded. You can ask for specific data types, and you don't end up loading the whole set of data into memory all at the same time unless you want to. Basically, if you want the data but don't need a data...
What are some of the advantage/disadvantages of using SQLDataReader? SqlDataReader is a faster way to process the stored procedure. What are some of the advantage/disadvantages of using SQLDataReader?
TITLE: What are some of the advantage/disadvantages of using SQLDataReader? QUESTION: SqlDataReader is a faster way to process the stored procedure. What are some of the advantage/disadvantages of using SQLDataReader? ANSWER: I assume you mean "instead of loading the results into a DataTable"? Advantages: you're in c...
[ ".net-2.0" ]
5
7
4,386
5
0
2008-10-10T18:40:46.740000
2008-10-10T18:46:06.713000
192,602
192,972
Are there documented, organized collections of libraries for Common Lisp?
I am a college student at a school that teaches mainly in Java. One of the strong points of Java, which I quite enjoy, is the large collection of libraries. What makes these libraries especially useful is the extensive documentation and organization presented via JavaDoc. Are there any library collections for Common Li...
No, there is no comprehensive, consistently documented library collection. The inexistence of such a thing is Common Lisp's biggest problem right now. If you're interested in helping the Lisp community, this may well be the thing to attack first. Also, while there are various JavaDoc equivalents, there is no widely acc...
Are there documented, organized collections of libraries for Common Lisp? I am a college student at a school that teaches mainly in Java. One of the strong points of Java, which I quite enjoy, is the large collection of libraries. What makes these libraries especially useful is the extensive documentation and organizat...
TITLE: Are there documented, organized collections of libraries for Common Lisp? QUESTION: I am a college student at a school that teaches mainly in Java. One of the strong points of Java, which I quite enjoy, is the large collection of libraries. What makes these libraries especially useful is the extensive documenta...
[ "lisp", "common-lisp", "documentation-generation" ]
8
5
611
9
0
2008-10-10T18:42:20.560000
2008-10-10T20:47:34.300000
192,628
192,679
Google Page Rank - New Domain / Link Structure Migration
i've been tasked with re-organizing a pure HTML site into a CMS. if all goes well, the new site will eventually become the main URL, and the old domain will be phased out. the old domain has a decent enough page rank, and the company wishes to mitigate any loss of page rank for that. in looking over the options availab...
If you really truly want to ensure that page rank is not lost, you will want to replace the old content with something that performs a proper 301 redirect to the new location. With a 301 redirect the search spiders will know that the content is moved and the page rank typically carries over. It also helps external link...
Google Page Rank - New Domain / Link Structure Migration i've been tasked with re-organizing a pure HTML site into a CMS. if all goes well, the new site will eventually become the main URL, and the old domain will be phased out. the old domain has a decent enough page rank, and the company wishes to mitigate any loss o...
TITLE: Google Page Rank - New Domain / Link Structure Migration QUESTION: i've been tasked with re-organizing a pure HTML site into a CMS. if all goes well, the new site will eventually become the main URL, and the old domain will be phased out. the old domain has a decent enough page rank, and the company wishes to m...
[ "seo", "migration", "pagerank" ]
4
6
957
2
0
2008-10-10T18:50:22.150000
2008-10-10T19:06:57.047000
192,641
192,897
Settings.Default.<property> always returns default value instead of value in persistant storage (XML file)
I recently wrote a DLL in C# (.Net 2.0) which contains a class that requires an IP address. A co-worker of mine altered the class to retrieve the IP from a ".dll.config" (XML) file -- This apparently is automatically generated by the "Application Settings" file he created (Settings1.settings). The benefit of this was t...
I'm addressing this exact issue in an application I'm in the midst of prototyping. Although Decker's suggestion of hacking the config files together should work I think this is a pretty inconvenient manual hack to perform as part of a build cycle. Instead of that I've decided that the cleanest solution is to just have ...
Settings.Default.<property> always returns default value instead of value in persistant storage (XML file) I recently wrote a DLL in C# (.Net 2.0) which contains a class that requires an IP address. A co-worker of mine altered the class to retrieve the IP from a ".dll.config" (XML) file -- This apparently is automatica...
TITLE: Settings.Default.<property> always returns default value instead of value in persistant storage (XML file) QUESTION: I recently wrote a DLL in C# (.Net 2.0) which contains a class that requires an IP address. A co-worker of mine altered the class to retrieve the IP from a ".dll.config" (XML) file -- This appare...
[ "c#", ".net", "dll", "application-settings" ]
11
2
13,290
10
0
2008-10-10T18:53:46.353000
2008-10-10T20:18:43.437000
192,643
192,706
.NET Dynamic Objects with Reflection
How do I determine if a Nullable(of Enum) is indeed an Enum by means of reflection? I'm working with a method that dynamically populates an object of type T with an IDataReader retrieved from a database call. At its essence, it loops through the datareader's ordinals, and all the properties of T and populates the prope...
It's a bit cumbersome: Get type from PropertyInfo.PropertyType Test for IsGenericType If it is, get the generic type with GetGenericTypeDefinition() If that type equals typeof(Nullable<>), you have a Nullable Get the underlying (i.e. Enum ) type with Nullable.GetUnderlyingType(propertyInfo.PropertyType)
.NET Dynamic Objects with Reflection How do I determine if a Nullable(of Enum) is indeed an Enum by means of reflection? I'm working with a method that dynamically populates an object of type T with an IDataReader retrieved from a database call. At its essence, it loops through the datareader's ordinals, and all the pr...
TITLE: .NET Dynamic Objects with Reflection QUESTION: How do I determine if a Nullable(of Enum) is indeed an Enum by means of reflection? I'm working with a method that dynamically populates an object of type T with an IDataReader retrieved from a database call. At its essence, it loops through the datareader's ordina...
[ ".net", "reflection", "enums", "nullable" ]
1
7
1,372
4
0
2008-10-10T18:54:51.860000
2008-10-10T19:18:02.373000
192,648
193,897
CakePHP - How do i set the page title to an item name?
OK, so I'm trying to teach myself the CakePHP framework, and I'm trying to knock up a simple demo app for myself. I have the controllers, views and models all set up and working, but I want to do something slightly more than the basic online help shows. I have a guitars_controller.php file as follows... set('Guitars', ...
These actions are model agnostic so can be put in your app/app_controller.php file set(Inflector::variable($this->name), $this->{$this->modelClass}->findAll()); $this->pageTitle = 'All '.Inflector::humanize($this->name); } function view($id = null) { $data = $this->{$this->modelClass}->findById($id); $this->set(Inflect...
CakePHP - How do i set the page title to an item name? OK, so I'm trying to teach myself the CakePHP framework, and I'm trying to knock up a simple demo app for myself. I have the controllers, views and models all set up and working, but I want to do something slightly more than the basic online help shows. I have a gu...
TITLE: CakePHP - How do i set the page title to an item name? QUESTION: OK, so I'm trying to teach myself the CakePHP framework, and I'm trying to knock up a simple demo app for myself. I have the controllers, views and models all set up and working, but I want to do something slightly more than the basic online help ...
[ "php", "cakephp" ]
5
5
12,889
10
0
2008-10-10T18:55:54.383000
2008-10-11T09:37:09.380000
192,649
192,703
Can you monkey patch methods on core types in Python?
Ruby can add methods to the Number class and other core types to get effects like this: 1.should_equal(1) But it seems like Python cannot do this. Is this true? And if so, why? Does it have something to do with the fact that type can't be modified? Rather than talking about different definitions of monkey patching, I w...
What exactly do you mean by Monkey Patch here? There are several slightly different definitions. If you mean, "can you change a class's methods at runtime?", then the answer is emphatically yes: class Foo: pass # dummy class Foo.bar = lambda self: 42 x = Foo() print x.bar() If you mean, "can you change a class's meth...
Can you monkey patch methods on core types in Python? Ruby can add methods to the Number class and other core types to get effects like this: 1.should_equal(1) But it seems like Python cannot do this. Is this true? And if so, why? Does it have something to do with the fact that type can't be modified? Rather than talki...
TITLE: Can you monkey patch methods on core types in Python? QUESTION: Ruby can add methods to the Number class and other core types to get effects like this: 1.should_equal(1) But it seems like Python cannot do this. Is this true? And if so, why? Does it have something to do with the fact that type can't be modified?...
[ "python", "programming-languages", "monkeypatching", "fluent-interface" ]
58
46
29,467
15
0
2008-10-10T18:56:12.340000
2008-10-10T19:15:42.207000
192,653
192,690
How come I can't see member 'Default' on a class derived from ApplicationSettingsBase?
I'm using.NET 3.5 and I have a class, A, marked as internal sealed partial and it derives from System.Configuration.ApplicationSettingsBase. I then use an instance of this class in the following manner: A A_Instance = new A(); A_Instance.Default.Save(); Why would the Visual C# compiler be complaining: error CS0117: 'A'...
You are probably looking for this: private static ServerSettings defaultInstance = ((ServerSettings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new ServerSettings()))); public static ServerSettings Default { get { return defaultInstance; } } This is the code that gets generated by visual studio
How come I can't see member 'Default' on a class derived from ApplicationSettingsBase? I'm using.NET 3.5 and I have a class, A, marked as internal sealed partial and it derives from System.Configuration.ApplicationSettingsBase. I then use an instance of this class in the following manner: A A_Instance = new A(); A_Inst...
TITLE: How come I can't see member 'Default' on a class derived from ApplicationSettingsBase? QUESTION: I'm using.NET 3.5 and I have a class, A, marked as internal sealed partial and it derives from System.Configuration.ApplicationSettingsBase. I then use an instance of this class in the following manner: A A_Instance...
[ "c#", ".net" ]
0
3
795
3
0
2008-10-10T18:57:48.467000
2008-10-10T19:12:22.247000
192,684
192,716
Ant's wrong directory on property
I'm a newbie on Ant so instead of posting this on the official buglist(because its probably not a bug), I decided to post here: When I run my Ant build.xml file everything works well except for the build directory, that instead of translating the property ${classes.dir} into build/ver_2.0.0/classes it creates a file ${...
It will create directory named ${after}... You must initialize your parameters first before use!
Ant's wrong directory on property I'm a newbie on Ant so instead of posting this on the official buglist(because its probably not a bug), I decided to post here: When I run my Ant build.xml file everything works well except for the build directory, that instead of translating the property ${classes.dir} into build/ver_...
TITLE: Ant's wrong directory on property QUESTION: I'm a newbie on Ant so instead of posting this on the official buglist(because its probably not a bug), I decided to post here: When I run my Ant build.xml file everything works well except for the build directory, that instead of translating the property ${classes.di...
[ "java", "ant" ]
0
5
415
1
0
2008-10-10T19:10:28.723000
2008-10-10T19:19:59.577000
192,693
192,906
What is an efficient way to check the precision and scale of a numeric value?
I'm writing a routine that validates data before inserting it into a database, and one of the steps is to see if numeric values fit the precision and scale of a Numeric(x,y) SQL-Server type. I have the precision and scale from SQL-Server already, but what's the most efficient way in C# to get the precision and scale of...
System.Data.SqlTypes.SqlDecimal.ConvertToPrecScale( new SqlDecimal (1234.56789), 8, 2) gives 1234.57. it will truncate extra digits after the decimal place, and will throw an error rather than try to truncate digits before the decimal place (i.e. ConvertToPrecScale(12344234, 5,2)
What is an efficient way to check the precision and scale of a numeric value? I'm writing a routine that validates data before inserting it into a database, and one of the steps is to see if numeric values fit the precision and scale of a Numeric(x,y) SQL-Server type. I have the precision and scale from SQL-Server alre...
TITLE: What is an efficient way to check the precision and scale of a numeric value? QUESTION: I'm writing a routine that validates data before inserting it into a database, and one of the steps is to see if numeric values fit the precision and scale of a Numeric(x,y) SQL-Server type. I have the precision and scale fr...
[ "c#", "sql-server", ".net-3.5" ]
8
13
6,726
4
0
2008-10-10T19:13:02.620000
2008-10-10T20:22:05.647000
192,697
192,952
How Do You Fix A Parameter Names Mismatch - DOJO and PL/SQL
How do you fix a names mismatch problem, if the client-side names are keywords or reserved words in the server-side language you are using? The DOJO JavaScript toolkit has a QueryReadStore class that you can subclass to submit REST patterned queries to the server. I'm using this in conjunction w/ the FilteringSelect Di...
While it feels like the wrong thing to do, because I'm hacking at a well tested, nicely written JavaScript toolkit, this is how I fixed the problem: I went into the DOJOX QueryReadStore.js and replaced the "start" and "count" references with acceptable (to the server-side language) parameter names. I would have like to...
How Do You Fix A Parameter Names Mismatch - DOJO and PL/SQL How do you fix a names mismatch problem, if the client-side names are keywords or reserved words in the server-side language you are using? The DOJO JavaScript toolkit has a QueryReadStore class that you can subclass to submit REST patterned queries to the ser...
TITLE: How Do You Fix A Parameter Names Mismatch - DOJO and PL/SQL QUESTION: How do you fix a names mismatch problem, if the client-side names are keywords or reserved words in the server-side language you are using? The DOJO JavaScript toolkit has a QueryReadStore class that you can subclass to submit REST patterned ...
[ "javascript", "web-applications", "plsql", "dojo" ]
0
1
878
3
0
2008-10-10T19:13:30.403000
2008-10-10T20:39:43.223000
192,707
192,772
Creating Recordset with SQL statement
I am trying to create a recordset in Access VBA that will show me all records in a table related to the current record of a form. My current code looks like this: Private Sub Form_Load() Dim rst As Recordset Set rst = CurrentDb.OpenRecordset("Select [ID], [Ln] From [Order Detail] Where ((([Order Detail].[ID]) = [Form...
The issue is the fact that the string you see there is exactly what is getting passed to the driver. You need to "build up" the string, like so: Set rst = CurrentDb.OpenRecordset("Select [ID], [Ln] From [Order Detail] Where ((([Order Detail].[ID]) = " & [Forms]![Order Data Entry Header]![ID] & "))") Watch to make sure ...
Creating Recordset with SQL statement I am trying to create a recordset in Access VBA that will show me all records in a table related to the current record of a form. My current code looks like this: Private Sub Form_Load() Dim rst As Recordset Set rst = CurrentDb.OpenRecordset("Select [ID], [Ln] From [Order Detail]...
TITLE: Creating Recordset with SQL statement QUESTION: I am trying to create a recordset in Access VBA that will show me all records in a table related to the current record of a form. My current code looks like this: Private Sub Form_Load() Dim rst As Recordset Set rst = CurrentDb.OpenRecordset("Select [ID], [Ln] F...
[ "sql", "vba", "ms-access" ]
5
10
50,514
1
0
2008-10-10T19:18:06.993000
2008-10-10T19:38:22.287000
192,712
359,150
MVC with SharePoint
We are looking to use the MVC Framework in our SP Application. This is what we are trying to accomplish... A virtual directory within the SPSite which can host and run MVC. for e.g., /_layouts/MVC/ Any hints on the required configuration changes (if at all this is possible) will be very helpful.
This might be of interest to you http://www.codeplex.com/SharePointMVC I published it about 5 minutes ago. It is basically a library to help rendering ASP.MVC inside a SharePoint masterpage. Still early days but you get the idea.
MVC with SharePoint We are looking to use the MVC Framework in our SP Application. This is what we are trying to accomplish... A virtual directory within the SPSite which can host and run MVC. for e.g., /_layouts/MVC/ Any hints on the required configuration changes (if at all this is possible) will be very helpful.
TITLE: MVC with SharePoint QUESTION: We are looking to use the MVC Framework in our SP Application. This is what we are trying to accomplish... A virtual directory within the SPSite which can host and run MVC. for e.g., /_layouts/MVC/ Any hints on the required configuration changes (if at all this is possible) will be...
[ "asp.net-mvc", "sharepoint", "configuration", "web-config" ]
5
10
11,373
5
0
2008-10-10T19:18:42.310000
2008-12-11T12:16:32.150000
192,715
193,050
Is it possible to explode an array so that its elements can be passed to a method with the params keyword?
Take this non-compiling code for instance: public string GetPath(string basefolder, string[] extraFolders) { string version = Versioner.GetBuildAndDotNetVersions(); string callingModule = StackCrawler.GetCallingModuleName(); return AppendFolders(basefolder, version, callingModule, extraFolders); } private string Append...
One option is to make the params parameter an object[]: static string appendFolders(params object[] folders) { return (string) folders.Aggregate("",(output, f) => Path.Combine( (string)output,(f is string[])? appendFolders((object[])f): ((string)f).TrimStart('\\'))); } If you want something more strongly-typed, another...
Is it possible to explode an array so that its elements can be passed to a method with the params keyword? Take this non-compiling code for instance: public string GetPath(string basefolder, string[] extraFolders) { string version = Versioner.GetBuildAndDotNetVersions(); string callingModule = StackCrawler.GetCallingMo...
TITLE: Is it possible to explode an array so that its elements can be passed to a method with the params keyword? QUESTION: Take this non-compiling code for instance: public string GetPath(string basefolder, string[] extraFolders) { string version = Versioner.GetBuildAndDotNetVersions(); string callingModule = StackCr...
[ "c#", "parameters", "keyword", "variadic-functions", "params-keyword" ]
6
1
1,914
5
0
2008-10-10T19:19:50.797000
2008-10-10T21:14:32.263000
192,718
197,073
JNDI without a J2EE Container (with JNP? Maybe some other provider?)
I need to run a JNDI provider without the overhead of a J2EE container. I've tried to follow the directions in this article, which describes (on page 3) exactly what I want to do. Unfortunately, these directions fail. I had to add the jboss-common.jar to my classpath too. Once I did that, I get a stack trace: $ java or...
Apache ActiveMQ already comes with an integrated lightweight JNDI provider. See these instructions on using it. Basically you just add the jndi.properties file to the classpath and you're done. java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory # use the following property to configur...
JNDI without a J2EE Container (with JNP? Maybe some other provider?) I need to run a JNDI provider without the overhead of a J2EE container. I've tried to follow the directions in this article, which describes (on page 3) exactly what I want to do. Unfortunately, these directions fail. I had to add the jboss-common.jar...
TITLE: JNDI without a J2EE Container (with JNP? Maybe some other provider?) QUESTION: I need to run a JNDI provider without the overhead of a J2EE container. I've tried to follow the directions in this article, which describes (on page 3) exactly what I want to do. Unfortunately, these directions fail. I had to add th...
[ "java", "jakarta-ee", "jboss", "jms", "jndi" ]
5
6
8,259
3
0
2008-10-10T19:20:55.317000
2008-10-13T09:10:33.830000
192,719
192,831
Is there a limit to how much a website should track the actions of a visitor and/or user to that website?
Once a user starts a session (or logs in, for a registered user, to associate over multiple sessions), their specific page views are followed. The data can then be used in a number of ways from targeted advertisements to email updates to often-visited sections of the site. Would this be wrong, as long as this was noted...
There are certainly legal and moral ways to do something like this. However, I think that the biggest issue with something like this is more of a marketing issue. There's a fine but important line between something like Google's targeted text ads (which I don't find intrusive) and things like popups, animated banner ad...
Is there a limit to how much a website should track the actions of a visitor and/or user to that website? Once a user starts a session (or logs in, for a registered user, to associate over multiple sessions), their specific page views are followed. The data can then be used in a number of ways from targeted advertiseme...
TITLE: Is there a limit to how much a website should track the actions of a visitor and/or user to that website? QUESTION: Once a user starts a session (or logs in, for a registered user, to associate over multiple sessions), their specific page views are followed. The data can then be used in a number of ways from ta...
[ "language-agnostic" ]
1
1
128
4
0
2008-10-10T19:21:02.710000
2008-10-10T19:56:08.040000
192,721
227,555
Why shouldn't I use Objective C 2.0 accessors in init/dealloc?
In @mmalc's response to this question he states that "In general you should not use accessor methods in dealloc (or init)." Why does mmalc say this? The only really reasons I can think of are performance and avoiding unknown side-effects of @dynamic setters. Discussion?
It is all about using idiomatically consistent code. If you pattern all of your code appropriately there are sets of rules that guarantee that using an accessor in init/dealloc is safe. The big issue is that (as mmalc said) the code the sets up the properties default state should not go through an accessor because it l...
Why shouldn't I use Objective C 2.0 accessors in init/dealloc? In @mmalc's response to this question he states that "In general you should not use accessor methods in dealloc (or init)." Why does mmalc say this? The only really reasons I can think of are performance and avoiding unknown side-effects of @dynamic setters...
TITLE: Why shouldn't I use Objective C 2.0 accessors in init/dealloc? QUESTION: In @mmalc's response to this question he states that "In general you should not use accessor methods in dealloc (or init)." Why does mmalc say this? The only really reasons I can think of are performance and avoiding unknown side-effects o...
[ "objective-c", "cocoa" ]
42
19
13,138
6
0
2008-10-10T19:21:32.837000
2008-10-22T21:10:36.667000
192,723
192,788
Is there somewhere I can search for available webservices?
I'm wondering if there is a website that collects (and hopefully updates) information on available web services. Edit: Thanks for all the info; many good answers. I can only accept 1 as the "accepted answer" at this time, so I picked my favorite one.
How about http://www.programmableweb.com/apis? It has a fairly large list of popular Web Services and a quick info sheet on each, including how to access it.
Is there somewhere I can search for available webservices? I'm wondering if there is a website that collects (and hopefully updates) information on available web services. Edit: Thanks for all the info; many good answers. I can only accept 1 as the "accepted answer" at this time, so I picked my favorite one.
TITLE: Is there somewhere I can search for available webservices? QUESTION: I'm wondering if there is a website that collects (and hopefully updates) information on available web services. Edit: Thanks for all the info; many good answers. I can only accept 1 as the "accepted answer" at this time, so I picked my favori...
[ "web-services", "api", "mashup" ]
21
13
11,495
7
0
2008-10-10T19:21:57.467000
2008-10-10T19:41:48.397000
192,725
193,804
Why is Erlang crashing on large sequences?
I have just started learning Erlang and am trying out some Project Euler problems to get started. However, I seem to be able to do any operations on large sequences without crashing the erlang shell. Ie.,even this: list:seq(1,64000000). crashes erlang, with the error: eheap_alloc: Cannot allocate 467078560 bytes of mem...
Your OS may have a default limit on the size of a user process. On Linux you can change this with ulimit. You probably want to iterate over these 64000000 numbers without needing them all in memory at once. Lazy lists let you write code similar in style to the list-all-at-once code: -module(lazy). -export([seq/2]). se...
Why is Erlang crashing on large sequences? I have just started learning Erlang and am trying out some Project Euler problems to get started. However, I seem to be able to do any operations on large sequences without crashing the erlang shell. Ie.,even this: list:seq(1,64000000). crashes erlang, with the error: eheap_al...
TITLE: Why is Erlang crashing on large sequences? QUESTION: I have just started learning Erlang and am trying out some Project Euler problems to get started. However, I seem to be able to do any operations on large sequences without crashing the erlang shell. Ie.,even this: list:seq(1,64000000). crashes erlang, with t...
[ "memory", "memory-management", "erlang" ]
5
12
2,051
4
0
2008-10-10T19:22:45.860000
2008-10-11T07:25:53.763000
192,736
197,453
How do I make git-svn use a particular svn branch as the remote repository?
A word of warning: I'm a n00b to git in general. My team uses feature branches in svn, and I'd like to use git-svn to track my work on a particular feature branch. I've been (roughly) following Andy Delcambre's post to set up my local git repo, but those instructions seem to have led git to pick the svn branch that had...
Muchas gracias to Bart's Blog for this handy reference for svn branches in git. Apparently all I needed was to specify a remote branch when creating the git branch, e.g., git checkout -b git-topic-branch-foo foo where foo is the name of the remote branch.
How do I make git-svn use a particular svn branch as the remote repository? A word of warning: I'm a n00b to git in general. My team uses feature branches in svn, and I'd like to use git-svn to track my work on a particular feature branch. I've been (roughly) following Andy Delcambre's post to set up my local git repo,...
TITLE: How do I make git-svn use a particular svn branch as the remote repository? QUESTION: A word of warning: I'm a n00b to git in general. My team uses feature branches in svn, and I'd like to use git-svn to track my work on a particular feature branch. I've been (roughly) following Andy Delcambre's post to set up ...
[ "git", "svn", "repository", "branch", "git-svn" ]
61
60
31,223
4
0
2008-10-10T19:26:44.057000
2008-10-13T12:41:16.620000
192,742
192,759
Proper way to connect ODBC data source with Delphi 2006+?
What's proper way to connect ODBC datasources and execute some SQL statements? TQuery and other BDE components can do it, but if I understood correctly they are now deprecated?
You can use the ADO components: 1) Drag a TAdoConnection from the dbGo tab. 2) Right click and choose Edit connection string. 3) Click build 4) Select Microsoft OLE DB Provider for ODBC 5) Click Next Then you will be able to select a database. You can drag a TAdoQuery and connect it to the TAdoConnection to execute som...
Proper way to connect ODBC data source with Delphi 2006+? What's proper way to connect ODBC datasources and execute some SQL statements? TQuery and other BDE components can do it, but if I understood correctly they are now deprecated?
TITLE: Proper way to connect ODBC data source with Delphi 2006+? QUESTION: What's proper way to connect ODBC datasources and execute some SQL statements? TQuery and other BDE components can do it, but if I understood correctly they are now deprecated? ANSWER: You can use the ADO components: 1) Drag a TAdoConnection f...
[ "delphi", "odbc" ]
4
6
3,324
2
0
2008-10-10T19:28:06.207000
2008-10-10T19:33:31.437000
192,767
198,089
How do I register domain names programmatically?
Any domain name registrars out there that support domain name registration using a web service or a similar functionality without them telling you to become a reseller? I don't register that many domain names and I am not interested in paying reseller fees. If I can become a reseller without paying upfront fees, that w...
www.opensrs.com charge a one-off $95 setup fee (which converts into $95 credit on the account). That's not quite what you asked for, but it is pretty low. You get access to a well documented, functional API. However you need to pay for domains by making a credit to your account, then buying the domain from there. I don...
How do I register domain names programmatically? Any domain name registrars out there that support domain name registration using a web service or a similar functionality without them telling you to become a reseller? I don't register that many domain names and I am not interested in paying reseller fees. If I can beco...
TITLE: How do I register domain names programmatically? QUESTION: Any domain name registrars out there that support domain name registration using a web service or a similar functionality without them telling you to become a reseller? I don't register that many domain names and I am not interested in paying reseller f...
[ "registration", "domain-name" ]
11
3
4,237
4
0
2008-10-10T19:36:54.693000
2008-10-13T15:59:35.800000
192,773
526,499
ZeroConf extension that can be used in Firefox/XULRunner?
Is there a ZeroConf client extension for Firefox/XULRunner to be used in a zeroConf environment based on either mDNS or SLP? I know of an extension already that's being developed by the ActiveState Open Komodo folks but it requires PyXPCOM support to be baked into the XULRunner runtime in order to access the Apple Bonj...
It appears that Andrew Tunnell-Jones has undertaken the task. http://andrew.tj.id.au/projects/bonjourfoxy/ I have not yet verified that it works for me under Windows, but I am hopeful:) It did not discover that I activated web sharing here, only with a user account active. Let me know what you find.
ZeroConf extension that can be used in Firefox/XULRunner? Is there a ZeroConf client extension for Firefox/XULRunner to be used in a zeroConf environment based on either mDNS or SLP? I know of an extension already that's being developed by the ActiveState Open Komodo folks but it requires PyXPCOM support to be baked in...
TITLE: ZeroConf extension that can be used in Firefox/XULRunner? QUESTION: Is there a ZeroConf client extension for Firefox/XULRunner to be used in a zeroConf environment based on either mDNS or SLP? I know of an extension already that's being developed by the ActiveState Open Komodo folks but it requires PyXPCOM supp...
[ "firefox", "xulrunner", "zeroconf", "mdns", "slp" ]
1
1
2,134
3
0
2008-10-10T19:38:22.647000
2009-02-08T21:59:11.253000
192,810
2,023,917
SVN checkout filtered by file extension?
I have a home-grown automated build script in the form of a DOS batch file. In part of that script, I check out (with "svn checkout") a section of our SVN repository that includes a bunch of third-party stuff that's used in our projects. This batch file performed pretty well for a long time, but now people have checked...
This is possible: you can svn checkout an empty directory, and then svn update filename for each file that you do want. Your script can do something like: svn checkout svn://path/to/repos/directory --depth empty svn list --recursive svn://path/to/repos/directory Pipe that result through a filter that removes the forbid...
SVN checkout filtered by file extension? I have a home-grown automated build script in the form of a DOS batch file. In part of that script, I check out (with "svn checkout") a section of our SVN repository that includes a bunch of third-party stuff that's used in our projects. This batch file performed pretty well for...
TITLE: SVN checkout filtered by file extension? QUESTION: I have a home-grown automated build script in the form of a DOS batch file. In part of that script, I check out (with "svn checkout") a section of our SVN repository that includes a bunch of third-party stuff that's used in our projects. This batch file perform...
[ "svn", "svn-checkout" ]
16
34
19,110
6
0
2008-10-10T19:49:27.960000
2010-01-07T21:47:48.407000
192,824
218,131
SVN checkout ignore folder
Can I ignore a folder on svn checkout? I need to ignore DOCs folder on checkout at my build server. edit: Ignore externals isn't an option. I have some externals that I need.
You can't directly ignore folders on a checkout, but you can use sparse checkouts in svn 1.5. For example: $ svn co http://subversion/project/trunk my_checkout --depth immediates This will check files and directories from your project trunk into 'my_checkout', but not recurse into those directories. Eg: $ cd my_checkou...
SVN checkout ignore folder Can I ignore a folder on svn checkout? I need to ignore DOCs folder on checkout at my build server. edit: Ignore externals isn't an option. I have some externals that I need.
TITLE: SVN checkout ignore folder QUESTION: Can I ignore a folder on svn checkout? I need to ignore DOCs folder on checkout at my build server. edit: Ignore externals isn't an option. I have some externals that I need. ANSWER: You can't directly ignore folders on a checkout, but you can use sparse checkouts in svn 1....
[ "svn", "build-automation", "cruisecontrol.net", "svn-checkout" ]
102
106
96,272
11
0
2008-10-10T19:54:44.313000
2008-10-20T11:44:29.913000
192,838
192,869
Can you freeze a C/C++ process and continue it on a different host?
I was wondering if it is possible to generate a "core" file, copy if to another machine and then continue execution of the a core file on that machine? I have seen the gcore utility that will make a core file from a running process. But I do not think gdb can continue execution based on a core file. Is there any way to...
On modern systems, not from a core file, no you can't. For freezing and restoring an individual process on Linux, CryoPID and the new Kernel-based checkpoint and restart are in the works, but their abilities are currently quite limited. OpenVZ and other virtualization-like softwares can freeze and restore an entire sys...
Can you freeze a C/C++ process and continue it on a different host? I was wondering if it is possible to generate a "core" file, copy if to another machine and then continue execution of the a core file on that machine? I have seen the gcore utility that will make a core file from a running process. But I do not think ...
TITLE: Can you freeze a C/C++ process and continue it on a different host? QUESTION: I was wondering if it is possible to generate a "core" file, copy if to another machine and then continue execution of the a core file on that machine? I have seen the gcore utility that will make a core file from a running process. B...
[ "process", "coredump", "process-migration" ]
11
4
4,705
9
0
2008-10-10T19:57:58.347000
2008-10-10T20:04:08.990000
192,839
195,351
How can you get the terminal service client machine name from javascript?
Is it possible to get the machine name, or IP, or MAC address (basically client network information) from javascript running Internet Explorer? I found the following code that seems to accomplish this: function Button1_onclick() { var locator = new ActiveXObject("WbemScripting.SWbemLocator"); var service = locator.Conn...
Basically, there are two possibilities to get hold of the client name/address that come to mind: Use MFCOM, namely the MetaFrameSession object. Use WMI, the MetaFrame_ICA_Client class in root\Citrix looks promising. Mayor drawback of both solutions is, that they require more user permissions than you might be willing t...
How can you get the terminal service client machine name from javascript? Is it possible to get the machine name, or IP, or MAC address (basically client network information) from javascript running Internet Explorer? I found the following code that seems to accomplish this: function Button1_onclick() { var locator = n...
TITLE: How can you get the terminal service client machine name from javascript? QUESTION: Is it possible to get the machine name, or IP, or MAC address (basically client network information) from javascript running Internet Explorer? I found the following code that seems to accomplish this: function Button1_onclick()...
[ "internet-explorer", "activex", "terminal-services" ]
1
1
6,507
2
0
2008-10-10T19:58:03.900000
2008-10-12T11:08:09.227000
192,862
200,565
How to save a PDF file Using NHibernate and SQL Server 2005
I'm developing a webapp where the user is given the chance to upload his resume in pdf format. I'm using NHibernate as a data mapper and MS SQL SERVER 2005. I want to be able to save the.pdf file to a given table... any ideas? Thank you very much!
We are doing exactly that with the "original" Java Hibernate3. You just map a byte array property of your persistable class to an column of Type "image". package com.hibernate.pdf.sample; public class TPDFDocument implements java.io.Serializable { private Integer pdfDocumentId; private byte[] document; public Intege...
How to save a PDF file Using NHibernate and SQL Server 2005 I'm developing a webapp where the user is given the chance to upload his resume in pdf format. I'm using NHibernate as a data mapper and MS SQL SERVER 2005. I want to be able to save the.pdf file to a given table... any ideas? Thank you very much!
TITLE: How to save a PDF file Using NHibernate and SQL Server 2005 QUESTION: I'm developing a webapp where the user is given the chance to upload his resume in pdf format. I'm using NHibernate as a data mapper and MS SQL SERVER 2005. I want to be able to save the.pdf file to a given table... any ideas? Thank you very ...
[ ".net", "sql-server", "nhibernate", "pdf" ]
2
5
2,553
3
0
2008-10-10T20:03:07.090000
2008-10-14T09:50:22.020000
192,885
193,409
How do I stop Visual Studio from resizing my controls?
Visual Studio 2008 SP1 (although IIRC, the behavior was present in 2005 as well) keeps resizing a couple of grid controls (Janus.GridEx to be precise) I use. I can resize them back to normal, save, and compile just fine. When it does compile, these two controls will expand to ridiculous values. More Information: This p...
I usually solve that kind of trouble by putting the 'good' code in the form constructor, right after the call to InitializeComponent(), so it overrides any mess the automatic designer magic might cause.
How do I stop Visual Studio from resizing my controls? Visual Studio 2008 SP1 (although IIRC, the behavior was present in 2005 as well) keeps resizing a couple of grid controls (Janus.GridEx to be precise) I use. I can resize them back to normal, save, and compile just fine. When it does compile, these two controls wil...
TITLE: How do I stop Visual Studio from resizing my controls? QUESTION: Visual Studio 2008 SP1 (although IIRC, the behavior was present in 2005 as well) keeps resizing a couple of grid controls (Janus.GridEx to be precise) I use. I can resize them back to normal, save, and compile just fine. When it does compile, thes...
[ "visual-studio-2008", "ide" ]
11
2
5,268
5
0
2008-10-10T20:12:17.973000
2008-10-10T23:57:08.303000