Uncaught SyntaxError: Unexpected identifier

I’m an artist and i want to make a gallery like in this video. i don’t think that’s the only error so any additional information will be good.

I named the html: test.html

named the css: stylesheet.css

named the javascript: slideshow.js

html:

css:

*{padding: 0; margin: 0; box-sizing: border-box;}

gallery {

position:relative; 

width: 500px; height: 500px;

}

gallery img {

position: absolute; left: 0; top: 0; width: 100%; 

}

javascript:

$ (document).ready(function()

$ (“#gallery img:gt(0)”).hide(); <———–THIS IS THE ERROR

$ (“#gallery”).click(function()}

$ (“#gallery img:first”).fadeOut().next().fadeIn().appendTo(“#gallery”)

})

Bash script – user input ‘not an identifier:’

I am new to bash scripting but I am trying to write a script that creates a react app amongst other things. In the script I would like to pass a variable in the the npx create-react-app .. command. When I run my script I get an error saying ‘ReactAppInitialisation.sh:12: not an identifier: app-name’. Where am I going wrong? many thanks!

printf "$  {green}What would you like to call your new react app?\n"  read app-name  npx create-react-app "$  {app-name}" 

Entity unique identifier in domain driven design

I’m just learning DDD and a question raised in my mind about unique identifiers in an entity.

Consider this simple method that checks the uniqueness of an entity to prevent duplication:

    private bool IsDuplicate(BoardGame boardGame)     {         //It's either this         if (Games.Any(x => x.Id == boardGame.Id)) return true;          //Or this         if (Games.Any(x => x.Name == boardGame.Name && x.Price == boardGame.Price)) return true;          return false;     } 

The first method is very clean and readable. The problem is we usually don’t have the value of Id before the item is persisted somehow because it is handled by the ORM.

The second method is the way how an object is considered unique from a domain point of view. We can evaluate this uniqueness before persisting the object But the downside is it gets messy when an entity’s uniqueness becomes more complicated.

Now the question is, isn’t that Id field redundant? don’t we have to check this uniqueness with domain perspective anyway? why not having, say, a composite/compound key in ORM/Persistence side?

Of course this is an example. The name or price could change, but remember, I said that in the domain perspective, the name should be unique.

Consider having a Member entity, with his/her SSN as a unique identifier.

ERROR::SHADER::COMPILATION_FAILEDERROR: 0:5: Use of undeclared identifier ‘pozition’

Пытаюсь нарисовать треугольник, по этому видеоуроку… https://www.youtube.com/watch?v=EIpxcNl2WJU&t=122s но выводится пустое окно и не чего не рисуется..введите сюда описание изображения чел в видео использует ide “xcode” я тоже на этой ide

#include <iostream> #define GLEW_STATIC #include <GL/glew.h> #include <GLFW/glfw3.h>  using namespace std;  const GLint WIDTH = 800, HEIGTH = 600;  const GLchar *vertexShaderSource = "#version 330 core\n" "layout (location = 0) in vec3 position;\n" "void main()\n" "{\n" "gl_Position = vec4(position.x, position.y, pozition.z, 1.0);\n" "}";    const GLchar *fragmentShaderSource = "#version 330 core\n" "out vec4 color;\n" "void main () \n" "{\n" "color = vec4(1.0f, 0.5f, 0.2f, 1.0f);\n" "}";    int main () {      glfwInit();      glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);     glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);     glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);     glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);     glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);      GLFWwindow *window = glfwCreateWindow (WIDTH, HEIGTH, "Learn OpenGL", nullptr, nullptr);      int screenWidth, screenHeight;      glfwGetFramebufferSize (window, &screenWidth, &screenHeight);     if (nullptr == window) {         cout<<"Failed to create GLFW window"<<endl;         glfwTerminate ();         return EXIT_FAILURE;     }      glfwMakeContextCurrent(window);     glewExperimental = GL_TRUE;      if (GLEW_OK != glewInit()) {         cout<<"Failed to initialize GLEW"<<endl;         return EXIT_FAILURE;     }      glViewport (0, 0, screenWidth, screenHeight);      GLuint vertexShader = glCreateShader (GL_VERTEX_SHADER);      glShaderSource (vertexShader, 1, &vertexShaderSource, NULL );     glCompileShader (vertexShader);      GLint success;     GLchar infoLog[512];      glGetShaderiv (vertexShader, GL_COMPILE_STATUS, &success);     if (!success) {         glGetShaderInfoLog (vertexShader, 512, NULL, infoLog);         cout<<"ERROR::SHADER::COMPILATION_FAILED"<<infoLog<<endl;     }      GLuint fragmentShader = glCreateShader(GL_FRAGMENT_SHADER);     glShaderSource (fragmentShader, 1, &fragmentShaderSource, NULL);     glCompileShader (fragmentShader);      glGetShaderiv (fragmentShader, GL_COMPILE_STATUS, &success);      if (!success) {         glGetShaderInfoLog (fragmentShader, 512, NULL, infoLog);         cout<<"ERROR::FRAGMENT::COMPILATION_FAILED"<<infoLog<<endl;     }     GLuint shaderProgram = glCreateProgram ();      glAttachShader (shaderProgram, vertexShader);     glAttachShader (shaderProgram, fragmentShader);     glLinkProgram (shaderProgram);      glGetProgramiv (shaderProgram, GL_LINK_STATUS, &success);      if (!success) {         glGetProgramInfoLog (shaderProgram, 512, NULL, infoLog);         cout<<"ERROR::PROGRAM::LINKING_FAILED"<<infoLog<<endl;     }      glDeleteShader (vertexShader);     glDeleteShader (fragmentShader);      GLfloat vertices [] {         -0.5f, -0.5f, 0.0f,         0.5f, -0.5f, 0.0f,         0.0f, 0.5f, 0.0f     };     GLuint VBO, VAO;     glGenVertexArrays (1, &VAO);     glGenBuffers (1, &VBO);      glBindVertexArray (VAO);     glBindBuffer(GL_ARRAY_BUFFER, VBO);     glBufferData (GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);      glVertexAttribPointer (0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof (GLfloat), (GLvoid *) 0);     glEnableVertexAttribArray (0);      glBindBuffer (GL_ARRAY_BUFFER, 0);      glBindVertexArray (0);      while (!glfwWindowShouldClose(window)) {          glfwPollEvents();          glClear (GL_COLOR_BUFFER_BIT);          glUseProgram ( shaderProgram );         glBindVertexArray ( VAO );         glDrawArrays(GL_TRIANGLES, 0, 3);         glBindVertexArray (0);          glfwSwapBuffers (window);     }     glDeleteVertexArrays (1, &VAO);     glDeleteBuffers (1, &VBO);     glfwTerminate ();     return EXIT_SUCCESS; } 

Use subject key identifier for certificate pinning

As said here, certificate (or public key) pinning refers to a certificate (or a public key) which is hardcoded in the app that we want to protect and then compared to the one provided by the server. But

  • Can we use the Subject Key Identifier for “certificate” pinning ?
  • Is it secure to rely only on the SKI ?
  • Are there other fields that we could use for pinning securely (e.g. Certificate hash) ?

Thanks

Reproducible method to generate an anonymous identifier?

I’ve been working on a web application that needs to provide a way to create an anonymous identifier that can be used to identify one or more rows in a database that refer to a person who has called into a switchboard (let’s call them a “client“) without actually storing any identifiable information about that client. The switchboard operator should be able to:

  1. ask a few questions of the client that (ideally) only the client can answer
  2. enter their responses into an ephemeral online “calculator” form that doesn’t save/submit the data
  3. receive an anonymous identifier from that form
  4. enter that anonymous identifier into the the app that will be used to handle the client‘s request (let’s call that the CRM)

Notably:

  • personally identifiable information must never be stored in the CRM
  • the same questions are asked of every client
  • if the same client calls again one year later—and answers the same questions—a different switchboard operator would get the same anonymous identifier in response, and would see the entries about that client entered into the CRM by other operators into the who have answered calls from that same client in the past
  • the client is never asked to remember an identifier, password, or other secret

For example, John Doe calls the switchboard, and is asked to provide their:

  • First and Last name
  • DOB
  • City of birth

In my prototype: the name is processed with a simple Soundex-like algorithm (to avoid spelling errors) and returns a number; the date of birth returns a number a the number of days since an arbitrary epoch; and the city of birth returns a Where on Earth Identifier. These are then concatenated, salted, and hashed to return an anonymous identifier (e.g. 3:L3kmw:Ly, using SSDEEP so that the switchboard operator doesn’t have to type many characters into the CRM), though the hashing algorithm isn’t important). The form used to generate the anonymous identifier calculates everything in the browser, and doesn’t store/save/submit anything.

Is there a better approach to reproducibly generate an anonymous identifier? Are there better questions/procedures to reduce the risk of social engineering by others who might wish to gain information about a client?

Interested in all ideas, critiques, etc.. Will edit with changes as requested.

“SyntaxError: Unexpected identifier” from import statement?

for an assignment, I’ve created a chat app with Socket.io. I was able to create a functioning chat by following this tutorial: https://www.youtube.com/watch?v=tHbCkikFfDE. However, the assignment gave me a specific chat server to use and I am struggling to do so. I am trying to import io and then use the io.connect() method to connect to the server url. The problem is, when I try to import, I get a “SyntaxError: Unexpected identifier”.

This is my code up until that line:

var express = require('express'); var app = express(); var server = require('http').createServer(app); var io = require('socket.io').listen(server); var users = []; var connections = []; import io from "socket.io-client"; 

The last line, ‘import io from “socket.io-client”;’, produces the error with the carets pointing specifically to the “io” part of the statement. Any ideas on what the issue might be or suggestions for alternative approaches? If it wasn’t already clear, I’m quite inexperienced with JavaScript and might not be tackling the problem in the best way.

Bundle identifier of Zathura (not listed in ‘Applications’ folder, to be used in Karabiner)

I installed a PDF reader called Zathura in MacOS Mojave 10.14.4. Zathura’s version is 0.4.3, and I installed it through Homebrew (brew install zathura).

It works correctly: I can open PDFs in Terminal with zathura example.pdf.

I would like to find Zathura’s bundle identifier, so I tried this answer, namely: osascript -e 'id of app "Zathura"' and also mdls -name kMDItemCFBundleIdentifier -r Zathura.app. I tried also with zathura instead of Zathura.

The output was

0:2: execution error: Can’t get application "zathura". (-1728) 

Interestingly, in Finder > Applications, I do not find Zathura listed. Why? How can I get Zathura’s bundle identifier?

Note: I would like to get the bundle identifier to define some custom shortcuts with Karabiner. Any workaround that might get this done would be very welcome.