Hi,
is it possible to use date_sub like this ?
$dt = date("Y-m-d h:i:s");
$query = "INSERT INTO `table` (`date`) VALUES ('DATE_SUB('$dt', INTERVAL 15 DAY)')";
$result = MYSQL_QUERY($query);
Thanks
Hi, I have defined my class:
public class Host
{
public string Name;
}
then a strobgly-typed dictionary:
Dictionary<string, Host> HostsTable;
then I try to compare a value:
if (HostsTable.Values.Where(s => s.Name == "myhostname") != null) { doSomething }
and the problem is, nothing is found, even I'm sure the item is on the list. What I'm doing wrong ?
Hi all, is there a method (maybe with Google Collections) to obtain the min value of a Map(Key, Double)
In traditional way, I would have to sort the map according to the values, and take the first/last one.
thanks
I'm redesigning a class constructor in C++ and need it to catch an unspecified bool. I have used default values for all of the other parameters, but from my understanding bool can only be initialized to true or false. Since both of those cases have meaning in the class, how should I handle checking for change from a default value?
Hi,
if i filter an array with array_filter to eliminate null values, keys are preserved and this generated "holes" in the array. Eg:
The filtered version of
[0] => 'foo'
[1] => null
[2] => 'bar'
is
[0] => 'foo'
[2] => 'bar'
How can i get, instead
[0] => 'foo'
[1] => 'bar'
? Thanks
I have a configuration file in the following JSON format:
{
"key1": "value1",
"key2": "value2",
"key3": false,
"key4": 10,
}
The user can set/unset the configuration values using a text editor. I however need to read it in my C# application. Whats the best way to do so for JSON? The above keys are not associated with a class.
SELECT COUNT(*) AS Expr1
FROM Book
INNER JOIN Temp_Order ON Book.Book_ID = Temp_Order.Book_ID
WHERE (Temp_Order.User_ID = 25)
AND (CONVERT (nvarchar, Temp_Order.OrderDate, 111) = CONVERT (nvarchar, GETDATE(), 111))
In here i want to change my User_ID to get from a label.Text
this Sql Statement is in a DataView. so in the Wizard it not accepting a text box values or anything.
can someone please help me to solve this
Is there a simple way to fetch data from other programs running in the background? Like for instance i want my program to read the temperature values from Speed Fan and so on... So basicly reading data from controls that are present in a diffrent application.
If a drop down list contains values (1,3,5,7,9). Whe the user types a 2, the drop down control freezes and when he types 3/5/7, it doesn't change.
This works fine in IE6, IE 8 and FireFox. Does anyone know if this is a known issue?
Hello,
I have Hash where values of keys are other Hashes.
Example: {'key' => {'key2' => {'key3' => 'value'}}}
How can I iterate through this structure?
Hi all,
I'm building a website, and i need to know
the actual page address in which the user is in,
in order to take users in the same page after login.
The problem is that every page is generated from
variables passed by url and query string, so I dont't
know how to recover every variable and assign to it the
correct value.
How to recover variables name and assign them
the correct values?
Thanks
lore
(sorry for my English)
i have text file which has certain values which i want to erase in C++ and python . How to do it?Do i have to assign the file pointer to a null value string?
Hi
I have the following, can anyone familiar with NSTimer tell me why it isn't working?? I've tried various values for an interval but no luck.
self.timer = [NSTimer scheduledTimerWithTimeInterval:.5
target:self
selector:@selector(update:)
userInfo:nil repeats:YES];
And then my selector method
- (void)update:(NSTimer*)timer
{
//DOESN"T TRACE OUT!
NSLog(@" update:theTimer and userInfo = %@",timer.userInfo);
}
I've got a bunch of values that are all assigned the same variable due to running through a for loop several times, so for example:
d = 3.44434
d = 2.4444
d = 2.7777
How do I put them all into a vector?
How do I do the following in Perl in order:
a) curl a page and save it to a variable
b) parse the value of the variable (which is HTML content) for values I want (ex: the info is kept between tags like ... )
For clarification, are you able to use MySQL this way to sort?
ORDER BY CompanyID = XXX DESC
What I am trying to do is use one sql query to sort everything where X = Y, in this case, where CompanyID = XXX. All values where CompanyID is not XXX should come after all the results where CompanyID = XXX.
I don't want to limit my query but I do want to sort a particular company above other listings.
Hi all,
Looking for a creative way to be sure values that come from the getHours, getMinutes, and getSeconds() method for the javascript Date object return "06" instead of 6 (for example). Are there any parameters that I don't know about? Obviously I could write a function that does it by checking the length and prepending a "0" if need be, but I thought there might be something more streamlined than that.
Thanks.
Ok so I have a database colum 'UnitPrice' with a range of values
example: 23, 23.5, 43.23
Now I need to know if there is a way to format them all to the 00.00 format when printing them out. I've been failing at this for about an hour now...
In JTable, if you are inserting values to that row of 4 in first column, Then the focus goes to first row and second column by default. I want to focus the next column of the same row( ie., row 4). How to set requestFocus() in JTable by row wise.?
Hi,
I would like to find a function that will return this kind of formatted values :
1.5555 => 1.55
1.5556 => 1.56
1.5554 => 1.55
1.5651 => 1.56
toFixed() and math round return this value :
1.5651.fixedTo(2) => 1.57
This will be usefull for money rounding.
Hi,
Am having a table with quetion_id , nominees and vote_count. In which the values for question_id and nominees are prepopulated from other tables with vote_count as zero.
If the users select some nominees the vote count should be incresed by one. The problem is How to connect the question_id and nominees like for this question_id this nominee is selected .
can some one give example for this situation..
ASP.NET is changing id, name values according to control's parent control name. That's why i am searching id with JQUERY as below.
// $ is looking to the end of "id" attribute of input elements
$("input[id$='cbAddToNews']")
Only one element is returning by jQuery. But when i want to change the attribute, I'm using this syntax:
$($("input[id$='cbAddToNews']")[0]).show()
Is there any way to do this without wrapping it with $(...[0]) ?