I delete my java program from java project in eclipse. The extension was .java and I don't know how to get back? I try (getdataback for NTFS) but I didn't get back my *.java file. Some solution?
I've a typical scenario & need to understand best possible way to handle this, so here it goes -
I'm developing a solution that will retrieve data from a remote SOAP based web service & will then push this data to an Oracle database on network.
Also, this will be a scheduled task that will execute every 15 minutes.
I've event queues on remote service that contains the INSERT/UPDATE/DELETE operations that have been done since last retrieval, & once I retrieve the events for last 15 minutes, it again add events for next retrieval.
Now, its just pushing data to Oracle so all my interactions are INSERT & UPDATE statements.
There are around 60 tables on Oracle with some of them having 100+ columns. Moreover, for every 15 minutes cycle there would be around 60-70 Inserts, 100+ Updates & 10-20 Deletes.
This will be an executable jar file that will terminate after operation & will again start on next 15 minutes cycle.
So, I need to understand how should I handle WRITE operations (best practices) to improve performance for this application as whole ?
Current Test Code (on every cycle) -
Connects to remote service to get events.
Creates a connection with DB (single connection object).
Identifies the type of operation (INSERT/UPDATE/DELETE) & table on which it is done.
After above, calls the respective method based on type of operation & table.
Uses Preparedstatement with positional parameters, & retrieves each column value from remote service & assigns that to statement parameters.
Commits the statement & returns to get event class to process next event.
Above is repeated till all the retrieved events are processed after which program closes & then starts on next cycle & everything repeats again.
Thanks for help !
how do i load all class files in a folder in codeigniter?
its for when i develop, i create and delete class files very often, i don't want to add/remove everyone manually in autoload.php.
thanks!
I have select, insert, update and delete query.
if i have to write all query in same store procedure that is good for performance or i should write all query in separate store procedure?
I'm new to CRM (version 4.0) and i'm trying to return a 'yearid' guide based on a given year (which is also stored in the entity).So far i've got:
public static Guid GetYearID(string yearName)
{
ICrmService service = CrmServiceFactory.GetCrmService();
// Create the query object.
QueryExpression query = new QueryExpression("year");
ColumnSet columns = new ColumnSet();
columns.AddColumn("yearid");
query.ColumnSet = columns;
FilterExpression filter = new FilterExpression();
filter.FilterOperator = LogicalOperator.And;
filter.AddCondition(new ConditionExpression
{
AttributeName = "yearName",
Operator = ConditionOperator.Equal,
Values = new object[] { yearName}
});
query.Criteria = filter;
}
But my questions are:
A) What code do in addition to this to actually store the Guid?
B) Is using a QueryExpression the most efficient way to do this?
Hi,
what is the easiest/best way to copy my app shortcut to windows startup folder ?
i want to put a check box to notifyicon context menu and when user click on it i want app to copy shortcut to startup folder and when unchecked wanna delete it.
thanks
I am making a calculator and part of this program takes in user String input and tokenizes it (using my own implementation of a Tokenizer class). So now I have a bunch of Token objects and I would like to test each one of them to see if they hold numbers or operators.
Is there a way to test to see if they hold operators (ie. +, -, *, /, =, (, ), etc.) without using
if (token.equals("+") || token.equals("-") || ... and so on, for each operator? These Token objects are all of type String.
I want to write to a file without overwriting anything. It is a text file containing records. When I delete a specific record, I do not actually remove it from the file, I just put information in the header saying that it is deleted. How can I do this?
Instead of executable code all it does is create files that don't do anything, even if the files are made executable.
TARGETS = load list show add delete btree
all: $(TARGETS)
%: %.cpp
g++ $< -g -o $@ -MM -MF [email protected]
sed "s/$@\.o:/$@:/" [email protected] > [email protected]
-@rm [email protected]
DEPS=$(TARGETS:%=%.d)
-include $(DEPS)
I was going through mit's opencourseware related to performance engineering.
The quickest method (requiring least number of clock cycles) for finding the minimum of two numbers(say x and y) is stated as:
min= y^((x^y) & -(x<y))
The output of the expression x < y can be 0 or 1 (assuming C is being used) which then changes to -0 or -1. I understand that xor can be used to swap two numbers.
Questions:
1. How is -0 different from 0 and -1 in terms of binary?
2. How is that result used with the and operator to get the minimum?
Thanks in advance.
Have a quick question about what would be the best way to implement iterators in the following:
Say I have a templated base class 'List' and two subclasses "ListImpl1" and "ListImpl2". The basic requirement of the base class is to be iterable i.e. I can do:
for(List<T>::iterator it = list->begin(); it != list->end(); it++){
...
}
I also want to allow iterator addition e.g.:
for(List<T>::iterator it = list->begin()+5; it != list->end(); it++){
...
}
So the problem is that the implementation of the iterator for ListImpl1 will be different to that for ListImpl2. I got around this by using a wrapper ListIterator containing a pointer to a ListIteratorImpl with subclasses ListIteratorImpl2 and ListIteratorImpl2, but it's all getting pretty messy, especially when you need to implement operator+ in the ListIterator.
Any thoughts on a better design to get around these issues?
I am aware you cannot use an initialiser list for an array. However I have heard of ways that you can set an array of pointers to NULL in a way that is similar to an initialiser list.
I am not certain how this is done. I have heard that a pointer is set to NULL by default, though I do not know if this is guaranteed/ in the C++ standard. I am also not sure if initialising through the new operator compared to normal allocation can make a difference too.
Hello, I have an easy script, that works in all browsers, except IE(8, haven't tryed lower versions yet).
$('.deleteItemIcon').click(function() {
var deleteConfirm = confirm('Do you really wanna delete that item?')
if (!deleteConfirm) {
return false;
}
});
Can you see a reason, why that shouldn't be working, if yes, how to make it work?
I was reading this: http://en.wikipedia.org/wiki/Thread_safety
Is the following function thread-safe?
void foo(int y){
int * x = new int[50];
/*...do some stuff with the allocated memory...*/
delete x;
}
In the article it says that to be thread-safe you can only use variables from the stack. Really? Why? Wouldn't subsequent calls of the above function allocate memory elsewhere?
Is ResultSet Thread safe?
My question arises because in this i have used a different statement for each query i have delsared a ResultSet as an local variable but it gives me a error of Operation not allowed after ResultSet is closed. But my statements are working as i'm using the statements in insert and delete query.I have commented the ResultSet part and have not got the error !!
The source code of my program can be referd to , in my earlier Question .
Hello,
class Refvect
{
public:
vector<int> &refv;
Refvect(int t, vector<int> &refv = vector<int>()) : refv(refv) { };
void operator()()
{
refv.clear();
}
};
int main ()
{
Refvect r(0);
r();
}
With Visual Studio 2010, this gives me an error : "vector iterators incompatible" at the execution, but I don't understand why (but I can insert elements in refv without any problem).
The temporary object vector() lives as long as the reference, no?
DateTime? testDate = (DateTime?)arrayOfObjects[dateObject];
Does that code look ok? I attempted to use the as operator but I got the 'non-nullable' error. What I'm trying to say is that the object I'm choosing from the array is either DateTime or a null DateTime but either can be assigned to testDate.
Doesn't feel right doing it this way, I think I'm missing something obvious.
EDIT: I suppose it's the same as the way I could've adapted the as in the following way:
DateTime? testDate = arrayOfObjects[dateObject] as DateTime?;
Is either line of code the best way of handling potential nulls?
In a SQL Server 2008 R2 database, given this schema:
AgentsAccounts
_______________
AgentID int UNIQUE
AccountID
FinalAgents
___________
AgentID
I need to create a query that does this: For each AgentID 'final' in FinalAgents remove all of the OTHER AgentID's from AgentsAccounts that have the same AccountID as 'final'. So if the tables have these rows before the query:
AgentsAccounts
AgentID AccountID
1 A
2 A
3 B
4 B
FinalAgents
1
3
then after the query the AgentsAccounts table will look like this:
AgentsAccounts
AgentID AccountID
1 A
3 B
What T-SQL query will delete the correct rows without using a curosr?
Say I have an ArrayList that I have cast to an ArrayList of objects. I know that all the objects that were in the ArrayList I cast were of the same type, but not what the type was.
Now, if the ArrayList is not empty, I could take one of the objects in it and use the instanceof operator to learn what the actual type is. But what of the case where the ArrayList is empty? How do I determine what type Object actually is then? Is it possible?
I have the following script which identifies lines in a file which I want to remove, based on an array but does not remove them.
What should I change?
sourcefile = "C:\\Python25\\PC_New.txt"
filename2 = "C:\\Python25\\PC_reduced.txt"
offending = ["Exception","Integer","RuntimeException"]
def fixup( filename ):
print "fixup ", filename
fin = open( filename )
fout = open( filename2 , "w")
for line in fin.readlines():
for item in offending:
print "got one",line
line = line.replace( item, "MUST DELETE" )
line=line.strip()
fout.write(line)
fin.close()
fout.close()
fixup(sourcefile)
Hello
If there is only 1 running application in the system (and default 100 sleeping process), and it do a blocking syscall (I'm interested in blocking recv or blocking read). Will linux kernel delete this application from task_t *current pointer?
I maintain a product that is installed at multiple locations which as been haphazardly upgraded. Unique constraints were added to a number of tables, but I have no idea what the names are at any particular instance. What I do know is the table/columnname pair that has the unique constraints and I would like to write a script to delete any unique constraint on these column/table combinations. This is MSSQL 2000 and later. Something that works on 2000/2005/2008 would be best!
It is well known that the user can define stream manipulators like this:
ostream& tab(ostream & output)
{
return output<< '\t';
}
And this can be used in main() like this:
cout<<'a'<<tab<<'b'<<'c'<<endl;
Please explain me how does this all work? If operator<< assumes as a second parameter a pointer to the function that takes and returns ostream &, then please explain my why it is necessary? What would be wrong if the function does not take and return ostream & but it was void instead of ostream &?
Also it is interesting why “dec”, “hex” manipulators take effect until I don’t change between them, but user defined manipulators should be always used in order to take effect for each streaming?
How can I write a function using template specialization that has 2 different input types and an output type:
template <class input1, class input2, class output>
and return the sum of the 2 numbers (integers/doubles). However, if I get 2 integers I want to return an integer type but for any other combinations of integer and double I'll always return double.
I am trying to do that without using directly the '+' operator but having the next functions instead:
double add_double_double(double a, double b) {return (a+b);}
double add_int_double(int a, double b) {return ((double)(a)+b);}
int add_int_int(int a, int b) {return (a+b);}