• Untitled

    homm        
    0 Likes0 Commentsgolang

        ldr     q0, [x19]                   // Sx4 = vld1q_u8(&Srgba[0])
        ldr     q1, [x20]                   // Dx4 = vld1q_u8(&Drgba[0])
        movi    v17.2d, #0xffffffffffffffff
        mov     x9, xzr                     // i = 0
    .LBB0_3:
        tbl     v5.16b, { v0.16b }, v16.16b // vqtbl1q_u8(Sx4, v16)
        mvn     v5.16b, v5.16b              // Sax4 = vsubq_u8(vdupq_n_u8(255), v5)
        add     x10, x9, #16                // x10 = i + 16
        umull   v3.8h, v0.8b, v17.8b        // Rx2lo = vmull_u8(Sx4, 0xff);
        umull2  v4.8h, v0.16b, v17.16b      // Rx2hi = vmull_high_u8(Sx4, 0xff)
        ldr     q0, [x19, x10]              // Sx4 = vld1q_u8(&Srgba[i + 16])
        umlal   v3.8h, v1.8b, v5.8b         // vmlal_u8(Rx2lo, Dx4, Sax4)
        umlal2  v4.8h, v1.16b, v5.16b       // vmlal_high_u8(Rx2hi, Dx4, Sax4)
        ldr     q1, [x20, x10]              // Dx4 = vld1q_u8(&Drgba[i + 16])
        ursra   v3.8h, v3.8h, #8            // vrsraq_n_u16(Rx2lo, Rx2lo, 8)
        ursra   v4.8h, v4.8h, #8            // vrsraq_n_u16(Rx2hi, Rx2hi, 8)
        uqrshrn v2.8b, v3.8h, #8            // Rx4 = vqrshrn_n_u16(Rx2lo, 8)
        uqrshrn2 v2.16b, v4.8h, #8          // vqrshrn_high_n_u16(Rx4, Rx2hi, 8)
        cmp     x10, #3972                  
        str     q2, [x21, x9]               // vst1q_u8(&Rrgba[i], Rx4)
        mov     x9, x10
        b.lo    .LBB0_3
  • arduino i2c guitar effects control receiver

    kevinl7778        
    0 Likes0 Commentsc_cpp

    #include <Wire.h>
    int ledB[]{13,12,11,10,9,8,7,6,5};
    int ledA[]{4,3,2, 1, 0, A0, A1, A2, A3};
    int DelayTime = 50;
    
    int comm1 = 4; 
    void setup()
    {
       for (int i; i<9; i++)
        {pinMode(ledB[i], OUTPUT); pinMode(ledA[i], OUTPUT);}
      for (int i = 0; i <= 8; i++) {digitalWrite(ledB[i], HIGH);}//remove for real world
      for (int i = 0; i <= 8; i++) {digitalWrite(ledA[i], HIGH);}//remove for real world
      Wire.begin(comm1);                
      Wire.onReceive(receiveEvent); 
      Serial.begin(9600);
    
    }
    void loop()
    {
    
    }
    void receiveEvent(int howMany)
    {int x = Wire.read(); Serial.println(x); 
     if (x==0)
     {digitalWrite(ledB[0],LOW);}
     else{digitalWrite(ledB[0],HIGH);}
    }
    
    //{for (int i=0; i<=9; i++)
     //	{a[i]= Wire.read(); Serial.println(a[i]); (a[i]==1){digitalWrite(ledB[i],LOW);}}
  • arduino i2c guitar effects control

    kevinl7778        
    0 Likes0 Commentsc_cpp

    ////////////////////////////////////////////////////////Include default libraries
    #include <Wire.h>
    
    ////////////////////////////////////////////////////////Set up constants
    
    int comm1 = 4; 
    int comm2 = 5; 
    int DelayTime = 250;
    int FS[]{13,12,11,10,9,8,7,6,5};
    int Knb[18];
    int led[]{4,3,2,A2,A3};
    int Group = 1;
    int GroupLastState = 0;
    int Knob = 0;
    
    int comm = comm1;
    
    ////////////////////////////////////////////////////////Start ini proccess
    
    
    void setup(){
        init1(); //Set pinmode for foot switches and leds
      	ledSet(); //Sweep through leds and set 0 on
     	Wire.begin();
      	Serial.begin(9600);}
    
    ////////////////////////////////////////////////////////////Set var's :Need to change to 0-17 all set to 0
    
    int x = 0;
    int y = 0;
    
    
    ////////////////////////////////////////////////////////////Main loop
    
    void loop()
    {
      Wire.beginTransmission(comm);
      //for (int i = 0; i <= 8; i++)
      //{digitalRead(FS[i]); if (digitalRead(FS[i]) == LOW)
      //{Serial.println(String("x = ")+ x);Serial.println(String("Bingo ") +FS[i]);};}
      Grouping();
      Switch(); 
      Knobs();  
      x=digitalRead(FS[0]);
      Wire.write(x);
      
      Wire.endTransmission(comm); 
      delay(100);
     // Wire.beginTransmission(comm); 
      //y=digitalRead(FS[1]);
      //Wire.write(y);
      //Serial.println(String("y = ")+ y);  
      //Wire.endTransmission(comm);
      delay(100);
    
    }
    
    
    //////////////////////////////////////////////////////////Init buttons and outputs
    
    
    void init1(){
      for (int i=0; i<9; i++){pinMode(FS[i], INPUT_PULLUP);}
      for (int j=0; j<5; j++){pinMode(led[j],OUTPUT);}}
      
    
    //////////////////////////////////////////////////////////////////////////////////////////////////////////Init Knight Rider lights
    
    
    
    void ledSet(){ 
      for (int j = 0; j <= 4; j++) {digitalWrite(led[j], HIGH); delay(DelayTime);digitalWrite(led[j], LOW);Serial.println(String("J++") +j);}
      for (int j = 4; j >= 0; j--) {digitalWrite(led[j], HIGH); delay(DelayTime);digitalWrite(led[j], LOW);Serial.println(String("J--") +j);}
      digitalWrite(led[0], HIGH);}
    
    
    
    //////////////////////////////////////////////////////////////////////////////////////////////////////Changing Comunication group
    
    
    void Switch(){ 
      if (Group != GroupLastState){
      switch (Group) {
      case 1:
        comm = comm1;
        digitalWrite(led[1], HIGH);
        Serial.println(String("Group = ") +Group);
        Serial.println(String("comm = ") +comm);
        GroupLastState =1;
        break;
      case 2:
        comm = comm1;
        digitalWrite(led[2], HIGH);
        Serial.println(String("Group = ") +Group);
        Serial.println(String("comm = ") +comm);
        GroupLastState =2;
        break;
      case 3:
        comm = comm2;
        digitalWrite(led[3], HIGH);
        Serial.println(String("Group = ") +Group);
        Serial.println(String("comm = ") +comm);
        GroupLastState =3;
        break;
      case 4:
        comm = comm2;
        digitalWrite(led[4], HIGH);
        Serial.println(String("Group = ") +Group);
        Serial.println(String("comm = ") +comm);
        GroupLastState =4;
        break;}}}
    
    
    
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////Switching groups
    
    
    void Grouping(){if  (digitalRead(FS[1]) == LOW && digitalRead(FS[0]) == LOW) {Group += 1;if (Group > 4) {Group = 1;}for (int i=1; i<5; i++){digitalWrite(led[i], LOW);};}
                   
                   if  (digitalRead(FS[8]) == LOW && digitalRead(FS[7]) == LOW) {Group -= 1;if (Group < 1) {Group = 4;}for (int i=1; i<5; i++){digitalWrite(led[i], LOW);};}
                   }
    
    
    
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////Turning Knobs
    void Knobs(){if  (digitalRead(FS[0,3,6]) == LOW){Knob += 1; Serial.println(String("Knob = ") +Knob);}
                   else {Knob = 0;}
     }
    
  • Quine

    phillc        
    0 Likes0 Commentspython

    s='s=%r;print s%%s...';print s%s...
  • ai

    other019        
    0 Likes0 Commentsjavascript

    class GameAi{
      constructor(){
      	//initcall 
    		//minimax (currentPos,3,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,true);
    	}
    	gameAssesState(position){
    		//algorytm oceniania stanug gry
    		//wyższa ocena im bliżej do celu
    		//prawdopodbne poziomy inteligencji 
    		// 8**3 = 512 liści
    		// 8**5 = 32768 liści
    		// 8**7 = 2097152 liści
    	}
    	isGameOver(position){
    
    	}
    	minimax(position,depth,alpha,beta,maximizingPlayer){
    		if (depth == 0 || isGameOver(position))
    			return gameAssesState(position);
    		if (maximizingPlayer){
    			var maxEval = Number.NEGATIVE_INFINITY;
    			var childs = getChilds(position);
    			child.forEach(
    				function(child){
    					var eval = minimax(child,depth-1,alpha,beta,false);
    					maxEval = Math.max(maxEval,eval);
    					alpha = Math.max(alpha,eval);
    					if (beta<=alpha){
    						break;
    					}
    				}
    			);
    			return maxEval;
    		}
    		else{
    			var minEval = 
    		}
    
    	}
    }
    
  • Bae

    ihowarth        
    0 Likes0 Commentsjavascript

    const Kim = {
      size: "XS",
      hotness: "∞"
    };
  • Hello World in Go

    abemassry        
    0 Likes0 Commentsgolang

    package main
    
    import "fmt"
    func main() {
      fmt.Println("Hello World")
    }
  • Hello World

    mparke        
    0 Likes0 Commentsjavascript

    <script>alert('hello world');</script>
  • One liner to print all of unicode

    abemassry        
    0 Likes0 Commentssh

    for i in `bc <<< "obase = 16 ; $(seq 0 65536)" | tr '\n' ' '`; do printf "$i:"; printf "\u$i"; printf '\n'; done | rs -e | less
  • Function Captchas

    Dorthu        
    0 Likes0 Commentspython

    >>> def captcha(challenge=None, answer=None):
    ...   def _dec(f):
    ...     @wraps(f)
    ...     def _inner(*args, **kwargs):
    ...       if not challenge in kwargs or not kwargs[challenge] == answer:
    ...         raise ValueError('captcha failed!')
    ...       del kwargs[challenge]
    ...       return f(*args, **kwargs)
    ...     return _inner
    ...   return _dec
    ...
    >>> @captcha(challenge='two_plus_three', answer=5)
    ... def foo(bar):
    ...   print("bar is {}".format(bar))
    ...
    >>> foo('test')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "<stdin>", line 6, in _inner
    ValueError: captcha failed!
    >>> foo('test', two_plus_three=5)
    bar is test