J-Doe

0

votes
0

answer
5

views

Xamarin forms - How do I set font for toolbaritems

I have a toolbar in my mainpage and would like to set the font for each toolbaritem (so I can set custom fonts or normal fonts). So far I have been trying to get this done by implementing my own effect and this code works for labels but not for toolbaritems. Whenever I run this code the effects get...
j.Doe
1

votes
1

answer
6.8k

views

Installing Python telnetlib module

I'm trying to install a python module named telnetlib on my Ubuntu 15.4 OS. I tried: $ pip install telnetlib but I get errors: [email protected]:~# pip install telnetlib Collecting telnetlib Could not find a version that satisfies the requirement telnetlib (from versions: ) No matching distribution foun...
J. Doe
2

votes
1

answer
58

views

How would I reallocate a 2-dimensional array in C?

I'm doing a C programming assignment in which I read in the number of columns and rows from the user and make a 2D array based on the inputs given and fill in the entries with random values. How would I delete a certain column in my 2D array based on the user input (for example if the user wanted to...
j.doe
-2

votes
2

answer
25

views

C++ Mortgage payment calculator formula

I've been working on a mortgage calculator for my C++ class. However, I am stuck. I got the following formula off of Nerdwallet and tried to implement it in my program: M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1] M=mortgage payment P=Principal i=interest n=number of payments Here's the code that I am...
J. Doe
0

votes
0

answer
7

views

How can I set firebase rule for switch button

in the realtime firebase the child Button's value is 'true' I want new value has to be only 'false' while it is 'true' the opposite, it has to be true how can I code up for firebase rule? guessing to use data.exists() or 'true' or 'false' as string but using data.exists() is further reaching to me.
J.Doe
1

votes
2

answer
88

views

Tool Recommendation to create Interaction Map with multiple dimensions

I have knowledge in QLik/Sense, Big Query, Google Data Studio ( and related ) I need to create a map with multiple points and each point will display data from the database (point related) The table will look for example like this: +------------+---------------------------+-----------+---------+----...
J.Doe
0

votes
1

answer
21

views

Trying to fill NaNs with fillna() and groupby()

So I basically have an Airbnb data set with a few columns. Several of them correspond to ratings of different parameters (cleanliness, location,etc). For those columns I have a bunch of NaNs that I want to fill. As some of those NaNs correspond to listings from the same owner, I wanted to fill some...
J.Doe
0

votes
0

answer
7

views

Multiprocessing shared value issue with nested dict and slow function

While adjusting adjusting a value within a nested dictionary using multiprocessing, if there is a long process after copying the nested dictionary over the value isn't being updated and it looks like it's overwriting the other one. I've looked on various threads across stackoverflow, but couldn't fi...
J. Doe
1

votes
2

answer
29

views

How do I loop through 2 arrays?

I have 2 different arrays and I need help printing both of them Route = ["Bus A","Bus B","Bus C","Bus D","Bus E","Bus F"] DaysLate = [ [1],[2],[3],[4],[5],[6] ] is there a way I can get this output? Bus A 1 Bus B 2 Bus C 3 Bus D 4 Bus E 5 Bus F 6
J.Doe
0

votes
0

answer
7

views

How to filter minimum distinct values in a group by?

Lets say I have a table with the following columns (A,B,C) How would I write a pig statement to create a group by on a column( A). And then filter where count(column B > 100) and count of (distinct(column C) > 3) ? From what I have: I first removed count where B is less than 100 filter_column = FIL...
J Doe
1

votes
3

answer
44

views

How to use sync within an async Promise in JavaScript?

When I run the following code: b = async attempt => { if (attempt == 5) { return; } console.log("Starting attempt:", attempt); b(attempt + 1).then(() => { console.log("Finished attempt:", attempt); }); }; b(0); The output is: Starting attempt: 0 Starting attempt: 1 Starting attempt: 2 Starting attem...
J. Doe
1

votes
0

answer
11

views

How to use generic default parameters

This is my code: class Person { init(raw: T = Child.johnDoe) {} } enum Child: String { case johnDoe } It doesn't compile. The error is: Default argument value of type 'Child' cannot be converted to type 'T' Why can't it be converted? According to the docs, Child.someEnum is RawRepresentable: Enumera...
J. Doe
1

votes
2

answer
52

views

Is there any difference between these two ways?

I wrote a function called ws2s to convert wstring to string: std::string ws2s(const std::wstring & src) { std::string res = ""; size_t const mbs_len = wcstombs(NULL, src.c_str(), 0); std::vector buffer(mbs_len + 1); wcstombs(&buffer[0], src.c_str(), buffer.size()); res.assign(buffer.begin(), buffer...
J.Doe
0

votes
0

answer
13

views

textfield in closure swift

let creatorDB = Database.database().reference().child("A") creatorDB.queryLimited(toLast: 1).observe(.childAdded) { (snapshot) in let B = snapshot.value as! String print(B) let messageDB = Database.database().reference().child("\(B))/Messages/") let messageDictionary = ["Sender": Auth.auth().current...
J.Doe
1

votes
1

answer
676

views

Having issues with drawing to a frame buffer texture. It draws blank

I am in OpenGL es 2.0 with glKit trying to render to iOS devices. Basically my goal is to instead of drawing to the main buffer draw to a texture. Then render that texture to the screen. I have been trying to follow another topic on so. Unfortunately they mention something about the power of two...
J.Doe
1

votes
3

answer
477

views

Getting nothing from UITextField

In the below code I have a button which will prompt user to enter my admin passphrase. If I click Ok button it should be able to set message to inputTextField and display the message var inputTextField: UITextField? @IBAction func logOutButton(sender: AnyObject) { let actionController = UIAlertCont...
J.Doe
0

votes
0

answer
3

views

Fetching datas from 3 related tables

I'm trying to build a REST-API like application with ExpressJS and MySQL. I've got a table-structure like this: Course Table: +----+--------+ | ID | TITLE | +----+--------+ | 1 | titel1 | +----+--------+ Sections Table: +----+----------+-----------+-----------+ | ID | TITLE | CONTENT...
J. Doe
0

votes
2

answer
28

views

Python start from beginning of file if first file is not last line

with open(args.identfile) as indetifierfile, \ open(args.elementtxt) as elementfile: for identifier_line, element_line in izip(identifierfile, elementfile): ident_split = identifier_line.split(".") el_split = elementfile_line.split(".") print ident_split[0] print ident_split[1] print el_split[0] //p...
J Doe
1

votes
1

answer
5.7k

views

Bootstrap 4 Tabs Not Linking

I am wondering why I can't get the bootstrap tabs to correspond to links. I've tried a bunch of solutions on stackoverflow, but the code structure all looks different than mine because I presume they're not bootstrap 4. Here is the html from Tabs Using Data Attributes Home Profile Messages Settings...
J. Doe
2

votes
2

answer
19

views

Why do I need to force cast a property to a generic method with the same signature as the property?

This is my code: class GenericClass { let enumProperty = SomeEnum.myValue enum SomeEnum { case myValue } func callOtherClass() { OtherClass.handle(property: enumProperty) // Compile error } } class OtherClass { static func handle(property: GenericClass.SomeEnum) {} } Why do I get the compile error:...
J. Doe
1

votes
1

answer
184

views

Expected to decode Int but found a string

My JSON looks like: { "status": true, "data": { "img_url": "/images/houses/", "houses": [ { "id": "1", "name": "Kapital", "url": "https://kapital.com/", "img": "10fbf4bf6fd2928affb180.svg" } ] } } And I'm using the next structs: struct ServerStatus: Decodable { let status: Bool let data: ServerData...
J. Doe
1

votes
2

answer
51

views

Userscript to disable window.onbeforeunload

I'm trying to create a userscript that disables window.onbeforeunload on all pages. I've tried inserting the following script at document_start: Object.defineProperty(window, 'onbeforeunload', { 'value': null }); This way window.onbeforeunload can't be set by any other script on the page. This works...
J. Doe
1

votes
1

answer
60

views

How to Parse Sitemap XML Content using PHP

I have site that is on wordpress. I want to make a PHP Script that will parse XML content from the URL and show me in the form of table. I had written below PHP Script to parse the data Loc: Last Modified: Image Title: Image Location: Problem The Above PHP Script is working fine to parse Loc & L...
J. Doe
1

votes
1

answer
28

views

Which path to use for adding a Git remote?

Basically, I want to be able to run git push myserver branchname to have my changes pushed to my server I know I need to add the git repo on my server as a remote branch, and then push to that remote branch However, I don't know which URL to use for the git remote. My website is located at: var/www/...
J. Doe
5

votes
6

answer
95

views

Python find duplicates which occur more than 3 times

I am trying to find an efficient way to search three or more consecutive duplicates and replace them for only one in a Python list. list_before = [1, 1, 1, 2, 3, 4, 5, 5, 5, 6, 6, 7, 7, 7, 8, 8, 8, 8, 8] # expected list_after = [1, 2, 3, 4, 5, 6, 6, 7, 8] def replace(list_to_replace): for idx, val i...
J. Doe
13

votes
4

answer
262

views

Bounce occurs when changing rows

Glitch I am using CoreData with a NSFetchResultController to have data displayed in a UITableView. I have one problem: the UITableView changes the contentOffSet.y when a new row is inserted/moved/deleted. When the user have scrolled to, for e.g. the middle, the UITableView bounces when a new row is...
J. Doe
1

votes
2

answer
49

views

Proper work with Entity Framework in Highly Loaded Web Applications

Generally the work with EF for an looks like this: Some Web controller calls for a method that has something like this: using (var ctx = new EntityContext()) { ... return something; } But I guess that in highly loaded application, that has several thousand requests per minute, it might create the pr...
J. Doe
1

votes
1

answer
268

views

Tokenizing an s-expression in C

I'm trying to create my own Lisp interpreter and have run into some issues with the parsing of s-expressions. My initial thought was to tokenize the expression and handle one bit at a time. I came across some code to do this after failing with my own attempts, however I am confused with it's output....
J. Doe
1

votes
1

answer
50

views

I am not getting the results as I want

I am trying to display the results according to the option select from the list but not getting the result.I want when I click on "option 1" then "answer 1" will appear and other answers will be hidden, and as I select "option 2" then "answer 2" shows and else all answers will be hidden and so on......
j.Doe
1

votes
2

answer
2.8k

views

Admob account showing big difference in matched requests and impression due to ad preloading

Admob account showing big difference in matched requests and impression in interstitial ads as shown in the picture. (The last two rows). I think this happens due to ad preloading. My question is, this big difference cause any black mark to my admob account? And is there any possible ways to decrea...
j doe
1

votes
1

answer
44

views

Writing a Tester Class to test a compiled file

I am trying to write a tester class to test a file that has already been compiled. I am basically trying to see if the coordinates of are correct when rotated 90 degrees. I am not really sure how to write a tester class. ANy advice on how to do this? public static void testRotate90(){ int fails =...
J. Doe
1

votes
2

answer
583

views

How to change outer variable from anonymous inner class?

I have a local variable in my outer method that I want to change from an anonymous inner class. How can I do it? I tried the solution using a one element array described here public class outerClass{ static public void outerMethod(Interface interface) { final String[] variable = new String[1]; new...
J. Doe
1

votes
3

answer
406

views

Updating HATEOAS rels

Let's say I'm shooting for a HATEOAS-compliant API. I provide the endpoint /cars/{id}. If a user were to call GET /cars/12, they'd see something like: { "color": "Red", [...], "links": [ { "rel": "driver", "href": "/people/123" }, { "rel": "owner", "href": "/people/456" }, ] } In this model, how do...
J. Doe
1

votes
1

answer
187

views

Does memsql really support Ranking Functions?

http://docs.memsql.com/5.0/concepts/window_functions/ I checked the doc linked above and came up with several possible SQL functions but had no luck with any of them. These are just a few: select row_number() from test; select row_number() over (order by _id) from test; select row_number() over {or...
J.Doe
1

votes
2

answer
592

views

Weights optimization of a neural network using Genetic Algorithm

I was told to implement a neural network to do forecasting. So I created a Feed Forward MultiLayer Perceptron with a Backpropagation algorithm and it is working fine. But I need to get results faster and faster. So I thaught about genetic algorithm t ooptimize the weights in the training session. Ho...
J.Doe
-1

votes
2

answer
28

views

What is the best way to keep dimensionality when subarraying numpy arrays?

Suppose I had a standard numpy array such as a = np.arange(6).reshape((2,3)) When I subarray the array, by performing such task as a[1, :] I will lose dimensionality and it will turn into 1D and print, array([3, 4, 5]) Of course the list being 2D you originally want to keep dimensionality. So Ihave...
J.Doe
0

votes
0

answer
16

views

Alias: sh: not found, what's wrong with the .bashrc script?

I wrote the usual alias in .bashrc, but now when I start cmder I have an error: alias: sh: not found. Code: alias pro='cd /c/Users/oxythres/Documents/Sources' alias storm='/c/Program\ Files/JetBrains/PhpStorm\ 2018.1.4/bin/phpstorm64.exe' $* createNewProject() { pro mkdir site_$1\($2\) cd site_$1\($...
J. Doe
0

votes
0

answer
5

views

How to run server on Google Cloud Function - with Node.js

I have NODE.js code which works perfectly locally (127.0.0.1:CUSTOM_PORT). But now I would like to set it up to run it on Google Cloud Function. This is the code which I'm using to run code locally: function connect_to_server() { const PORT = process.env.PORT || 8080; app.listen(PORT,'127.0.0.1',fun...
J.Doe
0

votes
3

answer
35

views

Convert string[] to List<string> in c# [duplicate]

This question already has an answer here: Convert array of strings to List 2 answers I have been working on a small project and I have ran into this issue. I have a txt file full of lines and I need to store them in a List. Is there any elegant way of doing it? This is my code, however, it won´t...
J.Doe
-1

votes
1

answer
37

views

How do I have user input be stored with an enum

I need help understanding enums in java. I have a project where I need to build an application for a zoo keeper to use. Theses are the requirements. I need to use enums to store animal types. The object for each animal must contain: Name Location Food and DOB I need to then store that and do it for...
J. DOE

View additional