Predominantly DFS is used to find a cycle in graphs and not BFS. Any reasons? Both can find if a node has already been
visited while traversing the tree/graph.
According to RFC 2396,
The plus "+", dollar "$", and comma
"," characters have been added to
those in the "reserved" set, since
they are treated as reserved within
the query component.
Indeed, search this site for "plus + comma , dollar $", and you get
http://stackoverflow.com/search?q=plus+%2B+comma+,+dollar+$
Plus is only encoded (by the application) when it's not being used as a delimiter.
But as others have observed, .NET's UrlDecode function converts plus to space. Where is this behavior specified?
I am attempting to convert Java code to Jython and am using the apache Log and LogFactory imports. I am attempting to emulate Foo.class in Jython The chunk of code is as follows:
in Java
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class MyClass {
private static final Log log = LogFactory.getLog(MyClass.class);
public MyClass(Document dom)
{ //code
}
How can I emulate this same behavior of MyClass.class in Jython/Python?
I'm having issues with the maximum nametable char count quota, I followed a couple of answers here and it solved the problem for a while, but now I'm having the same issue.
My Server side config is as follows:
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="GenericBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true" />
<dataContractSerializer maxItemsInObjectGraph="1000000" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="REMWCF.RemWCFSvc">
<endpoint address="" binding="netTcpBinding" contract="REMWCF.IRemWCFSvc" bindingConfiguration="GenericBinding" />
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:9081/RemWCFSvc" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
I also have the same tcp binding on the devenv configuration.
Have I reached the limit of contracts supported? Is there a way to turn off that quota?
EDIT
Error Message:
Error: Cannot obtain Metadata from
net.tcp://localhost:9081/RemWCFSvc/mex If this is a Windows (R)
Communication Foundation service to which you have access, please
check that you have enabled metadata publishing at the specified
address. For help enabling metadata publishing, please refer to the
MSDN documentation at
http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange
Error URI: net.tcp://localhost:9081/RemWCFSvc/mex Metadata
contains a reference that cannot be resolved:
'net.tcp://localhost:9081/RemWCFSvc/mex'. There is an error in the
XML document. The maximum nametable character count quota (16384)
has been exceeded while reading XML data. The nametable is a data
structure used to store strings encountered during XML processing -
long XML documents with non-repeating element names, attribute names
and attribute values may trigger this quota. This quota may be
increased by changing the MaxNameTableCharCount property on the
XmlDictionaryReaderQuotas object used when creating the XML reader.
I'm getting that error when trying to run the WCF (which is hosted in a windows service app).
I have an ASP.NET Dynamic Data web application, with an entity called ActivationResource. One of the properties of this is a CellPhone field. Now, whenever I open a List or Details view of one of these entities, the cell phone number displays for a moment then disappears.
Anyone have any ideas as to the cause of this mysterious behavior?
I'm facing problem in showing FolderBrowserDialog instance created and called from a non-UI thread. It doesn't get renders properly.
Being more specific, it doesn't shows the folder tree but displays only the Make New Folder OK and Cancel
I have a jQuery Dialog box on one of my pages. One of the buttons in the dialog boxes triggers a JavaScript prompt OnClick. Everything seems OK with the lastest versions of Internet Explorer, Chrome, and Mozilla Firefox, but some users are reporting weird behavior.
Are there any known browser compatibility errors with jQuery UI dialog boxes?
In Visual Studio, two files are created when you create a new Windows Form in your solution (e.g. if you create MyForm.cs, MyForm.Designer.cs and MyForm.resx are also created). These second two files are displayed as a subtree in the Solution Explorer.
Is there any way to add files to the sub-tree or group for a Windows Form class?
Hello all,
I have a UIPickerView implemented in one of my pages that depends on the didSelectRow delegate method.
An odd behavior I have noticed is when the user moves a wheel and leaves it between selections, then the wheel will move very slowly to the closest selection. The didSelectRow event will not fire until this is complete, sometimes 3 seconds later.
Is there a way to speed this up, or detect when the wheel is being moved, so I can freeze my interface during this time?
In Netbeans or in Eclipse, you can use "Find Usages" or "References" from the right click context menu. If a() calls b(), using the functionality from b() will show you a(). However, what I want is to be able to see some kind of tree or have an option to see all usages of a given/class or method, such that if z() calls a() that using the functionality will show both z() and a().
Any IDE plugins or external tools that can do this?
Hi all,
I'm trying to setup a parallel CMake-based build for my source tree, but when I issue
$ cmake .
$ make -j2
I get a jobserver unavailable: using -j1. Add '+' to parent make rule warning. Does anyone have an idea if it is possible to fix it somehow?
Lately I've been seeing behavior where after an update svn shows certain files as "conflicted" but when I try to edit the conflicts, there are none (The "next conflict" and "previous conflict" buttons are disabled and if I scroll through the file, none of the lines are marked red).
This seems to have started after I started working from a different repository than I had been working with, but I'm not sure if that's related.
I had to reinstall a bunch of my port installs the other day and now when I launch my RoR server with "ruby script/server -d -p 3000" the server wont work. I am not seeing any errors in the logs. If I start it with "ruby script/server -p 3000" it works fine.
Any ideas of what I might have uninstalled that would cause this behavior?
Hello,
i need to build the same source tree twice,
1 - with normal cflags to build the project binary
2 - with cflags plus -fPIC to build a static library that would be some sort of SDK to develop project dynamic modules.
Using only one Makefile, what is the best approach to accomplish this?
It would be nice to do some sort of :
all: $(OBJECTS)
lib_rule: $(OBJECTS)
CFLAGS += -fPIC
.cpp.o:
$(CC) -c $< -o $@ $(CFLAGS)
But obviously it can't be done.
Thanks
When creating a new .resx file anywhere in my solution, I would like the following properties to be other than the default:
Copy to Output Directory: Copy if newer
Custom Tool namespace: Booking.Resources
Access Modifier: public
Is there any way I can change the default Visual Studio behavior on creation of these files, so I don't have to make the above changes manually each time?
Hi,
I am playing with the Demo SoftKeyboard the comes with the Android SDK.
In portrait mode when the candidate view is shown, it doesn't move the app up as the default android keyboard does. Hence it covers part of the application view.
What should be changed in order to make the candidate view in the demo softkeyboard behave as the default android keyboard does?
I've also looked at the source of the android keyboard from git but found nothing related to this behavior.
I'm writing a shell for a project of mine, which by design parses commands that looks like this:
COMMAND_NAME ARG1="Long Value" ARG2=123 [email protected]
My problem is that Python's command line parsing libraries (getopt and optparse) forces me to use '-' or '--' in front of the arguments. This behavior doesn't match my requirements.
Any ideas how can this be solved? Any existing library for this?
Scenario: I am maintaining a function which helps with an install - copies files from PathPart1/pending_install/PathPart2/fileName to PathPart1/PathPart2/fileName. It seems that String.Replace() and Path.Combine() do not play well together. The code is below. I added this section:
// The behavior of Path.Combine is weird. See:
// http://stackoverflow.com/questions/53102/why-does-path-combine-not-properly-concatenate-filenames-that-start-with-path-dir
while (strDestFile.StartsWith(@"\"))
{
strDestFile = strDestFile.Substring(1); // Remove any leading backslashes
}
Debug.Assert(!Path.IsPathRooted(strDestFile), "This will make the Path.Combine(,) fail).");
in order to take care of a bug (code is sensitive to a constant @"pending_install\" vs @"pending_install" which I did not like and changed (long story, but there was a good opportunity for constant reuse). Now the whole function:
//You want to uncompress only the files downloaded. Not every file in the dest directory.
private void UncompressFiles()
{
string strSrcDir = _application.Client.TempDir;
ArrayList arrFiles = new ArrayList();
GetAllCompressedFiles(ref arrFiles, strSrcDir);
IEnumerator enumer = arrFiles.GetEnumerator();
while (enumer.MoveNext())
{
string strDestFile = enumer.Current.ToString().Replace(_application.Client.TempDir, String.Empty);
// The behavior of Path.Combine is weird. See:
// http://stackoverflow.com/questions/53102/why-does-path-combine-not-properly-concatenate-filenames-that-start-with-path-dir
while (strDestFile.StartsWith(@"\"))
{
strDestFile = strDestFile.Substring(1); // Remove any leading backslashes
}
Debug.Assert(!Path.IsPathRooted(strDestFile), "This will make the Path.Combine(,) fail).");
strDestFile = Path.Combine(_application.Client.BaseDir, strDestFile);
strDestFile = strDestFile.Replace(Path.GetExtension(strDestFile), String.Empty);
ZSharpLib.ZipExtractor.ExtractZip(enumer.Current.ToString(), strDestFile);
FileUtility.DeleteFile(enumer.Current.ToString());
}
}
Please do not laugh at the use of ArrayList and the way it is being iterated - it was pioneered by a C++ coder during a .Net 1.1 era. I will change it. What I am interested in: what is a better way of replacing PathPart1/pending_install/PathPart2/fileName with PathPart1/PathPart2/fileName within the current code. Note that _application.Client.TempDir is just _application.Client.BaseDir + @"\pending_install". While there are many ways to improve the code, I am mainly concerned with the part which has to do with String.Replace(...) and Path.Combine(,). I do not want to make changes outside of this function. I wish Path.Combine(,) took an optional bool flag, but it does not.
So ... given my constraints, how can I rework this so that it starts to sucks less?
Thanks!
I'm new to Python, so this is probably a simple scoping question. The following code in a Python file (module) is confusing me slightly:
if __name__ == '__main__':
x = 1
print x
In other languages I've worked in, this code would throw an exception, as the x variable is local to the if statement and should not exist outside of it. But this code executes, and prints 1. Can anyone explain this behavior? Are all variables declared in a module global/available to the entire module?
Hello, everyone!
When using a JTree, a "user object" of a DefaultMutableTreeNode can be set. This can be of any kind, but to display it, its toString() value is used. This is not what I need.
How can I change the way a user object is displayed?
NOTE: My user object has to be something different than a String to be able to maintain mapping between the tree and the user objects.
I'd like to use the Drupal solr search module with the Apache Solr Search hosted on an external machine. I know that Acquia offer this as a service. But it's not an affordable option for me. I'd like to install Solr on an inexpensive VPS and have all my various Drupal sites which are on different hosts accessing the search functions. Am I barking up the wrong tree?
I maintain a few Python packages. I have a very similar setup.py file for each of them. However, when doing setup.py install, one of my packages gets installed as an egg, while the others get installed as "egg folders", i.e. folders with an extension of "egg".
I couldn't figure out what is the difference between them that causes this different behavior. What can it be?
Does the serialize function in jQuery replace dots ('.') with underscores?
For example, I have a form field such as:
<input id="Project.name" name="Project.name" type="text">
When the form is POSTed, I'm serializing the form data and sending it to another PHP file to save. The dots seem to be converted to underscores. Is this normal behavior?
To provide a Windows Explorer-like view of the user's system, we have been using the shell controls from LogicNP (formerly Sky Software), but these have deficiencies, e.g., no support for Win7 libraries. The vendor has not responded to our inquiries about updates, so we're looking to replace the package.
Requirements:
ActiveX (no managed code or MFC)
Tree and list views of the system
Per-item checkboxes
32- and 64-bit versions
Any recommendations for a replacement product?
TIA.
Hello all
I'm using wxPython.
I'm trying to figure out how I can change the behavior of the wx.aui.AuiManager so that when a window is dragged to become floating, it will become a proper window with Minimize and Maximize buttons and shown in the Taskbar.
Apparently there is some subclassing done of the standard window to remove those exact features but I'm not having any luck in getting them back.