Alex_Alex

23545 questions
6

votes
2

answer
87

views

How to write a maintainable, fast, compile-time bit-mask in C++?

I have some code that is morally like this: #include enum Flags { A = 1, B = 2, C = 3, D = 5, E = 8, F = 13, G = 21, H, I, J, K, L, M, N, O }; void apply_known_mask(std::bitset &bits) { const Flags important_bits[] = { B, D, E, H, K, M, L, O }; std::remove_reference::type mask{}; for (const auto& b...
Alex Reinking
1

votes
1

answer
101

views

traitsui prevent txt-box from realtime updating

Frequently when using traitsui, i have a depends_on relationships that are somewhat costly, and i would to Not update the trait with every character entry of a text-box. For example, if i have a Int which is used in a calculation, through depends_on linkage, the linkage is actuated every time i add...
alex
0

votes
0

answer
40

views

SSL with Angular-cli

How does one trust the SSL certificates that are self generated by the NG serve command? Steps to reproduce: Enviroment (ng --version) Angular CLI: 7.3.1 Node: 10.15.1 OS: win32 x64 Angular: 7.2.4 Create a new project with ng new myApp. change the package.json to contain "start": "ng serve --ssl" ru...
Alex
1

votes
1

answer
3.1k

views

WL5G3N0 notation in Proxy Server after exporting in OSB

I need to virtualize one web service in OSB, but the final wsdl is the same as the Business service (it's a asxm and everything is only in one file), this is OK, but after exporting the wsdl has a differente notation, please see the examples below: Expected and original The one I get: I'm getting th...
Alex
1

votes
1

answer
456

views

How to pass entity atribute value to form Symfony2?

I have a form type: $builder->add('paises', 'collection', array( 'options' => array('data_class' =>'Acc\ApssBundle\Entity\Pais'), 'prototype' => true, 'type' => new PaisType(), )) ; How to add attribute "name" to the class Pais to the label form ?? In twig I have: {% for pais in form.paises %} {{...
Alex
1

votes
2

answer
4.4k

views

Python multiprocessing redirect stdout of a child process to a Tkinter Text

I'm trying to use Tkinter GUI to launch a child process and display it stdout/stderr output to a Text widget. Initially, I thought the sys.stdout can be easily redirected to the Text widget by setting "sys.stdout = text_widget" but seems not. It comes to an error: "Text instance has no attribute 'fl...
Alex Zhe Hu
1

votes
1

answer
892

views

iOS how to add date and name metadata to file stored on disk?

Is there some way on iOS to add attributes to a file that I'm saving in the documents directory? Ideally I would have the file name, created date and duration. I'm currently using two date formatters formatters and am using the filename to store date. This will quickly prove unmanageable if I need...
Alex Stone
1

votes
0

answer
18

views

By which criteria range is applied to arrays and strings in C#8?

I'm looking through C#8 ranges and cannot understand how exactly the application of the Range is restricted to arrays and strings only. I have thought that it is somehow related to interface array implements. It implements ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructur...
Alex Netkachov
1

votes
2

answer
12.1k

views

Dynamically change label when pressing button - iOS Swift

In this there are buttons and when they are pressed I want the label to be changed to that order of operation for example when the Subtraction button is pressed I want the sign to change to a subtraction sign. Here is a picture of the storyboard. https://www.dropbox.com/s/sh61xss16xr2t0t/Screenshot%...
alex
1

votes
1

answer
500

views

Django Group_By and SUM query

I want to make a sumarized inventory report. To make that possible I have my model like this: class Inventario(models.Model): producto = models.ForeignKey(Producto) cantidad = models.DecimalField(default=0,decimal_places=2, max_digits=10) ubicacion = models.ForeignKey(Ubicacion, null=True, blank=Tru...
Alex Lord Mordor
0

votes
0

answer
3

views

Gerrit does not allow to clone repository

I have upped gerrit locally, created an admin user and have tested ssh connection through "ssh -vv -p 29418 [email protected]". I also created a project "ssh -p 29418 [email protected] gerrit create-project spring-petclinc.git", but I still have no option to clone repo from UI. What shoud I configure to...
Alex
1

votes
3

answer
1.1k

views

How to dereference an Objective-C object via its pointer/memory address?

So, it is very easy to get an object pointer's "memory address", á la.. id x = @"obj"; printf("'x' is at: %p", x); 'x' is at: 0x100b60048 Amazingly, I cannot seem to find ANY reference as to how to perform the "reverse" operation. ie. get a reference to an object pointer, either via the hex int poi...
Alex Gray
1

votes
2

answer
489

views

how to inspect html of Google sheets in firefox

I am trying to inspect html of Google drive's Sheets. They have override the right click. How can I inspect the html elements? I am using firefox
Alex
1

votes
2

answer
583

views

Using acceptsMouseMovedEvents for SpriteKit mouse actions with Storyboards and Swift

I have created a SpriteKit scene by referencing a custom NSView using Storyboards in Xcode. However, I cannot implement any mouseMoved events using SpriteKit because I do not know how to reference the program's NSWindowto set its acceptsMouseMovedEvents property to "true". How can I create an @IBOut...
Alex Laing
1

votes
2

answer
876

views

NSString length with flag emojis

I'm trying to get the length of an NSString that contains a bunch of emojis, including the flag characters. Now I know how to get the length of a string containing emojis: __block NSInteger length = 0; [string enumerateSubstringsInRange:range options:NSStringEnumerationByComposedCharacterSequences...
Alex Beals
1

votes
2

answer
1.2k

views

Play video when modal opens, pause when it closes

I have it so you click the image, the video opens up in a modal dialog, and then you have to click play. If you click off the video, it continues to play unless it has finished or has been paused beforehand. If I set the video to autoplay, it will autoplay when the page loads, not when the dialog o...
Alex
1

votes
1

answer
3.4k

views

How to pass a header as argument in curl command? [duplicate]

This question already has an answer here: Why does shell ignore quotes in arguments passed to it through variables? [duplicate] 3 answers I am attempting to do a curl command that uses a predefined variable as a header. header='-H "Content-Type: application/json" -H "userGUID: 7feb6e62-35da-4def-88...
Alex S
1

votes
1

answer
864

views

Microsoft Access - copy object properties to another object of the same type

I know you can select multiple objects and you will be able to change all of the properties that they have in common. In most cases, this would be ideal; however, I have multiple forms that I want to copy the properties of buttons to. Is there a way I can copy the properties of one button to anothe...
Alex
0

votes
0

answer
12

views

Using Prophet package to forecast by groups and create plot

I am using Prophet package to forecasting in groups in a dataframe, and I want to create plots using the grouped dataframe. I was following the answers in Using Prophet Package to Predict by Group in Dataframe in R. Are there easier ways to create the plots, compared to how I did it below? library(d...
Alex Ho
0

votes
0

answer
3

views

scrapy xpath returns list of entire page inside foreach

The code below goes through each iteration of the class container. It returns each product but when I try to use xpath for the price it returns a list instead of the price inside the foreach container. How do I get the xpath to return the price inside the individual div and not the entire page? It a...
Alex Daniels
2

votes
0

answer
19

views

How to start up Jenkins using Bash?

sudo systemctl status jenkins ● jenkins.service - LSB: Start Jenkins at boot time Loaded: loaded (/etc/init.d/jenkins; generated) Active: failed (Result: exit-code) since Tue 2019-02-19 00:14:29 UTC; 43s ago Docs: man:systemd-sysv-generator(8) Process: 878 ExecStart=/etc/init.d/jenkins start (code...
Alex Zubkov
-2

votes
0

answer
24

views

Python creating dictionaries issue [on hold]

Create a function named add_item that takes two parameters, the dictionary being used and the word to lookup (in that order). If the word is NOT in the dictionary add it with a count of 1 If the word is in the dictionary, update the count accordingly Create a function named build_dictionary that tak...
Alex Grage
1

votes
1

answer
943

views

Is there a way to know the “real” position of an a-frame element?

I want to find the "real" position of an a-frame element. Not the one shown in the position attribute. But the one that's the total of all the parents and relative to the world/scene position?
alex
1

votes
1

answer
2.7k

views

webpack + express.js doesn't load bundle.js

I'm looknig to create an app with node + express js as backend and react + webpack as front end, but I'm still getting errors and the bundle.js doesn't load. This is how my folders looks like: In the root directory I have the node_modules, src folder that containst main.js and compoenents subfolder,...
Razvan Alex
9

votes
2

answer
162

views

Training a tf.keras model with a basic low-level TensorFlow training loop doesn't work

Note: All code for a self-contained example to reproduce my problem can be found below. I have a tf.keras.models.Model instance and need to train it with a training loop written in the low-level TensorFlow API. The problem: Training the exact same tf.keras model once with a basic, standard low-level...
Alex
0

votes
0

answer
8

views

How to group stream of Map to Map<String, Map<String, String>>?

I have stream of Map [name:name1, type:type1, desc:desc1, ordinal:1]. How to convert/group (with Groovy) to Map>: Map(type1: Map (neme:name1, desc:desc1, ordinal:1)).
Alex
1

votes
2

answer
2k

views

Trying to set file name length limit with git - Permission denied

I am trying to clone a GitHub repository containing files with long path names, and I am trying to get around Git's file length restriction using the command git config --system core.longpaths true However, I am getting the error messages: error: could not lock config file C:\Program Files\Git\mingw...
Alex
1

votes
1

answer
659

views

How to put a swig/pybind11 C++ project on pypi

I have code wrapped with both pybind11 and swig, but can't seem to find docs about how to properly get that code on pypi so I can pip install my package. Pybind11 seems to have issues that make it difficult to put code on pypi. I think what I want is to build binary wheels for Linux & OSX, but I c...
Alex Lenail
1

votes
4

answer
778

views

Detect if process executes inside a Windows Container

It's simple. I would like to detect with code if my process is running inside a windows container. There are examples but they are all for linux based containers. I'm looking for something unique and explicit to docker that can be used to make a safe conclusion whether a process is executing inside...
Alex Sarafian
1

votes
1

answer
2.1k

views

how to mirror gitlab CE repo on gitlab.com and automatically update?

TLDR; I need to backup a repo and keep it automatically up to date for free. I've got some repos hosted on gitlab.com, free edition. I want to mirror them to any other free online repo store and keep this backup automatically updated when the origin repo on gitlab.com receives and update (push). Are...
Alex Kerr
24

votes
1

answer
656

views

Set shared_ptr with new_pointer that is old_pointer + offset

Here is a smart pointer: std::shared_ptr p(new char[size]) which represents array filled with raw binary file content. After (and only after) the whole array is copied from file to RAM, I can parse it, and during this I retrieve some header information (a few first dwords). Then actual data follows....
Alex Larionov
0

votes
2

answer
22

views

highlight nested list item when another element is hovered

I have a nested list in my menu and I wanted the first child of the sub list highlighted when the parent is highlighted. I want to code this just by using CSS (in SCSS file format) .sub-list-item { /*sub-list-item*/ height: inherit; padding: 0px 15px; margin: 22px 0; width: 213px; clear: left;...
Alex Deneris
1

votes
1

answer
2.2k

views

zaproxy: unable to find image 'in:latest' locally

I followed example from : https://zaproxy.blogspot.com/2017/06/scanning-apis-with-zap.html install Docker on my Mac executed docker pull owasp/zap2docker-weekly executed example: docker run -t owasp/zap2docker-weekly zap-api-scan.py -t \ https://www.example.com/openapi.json -f openapi it works exec...
Alex
2

votes
0

answer
24

views

I can't navigating without the navigation prop with react-i18next container

I apply the navigation example without the navigation prop of the react-navigations docs (NavigationService), but I can't make it work with react-i18next. I applied the example of the documentation https://reactnavigation.org/docs/en/navigating-without-navigation-prop.html in my code: // App.js impo...
Àlex
1

votes
1

answer
119

views

What does \u001b[1G\u001b[2K> mean?

I'm running through some javascript code and during testing I recieved this sequence: \u001b[1G\u001b[2K> . The entire line was actual: 'tests\repl\u001b[1G\u001b[2K> tests\replTest.js', expected: 'tests\replTest.js' What does this mean?
Alex W
1

votes
2

answer
223

views

Index instead of primary key on UUID type in PostgreSQL

First, I have read a few posts about this, like this one: Postgresql: UUID or SEQUENCE for primary key? My question is quite simple: my IDs in my table are UUID v4 (created in Rails or from an iOS app). As UUID by default is unique, can I remove the primary key on ID and just add an index on it? The...
alex.bour
0

votes
1

answer
14

views

Getting access to ui elements in different fxml file

I have a FXML-application with a main.fxml, which includes two other fxml files. Each of these fxml files has its own controller class. My question is, of how to get access to objects from a specific controller, although these objects are defined on another fxml file. The following code is just a m...
Alex
0

votes
0

answer
4

views

Raspberry redirect service output to console

I've been trying to monitor the output of a service and I managed to do so by using this service configuration file (reset_trigger.service): [Unit] Description=Reset Button Trigger After=multi-user.target [Service] StandardOutput=journal+console StandardError=inherit ExecStart=/usr/bin/python -u /us...
Alex
1

votes
3

answer
42

views

How to get an element of an object?

I want to reach an element of an object from an API endpoint (https://restcountries.eu/rest/v2/all), more precisely the "name" from "currencies" but it always return undefined. I have tried currencies.name and currencies["name"] but none of these works. const countries = document.getElementById('cou...
Alex Denor
0

votes
0

answer
4

views

urxvt remapping Shift-PgUp/Shift-PgDown to Shift-Control-PgUp/PgDown

has someone experience in configuring urxvt? I'm trying to figure out how to remap shift-page_up/down to control-shift-page_up/down. I figured out how to use eval perl script's scroll_down_pages/scroll_up_pages functions for that which works but beside the fact that scroll_down_pages functions isn't...
alex

View additional