[Solved] search in string from an array of keys. PHP

Please take the UPDATE 2 solution, not first and second result following code only works if all the key words are exist inside the string. if not. errors will occur. $str = “I have a sentence like this, and array of some keys.”; $keys = [‘have’, ‘like’, ‘some’]; $parts = preg_split(‘/(‘.implode(‘|’, $keys).’)/i’, $str); $parts = … Read more

[Solved] C# combine to list in json object

This is a textbook example of a nested loop. Loops can contain other loops, where the inner one repeats for each element of the outer one. This one might look something like: var result = new List<matrix>(); var count = 1; foreach (var r in tmpRows) foreach (var c in tmpCols) result.Add(new matrix { id … Read more

[Solved] Selecting column sequences and creating variables

We could split the dataset (‘df’) with ‘1416’ columns to equal size ‘118’ columns by creating a grouping index with gl lst <- setNames(lapply(split(1:ncol(df), as.numeric(gl(ncol(df), 118, ncol(df)))), function(i) df[,i]), paste0(‘site’, 1:12)) Or you can create the ‘lst’ without using the split lst <- setNames(lapply(seq(1, ncol(df), by = 118), function(i) df[i:(i+117)]), paste0(‘site’, 1:12)) If we need … Read more

[Solved] ld ignores additional pathes

LD_LIBRARY_PATH is the path where the dynamic loader (ld.so and ld-linux.so on Linux, dyld on OS X) looks up libraries. You need this when you run programs that depend on libraries in non-standard paths. It doesn’t necessarily influence where the linker finds libraries. Use the -L flag to specify the search path for ld: ld … Read more

[Solved] find and remove partial duplicates in excel

In an unused column to the right, put this array formula¹ in the second row. =ISNUMBER(MATCH(LEFT(A2, MIN(IFERROR(FIND({0,1,2,3,4,5,6,7,8,9}, A2)-1, 1E+99)))&MID(A2, FIND(“.”, A2), 9),A:A, 0)) Finalize with CSE and fill down as necessary. Use Data ► AutoFilter to filter on that column for TRUE and delete the visible rows. ¹ Array formulas need to be finalized with … Read more

[Solved] Recursive function without loop

First thing you should consider when using recursion is the exit state; which means when the function will be exit public static int findMin(int[] numbers, int startIndex, int endIndex) { if(startIndex == endIndex){ return numbers[startIndex]; } int min = findMin(numbers, startIndex+1, endIndex); return numbers[startIndex] < min ? numbers[startIndex] : min ; } 0 solved Recursive … Read more

[Solved] How to send data to another PHP file? [closed]

You want to transfer the id only to the next file? Use this in the first: <a href=”https://stackoverflow.com/questions/39648925/second.php?id=1″>link_to_2</a> or <form…> <input name=”id” type=”hidden” value=”1″> <button type=”submit”>btn_to_2</button> </form> And in your second file use this for both cases: <?= $_REQUEST[‘id’] ?> solved How to send data to another PHP file? [closed]

[Solved] Buttons must be pressed in a specific order to send the form – jquery

you can do something like this: foreach click on an answer button disabele the current button update the input value..and once the user clicks all answers button check if the combination is correct, if it is the case redirect your page. $(function () { var correct_order=”321″; var clicks=0; var max_clicks=$(‘.answer’).length; $(‘.answer’).click(function(e) { clicks++; $(‘#text1’).val($(‘#text1’).val()+$(this).data(‘info’)); $(this).attr(“disabled”, … Read more

[Solved] T-SQL INSERT INTO disabling Constraints check

Constraint is on the table not a single statement Kind of ugly but Put it in a transaction and take a tablock begin transaction ALTER TABLE branchOffice NOCHECK CONSTRAINT ALL insert into branchOffice with (tablock) — Re-enable the constraints on a table ALTER TABLE branchOffice WITH CHECK CHECK CONSTRAINT ALL commit transation; 3 solved T-SQL … Read more

[Solved] PHP send email foreach user

Your code was missing some curly brackets ( {} ): include (“../dbconnect.php”); $sql=”SELECT c.endofmonthform, c.startofmonthform, c.email, c.id, c.formlevel, c.mastersite, c.opmanager, u.userEmail FROM `clients` as c LEFT JOIN `users` as u on c.opmanager = u.userName WHERE endofmonthform=”22/09/2016″”; //TODAYS DATE BACK HERE! $result=mysql_query($sql); while($row=mysql_fetch_array($result)){ $enddate = $row[‘endofmonthform’]; // End $startdate = $row[‘startofmonthform’]; // Start $email = $row[’email’]; … Read more

[Solved] SQL query with order by clause

‘Transaction’ is a pair of take + return. It’s identity is computed from source data so OPERATORs could be grouped the way you need. The query may fail on data with unpaired OPERATORs. declare @tbl table ( OPERATOR int, PRODUCT varchar(50), [USER NAME] varchar(100), [TIME STAMP] datetime); insert into @tbl(OPERATOR, PRODUCT, [USER NAME], [TIME STAMP]) … Read more

[Solved] SETLOCAL ENABLEDELAYEDEXPANSION , Interrupt SETLOCAL ENABLEDELAYEDEXPANSION, SETLOCAL ENABLEDELAYEDEXPANSION

You may solve your problem this way: set bang=! SETLOCAL ENABLEDELAYEDEXPANSION Echo hi! 7z e -o”C:\test” -i!bang!*.jar “C:\*.zip” Just be sure that the set bang=! command is executed when delayed expansion is disabled. 1 solved SETLOCAL ENABLEDELAYEDEXPANSION , Interrupt SETLOCAL ENABLEDELAYEDEXPANSION, SETLOCAL ENABLEDELAYEDEXPANSION