Blog

  • Parallel-shapes-plotter

    A plotter that is using fork to create parallel workers that communicate with the main proccess through named pipes synched with the use of poll function in order to finally plot multiple shapes using gnu plot.
    
    Readme
    
    Thanasis Filippidis sdi1400215@di.uoa.gr
    
    ## Compile
    
    To compile run `make`
    
    ## Run
    
    Command line options:
     * -i binary file: filename of input file 
     * -w workers: integer number of workers
     * -d directory: directory name to save files
    
    Invocation:
    
        ./shapes -i binary file -w workers -d directory
        
        in all possible combinations 
    
    
    ## Implementation Notes
    
    
    ### Shapes
    
    For the shapes implementation, the CLI I get the whole line with input string function
    and then I break it with strtok and save it in an array which contains the shapes and
    the arguments and then I break every set of arguments in another array so that I can
    get the arguments one by one. I used the function execlp for the workers. For the named 
    pipes I followed the notes provided by the instructor step by step and to read and write
    from the pipes and sync them I used the poll function. At the end of every CLI I wait 
    for all the handlers to finish and then I create the gnuplot, following the given
    instructions. The CLI input ends when I give the command "end;".
    
    ### Utilities
    
    All the utilies use the equations of the links given.
    

    Visit original content creator repository
    https://github.com/tflpd/Parallel-shapes-plotter

  • mobsf-cli

    mobsf-cli

    mobsf-cli is a wrapper for the Mobile Security Framework (MobSF) REST-API. Created especially for Continuous
    Integration (CI) / Continuous Delivery (CD) stages. You can use only use one command to upload a file, auto start scan,
    save reports, check scores.

    Mobile Security Framework (MobSF) is an automated,
    all-in-one mobile application (Android/iOS/Windows) pen-testing, malware analysis and security assessment framework
    capable of performing static and dynamic analysis.

    Releases

    Go to releases page and fetch latest release.

    Install (linux x86_64)

    wget https://github.com/wojciech-zurek/mobsf-cli/releases/download/v0.1.0/mobsf-cli-x86_64-unknown-linux-gnu.tar.gz 
    tar -xvf mobsf-cli-x86_64-unknown-linux-gnu.tar.gz
    sudo mv mobsf-cli /usr/local/bin/mobsf-cli
    sudo chmod +x /usr/local/bin/mobsf-cli

    Manual installation

    git clone git@github.com:wojciech-zurek/mobsf-cli.git
    cd mobsf-cli
    cargo build --release
    sudo cp target/release/mobsf-cli /usr/local/bin/mobsf-cli
    mobsf-cli --help

    Usage

    mobsf-cli 0.1.0
    Wojciech Zurek <mail@wojciechzurek.eu>
    mobsf-cli app
    
    USAGE:
        mobsf-cli [OPTIONS] <SUBCOMMAND>
    
    OPTIONS:
        -a <api_key>        Api key/token (overrides MOBSF_API_KEY env)
        -h, --help          Print help information
        -s <server>         Server, example: http://localhost:8000 (overrides MOBSF_SERVER env)
        -V, --version       Print version information
    
    SUBCOMMANDS:
        ci        For CI/CD stages. Upload a file, auto start scan, save reports, check scores.
        delete    Delete scan.
        help      Print this message or the help of the given subcommand(s)
        play      Upload a file and auto start scan.
        report    Get report.
        scan      Scan a file.
        scans     Display recent scans.
        source    View source files.
        upload    Upload a file.

    Example usage

    # Upload a file to MobSF server
    mobsf-cli upload path/to/example.apk
    
    # Scan a file
    mobsf-cli scan apk example.apk <hash>
    
    # Upload a file and auto start scan
    mobsf-cli play path/to/example.apk
    
    # Fetch scan result (report)
    mobsf-cli report pdf <hash>
    mobsf-cli report json <hash>
    
    # Display recent scans
    mobsf-cli scans
    
    # Delete scan result
    mobsf-cli delete <hash>

    CI/CD usage

    mobsf-cli ci combines:

    • upload a file,
    • start scan,
    • generate reports in pdf and json format,
    • check scan scores (cvss, security score, trackers) and rise an error if scores are wrong

    # help
    mobsf-cli ci --help
    
    mobsf-cli-ci 
    For CI/CD stages. Upload a file, auto start scan, save reports, check scores.
    
    USAGE:
        mobsf-cli ci [OPTIONS] -p <path_to_save> <file_path>
    
    ARGS:
        <file_path>    
    
    OPTIONS:
        -a <api_key>             Api key/token (overrides MOBSF_API_KEY env)
        -c <cvss>                Above this score rise a cvss error. 0.0-10.0 [default: 3.9]
        -h, --help               Print help information
        -p <path_to_save>        Path to directory to save reports (pdf and json).
        -r                       Rescan a file
        -s <server>              Server, example: http://localhost:8000 (overrides MOBSF_SERVER env)
        -t <trackers>            Above this score rise a trackers error. 0-407 [default: 0]
        -u <security>            Below this score rise a security error. 0-100 [default: 71]
    
    

    mobsf-cli ci path/to/example.apk -p path/to/save/reports -c 5.5 -u 48 -t 2
    ...
    Validating scan scores...
    Error: CVSS score [6.6] is to high. Max: 5.5!

    Server and api key

    You can set server and api key:

    • as command options (higher order),
      • -a <api_key>
      • -s <server>
    • as environment variables (lower order)

    Environment variables

    You can set env for api and server config:

    • MOBSF_API_KEY – for api key,
    • MOBSF_SERVER – for server
    MOBSF_API_KEY="ed...c4" MOBSF_SERVER="https://su...com:8000" mobsf-cli scans

    Visit original content creator repository
    https://github.com/wojciech-zurek/mobsf-cli

  • ecommerce

    Site e-commerce en PHP procédural

    Il s’agit d’un exercice PHP développé dans le cadre de mon poste de formateur en développement web. L’objectif est que les étudiants pratiquent le PHP procédural et se familiarisent ainsi avec les fonctionnalités de base du langage appliquées au web.

    Ce projet connaît plusieurs versions qui évoluent en difficulté avec la montée en compétence des étudiants pendant leur formation et se réalise ainsi sur plusieurs semaines. Cependant il n’intègre pas encore de modèle MVC.

    Mis à part l’apprentissage du PHP ce projet introduit également la notion de framework front avec Bootstrap qui leur permet de maquetter rapidement une application en utilisant du code produit par quelqu’un d’autre.

    Trois versions sont disponibles, chacune avec un readme et ses propres consignes :

    • Une version simple aux fonctionnalités basiques donnée peu après le démarrage de PHP en formation. Elle permet de comprendre les fonctionnalités fondamentales du langage sur un site web.
    • Une version améliorée qui étend la première et intègre des fonctionnalités plus avancées. Elle permet au étudiants d’améliorer leur pratique de la programmation PHP, de l’algorithmie et de s’interroger sur la maintenabilité et l’organisation de leur code.
    • Une version finale intégrant une base de données MySQL qui leur permet de travailler la gestion de données dans le cadre d’une application PHP.

    Visit original content creator repository
    https://github.com/thomgo/ecommerce

  • LGAimers_B2B_data_

    LGAimers_B2B_data_

    프로젝트 목적 및 설명

    기업 간 영업 전환 전략 데이터 분석입니다. 이 프로젝트에서의 제 역할은 데이터 전처리(결측치 대체, 이상치 제거)입니다. 기업 영업 실태에 대한 데이터의 Attribute을 기준으로 평균, 중앙값, 최빈값, 중앙값으로 결측치를 대체하였습니다. 그리고 이상치를 boxplot이라는 시각화 그래프를 이용하여서 확인하였습니다. 제 1분위수 이하인 표본과 제 3사분위수 이상의 범위를 가진 데이터를 이상치로 간주하고 제거하는 역할을 하였습니다.

    프로젝트 과정

    1. 데이터를 통해서 EDA 기법을 이용하여서 여러 그래프들을 데이터로 시각화하였습니다.
      image
    2. 서로 다른 데이터들의 attribute 요소들을 연관-독립관계에 대해서 측정을 하였습니다. image
    3. 종속변수와 연관되는 요소를 제외한 서로 관련이 없는 attribute 요소들을 제거 한 다음, 주어진 attribute의 정의의 특성을 이용하여서 attribute을 새로 생성하거나, 대체를 하였습니다.
    4. 대체한 attribute인 경우 데이터 타입에 따라서 결측치를 대체합니다.
      • attribute의 값이 문자열이라면, 문자열에 대한 최빈값(문자열)을 이용하여서 대체합니다.
      • attribute의 값이 숫자라면 숫자에 대한 표준편차의 상황에 따라서 평균, 중앙값으로 대체합니다.
        • 만약 표준편차의 값이 크면 각 표본의 중앙값으로 대체합니다.
        • 표준편차의 값이 작으면 각 표본의 평균으로 대체합니다.
    5. 결측치를 대체한 후에는 분류모델인 decisiontree 모델을 이용하여서 classifcation으로 학습 및 예측합니다.
    6. 그 결과 결과값에 대해서 평가하며, label로 정합니다.

    프로젝트 결과 with Confusion matrix

    • Confusion Matrix
    • 정확도(Accuracy)
    • 정밀도(Precision)
    • 재현율(Recall)
    • F1-score
      결과 image
      image
    Visit original content creator repository https://github.com/H-Software224/LGAimers_B2B_data_
  • react-ant-input

    react-ant-input

    Ant input.

    version license size download

    installation

    npm install -S @jswork/react-ant-input

    properties

    Name Type Required Default Description
    className string false The extended className for component.
    value any false Default value.
    shouldTrim bool false false If the value should be trim before returned.
    autoComplete string false ‘off’ Should autoComplete on.
    onChange func false noop The change handler.

    usage

    1. import css
    @import "~@jswork/react-ant-input/dist/style.css";
    
    // or use sass
    @import "~@jswork/react-ant-input/dist/style.scss";
    
    // customize your styles:
    $react-ant-input-options: ()
    1. import js
    import ReactDemokit from '@jswork/react-demokit';
    import React from 'react';
    import ReactDOM from 'react-dom';
    import ReactAntInput from '@jswork/react-ant-input';
    import './assets/style.scss';
    
    class App extends React.Component {
      state = {
        value: '',
        value2: ''
      };
    
      handleChange = (inEvent) => {
        this.setState({
          [inEvent.target.name]: inEvent.target.value
        });
      };
    
      render() {
        const { value, value2 } = this.state;
        return (
          <ReactDemokit
            className="p-3 app-container"
            url="https://github.com/afeiship/react-ant-input">
            <article className="message is-info">
              <div className="message-header">Preview:</div>
              <div className="message-body">
                <ReactAntInput
                  name="value"
                  value={value}
                  placeholder="Please input text1..."
                  className="mb-2"
                  onChange={this.handleChange}
                />
    
                <ReactAntInput
                  shouldTrim
                  name="value2"
                  placeholder="Please input text2..."
                  value={value2}
                  onChange={this.handleChange}
                />
              </div>
            </article>
    
            <article className="message">
              <div className="message-header">Status changed:</div>
              <div className="message-body">
                {JSON.stringify(this.state, null, 2)}
              </div>
            </article>
          </ReactDemokit>
        );
      }
    }
    
    ReactDOM.render(<App />, document.getElementById('app'));

    documentation

    license

    Code released under the MIT license.

    Visit original content creator repository https://github.com/afeiship/react-ant-input
  • black

    Black

    A software rasterizer for Rust

    Overview

    Black is a small software rasterizer for Rust. It allows one to create simple 3D visualizations that are run entirely on the CPU. It provides a fairly low level graphics API specifically geared towards triangle rasterization and allows for custom vertex and fragment shaders to be implemented with Rust traits.

    This project was primarily written as an exercise in Rust. It is offered to anyone who finds it of use.

    Building

    This project was built against rustc 1.39.0-nightly (6ef275e6c 2019-09-24). The crate being used to present the window is the mini-fb crate. If building on Windows, you will need Windows C++ build tools. Once installed, just run the following from the project root to start the example project.

    $ cargo run --release

    Example

    The following code renders single RGB triangle. Note that the Varying type must implement Interpolate which performs perspective correct per fragment interpolation across the triangle.

    Note the implementation of TargetBuffer which is used to receive fragment shader output. If this code was output to a window, or other output device, this code will result in the image below.

    Refer to the example project in this repository for an implementation of TargetBuffer. It is leveraging the most excellent mini_fb crate. This should work on Windows, Mac and Linux.

    #[macro_use] extern crate black;
    
    use black::{ TargetBuffer, DepthBuffer, Raster, Interpolate, VertexProgram, FragmentProgram };
    use black::{ Vec4, Vec3, Mat4 };
    
    // ----------------------------------------------
    // Uniform, Vertex and Varying types
    // ----------------------------------------------
    
    struct Uniform {
        projection: Mat4,
        matrix:     Mat4,
        view:       Mat4
    }
    struct Vertex {
        position: Vec4,
        color:    Vec3
    }
    #[derive(Interpolate)]
    struct Varying {
        position: Vec4,
        color:    Vec3
    }
    
    // ----------------------------------------------
    // VertexProgram
    // ----------------------------------------------
    
    struct VertexShader; 
    impl VertexProgram for VertexShader {
        type Uniform = Uniform;
        type Varying = Varying;
        type Vertex  = Vertex;
    
        fn main(&self, uniform: &Uniform, vertex: &Vertex, varying: &mut Varying) -> Vec4 {
            // assign varying to be interpolated across this primitive.
            varying.position = vertex.position;
            varying.color    = vertex.color
            
            // transform the vertex (analogous to gl_Position transform)
            input.position * (uniform.matrix * (uniform.view * uniform.projection))
        }
    }
    
    // -----------------------------------------
    // FragmentProgram
    // -----------------------------------------
    
    struct FragmentShader; 
    impl FragmentProgram for FragmentShader {
        type Uniform = Uniform;
        type Varying = Varying;
    
        fn main(&self, uniform: &Uniform, varying: &Varying) -> Vec4 {
            Vec4::new(
                varying.color.x, 
                varying.color.y, 
                varying.color.z, 
                1.0)
        }
    }
    
    // -----------------------------------------
    // TargetBuffer
    // -----------------------------------------
    
    struct ColorBuffer; 
    impl TargetBuffer for ColorBuffer {
        fn width (&self) -> usize { 256 }
        fn height(&self) -> usize { 256 }
        fn set(&mut self, x: usize, y: usize, color: Vec4) {
            // Invoked per fragment. Take vec4 output from fragment
            // shader and write to output device or other buffer.
        }
    }
    
    fn main() {
        
        // Color and Depth buffers.
        let mut color_buffer = ColorBuffer;
        let mut depth_buffer = DepthBuffer::new(256, 256);
    
        // Sets up the uniforms for this draw. Works
        // in a similar fashion to GLSL uniforms.
        let uniform = Uniform {
            projection: Mat4::perspective_fov(90.0, 1.0, 0.1, 1000.0),
            matrix:     Mat4::identity(),
            view:       Mat4::look_at(
                &Vec3::new(0.0, 0.0, 3.0),
                &Vec3::new(0.0, 0.0, 0.0),
                &Vec3::new(0.0, 1.0, 0.0),
            ),
        }
    
        // Rasterizes this triangle into the given
        // OutputBuffer. Depth values stored in the
        // given depth_buffer.
        Raster::triangle(
            &VertexShader,
            &FragmentShader,
            &mut depth_buffer,
            &mut color_buffer,
            &uniform,
            &Vertex { 
                position: Vec4::new(0.0, 1.0, 0.0, 1.0),
                color:    Vec3::new(1.0, 0.0, 0.0),
            },
            &Vertex {
                position: Vec4::new(-1.0, -1.0, 0.0, 1.0),
                color:    Vec3::new(0.0, 1.0, 0.0),
            },
            &Vertex { 
                position: Vec4::new(1.0, -1.0, 0.0, 1.0),
                color:    Vec3::new(0.0, 0.0, 1.0),
            } 
        );
    }
    Visit original content creator repository https://github.com/sinclairzx81/black
  • Urdu-Text-Preprocessing

    Hi, I’m MD Ryhan! 👋

    Urdu Text Preprocesing Task

    Urdu text preprocessing is an important step in natural language processing that involves cleaning, normalizing, and transforming raw Urdu text data into a form that can be analyzed by machines. In Python, there are various libraries and tools available for Urdu text preprocessing that can be used to perform tasks such as tokenization, lemmatization, stop word removal, normalization, and more.

    Here is a brief overview of some of the common Urdu text preprocessing tasks that can be performed in Python:

    • Tokenization: Tokenization involves splitting a piece of text into individual words or tokens. This is an important step in text analysis because it provides a basic unit of analysis that can be used to count occurrences of words, perform sentiment analysis, and more. Urdu text can be tokenized using libraries such as Urduhack, spaCy, and NLTK.

    • Urdu Stopword removal: Removing words that occur frequently in a language and are unlikely to carry any useful information for text classification.

    • Urdu Text Lemmatization: Lemmatization can be an important step in Urdu text preprocessing, as it can help to reduce the number of unique words in a corpus and improve the accuracy of natural language processing models.

    • Hashtag, HTML tag, mention, punctuation, number, and URL removal: Removing all the hashtags, HTML tags, mentions, punctuations, numbers, and URLs from the text.

    • Part-of-speech tagging:: Part-of-speech (POS) tagging involves identifying the grammatical parts of speech of each word in a sentence, such as nouns, verbs, and adjectives. POS tagging can be performed using libraries such as Urduhack,stanza and spaCy.

    • Count POS Tag: The output of the ud_pos_tag() function is a list of tuples, where each tuple contains a word and its corresponding POS tag. We then use the Counter() function from the collections library to count the frequency of each POS tag in the text.

    Overall, Urdu text preprocessing in Python involves a combination of these tasks to transform raw text data into a form that can be analyzed by natural language processing models. The choice of preprocessing tasks will depend on the specific NLP task at hand, as well as the quality and complexity of the input text data.

    🚀 About Me

    I’m a data scientist with a specialization in Natural Language Processing (NLP). I have experience working on NLP projects and conducting research in this field.

    As an NLP researcher, I have expertise in a variety of NLP techniques such as text classification, sentiment analysis, named entity recognition, and text summarization.

    🔗 Links

    portfolio

    linkedin

    Visit original content creator repository https://github.com/MD-Ryhan/Urdu-Text-Preprocessing
  • invaders

    Invader’s Game – Space Invaders Game 🚀

    This repository contains a space invaders game I created as a fun side project and portfolio piece. The game is built with TypeScript, CSS, and HTML, and uses the PIXI.js framework for displaying graphics. The aesthetic is reminiscent of a 1980’s handheld video game with Vacuum Fluorescent Display (VFD) technology.

    Check out a live demo of the game on my website: justin-lloyd.com. Scroll to the bottom and look to the right to find the game.

    Game Screenshot 📸

    Game Screenshot

    Features 🎮

    The game includes the following features:

    • Retro-styled invaders and spacecrafts 🚀.
    • VFD-like glow effects ✨.
    • Scoreboard for tracking high scores 📝.
    • Multiple difficulty settings 🎚️.

    Codebase Overview 👨‍💻

    The code is organized into several TypeScript modules, each of which handles a specific aspect of the game:

    • InvadersGame.ts: The main game module that manages the game state and initializes game objects.
    • GameObject.ts: A class for generic game objects with properties like position and speed.
    • Invader.ts, DeathRay.ts, Missile.ts, MissileBase.ts: Specific game objects representing entities in the game.
    • DifficultySetting.ts, Scoreboard.ts, InvaderLivesIndicator.ts: UI components for displaying game status.
    • Playfield.ts, PlayfieldGameWorld.ts: Classes managing the game area and the world in which the game occurs.
    • InvaderSpawner.ts, BonusController.ts, MissileBaseController.ts: Controllers for spawning and managing game objects.

    Installation 🛠️

    To run the game locally:

    1. Clone the repository:
    git clone https://github.com/username/InvadersGame.git
    
    2. Install the dependencies:
    ```bash
    npm install
    
    3. Start the development server:
    ```bash
    npm run start
    
    The game will be available at http://localhost:8080.
    
    ## License ⚖️
    
    This project is Copyright (c) 2023 Justin Lloyd. All rights reserved.
    Visit original content creator repository https://github.com/JustinLloyd/invaders
  • diplom-1

    Visit original content creator repository
    https://github.com/iskender-jumagulov/diplom-1

  • JSONlib

    JSONlib

    A JSON de- and encoder for SuperCollider

    The JSON implementation of the SuperCollider standard library lacks certain features such as

    • a JSON encoder (the conversion of an dictionary to a JSON string)
    • parsing JSON values into their respective type (.parseJSON converts everything to a string)

    which this Quark implements, building on top of the existing implementation.

    There also exists a json Quark which also adds a wrapper for sccode.org but lacks a recursive encoding of objects.
    The goal of JSONlib is to simply provide a full implementation of the JSON standard in sclang and nothing beyond it.

    Quickstart

    Installation

    // install the quark
    Quarks.install("https://github.com/musikinformatik/JSONlib.git");
    
    // restart the interpreter so the new classes are available
    thisProcess.recompile;
    
    // open documention
    HelpBrowser.openHelpFor("Classes/JSONlib");

    Basic usage

    Parse a JSON

    Let’s say we have a JSON with an integer as a value

    {
        "hello": 42
    }

    which we want to parse in sclang.

    // use Symbol instead of String to get rid of escaping quotation marks
    j = '{"hello": 42}';
    
    // turn this into an Event
    d = JSONlib.convertToSC(j);
    // -> ( 'hello': 42 )
    
    // an integer gets parsed as an integer
    d[\hello].class
    // -> Integer
    
    // compare to the built-in method of sclang
    // it uses a Dictionary instead of an Event
    d = j.parseJSON()
    // -> Dictionary[ (hello -> 42) ]
    
    // but 42 is a string here
    d["hello"].class
    // -> String

    Encode an Event as JSON

    // create an event
    e = (\foo: "bar", \baz: (\nested: true));
    
    e.asJSON
    // -> { "baz": { "nested": true }, "foo": "bar" }
    
    // or use the class JSONlib
    JSONlib.convertToJSON(e);
    // -> { "baz": { "nested": true }, "foo": "bar" }

    Advanced usage is described in the SCdoc documentation.

    Development

    Make sure to run the tests via

    TestJSONlib.run;

    License

    GPL-2.0

    Visit original content creator repository
    https://github.com/musikinformatik/JSONlib