martin-martin

15478 questions
1

votes
1

answer
3.5k

views

Webpack: You may need an appropriate loader to handle this file

I am setting up typescript with webpack, using awesome-typescript-loader. However webpack is giving me this error on build: ERROR in ./src/logic/Something.ts Module parse failed: Unexpected token (2:19) You may need an appropriate loader to handle this file type. here is a piece of code from webpac...
Martin Shishkov
1

votes
0

answer
8

views

React named presentational / container parent / child components breakdown

Okay, I am trying to make a project using container / presentational components design but I am missing some kind of information or knowledege. What I am trying to do is to render a component based upon it's parent component's type: I have this route: http://localhost:3000/:componentId componentId h...
Martin Fernandez
1

votes
1

answer
266

views

relation between random testing and fuzz testing

I am wondering what the relation between random and fuzz testing is. I understand that random testing has been there for a longer time, but I cannot see any differences between them. They both seem to make use of random input to see if the program goes into an unexpected state (i.e. crash). Is the m...
Martin Jü
1

votes
1

answer
523

views

Kotlin - use Array<Double> or DoubleArray

What is the main difference in these two: val array: Array = arrayOf() vs val array: DoubleArray = doubleArrayOf() I know that one is using primitive data type double and the second its object based countrepart Double. Is there any penalty or disadvatnage in using plain DoubleArray? Why I want to...
Martin Perry
1

votes
0

answer
9

views

Xamarin.Forms ScrollView adds extra space

My ScrollView adds extra spaces above the first child and under the last on my iPhone X. There is no padding or margin. I gave the ScrollView a blue background to see it's dimensions better. If I remove the ScrollView, the spacing also is gone. Here`s the code I am using .... Is this maybe a bug or...
1

votes
2

answer
154

views

Peer exit immediatly after starting with “fatal error: unexpected signal during runtime execution” with Fabric1.4 on Ubuntu18.04

I'm using Fabric v1.4 on Ubuntu 18.04.02LTS. I installed everything on this machine this week following the tutorials, so I got the Samples, Binaries and Docker Images of v1.4 (latest), like: hyperledger/fabric-peer 1.4.0 304fac59b501 5 weeks ago 157MB hyperledger...
Tommaso Martin
1

votes
1

answer
35

views

IntelliJ hint while rounding BigDecimal division stream result

I have a little bit strange problem with IntelliJ hint while dividing result at the end of stream operation. products.stream() .filter( order -> order.getEstimatedRealizationDate().compareTo(begin) > 0 && order.getEstimatedRealizationDate().compareTo(end) < 0) .map(order -> order.getProduct().getP...
Martin
1

votes
2

answer
45

views

Converting Map<key, value> to List<value>

I've been searching for a while without success. I am trying to convert a Map to a List (discarding key). Sure, I can do var addictionList = new List(); dataMan.forEach((String date, AddictionDay day) { addictionList.add(day); }); but is there a more straight approach, like var addictionList = dat...
Martin.
1

votes
3

answer
74

views

Executing N times a Scala Future

I am trying to find a more elegant way to execute 2 times a function which returns a Future[HttpReponse] and then to use the response of the 2-end call. for { // function post returns a Future[HttpResponse] response
Martin
1

votes
1

answer
33

views

How set text color of combobox?

I'm trying to set the text color of combobox. My code, which I tried comboList.setStyle('-fx-text-fill: blue');
Martin
1

votes
2

answer
49

views

How to prevent NHibernate SqlDateTime overflow when querying the database without using an IUserType?

Is it possible to prevent this exception when doing an NHibernate Linq query like the following: var dateFilter = DateTime.Parse('1500-01-01'); return _session.Query().Where(l => l.Date > dateFilter).ToList(); Result: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59...
Martin D.
1

votes
3

answer
42

views

Postgres - Searching for a particular value across columns in a table

I have a table that list of all fruits bought by a customer at a store by customer: | cust_name | fruit1 | fruit2 | fruit3 | |-----------|--------|---------|--------| | cust_a | apples | oranges | pears | | cust_b | pears | | | | cust_c | | | apples | I am t...
scott martin
1

votes
3

answer
23

views

Python - Returning only first value from a for loop statement

I know this is basic but I have not been able to break this. I have a for loop that I am trying to execute that returns back 10 rows. How do I limit the loop to only return back first row and not the entire output. for i in range(10): print(i) I cannot change the range value from 10. Current output...
scott martin
1

votes
1

answer
32

views

C++ - Template static method with templated parameter inside template class [duplicate]

This question already has an answer here: What are some uses of template template parameters? 9 answers I have these two classes: template class InputCSV { public: InputCSV(DataSet * ds) : ds(ds) {} virtual ~InputLoaderCSV() = default; DataSet * ds; }; and template struct DataSet { template stat...
Martin Perry
1

votes
1

answer
1.5k

views

Accessing Annotation-value in advice

In my application I have methods annotated like this: @SomeAnnotation(key1='value1', key2 ='value2') public void myMethod() I have defined the following apsect to perform some action on executing of those methods: @Aspect public class MyAspect() { @Around('@annotation(my.package.SomeAnnotation)') pu...
martin
5

votes
1

answer
30

views

How to keep a window-wide sticky element from scrolling within a wider block?

I'm developing a web interface that involves a lot of scrolling, utilizing sticky positioning, which works beautifully except for one little detail. Below is a minimalist example. You can try it on CodePen to see how the stickies work when scrolling horizontally and vertically. Menu bar item Button...
Martin Laakso
0

votes
0

answer
16

views

Disabling certain option fields from a select dropdown using Javascript

Am working on an application whereby I have some cards that have select dropdown fields. On the Cards I need to write a Javascript logic whereby if the user - selected a wife as an option on the 1st dropdown, the rest of wife options in other cards should be hidden instantly. selected a husband fro...
Martin
0

votes
0

answer
3

views

PhpStorm - Two Dart web apps in one project

I have a Dart project in PhpStorm and I have two web (Angular Dart) modules (or subprojects?) I have a problem how to run/debug them as PhpStorm created very same JavaScript Debug configurations. When I had only one it worked well. Directory structure is ~/Zdrojaky/src/dart/app/Vavrinec (the main pr...
Martin Edlman
0

votes
0

answer
10

views

IDA Pro Hexrays Decompiler MEMORY[0x40080] Errors

I'm using IDA Pro 7.0 with Hexrays plugin to decompile some C++ code. I very often encounter some functions that their de-compiled code just looks wrong and display them in red foreground color like so: MEMORY[0x1008] = 1; if (MEMORY[0x1008]) .... And very often I get at the top of my function the f...
Martin Brooker
0

votes
0

answer
4

views

Why do I get this error when deploying non-visual caffe model in python?

I'm trying to deploy a fully-connceted caffe neural network in python. The original model/NN was implemented and trained in Keras and then converted to a caffe model using MMdnn. The NN recieves a numpy array as input and gives class predictions using Softmax as output. However, when I'm trying to p...
Martin
1

votes
1

answer
1.1k

views

AttributeError: 'Spotify' object has no attribute 'current_user_saved_tracks'

Using Spotipy and am attempting to 'current_user_recently_played' token = util.prompt_for_user_token(username, scope = scope, client_id=client_id, client_secret=client_secret, redirect_uri=redirect_uri) sp = spotipy.Spotify(auth = token) saved = sp.current_user_saved_tracks() print(saved) recent = s...
Martin Zegarelli
0

votes
2

answer
20

views

Finding punctuation marks in text with string-methods

how can I find out when a punctuation(?!;.) or '
Martin
1

votes
2

answer
63

views

nltk.org example of Sentence segmentation with Naive Bayes Classifier: how does .sent separate sentences and how does the ML algorithm improve it?

There is an example in nltk.org book (chapter 6) where they use a NaiveBayesian algorithm to classify a punctuation symbol as finishing a sentence or not finishing one... This is what they do: First they take a corpus and use the .sent method to get the sentences and build an index from them of whe...
Martin
1

votes
1

answer
49

views

Does 'string.format' allow more control over iterables / dictionaries?

I am in a situation where it is easy to adjust the formatting string, but hard to adjust the arguments for format: 'I can influence this'.format(foo={'a': 'no', 'b': 'control'}, bar=['no', 'control', 'either']) For numbers, you can format with {:1.23f}. For dates, you can format with {:%Y-%m-%d}. I...
Martin Thoma
1

votes
2

answer
76

views

What is the difference between C++ and Visual C++ and how to start with C++? [closed]

So I want to start learning how to make real games and programs, and I bumped into C++ but then I realized that there is also Visual C++. If there's any difference - tell me what it is. If you have any suggestions on how to start in general with C++ program making (not that black window), please let...
Martin Davidov
1

votes
2

answer
61

views

Accumulating [State s a] results

What I did I found myself writing some kind of 'renderer', where at some point I had a list of state-transitions: [State String [a]] I wanted to apply them one after the other. I could do this with sequence, which brought me to State String [[a]] Then I had to flatten the result from list-of-lists t...
Martin Drautzburg
1

votes
1

answer
25

views

Using __repr__ when parameter defaults to None, but may be a str

I have a class that can be initializes with several parameters. Some of these parameters have default values of None, but if a value is provided it should be str. I would like to have a nice pythonic output from __repr()__, but can't figure out how to handle None as well as a possible str in one ret...
Martin Héroux
1

votes
1

answer
32

views

call function after multiple loops of fetch()

If i want to call doStuff() when multiple loops of fetch are finnish, how would i approach it ? im assuming i need to call a function every time a fetch is done and check if concat of both array length is at the last one ? let array1 = [1,2] let array2 = [7,8] array1.map(function(item){ fetch('/a...
Martin Larocque
1

votes
4

answer
1.6k

views

Python ImportError when executing 'import.py', but not when executing 'python import.py'

I am running Cygwin Python version 2.5.2. I have a three-line source file, called import.py: #!/usr/bin/python import xml.etree.ElementTree as ET print 'Success!' When I execute 'python import.py', it works: C:\Temp>python import.py Success! When I run the python interpreter and type the commands, i...
0

votes
0

answer
3

views

How to get Labels to appear on markers in ArcGis Maps webpart for SharePoint?

I'm using the Arcgis Maps web part for SharePoint. I can get my markers / pins to appear, now I'm trying to get labels to appear identifying each. How do I go about this? Please see screenshot below:
Martin Muldoon
1

votes
4

answer
3.3k

views

how do I make erlang connect with mysql?

I'm trying to use odbc to connect some erlang code to a mysql server. I've started up the odbc manager with odbc:start(). But I simply cant get the connect call working, My connect call looks like this: odbc:connect('server=localhost;port=3306;Uid=root',[]). the only thing I have to work with is th...
Martin Kristiansen
1

votes
1

answer
1.3k

views

NSTableView Delegate Called But Data not showing

i have a very strange problem with NSTableView in XCode 4.2. I've set the datasource an delegate for the table. My table has 3 columns where each of the column has an identifier ('name','mugshot','lastSeen'). My delegate -(id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableCol...
Martin
1

votes
2

answer
1.8k

views

Which years to write into copyright header?

How should I write the years in the copyright header? Just firstyear, every year like firstyear, ..., currentyear, the range firstyear-currentyear or just the last currentyear? For example, I currently work on code I wrote in 2011, and it just says Copyright 2011 in the header.
Martin Ueding
1

votes
2

answer
73

views

Double pointer as function parameter

I was reading a page of 'Understanding and Using C Pointers' when this function appeared: void safeFree(void **pp) { if (pp != NULL && *pp!= NULL) { free(*pp); *pp = NULL; } } and an example code from it: int main(int argc, char **argv) { int* pi = (int*)malloc(sizeof(int)); *pi = 5; safeFree((void*...
Martín
1

votes
0

answer
145

views

Python/Kivy : How to pass TextBox value in .kv file from one class to another class

Can anyone tell me? I have two file test.py and test.kv. I have a textBox which id : state . How to pass state.text value in root.get_value(state.text) and get value in function of def get_value test.py from kivy.uix.screenmanager import Screen from kivy.app import App from kivy.lang import Builder...
Martin
1

votes
1

answer
551

views

UITableView - footer for section - iPhoneX

I have problem with iPhone and UITableView section footer. It is being 'hidden' behind the top cut-out section. I have this code: override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { var content = 'some long text' let footerView = UIView(frame: CGRect(x...
Martin Perry
1

votes
0

answer
211

views

UnicodeDecodeError from python 2 to 3 with .decode() and sockets

Hello i have been working on a Python code which will flash my Arduino over WiFi and i almost have it working im so close. The issue is it was created for Python 2 and i want it to run on the latest python 3. I added .encode and decode to places where socket sends or receives a string. and that work...
Edwin Martin
1

votes
1

answer
1.2k

views

Jenkins permissions denied when copying files

I'm setting up a web application using jhipster. I created a Jenkinsfile with the jhipster subgenerator which looks like this: #!/usr/bin/env groovy node { stage('checkout') { checkout scm } docker.image('openjdk:8').inside('-u root -e MAVEN_OPTS='-Duser.home=./' --volume=/var/run/docker.sock:/var/r...
Martin
1

votes
2

answer
247

views

Changing locale of UIDatePicker in Countdown Timer mode

I have UIDatePicker in CountdownTimer mode and need to change the wording of hours and min to German locale. I tried both, to set locale to German (Germany) in storyboard and in code, but both failed and the app still shows default english words for hours and min. timePicker.locale = Locale(identifi...
Martin Koles
1

votes
0

answer
42

views

PHP - Memcache for aprox. 20k small strings - out of memory

I have created simple code with memcache function CreateMemcacheName() { //lat and lon are latitude and longitude of place //user can not directly change this - it is passed from image URL //embeded in HTML site $lat = intval($_GET['lat'] * 100); $lon = intval($_GET['lon'] * 100); return 'data_{$lat...
Martin Perry

View additional