What does this line mean? I havn't done C in a few years. Does it perform the operation in parens then make the int result a pointer??
b[0] = *(start + pos++);
Is there a better way of doing this:
val totalScore = set.foldLeft(0)( _ + score(_) )
or this:
val totalScore = set.map(score(_)).sum
I think it's quite a common operation so was expecting something sleeker like:
val totalScore = set.sum( score(_) )
So we have a photo like this
How to detect that a red wall has a white figure painted on it and that that white figure is a texture and than how to cut that wall from the picture? I need an algorithm for performing such operation programaticly (not by hand)
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 .
Can "Distinct" key Word be used twice in a single Select Query? like wise:
select DISTINCT(trackid), DISTINCT(table_name) from jos_audittrail where live = 0 AND operation = UPDATE
Thanks
I am fetching a db zip on initial startup of an AIR app (after 1st install), which I then unpack via FZip.
After this operation I immediately need to load data from the generated sqlite db, which fails since I seem not able to determine when the zip is completely unpacked and/or the sqlite has been created.
Any suggestions? Thx!
I am trying to create a type of recorded data transaction that I can replay on a different database.
For example I am capturing an order into a system, when I save that I want to be able to "export" a sql script that I can run on another database to create the same order.
I am using NHibernate and I am trying to catch the sql query string for the save operation to save to a file, but with no success.
I am going to write a C# WinForms application which will run a long data-crunching task in a BackgroundWorker, show progress in a ProgressBar and have buttons to start, pause, resume and cancel the operation. I'd like to write the calculation in F#. Do you know of any good examples or readings available in the Web which can help me?
Say that I'm writing a test and my caret is here (indicated by "|"):
[ExpectedException(typeof(InvalidOperationException|))]
In Visual Studio 2010, I'd like to press some shortcut that would take me to the next line so that I could start typing "public void Etc()".
Right now, I need to press
Right arrow
Right arrow
Right arrow
Enter
Which is too many key presses IMO. Is there a VS2010 / ReSharper shortcut to aid this operation?
By default it's like this:
$.fn.ellipsis = function() {
...
return this.each(function(){
//do some operation on each element here to see if it qualifies
}
}
But now I want to return a subset of all, only those qualify in this.each(function() {}),
how to modify the code so that it finally returns only those that qualify?
i have write bellow at this link http://stackoverflow.com/questions/2896811/question-about-siftdown-operation-on-heap code above ritten is pseudo code and i am interested if according to pseudo code my program is correct?
hi i am very surpise when somebody post question everybody are saying it is homework please show us your effort now i have done this code http://stackoverflow.com/questions/2902781/priority-queue-implementation question is is this implementation correct? and nobody tell me answer also this one http://stackoverflow.com/questions/2896811/question-about-siftdown-operation-on-heap-closed can anybody explain me what is happened?no one answer me
why?
I want alternative rows in my table to be shaded. what is the best way to do this, javascript, rails?
Today, i do a simple <% num % 2%, but this is such a common operation that i think there should be a smarter way to do it
Hi,
I am doing an App which access the gprs .I am facing problem when the user starts another application who uses gprs also like google maps .It takes it own heap memory ,after doing some operation on Maps app it calls OnLowMemory of my service .and my ui is also killed in background.
I am not getting any proper tutorial haw can i start my app when it is getting killed during onLowMemory ,or is there any other way to handle it .
Thanks in advance.
Is there an easy way to convert an angle (in degrees) to be between -179 and 180? I'm sure I could use mod (%) and some if statements, but it gets ugly:
//Make angle between 0 and 360
angle%=360;
//Make angle between -179 and 180
if (angle180) angle-=360;
It just seems like there should be a simple math operation that will do both statements at the same time. I may just have to create a static method for the conversion for now.
Hi
I installed the tfs 2008. it work on the work group but it unable to connect the when the tfs server run on the domain.
it shows the some error
1 - you r the not authorize person to,
2 - tfs server is offline.
3 - you have not the sufficient writ e to perform this operation.
I have a wcf restful service with a operation contract that contains two values - an int and a string. This is a post call as well.
If i wrap the call using the BodyStyle = WebMessageBodyStyle.Wrapped. What should i assume the xml request will now look like?
Often, I am building an array by iterating through some data, e.g.:
my_array = []
for n in range(1000):
# do operation, get value
my_array.append(value)
# cast to array
my_array = array(my_array)
I find that I have to first build a list and then cast it (using "array") to an array. Is there a way around these? all these casting calls clutter the code... how can I iteratively build up "my_array", with it being an array from the start?
thanks.
I'm witting an application based on a server and various client but I'm having a problem with the send command.
Whenever I do ctrl+c on the client side the send operation kills the thread which is in and the process running (in order to have multiple clients I set a thread to which one).
If the client ends (doing the close socket) properly the server doesn't die, but when I use the ctrl+c combination on the client both exit.
What can I do to prevent send commando to have this behavior?
Thx in advance
Greetings,
What control in Visual C# 2008 would allow me to set a path and get the value of that path.
For example:
I want the user to click a button then select a path where he/she would do the operation such as save a file in selected path.
Hi,
I' am required to convert a MATLAB function into C++, and this requires me to find determinate of a matrix. I was told that use of BOOST library would make my job easier. I went through the documentation of BOOST Library, but couldn't find much info about the same.
If anyone could give a template for the above operation, It would be of lot of help and would be greatly appreciated.
Thanks
Regards
I have a php page named import.php. while executing this file a lot of database operation is doing.So i need to show the progress to the user, by using a progres bar.How is it possible using any of these php ajax, javascript, jquery,css, flash... methods
I develop the DAL class for db operation
Public Sub StartTransaction()
Dim objConnection As SqlConnection = EstablishConnection()
objConnection.Open()
Me.Transaction = objConnection.BeginTransaction()
End Sub
Public Sub CommitTransaction()
Me.Transaction.Commit()
End Sub
Public Sub RollBackTransaction()
Me.Transaction.Rollback()
End Sub
after start the transaction when we commit or rollback and set transaction object to nothing it dont close the connection attach with this transaction
how I close the Connection attach to this transaction???
I created an application using seam-gen. The created operation to search the DB ends with and exception (syntax error). The query has a where clause like this:
lower(barcode0_.barcode_ean) like lower((?||'%')) limit ?
Does hibnerate or seam create the where clause which my DB can't understand?
Or is there a workaround for SQL statement related issues in seam?
Hi,
Just playing around with some of the APIs in .NET and I can't seem to find a way to cause Array.ConstrainedCopy() fail.
According to MSDN, it's treated as an atomic operation. If it fails during the copy, the entire call fails resulting in no elements being copied as opposed to its Array.Copy() counterpart.
Can someone demonstrate this or tell me how to do this?