id stringlengths 3 6 | prompt stringlengths 100 55.1k | response_j stringlengths 30 18.4k |
|---|---|---|
82013 | So my system requires that Roles have associated Expiry dates. I have implemented the Identity 2.0 framework, and things are going smoothly, but I've run into an issue that is making me doubt my structure.
```
public class ApplicationUserRole : IdentityUserRole
{
public override string UserId { get; set; }
pub... | Take a look at below video tutorial on using asp.net identity using existing database tables. I think you have to let ApplicationUser table know that you have new field in your ApplicationUserRole table. So that you have to follow entity framework model binding in order to achieve that.
Part 1 - <https://www.youtube.c... |
82037 | I don't know how to write this without it sounding like a plug (lol), but it's not. So please don't close-vote it, even if you really want your editor badge. Here goes:
There's this site called av-comparatives that I use and trust to provide me independent antivirus reviews. You probably do, too, actually. While I kee... | Possibly. It's not immediately clear if you are relying on the email address as the sole identifier (i.e. you're using it as the username) or if a separate username is in play. If the latter case, then the obvious flaw is that an attacker can supply the username of someone else, but provide their own email address as t... |
82606 | I have created the following query:
```
SELECT wvwcs1.*, wvwcs2.* FROM wvwcs1
inner join wvwcs2 on wvwcs1.id = wvwcs2.wvwcs1_id
inner join wvwcs2 w2 on wvwcs1.id = wvwcs2.wvwcs1_id AND wvwcs2.value LIKE '%ee%'
```
My tables are created like so:
```
CREATE TABLE `wvwcs1` (
`id` int(10) unsigned NOT NULL AUTO_INCR... | I have got the same error. I realized that I have installed the **wrong apache beam** package. You need to add **[gcp]** to the package-name while installing apache beam.
```
sudo pip install apache_beam[gcp]
```
Some more optional installation to fix the installation errors and you are good to go.
```
sudo pip in... |
83214 | We have a bunch of unit tests which test a lot of webpages and REST API services.
Currently when our tests run it pulls from these pages live but this can take ages to run sometimes, and it also feels like the tests should be testing more of our code - not just relying on them being up and responding (if that makes se... | It sounds like you are trying to test too much at a time yes.
You should test the code generating the response for the Rest API (if this code is under your cotrole) and the code using it completely separately. If you don't control the code generating the API you should feed the code using it with fake, valid API answe... |
84250 | I've tried to install bunch of python packages in Google Cloud Platform Console. However, the disk space was not enough and installation failed. Interestingly, at some point, the network connection was lost and I should reconnect it.
And then I've checked some packages which had been already installed before I tried t... | This is a known limitation of Google Cloud Shell - after about an hour of inactivity, any modifications outside of $HOME are lost, including installed packages. See [Custom installed software packages and persistence](https://cloud.google.com/shell/docs/limitations#custom_installed_software_packages_and_persistence "Cu... |
84500 | Based on [this](https://mathematica.stackexchange.com/a/655/204) I'd like to close the mathematica front end without the nagging dialog boxes that follow.
Why am I trying to do this?
I have a bash script which is such:
```
#!/bin/bash
mathematica bfile01.nb
pid1=$(pgrep mathematica)
kill -9 $pid1
! [ -z `pidof mat... | Take a look at: [Programmatically quitting the FrontEnd or running without one?](https://mathematica.stackexchange.com/questions/8392/programmatically-quitting-the-frontend-or-running-without-one)
I asked some similar questions and the answers have some good strategies to do this although most of them as workarounds ... |
85056 | I would like to create a select list on my view that allows the client to chose the customer from that select list.
My view model looks like this:
```
public int SalesOrderId { get; set; }
public int CustomerId { get; set; }
public string PONumber { get; set; }
public DateTime OrderDate { get; set; }
public List<Cus... | Arent you missing "" in options text and options value ?
```
<select class="form-control" name="Customers" id="Customers" data-bind="options: Customers, optionsText: "CustomerName", optionsValue: "CustomerId", value: CustomerId"></select>
``` |
85138 | **On the left is Chrome and on the right is IE9.**

As you can see with the image above, even with the *Meyer CSS Reset* there are yet inconsistencies between browsers. Two examples in this image:
1. IE9 clearly has a darker font for just about all ... | The differences you point out are all based on the fact that two different fonts are being used in your chrome and IE9 outputs. Once you tweak the css `font-family` so both browsers use the same font then it should be ok.
**UPDATE:**
After seeing your css, you're specifying only `Lato` font for your elements, it se... |
85213 | First of all for some reason I have two different "switch keyboard layout" hotkeys: one which I set in `Settings->Devices->Keyboard` and the second one(Left ctrl + Left shift) is produced by `keyboard-configuration` package.
Calling `sudo dpkg-reconfigure keyboard-configuration` and removing hotkey binding solves the... | Besides running `sudo dpkg-reconfigure keyboard-configuration` you probably need to remove it from the desktop settings too. Try this command:
```
gsettings reset org.gnome.desktop.input-sources xkb-options
```
After that the removal of the extra shortcut should survive a reboot. |
85233 | As the title suggested, can we find positive measure sets$\{V\_j\}\_{j\in\alpha}$, such that $$V\_j\cap V\_k=\emptyset, \quad \cup\_{j\in\alpha}{V\_j=\mathbb{R}^{n}},$$
and the cardinal number of this set is $\aleph\_1$. | If $\mathbb{R}^n$ is the disjoint union of subsets of positive measure, there are at most $\aleph\_0$ of these subsets.
Suppose that there are an infinite number, as otherwise the proposition is evident. Partitioning any subsets of infinite measure into ones of finite measure can then be done without increasing the (i... |
85247 | Are there any set of numbers into which any of the indeterminate forms we see in a calculus course, like 00, n/0, 1infinity, etc has an answer?
I'm asking that because, thanks to the Net, I took notice of other kinds of numbers besides those commonly seen in the high school and most of the university courses: Real and... | $0^0$ and $1^\infty$ are indeterminant forms because when you have limits where the pieces approach those parts, any value is possible. They aren't usually defined even in other number systems because it doesn't mesh well with the limits (although some advanced real analysis books will define $0\*\infty$ to be $0$, the... |
85530 | I'm trying to learn how to use SQL in python with MySQL (since all my projects use MySQL), but it seems to have issues with the IF EXISTS statement.
from command line:
```
DROP TABLE IF EXISTS accessLogs;
```
returns:
```
Query ok, 0 rows affected, 1 warning (o.00 sec)
```
and the table is successfully dropped. ... | Every warning that MySQL generates will be raised as a `Warning` by MySQLdb 1.2, unless you're using a use-result cursor. There is no code that discriminates between different warnings.
MySQLdb does not provide enough information to let Python's [`warnings`](http://docs.python.org/2/library/warnings.html) module filte... |
85700 | I tried by this
```
select module from v$sqlarea where sql_fulltext LIKE '%begin ORACLE_PKG%'
```
Any help would be appreciated. | You can get the module name by your current sql provided the module name is set by using `dbms_application_info.set_module` method within the related application :
```
declare
v_module_name varchar2(150);
begin
v_module_name := get_module_name; -- a presumed function that brings the module name
dbms_application... |
85922 | I need to pass parameters from view to controller..
**controller**
```
<?php
class Site2 extends CI_Controller{
function index(){
$this->load->helper('url');
$this->home();
}
public function getBranchDetails($b_id){
$this->load->model('bank_account_model');
$data['rresul... | it's working 100%
**controller**
```
<?php
class Site2 extends CI_Controller{
function index(){
$this->load->helper('url');
$this->home();
}
public function home(){
$this->load->model('get_company_model');
$this->load->model('bank_account_model');
$data['results_... |
85931 | i have problem to build the 'link\_to' to action "destroy".
I have two nested routes in 'Routes.rb':
```
namespace :admin do
namespace :security do
resources :users
end
end
```
'rake routes' prints:
```
DELETE /admin/security/users/:id(.:format) admin/security/users#destroy
```
... | You could try passing only the action and resources and leave the rest up to rails:
**UPDATE**
You should use namespaces names as a parameter to `url_for`
```
<%= link_to 'destroy', ([:destroy, :admin, :security, user]), method: :delete %>
``` |
85996 | In my spare time, I have been studying and analysing continued fractions.
I was having a conversation with someone on Discord in a Mathematics server and he was telling me that continued fractions can be related to quantum physics. He didn't go into it too much and the concept he was describing seemed a little vague ... | In the paper "[A Continued-Fraction Representation of the Time-Correlation Functions](https://academic.oup.com/ptp/article/34/3/399/1943170)", generalized susceptibilities and transport coefficients for materials are obtained using a continued-fraction expansion of the Laplace transform of the time-correlation function... |
86403 | I am trying to make a canvas you can draw on in vanilla JavaScript. I managed to make it so you can draw on it. However, I want to make it so you can see the dot that will be drawn if you press down. I basically want a circle that has the same styling as the drawn lines to follow the cursor. This circle is only suppose... | The most performant way to do this is to set the [CSS `cursor` property](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor) to a custom image:
```js
const imageLoader = document.getElementById('imageLoader');
imageLoader.addEventListener('change', handleImage, false);
const canvas = document.getElementById('imag... |
86431 | I am new with springboot i need to setup multiple database in my project i am using postgresql this is my properties file.
If i am running my application so whatever @primay annotation i am giving only that db i able to access but i need to access both db.
Note : if i am adding both db @primary annotation then gettin... | The cause is that the value would be cover when it exists `x['df']`.
You could use defaultdict to save them(A little different from you expect, though.But it is very easy):
```
from collections import defaultdict
a = [['kyle', 'movie_1', 'c_13'],
['blair', 'food', 'a_29'],
['reese', 'movie_2', 'abc_76']]
b... |
86492 | I have been declaring all the routes for my application inside web.php , but it is now getting quite large. I find that I am losing a lot of time shifting between web.php and each controller and this is hurting productivity.
I feel like it would be better to define routes inside of the controller, perhaps ideally dele... | It is not possible given how laravel works. Every request is passed onto router to find its designated spot viz. the controller with the method. If it fails to find the route within the router, it just throws the exception. So the request never reaches any controller if the route is not found. It was possible in earlie... |
86532 | A month ago I sent my application for a job for X company for a full-stack job. They didn't move forward with my application because I am not senior level. I found a new DevOps job. I tried to call the HR person to apply for the job but he did not respond to my call or email. I use my nickname, alternate email and my h... | >
> I want to ask if changing my name to a nickname or alternate email is scam can I get into trouble if someone found out?
>
>
>
"Scam" is probably too strong a word - but ultimately you're asking whether attempting to circumvent the company's prior knowledge of you via obfuscating who you are is okay. You aren't... |
86649 | My page has albums. I add classes to each album according to first letter of an artist inside the album's div to filter content.
The purpose is to disable a letter's filter button if there is no artist begins with this specific letter.
I try to do something, but of course, it doesn't work, have you any idea?
The rele... | Still, you facing the issue
Add this Jar in Build path ->modulerpath
Add this jar
<https://mvnrepository.com/artifact/org.hamcrest/hamcrest-all/1.3>
And the issue will be resolved. |
87152 | I'm trying to simply start the chrome driver but getting some timeout errors. the browser does start but then closed after few sec with the following exception:
System info:
```
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'
System info: host: 'MAC-images-MacBook-Pro-1164.local',... | This error message...
```
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'
System info: host: 'MAC-images-MacBook-Pro-1164.local', ip: '----', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.6', java.version: '1.8.0_172'
Driver info: driver.version: ChromeDriver
.
com.goo... |
87406 | I have shifted our live server to a new server configuration Windows 2008 server and sql server 2008.
But I am having following exception while adding date field data :
>
> 2011-05-15 18:00:44,263 ERROR Error
> caught : the details of the error are
> System.Data.SqlTypes.SqlTypeException:
> SqlDateTime overflow.... | There's actually three things: A Website, a Store and a Store View.
The most important part about Websites is that each websites has its unique customer and order base.
Stores can be used to define for example different (looking) stores with the same information.
Store Views are mostly used to handle different langu... |
87609 | I am sending this from the frontend via POST ajax:
It consists of JSON array and object.
EDIT: I have set :
```
contentType: 'application/json'
```
The exact JSON is sent as follows:
```
{
"alertKeeperDTOs": [
{
"isSelected": true,
"rn": 0,
"keeperId": "B116453993D5... | In the code in your question the hole in the 8 is a different path. In order to make it a real hole I've merged the 2 paths by combining the d attributes.
However it may not work for all the paths in your code. Give it a try and let me know how it works.
Please observe that I've changed the initial m comand to M when... |
87877 | I have used an example and can successfully read data using php and mysql and plot it (timebase vs a variable), all works fine. I have taken that and used it as a template and used a different db that doesn't use a timebase but the graph isn't rendering. The graph is meant to display data from an SQL query that collate... | just put the strings you want for flavor1 into:
```
src/flavor1/res/values/strings.xml
```
and the strings for flavor2 into:
```
src/flavor2/res/values/strings.xml
```
no need to put logic into your gradle file |
88050 | I have a background thread that is querying an Oracle database via a Select statement. The statement is populating a ResultSet Java object. If the query returns a lot of rows, the ResultSet object might get very large. If it's too large, I want to both cancel the background thread, but more importantly I want to cancel... | Please use ViewHolder pattern, and also add your gridMain\_text.xml
else you will keep receiving wrong index of click
<http://www.binpress.com/tutorial/smooth-out-your-listviews-with-a-viewholder/9>
This is example of ListView but equally applicable for `GridView` |
88866 | I've installed Apache Spark 1.5.2 (for Hadoop 2.6+). My cluster contains of the following hardware:
* Master: 12 CPU Cores & 128 GB RAM
* Slave1: 12 CPU Cores & 64 GB RAM
* Slave2: 6 CPU Cores & 64 GB RAM
Actually my slaves file has the two entries:
```
slave1_ip
slave2_ip
```
Because my master also has a very "st... | It's possible. Just limit the number of cores and memory used by the master and run one or more workers on the machine.
Use `conf/spark-defaults.conf` where you can set up `spark.driver.memory` and `spark.driver.cores`. Consult [Spark Configuration](http://spark.apache.org/docs/latest/configuration.html).
You should ... |
89468 | I am currently learning Laravel 5 and am experimenting with user logins and registration.
I used the command:
```
php artisan make:migration create_users_table --create=users
```
the first time i ran this command it worked perfectly and created a migration file with a selection of fields typically required for user... | There is default migration file for users. I think you have not check after installing the laravel. Check the default migration file in github bellow
[default migration file](https://github.com/laravel/laravel/tree/master/database/migrations) |
89497 | I am returning a value from my database. The data type is a string. I checked with TypeName. However, my if condition never works despite it printing the value I am checking for. Any ideas?
```
while NOT prs.EOF
RecordStatus = prs("status")
If (RecordStatus = "S") Then
response.write("Scheduled!<br>"... | Also, consider placing MoveNext to last line.
```
while NOT prs.EOF
RecordStatus = prs("status")
If (Trim(RecordStatus) = "S") Then
response.write("Scheduled!<br>")
Else
response.write(RecordStatus & "<BR>")
End If
prs.MoveNext
Wend
prs.Close
``` |
89708 | **[If you only experience this problem when using VLC see this question](https://unix.stackexchange.com/q/440321/3285)**
When the screen is blocked, the `xscreensaver` (version 5.35) password prompt pops out without any mouse/touchpad movement. It just appears, blinks out when the time is gone (there is also a message... | Since I am new I am unable to add a comment and ask you if you are using XFCE4. I had this same exact problem and tracked the problem to xfce4-power-manager causing this exact same issue.
Taken from the [Xscreensaver FAQ](https://www.jwz.org/xscreensaver/faq.html#no-blank):
>
> Starting in early 2016, I began receiv... |
90225 | SOLVED
What really helped me was that I could #include headers in the .cpp file with out causing the redefined error.
---
I'm new to C++ but I have some programming experience in C# and Java so I could be missing something basic that's unique to C++.
The problem is that I don't really know what's wrong, I will past... | The preprocessor is a program that takes your program, makes some changes (for example include files (#include), macro expansion (#define), and basically everything that starts with `#`) and gives the "clean" result to the compiler.
The preprocessor works like this when it sees `#include`:
When you write:
```
#inclu... |
90398 | I'm trying to upload 2 documents using AngularJs. The user fills the information like Name, Date of Birth, Gender etc. If these data successfully stored in the database through spring controller, 2 documents should be stored.
**JS**
Below code is for adding and removing the documents.
```
$scope.items = [];
$scope.i... | The operator `==` will check the values of 2 object and in this case an empty `set()` and a False value have not a same value.
And since python evaluates any empty sequence as False and none empty sequences as True, if you want to check the validation of the `test` object you can simple use `if`:
```
if test:
#do s... |
90542 | I have a ListView with contents as suppose android in 1st row,blackberry in second row and iphone in 3rd row so on now I want to make ListView's whole row clickable but when I click above content of listview row then it performs only click event but I want if I click any where in a row then a click action should be per... | I know this question is old, but it was the first hit for me in google when I was looking for this problem.
This is my solution.
```
<ListView
android:id="@+id/XXXXXX"
android:layout_width="fill_parent" // Changed from wrap content
android:layout_height="fill_parent" // Changed from wrap content
an... |
90691 | I can add the marker on the openlayer map using `Openlayers.Layer.markers` .
But i cannot do this using `OpenLayers.Feature.Vector` ? . Any one may help me..please...thanks in advance
Regards,
Boomiraj.P | here's a simple example that should work.
```
var point = new OpenLayers.Feature.Vector(
new OpenLayers.Geometry.Point(-111.04, 45.68));
var layer = new OpenLayers.Layer.Vector("My Layer", {
style: OpenLayers.Feature.Vector.style["default"]
});
map.addLayer(layer);
layer.addFeatures([point]);
``` |
90923 | * I am trying to link manifest.json file to the website I built to convert it to PWA. Have used `html/css` and `python flask` for the backend.
* I am not getting whether it is the issue of the path or something else. Service worker is being detected and that is working absolutely fine.
* But in the Application manifest... | The problem is that the program can't update state inside rendering..it goes through infinite loop so "selectedIndex" must have an event handler function to handle when to setState it. |
91153 | In Russian, verbs in the past have gender information attached to them, so that “я спросил” implies that the asker was male, whereas “я спросила” comes from a female.
Why no other tenses have this trait, or why verbs were even chosen to differ by speaker's gender? | Because historically what we call past in modern Russian is perfect, and what we believe to be past forms of the verbs are in fact participles (adjectives formed from verbs).
Compare:
>
> Он пел / она пела / оно пело (he / she / it has sung)
>
>
> Он бел / она бела / оно бело (he / she / it is white)
>
>
>
In ... |
92034 | In my build.gradle , the logcat is visible when
```
debugCompile 'org.slf4j:slf4j-android:1.6.1-RC1'
```
However when the version is updated , there is logcat
```
debugCompile 'org.slf4j:slf4j-android:1.7.14'
```
I am stuck with 1.6.1-RC1 version. Why the newer versions of slf4j-android:1.7.x are not logged in th... | <http://jira.qos.ch/browse/SLF4J-314> gave me the answer .
To see the logs on "slf4j-android:1.7.x" , using Android setprop is the official approach.
The downside of this approach is that you have to select the TAG but cannot show all logs . For example in the logcat :
```
app_package D/TAG1: blabla
app_package D/... |
92107 | I'm trying to strip the span tags w/ a letter-spacing that starts with 0. or 1.
```
'<span style="letter-spacing:0.50 px">Boulevard,</span> '
to equal
'Boulevard, '
```
Thank you
Here's an example of a complete line.
```
<span style="letter-spacing:1.33 px">PRODUCTS</span> <span style="letter-spacing:1.37 px">MODE... | Here is an example using Perl and [`HTML::Parser`](https://metacpan.org/pod/HTML::Parser) :
```
use strict;
use warnings;
use HTML::Parser ();
my $delete_tag = 0;
my $p = HTML::Parser->new(
api_version => 3,
default_h => [sub { print shift }, 'text'],
start_h => [\&start_handler, 'tagname,text,attr'],
... |
92580 | I'm using ruby motion. Below are the details of my environment.
```
$ motion --version
2.9
$ bundle
Using bubble-wrap (1.4.0)
Using motion-require (0.0.7)
Using formotion (1.6)
Using motion-layout (0.0.1)
Using thor (0.18.1)
Using rubymotion_generators (0.1.0)
Using bundler (1.3.5)
```
When I run my app and ... | Parenthesis are not used for multiplication in Java as they are in mathematics. Use the `*` operator.
```
if (((i - posX) * (i - posX) + (j - posY) * (j - posY)) == (radius) * (radius)) {
```
Read: [Operators](http://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html) |
92830 | Then new Enterprise Library 6 is out and can be [downloaded here](http://www.microsoft.com/en-us/download/details.aspx?id=38789). I have downloaded and extracted EnterpriseLibrary6-binaries.exe to a folder on my C: drive. The readme says this:
```
MICROSOFT ENTERPRISE LIBRARY 6
Summary: This package contains Enterpri... | I had to use NuGet to install the application block I wanted to use in the project. For me, Tools >> Library Package Manager >> Manage NuGet Packages for solution and add the appropriate EntLib 6 Exception Handling Application Block WCF Provider. |
92977 | ```
function getHashTagsFromString($str){
$matches = array();
$hashTag=array();
if (preg_match_all('/#([^\s]+)/', $str, $matches)) {
for($i=0;$i<sizeof($matches[1]);$i++){
$hashtag[$i]=$matches[1][$i];
... | Update your regular expression as follows:
```
/#+(\S+)/
```
**Explanation:**
* `/` - starting delimiter
+ `#+` - match the literal `#` character one or more times
+ `(\S+)` - match (and capture) any non-space character (shorthand for `[^\s]`)
* `/` - ending delimiter
[**Regex101 Demo**](http://regex101.com/r/nH... |
93229 | I made my front component similar to a login page. When I try to pass the begin prop Front doesn't render for some reason. If I don't pass it any props then it renders fine. I'm not sure why this is happening. Any help would be appreciated!
```
export default function App() {
const [start, setStart] = React.useState(f... | Pass the function like this:
`<Front begin={startGame} />`
Instead of this:
`<Front begin={startGame()} />`
Because `startGame()` will run the function on site and what it returns would be passed as props. This case it returns void (nothing) which is not expected by the component, thus the error occured. |
94183 | My problem is as follows, and I suspect it has a simple solution. However I looked at [create reactive function from user input](https://stackoverflow.com/questions/28788029/shiny-create-reactive-function-from-user-string-input?rq=1) and [Reactive Function Parameter](https://stackoverflow.com/questions/34725029/reactiv... | The simple solution as suggested by Dieter Menne is as follows:
Outside of the UI/Server functions:
```
myConnective <- function(aString) {
if (substr(aString, 1,1) %in% c("a", "e", "i", "o", "u"))
{
myString <- "an"
}
else
{
myString <- "a"
}
return(myString)
}
```
Then inside the Server func... |
94303 | I'm using Python to pull out the country of residence that somebody has. The lines where the country is in are (address faked):
```
<HR NOSHADE SIZE="1" COLOR="#000000"><B>Buyer Information</B><HR NOSHADE SIZE="1" COLOR="#000000">
<TABLE WIDTH="100%" BORDER="0" CELLPADDING="1" CELLSPACING="0" CLASS="ta"><TR BGCOLOR="#... | I suggest you to use a `html` parser like [beautifulsoup](/questions/tagged/beautifulsoup "show questions tagged 'beautifulsoup'"). It finds the last `<br>` of the table and from there search next sibling including text nodes, which returns the country:
```
from bs4 import BeautifulSoup
import sys
soup = BeautifulSo... |
94488 | [Note: it's generally bad practice to include code in your cfcs, (see answers below), so consider this just research]
To summarize, I have a class and a subclass and one method that is overridden by the subclass. When I hard-code the method in the child class, everything works fine, when I use cfinclude to include it ... | You're getting the error because of the way the the CFC is instantiated.
When you have `hola()` in the parent & `hola()` in the child, where the child extends the parent, when the child CFC is created, it sees `hola()` in the parent and overrides it. However, that function still exists in the CFC.
From the child CFC... |
94545 | Is it possible to display a specific data field of a related class (one-to-many relationship) when the field is not a foreign key? If not, how to bypass this problem?
For example:
Class **Pigeon**
```
public class Pigeon
{
[Key]
public string PigeonId { get; set; }
[ForeignKey("RaceForeign... | You can use this overload of SelectList constructor:
>
> SelectList(IEnumerable, String, String, Object)
>
>
> Initializes a new instance of the SelectList class by using the specified items for the
> list, the data value field, the data text field, and a selected value.
>
>
>
so, changing your parameter, solve... |
94657 | Please consider this dummy code.
```
$ cat dummy.py
import logging
import time
from boto3.session import Session
# Logging Configuration
fmt = '%(asctime)s [%(levelname)s] [%(module)s] - %(message)s'
logging.basicConfig(level='INFO', format=fmt, datefmt='%m/%d/%Y %I:%M:%S')
logger = logging.getLogger()
def main():... | **Solution:**
```
import logging
import time
from boto3.session import Session
# Logging Configuration
fmt = '%(asctime)s [%(levelname)s] [%(module)s] - %(message)s'
logging.basicConfig(format=fmt, datefmt='%m/%d/%Y %I:%M:%S')
logger = logging.getLogger('LUCIFER')
logger.setLevel(logging.INFO)
def main():
COUNT... |
95892 | I'm looking for a way of converting a `wstring` into a plain `string` containing only ASCII characters. Any character that isn't present in ASCII (0-127) should be converted to the closest ASCII character. If there is no similar ASCII character, the character should be omitted.
To illustrate, let's assume the followin... | On GitHub, there is [unidecode-cxx](https://github.com/mapbox/node-unidecode-cxx) which is a (somewhat unfinished) C++ port of [node-unidecode](https://github.com/FGRibreau/node-unidecode), which is in turn a JavaScript port of Perl's [Text::Unicode](http://search.cpan.org/%7Esburke/Text-Unidecode-0.04/lib/Text/Unideco... |
96689 | I'm using HHVM to write a system tool and I cannot for the life of me figure out why this code issues an error when I run `hh_client`
```
$__al_paths = array();
function requires(string $classPath): void {
global $__al_paths;
$className = basename($classPath);
if (!isset($__al_paths[$className])) {
... | Instead of using `global` try to rewrite your code like this (called dependency injection):
```
function requires(string $classPath, $__al_paths): void {
$className = basename($classPath);
if (!isset($__al_paths[$className])) {
$__al_paths[$className] = AL_CLASSES_FOLDER.'/'.$classPath.'.'.AL_CLASS_EXTE... |
97703 | i just need to know what happens when you create a RSS feed in Liferay?
Is the configuration data for the feed (Structure, template, friendly url of the portlet...) stored on the DB or in a file?And, in both cases, where the data is stored exactly? | they are stored in the DB, if anyone is interested!
Update: i will detail the answer more if anyone is interested. They are stored in the table JournalFeeds. |
97824 | I am trying to install Windows 2008 server on a HP Proliant DL180 G5. There is no built-in DVD reader so I need to use my LaCie USB one.
When I put the CD in and boot from the USB DVD on the server, I get the error message:
Boot Failed! Please insert boot media in selected boot device.
So I tried with another Window... | You'll probably need to go into the BIOS and enable it to boot off the USB drive. |
97847 | So, on my main domain 'domain.com' I created several subdomains from cPanel, like 'sub1.domain.com' and 'sub2.domain.com'. Their real location on server is in 'domain.com/sub1' and 'domain.com/sub2'.
Now, I want to redirect non www to www with .htaccess and this is what currently what i have:
```
<IfModule mod_rewrit... | You can exclude each `sub1`, `sub2` individually like so;
```
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^sub1\.domain\.com [NC]
RewriteRule ^(.*) - [L]
RewriteCond %{HTTP_HOST} ^sub2\.domain\.com [NC]
RewriteRule ^(.*) - [L]
RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
RewriteRule ^(.*)... |
97868 | I want to configure Python/Jython in IBM BPM, so that these files can directly executed from process app. How can I do that?
How to setup this entry in WebSphere Application Server? | You can use the same key and then just insert the new bin. This will update the existing record with the new bin. The way you are proceeding about it is correct. |
98364 | Android studio is too heavy and slows down my pc for development. i am an ionic developer and i only need the android emulator to have a better test environment for my mobile application. I only make use of the android studio because i am trying to set up the virtual emulator following the steps in this video [Ionic 3 ... | You can use [union types](https://docs.julialang.org/en/v1/manual/types/#Type-Unions) to do the same.
```
function func(x::Union{Int, AbstractFloat})
x + 1
end
```
Note that C++ `std::variant` is a *tagged union*, so you can always ask "which" variant it is, whereas a Julia union is a proper set union. Pragmatic... |
99015 | I need to create a custom animated toast message. Now i need to know if that is possible. I've created a toast with a custom view but I cannot figure out how can I add custom animation to the toast.
Here is the code I have so far.
```
private void showToast() {
LayoutInflater inflater = getLayoutInflater(... | It is not possible to do this with the stock Android Toast class. Stock style toasts (ones added to the WindowManager and not to a ViewGroup) are limited to four system animations and will not accept animations from your project. If you would like to use different system animations with stock type Android Toasts check ... |
99251 | I realize that similar questions have been posted, and I've viewed them and lots of other topics etc to find a solution - I'm clearly missing the obvious - as I am still learning the basics!
Goal: Simple drag and drop.
User moves image across screen and either drops on top of another image or anywhere on the screen.
... | Although I am not sure if my implementation is the best way to go by, it works.
Add these members in your MainActivity:
```
View root; // references root activity view
float dropX, dropY; // records position of where finger was lifted on the root
```
In your onCreate():
```
root = findViewById(android.R.id.content... |
99729 | What I am attempting to do is match the username stored in two tables, `table1` and `table2` and then pull the `user_id` of table 2.
`Table1` has columns such as `id`, `username`, and other random info
`Table2` has columns such as `user_id`, `username`, and other random info
What I am attempting to do in the end is ... | Do a join as below:
```
SELECT b.user_id, a.*
from cpanel a,
login_users b
where b.username = a.username
ORDER BY a.username DESC
```
OR
```
SELECT b.user_id, a.*
FROM cpanel a JOIN login_users b
ON b.username = a.username
ORDER BY a.username DESC
```
Here `a.*` returns you all the columns of `cpa... |
100103 | ```
for (int rowNum = 1; rowNum < sheet.getLastRowNum(); rowNum++) {
Row row = sheet.getRow(rowNum);
Employee instance = methodToGetInstance(parameters);
originalList.add(instance);
}
List<Employee> copy = new ArrayList<>(originalList);
List<Employee> t... | They are completely different.
Using `async`/`await` allows you to consume Promises in a flat manner in your code, without nesting callbacks or hard-to-read `.then` chains. For example:
```
const doSomething = async () => {
await asyncStep1();
await asyncStep2();
await asyncStep3();
};
```
where each async st... |
100176 | I cloned a repository and was working in the master branch. There was a consistent problem: `git push` (and `git push`) didn't work and gave long, uninterpretable error message. Through trial-and-error, I found `git push origin master` did the push correctly. But now I've noticed something odd:
```
$ git config push.d... | What is your `branch.autosetupmerge` set to? By default it should have setup the branch tracking when you cloned.
Try setting the upstream for the branch with this to make the branch track the remote.
```
git branch --set-upstream master origin/master
``` |
100536 | I'm trying to import posts from medium to WordPress.
[https://upthemes.com/blog/2014/11/medium-to-wordpress/][1]
I followed this blog
I downloaded a zip file. and when I try to import it using WordPress importer as mentioned in the blog.
It throws an error`'This does not appear to be a WXR file, missing/invalid WXR v... | Export zip file and upload just xml file with WordPress Importer. |
100736 | I've implemented a method for users to add their Facebook accounts to their site account. It was working fine until I switched from stage domain to my production domain. (They're hosted on different servers)
I'm redirecting the user to the Login URL as below:
```
$params = array("redirect_uri" => SITE_URL . "settings... | >
> Is there any progress being made anywhere on making this process simpler?)
>
>
>
Yes: Yehuda Katz is leading a Kickstarter project to help:
<http://www.kickstarter.com/projects/1397300529/railsapp>
Looks like you may have an old openssl.
Try this:
```
sudo port selfupdate
```
View the list of outdated po... |
100741 | **EDIT:**
After fiddling around some more, I realised that using XLData required me to have the data somewhere online, because the search requested the results from a URL instead of from my dataset.
So, now my question is, how do I use XLData's search functionality with a specific list of data and query that data se... | >
> However, somehow it returns only output with letters A, F, I, L, S, T. Like this:
>
>
>
```
foreach (char c in failas)
```
You iterate over the *filename*, which is `"failas.txt"`, This should be the actual file's text.
```
foreach (char c in rodymas)
foreach (char c in masyvas) // Possibly the char array.... |
100797 | In rails 2.x I used shallow routes, but this seems to be missing from rails 3 (at least in the API <http://apidock.com/rails/ActionController/Resources/resources>).
When I pass this option in rails 3 it doesn't throw any errors, but I'm also not getting all of the routes I expected.
Rails 3 routes.rb
```
resources... | You need to apply the :shallow option to the nested resources. This should give you what you want:
```
resources :users do
resources :recipe, :shallow=>true do
resources :categories do
resources :sections do
resources :details do
end
end
end
end
end
``` |
101246 | After creating a character using the Red Box and convincing my gaming group, all newbies to RPG's, to roll characters using the Red Box, I discovered that the Red Box doesn't seem to have an upgrade path for these characters. Is there an official or published method of leveling these chracters? | In the Dungeon Master's Book, the book contains instructions on how to level as per this [link](http://www.therpgsite.com/showthread.php?t=18583). If you're interested in having them level all the way to thirty, you'll need to grab the book "Heroes of the Fallen Lands".
Characters created as part of the Red Box are fi... |
101568 | I am trying to write a simple Map Reduce program using Hadoop which will give me the month which is most prone to flu. I am using the google flu trends dataset which can be found here <http://www.google.org/flutrends/data.txt>.
I have written both the Mapper and the reducer as shown below
```
public class MaxFluPerMo... | ```
<?php
$songid = $_REQUEST['SongID'];
if($songid == 1)
{
header("Location: ".$songLink);
}
?>
``` |
101622 | Is it possible to set Shiny options to open an App automatically in a full view mode, i.e. in a maximized window?
My user interface is designed in a way that is nicely looking only when browsed in a full view.
My source is written in two standard files: server.R and ui.R.
I am interested in both options: to run app ... | What you are asking for is browser dependent and cannot be *enforced* from *R* or *Shiny*. I had this same requirement for a conference where I deployed an app as a team activity, all the conference tables had a connected tablet. Note that the reason why this is difficult comes down to security and the risks of *phishi... |
102123 | I am running a query that effectively looks like
```
SELECT SUM(CASE WHEN name LIKE '%ad%' AND x > 0 THEN 1 ELSE 0 END) as num_x,
SUM(CASE WHEN name LIKE '%ad%' AND y > 0 THEN 1 ELSE 0 END) as num_y,
SUM(CASE WHEN name LIKE '%ad%' AND z > 0 AND Z <= 100 THEN 1 ELSE 0 END) as num_z,
SUM(CASE WHEN ... | In SQL all `AND` are evaluated before all `OR`.
So a criteria like:
```
name LIKE '%ad%' AND x > 0 OR y > 0 OR z > 0 AND z <= 100
```
Is actually evaluated as:
```
(name LIKE '%ad%' AND x > 0) OR y > 0 OR (z > 0 AND z <= 100)
```
While you probably expected:
```
name LIKE '%ad%' AND (x > 0 OR y > 0 OR (z > 0... |
102470 | I am trying to create a service using golang that will listen on a port for a post request containing json and would like to parse out the username and password fields of the json and save those as variables to be used outside of the function to authenticate to Active Directory.
I am using the HandleFunc() fucntion, bu... | You can't access the variables not because Go namespaces not allow it but because `ListenAndServe` is blocking and `ldapConn` could be called only if the server is stopped.
```
log.Fatal(http.ListenAndServe(":" + SERVICE_PORT, nil))
// Blocked until the server is listening and serving.
connected := ldapConn(LDAP_S... |
102724 | I have a basic question regarding the definition of a random variable. *Probability and Random Processes* (Grimmett and Stirzaker) have the following:
>
> A random variable is a function $X:\Omega\rightarrow \mathbb{R}$ with the property that
> $
> \{
> \omega\in \Omega: X(\omega)\leq x
> \}
> \in \mathcal{F}
> $
>... | Q1: Yes, that is a set.
Q2: The thing you need to understand here is that $\mathcal{F}$ is a collecion of sets. In other words, it is a set of sets - its elements are sets. Hence we use $\in$ instead of $\subset$.
For example,
$$1 \in \{1, 2, 3, 4\}$$
$$\{1\} \subset \{1, 2, 3, 4\}$$
but
$$\{1\} \in \{\{1\}, \{2\}, ... |
102821 | I have been trying to implement a design but I don't know how I'll blend the image properly, I don't want the bottom of the Image to show just like the picture below
[](https://i.stack.imgur.com/lBmo7.png)
But this is what I get when I implement in re... | Use `str.split`
**Ex:**
```
import pandas as pd
df = pd.DataFrame({"Column 1": ["153 ADRB1", "3486 IGFBP3", "9531 BAG3", "9612 NCOR2"]})
print(df["Column 1"].str.split().str[1])
```
**Output:**
```
0 ADRB1
1 IGFBP3
2 BAG3
3 NCOR2
Name: Column 1, dtype: object
``` |
103361 | I'm having some trouble with a MySQL Select Where statement that uses aliases and parameters. My problem lies with the Where part of the statement. As it stands, I'm not returning any results when I try to use any parameters.
The statement in question is:
```
SELECT postcode, suburb, streetname, categorycode, DATE_F... | If you look at the [Swing Tutorial part on Buttons](http://download.oracle.com/javase/tutorial/uiswing/components/button.html) ...
Have the other class implement ActionListener and create this method
```
public void actionPerformed(ActionEvent e) {
// do something
}
```
Make sure that on your Radio Button you ... |
103543 | i try to access this function in my Object with the console.log but i don't really understand why i can't access it!
I'm beginning Javascript but i'm really stuck with accessing functions in Object.
Thanks for the help
```js
const hotel = {
name: "Grand Hotel",
location: "Stockholm",
pricePerNight: 220... | You're just missing the parentheses in the log function:
```
hotel.roomAvailable()
``` |
103701 | I'm working on a system which allows imported files to be localized into other languages.
This is mostly a private project to get the hang of MVC3, EntityFramework, LINQ, etcetera. Therefore I like doing some crazy things to spice up the end result, one of those things would be the recognition of similar strings.
Im... | You could look into the [Levenshtein Distance](http://en.wikipedia.org/wiki/Levenshtein_distance). Those below a certain threshold will be considered similar. Two strings that are identical will have a distance of zero.
There's a C# implementation, amongst other languages, on [Rosetta Code](http://rosettacode.org/wiki... |
103736 | I just came across this function in my work (the integral in the first line is only to show where it came from),
\begin{align}
f(x,y) &= \int\_0^1 dt \frac{1}{(t-i y)^{1+x}},& x<0, y\in\mathbb{R}
\\ &= \frac{-(1-i y)^{-x}+(-i y)^{-x}}{x}, &x,y\in\mathbb{R}\,,
\end{align}
and I am really puzzled about (the real part) ... | For the first term, I will use the binomial expansion up to the second order term. The the second term, I will use the formula $a^b = \exp(b \ln a)$ and then use Taylor's series up to the second order term. For the region you are looking at, $x \ln y$ is close to zero, except when $y$ is much smaller than $x$, and this... |
104002 | I am trying to make a binary version of a Python script using PyInstaller 2.0. I am using a basic "hello world" tkinter script but imported a few dependencies that i need for a project to test Pyinstaller out. I am on a mac running Yosemite 10.10.5.
This is my script:
```
#!/usr/bin/env python
from Tkinter import *
i... | If you are using python via pyenv like me, you might need to reinstall with enabling shared to access xcode libs unless you had done that earlier.
```
sudo env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 2.7
```
PS: I am on Darwin but still `enable-shared` worked than `enable-framework`
In fact the messag... |
104031 | I've been getting in to mongo, but coming from RDBMS background facing the probably obvious questions with regards to denormalisation and general data modelling.
If I have a document type with an array of sub docs, each sub doc has a status code.
In The relational world I would add a foreign key to the record, Status... | >
> Or should the transaction history be a separate collection with a onjid referencing the person?
>
>
>
Probably, I think [this S/O question](https://stackoverflow.com/questions/4662530/how-should-i-implement-this-schema-in-mongodb/4684647#4684647) may help you understand why.
>
> if the status doc is modified... |
104555 | Here is my current code to launch browser without any proxy:
```
properties = getGridProperties();
DesiredCapabilities capabilities = null;
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("layout.css.devPixelsPerPx","0.9");
... | Hi please try this one
```
Proxy proxy = new Proxy();
proxy.setHttpProxy("http://www-proxy.us.abc.com:80");
capabilities.setCapability(CapabilityType.PROXY, proxy);
```
I hope it will work for you.
Thanks |
104702 | Any reasons why this not work? When I print the query to screen and runs it through phpMyAdmin it works. I left out the part where I connect to the database (MySQL).
```
$query = "START TRANSACTION; ";
$query .= "INSERT INTO table1(text) VALUES('$question_description'); ";
for ($i = 0; $i < count($processed_answers)... | Looks like you are attempting to run multiple statements, possibly through a `mysql_query()` or `mysqli->query()` which only support single statements. Instead you need to execute this with `mysqli->multi_query()` or `mysql_multi_query()`. |
105169 | I am trying to figure out how I could remove certain words from a file name. So if my file name was lolipop-three-fun-sand,i would input three and fun in and they would get removed. Renaming the file to lolipop--sand. Any ideas on how to start this? | Use `string.replace()` to remove the words from the filename. Then call `os.rename()` to perform the rename.
```
newfilename = filename.replace('three', '').replace('fun', '')
os.rename(filename, newfilename)
``` |
105357 | I am using JQuery UI Accordion, it works fine with the static content. However when i am loading the H3 and Div tags of the accordion from the ajax rest service call. The data is coming up properly but accordion is not loading up
```
onSuccess: function (data) {
var results = data.d.query.PrimaryQueryResult.Re... | [](https://i.stack.imgur.com/viY0P.png)
You need to first do Ctrl+F on the selected word, now this gets cached then you can use the Ctrl+L and ctrl+shitf+L for going down and up respectively. This is already present. its just that instead of ctrl+K yo... |
105573 | I'm new to Python and want to read my smart meters P1 port using a Raspberry Pi and Python. Problem: the input looks like some component is drunk.
I'm sure it's pretty simple to fix, but after several hours of searching and trying, had to seek help.
When reading the P1 port with CU etc. everything is fine so the hardw... | I'm not very familiar with the `serial` module, but I noticed that your `cu` command assumes there is no parity bit (`--parity=none`), but your python script assumes there is an even parity bit (`ser.parity=serial.PARITY_EVEN`). I would try
```
ser.parity=serial.PARITY_NONE
```
And if there's no parity bit, you'll a... |
105653 | I have a simple spreadsheet where one column has a String *(It's a title of a page)* and the other one has a URL of that page:
[](https://i.stack.imgur.com/2QI6s.png)
I simply want a function to automate adding the link the title as below since I hav... | See the documentation on the [`HYPERLINK`](https://support.office.com/article/hyperlink-function-333c7ce6-c5ae-4164-9c47-7de9b76f577f) function.

In the example, the formula in `D3` is `=HYPERLINK(C3,B3)`.
Since the information of both Columns `B` and `C` are contained in t... |
105962 | I'm writing some Python 2 code with which to analyze the compressibility of random bitstrings. It's working pretty well right now, and now I'd like to request some help making sure it follows [PEP 8](https://www.python.org/dev/peps/pep-0008/) and is in other ways pythonic.
```
# -*- coding: utf-8 -*-
"""
Created on We... | * About the first approach:
+ I would initialize `max_size` to `0` instead of `Integer.MIN_VALUE`, because if the graph does not contain any nodes, the `for` loop over `M` will never be executed, and the size of the largest connected component in an empty graph is `0`.
+ I would replace this:
```java
if (visited[... |
105993 | I Am trying to learn the RDBMS. I have question for you guys. Why does a DBMS interleave the actions of the different transactions instead of executing transactions one after another? | A DBMS is typically shared among many users. Transactions from these users
can be interleaved to improve the execution time of users’ queries. By interleaving
queries, users do not have to wait for other user’s transactions to complete
fully before their own transaction begins. Without interleaving, if user A begins
a ... |
106298 | Ruby 2.6.3.
I have been trying to parse a `StringIO` object into a `CSV` instance with the `bom|utf-8` encoding, so that the BOM character (undesired) is stripped and the content is encoded to UTF-8:
```
require 'csv'
CSV_READ_OPTIONS = { headers: true, encoding: 'bom|utf-8' }.freeze
content = StringIO.new("\xEF\xB... | Ruby 2.7 added the [`set_encoding_by_bom`](https://ruby-doc.org/core-2.7.0/IO.html#method-i-set_encoding_by_bom) method to `IO`. This methods consumes the byte order mark and sets the encoding.
```
require 'csv'
require 'stringio'
CSV_READ_OPTIONS = { headers: true }.freeze
content = StringIO.new("\xEF\xBB\xBFid\n12... |
106921 | After upgrading to react-native:0.60.4 I have been unable to run my app and I am getting a react-native version mismatch error while testing it both on a real device as well as on an emulator. When upgrading I have followed the rndiff that is commonly used for project setup and
After searching the repository for any ... | **Use this :**
1. First of all uninstall app from your device
2. After this clean gradlew
3. close the Metro bundler and also terminal
4. Open terminal in the root of your project directory and run
>
> npm start -- --reset-cache
>
>
>
or
>
> yarn start -- --reset-cache
>
>
>
4. Open another terminal in ... |
107863 | I am an absolute novice in Visual C++ and hence I have to ask you, how would I create a managed class module (new class) with one or more functions inside of my managed C++ project (Visual Studio 2008)?
How would I call the method of the class for example if a button was pressed. I was unable to understand the very com... | I'm going to try again to post step-by-step instructions on how to add a class file to a VS2008 WinForm project. **I again did not realize until completing the list that numbered items don't always work cleanly here. I was able to fix all but one of the numbers, so this should be good to go - David W**
1. These steps ... |
107876 | My house has 2 bedrooms, a living room and a studio (Room for a computer, shelves, etc., don't know how it's called in the US), each one with a RJ-45 connection (LAN, Internet). I want to install speakers in the living room and that they could accept input from every one of the rooms. How can this be done? | <http://opensource-sidh.blogspot.co.uk/2011/06/recover-grub-live-ubuntu-cd.html> works perfectly, with very clear instructions! |
108767 | I'm having problem with returning string outside function. Is there some sort of convertion that should be done before ?
I'm using public `const int val_int[ ]` and `const char* val_rom[ ]` outside class.
And inside class:
```
private:
char* roman;
public:
char arab2rzym(int arabic) throw (RzymArabException... | Logically, a char is something like `'a'` or `'1'`, whereas a string would be `"a11a"`. If you expect this to work, what do you expect it to do? What would the char corresponding to `"a11a"` be? So, a single char corresponding to an array of chars?
To answer the question - you get the error because you can't convert a... |
108780 | very new to ARKit and want to learn.
I have created a scene and able to create 3d objects on it. They are persistent if i put the App in background but destroyed if the App is closed.
My aim is to store the coordinates of those nodes and load them persistently so I can see them every time I open the App.
Is that pos... | It's possible to keep objects persistent but they need to be persistent relative to something - a static location, an object etc.
There are a few ways to keep objects persistent with respect to space. One of them is [Placenote SDK](http://placenote.com/) that lets you scan a physical areas and create a persistent coor... |
108857 | I have a very simple nested query that is demanding 90+% CPU when it is called, and I can't seem to figure out why.
```
SELECT * FROM `push_log`
WHERE push_id IN
(SELECT `push_id` FROM push_sent_log
WHERE player_id='".$player_id."'
OR push_group='All'
AND `timestamp` >= DATE_SUB(CURDATE(), INT... | Try remove subquery instead of `join`:
```
SELECT p.*
FROM push_sent_log ps
JOIN `push_log` p ON p.push_id= ps.push_id
WHERE ps.player_id='".$player_id."'
OR ps.push_group='All'
AND `ps.timestamp` >= DATE_SUB(CURDATE(), INTERVAL 24 hour) )
ORDER BY p.timestamp DESC"
```
also I ... |
108872 | Why is this not returning a count of number of points in each neighbourhoods (bounding box)?
```
import geopandas as gpd
def radius(points_neighbour, points_center, new_field_name, r):
"""
:param points_neighbour:
:param points_center:
:param new_field_name: new field_name attached to points_center
... | An RCPT command is never a good idea to check for email validation, most SMTP servers will ban your IP after several attempts or ignore you command to keep their emails safe from spammers.
The only way to validate an email existance is to send a validation email. |
109009 | I have got redis setup for windows running the server from redis cli
```
C:\program files\redis>redis-cli
127.0.0.1:6379>
```
Development cable.yml is
```
development:
adapter: redis
url: redis://127.0.0.1:6379/0
```
Notifications channel rb
```
class NotificationsChannel < ApplicationCable::Channel
def s... | I think the reason it didn't work for you on your first try might be because of a typo when naming `received` function. You did `recieved` instead. |
109436 | In Italian, [translating from the Italian wikipedia](http://it.wikipedia.org/wiki/Complemento_%28linguistica%29) as accurately as I can muster,
>
> a "complemento" is a part of a sentence (one or more words) that specify, clarify and enrich the meaning thereof.
>
>
>
Italian has a [loooong, punctilious list of v... | The Italian Wikipedia appears to call both complements and adjuncts *complementi*. Therefore I conclude that an Italian *complemento* is a very broad category, and it is **not** the same as an English complement. I'd call it a **[constituent](http://en.wikipedia.org/wiki/Constituent_%28linguistics%29)**. The Italian li... |
109829 | I am making an app of login form but when I am running my app and click on login button the following error will occur
**Forbidden (403)
CSRF verification failed. Request aborted.**
the code of view.py is as:
```
from django.template import loader
from django.shortcuts import render_to_response
from registration.m... | In **Django ≥ 4** it is now necessary to specify **CSRF\_TRUSTED\_ORIGINS** in **settings.py**
```
CSRF_TRUSTED_ORIGINS = ['https://your-domain.com', 'https://www.your-domain.com']
```
See [documentation](https://docs.djangoproject.com/en/4.0/releases/4.0/#csrf-trusted-origins-changes-4-0) |
109846 | Trying to create a microservice within Go, I have a package network to take care of getting the bytes and converting to a particular request:
```
package network
type Request interface {
}
type RequestA struct {
a int
}
type RequestB struct {
b string
}
func GetRequestFromBytes(conn net.Conn) Request {
buf := make... | `b = a` is an assignment by reference: it makes the variable `b` point at the same list that variable `a` is pointing to. So when you update the contents of that list on the next line, with `a[:] = ...` then both `a` and `b` are pointing to the updated list.
If the next line had been `a = [x**2 for x in a]` (instead o... |
110074 | I'm searching for a cleaner way to validate tags when storing a Post.
All of the input validation takes place within my custom request `StorePostRequest`. The problem is that I need to check whether the given tags exist in the database, only existing tags are allowed. The function `$request->input('tags')` returns a ... | Transfer some parts of your app to different microservices. This will make some parts of your app focused on doing one or two things right (e.g. event logging, emails). Code coupling is also reduced and different parts of the site can be tested in isolation as well.
>
> The microservice architecture style involves de... |
110221 | I am trying to add a remote file to a local zip archive.
Currently, I am doing something like this.
```
use Modern::Perl;
use Archive::Zip;
use File::Remote;
my $remote = File::Remote->new(rsh => "/usr/bin/ssh", rcp => "/usr/bin/scp");
my $zip = Archive::Zip->new();
$remote->open(*FH,'host2:/file/to/add.txt');
my $f... | Do something like this (copy to local path):
```
$remote->copy("host:/remote/file", "/local/file");
```
and use the addFile method provided by Archive::Zip with the local file |
110501 | I have a backup script on my server which does cron jobs of backups, and sends me a summary of files backed up, including the size of the new backup file. As part of the script, I'd like to divide the final size of the file by (1024^3) to get the file size in GB, from the file size in bytes.
Since bash does not have ... | Just double-quote (`"`) the expression:
```
echo "$a / ( $b - 34 )" | bc -l
```
Then bash will expand the `$` variables and ignore everything else and `bc` will see an expression with parentheses:
```
$ a=22
$ b=7
$ echo "$a / ( $b - 34 )"
22 / ( 7 - 34 )
$ echo "$a / ( $b - 34 )" | bc -l
-.81481481481481481481
... |
111122 | In Python, how do I turn this:
```
"(test1)(test2)"
```
into this:
```
["test1","test2"]
```
? | The 401 Unauthorized response is usually emitted as an `error` notification from the Angular `HttpClient`. So you'd need to use RxJS [`catchError`](https://rxjs.dev/api/operators/catchError) operator to catch the error and redirect. You could then emit [`NEVER`](https://rxjs.dev/api/index/const/NEVER) constant so that ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.