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??
hello fellow java developers,
Im trying toget the System.getProperty("os.name") of my own machine. I am running a java application directly from the machine from within eclipse.
My machine is "windows 7"
the returned value is "windows vista" ! Seems wrong, very wrong. and yes I am sure that I am running the app on a windows 7 machine...
Any ideas as to what is going on here?
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?
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?
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>
I don't want to give an initial value. I want to set these later using the set method
class Duck {
var int id;
var set = Array();
}
Any idea how to declare without getting error?
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?
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
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])
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?
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#?
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
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
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", ....
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 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?
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.
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
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?
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.
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.
Hello,
$url = 'http://www.domain.com/file.php?dir=r&hl=100,200&ord=3&key=a+b+c';
If it were a url I could get value of hl by, say, $_GET['hl']. but how do I retrieve the same from $url string.
Thanks.