Hi
can any body suggest me any idea about how can i compare two fields in django.
as i have two password fields in my forms.py file.
now i want to compare the two fields and if both are same then save the user in database
else append an error message to reenter the values again.
thanks
Hello, I wanted to ask whether it is possible to compare the complete database structure of two huge databases.
We have two databases, the one is a development database, the other a production database.
I've sometimes forgotten to make changes in to the production database, before we released some parts of our code, which results that the production database doesn't have the same structure, so if we release something we got some errors.
Is there a way to compare the two, or synchronize?
Hello,
I am trying to combine two integers in my application. By combine I mean stick one byte stream at the end of the other, not concatenate the strings.
The two integers are passed from hardware that can't pass a 32 bit value directly, but passes two consecutive 16-bit values separately.
Thanks,
Hi,
I'm using Tomcat to deploy two web-services endpoints but on one WAR file (I used one WAR because the two endpoint implementations are calling one another).
How can I define different login methods to each endpoint?
I actually need two different custom realm for each endpoint...
Thanks
HI, i have two tables
1- name, id, code
2- id, value, concept
One name can have two concepts and two values. i want to retreive this:
Id, name, value1, value2.
How can i do that?
Tanks
I have two Python scripts in two different locations and cannot be moved. What is the best way to send information between the two scripts?
say for example in script1.py i had a string e.g.
x = 'teststring'
then i need variable 'x' passed to script2.py, which saves the variable 'x' to a text file?
Any ideas?
So I have two cell arrays:
A = {2 2 2 2}
B = {[1 2] [3 2] [5 5] [7 7]}
and a function of two arguments:
F = @(a, b) [a * b(1), (b(2) / 3), (b(1) + a) * 22]
And I want to apply the function to the two cell arrays like so:
idealfun(F, A, B)
and have it do the right thing (return a cell array with four cells of 1x3 vectors). Any ideas how to find/write idealfun?
I have two different .Net projects, hosted on github.
I would like to create a shared "commons" library for the two projects.
How should I structure my repository to facilitate this sharing?
Ideally, a change in this common library in one project could easily be pushed into the other project. I prefer to keep the code itself editable from the two projects (within Visual Studio), and not include it as a library. Are there best practices for this?
Hi,
I have two seperate git repositories at ~/linux and ~/android. I want to make a diff of the two repositories using git. Or is there any way to merge the two repositories.?
Regards,
Murugaprabu
Hello:
I have two tables with a column 'date'. One holds (name, date) and the other holds (date, p1, p2). Given a name, I want to use the date in table 1 to query p1 and p2 from table two; the match should happen if date in table one is within two seconds of date in table two.
How can you accomplish this using SQLAlchemy?
I've tried (unsuccessfully) to use the between operator and with a clause like:
td = datetime.timedelta(seconds=2)
q = session.query(table1, table2).filter(table1.name=='my_name').\
filter(between(table1.date, table2.date - td, table2.date + td))
Any thoughts?
I have two HashMaps and I can iterate both hashmaps with following code
Iterator it = mp.entrySet().iterator();
while (it.hasNext()) {
Map.Entry pairs = (Map.Entry)it.next();
String firstVal = pairs.getValue();
}
Iterator it2 = mp2.entrySet().iterator();
while (it2.hasNext()) {
Map.Entry pairs2 = (Map.Entry)it.next();
String SecondVal = pairs2.getValue();
}
myFunction(firstVal, SecondVal)
Is there anyway to iterate two hashmaps at the same time without using two loops?
Currently, I have a method that accepts two parameters and each parameter value is stored in first and second hashmap. I have to iterate first hash then second to get values. I think there must be a good way to do it but I don't know :(
P.S: there could be some errors in above code as this is just an example to explain my problem. Each iterator is a method in original program and accept one parameter. I couldn't copy past real time functions as they are HUGE !
Is it a viable option to compare two FileInfo.CreationTimeUtc.Ticks of two files on two different computers to see which version is newer - or is there a better way?
Do Ticks depend on OS time or are they really physical ticks from some fixed date in the past?
I dont know if this is possible, but if Im working on two areas of code in a long file, I have to note the line numbers and scroll between the two areas of code. Is there a way you can jump between two commonly used areas of code?
Perhaps setup a flag of some sort?
This question is related to:
How do I determine the intersection point of two lines in GDI+? (great explanation of algebra but no code)
How do you detect where two line segments intersect? (accepted answer doesn't actually work)
But note that an interesting sub-problem is completely glossed over in most solutions which just return null for the coincident case even though there are three sub-cases:
coincident but do not overlap
touching just points and coincident
overlap/coincident line sub-segment
For example we could design a C# function like this:
public static PointF[] Intersection(PointF a1, PointF a2, PointF b1, PointF b2)
where (a1,a2) is one line segment and (b1,b2) is another.
This function would need to cover all the weird cases that most implementations or explanations gloss over. In order to account for the weirdness of coincident lines, the function could return an array of PointF's:
zero result points (or null) if the lines are parallel or do not intersect (infinite lines intersect but line segments are disjoint, or lines are parallel)
one result point (containing the intersection location) if they do intersect or if they are coincident at one point
two result points (for the overlapping part of the line segments) if the two lines are coincident
Is it possible to generate two different psuedorandom numbers on two separate program runs without using time as the seed? i.e. using the same seed on both runs, is it possible to get two different numbers?
I have two projects, both of them data access layers, and both using EF. I have another project calling services related to the two different assemblies. Are there any pitfalls on using two different models on two different databases linked to the same database?
I'm asking this because I've been getting this generic "EntitySqlException"
could not be resolved in the current scope or context. Make sure that all referenced variables are in scope, that required schemas are loaded, and that namespaces are referenced correctly., near escaped identifier.
that does not appear when are run separately but appear when under the same project.
I have two floats in Python that I'd like to subtract, i.e.
v1 = float(value1)
v2 = float(value2)
diff = v1 - v2
I want "diff" to be computed upto two significant figures, that is compute it using %.2f of v1 and %.2f of v2. How can I do this? I know how to print v1 and v2 up to two decimals, but not how to do arithmetic like that.
thanks.
I have two lines that extend to infinity but both have a starting point. They are both described by a starting point and a vector in the direction of the line extending to infinity. I want to find out if the two lines intersect but i don't need to know where they intersect (its part of a collision detection algorithm).
Everything i have looked at so far describes finding the intersection point of two lines or line segments. Anyone know a fast algorithm to solve this?
Hello everybody!
Thank you in advance for your help!
I have two lists with some stocks prices, example:
a = [10.23, 11.65, 12.36, 12.96]
b = [5.23, 6.10, 8.3, 4.98]
I can calculate the correlation of these two lists, with:
import scipy.stats
scipy.stats.pearsonr(a, b)[0]
But, I didn't found a method to calculate the co-integration of two lists.
Could you give me some advices?
Thank you very much!
I am using windows, Mysql DB, PHP
I am building the Joomla Component whose one of the functionality is to synchronize the folders
I want to sync two folders of different name.. How can I do this? It has to be dne in the same machine, no two different servers are involved in it..
How to sync two folders in PHP?
In a nutshell
I need a CSS solution for the following requirements:
Layout: One centered column with fixed width and a minimum height of 100%
Two vertically repeated background images behind the centered column, one aligned to the left, one aligned to the right
Cross browser compatibility
A little more details
Today a new requirement for my current web site project came up: A background image with gradients on the left and right side. The challenge is now to specify two different background images while keeping the rest of the layout spec. Unfortunately the (simple) layout somehow doesn't go with the two backgrounds.
My layout is basically one centered column with fixed width:
#main_container {
margin: 0 auto;
min-height: 100%;
width: 800px;
}
Furthermore it's necessary to stretch the column to a minimum height of 100%, since there are quite some pages with only little content. The following CSS styles take care of that:
html {
height: 100%;
}
body {
margin: 0;
height: 100%;
padding: 0;
}
So far so good - until the two background image issue arrived... I tried the following solutions
Two absolute positioned divs behind the main container
One image defined with the body, one with the html CSS class
One image defined with the body, the other one with a large div begind the main container
With either one of them, the dynamic height solution was ruined. Either the main container didn't stretch to 100% when it was too small, or the background remained at 100% when the content was actually longer