qid int64 20 74.4M | question stringlengths 36 16.3k | date stringlengths 10 10 | metadata listlengths 3 3 | response_j stringlengths 33 24k | response_k stringlengths 33 23k |
|---|---|---|---|---|---|
20 | In French, some nouns are considered male and some female (le/la). Is there a way which can help me understand which grammatical gender to use with which noun? | 2016/04/05 | [
"https://languagelearning.stackexchange.com/questions/20",
"https://languagelearning.stackexchange.com",
"https://languagelearning.stackexchange.com/users/41/"
] | Grammatical gender in French is pretty much arbitrary. There's not much to understand. Sorry.
The usual tip when learning a language with (mostly) arbitrary grammatical gender like French or German is to **always learn the article with the noun**. When you learn the word for *car*, learn “la voiture” or “une voiture”.... | The best way to learn the grammatical gender is by practice and by using a French dictionary where *nf* refers to "nom féminin" (feminine noun) and *nm* refers to "nom musculin" (masculine noun).
Please note that the grammatical gender is sometimes confusing. I speak French and Arabic (native language), and there are ... |
1,370,899 | I want to display different types of objects in the same ajax called controller function. I want to render out when I send back an ajax call. The problem is I want the "title" attribute of one object and the "name" attribute of another object. I can't render 2 partials and can seem to figure out how to check the type o... | 2009/09/03 | [
"https://Stackoverflow.com/questions/1370899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/157894/"
] | try something like
```
<%= obj.title if obj.respond_to?(:title) %>
``` | You could use [Object.is\_a?](http://apidock.com/ruby/Object/is_a%3F) but that's not a very clean solution. You could also try mapping your data before presentation to help keep your views lightweight. |
1,370,899 | I want to display different types of objects in the same ajax called controller function. I want to render out when I send back an ajax call. The problem is I want the "title" attribute of one object and the "name" attribute of another object. I can't render 2 partials and can seem to figure out how to check the type o... | 2009/09/03 | [
"https://Stackoverflow.com/questions/1370899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/157894/"
] | try something like
```
<%= obj.title if obj.respond_to?(:title) %>
``` | Here's one option that doesn't involve checking its type - in your Obj and ObjTwo classes add a new method:
```
def fancy_pants
title
end
def fancy_pants
name
end
```
Then you can combine `@objects` and `@moreObjects` - you'll only need one if statement and one partial.
```
@search_domination = @objects + @mor... |
1,370,899 | I want to display different types of objects in the same ajax called controller function. I want to render out when I send back an ajax call. The problem is I want the "title" attribute of one object and the "name" attribute of another object. I can't render 2 partials and can seem to figure out how to check the type o... | 2009/09/03 | [
"https://Stackoverflow.com/questions/1370899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/157894/"
] | Here's one option that doesn't involve checking its type - in your Obj and ObjTwo classes add a new method:
```
def fancy_pants
title
end
def fancy_pants
name
end
```
Then you can combine `@objects` and `@moreObjects` - you'll only need one if statement and one partial.
```
@search_domination = @objects + @mor... | You could use [Object.is\_a?](http://apidock.com/ruby/Object/is_a%3F) but that's not a very clean solution. You could also try mapping your data before presentation to help keep your views lightweight. |
4,611,178 | I am attempting to write a test case to ensure a Singleton class cannot be instantiated. The constructor for the Singleton is defined to be private so my test is as follows:
```
$this->expectError();
$test = new TestSingletonClassA();
```
Instead of catching the error and passing the test, I get a 'PHP Fatal error: ... | 2011/01/06 | [
"https://Stackoverflow.com/questions/4611178",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/382462/"
] | If your php code throws a FATAL ERROR, it will never get to the phpunit, so you have to write "right" code in order to test it. If you call a private method, it will throw an excepcion, so it won't get to the phpunit. You have to change that.
I think you have to mock the object. Try [these posts](http://sebastian-berg... | i don't think it's possible to do it that way.. fatal errors are not catchable as i've understood it. you could use reflection to get the constructor method, and then make sure it has the access modifier "private".
this is hard to test in most languages. for example java, c# and c++ would not even let you compile this... |
4,611,178 | I am attempting to write a test case to ensure a Singleton class cannot be instantiated. The constructor for the Singleton is defined to be private so my test is as follows:
```
$this->expectError();
$test = new TestSingletonClassA();
```
Instead of catching the error and passing the test, I get a 'PHP Fatal error: ... | 2011/01/06 | [
"https://Stackoverflow.com/questions/4611178",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/382462/"
] | Unit testing frameworks cannot catch such things. But you can with [PHPT](http://qa.php.net/phpt_details.php) and similar regression test frameworks.
You might have to jump through some hoops to hook it into PHPUnit, but there's probably ways to integrate it with the remaining tests. You'll just have to separate asser... | i don't think it's possible to do it that way.. fatal errors are not catchable as i've understood it. you could use reflection to get the constructor method, and then make sure it has the access modifier "private".
this is hard to test in most languages. for example java, c# and c++ would not even let you compile this... |
73,910,771 | I am writing a function that returns a list of car models. The input is a string of comma separated cars. Duplicate entries are not added to the result. The elements in the list should be in the same order as they appear in the input string. If the input string is empty, the result is an empty list. I modified it to su... | 2022/09/30 | [
"https://Stackoverflow.com/questions/73910771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17261019/"
] | Since you're appending `" ".join(unique_car[1:])` to the list, you need to use the same thing when checking if already exists.
Solve this easily by assigning that to a variable, so you can use the same thing in the `in` test and `append()` call.
```
def car_models(all_cars: str) -> list:
if not all_cars:
... | First, I suppose you misspelled the command and should be like:
>
> print(car\_models("Tesla Model S","Skoda Super Lux Sport"))
>
>
>
And then, instead of:
```
unique_car = car.split(" ")
```
I should use something like:
```
unique_car = car[car.find(" ")+1:]
```
to have full name of the model compared. Eve... |
73,910,771 | I am writing a function that returns a list of car models. The input is a string of comma separated cars. Duplicate entries are not added to the result. The elements in the list should be in the same order as they appear in the input string. If the input string is empty, the result is an empty list. I modified it to su... | 2022/09/30 | [
"https://Stackoverflow.com/questions/73910771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17261019/"
] | Since you're appending `" ".join(unique_car[1:])` to the list, you need to use the same thing when checking if already exists.
Solve this easily by assigning that to a variable, so you can use the same thing in the `in` test and `append()` call.
```
def car_models(all_cars: str) -> list:
if not all_cars:
... | Checking for the existence of some object in a list will not perform optimally when the list is very large. Better to use a set.
Here are two versions. One without a set and the other with:
```
def car_models(all_cars):
result = []
for car in all_cars.split(','):
if (full_model := ' '.join(car.split()... |
73,910,771 | I am writing a function that returns a list of car models. The input is a string of comma separated cars. Duplicate entries are not added to the result. The elements in the list should be in the same order as they appear in the input string. If the input string is empty, the result is an empty list. I modified it to su... | 2022/09/30 | [
"https://Stackoverflow.com/questions/73910771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17261019/"
] | Checking for the existence of some object in a list will not perform optimally when the list is very large. Better to use a set.
Here are two versions. One without a set and the other with:
```
def car_models(all_cars):
result = []
for car in all_cars.split(','):
if (full_model := ' '.join(car.split()... | First, I suppose you misspelled the command and should be like:
>
> print(car\_models("Tesla Model S","Skoda Super Lux Sport"))
>
>
>
And then, instead of:
```
unique_car = car.split(" ")
```
I should use something like:
```
unique_car = car[car.find(" ")+1:]
```
to have full name of the model compared. Eve... |
37,434,875 | I'm getting a weird error when i try to set templateUrl in my component.
This works:
```
@Component({
selector: 'buildingInfo',
template: `
<html>stuff</html>
`
})
```
But when i do this (with the same content in the html-file):
```
@Component({
selector: 'buildingInfo',
templateUrl: 's... | 2016/05/25 | [
"https://Stackoverflow.com/questions/37434875",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5119447/"
] | If you want Angular to find the templates relative to the Component e.g. you have a structure like
app/
app/app.component.ts
app/app.component.html
make sure, you set the module id of the component. That'll cause the System loader to look relative to your current path. Otherwise, it will *always* expect the complet... | You can't have an `<html>` tag in your template. `<html>` is a top-level tag in an HTML file and an Angular application can only be used on or inside `<body>` and `<body>` can't contain an `<html>` tag. |
22,518,501 | I am reading in another perl file and trying to find all strings surrounded by quotations within the file, single or multiline. I've matched all the single lines fine but I can't match the mulitlines without printing the entire line out, when I just want the string itself. For example, heres a snippet of what I'm readi... | 2014/03/19 | [
"https://Stackoverflow.com/questions/22518501",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1583932/"
] | Couple big things, you need to search in a `while` loop with the `g` modifier on your regex. And you also need to turn off greedy matching for what's inside the quotes by using `.*?`.
```
use strict;
use warnings;
my $contents = do {local $/; <DATA>};
my @strings_found = ();
while ($contents =~ /(['"](.*?)["'])/sg)... | regexp matching (in perl and generally) are greedy by default. So your regexp will match from 1st ' or " to last. Print the length of your @strings\_found array. I think it will always be just 1 with the code you have.
Change it to be not greedy by following \* with a ?
/('"\*?["'])/s
I think.
It will work in a basic... |
25,024,560 | Assume I have a dataframe:
```
Col1 Col2 Col3 Val
a 1 a 2
a 1 a 3
a 1 b 5
b 1 a 10
b 1 a 20
b 1 a 25
```
I want to aggregate across all columns and then attach this to my dataframe so that I have this output:
```
C... | 2014/07/29 | [
"https://Stackoverflow.com/questions/25024560",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2565416/"
] | No guarantees in terms of performance, but for each directory you could check its files to see if it contains any with the matching extension:
```
List<string> imageDirectories = Directory.GetDirectories(sourceTextBox.Text, "*", SearchOption.AllDirectories)
.Where(d => Directory.EnumerateFiles(d)
.Select(P... | There is no built in way of doing it, You can try something like this
```
var directories = Directory
.GetDirectories(path, "*", SearchOption.AllDirectories)
.Where(x=> Directory.EnumerateFiles(x, "*.jpg").Any() || Directory.EnumerateFiles(x, "*.png").Any())
.ToList();
``` |
25,024,560 | Assume I have a dataframe:
```
Col1 Col2 Col3 Val
a 1 a 2
a 1 a 3
a 1 b 5
b 1 a 10
b 1 a 20
b 1 a 25
```
I want to aggregate across all columns and then attach this to my dataframe so that I have this output:
```
C... | 2014/07/29 | [
"https://Stackoverflow.com/questions/25024560",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2565416/"
] | No guarantees in terms of performance, but for each directory you could check its files to see if it contains any with the matching extension:
```
List<string> imageDirectories = Directory.GetDirectories(sourceTextBox.Text, "*", SearchOption.AllDirectories)
.Where(d => Directory.EnumerateFiles(d)
.Select(P... | You can use [`Directory.EnumerateFiles`](http://msdn.microsoft.com/en-us/library/system.io.directory.enumeratefiles(v=vs.110).aspx) method to get the file matching criteria and then you can get their Path minus file name using `Path.GetDirectoryName` and add it to the `HashSet`. `HashSet` would only keep the unique ent... |
25,024,560 | Assume I have a dataframe:
```
Col1 Col2 Col3 Val
a 1 a 2
a 1 a 3
a 1 b 5
b 1 a 10
b 1 a 20
b 1 a 25
```
I want to aggregate across all columns and then attach this to my dataframe so that I have this output:
```
C... | 2014/07/29 | [
"https://Stackoverflow.com/questions/25024560",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2565416/"
] | There is no built in way of doing it, You can try something like this
```
var directories = Directory
.GetDirectories(path, "*", SearchOption.AllDirectories)
.Where(x=> Directory.EnumerateFiles(x, "*.jpg").Any() || Directory.EnumerateFiles(x, "*.png").Any())
.ToList();
``` | You can use [`Directory.EnumerateFiles`](http://msdn.microsoft.com/en-us/library/system.io.directory.enumeratefiles(v=vs.110).aspx) method to get the file matching criteria and then you can get their Path minus file name using `Path.GetDirectoryName` and add it to the `HashSet`. `HashSet` would only keep the unique ent... |
59,762,087 | Hi I know that Flutter still doesn't support SVG files so I used flutter\_svg package, but for some reason, the svg file is not rendering the SVG file I want to use.
What I want is use my custom SVG files as Icon in the bottomnavigation bar items.
>
> I want to use SVG icons so that I can easily change their colors ... | 2020/01/16 | [
"https://Stackoverflow.com/questions/59762087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12509659/"
] | Fixed it
```
height: 20.0,
width: 20.0,
allowDrawingOutsideViewBox: true,
```
I'm beginning to slowly fall in love with flutter | Use property activeIcon also inside BottomNavigationBarItem
```
BottomNavigationBarItem(
icon: SvgPicture.asset(
icon,
height: 20.0,
width: 20.0,
),
activeIcon: SvgPicture.asset(
icon,
height: 20.0,
width: 20.0,
color: Colors.pinkAccent,
),
label: title,
);
```
SVG color changin... |
25,469,489 | A long, long time ago, in a galaxy far away, I used to write programs in Delphi, and then if I needed something to happen really fast, I'd write those routines in hand-written assembler. It produced much faster code than the compiler did.
But is this true **in practice** any more? Obviously hand-written assembler will... | 2014/08/24 | [
"https://Stackoverflow.com/questions/25469489",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3933089/"
] | To me it looks both answers given so far are correct. The answer depends, among other things, on the particular CPU architecture we're talking about. The more complex architecture is, the harder it is to write efficient ASM code by hand.
On one end of the spectrum are CISC cores such as x86. They have multiple executi... | In practice decent C code *compiled with an optimizing compiler* is faster than assembler code, in particular once you need more than a few dozen of source code lines.
Of course you need a good, recent, optimizing compiler. Cross-compiling with a recent [GCC](http://gcc.gnu.org/) tuned for your particular hardware (an... |
25,469,489 | A long, long time ago, in a galaxy far away, I used to write programs in Delphi, and then if I needed something to happen really fast, I'd write those routines in hand-written assembler. It produced much faster code than the compiler did.
But is this true **in practice** any more? Obviously hand-written assembler will... | 2014/08/24 | [
"https://Stackoverflow.com/questions/25469489",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3933089/"
] | To me it looks both answers given so far are correct. The answer depends, among other things, on the particular CPU architecture we're talking about. The more complex architecture is, the harder it is to write efficient ASM code by hand.
On one end of the spectrum are CISC cores such as x86. They have multiple executi... | Hand-written assembler is still faster than decent C code. If you knew how to write assembler you wouldn't believe what cruft some compilers generate. I have seen insane stuff like loading a value from memory and instantly writing it back unmodified (as recent as two years ago, I generally do not look at assembler outp... |
1,385,852 | How do we do this? Does it involve the fact that we know $f$ is continuous, and therefore the limit approaching the endpoint $1$ should be the same coming from both sides? | 2015/08/05 | [
"https://math.stackexchange.com/questions/1385852",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/259137/"
] | If $f(1)<2$ then $\epsilon=2-f(1)$ is positive. Since $f$ is continuous and $f(0)\ge 2$, then there exists some $c\in[0,1)$ such that $f(c)=2-\frac\epsilon2$. Contradiction. | An alternative topological solution:
Since $f$ is continuous, $f(\overline{A}) \subset \overline{f(A)}$ for all $A \subset [0,1]$
Applying this to $[0,1)$:
$f([0,1]) \subset \overline{f([0,1))} \subset \overline{[2,\infty)} = [2,\infty)$ |
13,756,250 | I am using Grails and I am currently faced with this problem.
This is the result of my html table

And this is my code from the gsp page
```
<tr>
<th>Device ID</th>
<th>Device Type</th>
<th>Status</th>
<th>Custome... | 2012/12/07 | [
"https://Stackoverflow.com/questions/13756250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1790785/"
] | I think you problem is not in the view, but in the controller (or maybe even the domain). You must have some way of knowing that `reqid` and `custname` are related if they are in the same table. You must use that to construct an object that can be easily used in a g:each
You are looking for a way to mix columns and ro... | Do you want to display the first reqid against the first custname (three fields), the second againts the second and so on? And are those collections of same length?
In such case you could try the following:
```
<tr>
<th>Device ID</th>
<th>Device Type</th>
<th>Status</th>
<th>Customer</th>
</tr>
<g:... |
5,329,947 | I have an input that I'd like to put a placeholder text in, but *only if* it's respective value is an empty string. The value that should go in the textbox is echoed from a PHP array, but if this value is empty, the placeholder should be echoed instead. At the moment, I've got this code:
```
<?php echo sponsorData('a... | 2011/03/16 | [
"https://Stackoverflow.com/questions/5329947",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/383609/"
] | try the following code:
```
<?php echo ((sponsorData('address0') == '') ? 'Address Line 1' : 'Other'); ?>
```
felix | You seem to have this working ok, I don't think the error lies there. Here is how I would do it:
```
$address0 = sponsorData('address0');
$address0 = !empty($address0) ? $address0 : 'placeholder';
``` |
5,329,947 | I have an input that I'd like to put a placeholder text in, but *only if* it's respective value is an empty string. The value that should go in the textbox is echoed from a PHP array, but if this value is empty, the placeholder should be echoed instead. At the moment, I've got this code:
```
<?php echo sponsorData('a... | 2011/03/16 | [
"https://Stackoverflow.com/questions/5329947",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/383609/"
] | try the following code:
```
<?php echo ((sponsorData('address0') == '') ? 'Address Line 1' : 'Other'); ?>
```
felix | You have to consider that the `sponsorData('address0')` may have spaces, so you can add the `trim` function, like this:
```
<?php echo ((trim(sponsorData('address0')) == '') ? 'Address Line 1' : 'Other'); ?>
``` |
5,329,947 | I have an input that I'd like to put a placeholder text in, but *only if* it's respective value is an empty string. The value that should go in the textbox is echoed from a PHP array, but if this value is empty, the placeholder should be echoed instead. At the moment, I've got this code:
```
<?php echo sponsorData('a... | 2011/03/16 | [
"https://Stackoverflow.com/questions/5329947",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/383609/"
] | You're running into operator precedence issues. Try:
```
<?php echo (sponsorData('address0') == '' ? 'Address Line 1' : 'Other'); ?>
```
(put brackets around the ternary operator statement). | You seem to have this working ok, I don't think the error lies there. Here is how I would do it:
```
$address0 = sponsorData('address0');
$address0 = !empty($address0) ? $address0 : 'placeholder';
``` |
5,329,947 | I have an input that I'd like to put a placeholder text in, but *only if* it's respective value is an empty string. The value that should go in the textbox is echoed from a PHP array, but if this value is empty, the placeholder should be echoed instead. At the moment, I've got this code:
```
<?php echo sponsorData('a... | 2011/03/16 | [
"https://Stackoverflow.com/questions/5329947",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/383609/"
] | You're running into operator precedence issues. Try:
```
<?php echo (sponsorData('address0') == '' ? 'Address Line 1' : 'Other'); ?>
```
(put brackets around the ternary operator statement). | You have to consider that the `sponsorData('address0')` may have spaces, so you can add the `trim` function, like this:
```
<?php echo ((trim(sponsorData('address0')) == '') ? 'Address Line 1' : 'Other'); ?>
``` |
27,771,899 | Our .net application supports AD authentication, so our application will read from the GC connection string and credentials. We now have a client who has ADFS in their on-premise and wants to create a trust with our server which hosts the application. Do I need to write a separate code to setup as a claims-aware (or) c... | 2015/01/03 | [
"https://Stackoverflow.com/questions/27771899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2024422/"
] | you've answered your own question : "Our .net application supports AD authentication..." This is not the same s being claims aware, so yes you will need to modify the app. Once your app is claims aware they will create a relying party (that's your app) trust with some data that you will provide after it's been made cla... | You should ask this on <https://stackoverflow.com/>
If you do consider converting the app to be claims aware, I suggest you implement AD FS in your environment and create a trust between your AD FS and the client's ADFS. Your app will then needs to be converted to be claims aware and configure a trust between your app... |
42,099,915 | I don't mean collapse, I mean hide. For example for single line comments it'd completely hide it, the editor entirely skipping the comment's line number.
I'm entirely self-taught when it comes to programming, so I'm sure I've picked up numerous bad habits, one of which is almost entirely forgoing commenting. I dislike... | 2017/02/07 | [
"https://Stackoverflow.com/questions/42099915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2868017/"
] | I am not sure, whether I would recommend working without comments. However, you could switch between two schemes. The first one would be the one you are currently working with. The other would be a copy of it, but with the -distracting- comments matching the background color.
[For instance like this](https://i.stack.i... | "CTRL SLASH" will comment the current line.
"CTRL SHIFT SLASH" will comment all that is currently selected.
To hide multiple commented lines simply use the minus/minimize arrows on the left side of the code window (right side of the line numbers).
To see the hidden lines use the add/maximize blocks. |
13,624 | [](https://i.stack.imgur.com/9pJC6.jpg)
This is a picture of a jet of particles exiting the supermassive black hole in the center of Pictor A galaxy at nearly the speed of light. [Source](http://www.astronomy.com/news/2016/02/blast-from-black-hole-in-a-galaxy-far-far-away?utm_so... | 2016/02/09 | [
"https://astronomy.stackexchange.com/questions/13624",
"https://astronomy.stackexchange.com",
"https://astronomy.stackexchange.com/users/7926/"
] | This is a clear example of an [astrophysical jet](https://en.wikipedia.org/wiki/Astrophysical_jet), in this case, most likely a relativistic jet. In short, an accretion disk forms around a black hole (supermassive or otherwise). Matter is pulled towards the black hole and further energized, before being accelerated int... | It's infalling matter, as described in [the article](http://futurism.com/distant-supermassive-black-hole-emits-giant-death-rays-larger-galaxy/):
>
> The new image shows how the material being consumed by the black hole—stars, planets, interstellar gas, unwary astronauts (kidding)—releases a tremendous surplus of ener... |
253,869 | I upgraded my service to 200 amp from 100 amp, but the new panel is 15 ft. away. In order to connect the existing wires to the new breakers in the new panel, will just a simple connection with higher guage wire and wire nut be fine or does it require a different approach?
thanks | 2022/07/31 | [
"https://diy.stackexchange.com/questions/253869",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/100926/"
] | Extending the existing circuits from the old panel to the new one with the same gauge wire is acceptable. There is no need to upsize the wire. If you have an excess of larger gauge wire that you are trying to use up then you can use it, provided the breakers in the new panel are listed for use with that gauge.
Your ol... | Not clear from the question. Is this about *service* or *branch circuits*?
### Service
Since you upgraded the *service*, you need larger feed wires to match. Instead of 2 sections of wire and a splice, get wires to go the whole distance.
If you are simply putting in a bigger panel (based on a previous question, I th... |
2,148,135 | I've looked at the [documentation](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:jqgriddocs) but I've been unable to find an answer. Is there a way to prevent a row from being highlighted when selected? That or even a way to stop the row being selected at all. I like the "hoverrows: true" option, but ideally I wou... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2148135",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/178383/"
] | try:
```
onSelectRow: function(rowid, status) {
$("#grid_id").resetSelection(); //Resets (unselects) the selected row(s). Also works in multiselect mode.
}
```
you can read documentations [here](http://www.secondpersonplural.ca/jqgriddocs/index.htm). Hope it helps you... | I suppose you could address this in the CSS directly. Just override the values for ui-state-highlight for your specific table
```
#table_id tr.ui-state-highlight {
border: inherit !important;
background: inherit !important;
color: inherit !important;
}
#table_id tr.ui-state-highlight a {
color: inherit !impor... |
2,148,135 | I've looked at the [documentation](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:jqgriddocs) but I've been unable to find an answer. Is there a way to prevent a row from being highlighted when selected? That or even a way to stop the row being selected at all. I like the "hoverrows: true" option, but ideally I wou... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2148135",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/178383/"
] | Use the following code:
```
beforeSelectRow: function(rowid, e) {
return false;
}
``` | I suppose you could address this in the CSS directly. Just override the values for ui-state-highlight for your specific table
```
#table_id tr.ui-state-highlight {
border: inherit !important;
background: inherit !important;
color: inherit !important;
}
#table_id tr.ui-state-highlight a {
color: inherit !impor... |
2,148,135 | I've looked at the [documentation](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:jqgriddocs) but I've been unable to find an answer. Is there a way to prevent a row from being highlighted when selected? That or even a way to stop the row being selected at all. I like the "hoverrows: true" option, but ideally I wou... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2148135",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/178383/"
] | If you, like me, have a gazillion jqGrids and don't want to override onSelectRow for every single one, here's a global version of Reigel's solution that worked nicely for me:
```
jQuery.extend(jQuery.jgrid.defaults, {
onSelectRow: function(rowid, e) {
$('#'+rowid).parents('table').resetSelection();
}
}... | I suppose you could address this in the CSS directly. Just override the values for ui-state-highlight for your specific table
```
#table_id tr.ui-state-highlight {
border: inherit !important;
background: inherit !important;
color: inherit !important;
}
#table_id tr.ui-state-highlight a {
color: inherit !impor... |
2,148,135 | I've looked at the [documentation](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:jqgriddocs) but I've been unable to find an answer. Is there a way to prevent a row from being highlighted when selected? That or even a way to stop the row being selected at all. I like the "hoverrows: true" option, but ideally I wou... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2148135",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/178383/"
] | I suppose you could address this in the CSS directly. Just override the values for ui-state-highlight for your specific table
```
#table_id tr.ui-state-highlight {
border: inherit !important;
background: inherit !important;
color: inherit !important;
}
#table_id tr.ui-state-highlight a {
color: inherit !impor... | Yes, use the rowattr callback:
```
rowattr: function (rowData,currentObj,rowId) {
if (rowData.SomeField=="SomeValue") {
return {"class": "ui-state-disabled"};
}
},
```
This also grays out the row and disables the selection. |
2,148,135 | I've looked at the [documentation](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:jqgriddocs) but I've been unable to find an answer. Is there a way to prevent a row from being highlighted when selected? That or even a way to stop the row being selected at all. I like the "hoverrows: true" option, but ideally I wou... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2148135",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/178383/"
] | Use the following code:
```
beforeSelectRow: function(rowid, e) {
return false;
}
``` | try:
```
onSelectRow: function(rowid, status) {
$("#grid_id").resetSelection(); //Resets (unselects) the selected row(s). Also works in multiselect mode.
}
```
you can read documentations [here](http://www.secondpersonplural.ca/jqgriddocs/index.htm). Hope it helps you... |
2,148,135 | I've looked at the [documentation](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:jqgriddocs) but I've been unable to find an answer. Is there a way to prevent a row from being highlighted when selected? That or even a way to stop the row being selected at all. I like the "hoverrows: true" option, but ideally I wou... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2148135",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/178383/"
] | If you, like me, have a gazillion jqGrids and don't want to override onSelectRow for every single one, here's a global version of Reigel's solution that worked nicely for me:
```
jQuery.extend(jQuery.jgrid.defaults, {
onSelectRow: function(rowid, e) {
$('#'+rowid).parents('table').resetSelection();
}
}... | try:
```
onSelectRow: function(rowid, status) {
$("#grid_id").resetSelection(); //Resets (unselects) the selected row(s). Also works in multiselect mode.
}
```
you can read documentations [here](http://www.secondpersonplural.ca/jqgriddocs/index.htm). Hope it helps you... |
2,148,135 | I've looked at the [documentation](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:jqgriddocs) but I've been unable to find an answer. Is there a way to prevent a row from being highlighted when selected? That or even a way to stop the row being selected at all. I like the "hoverrows: true" option, but ideally I wou... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2148135",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/178383/"
] | try:
```
onSelectRow: function(rowid, status) {
$("#grid_id").resetSelection(); //Resets (unselects) the selected row(s). Also works in multiselect mode.
}
```
you can read documentations [here](http://www.secondpersonplural.ca/jqgriddocs/index.htm). Hope it helps you... | Yes, use the rowattr callback:
```
rowattr: function (rowData,currentObj,rowId) {
if (rowData.SomeField=="SomeValue") {
return {"class": "ui-state-disabled"};
}
},
```
This also grays out the row and disables the selection. |
2,148,135 | I've looked at the [documentation](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:jqgriddocs) but I've been unable to find an answer. Is there a way to prevent a row from being highlighted when selected? That or even a way to stop the row being selected at all. I like the "hoverrows: true" option, but ideally I wou... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2148135",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/178383/"
] | Use the following code:
```
beforeSelectRow: function(rowid, e) {
return false;
}
``` | If you, like me, have a gazillion jqGrids and don't want to override onSelectRow for every single one, here's a global version of Reigel's solution that worked nicely for me:
```
jQuery.extend(jQuery.jgrid.defaults, {
onSelectRow: function(rowid, e) {
$('#'+rowid).parents('table').resetSelection();
}
}... |
2,148,135 | I've looked at the [documentation](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:jqgriddocs) but I've been unable to find an answer. Is there a way to prevent a row from being highlighted when selected? That or even a way to stop the row being selected at all. I like the "hoverrows: true" option, but ideally I wou... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2148135",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/178383/"
] | Use the following code:
```
beforeSelectRow: function(rowid, e) {
return false;
}
``` | Yes, use the rowattr callback:
```
rowattr: function (rowData,currentObj,rowId) {
if (rowData.SomeField=="SomeValue") {
return {"class": "ui-state-disabled"};
}
},
```
This also grays out the row and disables the selection. |
2,148,135 | I've looked at the [documentation](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:jqgriddocs) but I've been unable to find an answer. Is there a way to prevent a row from being highlighted when selected? That or even a way to stop the row being selected at all. I like the "hoverrows: true" option, but ideally I wou... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2148135",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/178383/"
] | If you, like me, have a gazillion jqGrids and don't want to override onSelectRow for every single one, here's a global version of Reigel's solution that worked nicely for me:
```
jQuery.extend(jQuery.jgrid.defaults, {
onSelectRow: function(rowid, e) {
$('#'+rowid).parents('table').resetSelection();
}
}... | Yes, use the rowattr callback:
```
rowattr: function (rowData,currentObj,rowId) {
if (rowData.SomeField=="SomeValue") {
return {"class": "ui-state-disabled"};
}
},
```
This also grays out the row and disables the selection. |
454,087 | I have dual boot with Ubuntu 12.04 and Windows 7, and I would like to upgrade Ubuntu to 14.04 but still retain my windows 7, help! I have a DVD with the ubuntu 14.04 ISO | 2014/04/24 | [
"https://askubuntu.com/questions/454087",
"https://askubuntu.com",
"https://askubuntu.com/users/273372/"
] | If you copy a partition with `dd`, the output file will be as big as the partition. `dd` does a physical copy of the disc, it has no knowledge of blank or used space.
If you compress the result file you will save a lot of space, though, given that blank space will compress away very well (beware, this is going to be ... | DD probably isn't the right tool to do a backup. As Rmano said, it's making a direct copy of /dev/sda4 (probably to /dev/sda4).
His answer is spot on.
Check out rsync for doing backups. |
3,705,480 | How can I use RichTextBox Target in WPF application?
I don't want to have a separate window with log, I want all log messages to be outputted in richTextBox located in WPF dialog.
I've tried to use WindowsFormsHost with RichTextBox box inside but that does not worked for me: NLog opened separate Windows Form anyway. | 2010/09/14 | [
"https://Stackoverflow.com/questions/3705480",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/446876/"
] | A workaround in the mean time is to use the 3 classes available [here](http://nlog.codeplex.com/workitem/6272), then follow this procedure:
1. Import the 3 files into your project
2. If not already the case, use `Project > Add Reference` to add references to the WPF assemblies: `WindowsBase, PresentationCore, Presenta... | If you define a RichTextBoxTarget in the config file, a new form is automatically created. This is because NLog initializes before your (named) form and control has been created. Even if you haven't got any rules pointing to the target. Perhaps there is a better solution, but I solved it by creating the target programa... |
61,048,540 | I'm trying to serve API with ***nodeJS***, and database use ***oracle***. I've an object like this that I got from `req.body.detail`:
```
{
title: "How to Have",
content: "<ol><li><b>Lorem ipsum dolor sit amet.</b></li></ol>"
}
```
then I do
```
const data = JSON.stringify(req.body.detail);
```
but t... | 2020/04/05 | [
"https://Stackoverflow.com/questions/61048540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4941250/"
] | If
`public class ClassName1 extends/implements ClassName`
than it is perfectly valid.
This is how polimorphism works - you can treat given instance as it would be a solely instance of any of its superclasses or interfaces it implements. | `ClassName` is the type of the variable `a`, which means for your problem, that `a` can represents an object of the type `ClassName` (and any other subclass of it).
So, the sentence `ClassName a = new ClassName1()` only make sense and is right if the `ClassName1` is a subclass of `ClassName`. |
151,594 | I cannot for the life of me figure this out. I have two monitors. If I'm focused on the left monitor, I cannot use a shortcut to switch spaces on the right monitor. Or (as often happens) I click my right monitor to focus it instead of alt tabbing, and then I cannot switch the left monitor space with my keyboard without... | 2014/10/19 | [
"https://apple.stackexchange.com/questions/151594",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/96457/"
] | Ctrl-Left Arrow/Right Arrow let you scroll through spaces from the keyboard in Mavericks.
Spaces are only independent if you have "Displays Have Separate Spaces" enabled under `System Preferences > Mission Control` -- with this option enabled, you should be able to switch workspaces on each monitor independently. The ... | The free app "CurrentKey Stats" will do just what you want: `https://currentkey.com/`
With CKS, you can assign a hotkey to each Desktop/Workspace. Pressing that hotkey will bring up the assigned space no matter which monitor has the mouse or has the active focus. You can be working in the main monitor and press your c... |
151,594 | I cannot for the life of me figure this out. I have two monitors. If I'm focused on the left monitor, I cannot use a shortcut to switch spaces on the right monitor. Or (as often happens) I click my right monitor to focus it instead of alt tabbing, and then I cannot switch the left monitor space with my keyboard without... | 2014/10/19 | [
"https://apple.stackexchange.com/questions/151594",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/96457/"
] | The keyboard shortcuts for switching spaces apply to the display that the pointer is on - there isn't really a way of getting round that, as far as I'm aware. | The free app "CurrentKey Stats" will do just what you want: `https://currentkey.com/`
With CKS, you can assign a hotkey to each Desktop/Workspace. Pressing that hotkey will bring up the assigned space no matter which monitor has the mouse or has the active focus. You can be working in the main monitor and press your c... |
151,594 | I cannot for the life of me figure this out. I have two monitors. If I'm focused on the left monitor, I cannot use a shortcut to switch spaces on the right monitor. Or (as often happens) I click my right monitor to focus it instead of alt tabbing, and then I cannot switch the left monitor space with my keyboard without... | 2014/10/19 | [
"https://apple.stackexchange.com/questions/151594",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/96457/"
] | Yes, if you know applescript.
For example, to switch to **Space 1** on the **Secondary Display**. Note:
1) Primary/Secondary Display is defined by where the Menu Bar is (i.e. System Preference -> Display -> Arrangement), not by cursor focus.
2) This script switches to *Space 1*, whether it's a Desktop or fullscreen... | The free app "CurrentKey Stats" will do just what you want: `https://currentkey.com/`
With CKS, you can assign a hotkey to each Desktop/Workspace. Pressing that hotkey will bring up the assigned space no matter which monitor has the mouse or has the active focus. You can be working in the main monitor and press your c... |
17,351,192 | **dir1\dir2\dir3\file.aspx.cs**(343,49): error CS0839: Argument missing [**C:\dir\dir\dir\dir\namespace.namespace.namespace.namespace\**project.csproj]
I've been trying for hours to create a regular expression to extract just 2 areas of this string. The bold areas are the parts I wish to capture.
I need to split this... | 2013/06/27 | [
"https://Stackoverflow.com/questions/17351192",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/882993/"
] | This pattern:
```
(^[^(]*).*\[(.*)project.csproj]$
```
Captures these groups:
1. `dir1\dir2\dir3\file.aspx.cs`
2. `C:\dir\dir\dir\dir\namespace.namespace.namespace.namespace\`
If the name `project.csproj` file could change, you can use this pattern instead:
```
(^[^(]*).*\[(.*\\)[^\\]*]$
```
This will match eve... | Well, right now the parentheses aren't doing you any good. Just place them around the parts you are interested in:
```
^(.*)\(
```
and
```
\[(.*)\]
```
Now to exclude `projects.csproj` from the match, simply include it after the `.*`:
```
\[(.*)projects.csproj\]
```
Then `match.Groups(1)` will give you the des... |
36,734,566 | I am working on performance storage. When I am selecting Storage Size 250/500 then no data In IOPS. When I was select storage size `100/20/80/1000/2000gb` then I am getting IOPS. I am facing problem only `250/500gb`. this is the API i am using
```
https://[username]:[apikey]@api.softlayer.com/rest/v3.1/SoftLayer_Produ... | 2016/04/20 | [
"https://Stackoverflow.com/questions/36734566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6171678/"
] | if you have just use three array means just use if condition
```
String arraname="";
if (Arrays.asList(lac1).contains("102")) {
arraname="lac1";
}
if (Arrays.asList(lac2).contains("102")) {
arraname="lac2";
}
if (Arrays.asList(lac3).contains("102")) {
arraname="lac3";
}
``` | I think the best data structure to solve the problem is using dictionary.
in java:
```
Map<int, String> dictionary = new HashMap<int, String>();
//put the data in..
//check existence
string value = map.get(key);
if (value != null) {
...
} else {
// No such key
}
``` |
36,734,566 | I am working on performance storage. When I am selecting Storage Size 250/500 then no data In IOPS. When I was select storage size `100/20/80/1000/2000gb` then I am getting IOPS. I am facing problem only `250/500gb`. this is the API i am using
```
https://[username]:[apikey]@api.softlayer.com/rest/v3.1/SoftLayer_Produ... | 2016/04/20 | [
"https://Stackoverflow.com/questions/36734566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6171678/"
] | if you have just use three array means just use if condition
```
String arraname="";
if (Arrays.asList(lac1).contains("102")) {
arraname="lac1";
}
if (Arrays.asList(lac2).contains("102")) {
arraname="lac2";
}
if (Arrays.asList(lac3).contains("102")) {
arraname="lac3";
}
``` | If you want a better data structure to store these details i will suggest a `Map` with key as `String` and value as `List<String>`
```
Map<String,List<String>> map = new HashMap<String,List<String>>();
map.put("lac1",lac1List);
map.put("lac2",lac2List);
map.put("lac3",lac3List);
```
You can iterate the map and find... |
36,734,566 | I am working on performance storage. When I am selecting Storage Size 250/500 then no data In IOPS. When I was select storage size `100/20/80/1000/2000gb` then I am getting IOPS. I am facing problem only `250/500gb`. this is the API i am using
```
https://[username]:[apikey]@api.softlayer.com/rest/v3.1/SoftLayer_Produ... | 2016/04/20 | [
"https://Stackoverflow.com/questions/36734566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6171678/"
] | if you have just use three array means just use if condition
```
String arraname="";
if (Arrays.asList(lac1).contains("102")) {
arraname="lac1";
}
if (Arrays.asList(lac2).contains("102")) {
arraname="lac2";
}
if (Arrays.asList(lac3).contains("102")) {
arraname="lac3";
}
``` | For array, you could try just `for` loop
```
public static void main(String[] args) {
String[] lac1 = {"1", "101", "1101"};
String[] lac2 = {"2", "102", "1102"};
String[] lac3 = {"3", "103", "1103","8", "108", "1108"};
int pos = -1;
if ((pos = getPostion(lac1, "102")) > -1) {
System.out.pri... |
36,734,566 | I am working on performance storage. When I am selecting Storage Size 250/500 then no data In IOPS. When I was select storage size `100/20/80/1000/2000gb` then I am getting IOPS. I am facing problem only `250/500gb`. this is the API i am using
```
https://[username]:[apikey]@api.softlayer.com/rest/v3.1/SoftLayer_Produ... | 2016/04/20 | [
"https://Stackoverflow.com/questions/36734566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6171678/"
] | if you have just use three array means just use if condition
```
String arraname="";
if (Arrays.asList(lac1).contains("102")) {
arraname="lac1";
}
if (Arrays.asList(lac2).contains("102")) {
arraname="lac2";
}
if (Arrays.asList(lac3).contains("102")) {
arraname="lac3";
}
``` | ```
public String checkValueInList(String val){
String arrayName = "";
String[] lac1 = {"1", "101", "1101"};
String[] lac2 = {"2", "102", "1102"};
String[] lac3 = {"3", "103", "1103","8", "108", "1108"};
List<String> list1 = getArrayList();
list1.add("lac1");
List<String> list2 = getArrayLi... |
36,734,566 | I am working on performance storage. When I am selecting Storage Size 250/500 then no data In IOPS. When I was select storage size `100/20/80/1000/2000gb` then I am getting IOPS. I am facing problem only `250/500gb`. this is the API i am using
```
https://[username]:[apikey]@api.softlayer.com/rest/v3.1/SoftLayer_Produ... | 2016/04/20 | [
"https://Stackoverflow.com/questions/36734566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6171678/"
] | if you have just use three array means just use if condition
```
String arraname="";
if (Arrays.asList(lac1).contains("102")) {
arraname="lac1";
}
if (Arrays.asList(lac2).contains("102")) {
arraname="lac2";
}
if (Arrays.asList(lac3).contains("102")) {
arraname="lac3";
}
``` | A Simple way could be:
```
public class mapList {
Map<String,String> map;
String[] lac1 = {"1", "101", "1101"};
String[] lac2 = {"2", "102", "1102"};
String[] lac3 = {"3", "103", "1103","8", "108", "1108"};
public mapList(){
map = new HashMap<>();
for(String l1:lac1){ map.put(l1,... |
178 | Suppose we want to translate the whole of Wikipedia from English into [Lojban](https://jbo.wikipedia.org/), what are the main known big limitations or concerns we should be aware of? In other words, does Lojban as a language have sufficient expressive power for being translated from English? | 2018/02/08 | [
"https://conlang.stackexchange.com/questions/178",
"https://conlang.stackexchange.com",
"https://conlang.stackexchange.com/users/30/"
] | Length
======
A few things. First, Lojban often needs longer sentences to express something than it does in, for example, English.
Vocabulary
==========
Secondly, Lojban's vocabulary isn't that big, especially in the domain of sciences. Words would have to be calqued, adapted from English, French, etc. or completely... | One of Lojban's most famous features is, of course, its lack of syntactic ambiguity. While this is an advantage in some cases, it can also be a limitation. It wouldn't likely be an issue in something like Wikipedia, but does make certain kinds of wordplay impossible. Take for example this exchange from Lewis Carroll's ... |
6,935,450 | ```
$(window).bind("beforeunload",function(){
return "cant be seen in ff";
});
```
The problem is that i can't see the "cant be seen in ff" on the confirm box in my FireFox browser, but works well in other browsers(IE Chrome)
Any solutions?? | 2011/08/04 | [
"https://Stackoverflow.com/questions/6935450",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/342366/"
] | See this: <https://bugzilla.mozilla.org/show_bug.cgi?id=588292>
It looks like forefox decided to remove the support for the beforeunload as we know it. | do this
```
<script>
window.onbeforeunload = function(){
return "cant be seen in ff";
}
</script>
``` |
6,935,450 | ```
$(window).bind("beforeunload",function(){
return "cant be seen in ff";
});
```
The problem is that i can't see the "cant be seen in ff" on the confirm box in my FireFox browser, but works well in other browsers(IE Chrome)
Any solutions?? | 2011/08/04 | [
"https://Stackoverflow.com/questions/6935450",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/342366/"
] | ```
confirmOnPageExit : function( display ) {
if ( true == display ) {
var message;
/* if unsaved changes exist, display a warning */
if (false !== form_structure.unsaved_changes) {
message = 'Warning! Changes to the form builder have not been saved.';
ret... | do this
```
<script>
window.onbeforeunload = function(){
return "cant be seen in ff";
}
</script>
``` |
6,935,450 | ```
$(window).bind("beforeunload",function(){
return "cant be seen in ff";
});
```
The problem is that i can't see the "cant be seen in ff" on the confirm box in my FireFox browser, but works well in other browsers(IE Chrome)
Any solutions?? | 2011/08/04 | [
"https://Stackoverflow.com/questions/6935450",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/342366/"
] | See this: <https://bugzilla.mozilla.org/show_bug.cgi?id=588292>
It looks like forefox decided to remove the support for the beforeunload as we know it. | ```
confirmOnPageExit : function( display ) {
if ( true == display ) {
var message;
/* if unsaved changes exist, display a warning */
if (false !== form_structure.unsaved_changes) {
message = 'Warning! Changes to the form builder have not been saved.';
ret... |
251,927 | What is the proper way to fuse and switch a power supply consisting of a bunch of SMPS like the following:
[](https://i.stack.imgur.com/qd2vI.jpg)
There would be up to 5 separate output voltages. The outputs shown are about 35W each. Other outputs would be less... | 2016/08/12 | [
"https://electronics.stackexchange.com/questions/251927",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/18385/"
] | >
> So currently I have a mock-up that has a single fuse and a single switch on the AC load line. Is this safe?
>
>
>
The majority of devices found in the home or office are wired this way and there are few issues. The problem is that if you live in a land of non-polarised mains plugs which when reversed, can make... | I would use a single switch and fuse as you have shown, particularly if the supplies have internal fuses.
Whether the individual supplies should be switched will depend on the application. |
45,200,443 | the idea is within class Card
I have dict
```
pack_of_cards = {'2': 2,'3': 3,'4': 4,'5': 5,'6': 6, \
'7': 7,'8': 7,'9': 9,'10': 10,'J': 10, \
'D': 10,'K': 10,'T': 10}
```
I need this class to return a random set of key and value as a dict.
For example:
```
Card() == {'T': 10}
```... | 2017/07/19 | [
"https://Stackoverflow.com/questions/45200443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8291387/"
] | You can do this using a method in the `random` module, but it wouldn't make sense unless your `Card` class implements an `__eq__` method. Example:
```
In [450]: class Card:
...: def __init__(self, suite, num):
...: self.suite = suite
...: self.num = num
...:
...: def __... | You can use `random.sample()` to return the number of cards you need, e.g.:
```
>>> import random
>>> dict(random.sample(pack_of_cards.items(), k=5))
{'10': 10, '5': 5, '9': 9, 'J': 10, 'K': 10}
```
*(not a bad hand for cribbage)* |
37,261,889 | I have handle that I got via `stdinHandle = GetStdHandle(STD_INPUT_HANDLE)` and I have separate thread which execute such code:
```
while (!timeToExit) {
char ch;
DWORD readBytes = 0;
if (!::ReadFile(stdinHandle, &ch, sizeof(ch), &readBytes, nullptr)) {
//report error
return;
}
if (readBytes == 0)
... | 2016/05/16 | [
"https://Stackoverflow.com/questions/37261889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1034749/"
] | When reading from a console's actual STDIN, you can use [`PeekConsoleInput()`](https://msdn.microsoft.com/en-us/library/windows/desktop/ms684344.aspx) and [`ReadConsoleInfo()`](https://msdn.microsoft.com/en-us/library/windows/desktop/ms684961.aspx) instead of `ReadFile()`.
When reading from an (un)named pipe, use [`Pe... | The safest way to do this would be to call [ReadFile](https://msdn.microsoft.com/en-us/library/windows/desktop/aa365467(v=vs.85).aspx) asynchronously (non-blocking) using the OVERLAPPED structure etc. This can be done from your main thread.
If/when you need to cancel it, call [CancelIo](https://msdn.microsoft.com/en-u... |
16,315,042 | Below is my code
```
DirectoryInfo directoryInfo = new DirectoryInfo(@"C:\Users\Shahul\Documents\Visual Studio 2010\Projects\TreeView\TreeView\bin\FileExplorer");
private void Form1_Load(object sender, EventArgs e)
{
if (Directory.Exists("FileExplorer"))
{
try
{
DirectoryInfo[] dir... | 2013/05/01 | [
"https://Stackoverflow.com/questions/16315042",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2338764/"
] | This should solve your problem, I tried on WinForm though:
```
public Form1()
{
InitializeComponent();
DirectoryInfo directoryInfo = new DirectoryInfo(@"C:\Users\hikuma\Documents\IR");
if (directoryInfo.Exists)
{
treeView1.AfterSelect += treeView1_AfterSelect;
... | Try this: (note make sure your directoryInfo location contains some folders)
```
DirectoryInfo directoryInfo = new DirectoryInfo(@"C:\Users\Shahul\Documents\Visual Studio 2010\Projects\TreeView\TreeView\bin\FileExplorer");
private void Form1_Load(object sender, EventArgs e)
{
if (directoryInfo.Exists)
{
... |
16,315,042 | Below is my code
```
DirectoryInfo directoryInfo = new DirectoryInfo(@"C:\Users\Shahul\Documents\Visual Studio 2010\Projects\TreeView\TreeView\bin\FileExplorer");
private void Form1_Load(object sender, EventArgs e)
{
if (Directory.Exists("FileExplorer"))
{
try
{
DirectoryInfo[] dir... | 2013/05/01 | [
"https://Stackoverflow.com/questions/16315042",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2338764/"
] | This should solve your problem, I tried on WinForm though:
```
public Form1()
{
InitializeComponent();
DirectoryInfo directoryInfo = new DirectoryInfo(@"C:\Users\hikuma\Documents\IR");
if (directoryInfo.Exists)
{
treeView1.AfterSelect += treeView1_AfterSelect;
... | DirectoryInfo.Exists("FileExplorer") will check for "C:\Users\Shahul\Documents\Visual Studio 2010\Projects\TreeView\TreeView\bin\debug\FileExplorer", not "C:\Users\Shahul\Documents\Visual Studio 2010\Projects\TreeView\TreeView\bin\FileExplorer", when you are running in debug mode. |
16,315,042 | Below is my code
```
DirectoryInfo directoryInfo = new DirectoryInfo(@"C:\Users\Shahul\Documents\Visual Studio 2010\Projects\TreeView\TreeView\bin\FileExplorer");
private void Form1_Load(object sender, EventArgs e)
{
if (Directory.Exists("FileExplorer"))
{
try
{
DirectoryInfo[] dir... | 2013/05/01 | [
"https://Stackoverflow.com/questions/16315042",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2338764/"
] | This should solve your problem, I tried on WinForm though:
```
public Form1()
{
InitializeComponent();
DirectoryInfo directoryInfo = new DirectoryInfo(@"C:\Users\hikuma\Documents\IR");
if (directoryInfo.Exists)
{
treeView1.AfterSelect += treeView1_AfterSelect;
... | Try the following:
```
private void Form1_Load(object sender, EventArgs e)
{
if (directoryInfo.Exists)
{
try
{
treeView.Nodes.Add(LoadDirectory(directoryInfo));
}
catch (Exception ex)
{
M... |
15,509,300 | I'm creating an Oracle Report and I would like to display certain results based on when I print the report. There is a field called apply\_date. For example, if I print the report <= sysdate of 3/15 then I only want to display the records that have an apply\_date of 3/1 - 3/15. This also goes for printing on the 30th o... | 2013/03/19 | [
"https://Stackoverflow.com/questions/15509300",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2188170/"
] | If you don't care much about the fiddly bits of column alignment, this isn't too bad:
```
datapoints = [{'a': 1, 'b': 2, 'c': 6},
{'a': 2, 'd': 8, 'p': 10},
{'c': 9, 'd': 1, 'z': 12}]
# get all the keys ever seen
keys = sorted(set.union(*(set(dp) for dp in datapoints)))
with open("outfile... | **Program:**
```
data_points = [
{'a': 1, 'b': 2, 'c': 6},
{'a': 2, 'd': 8, 'p': 10},
{'c': 9, 'd': 1, 'z': 12},
{'e': 3, 'f': 6, 'g': 3}
]
merged_data_points = {
}
for data_point in data_points:
for k, v in data_point.items():
if k not in merged_data_points:
merged_data_point... |
41,921,530 | I have a little dilemma with the decision part of my form. I'm attempting to create a form with radio buttons and a checkbox in an html page but I would like to retrieve data from my .php page.
I think there's an issue with the .php portion of the code. I'm getting a response from each 'if' statement regardless of the... | 2017/01/29 | [
"https://Stackoverflow.com/questions/41921530",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7422381/"
] | There are few issues with your code, such as:
* There's no `value` attribute in your radio buttons, so you won't get anything with `document.getElementById("radioX").value`. Add a `value` attribute in your radio buttons,
```
<input type="radio" name="radbutton" id="radioX" value="radioX" />
```
* Missing `&` between... | Is it php-behavior you need?
```
if (isset($_GET['box'])) {
if (isset($_GET['radio1'])) {
echo "Radio One AND checkbox.";
}
if (isset($_GET['radio2'])) {
echo "Radio One AND checkbox.";
}
if (isset($_GET['box'])) {
echo "Radio Three AND checkbox.";
}
} else {
if (... |
17,691,691 | If you close a GUI using the the little X in the top right of the form, does that kill all your threads as well?
If not, how to you catch that event so I can put in some close down code? | 2013/07/17 | [
"https://Stackoverflow.com/questions/17691691",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/758323/"
] | ```
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
```
To execute some code on closing have a look at this. [close window event in java](https://stackoverflow.com/questions/1984195/close-window-event-in-java) | >
> If you close a GUI using the the little X in the top right of the form, does that kill all your threads as well?
>
>
>
Yes, if the default close operation is `EXIT_ON_CLOSE` as mentioned by Luiggi. OTOH it is best not to simply 'kill' threads arbitrarily.
>
> If not, how to you catch that event so I can put ... |
54,547,061 | How can I get the following effect with FFMPEG?
[](https://i.imgur.com/8KeRNk5.gif)
I know I have to do it with Zoompan, but the truth is, I've been trying for a while and I can not! | 2019/02/06 | [
"https://Stackoverflow.com/questions/54547061",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6726976/"
] | The below pom.xml would suffices your requirement and
this [tutorial](https://www.journaldev.com/21816/mockito-tutorial) will help you for better understanding how to work with mockito using maven
```
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaL... | Maven has to download the dependencies, so you have to specify the package you're trying to import in the pom file. Go to <https://mvnrepository.com> and search for your package. Find the latest version, and you'll see under the maven tab something like this.
```
<dependency>
<groupId>org.mockito</groupId>
<ar... |
44,266,435 | When clicking on "a" anchor tag I want to redirect from one controller(HomeController.cs) to another controller(CartController.cs) index [GET] and and execute code and return data to view(cart/index.cshtml).
Here is the js code
```
$(document).on('click', '.btn-margin', function () {
if (parseInt($('#UserID')... | 2017/05/30 | [
"https://Stackoverflow.com/questions/44266435",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5663668/"
] | I may be a little bit late, but: You do not need anything special, it's simply formating.
Put label on top of form, wrap both label and select in a div, then adjust background colors and borders. See the example:
```css
.select-wrap
{
border: 1px solid #777;
border-radius: 4px;
margin-bottom: 10px;
paddi... | Try with the below code, I have refer it from here, <https://codepen.io/chriscoyier/pen/CiflJ>
It's not the exact what you want I think, but it is similar to that and more jazzy, so just play with this, might be you like it.
```css
form {
width: 320px;
float: left;
margin: 20px;
}
form > div {
p... |
27,952 | Mit „was“ meine ich hier das **neutrale** [Interrogativadverb – auch: Frageadverb](https://de.wikipedia.org/wiki/Interrogativadverb), mit dem man sich z.B. nach einem Gegenstand erkundigt: „Was hältst du in der Hand?“, im Gegensatz zu dem *persönlichen* Frageadverb „wer“, dessen Genitiv definitiv „wessen“ lautet.
Aber... | 2016/02/01 | [
"https://german.stackexchange.com/questions/27952",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/19609/"
] | *Wessen* ist der korrekte Genitiv zu *was* (und *wer*).
*Aufgrundwessen* existiert nicht (zumindest nicht im Duden; gehört habe ich es auch noch nie). Nach der Ursache kann man z.B. mit
*weshalb*, *warum*, *wieso* fragen. | Ich finde auch, dass “wessen Dach“ eine Person suggeriert und würde als Fragewort zu “welches Dach“ ausweichen, um die Beantwortung nicht einzuengen. Bei Präpositionen wie aufgrund gibt es andere Fragen, wie oben beschrieben. Eindeutiger wird es bei Verben/Adjektiven mit Genitivergäzung, z.B. er ist des xyz schuldig, w... |
51,848,564 | I have run into the problem of sending data, a simple int type, from a dialogue fragment to all the fragments within a viewpager. I have an activity that hosts both the dialogue fragment and the viewpager. I know how to send data from the dialogue fragment to the activity using an interface defined in the dialogue frag... | 2018/08/14 | [
"https://Stackoverflow.com/questions/51848564",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7180267/"
] | First of,
The `Include()` method is used to load related data, not properties on related data.
Which means, to load the name property of the related AplicantCompany and CreditorCompany on the entity Applications, your first query is correct.
It will include the name properties of both related entities
```
var result... | Your call to `ToListAsync` is async; but the invocation and the method itself are synchronous. Change to `ToList()` or (better) make everything else asynchronous as well |
51,848,564 | I have run into the problem of sending data, a simple int type, from a dialogue fragment to all the fragments within a viewpager. I have an activity that hosts both the dialogue fragment and the viewpager. I know how to send data from the dialogue fragment to the activity using an interface defined in the dialogue frag... | 2018/08/14 | [
"https://Stackoverflow.com/questions/51848564",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7180267/"
] | Your call to `ToListAsync()` is returning a `Task`, which may not have completed executing by the time you return from the method. The best solution would be to make the method async, like so:
```
public async Task<IActionResult> GetApplications()
{
var result = await context.Applications.Include(a=> a.AplicantComp... | Your call to `ToListAsync` is async; but the invocation and the method itself are synchronous. Change to `ToList()` or (better) make everything else asynchronous as well |
51,848,564 | I have run into the problem of sending data, a simple int type, from a dialogue fragment to all the fragments within a viewpager. I have an activity that hosts both the dialogue fragment and the viewpager. I know how to send data from the dialogue fragment to the activity using an interface defined in the dialogue frag... | 2018/08/14 | [
"https://Stackoverflow.com/questions/51848564",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7180267/"
] | Your call to `ToListAsync()` is returning a `Task`, which may not have completed executing by the time you return from the method. The best solution would be to make the method async, like so:
```
public async Task<IActionResult> GetApplications()
{
var result = await context.Applications.Include(a=> a.AplicantComp... | First of,
The `Include()` method is used to load related data, not properties on related data.
Which means, to load the name property of the related AplicantCompany and CreditorCompany on the entity Applications, your first query is correct.
It will include the name properties of both related entities
```
var result... |
66,996,455 | I am fairly new to R and I would like to paste the string "exampletext" in front of each file name within the path.
```
csvList <- list.files(path = "./csv_by_subject") %>%
paste0("*exampletext")
```
Currently this code renders things like "csv\*exampletext" and I want it to be \*exampletextcsv". I would l... | 2021/04/08 | [
"https://Stackoverflow.com/questions/66996455",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10524382/"
] | As others pointed out, the pipe is not necessary here. But if you do want to use it, you just have to specify that the second argument to `paste0` is "the thing you are piping", which you do using a period (.)
```
list.files(path = "./csv_by_subject") %>%
paste0("*exampletext", .)
``` | `paste0('exampletext', csvList)` should do the trick. It's not necessarily using `dplyr` and piping, but it's taking advantage of the vectorization features that R provides. |
66,996,455 | I am fairly new to R and I would like to paste the string "exampletext" in front of each file name within the path.
```
csvList <- list.files(path = "./csv_by_subject") %>%
paste0("*exampletext")
```
Currently this code renders things like "csv\*exampletext" and I want it to be \*exampletextcsv". I would l... | 2021/04/08 | [
"https://Stackoverflow.com/questions/66996455",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10524382/"
] | As others pointed out, the pipe is not necessary here. But if you do want to use it, you just have to specify that the second argument to `paste0` is "the thing you are piping", which you do using a period (.)
```
list.files(path = "./csv_by_subject") %>%
paste0("*exampletext", .)
``` | If you'd like to paste \*exampletext before all of the file names, you can reverse the order of what you're doing now using paste0 and passing the second argument as list.files. paste0 can handle vectors as the second argument and will apply the paste to each element.
```
csvList <- paste0("*exampletext", list.files(... |
50,882,897 | This is a simple problem that is hard for me to put into words because I'm not too familiar with Python's syntax. I have a class called "Quadrilateral" that takes 4 points, and I'm trying to make a method called "side\_length" that I want to use to compute the length of the line between two of the vertices on the quadr... | 2018/06/15 | [
"https://Stackoverflow.com/questions/50882897",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9948429/"
] | Is you looking for multiple index slice ?
```
df.loc[pd.IndexSlice['bar',:],:]
Out[319]:
0 1 2 3
bar one 0.807706 0.07296 0.638787 0.329646
two -0.497104 -0.75407 -0.943406 0.484752
``` | Your first column is level\_0, but you want to group by level\_1. If you reset the index both columns will be assigned a column header which you can group by
add this code:
```
df=df.reset_index()
df=df.groupby(['level_1']).first()
df.head()
``` |
50,882,897 | This is a simple problem that is hard for me to put into words because I'm not too familiar with Python's syntax. I have a class called "Quadrilateral" that takes 4 points, and I'm trying to make a method called "side\_length" that I want to use to compute the length of the line between two of the vertices on the quadr... | 2018/06/15 | [
"https://Stackoverflow.com/questions/50882897",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9948429/"
] | Is you looking for multiple index slice ?
```
df.loc[pd.IndexSlice['bar',:],:]
Out[319]:
0 1 2 3
bar one 0.807706 0.07296 0.638787 0.329646
two -0.497104 -0.75407 -0.943406 0.484752
``` | You can give your `MultiIndex` levels names and then use [`pd.DataFrame.query`](http://pandas.pydata.org/pandas-docs/version/0.22/generated/pandas.DataFrame.query.html):
```
df.index.names = ['first', 'second']
res = df.query('first == "bar"')
print(res)
0 1 2 3
first sec... |
50,882,897 | This is a simple problem that is hard for me to put into words because I'm not too familiar with Python's syntax. I have a class called "Quadrilateral" that takes 4 points, and I'm trying to make a method called "side\_length" that I want to use to compute the length of the line between two of the vertices on the quadr... | 2018/06/15 | [
"https://Stackoverflow.com/questions/50882897",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9948429/"
] | Is you looking for multiple index slice ?
```
df.loc[pd.IndexSlice['bar',:],:]
Out[319]:
0 1 2 3
bar one 0.807706 0.07296 0.638787 0.329646
two -0.497104 -0.75407 -0.943406 0.484752
``` | Since my question was answered by @user2285236 in the comments, I try to summary it.
The method `first()` does not select the first group, but the first entry of every group. The reason why there is no built-in implementation something like `list(df.groupby(level=0))[0][1]` is that `groupby()` method sorts the entrie... |
39,988 | The `Devices menu` -> `CD/DVD Devices` contains `VBoxGuestAdditions.iso`
**But ticking the above menu option doesn't show any menu to select anything from.**
The `kernel-devel` is already there.
The host is `openSUSE 11.3` 64 bit. The guest is `Slackware 13.37` 32 bit.
What's the way round now? | 2012/06/04 | [
"https://unix.stackexchange.com/questions/39988",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/8706/"
] | You should try [Redmine](http://www.redmine.org/).
>
> Some of the main features of Redmine are:
>
>
>
> ```
> Multiple projects support
> Flexible role based access control
> Flexible issue tracking system
> Gantt chart and calendar
> News, documents & files management
> Feeds & email notifications
> Per project ... | "Trac" might be an option for you.
<http://trac.edgewall.org/> |
18,423,853 | I want to validate url before redirect it using Flask.
My abstract code is here...
```
@app.before_request
def before():
if request.before_url == "http://127.0.0.0:8000":
return redirect("http://127.0.0.1:5000")
```
Do you have any idea?
Thanks in advance. | 2013/08/24 | [
"https://Stackoverflow.com/questions/18423853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1113655/"
] | Use [urlparse (builtin module)](http://docs.python.org/2/library/urlparse.html). Then, use the builtin flask [redirection methods](http://flask.pocoo.org/docs/api/?highlight=redirect#flask.redirect)
```
>>> from urlparse import urlparse
>>> o = urlparse('http://www.cwi.nl:80/%7Eguido/Python.html')
>>> o
ParseResult... | You can do something like this (not tested):
```
@app.route('/<path>')
def redirection(path):
if path == '': # your condition
return redirect('redirect URL')
``` |
18,423,853 | I want to validate url before redirect it using Flask.
My abstract code is here...
```
@app.before_request
def before():
if request.before_url == "http://127.0.0.0:8000":
return redirect("http://127.0.0.1:5000")
```
Do you have any idea?
Thanks in advance. | 2013/08/24 | [
"https://Stackoverflow.com/questions/18423853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1113655/"
] | You can use **urlparse** from **urllib** to parse the url. The function below which checks `scheme`, `netloc` and `path` variables which comes after parsing the url. Supports both Python 2 and 3.
```
try:
# python 3
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
def ur... | You can do something like this (not tested):
```
@app.route('/<path>')
def redirection(path):
if path == '': # your condition
return redirect('redirect URL')
``` |
18,423,853 | I want to validate url before redirect it using Flask.
My abstract code is here...
```
@app.before_request
def before():
if request.before_url == "http://127.0.0.0:8000":
return redirect("http://127.0.0.1:5000")
```
Do you have any idea?
Thanks in advance. | 2013/08/24 | [
"https://Stackoverflow.com/questions/18423853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1113655/"
] | Use [urlparse (builtin module)](http://docs.python.org/2/library/urlparse.html). Then, use the builtin flask [redirection methods](http://flask.pocoo.org/docs/api/?highlight=redirect#flask.redirect)
```
>>> from urlparse import urlparse
>>> o = urlparse('http://www.cwi.nl:80/%7Eguido/Python.html')
>>> o
ParseResult... | You can use **urlparse** from **urllib** to parse the url. The function below which checks `scheme`, `netloc` and `path` variables which comes after parsing the url. Supports both Python 2 and 3.
```
try:
# python 3
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
def ur... |
258,422 | I have developed two web services. The main service is a RESTful service (using DB), and another UI service that uses the RESTful service.
Say I want to test the UI for now (integration tests), every test will makes changes in the prod DB. More then that, if in the RESTful service, there are one-way functions for secu... | 2014/10/08 | [
"https://softwareengineering.stackexchange.com/questions/258422",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/110245/"
] | First of all, you shouldn't be testing against your production database. If you ever need to rerun your tests after the application has gone live (and you *will* need to do that), you run a serious risk of losing or corrupting data that is vital to the business.
So, instead of testing against the production database, ... | Given HATEOAS, you only need to change the base URL for your RESTful service to point the UI service to another implementation of it. So set up a staging version of your UI and test it against a staging version of the data service, making that one change. |
258,422 | I have developed two web services. The main service is a RESTful service (using DB), and another UI service that uses the RESTful service.
Say I want to test the UI for now (integration tests), every test will makes changes in the prod DB. More then that, if in the RESTful service, there are one-way functions for secu... | 2014/10/08 | [
"https://softwareengineering.stackexchange.com/questions/258422",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/110245/"
] | Since you have to do unit testing for the REST API, I would assume you are using mock objects for those, rather than interact directly with the database. This should give you a framework of proper "valid" responses from the API already - what I'm getting at is that when you test, you should know you're in "test mode" (... | Given HATEOAS, you only need to change the base URL for your RESTful service to point the UI service to another implementation of it. So set up a staging version of your UI and test it against a staging version of the data service, making that one change. |
258,422 | I have developed two web services. The main service is a RESTful service (using DB), and another UI service that uses the RESTful service.
Say I want to test the UI for now (integration tests), every test will makes changes in the prod DB. More then that, if in the RESTful service, there are one-way functions for secu... | 2014/10/08 | [
"https://softwareengineering.stackexchange.com/questions/258422",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/110245/"
] | First of all, you shouldn't be testing against your production database. If you ever need to rerun your tests after the application has gone live (and you *will* need to do that), you run a serious risk of losing or corrupting data that is vital to the business.
So, instead of testing against the production database, ... | Since you have to do unit testing for the REST API, I would assume you are using mock objects for those, rather than interact directly with the database. This should give you a framework of proper "valid" responses from the API already - what I'm getting at is that when you test, you should know you're in "test mode" (... |
1,684 | Conosco che alcune parole, come "dito", hanno due forme ("dito", "dita") e due significati: possono avere due articoli determinativi?
Per esempio:
>
> la dita
>
>
> il dita
>
>
> | 2014/02/11 | [
"https://italian.stackexchange.com/questions/1684",
"https://italian.stackexchange.com",
"https://italian.stackexchange.com/users/134/"
] | In italiano ogni nome appartiene a un genere, maschile o femminile. Alcuni nomi cambiano genere passando dal singolare al plurale, l'esempio più famoso è
>
> *il carcere*, *le carceri*
>
>
>
e *i carceri* non è comunemente accettato. Più frequente è il doppio genere al plurale:
1. *il braccio*, *le braccia* (del... | Correggo innanzitutto la tua domanda:
>
> so che alcune parole, come dita, hanno due forme, dita e dito, e due significati. Ma può una sola parola avere due articoli determinativi?
>
>
>
In più ti rispondo:
L'articolo determinativo dipende da come inizia una parola, non dalla sua terminazione. Tra singolare e pl... |
1,684 | Conosco che alcune parole, come "dito", hanno due forme ("dito", "dita") e due significati: possono avere due articoli determinativi?
Per esempio:
>
> la dita
>
>
> il dita
>
>
> | 2014/02/11 | [
"https://italian.stackexchange.com/questions/1684",
"https://italian.stackexchange.com",
"https://italian.stackexchange.com/users/134/"
] | Correggo innanzitutto la tua domanda:
>
> so che alcune parole, come dita, hanno due forme, dita e dito, e due significati. Ma può una sola parola avere due articoli determinativi?
>
>
>
In più ti rispondo:
L'articolo determinativo dipende da come inizia una parola, non dalla sua terminazione. Tra singolare e pl... | L'osso, le ossa (del corpo umano), gli ossi (di animale, ad esempio il pollo arrosto ha gli ossi). |
1,684 | Conosco che alcune parole, come "dito", hanno due forme ("dito", "dita") e due significati: possono avere due articoli determinativi?
Per esempio:
>
> la dita
>
>
> il dita
>
>
> | 2014/02/11 | [
"https://italian.stackexchange.com/questions/1684",
"https://italian.stackexchange.com",
"https://italian.stackexchange.com/users/134/"
] | In italiano ogni nome appartiene a un genere, maschile o femminile. Alcuni nomi cambiano genere passando dal singolare al plurale, l'esempio più famoso è
>
> *il carcere*, *le carceri*
>
>
>
e *i carceri* non è comunemente accettato. Più frequente è il doppio genere al plurale:
1. *il braccio*, *le braccia* (del... | La parola "pneumatico" può usare sia l'articolo "lo" ("lo pneumatico" è la forma ritenuta corretta dai puristi) che l'articolo "il" ("il pneumatico" è tollerato). Al plurale similmente si ha "gli pneumatici / i pneumatici".
Poi a Cremona nessuno direbbe "lo gnocco fritto" ma "il gnocco fritto", ma non lo scriverei mai... |
1,684 | Conosco che alcune parole, come "dito", hanno due forme ("dito", "dita") e due significati: possono avere due articoli determinativi?
Per esempio:
>
> la dita
>
>
> il dita
>
>
> | 2014/02/11 | [
"https://italian.stackexchange.com/questions/1684",
"https://italian.stackexchange.com",
"https://italian.stackexchange.com/users/134/"
] | In italiano ogni nome appartiene a un genere, maschile o femminile. Alcuni nomi cambiano genere passando dal singolare al plurale, l'esempio più famoso è
>
> *il carcere*, *le carceri*
>
>
>
e *i carceri* non è comunemente accettato. Più frequente è il doppio genere al plurale:
1. *il braccio*, *le braccia* (del... | L'osso, le ossa (del corpo umano), gli ossi (di animale, ad esempio il pollo arrosto ha gli ossi). |
1,684 | Conosco che alcune parole, come "dito", hanno due forme ("dito", "dita") e due significati: possono avere due articoli determinativi?
Per esempio:
>
> la dita
>
>
> il dita
>
>
> | 2014/02/11 | [
"https://italian.stackexchange.com/questions/1684",
"https://italian.stackexchange.com",
"https://italian.stackexchange.com/users/134/"
] | In italiano ogni nome appartiene a un genere, maschile o femminile. Alcuni nomi cambiano genere passando dal singolare al plurale, l'esempio più famoso è
>
> *il carcere*, *le carceri*
>
>
>
e *i carceri* non è comunemente accettato. Più frequente è il doppio genere al plurale:
1. *il braccio*, *le braccia* (del... | There are a few different ways the same (orthographic) word can take two different gendered articles:
### Homographs
Some non-cognate words of distinct genders are coincidentally spelled identically:
* *il boa* / *la boa*
* *il lama* / *la lama*
others are cognate but have different genders for different (often rel... |
1,684 | Conosco che alcune parole, come "dito", hanno due forme ("dito", "dita") e due significati: possono avere due articoli determinativi?
Per esempio:
>
> la dita
>
>
> il dita
>
>
> | 2014/02/11 | [
"https://italian.stackexchange.com/questions/1684",
"https://italian.stackexchange.com",
"https://italian.stackexchange.com/users/134/"
] | La parola "pneumatico" può usare sia l'articolo "lo" ("lo pneumatico" è la forma ritenuta corretta dai puristi) che l'articolo "il" ("il pneumatico" è tollerato). Al plurale similmente si ha "gli pneumatici / i pneumatici".
Poi a Cremona nessuno direbbe "lo gnocco fritto" ma "il gnocco fritto", ma non lo scriverei mai... | L'osso, le ossa (del corpo umano), gli ossi (di animale, ad esempio il pollo arrosto ha gli ossi). |
1,684 | Conosco che alcune parole, come "dito", hanno due forme ("dito", "dita") e due significati: possono avere due articoli determinativi?
Per esempio:
>
> la dita
>
>
> il dita
>
>
> | 2014/02/11 | [
"https://italian.stackexchange.com/questions/1684",
"https://italian.stackexchange.com",
"https://italian.stackexchange.com/users/134/"
] | There are a few different ways the same (orthographic) word can take two different gendered articles:
### Homographs
Some non-cognate words of distinct genders are coincidentally spelled identically:
* *il boa* / *la boa*
* *il lama* / *la lama*
others are cognate but have different genders for different (often rel... | L'osso, le ossa (del corpo umano), gli ossi (di animale, ad esempio il pollo arrosto ha gli ossi). |
28,492 | How does IE register ActiveX controls for use in the browser?
Does it just run regsvr32 for the DLL? | 2009/08/24 | [
"https://superuser.com/questions/28492",
"https://superuser.com",
"https://superuser.com/users/2503/"
] | ActiveX components register themselves, triggered by a well known DLL entry point (`DllRegisterServer`).
`regsvr32` is just a wrapper around loading the DLL and calling that entry point. Other tools can do this directly. Installers sometimes just directly update the registry (having recorded the changes to make when b... | My understanding is that it uses some of the underlying APIs that regsvr32 uses, but it doesn't call the regsvr.exe. ActiveX controls are composed of a file on disk, typically a .DLL file, and some registry entries. The registry entries are used to lookup the the location of the actual executable code since the browser... |
28,492 | How does IE register ActiveX controls for use in the browser?
Does it just run regsvr32 for the DLL? | 2009/08/24 | [
"https://superuser.com/questions/28492",
"https://superuser.com",
"https://superuser.com/users/2503/"
] | My understanding is that it uses some of the underlying APIs that regsvr32 uses, but it doesn't call the regsvr.exe. ActiveX controls are composed of a file on disk, typically a .DLL file, and some registry entries. The registry entries are used to lookup the the location of the actual executable code since the browser... | It actually doesn't have to do any of these things; the CAB file specifies what it will actually do. It may use DllRegisterServer, and indeed this is the most common thing, but it could also launch an MSI or EXE installer that may register the ActiveX control in another way. |
28,492 | How does IE register ActiveX controls for use in the browser?
Does it just run regsvr32 for the DLL? | 2009/08/24 | [
"https://superuser.com/questions/28492",
"https://superuser.com",
"https://superuser.com/users/2503/"
] | ActiveX components register themselves, triggered by a well known DLL entry point (`DllRegisterServer`).
`regsvr32` is just a wrapper around loading the DLL and calling that entry point. Other tools can do this directly. Installers sometimes just directly update the registry (having recorded the changes to make when b... | It actually doesn't have to do any of these things; the CAB file specifies what it will actually do. It may use DllRegisterServer, and indeed this is the most common thing, but it could also launch an MSI or EXE installer that may register the ActiveX control in another way. |
94,357 | I'm using i8n to host a bilingual site and I only like to display the inactive language in the top bar. What php code do I need to detect the current language so I place the inactive language in the template?
Thanks:
```
<a href=
<?php
global $language;
if (($language -> name) == 'English') {
print "\"http://www.ma... | 2013/11/15 | [
"https://drupal.stackexchange.com/questions/94357",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/23730/"
] | Use the global variable `$language`
<https://api.drupal.org/api/drupal/developer%21globals.php/global/language/7> | If you are planning to use the existing **Language switcher** block of Drupal which links directly to the translated page(s) on a multilingual website, here is some sample code to remove the active language from the list.
You can add this code in the `template.php` of your theme. Replace `YOURTHEME` with the name of y... |
35,059,719 | I have created a channel on Azure Media Services, I correctly configured it as an RTMP channel and streamed a live video with Android + FFMpeg libraries.
The problem is the client end-point latency.
I need a maximum latency ~2 seconds, but now I have about ~25 seconds!
I'm using Azure Media Player in a browser page... | 2016/01/28 | [
"https://Stackoverflow.com/questions/35059719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2014144/"
] | You have used `AutoSize` and explicit label size setting at the same time, this makes no sense.
If you want to enable word wrapping in your label text - you have to set `dynamiclabel1.AutoSize = false;` first and then increase its `Height`. Currently it has only 14 pixels of height so it is impossible to make text mul... | If you increase the height, and want less rows, set the Width property to something bigger;
```
dynamiclabel1.Width = 150;
``` |
35,059,719 | I have created a channel on Azure Media Services, I correctly configured it as an RTMP channel and streamed a live video with Android + FFMpeg libraries.
The problem is the client end-point latency.
I need a maximum latency ~2 seconds, but now I have about ~25 seconds!
I'm using Azure Media Player in a browser page... | 2016/01/28 | [
"https://Stackoverflow.com/questions/35059719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2014144/"
] | You have used `AutoSize` and explicit label size setting at the same time, this makes no sense.
If you want to enable word wrapping in your label text - you have to set `dynamiclabel1.AutoSize = false;` first and then increase its `Height`. Currently it has only 14 pixels of height so it is impossible to make text mul... | If you want to select the number of lines depending on font/text size, you can do something like this:
```
Label dynamiclabel1 = new Label();
dynamiclabel1.Location = new Point(280, 90);
dynamiclabel1.Name = "lblid";
dynamiclabel1.Size = new Size(150, 100);
dynamiclabel1.Text = "Smith had omitted the paragraph in ques... |
35,059,719 | I have created a channel on Azure Media Services, I correctly configured it as an RTMP channel and streamed a live video with Android + FFMpeg libraries.
The problem is the client end-point latency.
I need a maximum latency ~2 seconds, but now I have about ~25 seconds!
I'm using Azure Media Player in a browser page... | 2016/01/28 | [
"https://Stackoverflow.com/questions/35059719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2014144/"
] | ```
Label dynamiclabel = new Label();
dynamiclabel.Location = new Point(38, 30);
dynamiclabel.Name = "lbl_ques";
dynamiclabel.Text = question;
//dynamiclabel.AutoSize = true;
dynamiclabel.Size = new System.Drawing.Size(900, 26);
dynamic... | You have used `AutoSize` and explicit label size setting at the same time, this makes no sense.
If you want to enable word wrapping in your label text - you have to set `dynamiclabel1.AutoSize = false;` first and then increase its `Height`. Currently it has only 14 pixels of height so it is impossible to make text mul... |
35,059,719 | I have created a channel on Azure Media Services, I correctly configured it as an RTMP channel and streamed a live video with Android + FFMpeg libraries.
The problem is the client end-point latency.
I need a maximum latency ~2 seconds, but now I have about ~25 seconds!
I'm using Azure Media Player in a browser page... | 2016/01/28 | [
"https://Stackoverflow.com/questions/35059719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2014144/"
] | If you increase the height, and want less rows, set the Width property to something bigger;
```
dynamiclabel1.Width = 150;
``` | If you want to select the number of lines depending on font/text size, you can do something like this:
```
Label dynamiclabel1 = new Label();
dynamiclabel1.Location = new Point(280, 90);
dynamiclabel1.Name = "lblid";
dynamiclabel1.Size = new Size(150, 100);
dynamiclabel1.Text = "Smith had omitted the paragraph in ques... |
35,059,719 | I have created a channel on Azure Media Services, I correctly configured it as an RTMP channel and streamed a live video with Android + FFMpeg libraries.
The problem is the client end-point latency.
I need a maximum latency ~2 seconds, but now I have about ~25 seconds!
I'm using Azure Media Player in a browser page... | 2016/01/28 | [
"https://Stackoverflow.com/questions/35059719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2014144/"
] | ```
Label dynamiclabel = new Label();
dynamiclabel.Location = new Point(38, 30);
dynamiclabel.Name = "lbl_ques";
dynamiclabel.Text = question;
//dynamiclabel.AutoSize = true;
dynamiclabel.Size = new System.Drawing.Size(900, 26);
dynamic... | If you increase the height, and want less rows, set the Width property to something bigger;
```
dynamiclabel1.Width = 150;
``` |
35,059,719 | I have created a channel on Azure Media Services, I correctly configured it as an RTMP channel and streamed a live video with Android + FFMpeg libraries.
The problem is the client end-point latency.
I need a maximum latency ~2 seconds, but now I have about ~25 seconds!
I'm using Azure Media Player in a browser page... | 2016/01/28 | [
"https://Stackoverflow.com/questions/35059719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2014144/"
] | ```
Label dynamiclabel = new Label();
dynamiclabel.Location = new Point(38, 30);
dynamiclabel.Name = "lbl_ques";
dynamiclabel.Text = question;
//dynamiclabel.AutoSize = true;
dynamiclabel.Size = new System.Drawing.Size(900, 26);
dynamic... | If you want to select the number of lines depending on font/text size, you can do something like this:
```
Label dynamiclabel1 = new Label();
dynamiclabel1.Location = new Point(280, 90);
dynamiclabel1.Name = "lblid";
dynamiclabel1.Size = new Size(150, 100);
dynamiclabel1.Text = "Smith had omitted the paragraph in ques... |
44,123,504 | I hope to make some Class D heritage and implements all properties and methods of Interfaces A,B and C. Please help-me with an example in Delphi.
I use Delphi Xe7
**How One class Implement Many Interfaces?**
I'm trying something like:
```
Unit1
Type
IRefresher = Interface
['{B289720C-FFA4-4652-9F16-0826550DF... | 2017/05/22 | [
"https://Stackoverflow.com/questions/44123504",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6695319/"
] | Try this:
```
success: function (result) {alert(JSON.stringify(result)); }
```
From the error you have posted in comments below, it appears Dictionary is not serializable. Try setting `AllowGet` as mentioned in other answers. If doesn't work, you will need to convert Dictionary to some other object that is seri... | You should add JsonBehavious if you are not getting values.
return Json(returnValue, JsonRequestBehavior.AllowGet); |
44,123,504 | I hope to make some Class D heritage and implements all properties and methods of Interfaces A,B and C. Please help-me with an example in Delphi.
I use Delphi Xe7
**How One class Implement Many Interfaces?**
I'm trying something like:
```
Unit1
Type
IRefresher = Interface
['{B289720C-FFA4-4652-9F16-0826550DF... | 2017/05/22 | [
"https://Stackoverflow.com/questions/44123504",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6695319/"
] | Try this:
```
success: function (result) {alert(JSON.stringify(result)); }
```
From the error you have posted in comments below, it appears Dictionary is not serializable. Try setting `AllowGet` as mentioned in other answers. If doesn't work, you will need to convert Dictionary to some other object that is seri... | Try this piece of code :
```
return Json(returnValues, JsonRequestBehavior.AllowGet);
``` |
15,941,999 | Can I set some space inside 'EditText' in the beginning and at the end? If possible, then how? Actually, I have done some customization on my 'EditText' view and now it shows like this, as shown in the below image:

In my case, as you see, in my "description... | 2013/04/11 | [
"https://Stackoverflow.com/questions/15941999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1739882/"
] | Use `padding left` like
`editText.setPadding (int left, int top, int right, int bottom);` | try this code
```
android:paddingLeft="5dp"
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.