So I run my task with ccnet and my task creates files. What is the best way to read the file and identify if there is a certain value in it from msbuild??
I have following statement in one of the oracle SP:
OPEN CUR_NUM FOR
SELECT RTRIM(LTRIM(num)) as num
FROM USER WHERE USER_ID = v_user_id;
When the above does not return anything the SP result just has no column name in it. But I'd like the cursor to still have num column with some default value like NOTHING when no data is found.
Is this doable ?
Hi,
Can you please tell me if there is any DOM API which search for an element with given attribute name and attribute value:
Something like:
doc.findElementByAttribute("myAttribute", "aValue");
Thank you.
how to get the value of input box while submitting the form in php
i need the url like this
www.example.com/te/?a=test&firstname=blabla
<form action="te/?a=test" method="post">
<input type="text" name="firstname" />
<input type="submit" name="button" />
</form>
Basically I've created a list that subtotals according to the group.
I then created a multi-value parameter that allows the user to choose which group is shown in the report.
How can I get the grand total to reflect the parameter since its currently outside of the list?
Hi,
I need a function by which I will be able to convert a number to a nearest value of a given multiple.
Eg i want an array of number to be set to the neareast multiple of 16, so 2 = 0, 5 = 0, 11 = 16, 17 = 16, 30 = 32 etc
thanks
I have a primary key auto increment attribute in my table. I want to know the value assigned to it for a row that is inserted using statement.executeQuery(). How to achieve this in the best possible manner?
let retVal =
if reader.Read() then
(reader.GetString(0), getBytesData reader 1, reader.GetDateTime(2))
else
null
F# don't allow null to returned
How can i have value return as a tuple or a null?
i have an html page where i have a table of items (one item per row) where each item is a html link that says "Add" and there is a textbox next to each link with a number in it.
the text link and the textbox are in the same td inside the row of the table.
how do i, using jquery, capture the value from the textbox that is to the right of the link i click on.
Often I just need to get a single value from MySQL that I know exists there. I use the following construct:
$result = end(mysql_fetch_array(mysql_query('SELECT FOUND_ROWS()', $db)));
Is there a proper single function in PHP that would do this?
Contract.all(:conditions => ['voided == ?', 0]).size
=> 364
Contract.all(:conditions => ['voided != ?', 0]).size
=> 8
Contract.all.size
=> 441
the 3 numbers does not added up (364 + 8 != 441). What's the proper way write the :conditions to count the rows which the voided column value is NULL or equal to zero?
I am performing a least squares regression as below (univariate). I would like to express the significance of the result in terms of R^2. Numpy returns a value of unscaled residual, what would be a sensible way of normalizing this.
field_clean,back_clean = rid_zeros(backscatter,field_data)
num_vals = len(field_clean)
x = field_clean[:,row:row+1]
y = 10*log10(back_clean)
A = hstack([x, ones((num_vals,1))])
soln = lstsq(A, y )
m, c = soln [0]
residues = soln [1]
print residues
Hi, im just writing my own replace method for any weird characters and i used the ASCI value 0, null to replace unwanted characters, i was hoping for them to be 'deleted', but this doesnt work. A gap just appears in the string.
What exactly does String.Replace() do when removing a character for ""? Does it shift them all down and then 'delete' the final character or something?
I used a code:
jQuery.fn.MyFunction = function(){
return this.each(function() {
attributes = "test";
return attributes;
});}
But when I call
var1 = $(this).MyFunction();alert(var1);
I got an [object], but not the "test".
How to allow jquery plugin return a some value?
CALORIES = \
{ 'Beef' : 200, \
'Chicken' : 140, \
}
class Food():
__slots__ = (
'cal' # Calories
)
def mkFood( name ):
"""Create and return a newly initialized Food item"""
result = Food()
result.cal = calorie in dict(CALORIES[1])
return result
Is that a proper way to the value of the target item in Calories? Like getting 200, 140, such like that.
result.cal = calorie in dict(CALORIES[1])
So... I want to return value when C# function is called. I need a code example (simple summ of a,b values will be ok) Please help
I need something like this ( I know ActionScript so I will write in it):
public function sum(valueA:int, valueB:int):int
{
var summ:int = valueA + valueB;
return summ;
}
How to translate it into C#?
Hello,
I'm building a shopping cart and I would like to use a JavaScript function to validate user input when entering the quantity value in the quantity text input. I would like to allow the entering of integer values only (no floats, no other characters).
I know that I can apply this function using onKeyUp event and also I found isNaN() function, but it returns true even for floats (which is not ok).
Can you guys help me out with this one?
Thanks.
I have one 'Transaction' entity object with 'Operations' navproperty with multiplicity of 'Many'.
When I'm adding only one operation per transaction nothing happens, but when I'm trying to add more than one operation,
db.SaveChanges() throws an exception like 'Subquery returned more than 1 value blah, blah, blah'
How can I solve that?
Help me guys please...
BTW... Could you tell me how can I see the exact query string that EF passes to Sql Server on db.SaveChanges() method?
Hello, I have a table with OWN_ID and OWN_Email -
3ace7cf80edd | [email protected]
3acf6af33ff7 | [email protected]
3acda2524e00 | [email protected]
3ad75583c9a7 | [email protected]
3ad74b018999 | [email protected]
etc.
the problem is that it should contain only a single ID per Email, also I need to replace all OWN_ID values in another table by highest OWN_ID value of the OWN_Email
So I have this schedule visit page with two groups.
Group 1 contains a list of: Cases.
Group 2 contains a list of: Parties.
each group has a checkboxes next to its item for the user to select.
My Issue when i select a case and/or a party and save -- then go to the edit page of the visit i just saved and only my selected case is checked and the party i selected is not checked. After debugging i realized that the partyId is not being saved properly during the create page and thus not showing as selected or saved on the edit page.
I really need help on how to properly save the party selected and setting for it a value from the parameter. Here is my code of what i have for saving a case and would like to know how to properly save with party.
Controller
[HttpPost]
[ValidateInput(false)]
public ActionResult Create(VisitViewModel viewModel, Guid[] associatedCasesSelected, Guid[] selectedParties)
{
if (!ModelState.IsValid)
{
viewModel.Time = _timeEntryHelper.Value;
AddLookupsToViewModel(viewModel);
return View(viewModel);
}
var visitEntry = Mapper.Map<VisitViewModel, VisitEntry>(viewModel);
...
viewModel.CasePartyIds = selectedParties;
try
{
_visitEntryService.Create(visitEntry, associatedCasesSelected);
this.FlashInfo(string.Format(Message.ConfirmationMessageCreate, Resources.Entities.Visit.EntityName));
}
catch (RulesException ex)
{
ex.CopyTo(ModelState);
}
if (ModelState.IsValid)
return RedirectToAction("Edit", "Case", new { caseId = viewModel.CaseId });
AddLookupsToViewModel(viewModel);
return View(viewModel);
}
VisitEntryService
public void Create(VisitEntry visitEntry,IList<Guid>caseIds)
{
EnsureValid(visitEntry);
_visitEntryRepository.Save(visitEntry);
caseIds = AddCurrentCaseToCases(visitEntry.CaseId, caseIds);
foreach (var caseId in caseIds.Distinct())
{
var visit = new Visit {CaseId = caseId, VisitEntryId = visitEntry.VisitEntryId};
_visitService.Create(visit);
}
}
AddCurrentCaseToCases
private static IList<Guid>AddCurrentCaseToCases(Guid caseId, IEnumerable<Guid>caseIds)
{
var cases = new List<Guid>();
if (caseIds != null)
{
cases.AddRange(caseIds);
if(!caseIds.Contains(caseId))
cases.Add(caseId);
}
else cases.Add(caseId);
return cases;
}
VisitService
public Visit Get(Guid visitId)
{
return DataContext.Visits.SingleOrDefault(v => v.VisitId == visitId);
}
public void Save(Visit visit)
{
if(visit.VisitId == Guid.Empty)
{
visit.VisitId = Guid.NewGuid();
DataContext.Visits.InsertOnSubmit(visit);
}
else
{
var currentVisit = Get(visit.VisitId);
if (currentVisit == null) throw RepositoryExceptionFactory.Create("Visit", "VisitId");
}
DataContext.SubmitChanges();
}
Any TIPS or IDEAS is greatly appreciated at this time :)
The entitiy for the parties will be VisitEntryParty
I have the following code to assign a value to all the elements of a vector:
x = 100;
for (int i=0;i<vect.size();i++)
{
vect[i] = x;
}
It's straightforward enough, but I'm wondering if there is a function in the STL that does the same thing; something like for_each, but for assignment.
On my page.
i have one textbox and one button.
-- on the button click event. -- one function will be called.
Now,
How to get that value of textbox and store in php variable? this should be done in that function which we will call on button click.
var user = {};
now I want to create a setUsers method that takes a key/value pair object and initializes the user variable.
setUsers = function(data) {
// loop and init user
}
where data is like:
234: "john", 23421: "smith", ....