bash – Project setup script

It’s a pretty simple script really, i just want to know if there is a way to improve it.

#!/bin/env sh

set -o nounset
set -o errexit

if (( "$#" -ne 3 )) && (( "$#" -ne 2 ));
then
    echo "Usage: ./project.sh (NAME) (GENERATOR) (MAKEFILES)"
    exit 1
fi


mkdir $HOME/Dev/$1
mkdir $HOME/Dev/$1/src/
mkdir $HOME/Dev/$1/build/
cp $HOME/ProjectSetup/CMakeLists.txt $HOME/Dev/$1/

sed -i "s/set(CMAKE_PROJECT_NAME placeholder/set(CMAKE_PROJECT_NAME $1/" $HOME/Dev/$1/CMakeLists.txt

git init $HOME/Dev/$1/
cat > $HOME/Dev/$1/.gitignore << EOL
build/
compile_commands.json
.vscode/
EOL

touch $HOME/Dev/$1/src/main.cpp
cat > $HOME/Dev/$1/src/main.cpp << EOL 

int main(int argc, const char* argv())
{

    return 0;
}
EOL

if (( "$#" -eq 3 ));
then
    cmake -G "$2 - $3" -S $HOME/Dev/$1 -B $HOME/Dev/$1/build/ -DCMAKE_EXPORT_COMPILE_COMMANDS=1
else
    cmake -G "$2" -S $HOME/Dev/$1 -B $HOME/Dev/$1/build/ -DCMAKE_EXPORT_COMPILE_COMMANDS=1
fi
ln -s $HOME/Dev/$1/build/compile_commands.json $HOME/Dev/$1/

```

architecture – Example Project to learn Software Engineering?

I want to learn how control the complexity of a large project. Martin Fowler’s Refactoring and P of EAA teach what I want to learn, but reading textbooks can be incredibly slow. I’d like to learn by having an example project that I can get my head around (by stepping through with a debugger, or navigating with an IDE) and then imitate.

Is there anything like Minix (minimalist OS designed for teaching) and Operating System Design and Implementation (accompanying book), but teaches Software Engineering instead.

I have though about SerenityOS. Being able to watch Andreas Kling’s youtube screencasts would be an advantage.

How to prevent icloud from downloading (storing) certain files in Xcode project in cloud?

I have iCloud backup enabled on my desktop. On my desktop I keep my Xcode projects. Every hour or so iCloud will store files, inside of a pods folder within an Xcode project I’m working on, in the cloud. This is very tedious as I then have to click on each one by one to re-download.

How can I prevent cloud from downloading my files in this manner, for this specific Xcode project?

I have tried disabling cloud for desktop but this results in me losing all my desktop folders/files, so I could rather not go this rout.

php 7.3 – Magento 1.9 : Fatal error after cloning project

Am cloning project to my htdocs folder.When iam opening project with localhost am getting below error.
php version amusing is 7.3.4

      Fatal error: Uncaught ArgumentCountError: Too few arguments to function Varien_Db_Adapter_Pdo_Mysql::_debugWriteToServerDetailFile(), 0 passed in C:xampphtdocsadcwebshopappcodelocalVarienDbAdapterPdoMysql.php on line 334 and exactly 1 expected in C:xampphtdocsadcwebshopappcodelocalVarienDbAdapterPdoMysql.php:3965 Stack trace: #0 C:xampphtdocsadcwebshopappcodelocalVarienDbAdapterPdoMysql.php(334): Varien_Db_Adapter_Pdo_Mysql->_debugWriteToServerDetailFile() #1 C:xampphtdocsadcwebshoplibZendDbAdapterAbstract.php(459): Varien_Db_Adapter_Pdo_Mysql->_connect() #2 C:xampphtdocsadcwebshoplibZendDbAdapterPdoAbstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array) #3 C:xampphtdocsadcwebshopappcodelocalVarienDbAdapterPdoMysql.php(441): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array) #4 C:xampphtdocsadcwebshopappcodecoreMageCoreModelResource.php(169): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8') #5 C:xampphtdocsadcwebsho in C:xampphtdocsadcwebshopappcodelocalVarienDbAdapterPdoMysql.php on line 3965

why this error occurs.Can anyone please.

wikipedia – Transclude a page from another language or another project

In Wikipedia, to copy the content of another page (called “transclusion”), you just need to add {{:SourcePageName}} in the destination page.

Is it possible to transclude a page from:

  • Another language ? something like {{:fr:SamePageInFrench}}
  • Another sister project (WikiBooks, WikiVersity) ? something like {{:wikibooks:PageInWikiBooks}}

Transclusion documentation: here

c# – Basic Beginner Unity Project with a bouncing corona

At first I wasn’t really proud of this one, but then I decided that I need to know what’s so bad about it? Why does it feel unsatisfying? How can I do it better?

So yeah here’s a unity project that does the following:

Spawns a maximum of 3 wall bouncing corona balls where the player clicks, which when they collide with each other they heal some health, and if with a wall (screen edges) they loose health. I also tried to do so their alpha value changes in proportion with its health (the closer it is to the death, the more transparent it is). There is a text showing how many time the corona balls bounced of the walls. One last thing, it plays a cough sound on collision.

Here are the scripts I have and which gameObject are they attached to:

Basic script I found online, I remember reading and understanding it before writing on my own, can’t recall if I modified it though. Its attached to the camera obviously:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

// script to instantiate edge colliders at start
public class edges : MonoBehaviour
{
    public PhysicsMaterial2D bouncy;
    void Awake()
    {
        AddCollider();
    }

    void AddCollider()
    {
        if (Camera.main == null) { Debug.LogError("Camera.main not found, failed to create edge colliders"); return; }

        var cam = Camera.main;
        if (!cam.orthographic) { Debug.LogError("Camera.main is not Orthographic, failed to create edge colliders"); return; }

        var bottomLeft = (Vector2)cam.ScreenToWorldPoint(new Vector3(0, 0, cam.nearClipPlane));
        var topLeft = (Vector2)cam.ScreenToWorldPoint(new Vector3(0, cam.pixelHeight, cam.nearClipPlane));
        var topRight = (Vector2)cam.ScreenToWorldPoint(new Vector3(cam.pixelWidth, cam.pixelHeight, cam.nearClipPlane));
        var bottomRight = (Vector2)cam.ScreenToWorldPoint(new Vector3(cam.pixelWidth, 0, cam.nearClipPlane));

        // add or use existing EdgeCollider2D
        var edge = GetComponent<EdgeCollider2D>() == null ? gameObject.AddComponent<EdgeCollider2D>() : GetComponent<EdgeCollider2D>();

        var edgePoints = new() { bottomLeft, topLeft, topRight, bottomRight, bottomLeft };
        edge.points = edgePoints;
        edge.sharedMaterial = bouncy;
    }
}

Script attached to HUD (canvas), it just has a AddBounce method to display bounce count, would be surprised if I screwed even this:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

// Script for HUD management, and stuf...

public class HUD : MonoBehaviour
{
    // declaring them fields
    (SerializeField)
    Text bounceText;
    int bounces;

    // Start is called before the first frame update
    void Start()
    {
        // assign number of bounces to text
        bounceText.text = bounces.ToString();

    }

    // Method to add bounces
    public void AddBounce()
    {
        bounces += 1;
        bounceText.text = bounces.ToString();
    }
}

This is the spawner attached to the camera that detects players clicks so it can spawn coronas as long as there aren’t 3 or more already:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class coronaSpawner : MonoBehaviour
{
    // declaring fields
    (SerializeField)
    GameObject prefabCorona;

    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetButtonDown("Fire1"))
        {
            if (GameObject.FindGameObjectsWithTag("corona").Length < 3)
            {
                // gets mouse location and convert it to world position
                Vector3 mouseLocation = Input.mousePosition;
                Vector3 worldPosition = Camera.main.ScreenToWorldPoint(mouseLocation);
                worldPosition.z = 2f;

                // spawns a corona in mouse location
                Instantiate(prefabCorona, worldPosition, Quaternion.identity);
            }
        }
    }
}

And finally, here’s what I hate (I think?), a blunder of horribly declared fields that feel that are too much already, here’s the script attached to the coronaPrefab which traces its health, alphaValue, X and Y values for impulse force and everything else you’ll have to figure out reading it:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class bouncer : MonoBehaviour
{
    //declaring variables
    (SerializeField)
    int health = 100;
    (SerializeField)
    int minX = 6;
    (SerializeField)
    int maxX = 9;
    (SerializeField)
    int minY = 4;
    (SerializeField)
    int maxY = 20;
    (SerializeField)
    int fragility = 10;
    float fullHealth;
    float alphaValue;
    HUD hud;
    AudioSource audioSource;

    // Start is called before the first frame update
    void Start()
    {
        // assigning fields
        audioSource = GetComponent<AudioSource>();
        fullHealth = health;

        // calculates right alpha value for the sprite to dissapear at death
        alphaValue = (float)1 / (health / fragility);

        // taking RigidBody2D and adding random impulse force
        Rigidbody2D rb2d = GetComponent<Rigidbody2D>();
        rb2d.AddForce(new Vector2(Random.Range(minX,maxX), Random.Range(minY,maxY)), ForceMode2D.Impulse);

        // taking HUD component
        hud = GameObject.FindGameObjectWithTag("HUD").GetComponent<HUD>();

    }

    // called when the Object's colider enters a collision with another collider
    void OnCollisionEnter2D(Collision2D col)
    {
        // calls the Change method
        audioSource.Play();
        Change(col);
    }

    // gets alpha value, changes it and assigns it back. Also reduces or adds health
    private void Change(Collision2D col)
    {
        // gets color componenent
        Color color = GetComponent<SpriteRenderer>().color;

        // adds or reduce values depending on choice
        if (col.gameObject.tag == "MainCamera")
        {
            hud.AddBounce();
            health -= fragility;
            if (health <= 0)
            {
                Destroy(gameObject);
            }
        }
        else if (col.gameObject.tag == "corona")
        {
            health += fragility * 2;
            Range(health, 0, fullHealth * 1.5);
        }

        // assigns color component back with modified alpha value
        color.a = health / fullHealth;
        GetComponent<SpriteRenderer>().color = color;
    }

    // makes sure value is within a reasonable range
    public static double Range(int value, double minimum, double maximum)
    {
        if (value < minimum) { return minimum; }
        if (value > maximum) { return maximum; }
        return value;
    }
}

So yeah, this is one of my training Unity Projects, I’ll be forever grateful to you if you give it a look and tell me what I could’ve done better, and thank you in advance!

Also I would like a smoll tip, when I get feedback on a script(s?), should I go back and change what I can? Should I try to test all the new features and tricks I learned in a different project? Or should I just read, understand and memorize? Again, thank you all so much that for your help and for taking the time and effort to share your experiences so us beginners can learn! ^^

Arduino Security Project – Super User

Hello to everyone this has not done yet I am working on it but when I tried to apply options, I could not move forward since for ex: if you choose option 1 LCD shows “ENTER PASS A” it is fine then when I code the password such as “1111” just one 1 is written the other “111” is not written. In short, I really need how to apply options in Arduino by the way I drew the circuit on proteus

THANKS FOR ANSWERS…

LiquidCrystal lcd(13,12,11,10,9,8);

Servo myservo; // create servo object to control a servo
Servo myservo2;
// twelve servo objects can be created on most boards

String option;
int tryy = 0;
int pos = 0; // variable to store the servo position
const byte ROWS = 4;
const byte COLS = 3;
char keys(ROWS)(COLS) = {{‘1′,’2′,’3’},{‘4′,’5′,’6’},{‘7′,’8′,’9’},{‘*’,’0′,’#’}};
byte rowPins(ROWS) = {4,3,2,1};
byte colPins(COLS) = {7,6,5};

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

String str;
String str2;
String bait = “9999”;
String masLock = “1234”;

void setup(){
lcd.begin(16,2);
myservo.attach(A1); // attaches the servo on pin 9 to the servo object
myservo2.attach(A2);
lcd.print(“Enter Option”);
pinMode(A0, OUTPUT);

}

void loop(){

  lcd.setCursor(0,1);
  char key = keypad.getKey();
  option = String(key);
      if(key){
          lcd.print(key);            
           }


           if(option == "1") {

            lcd.clear();
            lcd.print("ENTER PASS A");
            lcd.setCursor(0,1);

            key = keypad.getKey();

             if(key){
                lcd.print('*');     
                str2 = key;
                str = str + str2;       
              }




     if(str == bait) {
      digitalWrite(A0, HIGH);
      delay(500);
      digitalWrite(A0, LOW);
      delay(500);

      }      

     if(str == "1111"){

      for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees

         myservo.write(pos);              // tell servo to go to position in variable 'pos'
         delay(15);          // waits 15ms for the servo to reach the position               
      }

     for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
        myservo.write(pos);              // tell servo to go to position in variable 'pos'
        delay(15);     // waits 15ms for the servo to reach the position
      }
     } else {
      tryy = tryy + 1;

      if( str.length() == 4){
      lcd.print("Wrong Password");  
      } 
      }
           }





       if( option == "2") {
       lcd.print(" " );
       lcd.setCursor(0,1);
       lcd.print("ENTER PASS B");
       char key = keypad.getKey();
       str2 = key;
       str = str + str2;
      if(key){
          lcd.print('*');            
           }
     if(str == "2222"){

      for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
                      // in steps of 1 degree
         myservo2.write(pos);              // tell servo to go to position in variable 'pos'
         delay(15);          // waits 15ms for the servo to reach the position               
      }

     for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
        myservo2.write(pos);              // tell servo to go to position in variable 'pos'
        delay(15);     // waits 15ms for the servo to reach the position
      }
     }else {
      tryy = tryy + 1;
      if( str.length() == 4){
      lcd.print("Wrong Password");  
      } 
      }

}

}

The World’s First 100% Decentralized Ethereum Blockchain Matrix Project – Cryptocurrencies Corner



Screenshot-2.png



FORSAGE





Earn Etherium +3176 Joined in the Last 24hours the World’s First 100% Decentralized Ethereum Blockchain Matrix Project





forsagelogo.jpg


How Easy is it to Earn Ethereum Through Forsage 
With the cryptocurrency market booming, the number of people joining the blockchain revolution seems to be increasing every day. Though this might be so that they can get the return on their investments on cryptocurrency and not for the groundbreaking technology that blockchain has to offer, the cryptocurrency world is trying almost everything to get more and more people interested in its agenda. 

With regard to this, many companies have resorted to incentivizing tasks and promotional activities to give their consumers a fraction of a specific cryptocurrency. Ethereum is the second most popular and lucrative cryptocurrency in the world right now; which is potentially predicted to surpass Bitcoin someday. 

The main idea behind blockchain is to set up a decentralized network that would need a large number of users. Nevertheless, Ethereum has joined forces with many online incentive programs to give a little taste of their cryptocurrency to the users who are still having difficulties establishing themselves in the crypto market. 
Forsage 
Unlike many other incentive programs, Forsage is based on a Smart Contract Crypto earnings structure. There are no time limits, incentive caps, or any sort of time-sensitive pressure related to this program. What’s better is that you do not need any prior knowledge about blockchain or cryptocurrency! 

This program enables you to earn long term residual income by simply providing a referral to 3 or more friends, and asking them to follow the same process. In a way, this is a type of marketing program that is associated with Ethereum. Since it is based on the ‘Smart Contract’ structure, it cannot exploit any user. 
What is a Smart Contract? 
Smart Contract is a developed blockchain technology that involves an automated digital contract of sorts, which is unbreakable and unchangeable. One of the best features of this automated blockchain is that even if the host i.e. Forsage closes its website or shuts you out of it, the blockchain will still register you as an active participant and will constantly reward you for the efforts you put in. 

So, the chances of you being scammed are negligible. Also, this program was intentionally inclined towards a marketing and network marketing niche. This gives an advantage to people who have prior experience in marketing. Because of its overall technology, scams and fraud are practically non-existent. 
How do I Join? 
To join Forsage, you would initially need to pay a one-time payment of 0.055 Ethereum, which is less than $10.00 USD for registration. Once you set up an account and start referring to friends and the cycle continues to expand, you will see the funds in your crypto wallet increase. 

Forsage works with one of two major wallets. This again depends on which medium you use it on. Either Trust works best for mobile, tablets, and laptops and Metamask works best for computers and rigs. 
Conclusion 
Forsage is indeed the new wave of incentivized network marketing. The Smart Contract structure makes it scam-free, giving crypto network marketing a revolutionary and much-needed change. Being a blockchain entity, privacy and security are at the top priority of Forsage and the inexpensive initial fee is literally and figuratively a small price to pay. So, what are you waiting for? Go get that Ethereum! 

Join Forsage Today https://forsage.io/i/971neo


screencapture-forsage-io-i-971neo-2020-0


 

DreamProxies - Cheapest USA Elite Private Proxies 100 Private Proxies 200 Private Proxies 400 Private Proxies 1000 Private Proxies 2000 Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive Proxies-free.com New Proxy Lists Every Day Proxies123