date stringlengths 10 10 | nb_tokens int64 60 629k | text_size int64 234 1.02M | content stringlengths 234 1.02M |
|---|---|---|---|
2018/03/07 | 1,616 | 4,704 | <issue_start>username_0: I have a model object described as a named list of vector and matrix parameters. Two basic operations with this class of objects are the loading and storing from/to a numeric vector, based on a **mapping** between the elements of each parameter vector or matrix and the indices in the vector. He... |
2018/03/07 | 394 | 1,471 | <issue_start>username_0: I have the following directory structure:
```
|_ director_script.py
|_ app/
|_ __init__.py
|_ ParentClass.py
|_ my_module/
|_ __init__.py
|_ MyClass.py
|_ MyClassTestCase.py
```
In my `director_script.py` I use `MyClass` an... |
2018/03/07 | 1,106 | 4,003 | <issue_start>username_0: Merges two strings together, using alternating characters from each, except that runs of the same character are kept together. For example, ("abcde", "xyz") returns "axbyczde"
("abbcde", "xxxyzzzz") returns "axxxbbyczzzzde"
Given the code below, the output I get is "axbxbcydzezzzz" Not only doe... |
2018/03/07 | 1,041 | 2,837 | <issue_start>username_0: ```
select1 select2
a1 b1 c1 a2 b2 c2 (column name)
34 64 65 45 67 54
34 43 65 74 75 54
63 54 45 546 76 46
combined
a1 b1 c1 a2 b2 c2
34 64 65 45 67 54
34 43 65 74 75 54
635 54 45 54 76 4... |
2018/03/07 | 789 | 2,422 | <issue_start>username_0: I am trying to implement a visualisation to control my PLC with a Touchscreen. I want to create a button which description changes depending of the state of the button.
Example: At the beginning the Buttons says 'start'; after it is pressed it should say 'stop'.
Can anybody tell me how to ... |
2018/03/07 | 1,314 | 3,582 | <issue_start>username_0: I have some data I `melt` and `dcast` using the `reshape2` package, as follows.
```
dat <- data.frame(Name = c("Alice", "Alice", "Alice", "Alice", "Bob", "Bob", "Bob"),
Month = c(1, 1, 1, 2, 1, 2, 2),
Product = c("Car", "Bike", "Car", "Car", "Car", "Bike", "Bike"),
... |
2018/03/07 | 510 | 1,668 | <issue_start>username_0: I am trying to send file in an api using `curl` in Yii 1. `File` us uploaded using a form and it is then sent to the `server` using api. This is what I am doing:
```
$apiFile= CUploadedFile::getInstanceByName('bases');
$apiFile = new CURLFile($apiFile->name, $apiFile->type, $apiFile->tempName... |
2018/03/07 | 372 | 1,348 | <issue_start>username_0: I have a input field. When the user type some value then it must autocomplete based on the user search. I am using following code. I am getting the data but it gets very slow if result is more than 50 and sometimes system crash out.
How can I improve my code so that it works fine.
```
$( "#c... |
2018/03/07 | 956 | 3,196 | <issue_start>username_0: I wrote a java program "Test" which is:
```
class Get{
static void fIntarray(int[] b){
b = {10};
}
}
class Test{
public static void main(String[] args){
int[] a;
Get.fIntarray(a);
System.out.println(a[0]);
}
}
```
But when I compiled it, the c... |
2018/03/07 | 319 | 973 | <issue_start>username_0: Looks like it prints out something like [[], [], []].
could someone rephrase it without using list comprehension?<issue_comment>username_1: You are creating a list of empty lists of size **vertex**.
These are called list comprehensions.
For ex:
```
foo = [i for i in range(10)]
print(foo)
``... |
2018/03/07 | 498 | 1,463 | <issue_start>username_0: On a Linux Mint 64-bit PC
This C program does not compile:
```
#include
#include
int main(int argc, char\* argv[])
{
gtk\_init(&argc, &argv);
return 0;
}
gcc `pkg-config --cflags gtk+-3.0` -o hello hello.c `pkg-config --libs gtk+-3.0`
```
The compile error message is: hello.c:2:29: f... |
2018/03/07 | 813 | 2,599 | <issue_start>username_0: When I press the Login button it refreshes the page and doesn't do anything. I tried entering wrong Server IP just to check the error, but I guess it's not responding to the login button and directly refreshing the page.
Unable to call a PHP function in the HTML file, tried using the same cod... |
2018/03/07 | 1,019 | 3,710 | <issue_start>username_0: I'm planning to use this [package](https://github.com/overtrue/laravel-follow) as it looks good for what I'm looking for. (it adds a user based follow system for Follows/Likes/Votes)
I have added the traits to my user model and professionals model as per their documentation and created a butto... |
2018/03/07 | 674 | 1,931 | <issue_start>username_0: I'm new at R, so sorry if I'm asking a stupid question.
I'm trying to generate random numbers from normal distribution as far as they will form a decreasing sequence of numbers, that means that the generator stops when Y\_n < Y\_(n+1).
I know that I have to use some for and while cycles, but ... |
2018/03/07 | 1,655 | 5,874 | <issue_start>username_0: My vue component like this :
```
...
![]()
...
export default {
props: ['banners'],
data() {
return {
baseUrl: App.baseUrl,
bannerId: this.banners.id,
photo: this.banners.photo // result : chelsea.png
}
},
methods: {
onFileChange(e) {
let files = e.target.files,
reader = new... |
2018/03/07 | 592 | 2,060 | <issue_start>username_0: I can run my program in the terminal, but when I run it directly using Pycharm, it gives
>
> AttributeError: module 'matplotlib' has no attribute 'verbose'
>
>
>
[](https://i.stack.imgur.com/YYncx.png)<issue_comment>usern... |
2018/03/07 | 1,240 | 4,918 | <issue_start>username_0: I'm new on java world.I have this error "package org.springframework.boot does not exist" on my SpringApplication Runner class.But i added Spring Boot dependency to pom.xml
I do not understand why i got this error.
pom.xml
```
org.springframework.boot
spring-boot-starter-data-jpa
org.sp... |
2018/03/07 | 422 | 1,585 | <issue_start>username_0: I have 2 versions of python on my mac they are 3.6.4(downloaded one) and 2.7.10(default one) . i want to use pandas on my IDLE3.6. So I tried to install using pip. But pip got installed in the 2.7 site-packages.But the IDLE always open python 3.6.4 and when I say import pandas , it says module ... |
2018/03/07 | 456 | 1,648 | <issue_start>username_0: It's a like dislike button, connected with a database. But it only takes the first variable "storyid".
```
function savelike(storyid, username, autid)
{
$.ajax({
type: "POST",
url: "<?php echo site\_url('site/homecontroler/savelikes');?>",
Data: "Storyid="+storyid,
success: function (res... |
2018/03/07 | 749 | 2,537 | <issue_start>username_0: I have the table which consist of column with datatype `text`.
**Table** EmployeeMaster
```
CREATE TABLE [EmployeeMaster]
(
EmpID int identity(1,1),
EmpName varchar(20),
EmpPhone int,
EmpAddress TEXT
);
```
And I want to create audit log on this table.
**Audit Table**: Emp... |
2018/03/07 | 1,413 | 5,135 | <issue_start>username_0: For curiosity and because I think this can be helpful in the future, I tried to do a very simplistic animation through a Promise() object, trying to figure it out how it would work and understand how to structure it, but I'm a bit unsure of its structure, because there's a function *movingBox* ... |
2018/03/07 | 712 | 2,676 | <issue_start>username_0: I want to make a file, which is called ObjectsInfos.java
It has too many objects' info.
Which way is the best to implement the problem? Which one is the most effective?
Singleton ? Inheritance? ..?
Thanks for helping.
.. Edit. The informations will be added later. So I must write the informat... |
2018/03/07 | 636 | 2,638 | <issue_start>username_0: I'm new to C#. I have following code:
```
XmlNodeList elemList = xmlFile.GetElementsByTagName("Position");
for (int i = 0; i < elemList.Count; i++)
{
string posNumber = elemList[i].Attributes["PosNumber"].Value;
string posGroup = elemList[i]... |
2018/03/07 | 2,082 | 6,879 | <issue_start>username_0: Getting to know Tensorflow, I built a toy network for classification. It consists of 15 input nodes for features identical to the one-hot encoding of the corresponding class label (with indexing beginning at 1) - so the data to be loaded from an input CSV may look like this:
```
1,0,0,0,0,0,0,... |
2018/03/07 | 231 | 949 | <issue_start>username_0: I have 3 radio buttons with ng-model - client.ssoApiClientAuth and ids - apiClientAuthMeth0, apiClientAuthMeth1, apiClientAuthMeth2
I have a password field with ng-model - client.newPassword and id - apiClientSecret.
I need to greyout/disable password field when apiClientAuthMeth1 is selected... |
2018/03/07 | 712 | 2,888 | <issue_start>username_0: Im new to laravel and have completed a project on the latest version laravel 5.6
However, the only thing that is pending to learn and implement is the search functionality which is the core of every application. The application i have coded is a huge project and i do not want to mess it up so ... |
2018/03/07 | 382 | 1,409 | <issue_start>username_0: Is there a way to install qpoases for python 3 in linux?
I have used this link instruction [enter link description here](https://projects.coin-or.org/qpOASES/wiki/QpoasesInstallation), but I haven some error during installation.
my result in terminal :
[enter image description here](https://... |
2018/03/07 | 545 | 2,168 | <issue_start>username_0: I'm working on image picker with `camera` and `gallery` and using following code to get image captured from camera but `imageurl and image name` is nil.I'm testing on mobile with os version of 11.2.2.
```
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithIn... |
2018/03/07 | 453 | 1,678 | <issue_start>username_0: I'm trying to execute a JavaScript function. I get an error everytime the function enters the Ajax block saying:
>
> $ is not defined
>
>
>
How can I solve this problem? I'm Programming a `Google Chrome Addon` and I get this error in my .js file:
[ with the help of `dynamic builder API`. This link is working fine (No error found in Debug Dynamic Links doc). Now, I ... |
2018/03/07 | 369 | 1,371 | <issue_start>username_0: Simple example for my problem:
```
char answer;
printf("enter your favorite letter: \n");
answer = getchar();
```
Now here is the problem. I want to print that character in screen. But by using "answer" variable.
Something like this:
```
printf(answer);
```
But of course it doesn't work... |
2018/03/07 | 435 | 1,449 | <issue_start>username_0: Where am I going wrong? I have this code:
```
CComboBox m_item;
if((m_item.GetCurSel()) == atoi("TC001"))
MessageBox(L"TC001");
if((m_item.GetCurSel()) == atoi("TC002"))
MessageBox(L"TC002");
```
If I select "TC001" in the `ComboxBox`, it pops up **both** "TC001" and "TC002" messag... |
2018/03/07 | 1,491 | 4,325 | <issue_start>username_0: ```
var JobList = new UpdateJobDetails();
JobList.jobDetails = (from b in Result
where (b.JobStatus !=4 && b.ActionStatus != 0) || (b.JobStatus !=5 && b.ActionStatus != 0)
select b).ToList();
```
If I do so this query is taking all the conditions... |
2018/03/07 | 770 | 3,474 | <issue_start>username_0: Hi all when I try to update any record in the database it shows successfully updated however when I check the database it is not yet updated.
There is no error in the code but it is not working. Can anyone look into this and point out the problem in the code.
I am trying to update the usernam... |
2018/03/07 | 482 | 1,795 | <issue_start>username_0: I am trying to leverage the following modal example <https://codepen.io/centem/pen/wrYeMV> but instead of using a button to launch the modal I am trying to launch the modal when a div rectangle is clicked and capture its id before launching the modal. This is the pen with the rectangles. <https... |
2018/03/07 | 671 | 2,725 | <issue_start>username_0: I have two docker images `Mosquitto` & `user-info`. `userInfo` is a container which performs some logic and then send the result to `mosquitto`. Mosquitto then use this information to send it to IOT hub. Inside `user-info` I have mentioned to use `hostname=mosquitto` so the `user-info` send all... |
2018/03/07 | 597 | 2,343 | <issue_start>username_0: I'm just scripting something for some new software. Therefore i have to remove some older software. I'm doing this whit a PS script. This works almost fine. The elevated rights are working, the software got removed, but there is always a message from the first uninstalling concerning a reboot. ... |
2018/03/07 | 2,033 | 5,843 | <issue_start>username_0: Receiving the following error when running Selenium via Flask/Python
```
browser = webdriver.Firefox()
[Wed Mar 07 03:02:27.719608 2018] [:error] [pid 21555] [client 192.168.127.12:36139] File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 151, in __in... |
2018/03/07 | 498 | 1,996 | <issue_start>username_0: I'm new with odoo 11, I want to show a custom error popup but I want to show it like the popup error displayed when we miss a required field and this is not possible with ValidationError.
Is that possible ? If not, is it possible to use JavaScript api for notification like sweet alert ?<issue_c... |
2018/03/07 | 652 | 2,555 | <issue_start>username_0: Is it possible to change the database connection timeout at runtime? As far as I know the only way is to modify the connection string, and then create a new connection instance with the modified connection string (replacing the timeout attribute of the string).
```
```
Some methods on a serv... |
2018/03/07 | 593 | 2,365 | <issue_start>username_0: I am trying to use dependency injection instead of following singletons. This is how I am trying to achieve. When I run the application I am having an error on `"No "decodeObject" candidates produce the expected contextual result type "ModelManager"` on that. Any idea how can I implement depend... |
2018/03/07 | 682 | 1,533 | <issue_start>username_0: I have a sidebar with several menu items. Each item is a that consists of SVG image and text inside `####`. I want to change their color when I hover on this item div. Unfortunately, my approach doesn't work.
Here is my HTML:
```
#### Опрос
```
My CSS:
```
.nav-flex {
display: flex;
cur... |
2018/03/07 | 595 | 2,378 | <issue_start>username_0: Thanks for taking time and looking into my query. I have below scenarios and would require your help on suggesting a good BI tool.
Scenario:
1. We are organization of 500 employees
2. There will be 10 designers out of 500 who will be designing the dashboard using BI desktop tool
3. We are goi... |
2018/03/07 | 311 | 1,152 | <issue_start>username_0: Is it somehow possible to see how many times a specific file was requested from the server, or set up a system to see it in the future?
In my case, it is a Javascript file on my server that is included on many different websites.
My setup is using LAMP.<issue_comment>username_1: You can see r... |
2018/03/07 | 610 | 1,774 | <issue_start>username_0: I'm working on my project about scheduling algorithm (FCFS) in C++. All the things left I need to do is gantt chart. Here's an example:
[](https://i.stack.imgur.com/0X6IW.png)
I can sort if it is only the arrival time but I'm getting ... |
2018/03/07 | 934 | 2,636 | <issue_start>username_0: I have a task on which I have no idea how that could even work out.
I have to find records, which have a time difference of X and where a boolean is ON/OFF. I tried to use a `LEFT OUTER JOIN` and used the conditions in the ON clause, but it gave me the wrong result.
So my question is, how ca... |
2018/03/07 | 795 | 3,241 | <issue_start>username_0: I tried every single variation that I could find on the internet. Everything. And still every time I get the very same exception:
>
> System.Data.SqlClient.SqlException: 'A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not fo... |
2018/03/07 | 1,072 | 3,419 | <issue_start>username_0: I have a DataFrame `df` like this:
```
Pattern String
101 hi, how are you?
104 what are you doing?
108 Python is good to learn.
```
I want to create ngrams for String Column.
I've create unigram using `split()` and `stack()`
``... |
2018/03/07 | 3,486 | 10,182 | <issue_start>username_0: I have problem with the black border which is on left and right of the website, how do I fix it? Which element do I need to change to fix that? Is anything missing there? I copied this from my textbook. But I don't know why its not working. I tried changing css as html was provided by instructo... |
2018/03/07 | 514 | 1,693 | <issue_start>username_0: I am trying to write recursive function in Scala returning first and last element of the list (pair). I'd like to only use `.head` and `.tail` without `match` using simple (not tail) recursive (without defining additional function). Is it possible?
Last element I can find using this code:
```... |
2018/03/07 | 1,662 | 4,343 | <issue_start>username_0: According to [the specification](https://www.ecma-international.org/ecma-262/8.0/index.html#sec-object-type), a string-valued property key whose numeric value is `2 ** 53 - 1` must be treated as an integer index.
According to [the specification](https://www.ecma-international.org/ecma-262/8.0/i... |
2018/03/07 | 468 | 1,687 | <issue_start>username_0: Can a Windows batch file determine its invoked filename when invoked through a shortcut?
For example, I create `real.bat`, and create its shortcut named `phony.bat` (`.lnk`?)
And invoke `phony` by double-click on it.
Can this batch file detect the name `phony.bat` instead of `real.bat`?
Of ... |
2018/03/07 | 349 | 1,160 | <issue_start>username_0: I have enabled `AllowOverride All` in Apache configuration file.
This the URL users are typing in browser
```
http://hostname/system_name/dynamic_text/login
```
This needs to be working as below
```
http://hostname/system_name/index.php?id=dynamic_text
```
I have created rewrite rule as ... |
2018/03/07 | 385 | 1,401 | <issue_start>username_0: Situation is like this. I have master and a branch that lets call it "image2"
So from the latest master up to date, I branched and created image2. I continued working on image2 branch.. and after a while a huge bug was found that also affected the master.
Now because master version is live, I... |
2018/03/07 | 826 | 3,014 | <issue_start>username_0: I'm trying to add bootstrap to my Spring Boot project using Thymeleaf.
index.html
```
```
footer.html
```
```
header.html
```
Модуль планирования ПД
```
MvcConfig.java
```
@Configuration
public class MvcConfig implements WebMvcConfigurer {
@Override
public void addResour... |
2018/03/07 | 668 | 2,034 | <issue_start>username_0: **How can I inline align form with a button?**
**HTML**
```
```
**CSS**
```
/*Just those buttons*/
div div button {
margin-top: 3px;
font-size: 17px;
margin-right: 10px;
display: inline !important;
padding-bottom: 1px !important;
border: 2px solid #474747;
color... |
2018/03/07 | 4,905 | 15,465 | <issue_start>username_0: I want to rotate a shape on canvas on mouse move, and I want to detect if mouse is moving in `clockwise direction` or not, but I do not know how to do that. Here is my code:
```js
var canvas = document.getElementById('canvas');
var img = document.getElementById('photo');
var ctx = canvas.get... |
2018/03/07 | 474 | 1,796 | <issue_start>username_0: I have an array that stores all my levels in a game. This array searches for all levels and
* orders them by their levelId
* removes the levels that are locked
So I go for this code
```
private Level[] levels;
private void Start()
{
levels = FindObjectsOfType(); // find all levels
leve... |
2018/03/07 | 583 | 2,131 | <issue_start>username_0: I have multiple datasets which has same columns name as below example, I want the columns which are repeated in multiple datasets sort out in list format using python and pandas.
```
df1 = pd.DataFrame({'A': 'foo bar foo bar foo bar foo foo'.split(),
'B': 'one one two three two ... |
2018/03/07 | 376 | 1,346 | <issue_start>username_0: I'd like to complete an autologin script, but I need to find and click a button without ID or Name.
```
```
How can I find such element using javascript?
thanks<issue_comment>username_1: Since the button is a `submit` button, one option is to submit the form rather than clicking the submit ... |
2018/03/07 | 602 | 2,022 | <issue_start>username_0: ```
public static boolean mystery(int[] array, int target) {
for(int i = 0; i < array.length; i++) {
if(array[i] == target)
return true;
else if(array[i] > target)
return false;
}
return false;
}
```
`int a[] = {2,5,11,14,15,27,31}`
1) What does myster... |
2018/03/07 | 399 | 1,563 | <issue_start>username_0: I wrote codes to access android native from react native,
to show the toast-like example on react native docs <http://facebook.github.io/react-native/docs/native-modules-android.html>
It works well, but when I try to use intent, there's an error.
Can someone help?
```
package com.myApp;
imp... |
2018/03/07 | 2,248 | 8,702 | <issue_start>username_0: I need to send verification email to the user in my application and in that mail i want to send an url as a hyperlink, i am able to send email successfully but i am not getting how to send hyperlink in the body text.
My code where i am sending email to user :-
```
class SendEmailAsyncTask ex... |
2018/03/07 | 816 | 2,978 | <issue_start>username_0: I have a base64 string and I want to convert it to a PDF file. I am using the SAP UI5 framework. I already tried it with atob(), but the pdf does not open.
Any suggestions how to do that?
BR,
ajsnub
Here is my coding:
```
onClick: function(oEvent) {
var base64 = "JVBERi0xLjUNC... |
2018/03/07 | 459 | 1,039 | <issue_start>username_0: I try to generate a infinite list like this:
```
[1,-2,3,-4..]
```
with this code:
```
[ m | n <- [1..],m <- [n, -n]]
```
but this code reduplicate all numbers like this:
```
[1,-1,2,-2..]
```
So i dont know what to do<issue_comment>username_1: You can group these as follows:
```
[[1... |
2018/03/07 | 524 | 1,442 | <issue_start>username_0: My http query
```
http://testemu.foo.com:5050/reportGroup?customerId=4&token=<PASSWORD>&searchKey={"brandId":1,"sourceType":"E-Commerce","startDate":"01/01/2017","endDate":"31/12/2017"}
```
Jmeter is throwing error
>
> java.net.URISyntaxException: Illegal character in query at index 109
... |
2018/03/07 | 600 | 1,905 | <issue_start>username_0: i want to access a wcf service so i added it as a web reference in my xamarin android project but whenever i try to create its client it does not recognize it.
i am attaching screenshots in a step by step order
[This is the working wcf service](https://i.stack.imgur.com/KJvIc.png)
[I added i... |
2018/03/07 | 655 | 2,122 | <issue_start>username_0: I need to use the $\_GET variable into the blade.
The AJAX code work good, i received an alert with the correct value but i can't use it into the blade.
Route:
```
/*
|--------------------------------------------------------------------------
| Routes per gestire la pagina "Home"
|-----------... |
2018/03/07 | 616 | 2,054 | <issue_start>username_0: I'm trying to set image as 'UITableView`cell background.I create`UIiImageView`in`cellforRowAt` func and add to cell as subView, but the result is :
[](https://i.stack.imgur.com/3SHqI.png)
It is ok only for first cell . My co... |
2018/03/07 | 1,188 | 3,955 | <issue_start>username_0: I just take a few modifications on a Dockerfile to run it with nginx on Heroku. Something special about Heroku is, that everything is running as non-root. Second certain behaviour is the use of a random Port which comes from Heroku itself and you can't be modified. They provide the env $PORT wh... |
2018/03/07 | 733 | 3,148 | <issue_start>username_0: I have come across this new method definition. Need explanation what exactly happens here.
Parent trait
```
sealed trait Generic{
def name : String = name // what is the body of this function call?
def id : Int = id
def place : String = place
}
```
Child case classes
```
cas... |
2018/03/07 | 673 | 2,074 | <issue_start>username_0: What would be the shortest way to write a condition for javascript `filter` method?
I know this way: `array.filter(elem => elem > 2);` But I know you can write this even without specifying an `elem` parameter.
`array.filter($1 > 2)` or like so.<issue_comment>username_1: The shortest would be... |
2018/03/07 | 963 | 4,043 | <issue_start>username_0: Is it possible to make Visual Studio to copy all dependencies of referenced projects into the output path?
Example
-------
In the Solution, Project A (Library, .NET Standard) defines some functions and is dependent on Library L1 (via NuGet) and Library L2 (local `.dll`, referenced and copied ... |
2018/03/07 | 714 | 2,847 | <issue_start>username_0: We can trigger vibration on supported devices like so:
```
navigator.vibrate(50);
```
But does the API support any access to user-defaults? In other words, is it possible to get the vibration duration from the OS? So when a user would normally press a button when using the device, get that v... |
2018/03/07 | 1,346 | 4,367 | <issue_start>username_0: I am new to regular expressions and need to perform a specific task with the same. I would require a regex that performs global search and checks if there are 3 or more consecutive digits in a string and if yes, then replaces all the digits with "xxxx".
For example, the string
>
> abcdef 12 ... |
2018/03/07 | 1,050 | 2,476 | <issue_start>username_0: [check demo on typescript playground](https://www.typescriptlang.org/play/#src=function%20get(params%20%3D%20%7B%7D)%3Astring%20%7B%0D%0A%20%20%20%20let%20url%20%3D%20''%3B%0D%0A%0D%0A%20%20%20%20const%20paramStr%20%3D%20Object.keys(params).reduce((str%2C%20key)%20%3D%3E%20%7B%0D%0A%20%20%20%20... |
2018/03/07 | 478 | 1,591 | <issue_start>username_0: Hi I am currently working on trying to convert a gray scale image to its original color format using Open CV in python.
```
import cv2
img = cv2.imread('bw.jpg')
img = cv2.cvtColor(img, cv2.COLOR_GRAY2RGB)
cv2.imwrite('gray_image.png',gray_image)
```
executing this produces an error:
``... |
2018/03/07 | 472 | 1,959 | <issue_start>username_0: Is it possible to save file attachments in C# through Microsoft Graph API?
I know I can get the properties of the attachment (<https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/attachment_get>) - can we also save it to a certain location?<issue_comment>username_1: When yo... |
2018/03/07 | 1,135 | 4,332 | <issue_start>username_0: I'm using an API that returns this pretty horrible JSON:
```
[
"A string",
[
"A string",
"A string",
"A string",
"A string",
…
]
]
```
I'm trying to decode the nested array using JSONDecoder, but it doesn't have a single key and I really don't know where to start… D... |
2018/03/07 | 1,131 | 3,235 | <issue_start>username_0: Here is my table (spacing only for better view)
```
month country temp
1 AU 15
1 AU 20
2 AU 10
3 AU 20
3 AU 20
3 AU 15
1 CZ 10
1 CZ 5
1 CZ 3
2 CZ 15
2 ... |
2018/03/07 | 875 | 2,618 | <issue_start>username_0: The application allows the user to draw on a canvas, these are some of the things they can draw:
1. Draw line: User starts by clicking a point on the canvas to mark the start point, then drag and release the mouse to mark the end point.
2. Draw rectangle: User starts by clicking a point on the... |
2018/03/07 | 666 | 2,020 | <issue_start>username_0: I am struggling to center my H1 tag inside my main tags. If I use position fixed with top:50% and left:50%, it works a bit, though I am never able to center it to the middle. Nothing else will work. Any advice ?
```css
main .container {
margin-top: 40%; }
main .container .row h1 {
t... |
2018/03/07 | 1,140 | 4,046 | <issue_start>username_0: I am attempting to query a DB from VBA, in order to avoid such issues a SQL injection I have been told I should parametrise the SQL string of code. The code I have at the moment, which returns no error, but no result either (!) is:
```
Sub ImportData_Click()
Dim strSql As String
Dim strDate A... |
2018/03/07 | 1,496 | 5,790 | <issue_start>username_0: I’m trying to add something to a map of arrays and the value binding does not pick up the change :-(
I have something like this:
```js
properties: {
deals: {
type: Object,
notify: true,
value: function () {
... |
2018/03/07 | 819 | 2,479 | <issue_start>username_0: I am using mpdf library in PHP to create a pdf file from HTML. I need to set the page mode in Custom mode<issue_comment>username_1: Please see this example code -
```
$mpdf=new mPDF('utf-8', array(190,236)); // Define a page size/format by array - page will be 190mm wide x 236mm height
```
... |
2018/03/07 | 965 | 3,320 | <issue_start>username_0: I have a pure JS function in which i have tried to convert majority to jquery. How do I set the entire function to a proper `jquery syntax`?
```
function openResources(e, resourceName) {
var i, tabcontent, tabs;
tabcontent = $(".resources__all-tabs-container");
for (i = 0; i < ta... |
2018/03/07 | 3,328 | 9,996 | <issue_start>username_0: I am kinda new to stored procedure and scalar values. Somehow I came up with a thread wherein I need to convert my stored procedure to scalar value in order to produce the output I wanted. I tried converting my stored procedure into a function and now I am getting the error **Must declare the s... |
2018/03/07 | 2,069 | 6,318 | <issue_start>username_0: I'm beginner & I need help
I try this code for check the id for employee to enable or disable the checkbox depend on the id for employee but the checkbox was disabled even when I login with the same Id in the session
```
if (Session["employeeNo"] == "12345")
{
CheckBoxList1.Enabled = t... |
2018/03/07 | 644 | 2,118 | <issue_start>username_0: I have a question about dicts. I'm a noob and have been looking through this topic extensively, but I can't seem to wrap my head around it. What I am trying to do is take this huge list I have from a text file(12 million terms), put it in a dict, and take items that share certain characteristic... |
2018/03/07 | 1,221 | 3,949 | <issue_start>username_0: Consider the followings:
```
protocol A: Codable {
var b: B { get }
var num: Int { get }
}
protocol B: Codable {
var text: String { get }
}
struct C: A {
var b: B
var num: Int
}
```
The compiler gives two errors
* Type 'C' does not conform to protocol 'Decodable'
* Type 'C' does n... |
2018/03/07 | 734 | 2,399 | <issue_start>username_0: I'm learning how to use makefile however after a few hours of research and still being stuck I just can not manage to resolve what is wrong with my makefile:
```
output: main.o module.o
g++ main.o module.o -o output
main.o: module.cpp module.h
g++ -c module.cpp
module.o: module.cpp mo... |
2018/03/07 | 2,994 | 12,413 | <issue_start>username_0: As SOLID principles say, it's better to remove switch conditions by converting them to classes and interfaces.
I want to do it with this code:
>
> Note: This code is not real code and I just put my idea into it.
>
>
>
```
MessageModel message = getMessageFromAnAPI();
manageMessage(messag... |
2018/03/07 | 391 | 1,506 | <issue_start>username_0: I issued new identity to already existing participant by composer rest server and got it activated. Now in wallet section section I selected the new card to use composer rest server. ACL for participant is:
```
rule SimpleRule {
description: "Description of the ACL rule"
participant: "org.exam... |
2018/03/07 | 536 | 1,879 | <issue_start>username_0: I would like to open and add a text file content into a list Box, but if I want to add another text file, how do I check if the file that I add is already added into the list Box. I mean I don't want the list box to be duplicated.
```
private void openAndAddToolStripMenuItem_Click(object sende... |
2018/03/07 | 486 | 1,623 | <issue_start>username_0: The problem is I have a set of data in two columns. Ex:
A B
3 5
6 **7**
**4 4**
7 8
1 6
8 **7**
Here I want to figure out the values that are same in both A & B column(4 & 4). Also I want to know the duplicates that are present in the B column(7 & 7).
After figuring it out, is there... |
2018/03/07 | 477 | 1,645 | <issue_start>username_0: I have a liking to finding shortest methods for coding. I have found a need for a method for calculating the sum of the digits(or the number of 1s in a number) of a number represented in binary. I have used bit operators and found this:
```
r=1;while(a&=a-1)r++;
```
where a is the number, an... |
2018/03/07 | 717 | 2,263 | <issue_start>username_0: I struggle to render a simple grid for my test project.
Didn't want to create grid by hand, because with bigger grids that would not only be a chore, but also the code would be cluttered, so figured I should use lodash for this.
However, I can't seem to render the grid, it's just not visible ... |
2018/03/07 | 666 | 2,128 | <issue_start>username_0: FYI - This all works when run on a Mac, but I am wanting to run on Windows.
I am running the following commands from IntelliJ terminal:
>
> 1 - `docker login` (logging in with my credentials and getting the success message)
>
>
> 2 - `docker-compose up` (to create and start the container)
... |
2018/03/07 | 615 | 1,922 | <issue_start>username_0: I probably discovered a bug of a PHP function http\_build\_query().
I am developing a search engine with dynamic form and some of these parameters are array.
I simply get the query url from the current $\_GET with http\_build\_query().
But all of these array parameters are **automatically cha... |
2018/03/07 | 983 | 2,673 | <issue_start>username_0: I have a table in SQL Server with the following format
```
MType (Integer), MDate (Datetime), Status (SmallInt)
1, 10-05-2018, 1
1, 15-05-2018, 1
2, 25-3-2018, 0
3, 12-01-2018, 1
....
```
I want to get the MIN `MDate` for specific `MTypes` for future dates. In case there isn't one, then the ... |