Peter Peter

16487 questions
1

votes
1

answer
2.6k

views

Swagger 3.0 schema error “should NOT have additional properties”

What does this error below mean? (Running in Swagger Editor) Schema error should NOT have additional properties additionalProperty: /buildinfo, /clearcache, /countries/{countryId}/cinemas/{theatreid}/screens/{screenid}/layout, /countries/{countryId}/cinemas/{theatreid}/screens Jump to line 0 Below i...
peter ivarsson
1

votes
2

answer
54

views

In Xcode, how would you go about having view controllers which are only accessible to the user if they perform a certain action in the app?

The app I am making has multiple pages which the user swipes between. I need the user to be able to press a button and that create a new page in the app, and then also for the user to be able to delete that page of the app. Is there a way to generate/delete a view controller while the app is in use?...
Peter Ruppert
1

votes
2

answer
5k

views

How to download Dash video files as they appear on the server?

Is it possible, given an mpd file like https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd, to easily download all the Dash files stored on the server (assuming we know that it's static content on the server). That is, I should be able to run an HTTP server serving the content I downloaded, an...
Peter Tseng
1

votes
1

answer
636

views

Mongo-Go-Driver Failing to Connect

So I am trying to use https://github.com/mongodb/mongo-go-driver to connect to a mongo database in golang. Here is my connection handler: var DB *mongo.Database func CreateConnectionHandler()(*mongo.Database, error){ fmt.Println('inside createConnection in database package') godotenv.Load() fmt.Pri...
Peter Weyand
1

votes
1

answer
49

views

Different addresses of a pointer and an array in a union

I want to get the address of the first element of an array. This array is in an union with a pointer. Code: #include #include #include union l_array_0_uint8_t { uint8_t *pnt; uint8_t array[8]; }; int main() { union l_array_0_uint8_t u; uint8_t* aa = &(u.array[0]); uint8_t* pa = u.pnt; printf('arr...
peter tomson
1

votes
1

answer
25

views

PostgreSQL: When casting an integer to a non-integer type to force floating point division in PostgreSQL, which number type should I use?

I know there are many integer division questions on StackOverflow, but I did not see this one. Similar to many programming languages, PostgreSQL performs integer division if both operands are integers. If one has: SELECT s.id AS student_id, COUNT(DISTINCT(bc.book_id)) / COUNT(c.id) AS average_books_...
Peter Jirak
1

votes
2

answer
55

views

Laravel Eloquent model returns value even with a wrong condition

I don't get the following problem : $user = App\User::where('id', 1)->first(); works $user = App\User::where('id', '1')->first(); works - same result $user = App\User::where('id', '1xxxx')->first(); works - same result $user = App\User::where('id', 'x1')->first(); doesn't work I'm surprised by 2., m...
Peter Estiven
0

votes
1

answer
23

views

How to center TextView in alignment with center of ImageView programatically?

I am making an ImageView and TextView programatically in an animation function, the ImageView size changes depending on a value. I simply need the TextView's center to be aligned with the image views, I am using RelativeLayout parameter leftMargin to determine its location on the X axis. Nothing I t...
Peter Ruppert
0

votes
3

answer
24

views

How can I get this argument?

Hello I have this code using HTML : {...} And Here is my code in Javascript : $(document).on('click', '.test_test', function (e) { ... }); And this is my function : function test(){ ... } The problem is that I would like to put my function test() like this : $(document).on('click', '.test_test', fu...
Jack Peter
1

votes
2

answer
15

views

Optimize Custom module code in node express

Please give me suggestion on how I can optimize my code that is present in custom module. Below is my module code that you can see and suggest. var employee = { all: function (req, res) { jwt.verify(req.token, 'novaturesol', (err) => { if (err) { res.status(400).send('Forbidden or tokken is expired!...
Peter
0

votes
0

answer
3

views

Bleno throws an index-out-of-range error on binary data

My code, that provides a BLE service, is running under nodejs and is using bleno package. My service characteristic supports read and notify. Here is my simplified implementation of onSubscribe function: function(maxValueSize, updateValueCallback) { var a = buildPacket(); var buf = Buffer.from(a);...
Peter
1

votes
1

answer
2.8k

views

Detect OS and Java on Windows and Linux

I have a JavaFX project based on Maven. I want to build the Maven project on Windows and on Linux. In order to automate the process when I deploy the bundle I want to automatically detect the operating system. In windows I have this configuration: org.apache.maven.plugins maven-compiler-plugin 3.1 1...
Peter Penzov
10

votes
5

answer
344

views

Calculate Spring Job execution time

I have this very basic example of Spring Job. @Scheduled(fixedRate = 90000) public void myScheduler() throws Exception { // Print here execution time into console and save into DB } I have to do some very heavy calculations. Is there a way to calculate total execution time? There is a solution with...
Peter Penzov
0

votes
0

answer
4

views

Solar zenith does not seem to be correct when calculating with pvlib

I'm using pvlib to calculate solar power. However, the solar zenith does not seem to be correct. city = Location(lat, lon, 'Europe/Amsterdam', 0, 'Amsterdam') gives the following outcome: Location: name: Amsterdam latitude: 52.37 longitude: 52.37 altitude: 0 tz: Europe/Amsterdam Then, I calculate t...
Peter
1

votes
1

answer
2.5k

views

Get all posts beginning with letter A

How can i get all poasts beginning with the letter A (in the post_title)? My idea was to use regex but this code dont work. $my_custom_query_args = array( 'cat' => '1', 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 25, 'offset'...
Peter
0

votes
1

answer
29

views

How can I split an array into specified lines when printing?

New to software development, I'm working through Big Nerd Ranch's book 'Swift Programming'. One of the challenges set by the book is to print an array within a dictionary that contains 15 zip codes and to have them split across three lines in groups of five. The formatting must exactly match how it...
Peter H
1

votes
5

answer
471

views

How to update a column twice with sql

I have a table with these values: Name | id ---------------- Blue guy | 20 Green girl | 10 The id column is a unique value. What I want is to update blue guy id to 10 and in that same query I want to update green girl id to 20. My current SQL query is: UPDATE colorpeople SET id = 20 WHE...
Peter rosevelt
1

votes
2

answer
270

views

Return list from Spring rest api

I want to return List from Spring rest api: @GetMapping('merchant_country') public ResponseEntity getMerchantCountry() { return ok(Contracts.getSerialversionuid()); } I want to get the content from here: private Map getCountryNameCodeList() { String[] countryCodes = Locale.getISOCountries(); Map lis...
Peter Penzov
1

votes
2

answer
174

views

Use of unresolved identifier 'kUTTypePDF'

How to use the file types in Swift according to https://developer.apple.com/documentation/coreservices/kuttypepdf this should be completely fine UIPasteboard.general.setData(Data(contentsOf: URL(fileURLWithPath: path)), forPasteboardType: kUTTypePDF) yet it yelds Use of unresolved identifier 'kUTT...
Peter Lapisu
1

votes
5

answer
74

views

Python Pandas, deleting NaN

So basically I am stuck on a very simple thing. For some reason when I execute this code: import pandas as pd x = pd.read_csv('titanic.csv') v = x.dropna(axis=0,how='any') z = v[['Survived']] y = z.where(z == 1) print (y) It still prints values with NaN, even though I have already done dropna on the...
Peter
1

votes
3

answer
60

views

Python, How to make an asynchronous data generator?

I have a program that loads data and processes it. Both loading and processing take time, and I'd like to do them in parallel. Here is the synchronous version of my program (where the 'loading' and 'processing' are done in sequence, and are trivial operations here for the sake of the example): im...
Peter
1

votes
2

answer
44

views

mutate new boolean column by comparing two columns

I would like to compare two columns with genotypes and generate a new boolean column. However, there is something different, for instances, GG can also equal to CC or AA can also equal to TT and vice versa. df: rsid ref sample rs104211 CC GG rs104998 AA TT rs105063 TT AA rs105076...
Peter Chung
1

votes
1

answer
44

views

PHP: Convert str to number

For an unknown reason, I cant seem to be able to convert a string to a number. It always return 0. Here is the code: $str = 'C$​2,313'; $str = str_replace(array('C$',','),'',$str); echo $str.PHP_EOL; echo intval($str); exit; The following always output: ​2313 0 How can I convert this string succ...
Peter Lur
1

votes
2

answer
50

views

How exactly is a VPC used

I understand the main concept and high level architecture of VPC. From what I understand VPC is mainly used to lower level detailing of the network. This is mainly used for ec2 instances. I understand that ec2 instances are IAAS. My question is how the VPC is used with other resources that are PAAS...
Peter
1

votes
2

answer
38

views

fn:boolean What does it for?

I have already read some articles but I am still confused about the 'fn:boolean'in XQuery3.0...Is this a function to This is where I look at: http://www.xqueryfunctions.com/xq/fn_boolean.html For instance: If I put fn:boolean ((1,2) > (5000,6,1)), it is true. If I put fn:boolean ((6,1) > (1,99,22)...
Peter
1

votes
2

answer
75

views

How to divide all members into individual fair teams based on their ratings?

I want to divide players into individual fair teams based on their rating. For example, I have a list of players like this: players = [{ name: 'Qasim', rating: 1 }, { name: 'Mahsam', rating: 7 }, { name: 'Aj', rating: 3 }, { name: 'Osman', rating: 6 }, { name: 'Usama', rating: 2 }, { name: 'Bilal',...
Peter Nguyen
0

votes
0

answer
4

views

How should the input shape of Keras LSTM layer looks like

I've been reading for a while about training LSTM models using tf.keras, where i did use the same framework for regression problems using simple feedforward NN architectures and i highly understand how should i prepare the input data for such models, however when it comes for training LSTM, i feel...
peter bence
1

votes
1

answer
4.1k

views

DataTables deleting a row without page refresh

I am using this code to initialize datatable and after Delete link is clicked - EVERYTHING works OK, but Iam using refresh page, so I tried to delete row directly with DataTable function, but can't get it to work at all.... Here is current code (the one that works, but refreshes whole page): $(docum...
Peter
1

votes
0

answer
186

views

Websocket communication works with localtunnel but not ngrok

I created a little multiplayer game to learn how Python's asyncio worked. I tested everything on localhost first -- everything worked. I then used ngrok to expose my localhost so I could play with some friends. However, every time they connected through ngrok, their client never updated. The client...
Peter Wang
1

votes
1

answer
184

views

“Italic” does not work in UILabel in Xcode -iOS

I am trying to design a view as attached, however, my label text is not 'Italic' as I have already set in label attribute. Tried to find solutions, but seems like all is programmatically adjustment. Is there anything I miss out to config 'Italic' in storyboard directly?
Peter Guo
1

votes
0

answer
47

views

Retrieving UserAuth data from Firebase in an Ionic project

I'm struggling to retrieve UserAuth data from firebase and presenting it on a list. I managed to put it there, but I can't get it back. I'v been around so many diffrent tutorials and tested a lot of code :( Are there any suggestions to this issue? My code looks like this. It's probably totally wrong...
Peter Bundgaard
1

votes
0

answer
104

views

UITextfield respond return UIViewNoIntrinsicMetric

I've added a UITextfield to a view, but when i run the app and press the textfield i get following error: error: returned 0 width, assuming UIViewNoIntrinsicMetric What causes this to happen? Custom UIView Code let rightBottomView = UIView() rightBottomView.isUserInteractionEnabled = true rightBot...
Peter Pik
1

votes
2

answer
610

views

powershell copy-item doesn't copy when filter is used

I'm trying to copy files using copy-item. Specifically, I want to copy files with a particular extension that are within a folder or its subfolders to another location, and to retain the subfolder hierarchy. I've tried using -filter and -include to specify the file extension, but no files are copied...
Peter
0

votes
0

answer
3

views

Is there a shorter workaround to reduce the number of AsyncTask in my Room DataBase Repository

I am trying to simplify the number of lines for my codes in the repository. Currently there is a lot of repetition in my codes. Many of the solutions online only involves inserting once into the table. I need to do insert() on many tables. I want to reduce the repetition for writing the same inner A...
Peter
1

votes
0

answer
75

views

How to set camera of android device as source type for javascript?

So, I am making an AR-application and have some basic code which runs fine on a pc-browser. The piece of code that activates the webcam is the following: //handle arToolkitSource var arToolkitSource = new THREEx.ArToolkitSource({ // to read from the webcam sourceType : 'webcam', }) When I use an...
Kanerva Peter
1

votes
1

answer
28

views

Nullable Guid Parameter in RAW method Codefluent Entities

I have a RAW method for an entity that has GUIDS as parameters. LOADONE (Guid CwObjectGuid, Guid CountryGuid) RAW With the corresponding body: SELECT * FROM dbo.Bid WHERE Bid_CwObject_Guid = @CwObjectGuid AND ((Bid_CountryGuid = @CountryGuid) OR (@CountryGuid = '00000000-0000-0000-0000-000000000000...
Peter de Bruijn
1

votes
0

answer
78

views

How to insert data frame value into Mongodb in R

How to insert data frame value into Mongodb in R, I'm using below code to insert but i'm getting error val is my data frame. My Insert Query is mongo1$insert(val) But i'm getting Below error Error: No method asJSON S3 class: table
jhon peter
1

votes
0

answer
43

views

how to get best order to resolve dependencies

I have a series of nodes that have dependency relations. (a:Foo)-[:DEPENDS_ON]->(b:Foo) Each node can depend on 0 or more other nodes and there are no loops. I need a query to return all the node in the best order to process the nodes before processing the nodes that they are dependent on. I know...
Dread Pirate Peter
1

votes
0

answer
25

views

Redirect to https and sub dir on apache2

I have a bolt application installed and want to do 2 things with my .htacces: 1st) Redirect to the /public/ folder, since bolt displays an error otherwise. 2nd) Change all incoming requests to https:// Seperatly I get them to work, individually I get either: 404, installation error or missing files...
Peter
1

votes
3

answer
1.4k

views

odoo 11 accounting fiscal periods

i just installed odoo 11 CE and managed to get the accounting features by activating in the user settings. However the most important functions to create fiscal periods and to close a fiscal year properly seems to be completely missing. If this is the case and this is only available in the enterpri...
Peter

View additional