Get different and common items in two arrays with LINQ [C#]

var list1 = new string[] {"1", "2", "3", "4", "5", "6"};
var list2 = new string[] {"2", "3", "4"};
var listCommon = list1.Intersect(list2);
foreach (string s in listCommon) Console.WriteLine(s);

Output:

2
3
4

 

http://stackoverflow.com/a/10648270

How to create a Winforms Combobox with Label and Value [C#]

    private void PopulateComboBox()
    {
        var dict = new Dictionary<int, string>();
        dict.Add(2324, "Toronto");
        dict.Add(64547, "Vancouver");
        dict.Add(42329, "Foobar");

        comboBox1.DataSource = new BindingSource(dict, null);
        comboBox1.DisplayMember = "Value";
        comboBox1.ValueMember = "Key";
    }

http://stackoverflow.com/a/2023457

Remove duplicates from array c#

int[] s = { 1, 2, 3, 3, 4};
int[] q = s.Distinct().ToArray();

http://stackoverflow.com/a/9685

search value (with regex) in array and push search value to multidimensional array in PHP

Example Data

Array
(
    [0] => [DATA_1_A]
    [1] => [DATA_1_B] [DATA_2_B]
    [2] => [DATA_1_C] [DATA_2_C] [DATA_3_C]
)

And push value to multidimensional array.

Array
(
    [0] => Array
        (
            [0] => DATA_1_A
        )
    [1] => Array
        (
            [0] => DATA_1_B
            [1] => DATA_2_B
        )
    [2] => Array
        (
            [0] => DATA_1_C
            [1] => DATA_2_C
            [2] => DATA_3_C
        )
)

$new = array_map(function($i) {
if(preg_match_all('/\[([^\]]+)\]/', $i, $m)) return $m[1];
return $i; }, $arr);

http://stackoverflow.com/a/37666969

Answer:Scripts to convert data-dump to other formats

https://github.com/testlnord/sedumpy/blob/master/makedb.py
http://meta.stackexchange.com/a/28231

ref: https://twitter.com/sornram9254/status/738783811073232896

Answer:How to print all information from an HTTP request to the screen, in PHP

echo file_get_contents( 'php://input' );

http://stackoverflow.com/a/3136304
ref: https://twitter.com/sornram9254/status/738058662141263872

Answer:Remove empty array elements (PHP)

$emptyRemoved = array_filter($linksArray);

http://stackoverflow.com/a/3654335
ref: https://twitter.com/sornram9254/status/737673183155740672

Answer:Rebase array keys after unsetting elements [php]

$array = array_values($array);

http://stackoverflow.com/a/5943165
ref: https://twitter.com/sornram9254/status/737696350146437120

Answer:Detecting request type in PHP (GET, POST, PUT or DELETE)

$_SERVER['REQUEST_METHOD']

http://stackoverflow.com/a/359050
ref: https://twitter.com/sornram9254/status/738063120422174720

Answer:Recommendations for a Hex Viewer Control for Windows.Forms?

There is a ByteViewer Control directly available in the .NET Framework. Here is how you can use it in a sample Winforms C# application (note: you need to reference the System.Design assembly):

Namespace: System.ComponentModel.Design
Assembly: System.Design (in System.Design.dll)

public Form1()
{
InitializeComponent();

ByteViewer bv = new ByteViewer();
bv.SetFile(@”c:\windows\notepad.exe”); // or SetBytes
Controls.Add(bv);
}


http://stackoverflow.com/a/23344431