Skip to content

Instantly share code, notes, and snippets.

// ********************************************************************************
// samplelib.h
#ifndef INCLUDED_SAMPLELIB_H
#define INCLUDED_SAMPLELIB_H
void some_func(void);
#endif//INCLUDED_SAMPLELIB_H
// ********************************************************************************
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace ConsoleApplication1
{
class Program
{
// ==UserScript==
// @name SortBy
// @namespace http://autosysprogs.blogspot.com/
// @description Sort by most mutual friends
// @include http://www.facebook.com/find-friends/*
// @author Mkrtich Soghomonyan
// ==/UserScript==
window.addEventListener(
'load',
unsigned long duration;
unsigned long time0;
unsigned long time;
void setup() {
Serial.begin(9600);
// signal pin
pinMode(2, INPUT);
//
time0 = micros();
...
private Thread receive_thread = null;
private void button1_Click(object sender, EventArgs e)
{
if (null != receive_thread)
{
receive_thread.Abort();
}
receive_thread = new Thread(receive_data);
receive_thread.Start();
...
private UdpClient sending_UdpClient = new UdpClient();
private void timer1_Tick(object sender, EventArgs e)
{
float throttle = throttle_trackBar.Value;
throttle /= 10;
throotle_textBox.Text = throttle.ToString();
float elevator = elevator_trackBar.Value - 10;
elevator /= 10;
<?xml version="1.0"?>
<PropertyList>
<generic>
<output>
<line_separator>newline</line_separator>
<var_separator>,</var_separator>
<!-- Get control values -->
<chunk>
<?xml version="1.0"?>
<PropertyList>
<generic>
<input>
<line_separator>newline</line_separator>
<var_separator>,</var_separator>
<!-- Controls -->
<chunk>
"C:\Program Files (x86)\FlightGear\bin\Win32\fgfs" ^
"--fg-root=C:\Program Files (x86)\FlightGear\data" ^
"--aircraft=Malolo1" ^
"--generic=socket,out,10,127.0.0.1,49001,udp,outputprotocol" ^
"--generic=socket,in,10,,49000,udp,inputprotocol"
$ echo -e "#"\!"/bin/dash\nwhoami" | sudo tee a.sh # create a script
#!/bin/dash
whoami
$ sudo chmod +x a.sh # add executable flag
$ ll # see root is the owner
...
-rwxr-xr-x 1 root root 19 2011-03-31 20:32 a.sh*
$
$ ./a.sh # it will print my username
<my user name>