This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
sin = Math.sin; | |
cos = Math.cos; | |
for ( i = 0 ; i < 8 ; i++ ) { | |
document.write( String.fromCharCode( Math.round( 13202.5+540.8*sin(i)+14948.3*cos(i)+7978.9*sin(2*i)-406.5*cos(2*i)-2614.3*sin(3*i)-5237.5*cos(3*i)+1847.2*sin(4*i)+2334.7*cos(4*i)+10577.7*sin(5*i)-2711*cos(5*i)+11858.1*sin(6*i)+21036.9*cos(6*i)+7818.5*sin(7*i)+1605.5*cos(7*i)-8761*sin(8*i)-9131.8*cos(8*i) ) ) ) ; | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <inttypes.h> | |
#include <pthread.h> | |
#include <signal.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
void TimerHandler( union sigval sv ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Timer1 interrupt handler | |
void __attribute__( ( interrupt ) ) _T1Interrupt( ) { | |
flag1 = 1; | |
flag2 = 1; | |
IFS0bits.T1IF = 0; | |
} | |
while ( 1 ) { | |
IEC0bits.T1IE = 0; // Disable Timer1 interrupt | |
f1 = flag1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void UART1Init() { | |
U1BRG = 25; | |
U1MODE = 0; | |
U1MODEbits.BRGH = 1; | |
U1STA = 0; | |
U1MODEbits.UARTEN = 1; | |
U1STAbits.UTXEN = 0; | |
IFS0bits.U1RXIF = 0; | |
IEC0bits.U1RXIE = 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void __attribute__((interrupt, auto_psv)) _U1RXInterrupt() { | |
char c = (char)U1RXREG; | |
IFS0bits.U1RXIF = 0; | |
// Do something | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define message NYA! | |
// Preprocessor magic! | |
#define _STRING(str) #str | |
#define STRING(str) _STRING(str) | |
int main(void) { | |
printf( "%s\n", STRING( message ) ); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module DrawCircle( | |
input CLOCK, | |
input nRESET, | |
input START, | |
input signed [11:0] X0, | |
input signed [10:0] Y0, | |
input signed [11:0] R, | |
input FILL, | |
output signed [11:0] X, | |
output signed [10:0] Y, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax( { | |
type: "GET", | |
url: "/command.cgi?op=190&CTRL=0x1f&DATA=" + value, | |
cache: true, | |
dataType: "json", | |
timeout: 3000, | |
beforeSend: function( jqXHR, settings ) { | |
jqXHR.setRequestHeader( "If-Modified-Since", "Thu, 01 Jan 1970 00:00:00 GMT" ); | |
} | |
} ).done( function( data, textStatus, jqXHR ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>IDisposable Implementation</Title> | |
<Shortcut>idisp</Shortcut> | |
<Description> | |
How Dispose(bool) should be implemented in a class that uses managed | |
and native resources. | |
</Description> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Sample1 { | |
class Program { | |
static void Main( string[] args ) { | |
Class1 class1 = new Class1(); | |
Console.WriteLine( class1[ DateTime.Now.Second ].ToString() ); | |
} | |
} | |
public class Class1 { |
OlderNewer