I'm using Notepad++ for python development, and few days ago I found out about free Komodo Edit.
I need Pros and Cons for Python development between this two editors...
Lets say I have the following:
data Greek = Alpha | Beta | Gamma | Phi deriving Show
I want to use the default showing of all items except Beta, which I want to say "two".
Can I do this?
Dim x AS New URI("http://www.example.com/test//test.asp")
Dim rel AS New URI("http://www.example.com/xxx/xxx.asp")
Console.Writeline(x.MakeRelativeUri(rel).Tostring())
In here output is:
../../xxx/xxx.asp
Which looks correct almost all web servers will process the two of the following as same request:
http://www.example.com/test//test.asp
http://www.example.com/test/test.asp
What's the best way to fix this behaviour is there any API to do this, or shall manually create a new URI and remove all // in the path?
how should i write the initial conditions and solve two coupled differential equation?
for ex. like:
s1 := diff(n[D](t), t) = a-b*n[D](t)^2-c*n[D](t)-e*n[D](t)*n[T](t)
s2 := diff(n[T](t), t) = b*n[D](t)^2-c*n[D](t)-e*n[D](t)*n[T](t)
dsolve({s1, s2});
Hi, I have a website ( based on JSP/Servlets ,using MVC pattern), and I want to support AJAX-based website and basic HTML-based website. website visitors should be able to change the surfing mode from Ajax to basic HTML and vise versa, - as it applies in Google-mail.
The Questions :
What is the best way to achieve this goal easily?
Should I design two views for each page?
I use JQuery and JSON as the result of this answer.
How can I replace this "a b" by "a b" in j2me?
the replace() method doesn't accept Strings, but only chars. And since a double space contains two chars, I think i have a small problem.
I can see how a cipher can be developed using substitutions and keys, and how those two things can become more and more complex, thus offering some protection from decryption through brute-force approaches. But specifically I'm wondering:
what other major concepts beyond substitution and key are involved?
is the protection/secrecy of the key a greater vulnerability than the strength of the encryption?
why does encryption still hold up when the key is 'public' ?
are performance considerations a major obstacle to the development of more secure encryption?
I'm using MVC2 with VS2010
I have a view that has two partial views in it: "Login" and "Register"
both partial views contains the Email address field i use the following in both partial views:
<%: Html.TextBoxFor(model => model.EmailAddress ) %><br /><%: Html.ValidationMessageFor(model => model.EmailAddress) %>
if i use both partial views on one page, it ends up having duplicate id's so validation happens across both views (even thopugh they are in seperate forms)
how can i go about eliminating this
i have a datagrid view with two columns. the first column is readonly and the other is editable. now i want every cell of the second column to support for mulitilines in each cell. i want to press enter key and come to the next line in the same cell.
im using c#.
I'm using SQL Server 2008, but my ERP Vendor only offers a SQL 2005 trace template that they'd like me to run on my system.
When I attempt to import it, I receive confirmation that it was successfully imported. However, it does not show up in the list of available templates.
I've done this on two separate servers to the same effect.
Is this a known problem with SQL Server 2008? I Googled unsuccessfully.
Hi,
I have a website that changes his inputs ids, and I'm trying to make a semi auto-login, filling automatically the email and the password part...
I'm doing this with greasemonkey and jQuery...
I'm trying something like this
$("input[@type=text]").setValue("[email protected]");
but had no success...
The Page has only the login part, two text type inputs...
What am I missing here?
How can I change the permissions depending on if it is a get or a post. Is it possible to do it in one class or would I have to separate it out into two classes? If its a get I want "permission_classes = (permissions.IsAuthenticated)" and if its a post I want "permission_classes = (permissions.IsAdminUser)"
class CategoryList(generics.ListCreateAPIView):
queryset = QuestionCategory.objects.all()
serializer_class = QuestionCategorySerializer
permission_classes = (permissions.IsAuthenticated,)
.NET 3.5 doesn't completely support XPATH 2.0 or XSLT 2.0, which is just too bad. Does anyone know if these two will be included and fully supported in any future .NET versions?
Is it possible (on any reasonable OS, preferably Linux) to swap the contents of two memory pages by only modifying the page table and not actually moving any data?
The motivation is a dense matrix transpose. If the data were blocked by page size it would be possible to transpose the data within a page (fits in cache) then swap pages to move the blocks into their final place. A large matrix would have many many pages moved, so hopefully flushing the TLB wouldn't cause trouble.
Hi,
If I am running an organization that has 50 .net developers and all are using sql server, what is the best way to make single sql server available to them?
Here is some of the concerns that I want to be careful about
Should I configure database users per project or per user? or both?
Should I provide single sql server instance?
There are some more concerns but I think getting answer of these two will be a good starting point.
i created imported DLL in references. My plugin need these DLL but they are in common or plugin file if i click reference add dll they import form plugins file . they must be only in only plugins or common not two place. Look picture below:
if i click add refrence ClearCanvas's DLL and PluginTest Dll must be only plugins file !!!
I have two tables that I'm trying to create a relationship between so I can write nice LINQ queries that don't require join.
Widgets
WidgetId
WidgetDescription
Orders
OrderId
WidgetId
OrderDate
What I want to be able to do is create a LINQ query that does something similar to:
var result = from x in db.Widgets
Where x.Orders.OrderDate == "5/11/2010"
select x;
I can't seem to get intellitext to pick up the other database despite creating a relationship in SQL server. Are there any additional steps I need to take to make this work?
My Python module has a list that contains all the data I want to save as a .txt file somewhere. The list contains several tuples like so:
list = [ ('one', 'two', 'three'), ('four', 'five', 'six')]
How do I print the list so each tuple item is separated by a tab and each tuple is separated by a newline?
Thanks
This question is about dealing with unmanaged resources (COM interop) and making sure there won't be any resource leaks. I'd appreciate feedback on whether I seem to do things the right way.
Background:
Let's say I've got two classes:
A class LimitedComResource which is a wrapper around a COM object (received via some API). There can only be a limited number of those COM objects, therefore my class implements the IDisposable interface which will be responsible for releasing a COM object when it's no longer needed.
Objects of another type ManagedObject are temporarily created to perform some work on a LimitedComResource. They are not IDisposable.
To summarize the above in a diagram, my classes might look like this:
+---------------+ +--------------------+
| ManagedObject | <>------> | LimitedComResource |
+---------------+ +--------------------+
|
o IDisposable
(I'll provide example code for these two classes in just a moment.)
Question:
Since my temporary ManagedObject objects are not disposable, I obviously have no control over how long they'll be around. However, in the meantime I might have Disposed the LimitedComObject that a ManagedObject is referring to. How can I make sure that a ManagedObject won't access a LimitedComResource that's no longer there?
+---------------+ +--------------------+
| managedObject | <>------> | (dead object) |
+---------------+ +--------------------+
I've currently implemented this with a mix of weak references and a flag in LimitedResource which signals whether an object has already been disposed. Is there any better way?
Example code (what I've currently got):
LimitedComResource:
class LimitedComResource : IDisposable
{
private readonly IUnknown comObject; // <-- set in constructor
...
void Dispose(bool notFromFinalizer)
{
if (!this.isDisposed)
{
Marshal.FinalReleaseComObject(comObject);
}
this.isDisposed = true;
}
internal bool isDisposed = false;
}
ManagedObject:
class ManagedObject
{
private readonly WeakReference limitedComResource; // <-- set in constructor
...
public void DoSomeWork()
{
if (!limitedComResource.IsAlive())
{
throw new ObjectDisposedException();
// ^^^^^^^^^^^^^^^^^^^^^^^
// is there a more suitable exception class?
}
var ur = (LimitedComResource)limitedComResource.Target;
if (ur.isDisposed)
{
throw new ObjectDisposedException();
}
... // <-- do something sensible here!
}
}
I've have a card class for a blackjack game with the following enums:
enum Rank { Ace, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Jack, Queen, King };
enum Suit { Clubs, Diamonds, Hearts, Spades };
When I create the deck I want to write the code like this:
// foreach Suit in Card::Suit
// foreach Rank in Card::Rank
// add new card(rank, suit) to deck
I believe there is no foreach in c++. However, how do I traverse an enum?
Thanks,
Spencer
Hello,
I started using Zend_Paginator,
it works everything fine but I noticed that there is one more query which slows the load time down.
The additional query:
SELECT COUNT(1) AS `zend_paginator_row_count` FROM `content`
The normal query:
SELECT `content`.`id`, `content`.`name` FROM `content` LIMIT 2
PHP:
$adapter = new Zend_Paginator_Adapter_DbSelect($table->select()->from($table, array('id', 'name')));
$paginator = new Zend_Paginator($adapter);
Could I merge the two querys into one (for better performance)?
I have two variables var1 and var2. The contents of each variables come from bash shell grep command.
echo $var1 prints
123 465 326 8080
echo $var2 prints
sila kiran hinal juku
Now I want to print the above into following formats in Linux bash shell
123 sila
465 kiran
326 hinal
8080 juku
So how can I print this way in bash shell??