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.

Is there any unique identifier for postgreSQL server Or how come postgres master is identifying its slave unqiuely

Is there any way to have more than one PostgreSQL slave servers in the same system.

If yes, how come a master detect each server as different slaves from the below query

select * from pg_stat_replication;

will give one row for each slave which are connected to it, with PID, IP-address/client_address, client_port, etc..

If two servers are running in the same machine gives the same IP-address so it is not a unique identifier.

If slave got restarted then both client_port and PID will change so these are also cant be a unique identifier.

So, what is the unique identifier used by Postgres master to identify each slave server uniquely? Or how it is finding its slave servers differently?

Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘Receiver () has no segue with identifier ‘pizzaSegue’ [migrated]

I am new to swift programming and running into errors with performing a segue from a tableview cell when it is pressed to a view controller giving details about that cell. The error I am getting is: Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘Receiver () has no segue with identifier ‘pizzaSegue”

I have already tried the following: 1) Tried renaming the storyboard and make sure to set the main storyboard in the project settings and in the info.plist file (Key is ‘Main storyboard file base name’). I currently have the storyboard named: “Main.storyboard”

2) Tried doing a clean of the product (Product -> Clean) and rebuild but this gives same error

3) I have tried deleting the app from the simulator and running it again

4) I have double checked and the segue identifier in interface builder is called “pizzaSegue” and it is the same in my code.

import UIKit import Alamofire  struct Drink {     let id: String     let name: String     let description: String     let amount: Float     let image: UIImage      init(data: [String: Any]) {         self.id = data["id"] as! String         self.name = data["name"] as! String         //self.amount = data["amount"] as! Float         self.amount = ((data["amount"] as? NSNumber)?.floatValue)!         self.description = data["description"] as! String         self.image = data["image"] as! UIImage     } }  class DrinkTableViewCell: UITableViewCell {     @IBOutlet weak var cellName: UILabel!     @IBOutlet weak var cellAmount: UILabel!     @IBOutlet weak var cellDescription: UILabel!     @IBOutlet weak var cellImage: UIImageView!      override init(style: UITableViewCell.CellStyle, reuseIdentifier: String!) {         super.init(style: style, reuseIdentifier: reuseIdentifier)     }      required init?(coder aDecoder: NSCoder) {         fatalError("init(coder:) has not been implemented")     }  }  class DrinkListTableViewController: UITableViewController {      var drinks: [Drink] = []      override func viewDidLoad() {         super.viewDidLoad()         navigationItem.title = "Drink Selection"         tableView.dataSource = self         tableView.delegate = self         //tableView.register(DrinkTableViewCell.self, forCellReuseIdentifier: "cell")          tableView.register(DrinkTableViewCell.self as AnyClass, forCellReuseIdentifier: "cell")          //tableView.register(UINib(nibName: "DrinkTableViewCell", bundle: Bundle.main), forCellReuseIdentifier: "cell")          //tableView.estimatedRowHeight = 134         //tableView.rowHeight = UITableView.automaticDimension          fetchInventory { drinks in             guard drinks != nil else { return }             self.drinks = drinks!             //print("Data from API call: ", self.drinks)             //self.tableView.reloadData() //            DispatchQueue.main.async { [weak self] in //                self?.tableView.reloadData() //            }         }     }      override func viewDidAppear(_ animated: Bool) {         super.viewDidAppear(animated)         DispatchQueue.main.async { [weak self] in             self?.tableView.reloadData()         }     }       override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {             performSegue(withIdentifier: "pizzaSegue", sender: self.drinks[indexPath.row] as Drink)         //trying another method below?         //self.navigationController?.pushViewController(UIViewController() as! PizzaViewController, animated: true)     }        override func prepare(for segue: UIStoryboardSegue, sender: Any?) {          if segue.identifier == "pizzaSegue" {             guard let vc = segue.destination as? PizzaViewController else { return }             vc.pizza = sender as? Pizza         }     }      private func fetchInventory(completion: @escaping ([Drink]?) -> Void) { Alamofire.request("http://127.0.0.1:4000/inventory", method: .get)         .validate()         .responseJSON { response in             guard response.result.isSuccess else { return completion(nil) }             guard let rawInventory = response.result.value as? [[String: Any]?] else { return completion(nil) }             let inventory = rawInventory.compactMap { pizzaDict -> Drink? in                 var data = pizzaDict!                 data["image"] = UIImage(named: pizzaDict!["image"] as! String)                 //print("Printing each item: ", Drink(data: data))                 //printing all inventory successful                 return Drink(data: data)             }             completion(inventory)     } }      // MARK: - Table view data source      override func numberOfSections(in tableView: UITableView) -> Int {         return 1     }      override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {         print("ROWS: ", drinks.count)         return drinks.count     }       override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {          //let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! DrinkTableViewCell          //let cell = UITableViewCell(style: UITableViewCell.CellStyle.subtitle, reuseIdentifier: "cell")          let cell:DrinkTableViewCell = self.tableView.dequeueReusableCell(withIdentifier: "cell") as! DrinkTableViewCell          //cell.cellName?.text = drinks[indexPath.row].name         //cell.cellAmount?.text = String(drinks[indexPath.row].amount)         //cell.cellDescription?.text = drinks[indexPath.row].description         //cell.cellImage?.image = drinks[indexPath.row].image          cell.imageView?.image = drinks[indexPath.row].image         cell.textLabel?.text = drinks[indexPath.row].name         cell.detailTextLabel?.text = drinks[indexPath.row].description          //print(cell.textLabel?.text)         //print(cell.detailTextLabel?.text)          print(cell.cellName?.text as Any)         //print(cell.cellImage?.image)         return cell     }       override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {      return 100.0      }  } 

Screenshot showing error in console and the segue identifier in storyboard

Would it be illegal to use “Const” as an identifier in PHP?

I’m attempting to design an interface, and it returns an error which might be likely due to naming it Const:

syntax error, unexpected ‘Const’ (T_CONST), expecting identifier (T_STRING) or namespace (T_NAMESPACE) or \ (T_NS_SEPARATOR) in

Attempt:

interface Const {      const CONSTANT_1 = 1.0;      const CONSTANT_2 = 2.0;      const CONSTANT_3 = 3.0;      const CONSTANT_4 = 4.0;      const CONSTANT_5 = 5.0;      const CONSTANT_6 = 6.0;      const CONSTANT_7 = 7.0;       // rest of codes     ...  } 

Implementation:

For instance, you might imagine some sub-classes (A, B, C …) and one large Core class, which all of them should use that interface:

class A extends Core implements Const {       public static function getCoefficientA()     {     }      public static function getCoefficientB()     {     }      ...      }   class B extends Core implements Const {       public static function getEquationA()     {     }      public static function getEquationB()     {     }          ... }   class C extends Core implements Const {       public static function getStatisticsA()     {     }      public static function getStatisticsB()     {     }          ...  } 

Regardless of design, would it be illegal to name any interface Const in PHP?

What’s a unique identifier in listsinceblock output?

I am trying to understand if there a unique identifier for transactions. I didn’t find anything about that mentioned in listsinceblock’s help.

{   "involvesWatchonly": true,   "account": "",   "address": "mvd6qFeVkqH6MNAS2Y2cLifbdaX5XUkbZJ",   "category": "receive",   "amount": 10,   "label": "",   "confirmations": 69,   "blockhash": "62967ce950fc03b14179e58f42e426b63cbfbf63c2b9e59acb6a719a09c23b94",   "blockindex": 58,   "blocktime": 1524872287278,   "txid": "aac9b2d7bb7b3476a83a5ac0c2fe21625bcd961ed43a5c5fd3eacf6536dc81d5",   "vout": 7,   "walletconflicts": [],   "time": 1524872276635,   "timereceived": 1524872276635,   "bip125-replaceable": "no" }, 

Export: Not a valid identifier (Cuda environment setup)

Hi I am new to Ubuntu and don’t know much about the environment setup. While, after I installed Cuda, I tied to use “nvcc – version” to check whether the installation was successful or not. However, it showed that “nvcc is not found”. It happened maybe because I didn’t add the path to the ~/.bashrc file. However, when I added the path to the PATH variable as the installation guide (https://docs.nvidia.com/cuda/cuda-in…lation-actions) shows, it failed.

Part of my ~/.bashrc is :

    #CUDA   export PATH=/usr/local/cuda-10.1/bin:/usr/local/cuda-10.1/NsightCompute-2019.1$  {PATH:+:$  {PATH}}   export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64\                          $  {LD_LIBRARY_PATH:+:$  {LD_LIBRARY_PATH}}       # added by Anaconda2 installer export PATH="/home/veronica/anaconda2/bin:$  PATH"   export CAFFE_ROOT=/home/veronica/caffe export PYTHONPATH=/home/veronica/caffe/python:/home/veronica/anaconda2/bin/python     # add Bazel path export PATH="$  PATH:$  HOME/bin"   export LD_LIBRARY_PATH=$  LD_LIBRARY_PATH:/usr/lib/nvidia-418   export LD_LIBRARY_PATH=$  LD_LIBRARY_PATH:/home/veronica/.mujoco/mjpro150/bin 

But, when I tried to make this file work:

$   source ~/.bashrc bash: export: `:/usr/local/cuda-10.1/lib64:/usr/lib/nvidia-418:/home/veronica/.mujoco/mjpro150/bin': not a valid identifier 

I am sure these folders exist.

PS: “:/usr/lib/nvidia-418:/home/veronica/.mujoco/mjpro150/bin” could work well before I added cuda path.

And I tried to change the path to

export PATH=/usr/local/cuda-10.1/bin$  {PATH:+:$  {PATH}} export LD_LIBRARY_PATH=$  LD_LIBRARY_PATH:/usr/local/cuda-10.1/lib64 

or

export LIBRARY_PATH=$  LIBRARY_PATH:/usr/local/cuda-10.1/lib64$  {LD_LIBRARY_PATH:+:$  {LD_LIBRARY_PATH}} 

No one works. Please please help me! Thank you in advanced!

CUDA compiling error – expected an identifier

When I try to execute the following code, I get errors :

#include "cuda_runtime.h" #include "device_launch_parameters.h" #include <stdio.h> #include <stdlib.h>  __global__ void vecAdd(int *A, int *B, int *C) {     int id = threadIdx.x;     C[id] = A[id] + B[id]; }  int main() {     printf("Enter the dimenstions of A");     int n;     scanf("%d", &n);     int A[n], B[n], C[n];     printf("Enter the elements of A: \n");     for(int i = 0; i < n; i++)     {         scanf("%d", &A[i]);     }      printf("Enter the elements of B: \n");     for(int i = 0; i < n; i++)     {         scanf("%d", &B[i]);     }      int *dA, *dB, *dC;     cudaMalloc((void **)&dA, n*sizeof(int));     cudaMalloc((void **)&dB, n*sizeof(int));     cudaMalloc((void **)&dC, n*sizeof(int));      cudaMemcpy(dA, A, n*sizeof(int), cudaMemcpyHostToDevice);     cudaMemcpy(dB, B, n*sizeof(int), cudaMemcpyHostToDevice);      vecAdd<<<1,n>>>(dA, dB, dC);      cudaMemcpy(C, dC, n*sizeof(int), cudaMemcpyDeviceToHost);      for(int i = 0; i < n; i ++)     {         printf("%d \t", C[i]);      } }   

The errors I get are :

/usr/include/x86_64-linux-gnu/c++/5/bits/c++config.h(218): error: expected an identifier  /usr/include/x86_64-linux-gnu/c++/5/bits/c++config.h(218): error: expected a type specifier  /usr/include/x86_64-linux-gnu/c++/5/bits/c++config.h(218): error: explicit type is missing ("int" assumed)  /usr/include/x86_64-linux-gnu/c++/5/bits/c++config.h(222): error: expected an identifier  /usr/include/x86_64-linux-gnu/c++/5/bits/c++config.h(222): error: expected a type specifier  /usr/include/x86_64-linux-gnu/c++/5/bits/c++config.h(222): error: explicit type is missing ("int" assumed)  /usr/include/x86_64-linux-gnu/bits/byteswap.h(47): error: identifier "__builtin_bswap32" is undefined  /usr/include/x86_64-linux-gnu/bits/byteswap.h(111): error: identifier "__builtin_bswap64" is undefined  /usr/include/c++/5/bits/cpp_type_traits.h(270): error: identifier "__int128" is undefined  /usr/include/c++/5/bits/cpp_type_traits.h(270): error: expected a ">"  /usr/include/c++/5/cstdlib(178): error: identifier "__int128" is undefined  /usr/include/c++/5/cstdlib(179): error: identifier "__int128" is undefined  12 errors detected in the compilation of "/tmp/tmpxft_0000200c_00000000-4_temp2.cpp1.ii". 

Any help is deeply appreciated. Thanks!