[Solved] Save Current Date into 3 Ints – C++ [closed]

#include <ctime> int main() { time_t t = time(0); // current time: http://cplusplus.com/reference/clibrary/ctime/time/ struct tm * now = localtime(&t); // http://cplusplus.com/reference/clibrary/ctime/localtime/ // struct tm: http://cplusplus.com/reference/clibrary/ctime/tm/ int day = now->tm_mday; int month = now->tm_mon + 1; int year = now->tm_year + 1900; } Links from above time(0): current time: http://cplusplus.com/reference/clibrary/ctime/time/ localtime: http://cplusplus.com/reference/clibrary/ctime/localtime/ struct tm: http://cplusplus.com/reference/clibrary/ctime/tm/ 1 … Read more

[Solved] Comparing comma separated numbers in cells

In Excel 2016 (but NOT Excel 2013), you can use the following array-entered formula. =TEXTJOIN(“,”,TRUE,IFERROR(1/(1/(ISNUMBER(FIND(“,”&TRIM(MID(SUBSTITUTE(B2,”,”,REPT(” “,99)),seq_99,99))&”,”,”,”&A2&”,”))))*TRIM(MID(SUBSTITUTE(B2,”,”,REPT(” “,99)),seq_99,99)),””)) seq_99 is a Named Formula Refers to: =IF(ROW(INDEX($1:$65535,1,1):INDEX($1:$65535,255,1))=1,1,(ROW(INDEX($1:$65535,1,1):INDEX($1:$65535,255,1))-1)*99) To enter an array formula, after entering the formula in the cell, confirm by holding down ctrl + shift while hitting enter. If you do it correctly, Excel will place … Read more

[Solved] How to limit signed int with AND operator in C?

It is unclear what you want to achieve. Masking the low bits while keeping the sign bit is something you could do with a single mask on architectures where int is represented as sign / magnitude. It is quite unlikely that you would be thinking of this peculiar case. What is your goal then ? … Read more

[Solved] Use List of custom Business Objects as ComboBox datasource

public class MyClass { public string FirstProperty { get; set; } public int SecondProperty { get; set; } } Then: var myList = new List<MyClass> { new MyClass {SecondProperty = 1, FirstProperty = “ABC”}, new MyClass {SecondProperty = 2, FirstProperty = “ZXC”} }; comboBox1.DataSource = myList; comboBox1.ValueMember = “FirstProperty”; comboBox1.DisplayMember = “SecondProperty”; I hope it … Read more

[Solved] Is a date within some of periods [closed]

This function should do what you want. It relies on MySQL treating boolean results as either 1 or 0 in a numeric context, thus the MAX call effectively becomes an OR of all the conditions. CREATE FUNCTION check_activity(project_id INT, check_date DATE) RETURNS BOOLEAN DETERMINISTIC BEGIN RETURN (SELECT MAX(check_date BETWEEN ActiveFrom AND ActiveTo) FROM projects WHERE … Read more