qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
14,847,635 | I am using .NET framework 1.1 with C#. My problem description is given below.
1. I have server side textbox control with id:= *txtFromDate*. view state is enabled and its readonly.
2. when page loaded for the first time i am setting current date value in above textbox.
3. after that I change the value of textbox with ... | 2013/02/13 | [
"https://Stackoverflow.com/questions/14847635",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1046955/"
] | changes you make to the controls on client side are not accessible to the code behind at the server, unless those changes are made to the values of input controls.
so, youu can also use hiddenfield along with label which youu want to change in javascript/ Jquery then, store the new label value in hiddenfield as well
t... | **Need to Keep in Mind**
1. If any Server Control Example: TextBox. is Disabled or ReadOnly from Aspx Page or Code behind.
2. It's value is being changed from JQuery or Javascipt.
3. You try to get the changed value of this control from code behind then you will never get it.
4. When you post back this control then se... |
30,704,258 | I have a factory, how do i call 'getAccountDetails' service inside getAccountInformation() function.
I tried in the following way, but not working.
```
AccountService.getAccountDetails.getAccountDetailsService
```
factory
-------
```
tellerApp.factory('AccountService',['$resource', function ($resource) {
retur... | 2015/06/08 | [
"https://Stackoverflow.com/questions/30704258",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4376984/"
] | I suggest you define your code dependencies out of the returned provider:
```
tellerApp.factory('AccountService',['$resource', function ($resource) {
var getAccountDetails = $resource(XXX, {}, {getAccountDetailsService: {}});
return {
getAccountDetails : getAccountDetails,
getAccountInformati... | This should work, havent tested it though.
```
tellerApp.factory('AccountService',['$resource', function ($resource) {
var AccountService = {
getAccountDetails: $resource(XXX, {}, {
getAccountDetailsService: {}
}),
getAccountInformation: function($scope, number, transaction, ind... |
5,808,650 | Here are my models:
```
class Player < ActiveRecord::Base
has_many :registrations, :class_name => "PlayerRegistration"
end
class PlayerRegistration < ActiveRecord::Base
belongs_to :player
belongs_to :payment
def self.paid
where("payment_id IS NOT NULL")
end
def self.unpaid
where(:payment... | 2011/04/27 | [
"https://Stackoverflow.com/questions/5808650",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/303675/"
] | You need the real table name in the where() filter:
```
class Player < ActiveRecord::Base
def self.paid
includes(:registrations).where("player_registrations.payment_id IS NOT NULL")
end
end
``` | You could write:
```
class Player
scope :unpaid, includes(:registrations).where("player_registrations.payment_id is null")
scope :paid, includes(:registrations).where("player_registrations.payment_id is not null")
end
```
and now `Player.unpaid` will return all players with unpaid registrations.
If you write ... |
9,084,682 | I'm trying to setup my site on a production server, and it's basically crashing at line 291 in /system/core/CodeIgniter.php:
```
//instantiate the requested controller
// Mark a start point so we can benchmark the controller
$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start');
$CI = new $class(... | 2012/01/31 | [
"https://Stackoverflow.com/questions/9084682",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/366716/"
] | I had the same problem, I fixed that by installing the php-mysql package:
$ sudo yum install php-mysql | Add same issue on Cpanel , moving a CI project from php 5.3 to 5.4
Blank page or 500 internal server error
This resolve the issue :
Enable the "mysqli" extension in PHP (v5) via EasyApache, using the Exhaustive Options List (Cpanel). |
9,084,682 | I'm trying to setup my site on a production server, and it's basically crashing at line 291 in /system/core/CodeIgniter.php:
```
//instantiate the requested controller
// Mark a start point so we can benchmark the controller
$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start');
$CI = new $class(... | 2012/01/31 | [
"https://Stackoverflow.com/questions/9084682",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/366716/"
] | Add same issue on Cpanel , moving a CI project from php 5.3 to 5.4
Blank page or 500 internal server error
This resolve the issue :
Enable the "mysqli" extension in PHP (v5) via EasyApache, using the Exhaustive Options List (Cpanel). | In my case it was fixed by doing this:
```
yum install php-mysqli
```
on Centos 8 |
9,084,682 | I'm trying to setup my site on a production server, and it's basically crashing at line 291 in /system/core/CodeIgniter.php:
```
//instantiate the requested controller
// Mark a start point so we can benchmark the controller
$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start');
$CI = new $class(... | 2012/01/31 | [
"https://Stackoverflow.com/questions/9084682",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/366716/"
] | see the include\_path in php on your production server and/or make other frontend with development environment to see error | In my case it was fixed by doing this:
```
yum install php-mysqli
```
on Centos 8 |
9,084,682 | I'm trying to setup my site on a production server, and it's basically crashing at line 291 in /system/core/CodeIgniter.php:
```
//instantiate the requested controller
// Mark a start point so we can benchmark the controller
$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start');
$CI = new $class(... | 2012/01/31 | [
"https://Stackoverflow.com/questions/9084682",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/366716/"
] | Check this thread for similar issue: [CodeIgniter project loads blank webpage](https://stackoverflow.com/questions/7486872/codeigniter-project-loads-blank-webpage)
Also, in case you *don't* have mysql installed and/or a database set up for your site, TankAuth *does* need the database. Be sure to follow all the [instal... | My solution was the same than the others, install mysql compatibility to php. In my case the platform is ubuntu on Amazon AWS (Using mysql on RDS, not local):
`$sudo apt-get install php5-mysql`
`$sudo apt-get install mysql-client`
`$sudo service apache2 restart`
And thats is all, Greetings! |
9,084,682 | I'm trying to setup my site on a production server, and it's basically crashing at line 291 in /system/core/CodeIgniter.php:
```
//instantiate the requested controller
// Mark a start point so we can benchmark the controller
$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start');
$CI = new $class(... | 2012/01/31 | [
"https://Stackoverflow.com/questions/9084682",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/366716/"
] | I had the same problem, I fixed that by installing the php-mysql package:
$ sudo yum install php-mysql | My solution was the same than the others, install mysql compatibility to php. In my case the platform is ubuntu on Amazon AWS (Using mysql on RDS, not local):
`$sudo apt-get install php5-mysql`
`$sudo apt-get install mysql-client`
`$sudo service apache2 restart`
And thats is all, Greetings! |
9,084,682 | I'm trying to setup my site on a production server, and it's basically crashing at line 291 in /system/core/CodeIgniter.php:
```
//instantiate the requested controller
// Mark a start point so we can benchmark the controller
$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start');
$CI = new $class(... | 2012/01/31 | [
"https://Stackoverflow.com/questions/9084682",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/366716/"
] | Have you checked if error reporting is enabled? If not, try adding
```
ini_set('display_errors',1);
error_reporting(E_ALL);
```
to the beginning of index.php. | see the include\_path in php on your production server and/or make other frontend with development environment to see error |
9,084,682 | I'm trying to setup my site on a production server, and it's basically crashing at line 291 in /system/core/CodeIgniter.php:
```
//instantiate the requested controller
// Mark a start point so we can benchmark the controller
$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start');
$CI = new $class(... | 2012/01/31 | [
"https://Stackoverflow.com/questions/9084682",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/366716/"
] | Check this thread for similar issue: [CodeIgniter project loads blank webpage](https://stackoverflow.com/questions/7486872/codeigniter-project-loads-blank-webpage)
Also, in case you *don't* have mysql installed and/or a database set up for your site, TankAuth *does* need the database. Be sure to follow all the [instal... | Add same issue on Cpanel , moving a CI project from php 5.3 to 5.4
Blank page or 500 internal server error
This resolve the issue :
Enable the "mysqli" extension in PHP (v5) via EasyApache, using the Exhaustive Options List (Cpanel). |
9,084,682 | I'm trying to setup my site on a production server, and it's basically crashing at line 291 in /system/core/CodeIgniter.php:
```
//instantiate the requested controller
// Mark a start point so we can benchmark the controller
$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start');
$CI = new $class(... | 2012/01/31 | [
"https://Stackoverflow.com/questions/9084682",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/366716/"
] | Have you checked if error reporting is enabled? If not, try adding
```
ini_set('display_errors',1);
error_reporting(E_ALL);
```
to the beginning of index.php. | i had the same problem, in my case i needed install de lib php-pgsql(because i use postgresql) on my server. After that, the problem was solved |
9,084,682 | I'm trying to setup my site on a production server, and it's basically crashing at line 291 in /system/core/CodeIgniter.php:
```
//instantiate the requested controller
// Mark a start point so we can benchmark the controller
$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start');
$CI = new $class(... | 2012/01/31 | [
"https://Stackoverflow.com/questions/9084682",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/366716/"
] | Check this thread for similar issue: [CodeIgniter project loads blank webpage](https://stackoverflow.com/questions/7486872/codeigniter-project-loads-blank-webpage)
Also, in case you *don't* have mysql installed and/or a database set up for your site, TankAuth *does* need the database. Be sure to follow all the [instal... | see the include\_path in php on your production server and/or make other frontend with development environment to see error |
9,084,682 | I'm trying to setup my site on a production server, and it's basically crashing at line 291 in /system/core/CodeIgniter.php:
```
//instantiate the requested controller
// Mark a start point so we can benchmark the controller
$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start');
$CI = new $class(... | 2012/01/31 | [
"https://Stackoverflow.com/questions/9084682",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/366716/"
] | I had the same problem, I fixed that by installing the php-mysql package:
$ sudo yum install php-mysql | i had the same problem, in my case i needed install de lib php-pgsql(because i use postgresql) on my server. After that, the problem was solved |
39,149,747 | I am new to React. This is probably a noob question.
I want to change the "filteredFields" prop of my MeteorGriddle component when the user clicks a checkbox. My JSX:
```
const bookingsPage = () => {
let filteredFields = ['userName'];
const handleClick = (e) => {
if (e.target.checked) {
fi... | 2016/08/25 | [
"https://Stackoverflow.com/questions/39149747",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/372459/"
] | I see two ways of solving your problem.
**The first and easy way to do this:**
Turn your bookingsPage component into statefull component instead of functional,
then you'd be able to create state inside it, and then change the state on event alongside with passing it to MeteorGriddle component.
So the code would be:
... | As @Maxx says, you should use a component with state. Then when you call the setState method, it will render again, updating the props of the children.
In your case this should work (also using ES6 notation):
```
import React from 'react';
import MeteorGriddle from '...whatever path...';
class bookingsPage extends R... |
39,149,747 | I am new to React. This is probably a noob question.
I want to change the "filteredFields" prop of my MeteorGriddle component when the user clicks a checkbox. My JSX:
```
const bookingsPage = () => {
let filteredFields = ['userName'];
const handleClick = (e) => {
if (e.target.checked) {
fi... | 2016/08/25 | [
"https://Stackoverflow.com/questions/39149747",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/372459/"
] | I see two ways of solving your problem.
**The first and easy way to do this:**
Turn your bookingsPage component into statefull component instead of functional,
then you'd be able to create state inside it, and then change the state on event alongside with passing it to MeteorGriddle component.
So the code would be:
... | There are number of ways to achieve this, you can just try like the below code,
```
import React from 'react';
class bookingsPage extends React.Component {
state = {
filteredFields: ['userName']
};
constructor(props) {
super(props);
}
handleChange(e) {
if (e.target.checked) {
this.setState({
filtere... |
39,149,747 | I am new to React. This is probably a noob question.
I want to change the "filteredFields" prop of my MeteorGriddle component when the user clicks a checkbox. My JSX:
```
const bookingsPage = () => {
let filteredFields = ['userName'];
const handleClick = (e) => {
if (e.target.checked) {
fi... | 2016/08/25 | [
"https://Stackoverflow.com/questions/39149747",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/372459/"
] | As @Maxx says, you should use a component with state. Then when you call the setState method, it will render again, updating the props of the children.
In your case this should work (also using ES6 notation):
```
import React from 'react';
import MeteorGriddle from '...whatever path...';
class bookingsPage extends R... | There are number of ways to achieve this, you can just try like the below code,
```
import React from 'react';
class bookingsPage extends React.Component {
state = {
filteredFields: ['userName']
};
constructor(props) {
super(props);
}
handleChange(e) {
if (e.target.checked) {
this.setState({
filtere... |
21,848,614 | I have an options page in my wordpress theme, it's to select a number of categories from a custom taxonomy.
```
$terms_obj = get_option('shop_features')
```
This returns an array with $key being the category-name and $value being either 1 or empty depending if the category was checked.
I need to grab a list of the ... | 2014/02/18 | [
"https://Stackoverflow.com/questions/21848614",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/992558/"
] | The right way seems to be commented out by you, below should work
```
foreach ( $terms_obj as $slug => $checked ) { //$key ==> value
if ( $checked > 0 )
$terms[] = $slug;
}
$q->set( 'tax_query', array(array(
'taxonomy' => 'product_cat',
'field' => 'slug',
'terms' => $terms,... | Just prepare an array in the loop
```
$terms[] = $slug
```
And assign to term
```
'terms' => $terms,
``` |
21,848,614 | I have an options page in my wordpress theme, it's to select a number of categories from a custom taxonomy.
```
$terms_obj = get_option('shop_features')
```
This returns an array with $key being the category-name and $value being either 1 or empty depending if the category was checked.
I need to grab a list of the ... | 2014/02/18 | [
"https://Stackoverflow.com/questions/21848614",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/992558/"
] | The right way seems to be commented out by you, below should work
```
foreach ( $terms_obj as $slug => $checked ) { //$key ==> value
if ( $checked > 0 )
$terms[] = $slug;
}
$q->set( 'tax_query', array(array(
'taxonomy' => 'product_cat',
'field' => 'slug',
'terms' => $terms,... | To get your array of category names you can do :
```
$terms_obj = get_option('shop_features');
$category_name_array = array_keys($terms_obj, 1);
```
The `array_keys($terms_obj, 1)` function will extract in an array all the keys of the $terms\_obj for witch the value match 1.
More info : <http://php.net/man... |
21,848,614 | I have an options page in my wordpress theme, it's to select a number of categories from a custom taxonomy.
```
$terms_obj = get_option('shop_features')
```
This returns an array with $key being the category-name and $value being either 1 or empty depending if the category was checked.
I need to grab a list of the ... | 2014/02/18 | [
"https://Stackoverflow.com/questions/21848614",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/992558/"
] | To get your array of category names you can do :
```
$terms_obj = get_option('shop_features');
$category_name_array = array_keys($terms_obj, 1);
```
The `array_keys($terms_obj, 1)` function will extract in an array all the keys of the $terms\_obj for witch the value match 1.
More info : <http://php.net/man... | Just prepare an array in the loop
```
$terms[] = $slug
```
And assign to term
```
'terms' => $terms,
``` |
56,338,512 | I have a table where 1 of the rows is an integer that represents the rows time. Problem is the table isn't full, there are missing timestamps.
I would like to fill missing values such that every 10 seconds there is a row. I want the rest of the columns to be nuns (later I'll forward fill these nuns).
10 secs is basi... | 2019/05/28 | [
"https://Stackoverflow.com/questions/56338512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11529177/"
] | If your values are strictly parted by 10 seconds, and there are just some multiples of 10 seconds intervals which are missing, you can go by this approach to fill your data holes:
```
WITH minsmax AS (
SELECT
MIN(time) AS minval,
MAX(time) AS maxval
FROM `dataset.table`
)
SELECT
IF (d.time <= i.ti... | You can use arrays. For numbers, you can do:
```
select n
from unnest(generate_array(1, 1000, 1)) n;
```
There are similar functions for `generate_timestamp_array()` and `generate_date_array()` if you really need those types. |
56,338,512 | I have a table where 1 of the rows is an integer that represents the rows time. Problem is the table isn't full, there are missing timestamps.
I would like to fill missing values such that every 10 seconds there is a row. I want the rest of the columns to be nuns (later I'll forward fill these nuns).
10 secs is basi... | 2019/05/28 | [
"https://Stackoverflow.com/questions/56338512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11529177/"
] | I ended up using the following query through python API:
```
"""
SELECT
i.time,
Sensor_Reading,
Sensor_Name
FROM (
SELECT time FROM UNNEST(GENERATE_ARRAY({min_time}, {max_time}+{sampling_period}+1, {sampling_period})) AS time
) AS i
LEFT JOIN
`{input_table}` AS inpu... | You can use arrays. For numbers, you can do:
```
select n
from unnest(generate_array(1, 1000, 1)) n;
```
There are similar functions for `generate_timestamp_array()` and `generate_date_array()` if you really need those types. |
56,106,244 | The following code below print "34" instead of the expected ".34"
```
use strict;
use warnings;
use Regexp::Common;
my $regex = qr/\b($RE{num}{real})\s*/;
my $str = "This is .34 meters of cable";
if ($str =~ /$regex/) {
print $1;
}
```
Do I need to fix my regex? (The word boundary is need as not including it ... | 2019/05/13 | [
"https://Stackoverflow.com/questions/56106244",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10704286/"
] | The word boundary is a context-dependent regex construct. When it is followed with a word char (letter, digit or `_`) this location should be preceded either with the start of a string or a non-word char. In this concrete case, the word boundary is followed with a non-word char and thus requires a word char to appear r... | Try this patern: `(?:^| )(\d*\.?\d+)`
Explanation:
`(?:...)` - non-capturing group
`^|` - match either `^` - beginning oof a string or - space
`\d*` - match zero or more digits
`\.?` - match dot literally - zero or one
`\d+` - match one or more digits
Matched number will be stored in first capturing group.
[De... |
32,603,907 | I have a very simple PowerShell script that adds a sql server login to a db role. Since I use it for SQL 2008 I need to use the `sp_addrolemember` stored procedure.
If I use t-sql in management studio like this:
```
declare @dbrole varchar(100)
set @dbrole = 'db_owner'
declare @login varch... | 2015/09/16 | [
"https://Stackoverflow.com/questions/32603907",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3665373/"
] | Although I recommend using an image editor to remove the borders, there is a CSS hack for this:
**Negative margins:**
1. Wrap the image inside a container and set `overflow: hidden` after
defining the dimensions(width and height). Make sure the dimensions are slightly less than the image dimensions.
2. Set negative m... | you can use `clip-path` on [modern browsers](http://caniuse.com/#feat=css-clip-path) so you wouldn't need to add a wrapper and set the size of the image
Example: <http://codepen.io/anon/pen/Gpoamy>
```
img {
-webkit-clip-path: inset(1px 1px 1px 1px);
clip-path: inset(1px 1px 1px 1px)
}
```
On older browsers... |
28,197,253 | I'm pretty familiar with WordPress, and a fan of this CMS. So I'm used to the `get_header()` function that includes the `header.php` file. But now I'm developing a raw PHP project, and I want a similar ease here too. I designed a folder structure like below:
```
project/
css/
bootstrap.css
j... | 2015/01/28 | [
"https://Stackoverflow.com/questions/28197253",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1743124/"
] | If you have access to your `php.ini` file, and assuming you are running Apache 2 and have access to the Apache configuration file, you can edit these files to solve your problem.
**Step 1: Editing the Apache configuration**
You need to set the Directory and Document Root in your Apache configuration to be the path to... | I had the same problem when using include menu so that i didn't had to change menu on each page.
So i hardcoded the url's:
```
<?php require_once('//domain.com/header.php'); ?>
``` |
28,197,253 | I'm pretty familiar with WordPress, and a fan of this CMS. So I'm used to the `get_header()` function that includes the `header.php` file. But now I'm developing a raw PHP project, and I want a similar ease here too. I designed a folder structure like below:
```
project/
css/
bootstrap.css
j... | 2015/01/28 | [
"https://Stackoverflow.com/questions/28197253",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1743124/"
] | Okay, I found a most solid solution: the HTML `<base>` tag –
```
<html>
<head>
<base href="http://example.com/">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
...
```
**Source:**
<http://www.w3schools.com/tags/tag_base.... | I had the same problem when using include menu so that i didn't had to change menu on each page.
So i hardcoded the url's:
```
<?php require_once('//domain.com/header.php'); ?>
``` |
28,197,253 | I'm pretty familiar with WordPress, and a fan of this CMS. So I'm used to the `get_header()` function that includes the `header.php` file. But now I'm developing a raw PHP project, and I want a similar ease here too. I designed a folder structure like below:
```
project/
css/
bootstrap.css
j... | 2015/01/28 | [
"https://Stackoverflow.com/questions/28197253",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1743124/"
] | Okay, I found a most solid solution: the HTML `<base>` tag –
```
<html>
<head>
<base href="http://example.com/">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
...
```
**Source:**
<http://www.w3schools.com/tags/tag_base.... | If you have access to your `php.ini` file, and assuming you are running Apache 2 and have access to the Apache configuration file, you can edit these files to solve your problem.
**Step 1: Editing the Apache configuration**
You need to set the Directory and Document Root in your Apache configuration to be the path to... |
27,077,967 | I have a immutable list and need a new copy of it with elements replaced at multiple index locations. The List.updated is an O(n) operation and can only replace one at a time. What is the efficient way of doing this? Thanks! | 2014/11/22 | [
"https://Stackoverflow.com/questions/27077967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2625798/"
] | `List` is not a good fit if you need random element access/update. From the [documentation](http://www.scala-lang.org/api/2.11.1/index.html#scala.collection.immutable.List):
>
> This class is optimal for last-in-first-out (LIFO), stack-like access patterns. If you need another access pattern, for example, random acce... | ```
list
.iterator
.zipWithIndex
.map { case (index, element) => newElementFor(index) }
.toList
``` |
220,170 | I've skimmed through several sparse articles online about hysteresis in a MOSFET's I-V characteristics. What I found was sparse, but some articles attribute uneven-ness in the gate structure, causing some charge to move slower.
As for my limited knowledge of Physics, it's still reasonable to think that pulling or push... | 2016/03/01 | [
"https://electronics.stackexchange.com/questions/220170",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/58458/"
] | I have been studying/working with MOSFETs for 25 years and I've **never** heard/read about *"hysteresis in a MOSFET's I-V characteristics"*. So in my opinion: **it does not exist**.
Maybe it exists on a theoretical level but in practice I have yet to see it before I believe it exists.
The only hysteresis that you wou... | If you look at the curves from an IRF9510, they do not conform to the expected results. I found this out when I tried to use one for a linear application. P-CH MOSFETs from other manufacturers do not, in general, have the same behavior. In the image below, the gate voltage is offset by an external power supply to just ... |
220,170 | I've skimmed through several sparse articles online about hysteresis in a MOSFET's I-V characteristics. What I found was sparse, but some articles attribute uneven-ness in the gate structure, causing some charge to move slower.
As for my limited knowledge of Physics, it's still reasonable to think that pulling or push... | 2016/03/01 | [
"https://electronics.stackexchange.com/questions/220170",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/58458/"
] | I have been studying/working with MOSFETs for 25 years and I've **never** heard/read about *"hysteresis in a MOSFET's I-V characteristics"*. So in my opinion: **it does not exist**.
Maybe it exists on a theoretical level but in practice I have yet to see it before I believe it exists.
The only hysteresis that you wou... | Vishay manufactured this FET. IR fabbed devices have similar performance.
A Fairchild FTP3P20 performs as expected. [](https://i.stack.imgur.com/SvWUq.jpg) |
220,170 | I've skimmed through several sparse articles online about hysteresis in a MOSFET's I-V characteristics. What I found was sparse, but some articles attribute uneven-ness in the gate structure, causing some charge to move slower.
As for my limited knowledge of Physics, it's still reasonable to think that pulling or push... | 2016/03/01 | [
"https://electronics.stackexchange.com/questions/220170",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/58458/"
] | Vishay manufactured this FET. IR fabbed devices have similar performance.
A Fairchild FTP3P20 performs as expected. [](https://i.stack.imgur.com/SvWUq.jpg) | If you look at the curves from an IRF9510, they do not conform to the expected results. I found this out when I tried to use one for a linear application. P-CH MOSFETs from other manufacturers do not, in general, have the same behavior. In the image below, the gate voltage is offset by an external power supply to just ... |
52,539,941 | I have a macro where I am going through columns and identifying whether the "top" cell (row 7, because there are various irrelevant headers) matches certain specified values, and then performing various actions.
The problem is that some of the headers are merged cells. This means that the code correctly recognises on... | 2018/09/27 | [
"https://Stackoverflow.com/questions/52539941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6078710/"
] | Use the [`Range.MergeArea`](https://learn.microsoft.com/en-us/office/vba/api/excel.range.mergearea) property.
>
> Returns a Range object that represents the merged range containing the specified cell. If the specified cell isn't in a merged range, this property returns the specified cell.
>
>
>
So for example, if... | All those comments and no one provided an actual working answer. Try this:
```
Sub LabourCalc()
Dim wb as Workbook
Set wb = Workbooks("XXX")
Dim ws as Worksheet
Set ws = wb.Worksheets("XXX")
For x = 1 To 10
Select Case UCase$(ws.Cells(7,x).MergeArea.Cells(1,1))
Case is = "MAN... |
43,066,117 | I'm trying to copy file from within my application to the SD card, but I get the error **eacces (permission denied)**. The OS is Android M and I have allowed runtime Storage permissions (checked in app info). I have also set the uses-permission in AndroidManifest.xml
```
<application>...</application>
<uses-permission... | 2017/03/28 | [
"https://Stackoverflow.com/questions/43066117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/864850/"
] | After Android 4.3 on some devices, you can't get direct write access to FileSystem on SDcard.
You should use [storage access framework](https://developer.android.com/guide/topics/providers/document-provider.html) for that. | You can't copy or Delete files & Folder on external storage using third party app. like [file explorer].
It's data policy updated after **KITKAT** Version.
If only allow on system apps. So you can use an original file explorer (Come from ROM).
IF you need to use 3rd party app then **ROOT** your device. (Root permis... |
43,066,117 | I'm trying to copy file from within my application to the SD card, but I get the error **eacces (permission denied)**. The OS is Android M and I have allowed runtime Storage permissions (checked in app info). I have also set the uses-permission in AndroidManifest.xml
```
<application>...</application>
<uses-permission... | 2017/03/28 | [
"https://Stackoverflow.com/questions/43066117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/864850/"
] | As suggested by @CommonsWare here we have to use the new Storage Access Framework provided by android and will have to take permission from user to write SD card file as you said this is already written in the File Manager Application ES File Explorer.
Here is the code for Letting the user choose the "SD card" :
```
... | I have also got that problem but i solved by use the request the permission in run time and after forcefully give the permission.After the permission in App info of Android device. after declare the permission in manifest =>go to setting of your device => go to app info => go to permission =>
and finally allow the perm... |
43,066,117 | I'm trying to copy file from within my application to the SD card, but I get the error **eacces (permission denied)**. The OS is Android M and I have allowed runtime Storage permissions (checked in app info). I have also set the uses-permission in AndroidManifest.xml
```
<application>...</application>
<uses-permission... | 2017/03/28 | [
"https://Stackoverflow.com/questions/43066117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/864850/"
] | As suggested by @CommonsWare here we have to use the new Storage Access Framework provided by android and will have to take permission from user to write SD card file as you said this is already written in the File Manager Application ES File Explorer.
Here is the code for Letting the user choose the "SD card" :
```
... | Its seems the runtime permission are implemented correctly but the issues seems from the device
If you are using Redmi than you have to manually allow the permission of specific app in Redmi security settings
This [link](http://xiaomiadvices.com/miui7-enable-permission-manager-xiaomi-mi-redmi-phones/) shows how to enab... |
43,066,117 | I'm trying to copy file from within my application to the SD card, but I get the error **eacces (permission denied)**. The OS is Android M and I have allowed runtime Storage permissions (checked in app info). I have also set the uses-permission in AndroidManifest.xml
```
<application>...</application>
<uses-permission... | 2017/03/28 | [
"https://Stackoverflow.com/questions/43066117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/864850/"
] | As suggested by @CommonsWare here we have to use the new Storage Access Framework provided by android and will have to take permission from user to write SD card file as you said this is already written in the File Manager Application ES File Explorer.
Here is the code for Letting the user choose the "SD card" :
```
... | You need to add permission request run time in Android 6.0 (API Level 23) and up, here is the [official](https://developer.android.com/training/permissions/requesting.html) docs
This is the code for `WRITE_EXTERNAL_STORAGE`
```
if (checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageMana... |
43,066,117 | I'm trying to copy file from within my application to the SD card, but I get the error **eacces (permission denied)**. The OS is Android M and I have allowed runtime Storage permissions (checked in app info). I have also set the uses-permission in AndroidManifest.xml
```
<application>...</application>
<uses-permission... | 2017/03/28 | [
"https://Stackoverflow.com/questions/43066117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/864850/"
] | You need to add permission request run time in Android 6.0 (API Level 23) and up, here is the [official](https://developer.android.com/training/permissions/requesting.html) docs
This is the code for `WRITE_EXTERNAL_STORAGE`
```
if (checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageMana... | I have also got that problem but i solved by use the request the permission in run time and after forcefully give the permission.After the permission in App info of Android device. after declare the permission in manifest =>go to setting of your device => go to app info => go to permission =>
and finally allow the perm... |
43,066,117 | I'm trying to copy file from within my application to the SD card, but I get the error **eacces (permission denied)**. The OS is Android M and I have allowed runtime Storage permissions (checked in app info). I have also set the uses-permission in AndroidManifest.xml
```
<application>...</application>
<uses-permission... | 2017/03/28 | [
"https://Stackoverflow.com/questions/43066117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/864850/"
] | You need to add permission request run time in Android 6.0 (API Level 23) and up, here is the [official](https://developer.android.com/training/permissions/requesting.html) docs
This is the code for `WRITE_EXTERNAL_STORAGE`
```
if (checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageMana... | You can't copy or Delete files & Folder on external storage using third party app. like [file explorer].
It's data policy updated after **KITKAT** Version.
If only allow on system apps. So you can use an original file explorer (Come from ROM).
IF you need to use 3rd party app then **ROOT** your device. (Root permis... |
43,066,117 | I'm trying to copy file from within my application to the SD card, but I get the error **eacces (permission denied)**. The OS is Android M and I have allowed runtime Storage permissions (checked in app info). I have also set the uses-permission in AndroidManifest.xml
```
<application>...</application>
<uses-permission... | 2017/03/28 | [
"https://Stackoverflow.com/questions/43066117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/864850/"
] | I have also got that problem but i solved by use the request the permission in run time and after forcefully give the permission.After the permission in App info of Android device. after declare the permission in manifest =>go to setting of your device => go to app info => go to permission =>
and finally allow the perm... | I can see that you are copying the entire content of one file and trying to write the same to another file. I could suggest a better way to do this :
Assuming that you already checked for file existence
```
StringWriter temp=new StringWriter();
try{
FileInputStream fis=new FileInputStream(inputFi... |
43,066,117 | I'm trying to copy file from within my application to the SD card, but I get the error **eacces (permission denied)**. The OS is Android M and I have allowed runtime Storage permissions (checked in app info). I have also set the uses-permission in AndroidManifest.xml
```
<application>...</application>
<uses-permission... | 2017/03/28 | [
"https://Stackoverflow.com/questions/43066117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/864850/"
] | I have also got that problem but i solved by use the request the permission in run time and after forcefully give the permission.After the permission in App info of Android device. after declare the permission in manifest =>go to setting of your device => go to app info => go to permission =>
and finally allow the perm... | After Android 4.3 on some devices, you can't get direct write access to FileSystem on SDcard.
You should use [storage access framework](https://developer.android.com/guide/topics/providers/document-provider.html) for that. |
43,066,117 | I'm trying to copy file from within my application to the SD card, but I get the error **eacces (permission denied)**. The OS is Android M and I have allowed runtime Storage permissions (checked in app info). I have also set the uses-permission in AndroidManifest.xml
```
<application>...</application>
<uses-permission... | 2017/03/28 | [
"https://Stackoverflow.com/questions/43066117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/864850/"
] | You need to add permission request run time in Android 6.0 (API Level 23) and up, here is the [official](https://developer.android.com/training/permissions/requesting.html) docs
This is the code for `WRITE_EXTERNAL_STORAGE`
```
if (checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageMana... | Its seems the runtime permission are implemented correctly but the issues seems from the device
If you are using Redmi than you have to manually allow the permission of specific app in Redmi security settings
This [link](http://xiaomiadvices.com/miui7-enable-permission-manager-xiaomi-mi-redmi-phones/) shows how to enab... |
43,066,117 | I'm trying to copy file from within my application to the SD card, but I get the error **eacces (permission denied)**. The OS is Android M and I have allowed runtime Storage permissions (checked in app info). I have also set the uses-permission in AndroidManifest.xml
```
<application>...</application>
<uses-permission... | 2017/03/28 | [
"https://Stackoverflow.com/questions/43066117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/864850/"
] | As suggested by @CommonsWare here we have to use the new Storage Access Framework provided by android and will have to take permission from user to write SD card file as you said this is already written in the File Manager Application ES File Explorer.
Here is the code for Letting the user choose the "SD card" :
```
... | You can't copy or Delete files & Folder on external storage using third party app. like [file explorer].
It's data policy updated after **KITKAT** Version.
If only allow on system apps. So you can use an original file explorer (Come from ROM).
IF you need to use 3rd party app then **ROOT** your device. (Root permis... |
41,688,966 | I am working with a dataset of hourly temperatures and I need to calculate "degree hours" above a heat threshold for each extreme event. I intend to run stats on the intensities (combined magnitude and duration) of each event to compare multiple sites over the same time period.
Example of data:
```
Temp
1 ... | 2017/01/17 | [
"https://Stackoverflow.com/questions/41688966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7428358/"
] | This is an alternative solution in base R.
You have some data that walks around, and you want to sum up the points above a cutoff. For example:
```
set.seed(99999)
x <- cumsum(rnorm(30))
plot(x, type='b')
abline(h=2, lty='dashed')
```
which looks like this:
[
setDT( df )
temp.threshold <- 18
```
First make a column showing the *previous* value from each one in your data. This will help to find the point at which the temperature rose above your threshold value.
```
df[ , lag... |
23,160,844 | I just used `check out head` after making a commit. I figured that doing this checkout would not actually do anything, but I seem to have been wrong. It put me into a 'detached head' state. I ignored this note, and continued to make a few additional commits. The message change to 'Head detached from ...' Feeling a bit ... | 2014/04/18 | [
"https://Stackoverflow.com/questions/23160844",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2370337/"
] | ### TL;DR
Use `git reflog` to find the lost commits. Give them a name—e.g., a branch name—and then consider whether to copy them to new-and-improved commits, perhaps using `git cherry-pick` or `git rebase`.
### Long
It's not clear to me what you did to get into "detached HEAD" state. (Anything that checks out a comm... | A detached head is perfectly normal and means that the copy you have point directly to the commit instead of a symbolic-ref in the branch. You can see more details on this [here](https://stackoverflow.com/a/5772882/2279816).
How do you come out of your situation? Well, use `git reflog` to see the stuff you did before ... |
52,419,074 | I have a banking program with an enter customer, and balance method. The method adds a String and a double to my accounts ArrayList, if the name Sam for example is inputted, I want to stop that name from being inputted again, as currently it creates two separate Strings and balances for Sam and when withdrawing/deposit... | 2018/09/20 | [
"https://Stackoverflow.com/questions/52419074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10218609/"
] | Are you set on using an Array with Accounts?
Other data structures exist, such as the [Set](https://docs.oracle.com/javase/7/docs/api/java/util/Set.html) That already filter duplicate entries. Set checks the equals method of the objects being inserted against the elements in the Set. In this case that means you would... | If you dont want to use duplicate values then go with **Set** interface which is a part java.util and extends java.util.Collection interface. It does not allow the use of duplicate elements and at max can accommodate only one null element.
For more reference check the following link
[Set in java](https://www.geeksfo... |
52,419,074 | I have a banking program with an enter customer, and balance method. The method adds a String and a double to my accounts ArrayList, if the name Sam for example is inputted, I want to stop that name from being inputted again, as currently it creates two separate Strings and balances for Sam and when withdrawing/deposit... | 2018/09/20 | [
"https://Stackoverflow.com/questions/52419074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10218609/"
] | Are you set on using an Array with Accounts?
Other data structures exist, such as the [Set](https://docs.oracle.com/javase/7/docs/api/java/util/Set.html) That already filter duplicate entries. Set checks the equals method of the objects being inserted against the elements in the Set. In this case that means you would... | With java 8 you can do this
```
boolean nameExists = accounts.stream().anyMatch(account-> "name".equals(account.getName()));
```
or another approach would be storing name and balance as key value pairs in [HashMap](https://docs.oracle.com/javase/7/docs/api/java/util/HashMap.html), it has a method [containsKey](https... |
52,419,074 | I have a banking program with an enter customer, and balance method. The method adds a String and a double to my accounts ArrayList, if the name Sam for example is inputted, I want to stop that name from being inputted again, as currently it creates two separate Strings and balances for Sam and when withdrawing/deposit... | 2018/09/20 | [
"https://Stackoverflow.com/questions/52419074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10218609/"
] | Are you set on using an Array with Accounts?
Other data structures exist, such as the [Set](https://docs.oracle.com/javase/7/docs/api/java/util/Set.html) That already filter duplicate entries. Set checks the equals method of the objects being inserted against the elements in the Set. In this case that means you would... | Thank you everyone for commenting! I should have mentioned I'm in my first semester of computer science so everything's still very new to me, but now I've got some more stuff to study up on haha. I decided to go with the for loop suggested by Carlos for simplicity sake.
```
for (Account acc : accounts) {
... |
52,419,074 | I have a banking program with an enter customer, and balance method. The method adds a String and a double to my accounts ArrayList, if the name Sam for example is inputted, I want to stop that name from being inputted again, as currently it creates two separate Strings and balances for Sam and when withdrawing/deposit... | 2018/09/20 | [
"https://Stackoverflow.com/questions/52419074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10218609/"
] | There are many ways of doing this. Here's a way that requires the least modification to your existing code that I can think of:
```
name = MyConsole.getString("Enter a customer name: ");
if (name.equals("q")) {
break;
}
if (accounts.stream().anyMatch(x -> x.getName().equals(name))) {
System.out.println("This n... | If you dont want to use duplicate values then go with **Set** interface which is a part java.util and extends java.util.Collection interface. It does not allow the use of duplicate elements and at max can accommodate only one null element.
For more reference check the following link
[Set in java](https://www.geeksfo... |
52,419,074 | I have a banking program with an enter customer, and balance method. The method adds a String and a double to my accounts ArrayList, if the name Sam for example is inputted, I want to stop that name from being inputted again, as currently it creates two separate Strings and balances for Sam and when withdrawing/deposit... | 2018/09/20 | [
"https://Stackoverflow.com/questions/52419074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10218609/"
] | There are many ways of doing this. Here's a way that requires the least modification to your existing code that I can think of:
```
name = MyConsole.getString("Enter a customer name: ");
if (name.equals("q")) {
break;
}
if (accounts.stream().anyMatch(x -> x.getName().equals(name))) {
System.out.println("This n... | With java 8 you can do this
```
boolean nameExists = accounts.stream().anyMatch(account-> "name".equals(account.getName()));
```
or another approach would be storing name and balance as key value pairs in [HashMap](https://docs.oracle.com/javase/7/docs/api/java/util/HashMap.html), it has a method [containsKey](https... |
52,419,074 | I have a banking program with an enter customer, and balance method. The method adds a String and a double to my accounts ArrayList, if the name Sam for example is inputted, I want to stop that name from being inputted again, as currently it creates two separate Strings and balances for Sam and when withdrawing/deposit... | 2018/09/20 | [
"https://Stackoverflow.com/questions/52419074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10218609/"
] | There are many ways of doing this. Here's a way that requires the least modification to your existing code that I can think of:
```
name = MyConsole.getString("Enter a customer name: ");
if (name.equals("q")) {
break;
}
if (accounts.stream().anyMatch(x -> x.getName().equals(name))) {
System.out.println("This n... | Thank you everyone for commenting! I should have mentioned I'm in my first semester of computer science so everything's still very new to me, but now I've got some more stuff to study up on haha. I decided to go with the for loop suggested by Carlos for simplicity sake.
```
for (Account acc : accounts) {
... |
52,419,074 | I have a banking program with an enter customer, and balance method. The method adds a String and a double to my accounts ArrayList, if the name Sam for example is inputted, I want to stop that name from being inputted again, as currently it creates two separate Strings and balances for Sam and when withdrawing/deposit... | 2018/09/20 | [
"https://Stackoverflow.com/questions/52419074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10218609/"
] | With java 8 you can do this
```
boolean nameExists = accounts.stream().anyMatch(account-> "name".equals(account.getName()));
```
or another approach would be storing name and balance as key value pairs in [HashMap](https://docs.oracle.com/javase/7/docs/api/java/util/HashMap.html), it has a method [containsKey](https... | If you dont want to use duplicate values then go with **Set** interface which is a part java.util and extends java.util.Collection interface. It does not allow the use of duplicate elements and at max can accommodate only one null element.
For more reference check the following link
[Set in java](https://www.geeksfo... |
52,419,074 | I have a banking program with an enter customer, and balance method. The method adds a String and a double to my accounts ArrayList, if the name Sam for example is inputted, I want to stop that name from being inputted again, as currently it creates two separate Strings and balances for Sam and when withdrawing/deposit... | 2018/09/20 | [
"https://Stackoverflow.com/questions/52419074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10218609/"
] | Thank you everyone for commenting! I should have mentioned I'm in my first semester of computer science so everything's still very new to me, but now I've got some more stuff to study up on haha. I decided to go with the for loop suggested by Carlos for simplicity sake.
```
for (Account acc : accounts) {
... | If you dont want to use duplicate values then go with **Set** interface which is a part java.util and extends java.util.Collection interface. It does not allow the use of duplicate elements and at max can accommodate only one null element.
For more reference check the following link
[Set in java](https://www.geeksfo... |
46,697 | I recently watched an Air Crash Investigation episode where Qantas flight 32 lost an engine shortly after takeoff. It was revealed that a *stud pipe* in a Rolls-Royce engine was made incorrectly, causing the pipe to snap and burst through the engine and the aircraft's wing, severing major hydraulic systems, and causing... | 2017/12/17 | [
"https://aviation.stackexchange.com/questions/46697",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/18800/"
] | Technically speaking, a control check is part of any pre-flight.
In the case of Qantas 32, one engine had exploded, punching holes in the wing and setting off a host of warnings, so there was a reasonable expectation that some of the controls might also have been damaged.
What the pilot did was put the plane throug... | Aircraft control their flight using movable portions of the wing and tail called control surfaces; a control check is a check performed to make sure that they're capable of moving through the range of motion that they're expected to be capable of moving through. In the case of small airplanes, they're connected to the ... |
46,697 | I recently watched an Air Crash Investigation episode where Qantas flight 32 lost an engine shortly after takeoff. It was revealed that a *stud pipe* in a Rolls-Royce engine was made incorrectly, causing the pipe to snap and burst through the engine and the aircraft's wing, severing major hydraulic systems, and causing... | 2017/12/17 | [
"https://aviation.stackexchange.com/questions/46697",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/18800/"
] | Technically speaking, a control check is part of any pre-flight.
In the case of Qantas 32, one engine had exploded, punching holes in the wing and setting off a host of warnings, so there was a reasonable expectation that some of the controls might also have been damaged.
What the pilot did was put the plane throug... | Why controllability checks matter
---------------------------------
The procedure you're referring to from the QF32 mishap is called a "controllability check". While a standard control check is done as part of a ground preflight to make sure that the flight controls work well enough to fly, a *controllability* check i... |
46,697 | I recently watched an Air Crash Investigation episode where Qantas flight 32 lost an engine shortly after takeoff. It was revealed that a *stud pipe* in a Rolls-Royce engine was made incorrectly, causing the pipe to snap and burst through the engine and the aircraft's wing, severing major hydraulic systems, and causing... | 2017/12/17 | [
"https://aviation.stackexchange.com/questions/46697",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/18800/"
] | Why controllability checks matter
---------------------------------
The procedure you're referring to from the QF32 mishap is called a "controllability check". While a standard control check is done as part of a ground preflight to make sure that the flight controls work well enough to fly, a *controllability* check i... | Aircraft control their flight using movable portions of the wing and tail called control surfaces; a control check is a check performed to make sure that they're capable of moving through the range of motion that they're expected to be capable of moving through. In the case of small airplanes, they're connected to the ... |
32,256,171 | So I have a containing element whose width gets smaller as the screen get smaller `#Aa`, this element has a `<nav>` element that contains a `<ul>` element and some `<li>` elements as menu items.
When `#Aa` can no longer contain all the `<li>` elements the page layout is broken.
What I would like to happen is what is ... | 2015/08/27 | [
"https://Stackoverflow.com/questions/32256171",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5021893/"
] | This is solved simply by below two lines of code.
```
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (comboBox1.SelectedIndex == 3)
{
foreach (DataRow row in dt1.Rows)
comboBox2.Items.Add(row["course_name"]);
}
}
``` | You could project the data into a collection that has named fields to prevent the default ToString()ing of the datarow objects:
```
if (comboBox1.SelectedIndex == 3)
{
comboBox2.ValueMember = "course_name_value";
comboBox2.DisplayMember = "course_name";
comboBox2.DataSource = dt1.AsEnumerable().Select
... |
32,256,171 | So I have a containing element whose width gets smaller as the screen get smaller `#Aa`, this element has a `<nav>` element that contains a `<ul>` element and some `<li>` elements as menu items.
When `#Aa` can no longer contain all the `<li>` elements the page layout is broken.
What I would like to happen is what is ... | 2015/08/27 | [
"https://Stackoverflow.com/questions/32256171",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5021893/"
] | This is solved simply by below two lines of code.
```
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (comboBox1.SelectedIndex == 3)
{
foreach (DataRow row in dt1.Rows)
comboBox2.Items.Add(row["course_name"]);
}
}
``` | I ran a mock test, and I think it's disposing of your dataset(when it finished the OnLoad event) before you can get to the selectedIndex changed event. Try having your SelectedIndexChanged event raise a function to populate the second box. PS, don't mind I used an SQLite database to test.
```
Private Sub ComboBox1_Sel... |
74,572,453 | I launch my app in eclipse and works fine and I got the initialization of de entityManagerFactory by default as I wish:
```
2022-11-28 13:32:58.558 INFO 12176 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
```
but when I deploy my... | 2022/11/25 | [
"https://Stackoverflow.com/questions/74572453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18495770/"
] | You have to build and package the jar with dependencies, add the below to your plugins in the pom.xml, change the main mainClass to yours.
```
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<go... | I solve it by deploying the project by command prompt in the next three steps:
* downloading Apache-Maven <https://maven.apache.org/download.cgi>
* following this tutorial: <https://www.youtube.com/watch?v=-ARoNTL90hY>
* modifying the pom.xml with manual configuration -> <https://www.baeldung.com/executable-jar-with-m... |
37,684,788 | I have a TableviewController : TableViewController.m , this has dynamic cells .
I have subclassed one cell(just one ) to : RegisterTableViewCell.m/.h , have a UIButton in this cell in storyboard and have created an outlet for the same in TableViewcell.m .
I have decalared a custom protocol in TableViewcell to get... | 2016/06/07 | [
"https://Stackoverflow.com/questions/37684788",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3540903/"
] | Yo can try this method: `QGraphicsView::setAlignment(Qt::Alignment alignment)`
([see here](http://doc.qt.io/qt-4.8/qgraphicsview.html))
You would have to use something like:
```
scene->setAlignment(Qt::AlignTop|Qt::AlignLeft);
``` | @rsp1984
Here is an example of a header code for a class based on a QWIdget. I'm copying and pasting only the parts of the code relvant to the question, from work, so please excuse me if it does not compile because I left something out:
The Header:
```
#include <QWidget>
#include <QGraphicsView>
#include <QDesktopWi... |
2,084,407 | I'm using an older version of PLY that uses the md5 module (among others):
```
import re, types, sys, cStringIO, md5, os.path
```
... although the script runs but not without this error:
```
DeprecationWarning: the md5 module is deprecated; use hashlib instead
```
How do I fix it so the error goes away?
Thanks | 2010/01/18 | [
"https://Stackoverflow.com/questions/2084407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172637/"
] | I think the warning message is quite straightforward. You need to:
```
from hashlib import md5
```
or you can use python < 2.5, <http://docs.python.org/library/md5.html> | i think the warning is ok,still you can use the md5 module,or else hashlib module contains md5 class
```
import hashlib
a=hashlib.md5("foo")
print a.hexdigest()
```
this would print the md5 checksum of the string "foo" |
2,084,407 | I'm using an older version of PLY that uses the md5 module (among others):
```
import re, types, sys, cStringIO, md5, os.path
```
... although the script runs but not without this error:
```
DeprecationWarning: the md5 module is deprecated; use hashlib instead
```
How do I fix it so the error goes away?
Thanks | 2010/01/18 | [
"https://Stackoverflow.com/questions/2084407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172637/"
] | That's not an error, that's a warning.
If you still insist on getting rid of it then modify the code so that it uses [`hashlib`](http://docs.python.org/library/hashlib.html) instead. | What about something like this?
```
try:
import warnings
warnings.catch_warnings()
warnings.simplefilter("ignore")
import md5
except ImportError as imp_err:
raise type(imp_err), type(imp_err)("{0}{1}".format(
imp_err.message,"Custom import message"))
``` |
2,084,407 | I'm using an older version of PLY that uses the md5 module (among others):
```
import re, types, sys, cStringIO, md5, os.path
```
... although the script runs but not without this error:
```
DeprecationWarning: the md5 module is deprecated; use hashlib instead
```
How do I fix it so the error goes away?
Thanks | 2010/01/18 | [
"https://Stackoverflow.com/questions/2084407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172637/"
] | I think the warning message is quite straightforward. You need to:
```
from hashlib import md5
```
or you can use python < 2.5, <http://docs.python.org/library/md5.html> | please see the docs [here](http://docs.python.org/library/warnings.html) , 28.5.3 gives you a way to suppress deprecate warnings. Or on the command line when you run your script, issue `-W ignore::DeprecationWarning` |
2,084,407 | I'm using an older version of PLY that uses the md5 module (among others):
```
import re, types, sys, cStringIO, md5, os.path
```
... although the script runs but not without this error:
```
DeprecationWarning: the md5 module is deprecated; use hashlib instead
```
How do I fix it so the error goes away?
Thanks | 2010/01/18 | [
"https://Stackoverflow.com/questions/2084407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172637/"
] | I think the warning message is quite straightforward. You need to:
```
from hashlib import md5
```
or you can use python < 2.5, <http://docs.python.org/library/md5.html> | As mentioned, the warning can be silenced. And hashlib.md5(my\_string) should do the same as md5.md5(my\_string).
```
>>> import md5
__main__:1: DeprecationWarning: the md5 module is deprecated; use hashlib instead
>>> import hashlib
>>> s = 'abc'
>>> m = md5.new(s)
>>> print s, m.hexdigest()
abc 900150983cd24fb0d6963... |
2,084,407 | I'm using an older version of PLY that uses the md5 module (among others):
```
import re, types, sys, cStringIO, md5, os.path
```
... although the script runs but not without this error:
```
DeprecationWarning: the md5 module is deprecated; use hashlib instead
```
How do I fix it so the error goes away?
Thanks | 2010/01/18 | [
"https://Stackoverflow.com/questions/2084407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172637/"
] | I think the warning message is quite straightforward. You need to:
```
from hashlib import md5
```
or you can use python < 2.5, <http://docs.python.org/library/md5.html> | What about something like this?
```
try:
import warnings
warnings.catch_warnings()
warnings.simplefilter("ignore")
import md5
except ImportError as imp_err:
raise type(imp_err), type(imp_err)("{0}{1}".format(
imp_err.message,"Custom import message"))
``` |
2,084,407 | I'm using an older version of PLY that uses the md5 module (among others):
```
import re, types, sys, cStringIO, md5, os.path
```
... although the script runs but not without this error:
```
DeprecationWarning: the md5 module is deprecated; use hashlib instead
```
How do I fix it so the error goes away?
Thanks | 2010/01/18 | [
"https://Stackoverflow.com/questions/2084407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172637/"
] | That's not an error, that's a warning.
If you still insist on getting rid of it then modify the code so that it uses [`hashlib`](http://docs.python.org/library/hashlib.html) instead. | please see the docs [here](http://docs.python.org/library/warnings.html) , 28.5.3 gives you a way to suppress deprecate warnings. Or on the command line when you run your script, issue `-W ignore::DeprecationWarning` |
2,084,407 | I'm using an older version of PLY that uses the md5 module (among others):
```
import re, types, sys, cStringIO, md5, os.path
```
... although the script runs but not without this error:
```
DeprecationWarning: the md5 module is deprecated; use hashlib instead
```
How do I fix it so the error goes away?
Thanks | 2010/01/18 | [
"https://Stackoverflow.com/questions/2084407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172637/"
] | As mentioned, the warning can be silenced. And hashlib.md5(my\_string) should do the same as md5.md5(my\_string).
```
>>> import md5
__main__:1: DeprecationWarning: the md5 module is deprecated; use hashlib instead
>>> import hashlib
>>> s = 'abc'
>>> m = md5.new(s)
>>> print s, m.hexdigest()
abc 900150983cd24fb0d6963... | i think the warning is ok,still you can use the md5 module,or else hashlib module contains md5 class
```
import hashlib
a=hashlib.md5("foo")
print a.hexdigest()
```
this would print the md5 checksum of the string "foo" |
2,084,407 | I'm using an older version of PLY that uses the md5 module (among others):
```
import re, types, sys, cStringIO, md5, os.path
```
... although the script runs but not without this error:
```
DeprecationWarning: the md5 module is deprecated; use hashlib instead
```
How do I fix it so the error goes away?
Thanks | 2010/01/18 | [
"https://Stackoverflow.com/questions/2084407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172637/"
] | I think the warning message is quite straightforward. You need to:
```
from hashlib import md5
```
or you can use python < 2.5, <http://docs.python.org/library/md5.html> | That's not an error, that's a warning.
If you still insist on getting rid of it then modify the code so that it uses [`hashlib`](http://docs.python.org/library/hashlib.html) instead. |
2,084,407 | I'm using an older version of PLY that uses the md5 module (among others):
```
import re, types, sys, cStringIO, md5, os.path
```
... although the script runs but not without this error:
```
DeprecationWarning: the md5 module is deprecated; use hashlib instead
```
How do I fix it so the error goes away?
Thanks | 2010/01/18 | [
"https://Stackoverflow.com/questions/2084407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172637/"
] | As mentioned, the warning can be silenced. And hashlib.md5(my\_string) should do the same as md5.md5(my\_string).
```
>>> import md5
__main__:1: DeprecationWarning: the md5 module is deprecated; use hashlib instead
>>> import hashlib
>>> s = 'abc'
>>> m = md5.new(s)
>>> print s, m.hexdigest()
abc 900150983cd24fb0d6963... | please see the docs [here](http://docs.python.org/library/warnings.html) , 28.5.3 gives you a way to suppress deprecate warnings. Or on the command line when you run your script, issue `-W ignore::DeprecationWarning` |
2,084,407 | I'm using an older version of PLY that uses the md5 module (among others):
```
import re, types, sys, cStringIO, md5, os.path
```
... although the script runs but not without this error:
```
DeprecationWarning: the md5 module is deprecated; use hashlib instead
```
How do I fix it so the error goes away?
Thanks | 2010/01/18 | [
"https://Stackoverflow.com/questions/2084407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172637/"
] | That's not an error, that's a warning.
If you still insist on getting rid of it then modify the code so that it uses [`hashlib`](http://docs.python.org/library/hashlib.html) instead. | i think the warning is ok,still you can use the md5 module,or else hashlib module contains md5 class
```
import hashlib
a=hashlib.md5("foo")
print a.hexdigest()
```
this would print the md5 checksum of the string "foo" |
35,780,647 | The project I'm working on uses C# WebAPI 2, and used to use Windows Active Directory authentication for everything. We're attempting to transition to Basic auth using a `AuthorizationFilterAttribute`, but IIS Express is making that quite difficult. Originally any request with Basic auth with get a `401.2` response bec... | 2016/03/03 | [
"https://Stackoverflow.com/questions/35780647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3029096/"
] | You may need to look in App\_Start/Startup.Auth.cs . If it's using OWIN, you'll need to add the basic auth module to the pipeline. | Did you check the authentication mode to make sure it's not set to 'Windows'?
```
<authentication mode="Forms">
``` |
62,712,771 | Think I have 2 collection:
1. Man: the documents are-
```
[
{ _id: 1,
name: 'Jack',
children: ['Joy','Joe','James']
},
{ _id: 2,
name: 'Molly',
children: ['Milly','Mou']
}
]
```
2. Age
```
[{_id:1, name: "Joy", age:10},
{_id:2, name: "Joe", age:12},
{_id:3, name: "James", age:14},
{_id:4... | 2020/07/03 | [
"https://Stackoverflow.com/questions/62712771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7585327/"
] | Set #myInput and bind the focus event
`<input #myInput (focus)="onFocus()">`
```
@ViewChild('myInput') myInput: ElementRef<HTMLInputElement>;
```
and
```
onFocus() {
setTimeout(() => {
this.myInput.nativeElement.setSelectionRange(0,0);
}, 0)
}
```
The timeout is required because when you select an i... | For setting the elements as unselectable, you can use `tabindex = -1` attribute in the input element like following-
`<input tabindex='-1'>`
>
> A negative value (usually tabindex="-1") means that the element is not reachable via sequential keyboard navigation, but could be focused with Javascript or visually by cli... |
62,712,771 | Think I have 2 collection:
1. Man: the documents are-
```
[
{ _id: 1,
name: 'Jack',
children: ['Joy','Joe','James']
},
{ _id: 2,
name: 'Molly',
children: ['Milly','Mou']
}
]
```
2. Age
```
[{_id:1, name: "Joy", age:10},
{_id:2, name: "Joe", age:12},
{_id:3, name: "James", age:14},
{_id:4... | 2020/07/03 | [
"https://Stackoverflow.com/questions/62712771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7585327/"
] | Just set `target.selectionEnd` to 0 on focus event
```html
<input (focus)="unselectOnFocus($event)">
```
```js
unselectOnFocus(event: Event): void {
event.target.selectionEnd = 0;
}
``` | For setting the elements as unselectable, you can use `tabindex = -1` attribute in the input element like following-
`<input tabindex='-1'>`
>
> A negative value (usually tabindex="-1") means that the element is not reachable via sequential keyboard navigation, but could be focused with Javascript or visually by cli... |
62,712,771 | Think I have 2 collection:
1. Man: the documents are-
```
[
{ _id: 1,
name: 'Jack',
children: ['Joy','Joe','James']
},
{ _id: 2,
name: 'Molly',
children: ['Milly','Mou']
}
]
```
2. Age
```
[{_id:1, name: "Joy", age:10},
{_id:2, name: "Joe", age:12},
{_id:3, name: "James", age:14},
{_id:4... | 2020/07/03 | [
"https://Stackoverflow.com/questions/62712771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7585327/"
] | Just set `target.selectionEnd` to 0 on focus event
```html
<input (focus)="unselectOnFocus($event)">
```
```js
unselectOnFocus(event: Event): void {
event.target.selectionEnd = 0;
}
``` | Set #myInput and bind the focus event
`<input #myInput (focus)="onFocus()">`
```
@ViewChild('myInput') myInput: ElementRef<HTMLInputElement>;
```
and
```
onFocus() {
setTimeout(() => {
this.myInput.nativeElement.setSelectionRange(0,0);
}, 0)
}
```
The timeout is required because when you select an i... |
13,888,663 | i've looked through many posts on here and couldn't quite see the solution I need...
I'm getting the error:
```
the method initTimer(untitled.Object, String, int int) in the type untitled.TimerClass is not applicable for the arguments (untitled.Toon, String, int, int)
```
and it's driving me crazy.
```
timers... | 2012/12/15 | [
"https://Stackoverflow.com/questions/13888663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1446063/"
] | The error message
>
> the method `initTimer(untitled.Object, String, int int)` in the type `untitled.TimerClass` is not
> applicable for the arguments `(untitled.Toon, String, int, int)`
>
>
>
is due to the fact that `untitled.Toon` does not extend `untitled.Object`. It extends `java.lang.Object` of course, whic... | Also, another error is initTimer(untitled.Object, String, int) is being called as (untitled.Toon, String, int, int) - notice the difference in number of arguments - 1 int in method declaration and 2 int in calling the method.
Please remember to correct that also. |
898,443 | I'm reading from the standard input using the read() system call but there's a tiny thing that bothers me. I can't use the arrow keys... What I really wanted to do was to use arrow keys to go back and forth within the typed text but I think that's not that easy... So, what I at least want to do, is to ignore them.
Rig... | 2009/05/22 | [
"https://Stackoverflow.com/questions/898443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40480/"
] | In order to interpret the arrow keys the way you would ideally like to (i.e. to move back and forth and edit the input), you generally need to use a library. For Linux, the standard is [GNU Readline](http://tiswww.case.edu/php/chet/readline/rltop.html). Hopefully someone else can say what you would normally use for a W... | The answer ultimately depends on where the keys come from. I ran this program under Cygwin:
```
int main(void)
{
int c=0;
while( c != 'X' ) {
c = getchar();
printf("\nc=%d", c);
}
}
```
Every time a cursor key comes along, I see escape (27), a bracket, plus another character.
So, if you ... |
11,334,913 | What is the proper way of inserting a copyright symbol `©` and a pound sterling symbol `£` into a bash script.
I am using `nano` as my editor and am running Debian Squeeze.
If I copy and paste the symbol from windows, it works but it seems to paste hidden characters that `nano` cannot display and it makes it hard to ... | 2012/07/04 | [
"https://Stackoverflow.com/questions/11334913",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/317603/"
] | It seems you are using a locale that doesn't support these symbols (in the olden days it could have also been a bad font). Since you are using UTF-8 characters (default on windows), you also need to be in a UTF-8 aware environment on linux. You can check that with the `locale` command:
```
$ locale
LANG=en_US.UTF-8
LC... | Better just use (C) for copyright, you want it to be always readable in other locales and not a defense for violation.
The display looks like
```
text="1.00"
text2=" ohn Doe"
```
in my test terminal. |
11,334,913 | What is the proper way of inserting a copyright symbol `©` and a pound sterling symbol `£` into a bash script.
I am using `nano` as my editor and am running Debian Squeeze.
If I copy and paste the symbol from windows, it works but it seems to paste hidden characters that `nano` cannot display and it makes it hard to ... | 2012/07/04 | [
"https://Stackoverflow.com/questions/11334913",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/317603/"
] | It seems you are using a locale that doesn't support these symbols (in the olden days it could have also been a bad font). Since you are using UTF-8 characters (default on windows), you also need to be in a UTF-8 aware environment on linux. You can check that with the `locale` command:
```
$ locale
LANG=en_US.UTF-8
LC... | If you're having problems with entering the symbols in nano, use escape syntax.
You can use `iconv` to convert it to the output encoding corresponding to the current locale:
```
text=$'\xa315.00'
text2=$'\xa9 John Doe'
iconv -f latin1 <<< $text
iconv -f latin1 <<< $text2
```
or the same in utf8:
```
text=$'\xc2\xa3... |
37,402,110 | HI i want to install the polyglot on python version 3.5. it requires to have numpy installed which i already have and also libicu-dev. My OS is windows X86. I went through cmd, pip and wrote "pip install libicu-dev" but it gives me an error that could not find a version to satisfy the requirements.
how can i install li... | 2016/05/23 | [
"https://Stackoverflow.com/questions/37402110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6195038/"
] | For install polyglot, get all dependency libraries (.whl) from <http://www.lfd.uci.edu/~gohlke/pythonlibs/>
* NumPy
* PyICU
* PyCLD2
Install by `pip install <name_of_the_binary>.whl`
Related to issue 11 in poliglot github repository
[source\_issue](https://github.com/aboSamoor/polyglot/issues/11#issuecomment-1266759... | From here:
```
sudo apt-get install python-numpy libicu-dev
```
for more information:
<http://polyglot.readthedocs.io/en/latest/Installation.html> |
37,402,110 | HI i want to install the polyglot on python version 3.5. it requires to have numpy installed which i already have and also libicu-dev. My OS is windows X86. I went through cmd, pip and wrote "pip install libicu-dev" but it gives me an error that could not find a version to satisfy the requirements.
how can i install li... | 2016/05/23 | [
"https://Stackoverflow.com/questions/37402110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6195038/"
] | For install polyglot, get all dependency libraries (.whl) from <http://www.lfd.uci.edu/~gohlke/pythonlibs/>
* NumPy
* PyICU
* PyCLD2
Install by `pip install <name_of_the_binary>.whl`
Related to issue 11 in poliglot github repository
[source\_issue](https://github.com/aboSamoor/polyglot/issues/11#issuecomment-1266759... | Firstly try:
```
git clone https://github.com/aboSamoor/polyglot.git
python setup.py install
```
Then pip install:
```
pip install pycld2-0.31-cp36-cp36m-win_amd64.whl
pip install PyICU-1.9.8-cp36-cp36m-win_amd64.whl
``` |
37,402,110 | HI i want to install the polyglot on python version 3.5. it requires to have numpy installed which i already have and also libicu-dev. My OS is windows X86. I went through cmd, pip and wrote "pip install libicu-dev" but it gives me an error that could not find a version to satisfy the requirements.
how can i install li... | 2016/05/23 | [
"https://Stackoverflow.com/questions/37402110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6195038/"
] | For install polyglot, get all dependency libraries (.whl) from <http://www.lfd.uci.edu/~gohlke/pythonlibs/>
* NumPy
* PyICU
* PyCLD2
Install by `pip install <name_of_the_binary>.whl`
Related to issue 11 in poliglot github repository
[source\_issue](https://github.com/aboSamoor/polyglot/issues/11#issuecomment-1266759... | This will work by typing it on Anaconda Prompt:
pip install polyglot==14.11 |
15,312,004 | I'm developing a website and intend to support IE8 and above, so I'm not so concerned about older IE versions.
When users open the website in IE, it always jumps either to Compatibility mode or Quirks mode. Can I turn that feature off using this?
```
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
```... | 2013/03/09 | [
"https://Stackoverflow.com/questions/15312004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1870940/"
] | Just have a look at [this SO post](https://stackoverflow.com/questions/14637943/what-is-x-ua-compatible-when-it-references-ie-edge-chrome-1).
Basically it should do what you need, I've used this in the past and it works. It'll open in standards mode in IE.
Just be aware, that if you open the developer tools in IE and... | You can explicitly tell IE browsers to use its latest available rendering engine using a meta tag. This also prevents IE to open Quirks mode while rending page.
<http://technowide.net/2013/06/21/forcing-ie-browsers-to-behave-properly/> |
31,049 | In an answer to [this question](https://space.stackexchange.com/questions/29633/vector-rs-lp-1-and-2-engines-use-liquid-propylene-as-fuel-with-lox-advantages), the brilliant diagram below was given:
[](https://i.stack.imgur.com/ihsi8.png)
The chart ma... | 2018/10/01 | [
"https://space.stackexchange.com/questions/31049",
"https://space.stackexchange.com",
"https://space.stackexchange.com/users/23003/"
] | For one, you get basically the same $I\_{sp}$ to density ratio as RP-1, except with two penalties: lower density, which means bigger tanks and a heavier rocket, and the need to chill the ethylene. Compared to RP-1, you also lose the synergy of being able to use the fuel as a lubricant and hydraulic fluid. | Late answer, but I just stumbled on this. There is a class that is not considered here that is up and to the right of most of the other propellants on the graph. Blends of light hydrocarbons exhibit depressed freezing points, which means things like 50/50 propane/propylene can be chilled down to or even below LOx tempe... |
31,049 | In an answer to [this question](https://space.stackexchange.com/questions/29633/vector-rs-lp-1-and-2-engines-use-liquid-propylene-as-fuel-with-lox-advantages), the brilliant diagram below was given:
[](https://i.stack.imgur.com/ihsi8.png)
The chart ma... | 2018/10/01 | [
"https://space.stackexchange.com/questions/31049",
"https://space.stackexchange.com",
"https://space.stackexchange.com/users/23003/"
] | It sure is, by some small portion of the industry. I don't think we'll be seeing any big EthyLox (if you'll excuse the neologism) boosters taking off as first stages, though: it's a complicated thing to deal with, Ethylene. it being a room temperature gas means it entails all the hassle methane or hydrogen brings (i.e.... | Late answer, but I just stumbled on this. There is a class that is not considered here that is up and to the right of most of the other propellants on the graph. Blends of light hydrocarbons exhibit depressed freezing points, which means things like 50/50 propane/propylene can be chilled down to or even below LOx tempe... |
14,572,331 | I am new to Entity Framework so please bear with me.
I have a program that I want to select multiple records from a table and store it in a queue:
```
private Queue<RecordsToProcess> getRecordsToProcess()
{
Queue<RecordsToProcess> results = new Queue<RecordsToProcess>();
using (MyEntity context = new MyEntit... | 2013/01/28 | [
"https://Stackoverflow.com/questions/14572331",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/775706/"
] | Since you are disposing your `MyEntity` context in the first method (by wrapping it in a `using` statement), the entities that are enqueued will be in a "detached" state. That means, among other things, that changes done to the entity will not be tracked and you will not be able to lazy load navigation properties.
It ... | It might be safer if you save off the primary key in the queue instead and retrieve the entities again. This way you are more likely avoid any data concurrency issues. |
53,305,405 | I have a weird issue with CORS. **The API and web APP are running on different servers**.
I enabled CORS on the API using [laravel-cors](https://github.com/barryvdh/laravel-cors) package, and am trying to consume the API from a different server.
I can consume the API using **Postman** as well as **Guzzle** Http Clien... | 2018/11/14 | [
"https://Stackoverflow.com/questions/53305405",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2732184/"
] | In a single awk you can do:
```
awk '{print > ("file" (NR%4))}' inputfile
```
This will send the output to files `file0`, `file1`, `file2` and `file3` | You may use these `awk` commands:
```
awk -v n=1 'NR%4 == n%4' file
20
14
awk -v n=2 'NR%4 == n%4' file
18
30
awk -v n=3 'NR%4 == n%4' file
21
40
awk -v n=4 'NR%4 == n%4' file
16
24
``` |
53,305,405 | I have a weird issue with CORS. **The API and web APP are running on different servers**.
I enabled CORS on the API using [laravel-cors](https://github.com/barryvdh/laravel-cors) package, and am trying to consume the API from a different server.
I can consume the API using **Postman** as well as **Guzzle** Http Clien... | 2018/11/14 | [
"https://Stackoverflow.com/questions/53305405",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2732184/"
] | You may use these `awk` commands:
```
awk -v n=1 'NR%4 == n%4' file
20
14
awk -v n=2 'NR%4 == n%4' file
18
30
awk -v n=3 'NR%4 == n%4' file
21
40
awk -v n=4 'NR%4 == n%4' file
16
24
``` | IMHO `awk` is the best solution. You can use `sed`:
Inputfile generated with `seq 12`:
```
for ((i=1;i<5; i++)); do
sed -n $i~4w$i.out <(seq 12)
done
```
Here `w$i.out` writes to file $i.out. |
53,305,405 | I have a weird issue with CORS. **The API and web APP are running on different servers**.
I enabled CORS on the API using [laravel-cors](https://github.com/barryvdh/laravel-cors) package, and am trying to consume the API from a different server.
I can consume the API using **Postman** as well as **Guzzle** Http Clien... | 2018/11/14 | [
"https://Stackoverflow.com/questions/53305405",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2732184/"
] | You may use these `awk` commands:
```
awk -v n=1 'NR%4 == n%4' file
20
14
awk -v n=2 'NR%4 == n%4' file
18
30
awk -v n=3 'NR%4 == n%4' file
21
40
awk -v n=4 'NR%4 == n%4' file
16
24
``` | This might work for you (GNU sed):
```
sed -ne '1~4w file1' -e '2~4w file2' -e '3~4w file3' -e '4~4w file4' file
``` |
53,305,405 | I have a weird issue with CORS. **The API and web APP are running on different servers**.
I enabled CORS on the API using [laravel-cors](https://github.com/barryvdh/laravel-cors) package, and am trying to consume the API from a different server.
I can consume the API using **Postman** as well as **Guzzle** Http Clien... | 2018/11/14 | [
"https://Stackoverflow.com/questions/53305405",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2732184/"
] | In a single awk you can do:
```
awk '{print > ("file" (NR%4))}' inputfile
```
This will send the output to files `file0`, `file1`, `file2` and `file3` | IMHO `awk` is the best solution. You can use `sed`:
Inputfile generated with `seq 12`:
```
for ((i=1;i<5; i++)); do
sed -n $i~4w$i.out <(seq 12)
done
```
Here `w$i.out` writes to file $i.out. |
53,305,405 | I have a weird issue with CORS. **The API and web APP are running on different servers**.
I enabled CORS on the API using [laravel-cors](https://github.com/barryvdh/laravel-cors) package, and am trying to consume the API from a different server.
I can consume the API using **Postman** as well as **Guzzle** Http Clien... | 2018/11/14 | [
"https://Stackoverflow.com/questions/53305405",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2732184/"
] | In a single awk you can do:
```
awk '{print > ("file" (NR%4))}' inputfile
```
This will send the output to files `file0`, `file1`, `file2` and `file3` | This might work for you (GNU sed):
```
sed -ne '1~4w file1' -e '2~4w file2' -e '3~4w file3' -e '4~4w file4' file
``` |
24,474,416 | I am trying to create a function that will toggle optional inputs if chosen, here is what I have done so far:
HTML:
```
<div>
<input>
<a class="input-toggle" href="#"><span>Toggle Option</span><span>Close</span></a>
<div class="input-toggle-content">
<input name="">
</div>
</div>
```
JavaScr... | 2014/06/29 | [
"https://Stackoverflow.com/questions/24474416",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3388091/"
] | Try,
```
$('.input-toggle + div.input-toggle-content').hide();
$(".input-toggle span:last-of-type").hide();
$('.input-toggle').click(function () {
$(this).next('div.input-toggle-content').toggle();
var spans = $('span', this);
spans.not(spans.filter(':visible').hide()).show();
});
```
[DEMO](http://jsfi... | here you go: <http://jsfiddle.net/jPe3A/>
```
$('.input-toggle').each(function() {
$(this).next("div").hide().end();
$("span:last-of-type").hide();
$(this).on('click', function() {
$(this).next("div").slideToggle();
if($("span:first").is(':hidden')){
$("span:first").show();
... |
71,574,752 | I need to use a reporting tool with genexus for web development. Genexus proposes to use the generation of reports through Procedure-type objects, but these do not have the possibility of generating them through queries similar to what can be done with Crystal Report.
As far as I know it has no possibility to integrate... | 2022/03/22 | [
"https://Stackoverflow.com/questions/71574752",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18441548/"
] | In GeneXus, you have the possibility to create queries to extract information from your database and then present with different types of charts, pivot table, tables, maps, and cards.
Also, you have a dashboard object to integrate many queries in a same dashboard. [Here](https://wiki.genexus.com/commwiki/servlet/wiki?... | speaking of Crystal Report I think you are using .net as a generator. If you had used Java you could have adopted Jasper Report. For .net, on the other hand, at the moment I don't think there is anything "standard". We use different approaches based on the type of report. For some reports we continue to make them with ... |
22,180,935 | I'm working on a data set where the source name is specified by a 2-letter abbreviation in front of the variable. So all variables from source AA start with `AA_var1`, and source bb has `bb_variable_name_2`. There are actually a lot of sources, and a lot of variable names, but I leave only 2 as a minimal example.
I wa... | 2014/03/04 | [
"https://Stackoverflow.com/questions/22180935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1052117/"
] | The strategy here is to split the data frame by columns into variable groups, and for each row identifying if there are non-NA values. We then check with `rowsums` to make sure there are at least two variables with non-NA values for a row, and if so, add the mean of those values with `cbind`.
This will generalize to a... | This solution seems a little convoluted to me, so there's probably a better way, but it should work for you.
```
# Here's your data:
df <- data.frame(AA_var1 = c(NA,NA,12,12,NA,12),
AA_var2 = c(NA,10,10,NA,NA,13),
BB_var3 = c(10,12,NA,NA,NA,14),
BB_var4 = c(12,NA,NA,1... |
22,180,935 | I'm working on a data set where the source name is specified by a 2-letter abbreviation in front of the variable. So all variables from source AA start with `AA_var1`, and source bb has `bb_variable_name_2`. There are actually a lot of sources, and a lot of variable names, but I leave only 2 as a minimal example.
I wa... | 2014/03/04 | [
"https://Stackoverflow.com/questions/22180935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1052117/"
] | This solution seems a little convoluted to me, so there's probably a better way, but it should work for you.
```
# Here's your data:
df <- data.frame(AA_var1 = c(NA,NA,12,12,NA,12),
AA_var2 = c(NA,10,10,NA,NA,13),
BB_var3 = c(10,12,NA,NA,NA,14),
BB_var4 = c(12,NA,NA,1... | ```
fun <- function(x) {
MEAN <- mean(c(x[1], x[2], x[4], x[5]), na.rm=TRUE)
CHECK <- sum(!is.na(c(x[1], x[2]))) > 0 & sum(!is.na(c(x[4], x[5])) > 0)
MEAN * ifelse(CHECK, 1, NaN)
}
df$rowMeanIfDiverseData <- apply(df, 1, fun)
df
AA_var1 AA_var2 myid BB_var3 BB_var4 rowMeanIfDiverseData
1 NA N... |
22,180,935 | I'm working on a data set where the source name is specified by a 2-letter abbreviation in front of the variable. So all variables from source AA start with `AA_var1`, and source bb has `bb_variable_name_2`. There are actually a lot of sources, and a lot of variable names, but I leave only 2 as a minimal example.
I wa... | 2014/03/04 | [
"https://Stackoverflow.com/questions/22180935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1052117/"
] | The strategy here is to split the data frame by columns into variable groups, and for each row identifying if there are non-NA values. We then check with `rowsums` to make sure there are at least two variables with non-NA values for a row, and if so, add the mean of those values with `cbind`.
This will generalize to a... | My attempt, somewhat longwinded.....
```
dat<-data.frame(AA_var1=c(NA,NA,12,12,NA,12),
AA_var2=c(NA,10,10,NA,NA,13),
myid=1:6,
BB_var3=c(10,12,NA,NA,NA,14),
BB_var4=c(12,NA,NA,12,NA,NA))
#what columns are associated with variables used i... |
22,180,935 | I'm working on a data set where the source name is specified by a 2-letter abbreviation in front of the variable. So all variables from source AA start with `AA_var1`, and source bb has `bb_variable_name_2`. There are actually a lot of sources, and a lot of variable names, but I leave only 2 as a minimal example.
I wa... | 2014/03/04 | [
"https://Stackoverflow.com/questions/22180935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1052117/"
] | The strategy here is to split the data frame by columns into variable groups, and for each row identifying if there are non-NA values. We then check with `rowsums` to make sure there are at least two variables with non-NA values for a row, and if so, add the mean of those values with `cbind`.
This will generalize to a... | ```
fun <- function(x) {
MEAN <- mean(c(x[1], x[2], x[4], x[5]), na.rm=TRUE)
CHECK <- sum(!is.na(c(x[1], x[2]))) > 0 & sum(!is.na(c(x[4], x[5])) > 0)
MEAN * ifelse(CHECK, 1, NaN)
}
df$rowMeanIfDiverseData <- apply(df, 1, fun)
df
AA_var1 AA_var2 myid BB_var3 BB_var4 rowMeanIfDiverseData
1 NA N... |
22,180,935 | I'm working on a data set where the source name is specified by a 2-letter abbreviation in front of the variable. So all variables from source AA start with `AA_var1`, and source bb has `bb_variable_name_2`. There are actually a lot of sources, and a lot of variable names, but I leave only 2 as a minimal example.
I wa... | 2014/03/04 | [
"https://Stackoverflow.com/questions/22180935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1052117/"
] | The strategy here is to split the data frame by columns into variable groups, and for each row identifying if there are non-NA values. We then check with `rowsums` to make sure there are at least two variables with non-NA values for a row, and if so, add the mean of those values with `cbind`.
This will generalize to a... | I think some of the answers are making this seem more complicated than it is. This will do it:
```
df$means = ifelse(rowSums(!is.na(df[, grep('AA_var', names(df))])) &
rowSums(!is.na(df[, grep('BB_var', names(df))])),
rowMeans(df[, grep('_var', names(df))], na.rm = T), NA)
# AA_v... |
22,180,935 | I'm working on a data set where the source name is specified by a 2-letter abbreviation in front of the variable. So all variables from source AA start with `AA_var1`, and source bb has `bb_variable_name_2`. There are actually a lot of sources, and a lot of variable names, but I leave only 2 as a minimal example.
I wa... | 2014/03/04 | [
"https://Stackoverflow.com/questions/22180935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1052117/"
] | My attempt, somewhat longwinded.....
```
dat<-data.frame(AA_var1=c(NA,NA,12,12,NA,12),
AA_var2=c(NA,10,10,NA,NA,13),
myid=1:6,
BB_var3=c(10,12,NA,NA,NA,14),
BB_var4=c(12,NA,NA,12,NA,NA))
#what columns are associated with variables used i... | ```
fun <- function(x) {
MEAN <- mean(c(x[1], x[2], x[4], x[5]), na.rm=TRUE)
CHECK <- sum(!is.na(c(x[1], x[2]))) > 0 & sum(!is.na(c(x[4], x[5])) > 0)
MEAN * ifelse(CHECK, 1, NaN)
}
df$rowMeanIfDiverseData <- apply(df, 1, fun)
df
AA_var1 AA_var2 myid BB_var3 BB_var4 rowMeanIfDiverseData
1 NA N... |
22,180,935 | I'm working on a data set where the source name is specified by a 2-letter abbreviation in front of the variable. So all variables from source AA start with `AA_var1`, and source bb has `bb_variable_name_2`. There are actually a lot of sources, and a lot of variable names, but I leave only 2 as a minimal example.
I wa... | 2014/03/04 | [
"https://Stackoverflow.com/questions/22180935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1052117/"
] | I think some of the answers are making this seem more complicated than it is. This will do it:
```
df$means = ifelse(rowSums(!is.na(df[, grep('AA_var', names(df))])) &
rowSums(!is.na(df[, grep('BB_var', names(df))])),
rowMeans(df[, grep('_var', names(df))], na.rm = T), NA)
# AA_v... | ```
fun <- function(x) {
MEAN <- mean(c(x[1], x[2], x[4], x[5]), na.rm=TRUE)
CHECK <- sum(!is.na(c(x[1], x[2]))) > 0 & sum(!is.na(c(x[4], x[5])) > 0)
MEAN * ifelse(CHECK, 1, NaN)
}
df$rowMeanIfDiverseData <- apply(df, 1, fun)
df
AA_var1 AA_var2 myid BB_var3 BB_var4 rowMeanIfDiverseData
1 NA N... |
283,371 | In letters written in the early 20th century, for the German word “bei”, the
author commonly uses the abbreviation “ᵇ/”. Currently I typeset as follows:
```
26.4.17 \textsuperscript{b}/La Selve
```
The result, however, is an unpleasant space between the superscript “b” and the
slash. Of course I could manually adjus... | 2015/12/16 | [
"https://tex.stackexchange.com/questions/283371",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/37500/"
] | Never seen such an abbreviation, but it's easy to obtain it:
```
\documentclass{article}
\newcommand{\bei}{\textsuperscript{b}\kern-.3em}
\begin{document}
Abcdef \bei/La Selve
\end{document}
```
You could also add the `/` in the definition of `\bei`, if you prefer, but it has the disadvantage that a space after ... | I'm not familiar with this specific abbreviation. For what I understand from your question, I'd suggest the microtype package (needs LuaLaTex).
```
\documentclass{article}
\usepackage{microtype}
\usepackage{xspace}
\newcommand*{\mybei}{\textls[-190]{\emph{\textsuperscript{b}}/}\xspace}
\newcommand*{\mybeis}{\textls[... |
25,932,257 | I would like to show a different **div** depending on what class my 3 **span** elems contain.
If all **span** hasClass *up* or *up1* the code would show a **div** with class *allUp* . If it hasClass *up* *up1* and *down* then it would show a **div** with class *twoUp*.
I wrote the following, but of course it doesn't w... | 2014/09/19 | [
"https://Stackoverflow.com/questions/25932257",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3246460/"
] | Using Mockito, you can do that by using `@Mock` and `@InjectMocks` and the `MockitoJUnitRunner`.
This question describes this: [Using @Mock and @InjectMocks](https://stackoverflow.com/questions/9076302/using-mock-and-injectmocks) | I think your tests are telling you that database records are hard to implement as unmodifiable objects.
How about adding
```
Person updateName(String name);
```
to Person class? |
25,932,257 | I would like to show a different **div** depending on what class my 3 **span** elems contain.
If all **span** hasClass *up* or *up1* the code would show a **div** with class *allUp* . If it hasClass *up* *up1* and *down* then it would show a **div** with class *twoUp*.
I wrote the following, but of course it doesn't w... | 2014/09/19 | [
"https://Stackoverflow.com/questions/25932257",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3246460/"
] | Through my substantial searches on Mockito I found there are two types of mocking:
1. Proxy Mocking (Usual stubbing)
2. Class remapping(Only Jmockit supports)
You can read about "How Mock Objects Work" [here](http://java.dzone.com/articles/the-concept-mocking).
For my question, Class Remapping was the solution
Anot... | Using Mockito, you can do that by using `@Mock` and `@InjectMocks` and the `MockitoJUnitRunner`.
This question describes this: [Using @Mock and @InjectMocks](https://stackoverflow.com/questions/9076302/using-mock-and-injectmocks) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.