Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="*"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="*"
>
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
int a[10], b[10], c[20];
for (int i = 0; i < 10; i++)
a[i] = b[i] = 0;
@abbas-oveissi
abbas-oveissi / gist:4987032
Last active December 13, 2015 22:49
sample C# code for socket
IPAddress ip = new IPAddress(new byte[] { 127, 0, 0, 1 });
IPAddress ip = IPAddress.Parse("127.0.0.1");
@abbas-oveissi
abbas-oveissi / gist:4987037
Created February 19, 2013 15:48
sample C# code for socket
IPAddress ip = IPAddress.Parse("127.0.0.1");
IPEndPoint iEp = new IPEndPoint(ip, 12345);
@abbas-oveissi
abbas-oveissi / gist:4987045
Created February 19, 2013 15:48
sample C# code for socket
Socket socket = new Socket(AddressFamily.InterNetwork,SocketType.Stream, ProtocolType.Tcp);
@abbas-oveissi
abbas-oveissi / gist:4988183
Created February 19, 2013 17:53
sample C# code for Value vs Reference Types
struct Point
{
private int x, y; // private fields
public Point (int x, int y) // constructor
{
this.x = x;
this.y = y;
}
@abbas-oveissi
abbas-oveissi / gist:4988219
Created February 19, 2013 17:55
sample C# code for Value vs Reference Types
Point p1 = new Point(); // Point is a *struct*
Form f1 = new Form(); // Form is a *class*
@abbas-oveissi
abbas-oveissi / gist:4988233
Created February 19, 2013 17:56
sample C# code for Value vs Reference Types
Form f1; // Allocate the reference
f1 = new Form(); // Allocate the object
@abbas-oveissi
abbas-oveissi / gist:4988241
Created February 19, 2013 17:57
sample C# code for Value vs Reference Types
Point myPoint = new Point (0, 0); // a new value-type variable
Form myForm = new Form(); // a new reference-type variable
Test (myPoint, myForm); // Test is a method defined below
void Test (Point p, Form f)
{
p.X = 100; // No effect on MyPoint since p is a copy
f.Text = "Hello, World!"; // This will change myForm’s caption since
// myForm and f point to the same object
f = null; // No effect on myForm