Bear Bear

-2

votes
2

answer
23

views

random.randint() call with -1?

Can someone explain why the range in the random.randint(0, len(messages) - 1) has a minus 1 at the end? The list has 9 values: import random messages = ['It is certain', 'It is decidedly so', 'Yes definitely', 'Reply hazy try again', 'Ask again later', 'Concentrate and ask again', 'My reply is no',...
Bear McBear
0

votes
0

answer
17

views

How to install old version of library in Pip3

I would like to use opencv-python and opencv-contrib-python versions in 3.3 or below on Python 3.7. The issue is that I can't seem to get them on pip3. I need it to be pip3 and Python 3.7 because it's to run on Google Cloud Functions. If I run $ pip3 install opencv-contrib-python== to get the versio...
Anters Bear
1

votes
2

answer
454

views

Cortana skills bot invocation name not being discovered after publishing

I added a new Bot i am developing in .net via the Bot Channels Registration option in Azure. I then added a Cortana channel to the bot via the Knowledge Store. Although I can test my Bot using Test in Web Chat, I cannot get Cortana to talk to my Bot. When Cortana does understand my accent she just o...
bear
1

votes
1

answer
174

views

predicting with zoib models (MCMC / RJags)

I am using the zoib package in R to build zero-inflated beta regression models. I am looking for a simple way to use the models that zoib produces to calculate a predicted response for a new dataset. By 'new dataset' I mean data not used to build the original zoib models. I know I can just take the...
bear
1

votes
1

answer
69

views

“displayof” in tkinter.font.Font.measure

The following measure method is defined in class Font of module /usr/lib/python3.5/tkinter/font or import tkinter.font: def measure(self, text, displayof=None): 'Return text width' args = (text,) if displayof: args = ('-displayof', displayof, text) return self._tk.getint(self._call('font', 'measure'...
Sun Bear
1

votes
0

answer
95

views

Maven-plugin execution in gradle

I've implemented an automated appium test for a mobile application using cucumber and a JUnit runner. In order to generate pretty reports, I'd like to use net.masterthought's maven-cucumber-reporting artifact. net.masterthought 3.9.0 execution verify generate TestingNo1 ${project.build.direc...
beware_bear
1

votes
0

answer
367

views

Dialogflow date-range values incorrect

Dialogflow V2 (beta) api. Windows 10. My intent uses the system date-period entity for this week and next week in the training phrases. When checking the values of startDate and endDate I find they are incorrect. The dates for next week are for Monday this week to Sunday next week and the dates for...
bear
1

votes
1

answer
48

views

Using sqlite3 in Tk8.6

To use SQLite3 with Tk8.5 and python, users commonly call the sqlite3 and tkinter modules separately via from sqlite3 import * import tkinter as tk Ever since Tk8.6 was launched with a built-in interface to the SQLite3 database engine, is there a new way to activate SQLite3 directly from tkinter? O...
Sun Bear
1

votes
1

answer
1.6k

views

How to remove a pipenv's PipFile, PipFile.lock and associated virtualenv?

To create a pipenv for a python project, I first created a project folder and go into the folder to instruct pipenv to create the Pipfile, Pipfile.lock and associated virtual environment like so: $ mkdir Project $ cd Project $ pipenv --three Creating a virtualenv for this project… Using /usr/bin/p...
Sun Bear
1

votes
0

answer
35

views

master.blade.php isn't loading CSS properly when doing @include

I'm trying to make a navbar appear using @include in a master.blade.php file so i get that navbar in all of my pages, the navbar does load but the CSS is messed up. I know its not the navbar's CSS because if I load the navbar php by itself without the master file the CSS its perfectly fine. Here is...
Helium Bear
1

votes
0

answer
35

views

How to express a python variable in a SQLITE3 statement

I have created the following functions to create a table call user. import sqlite3 from datetime import datetime def create_connection(db_file): try: connection = sqlite3.connect(db_file) return connection except sqlite3.Error as e: print(e) return None def create_table(connection, sql_table): curso...
Sun Bear
1

votes
0

answer
59

views

Why Can Wide & Deep Neural Net Work with Non-Normalized Data?

My understanding is that inputs to neural networks should be normalized to zero-mean-unit-variant or binary. My own experiment also found that non-normalized network would lead to unstable learning. But the tensorflow Wide and Deep Network example uses non-normalized numeric features such as 'age' a...
Hacking Bear
1

votes
1

answer
136

views

Sorting a matrix by column and by row

I have to build a function that sorts a matrix by rows and then by colums or the other way around, preserving the values inside the matrix. The matrix is a huge matrix so the algorithm that I use has to be a nlogn algorithm. I have a structure as follows: typedef struct{ unsigned int line, column; f...
Big Bear
1

votes
1

answer
46

views

Coloring NSMutableAttributedString in UITextView giving weird results

I'm trying to make a rudimentary IDE / code viewer and thus I am trying to color certain words in a UITextView. I wrote a small loop to find ranges and another to color the words in range on an NSMutableAttributedString. I know the ranges are being calculated correctly because the print statement at...
Anters Bear
1

votes
1

answer
65

views

Preserve default constructor in derived classes

How to preserve the default constructor in the derived class, without adding Derived() = default; in the derived class? struct Base { Base() = default; }; struct Derived : Base { using Base::Base; explicit Derived(int) {} }; int main() { // Compilation error here Derived d; }
c.bear
1

votes
1

answer
41

views

Time since the code has been running

The following code shows total code run time: Dummy code; require(tictoc) require(svMisc) tic() y
Polar Bear
1

votes
2

answer
58

views

Creating a new character from a string in Swift

This is a bit of a strange question. Would it be possible to create a new character in Swift from a string. Let's say that 'aa' would be recognized as a separate character from 'a'. The same way '\n' or '\t' are recognized as single characters even though strictly speaking they are made up of two ot...
Anters Bear
1

votes
0

answer
121

views

Detecting paste UITextView in textViewDidChange

I am creating a UITextView for use as a rudimentary IDE. When the user pastes text (code) I am modifying it so that it fits inline (correctly indented) with the other text. However, I am also coloring the text (attributedText) using the textViewDidChange method. As a result when I paste text, it is...
Anters Bear
1

votes
0

answer
238

views

Composition over inheritance limits

I have a number of interfaces like the following: public interface IFoo { void FooAction(); } public interface IBar { void BarAction(); } public interface IBiz { void BizAction(); } ...others... I have also defined a base abstract implementation for my interfaces. Something like this: public abstrac...
c.bear
1

votes
1

answer
114

views

Server side includes as a templating/layout technique

I'm making a website for a company, and I wanted to use something like ASP.NET MVC layout pages to dynamically load the content into the layout, but the hosting provider used by the company doesn't support ASP.NET. I assumed they supported Node.js, because they said the only thing they didn't suppo...
Snuggle Bear
1

votes
0

answer
87

views

Different sdl2 versions. How to use pip3 installed version instead of the debian version?

For SDL_GetVersion, the SDL2 Wiki states that : If you are linking to SDL dynamically, then it is possible that the current version will be different than the version you compiled against. This function returns the current version, while SDL_VERSION() is a macro that tells you what version you compi...
Sun Bear
1

votes
1

answer
215

views

Sliding window in R for dates

I am working on a project that requires me to create a flag field if an item has n number of occurrences (on different dates) within a 30-day window (for each TYPE). If it did occur n times within the window then it would flag all of the relevant dates with 1 and if it did not occur then the dates w...
Bear
1

votes
1

answer
74

views

TFS build Get Sources step fail on WiX Toolset NuGet package

I'm working on a non-XAML TFS build; my solution includes a number of WiX installer projects. I've installed the WiX.Toolset.2015 NuGet package in each installer project. My solution builds successfully in Visual Studio and .msi installer files are produced for each WiX project as expected. But, whe...
1

votes
0

answer
64

views

How is a nonce RESTful when using HMAC?

I'm trying to wrap my head around RESTful practices as I attempt to implement my own REST API, and that said, there's a fair bit that's confusing me. One of the resources I've come across is the REST Cookbook for logging in, and while I understand how a nonce works for HMAC authentication, I'm hung...
p0lar_bear
1

votes
0

answer
47

views

Getting rotation angle during animation / getting rotation angle from CATransform3D

I'm trying to get the angle of rotation of a UIView while it is being animated. I figured out that such properties are available / up to date during animation in the layer.presentation(). I'm trying to extract from there the angle of rotation, however, the transform property here is actually a CATra...
Anters Bear
1

votes
0

answer
61

views

How to import Jenetics Library in Eclipse

First post here, I hope it's not too dumb, but I tried for several hours and can't find a solution. I want to play around with evolutionary algorithms and therefor tried to import the Jenetics Library. I downloaded the zip and tried to import it into an existing java Project. I'm working with eclips...
Voli Bear
1

votes
1

answer
34

views

active record joins with distinct record

I have an Event model with multiple time slots(on and from attributes both are datetime) I need to get distinct events based on some condition that is applied on the time slot model through joins and have is sorted in some order. I tried a few approaches but it just works when i order on the event a...
yogi_bear
1

votes
0

answer
85

views

Detox with Saucelabs?

Curious to see if anybody has successfully configured the Detox automation framework with Saucelabs. I see it is mentioned on their site but they offer no support in regards to setting it up. I'm not really sure where to start as there seems to be little to no information to go off of. If there's...
Despair Bear
1

votes
0

answer
362

views

PowerShell remote connection problems

I’m trying to implement PowerShell remoting (for PowerShell script execution on a remote server). My remote server is running Windows Server 2008 and PowerShell v2. From an elevated permission PS console, I have executed the following cmdlet: Enable-PSRemoting Returned to console: WinRM already is...
The Furious Bear
1

votes
0

answer
66

views

adding opencv library onto node-gyp bindings.gyp

Im trying to connect the opencv library to my node C++ addon. Im using windows and I have downloaded opencv and extracted it. I added it to my project directory like below: | app.js | binding.gyp | +---.vscode | c_cpp_properties.json | +---build | config.gypi | +---c | test.cc...
Dennington-bear
1

votes
0

answer
89

views

Android Custom EditText Numbers

In my application I've EditText-Fields, which should be able to hold decimal numbers. So my keyboard should show all numbers, the comma, the point and the minus sign, in order to type in currency-values. I defined the EditText-Field through the following InputTypes: InputType.TYPE_CLASS_NUMBER | I...
beware_bear
1

votes
1

answer
120

views

How to change Single Element(integer) from 2D Arrays columns

So i need to change Element (a integer) from column which is closest to that column average number. For example: We have this 2D array array[3][3] 1 4 7 2 5 8 3 6 9 So from first column i would need to change/replace 2 ((1+2+3)/3=2) Because it is closest to average of column For second column i...
Dj_Bear
1

votes
1

answer
23

views

new factor-level assignment behaves weirdly depending on the position of the new factor string in the list

I know that adding new levels to an object of class factor is pretty straightforward. However, when I put the factor level to-be-added in the first position in the list, the actual values in the object (vector) change. Here is what I am talking about: test
Trail_Bear
1

votes
1

answer
41

views

Why does the 'ipady' option in the tkinter.grid() method only add space below a widget?

Below is a code to show the issue. Label1 shows that I need to use pady to displace Label1 by 10 pixels. Label2 shows the default effect of ipady. Why does ipady not leave space above and below the widgets? How do I get ipady to do what it is suppose to do w/o using pady? Thank you. Quoting tcl docu...
Sun Bear
1

votes
0

answer
35

views

Check if user selected all in shiny pickerInput menu

I have a shiny application with several pickerInput menus. They amount of choices change in each menu based on the selections of other menus so I can't ever hard code anything (ex: menu A will have 4 total selections possible). I am trying to determine how to check if the user selected all of the...
Bear
1

votes
1

answer
41

views

How to find if a directory exists somewhere (I dont know the path ) in my computer from a python script

Suppose there is a directory somewhere in my computer (I don't know its path) and I don't want to search it by myself rather I want my script to find it out by itself using the 'directory name' (provided no ambiguity) and if it exists then how can I import files from that into the script. Any help i...
the bipolar bear
1

votes
0

answer
7

views

How to set output html global lang attribute in Dokka?

If I run the Dokka gradle script on a PC with English as system language, javadoc/kdoc html files have at the top, but if I do it with the system language set to Spanish, it will replace it with everywhere. Is there an option in Dokka to set the preferred global content language for the output htm...
DuckN'Bear
1

votes
0

answer
15

views

How to get node.js console to pause in Visual Studio 2017?

I'm using Visual Studio 2017 with the built in tools support for node.js. I want to be able to create a empty console node.js project and run the debugger and see the console window output. However, when I run it, it opens the console and runs the script so quickly I cannot see what it is doing. I...
Bear
1

votes
1

answer
43

views

Creating an array of objects but it doesn't find the symbols

I am creating an array of Players in a minigame in Java. There is a class called Players and one called Game. In the Main we scan two names and send them to the Game game.createPlayer(name1, name2); and later on try to get some information back playerArray[(game.getPlayerTurn() % 2)].getPlayerName...
Thomas Bear
1

votes
1

answer
178

views

MySQL create view problem,

I'm using a view as a table to join data on 3 tables: create view category_list as select forum_categories.*, max( forum_answer.a_id ) as latest_answer_id from forum_categories left join forum_question on forum_question.catid = forum_categories.id left join forum_answer on forum_answer.question_...
bear

View additional