Peter Peter

12183 questions
1

votes
1

answer
1.3k

views

Eclipse won't reopen workspace after crash

Eclipse crashed while working on a project, now when I want to reopen the project I get the following message. An error has occurred. See the log file /FOLDERS/.metadata/.log I can open other workspaces without any problem. I remember having this problem some time ago and it was just a lock or somet...
Peter Raeves
1

votes
1

answer
13k

views

Passing strings by reference and value in C++

I want to declare a string, initialize it by passing it by reference, and then pass it by value to the 'outputfile' function. The code below works, but I don't know why. In main I would expect to pass the string 'filename' like startup(&filename) But that gives an error, and the code below doesn't....
Peter
1

votes
1

answer
1.7k

views

QCustomPlot: How to set percent on the y-axis? How to change tick label alignment?

I am playing around with the QCustomPlot libary for Qt. I created some plots succesfully. But I got still questions: 1: How can I set my y-axis range from 0% to 100%? 2: My tick labels are centered below the ticks. How can I change that to a left alignment? Thanks for your help. Peter // generate so...
Peter Panne
1

votes
2

answer
708

views

NSURL fail able initialiser initWithString: does not return nil on empty String in Swift

It is easy to reproduce in a Playground import Foundation let urlString = "" let url = NSURL(string: urlString) print(url) The result of url is somehow (no URL) instead of the expected nil and the printout is Optional() with neither .Some or .None. I would really like some insight on this one, becau...
Peter Schumacher
6

votes
1

answer
94

views

How to handoff animation for Android developers?

I'm a designer and interested in different ways I can handoff animation to Android developers and the best ways to do that depending on a particular case. 1. JSON I know Lottie works best for animating micro interactions and creating animated illustration, like those on onboarding pages. For a desi...
Peter
0

votes
0

answer
5

views

Subscribe scope is outside of components scope

I have the following angularJS component: export function setDisplayTaskDetailView(showTaskDetailView: boolean): void { if (showTaskDetailView !== null && window.device.mobile()) { showTaskDetailView$.onNext(showTaskDetailView); } } @Component('TaskHandling', { selector: 'task-overview-detail', temp...
Peter Boomsma
2

votes
0

answer
18

views

Lazy-evaluate dependent-types (CRTP)

I'd like the following piece of code to work: template struct foo_base { auto get(typename Self::type n) { return n; } }; template struct foo : public foo_base { using type = T; }; The problem of course is that the base is instantiated first so you cannot refer to the derived member types. I'd nee...
Peter Lenkefi
1

votes
2

answer
385

views

Generate random dates

I use this code to generate date in Ruby. DateTime.strptime("10/26/2015 07:09:52 AM", '%m/%d/%Y %I:%M:%S %p') How I can generate random date with range for example 6 months?
Peter Penzov
1

votes
2

answer
3.4k

views

Unable to pass payload parameters to Node-RED http request

I am trying to do a simple http get request in Node-RED. According to online documentation I have to pass the parameters in a function as input for the http request node. My function looks like this; msg.url = "https://api.socialstudio.radian6.com/v3/posts" msg.method = "GET" msg.headers = {'access_...
Peter
1

votes
2

answer
59

views

__FILE__ returns different value when using binding.pry

__FILE__ returns the path of the current Ruby script file. One potentially significant problem is that, if using binding.pry, __FILE__ evaluates to (pry). It is potentially problematic to have __FILE__ evaluate to different values depending on whether it is evaluated in the context of binding.pry. F...
Peter Jirak
1

votes
2

answer
70

views

Date one day backwards after select from MySQL DB

I have timezone related problem. I have a program in JAVA and MySql database. I do not use any ORM, but I have custom jdbc library which uses mysql connector java v 6.0.4 I send settings as part of the connection string as: serverTimezone - America/Chicago useTimezone - true useJDBCCompliantTimezo...
peter.cambal
1

votes
1

answer
48

views

How to override valueOf() by a correct type, that is not a primitive one?

Suppose that I need to override the internal valueOf() by Array type... As explained here the valueOf() method returns the primitive value of the specified object... So, I suppose that we can set the primitive value to any datatype... Can we? or there are restrictions? Here the same example of the l...
Peter Krauss
1

votes
1

answer
4.9k

views

Javascript Regex - Replace { with nothing

i have a little problem and i have no idea what is wrong var selector_css; var sheet= document.styleSheets[0]; var rules= 'cssRules' in sheet? sheet.cssRules : sheet.rules; for (var i= 0; i
Peter
0

votes
0

answer
13

views

How to override the internal valueOf() by Array?

As explained here the valueOf() method returns the primitive value of the specified object... So, I suppose that we can set the primitive value to any datatype... Can we? or there are restrictions? Here the same example of the link, changing only the return and the test: function MyNumberType(n) { t...
Peter Krauss
0

votes
0

answer
6

views

Pass SAML response from a Web App to the REST API for authentication?

We have a Web App using REST API. The REST API is based on Loopback and uses it's built-in token-based authentication. For the Web App we use forms based authentication over HTTPS, so the user has to enter his username and password which we then use to get access token from the REST API via POST /us...
Peter Liapin
2

votes
3

answer
29

views

How to unnest (unlevel) unnecessary nested list without changing its shape? (Python)

This is quite different what I found in many threads - I don't mean to make list flat but unnest levels as follows: [[[3, 3]]] should be [3, 3] [[[3, 4], [3, 3]]] should be [[3, 4], [3, 3]] but not [3, 4], [3, 3] nor [3, 4, 3, 3] because this changes the structure completely. Basically, I wanted to...
Peter.k
1

votes
1

answer
6.2k

views

google.protobuf.message.DecodeError: Error parsing message

I am doing the tutorial on https://www.tensorflow.org/versions/master/tutorials/image_recognition/index.html and working on the Python API section, I launched python classify_image.py Here I am getting the error message out like so: A protocol message was rejected because it was too big (more than 6...
Peter HIRT
1

votes
1

answer
34

views

Call interception - How to determine wether a call is a system call

I am trying to create an interception method that only processes non-system calls. According to the docs both system and non-system calls are intercepted: Outgoing grain call filters are invoked for all method calls to a grain and this includes calls to system methods made by Orleans. However, I ca...
Peter Bons
1

votes
1

answer
403

views

Flutter slideTransition is not animating

So I'm trying to create a trivial slide transition element in flutter and I'm having some difficulty. What the below does is wait for the animation time, and then just display the Text("hello there sailor"). I don't know why this is not animating - it seems very similar to this previous post that ha...
Peter Weyand
1

votes
2

answer
146

views

Implement Recursive CTE for Hierarchical Query to MariaDB

I have this table which I would like to store a chain of records. CREATE TABLE table_name ( id INT, unique_id varchar, reference_id varchar, ); I want to implement SQL query for MariDB which prints all records by unique_id with all record reference_id. Something like this: | id | unique_id | referen...
Peter Penzov
1

votes
4

answer
28

views

how to access array when using array.prototype

I am looking at trying to implement the map function myself. So far my code looks like this: Array.prototype.mapz = function (callback) { let arr = [] for (let i = 0; i < array.length; i++) { arr.push(callback(array[i])); } return arr; }; function double(arg) { return arg * 2 }; const x =...
peter flanagan
1

votes
2

answer
34

views

Creating a new column that is an average of non-adjacent rows in the data frame

I am very new to R. I have multiple columns of variables relating to different question responses on a questionnaire. I wish to generate a new column in the data frame that is an average of a set of these preceding variables. I have seen that rowMeans can be used for this, but this seems to only wor...
Peter James Taylor
1

votes
2

answer
95

views

Return keys with values from Rest API

I want to return JSON from Rest API endpoint as keys with values. Example: { "terminal 1": {"date":"2018-10-06T00:00:00.000+0000","volume":111,"count":1}, "terminal 2": {"date":"2018-11-06T00:00:00.000+0000","volume":122,"count":1} } How I can add the keys? It should be I suppose like this: List> Ca...
Peter Penzov
1

votes
1

answer
1.1k

views

C#: When would the NumberDecimalSeparator be different to the CurrencyDecimalSeparator

My application allows the user to capture a numeric value. In the context I do not know whether they are capturing a currency value or some other numeric amount. I need to cater for different decimal separators and grouping separators, but which should I choose from the CultureInfo? Does anyone kn...
Peter
0

votes
1

answer
16

views

R highcharts multiple stacked bar chart

I want to plot a multiple stacked bar chart, but I don't know how to combine the r code. Closing Date Non Current Assets Current Assets Non Current Liabilities 2 2013/12 13637344 13078654 9376243 3 2014/12 14075507 12772388 88...
Peter Chung
0

votes
1

answer
19

views

Can Figure Out How To Get TypeScript To Be Happy with Returned Promise

I have reduced my code to this simple example that just returns a promise function. The error TypeScript 3.2 gives me is: Error:(1, 7) TS2739: Type '() => Promise' is missing the following properties from type 'Promise': then, catch, [Symbol.toStringTag] The associated code is const fetchUserInfoPro...
Peter Kellner
1

votes
1

answer
1.5k

views

Correct way to octal escape a UTF-8 character in Python

I need to get the octal escape sequence for UTF-8 characters in Python and was wondering whether there's any simpler way of doing what I want to do, e.g. something in the standard library that I overlooked. I have a makeshift string manipulation function but I'm hoping there is a better solution. I...
Peter Goldsborough
0

votes
0

answer
30

views

Implement groupingBy in filter

I'm trying to implement this code in order to return proper response from Spring Rest API. @GetMapping("/terminals") public ResponseEntity getTopTerminalsVolumes( @RequestParam(value = "start_date", required = true) String start_date, @RequestParam(value = "end_date", required = true) String end_dat...
Peter Penzov
2

votes
0

answer
14

views

nltk: how to search connection between some words?

I'm using nltk and wordnet to link words which belongs to some group of relations. For example 'parking' and 'building' should have some parent linkage. I use hypernyms but for some words there are no connection. x = wordnet.synset('parking.n.01') y = wordnet.synset('building.n.01') print(x._shortes...
Peter.k
1

votes
1

answer
839

views

How to properly unbind jQuery window event handler in Ember component

I know that the best practice for binding an event handler to a window event with jQuery is jQuery(window).on('resize', Ember.run.bind(this, this.handleResize)); If you try to unbind the event handler though in willDestroyElement with $(window).off('resize', this.handleResize); this doesn't work bec...
Peter
1

votes
3

answer
575

views

Jmeter setting for sampler that it should not be in view results tree

I want that some beanshell samplers of my testplan should not be shown in view results tree. Is that somehow possible? Best regards, Peter
Peter
1

votes
1

answer
401

views

Caching Methods in grails

I am looking for a way to cache the return values of some of my methods in Grails. I found the plugin ehcache (https://grails.org/plugin/cache-ehcache) which looks very good. But I can't get my example to work. I want to use @Cachable notation. My configuration in Config.groovy: grails{ cache { enab...
Peter
4

votes
2

answer
64

views

Ruby method with parameters in double parenthesis

I have come across the following code in erb library. Note the double (( )): class MyTest def location=((filename, lineno)) @filename = filename @lineno = lineno if lineno end end The following locatia= method is another version without the (( )) for testing: class MyTest def locatia=(filename,...
Peter Camilleri
1

votes
1

answer
12

views

Beginner Question: Using spring initializr for previous versions or work around?

I've been pretty fond of Spring Initializr for the convenience of it, but I need to use Spring Boot 1.2.7 for a project and I'm not sure how to do that, but I'm thinking I could by just modding out the build.gradle or pom.xml files? I've done similar where there were unforeseen complications or othe...
Peter
9

votes
3

answer
258

views

Optimize continuous deployment (cancel throu chain-of-responsibility)

Id like to improove continuous delivery. I am using a Tomcat 8 and maven. I use mvn tomcat:redeploy to deploy the webapp. In tomcat documentation I found this part: Deploy A New Application Archive (WAR) Remotely If installation and startup is successful, you will receive(...) Otherwise, the respon...
Peter Rader
1

votes
2

answer
1.7k

views

Check the previous loaded scene

I'm making a game in Unity3D with C# for mobile devices and can't figure out how to check which scene was loaded before the current scene. I need to check this to change the spawn point from the player gameobject. First I added a simple script to my buttons (loadnextscene and loadprevscene) public c...
Peter Smith
1

votes
2

answer
67

views

Use a custom filter with a controller

I've created a filter that checks the user id and then filters out all results in a ng-repeat that don't have that user id. If I place my filter, UserService.getCurrentUser() .then(function(user_id){ $scope.user_id = user_id; }); In my controller it works fine, but I want to keep my controller as cl...
Peter Boomsma
1

votes
2

answer
1.4k

views

Gridstack not updating on delete

Here is my example of Gridstack layout that uses Knockout bindings. The problem is that my view doesn't get updated based on the model, when it should. After pressing Delete me the console output shows that the widgets observable array gets updated correctly, while the view doesn't. The cause seems...
Peter Gerhat
1

votes
1

answer
595

views

Sort array by frequency

I would like to count how many times is every string in array and sort them by number of times they exist in array I have this code now hlasy.sort(); var zaciatok = null; var pocet = 0; for (var i = 0; i < hlasy.length; i++) { if (hlasy[i] != zaciatok) { if (pocet > 0) { console.log(zaciatok + ' mĂ...
Peter Rybar
1

votes
1

answer
2.3k

views

How to get a UserPrincipal object for the manager from the employee's UserPrincipal object

I have an Active Directory searcher to get users' details using UserPrincipal objects. I'm using System.DirectoryServices and System.DirectoryServices.AccountManagement and it's accessing AD through a context. However, I also need to get the user's manager as a separate UserPrincipal object. What wo...
peter kover

View additional