Hi,
do you know any good algorithms that match two strings and then return a percentage in how many percent those two strings match?
And are there some, that work with databases too?
using the g.drawText function (two calls one for each text) is it possible to write text in two different sizes?
g.drawText("abc",0,0);
//whatever code to change font goes here
g.drawText("def",30,30);
I would like to extract some text between two points in a string, in Javascript
Say the string is
"start-extractThis-234"
The numbers at the end can be any number, but the hyphens are always present.
Ideally I think capturing between the two hypens should be ok.
I would like the result of the regex to be
extractThis
I'm trying to figure out how to get only the last two files within a folder, so that I can merge them together using c#. The files are csv files and I've looked at File.CreationTime, but don't know exactly how to compare on it, so that I'm working only with the last two files.
How can I do this?
I have table and I want to swap the values from two rows. I have the rows IDs of the two rows.
Is there any query to do that? Here is an example. Before the query I have this:
row1 : 1,2,3
row2 : 5,6,7
After the swap I want this:
row1 : 5,6,7
row2 : 1,2,3
I don't want write it in .NET code because I think an SQL query is easier than that.
Hi,
How can I find difference between two time intervals.
Like 13:45:26.836 - 14:24:18.473 which is of the format "Hour:Min:Sec:Millisecs". Now i need to find the time difference between these two times.
Thanks in advance.
Hello,
I'm using the jquery 1.2.6 with the seperate jquery tabs framework. I also need to use the 1.3.2 jquery sortable & resizable. I need to make those two to work.
how do i manage these two frameworks?
Hi,
I'm trying to get a report done and I have a small problem with the twocolums and the line numbering in listings.
The text is on two columns, the listings can be on the two columns as well.
If I put the number=left, the space between the columns is not sufficient and the text from the first column is written over.
Is there any way to ask the listings to put the line numbers "outside" ?
Thanks
Say that I have two CSV files (file1 and file2) with contents as shown below:
file1:
fred,43,Male,"23,45",blue,"1, bedrock avenue"
file2:
fred,39,Male,"23,45",blue,"1, bedrock avenue"
I would like to compare these two CSV records to see if columns 0,2,3,4, and 5 are the same. I don't care about column 1.
What's the most pythonic way of doing this?
EDIT:
Some example code would be appreciated.
I have tried the merge function to merge two csv files that I imported. They both have the same variable names and data types but each time I run merge all that I get is an object that contains the names of the two data frames. I have tried the following:
# ex1
obj <- merge(obj1, obj2, by=obj)
# ex2
obj <- merge(obj1, obj2, all)
and several other iterations of the above.
Is merge the correct function?
If so, what am I doing wrong?
I have two points and I want to know the line which is joining them.
I don't want to draw the line.
I want to create a matrix with all the points which formed the line.
In the future, I want to solve if two points belong or not to a shape. And this is the first part.
Hi,
I am new to ExtJS. I want to implement two tables. First one will have list of possible items to select. Second one can be empty. I will have 4 buttons in between the two tables as "move this item left", "move all to left", "move all to right" and "move this to right".
Which component should i use to implement this?
Regards,
Anandan
Hi,
I'm going to analysis two different versions of the same dll with fxcop.
I would like to display only the differences between these two reports.
Does anyone know if this is possible ?
Thanks for your time.
So, I am trying to use JSP to create a set of webpages. I want to link two pages so that if the user clicks a button in one page, it will trigger an event in the other page. Is there an efficient way to do this?
I was taking a look at creating cookies and/or sessions. Any suggestions on these two methods? Thanks
I have the following two methods that (as you can see) are similar in most of its statements except for one (see below for details)
unsigned int CSWX::getLineParameters(const SURFACE & surface, vector<double> & params)
{
VARIANT varParams;
surface->getPlaneParams(varParams); // this is the line of code that is different
SafeDoubleArray sdParams(varParams);
for( int i = 0 ; i < sdParams.getSize() ; ++i )
{
params.push_back(sdParams[i]);
}
if( params.size() > 0 ) return 0;
return 1;
}
unsigned int CSWX::getPlaneParameters(const CURVE & curve, vector<double> & params)
{
VARIANT varParams;
curve->get_LineParams(varParams); // this is the line of code that is different
SafeDoubleArray sdParams(varParams);
for( int i = 0 ; i < sdParams.getSize() ; ++i )
{
params.push_back(sdParams[i]);
}
if( params.size() > 0 ) return 0;
return 1;
}
Is there any technique that I can use to move the common lines of code of the two methods out to a separate method, that could be called from the two variations - OR - possibly combine the two methods to a single method?
The following are the restrictions:
The classes SURFACE and CURVE are from 3rd party libraries and hence unmodifiable. (If it helps they are both derived from IDispatch)
There are even more similar classes (e.g. FACE) that could fit into this "template" (not C++ template, just the flow of lines of code)
I know the following could (possibly?) be implemented as solutions but am really hoping there is a better solution:
I could add a 3rd parameter to the 2 methods - e.g. an enum - that identifies the 1st parameter (e.g. enum::input_type_surface, enum::input_type_curve)
I could pass in an IDispatch and try dynamic_cast< and test which cast is NON_NULL and do an if-else to call the right method (e.g. getPlaneParams() vs. get_LineParams())
The following is not a restriction but would be a requirement because of my teammates resistance:
Not implement a new class that inherits from SURFACE/CURVE etc. (They would much prefer to solve it using the enum solution I stated above)
Is there a tool that can do a diff of two methods? I'm working on some legacy code that has several 100-200 line methods that contain a lot of duplication and I would like to abstract the duplication out. Being able to diff the two methods would be a huge help. In case it matters, I'm working with .NET and Visual Studio 2008.
I have two servers - one Django, the other likely to be written in Python - and one is putting 'tasks' into a database and another is processing these tasks.
They share a database, but I want the processor to react quickly to new tasks rather than polling periodically.
Are there any straightforward ways for two Python servers to talk to one another, or does the task processor have to have web-hooks or something?
It feels there ought to be a blessed way to do this...
Using two ScriptManagers(ASP.Net and Telerik) will effect the page performance ?
I have both ASP.Net and Telerik Controls on the same page and I'm using both ASP.Net and Telerik Script managers. Can I avoid using one script manager ? How will the page performance is varried if I use two script managers ?
and
Refering Source/SCript files in one Script manager can be used accross the other controls ?
I have php class(simple example):
<?php class test{
public function __construct() {
//some code
}
public function __destruct() {
//some code
}
public function echo1 {
//some code
return 1;
}
public function echo2 {
//some code
return 2;
}
}
How could I return results of this two functions echo1 and echo2 in class in one row don't creating two new objects for each function?
I have two buttons that both have onTouchListeners and perform an action when pressed down. Why do they not work if you try to click both at the same time? I'm building for Android 1.6. I don't have a real device to test on, and you can't test clicking two things at the same time in the emulator. Thanks for any help.
I have datatable and there two column which is type of string and I want to make addition of that two columns data for another column how can I do that ?
I have a bitmap and I want to scale it up to fill an ImageView and overlay the unscaled version of the bitmap on top.
Which would be cheaper (in terms of memory and processor usage)?
Using two ImageViews, one for each version of the bitmap
Using a canvas and drawing on the singular bitmap, using one ImageView
I saw this question about ImageView vs Canvas, but it doesn't address memory/processor concerns. My intuition says two ImageViews may use more RAM, while using a canvas would use more processing power while the drawing occurs.
When there are two identical events in the event loop, will wxPython handle both of them, or will it call the handler only once for them both?
I mean, in my widget I want to have an event like EVT_NEED_TO_RECALCULATE_X. I want this event to be posted in all kinds of different circumstances that require x to be recalculated. However, even if there are two different reasons to recalculate x, only one recalculation needs to be done.
How do I do this?
I two sets of k-dimensional vectors, where k is around 500 and the number of vectors is usually smaller. I want to compute the (arbitrarily defined) minimal distance between the two sets.
A naive approach would be this:
(loop for a in set1
for b in set2
minimizing (distance a b))
However, this requires O(n² * distance) computations. Is there a faster way of doing this?
Say I have a dataframe df with two or more columns, is there an easy way to use unique() or other R function to create a subset of unique combinations of two or more columns?
I know I can use sqldf() and write an easy "SELECT DISTINCT var1, var2, ... varN" query, but I am looking for an R way of doing this.
It occurred to me to try ftable coerced to a dataframe and use the field names, but I also get the cross tabulations of combinations that don't exist in the dataset:
uniques <-
as.data.frame(ftable(df$var1,
df$var2))