Updates from yalamber Toggle Comment Threads | Keyboard Shortcuts

  • yalamber 9:29 am on January 5, 2018 Permalink | Reply
    Tags:   

    Make sure you are not loading jQuery or any js script from google CDN if you are building a website for Chinese client.

     
  • yalamber 5:19 am on December 21, 2017 Permalink | Reply
    Tags:   

    Match Intersection with exact number of related nodes

    WITH ["Ram", "Sita", "Hari"] as names
    MATCH (u:User)-[:IS_PARTICIPANT]->(c:Conversation)
    WHERE u.name IN names
    WITH c, size(names) as inputCnt, count(DISTINCT u) as userCnt
    WHERE userCnt = inputCnt and size(()-[:IS_PARTICIPANT]->(c)) = inputCnt
    RETURN c
    
     
  • yalamber 10:54 am on September 1, 2017 Permalink | Reply  

    Finding path in neo4j among labels

    MATCH p=shortestPath((c:Candidate {_id: "5bd67592-1d3a-492a-9508-6c9c758dc40a"})-[:LOCATED_IN*..3]->(s:Province)) RETURN p LIMIT 25
     
  • yalamber 10:53 am on September 1, 2017 Permalink | Reply
    Tags:   

    Helpful for setting up docker on windows
    http://digitaldrummerj.me/docker-windows-mounting-directories/

     
  • yalamber 6:05 am on July 31, 2017 Permalink | Reply
    Tags: data mining   

    Really useful tool for data mining
    http://openrefine.org/

     
  • yalamber 8:50 am on July 30, 2017 Permalink | Reply
    Tags: ,   

    Get specific label nodes without relation to specific label

    MATCH (d:District) WHERE NOT ((d)-[:LOCATED_IN]->(:Province)) RETURN d
    
     
  • yalamber 1:18 pm on June 17, 2017 Permalink | Reply
    Tags: , ne04j   

    Delete all nodes and relations

    MATCH (n)
    DETACH DELETE n
    
     
  • yalamber 5:37 am on March 15, 2017 Permalink | Reply  

    Copy from directory’s subdirectory to parent 

    find . -mindepth 2 -type f -print -exec mv {} . \;

     
  • yalamber 7:15 am on March 12, 2017 Permalink | Reply
    Tags:   

    docker exec -it containerid bash

     
  • yalamber 5:43 am on March 3, 2017 Permalink | Reply
    Tags: AWS, Computer Vision, Face Recognition, Face Swap, , Node.js, Rekognition   

    Aws Rekognition and Face Swap 

    CSS rules to cover face with a boundary or faceswap

    var boundingBox = face.faceMatched.Face.BoundingBox;
    var faceDetail = face.faceMatched.FaceDetail;
    var cssRules = {
      top: 100 * boundingBox.Top + "%",
      left: 100 * boundingBox.Left + "%",
      height: 100 * boundingBox.Height + "%",
      width: 100 * boundingBox.Width + "%",
      transform: "rotateZ(" + faceDetail.Pose.Roll + "deg)",
      borderRadius: "12%",
      zIndex: 2,
      background: url(replacer.png) no-repeat;
      "background-size": "cover"
    };
    

    With node.js and imagemagick faceswap code

    async.reduce(faceData, gm().in('-page', '+0+0', mainImage.path), function(img, face, rcallback) {
      const boundingBox = face.faceMatched.Face.BoundingBox;
      const faceDetail = face.faceMatched.FaceDetail;
      const faceWidth = parseInt(boundingBox.Width * mainImage.width, 10) + 10;
      const faceHeight = parseInt(boundingBox.Height * mainImage.height, 10) + 10;
      const xy = `+${boundingBox.Left * mainImage.width}+${boundingBox.Top * mainImage.height}`;
      //create temp replacer image to overlay with
      gm('replacer-image.png')
      .resize(faceWidth.toString(), faceHeight.toString())
      .rotate('rgba(0,0,0,0)', faceDetail.Pose.Roll)
      .write('/tmp/path.png', (err) => {
        rcallback(err, img.in('-page', xy, '/tmp/path.png'));
      });
    }, function(err, result) {
      result.mosaic().write('./result.png', function (err) {
        if(err) console.log(err);
        else console.log('done');
      });
    });
    
     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel