qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
12,552,843 | I have a `Localizable.strings` file for my project's i18n, and a lib uses `KYLocalizable.strings`.
I have considered to make `Localizable.strings` "subclass" from `KYLocalizable.strings`, but it cannot as far as I know. So instead, I want to define a function macro like what SDK does:
```
#define NSLocalizedString(ke... | 2012/09/23 | [
"https://Stackoverflow.com/questions/12552843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/904365/"
] | If the key doesn't exist, the string you will receive will be the key itself.
So as long as you suppose you will never use the key as a localized string, you can test if NSLocalizableString returned you the key or not. | Thanks @Xval, I've just figured it myself and here's a simple function (please offer some suggestions if you have a better idea):
```
#define KYLocalizedString(key, comment) \
[[[NSBundle mainBundle] localizedStringForKey:(key) value:nil table:nil] isEqualToString:(key)] ? \
[[NSBundle mainBundle] localizedStringF... |
12,552,843 | I have a `Localizable.strings` file for my project's i18n, and a lib uses `KYLocalizable.strings`.
I have considered to make `Localizable.strings` "subclass" from `KYLocalizable.strings`, but it cannot as far as I know. So instead, I want to define a function macro like what SDK does:
```
#define NSLocalizedString(ke... | 2012/09/23 | [
"https://Stackoverflow.com/questions/12552843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/904365/"
] | If the key doesn't exist, the string you will receive will be the key itself.
So as long as you suppose you will never use the key as a localized string, you can test if NSLocalizableString returned you the key or not. | For Swift:
```
var key = "your_key"
NSBundle.mainBundle().localizedStringForKey(key,
value: NSBundle.mainBundle().localizedStringForKey(key, value:"", table: nil),
table: "Your_Custom_Localizable_File")
```
Just to clarify thin... |
12,552,843 | I have a `Localizable.strings` file for my project's i18n, and a lib uses `KYLocalizable.strings`.
I have considered to make `Localizable.strings` "subclass" from `KYLocalizable.strings`, but it cannot as far as I know. So instead, I want to define a function macro like what SDK does:
```
#define NSLocalizedString(ke... | 2012/09/23 | [
"https://Stackoverflow.com/questions/12552843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/904365/"
] | If the key doesn't exist, the string you will receive will be the key itself.
So as long as you suppose you will never use the key as a localized string, you can test if NSLocalizableString returned you the key or not. | I wrote this handy extension for localized strings, so you can just use the `localized()` function to get the localized string(you can also pass arguments) and the `isLocalized` computed property to check whether the string is localized or not:
```
extension String {
var isLocalized: Bool {
return localiz... |
12,552,843 | I have a `Localizable.strings` file for my project's i18n, and a lib uses `KYLocalizable.strings`.
I have considered to make `Localizable.strings` "subclass" from `KYLocalizable.strings`, but it cannot as far as I know. So instead, I want to define a function macro like what SDK does:
```
#define NSLocalizedString(ke... | 2012/09/23 | [
"https://Stackoverflow.com/questions/12552843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/904365/"
] | In this call:
```
[[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]
```
The **value** parameter (currently an empty string) will be used if a string can't be located in your strings file using the specified key. So... all you should need to do is place your second lookup to *KYLocalizable.strin... | Thanks @Xval, I've just figured it myself and here's a simple function (please offer some suggestions if you have a better idea):
```
#define KYLocalizedString(key, comment) \
[[[NSBundle mainBundle] localizedStringForKey:(key) value:nil table:nil] isEqualToString:(key)] ? \
[[NSBundle mainBundle] localizedStringF... |
12,552,843 | I have a `Localizable.strings` file for my project's i18n, and a lib uses `KYLocalizable.strings`.
I have considered to make `Localizable.strings` "subclass" from `KYLocalizable.strings`, but it cannot as far as I know. So instead, I want to define a function macro like what SDK does:
```
#define NSLocalizedString(ke... | 2012/09/23 | [
"https://Stackoverflow.com/questions/12552843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/904365/"
] | In this call:
```
[[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]
```
The **value** parameter (currently an empty string) will be used if a string can't be located in your strings file using the specified key. So... all you should need to do is place your second lookup to *KYLocalizable.strin... | For Swift:
```
var key = "your_key"
NSBundle.mainBundle().localizedStringForKey(key,
value: NSBundle.mainBundle().localizedStringForKey(key, value:"", table: nil),
table: "Your_Custom_Localizable_File")
```
Just to clarify thin... |
12,552,843 | I have a `Localizable.strings` file for my project's i18n, and a lib uses `KYLocalizable.strings`.
I have considered to make `Localizable.strings` "subclass" from `KYLocalizable.strings`, but it cannot as far as I know. So instead, I want to define a function macro like what SDK does:
```
#define NSLocalizedString(ke... | 2012/09/23 | [
"https://Stackoverflow.com/questions/12552843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/904365/"
] | In this call:
```
[[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]
```
The **value** parameter (currently an empty string) will be used if a string can't be located in your strings file using the specified key. So... all you should need to do is place your second lookup to *KYLocalizable.strin... | I wrote this handy extension for localized strings, so you can just use the `localized()` function to get the localized string(you can also pass arguments) and the `isLocalized` computed property to check whether the string is localized or not:
```
extension String {
var isLocalized: Bool {
return localiz... |
59,763 | I'm struggling with figuring out a way to describe subtle movements in a scene that wouldn't normally be picked up on if not shown. For example:
>
> A character is being put in a prison cell and another
> character slips them a key or a small pin behind their back.
>
>
>
Or:
>
> Like in the movie Gladiator, whe... | 2021/12/12 | [
"https://writers.stackexchange.com/questions/59763",
"https://writers.stackexchange.com",
"https://writers.stackexchange.com/users/49129/"
] | I think you just reveal it to the audience (reader or viewer). I think you have to, or you will create a deus ex machina; the audience will say "WTF? How did he get an arrowhead?!?"
In a movie script, this would be Action description; no dialogue is spoken. (In fact in movies visually passed information without any di... | Go Bold or Go Home or Be Chill Little Fonzies
---------------------------------------------
The examples you cite from movies take great pains to ensure the audience knows what action the character. It's only implied to be subtle from the in-world characters sharing the stage with Maximus.
From the storytelling viewp... |
59,763 | I'm struggling with figuring out a way to describe subtle movements in a scene that wouldn't normally be picked up on if not shown. For example:
>
> A character is being put in a prison cell and another
> character slips them a key or a small pin behind their back.
>
>
>
Or:
>
> Like in the movie Gladiator, whe... | 2021/12/12 | [
"https://writers.stackexchange.com/questions/59763",
"https://writers.stackexchange.com",
"https://writers.stackexchange.com/users/49129/"
] | I think you just reveal it to the audience (reader or viewer). I think you have to, or you will create a deus ex machina; the audience will say "WTF? How did he get an arrowhead?!?"
In a movie script, this would be Action description; no dialogue is spoken. (In fact in movies visually passed information without any di... | **Don't go for the obvious.**
You want to describe a subtle, but highly significant action, don't describe the action. Describe the effects.
Your about-to-be-imprisoned character might feel cold metal against their palm which quickly closes around the object, releasing a surge of hope. They look down, wary of reveali... |
122,754 | I understand that for low cross-section events a very high luminosity is necessary in order to obtain enough data to produce meaningful statistics. That is why the [LHC](http://en.wikipedia.org/wiki/Large_Hadron_Collider) was built.
But which are these event which we are interested in? What are the events which would ... | 2014/07/02 | [
"https://physics.stackexchange.com/questions/122754",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/52636/"
] | The history of high energy physics is in the words "high energy" . There are two ways to get it, building higher and higher energy accelerators or studying cosmic rays, [which last has answers in another question.](https://physics.stackexchange.com/questions/33565/why-not-using-cosmic-rays-to-study-hep-since-they-are-w... | As pfnuessel said in his comment: The first thing to look at was the Higgs - there were hints from LEP and Tevatron, but no evidence, so the LHC was designed that the (SM-)Higgs has to be seen, if it exists.
And for everything beyond the Higgs - we don't know! There are various theories, e.g. the different flavors of ... |
58,054,080 | I have two different custom TableView Cells. That said, when the first cell type is returned, I want the other returned immediately after. Technically, the below code is what I want to occur:
```
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
ChatTable... | 2019/09/22 | [
"https://Stackoverflow.com/questions/58054080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3030060/"
] | You can only return one specific type at a time. Use the `indexPath` parameter to decide which one to return.
The following code is a rough idea of what you need. It's up to you to adapt the `if` statement based on your actual needs.
```
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N... | Your question is very interesting. First clarify your needs.
I guess your demand is probably like this, and once the layout is displayed, switch to another layout. Let me talk about my habit of using tables. I am used to using data to control display and animation behavior. For your needs, I can use two data sources, ... |
58,054,080 | I have two different custom TableView Cells. That said, when the first cell type is returned, I want the other returned immediately after. Technically, the below code is what I want to occur:
```
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
ChatTable... | 2019/09/22 | [
"https://Stackoverflow.com/questions/58054080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3030060/"
] | You can only return one specific type at a time. Use the `indexPath` parameter to decide which one to return.
The following code is a rough idea of what you need. It's up to you to adapt the `if` statement based on your actual needs.
```
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N... | You cannot return two custom cells at the same time. It is not possible, because the delegate only runs one time per row. You can return a different cell on a different row or section. |
21,590,875 | We have 2 queries on an SSRS report .
One query returns a single number that is a total record count.
The other query returns a single column that we'd like to divide by the total returned in the first query.
So
Query 1 DATASET (this will always return a single value)
```
TOTAL
100
```
Query 2 DATASET (this ... | 2014/02/05 | [
"https://Stackoverflow.com/questions/21590875",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2714083/"
] | If you don't want to combine your datasets, you can do the following to achieve your end result.
For the dataset that returns a single value, you could create a report parameter (@MyParam) that is hidden and is populated by your dataset Query1. Your dataset for Query2 can remain as it was. Then you can use the follow... | Why not do one data set? Err...I assume you want to see 49/100 and not .49 with this answer
```
select q2.A + '/' + q1.value as 'output'
from query2 q2, query1 q1
```
It's a cross join and applies q1 values to all q2 (since q1 is just one value, this'll work)...query1 and query 2 can be replaced with whatever querie... |
9,975,649 | In windows phone I have installed adobe reader its very nice but I am not able to jump to particular page I need to start from the starting . Its very difficult if we are reading book please any one have any solution for that. | 2012/04/02 | [
"https://Stackoverflow.com/questions/9975649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1292348/"
] | (reposting my comment as an answer for your approval so this question can get marked as answered):
There is not a good way to do this out of the box. Are you willing to look at using a third party app to accomplish this? Unfortunately I see it as your only option right now. Downside is that you cannot install an app t... | Maybe you could try and ebook reader for windows phone 7:
<http://www.mobiletechworld.com/2011/03/20/samsung-ebook-reader-for-windows-phone-7-hands-on-video-review/>
If it isnt what youre looking for just google for ebook reader,
cheers :) |
9,975,649 | In windows phone I have installed adobe reader its very nice but I am not able to jump to particular page I need to start from the starting . Its very difficult if we are reading book please any one have any solution for that. | 2012/04/02 | [
"https://Stackoverflow.com/questions/9975649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1292348/"
] | The latest adobe reader version released for the windows phone is working fine. We can go to particular pages also many advancement. SO the problem no more exist. | Maybe you could try and ebook reader for windows phone 7:
<http://www.mobiletechworld.com/2011/03/20/samsung-ebook-reader-for-windows-phone-7-hands-on-video-review/>
If it isnt what youre looking for just google for ebook reader,
cheers :) |
9,975,649 | In windows phone I have installed adobe reader its very nice but I am not able to jump to particular page I need to start from the starting . Its very difficult if we are reading book please any one have any solution for that. | 2012/04/02 | [
"https://Stackoverflow.com/questions/9975649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1292348/"
] | (reposting my comment as an answer for your approval so this question can get marked as answered):
There is not a good way to do this out of the box. Are you willing to look at using a third party app to accomplish this? Unfortunately I see it as your only option right now. Downside is that you cannot install an app t... | The latest adobe reader version released for the windows phone is working fine. We can go to particular pages also many advancement. SO the problem no more exist. |
2,356,965 | My application includes a client, web tier (load balanced), application tier (load balanced), and database tier. The web tier exposes services to clients, and forwards calls onto the application tier. The application tier then executes queries against the database (using NHibernate) and returns the results.
Data is mo... | 2010/03/01 | [
"https://Stackoverflow.com/questions/2356965",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5380/"
] | Define 2 cache regions "aggregation" and "aggregation.today" with a large expiry time. Use these for your aggregation queries for previous days and today respectively.
In `DoIt()`, make 1 NH query per day in the requested range using cacheable queries. Combine the query results in C#.
Prime the cache with a backgroun... | When analyzing the NHibernate cache details i remember reading something that you should not relay on the cache being there, witch seems a good suggestion.
Instead of trying to make your O/R Mapper cover your applications needs i think rolling your own data/cache management strategy might be more reasonable.
Also t... |
2,356,965 | My application includes a client, web tier (load balanced), application tier (load balanced), and database tier. The web tier exposes services to clients, and forwards calls onto the application tier. The application tier then executes queries against the database (using NHibernate) and returns the results.
Data is mo... | 2010/03/01 | [
"https://Stackoverflow.com/questions/2356965",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5380/"
] | Stop using your transactional ( OLTP ) datasource for analytical ( OLAP ) queries and the problem goes away.
When a domain significant event occurs (eg a new entity enters the system or is updated), fire an event ( a la domain events ). Wire up a handler for the event that takes the details of the created or updated e... | Define 2 cache regions "aggregation" and "aggregation.today" with a large expiry time. Use these for your aggregation queries for previous days and today respectively.
In `DoIt()`, make 1 NH query per day in the requested range using cacheable queries. Combine the query results in C#.
Prime the cache with a backgroun... |
2,356,965 | My application includes a client, web tier (load balanced), application tier (load balanced), and database tier. The web tier exposes services to clients, and forwards calls onto the application tier. The application tier then executes queries against the database (using NHibernate) and returns the results.
Data is mo... | 2010/03/01 | [
"https://Stackoverflow.com/questions/2356965",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5380/"
] | Stop using your transactional ( OLTP ) datasource for analytical ( OLAP ) queries and the problem goes away.
When a domain significant event occurs (eg a new entity enters the system or is updated), fire an event ( a la domain events ). Wire up a handler for the event that takes the details of the created or updated e... | When analyzing the NHibernate cache details i remember reading something that you should not relay on the cache being there, witch seems a good suggestion.
Instead of trying to make your O/R Mapper cover your applications needs i think rolling your own data/cache management strategy might be more reasonable.
Also t... |
65,796,518 | First post here, so apologies if I break any etiquette. If something is missing please let me know so I can edit my post if needed.
I'm currently working on an Excel macro, which enables me to import an interactive pdf form into excel and read data that was written in the form. Most of the script I have down by findin... | 2021/01/19 | [
"https://Stackoverflow.com/questions/65796518",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15038077/"
] | In your view you can use `self.request` (because you are using class-based-views) instead of just `request`.
```py
class BlogView(LoginRequiredMixin, DetailView):
def get_context_data(self, **kwargs):
...
user = self.request.user
blog_post = get_object_or_404(BlogPost, slug=self.kwargs['slu... | you can do it in the html like
```
{{q_search_customers.count}}
``` |
3,606,538 | We're thinking about switching technology for our future projects going from C++ to Java or C#. So naturally there's a big discussion going on right now what to choose. The problem is that none of us has industry experience with EMF or RCP, which would be quite nice to have if it fits our needs.
so i wanted to ask you... | 2010/08/31 | [
"https://Stackoverflow.com/questions/3606538",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/435608/"
] | As Java developer I can't say much about C#, but I can give you an overview about the Java side: There are sevaral good choices for RCP (the most prominent is of course Eclipse, but there are others as NetBeans). The learning curve is quite steep, but once you have the "hello world" running, it gets much easier. GUI-pr... | I'm not familiar at all with EMF and RCP, but from what I gathered in a quick glance, there are cetainly 'equivalents' in .Net. However I'm heavily biased so don't take my word for it.
There are tools from generating data classes from xml/xsd and vice-versa (xsd.exe), graphical integrated modeling tools inside Visual ... |
3,606,538 | We're thinking about switching technology for our future projects going from C++ to Java or C#. So naturally there's a big discussion going on right now what to choose. The problem is that none of us has industry experience with EMF or RCP, which would be quite nice to have if it fits our needs.
so i wanted to ask you... | 2010/08/31 | [
"https://Stackoverflow.com/questions/3606538",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/435608/"
] | As Java developer I can't say much about C#, but I can give you an overview about the Java side: There are sevaral good choices for RCP (the most prominent is of course Eclipse, but there are others as NetBeans). The learning curve is quite steep, but once you have the "hello world" running, it gets much easier. GUI-pr... | For the bulk of the application I highly recommend Eclipse RCP + EMF (Eclipse RAP is also a plus as you can single source the application and get a web-based rich Ajax application "for free").
If you need to access native features you can always write it in another language or use JNI, or implement a form of IPC or us... |
46,841,723 | So this is a doubly linked list that is supposed to hold names, address, and phone numbe and print them out. It works for the first 3 nodes then suddenly crashes after the the phone number entry on the third node. something is wrong with the pointers I believe but I have tried everything I can think of.
```
#inclu... | 2017/10/20 | [
"https://Stackoverflow.com/questions/46841723",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8692871/"
] | There are several issues.
1. If you use `addFrontNode()` to add first node, you must set your `tail`.
Change this:
```
v->next = head;
head = v;
```
To this:
```
v->next = NULL;
head = v;
tail = v;
```
2. Your function `addNode()` doesn't add to list correctly, try calling `print` and you will see, no node is a... | The code is indeed in need of re-write, but I don't want to repeat recommendations from the first answer. I however, believe that the question was about the reasons of the crash. It's because while copy-pasting the code, you added 2 extra lines to your addNode2:
```
void linkedList::addNode2(node* nextloc, const strin... |
273,816 | This is an example in the textbook.
>
> To prove: for any real number\*\* $a\_1, a\_2, \cdots, a\_n, b\_1, b\_2, \cdots b\_n$, linear dependence of the two vectors $\left(a\_1, a\_2, \cdots, a\_n\right)$ and $\left(b\_1, b\_2, \cdots, b\_n\right)$ is a necessary and sufficient condition for the equality:
>
>
> $\le... | 2022/09/22 | [
"https://mathematica.stackexchange.com/questions/273816",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/69835/"
] | I use `l`, `m`, `r` for the left, middle, right robots respectively. Each can take the values $-1,0,1$ with the following interpretation:
```
truthteller[x_]:=(x==1);
joker[x_]:=(x==0);
liar[x_]:=(x==-1);
```
Using
```
claim[who_,what_]:=And[Implies[truthteller[who],what],
Implies[liar[who],N... | Thanks for the solution from user293787. It is very helpful to me.
After a lot of effort, I also worked out a way myself to solve this.
I define l, m, r as Roberts at left, middle, and right. t as truth-teller, i as liar, and h as hesitater. So, for example, "lt" means the proposition that "left Robert is a truth-tel... |
168,541 | Given positive integers \$w\$ and \$h\$ output \$w\$ columns and \$h\$ rows of text as described below.
The first row begins with 11 `0`s, the second row with 10 `1`s, third with nine `2`s and so on down the the tenth row with two `9`s. On each of these first ten rows, following the initial run of consecutive digits, ... | 2018/07/13 | [
"https://codegolf.stackexchange.com/questions/168541",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/75553/"
] | [C (gcc)](https://gcc.gnu.org/), ~~101~~ ~~100~~ 99 bytes
=========================================================
* Saved a byte thanks to [pizzapants184](https://codegolf.stackexchange.com/users/44694/pizzapants184).
* Saved a byte.
```c
s,t;a(i,r){for(t=~0;++t<r;puts(""))for(s=0;s<i;putchar(48+(t+(s>10-t)*(10*s+9... | [Charcoal](https://github.com/somebody1234/Charcoal), ~~20~~ 17 bytes
=====================================================================
```
Eη⭆θ﹪⌊⟦ι÷⁺⁻ιλχ²⟧χ
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMM3sUAjQ0chuATISwdxCnUUfPNTSnPyNXwz8zJzS3M1ojN1FDzzSlwyyzJTUjUCckqLQVJAEiieo6mjYGgAJIw0YyFMELD@... |
168,541 | Given positive integers \$w\$ and \$h\$ output \$w\$ columns and \$h\$ rows of text as described below.
The first row begins with 11 `0`s, the second row with 10 `1`s, third with nine `2`s and so on down the the tenth row with two `9`s. On each of these first ten rows, following the initial run of consecutive digits, ... | 2018/07/13 | [
"https://codegolf.stackexchange.com/questions/168541",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/75553/"
] | [C (gcc)](https://gcc.gnu.org/), ~~101~~ ~~100~~ 99 bytes
=========================================================
* Saved a byte thanks to [pizzapants184](https://codegolf.stackexchange.com/users/44694/pizzapants184).
* Saved a byte.
```c
s,t;a(i,r){for(t=~0;++t<r;puts(""))for(s=0;s<i;putchar(48+(t+(s>10-t)*(10*s+9... | [Jelly](https://github.com/DennisMitchell/jelly), 19 bytes
==========================================================
Uses a very similar approach to [pizzapants'](https://codegolf.stackexchange.com/a/168544/59487) and [Neil's](https://codegolf.stackexchange.com/a/168548/59487). Saved 1 byte thanks to [Jonathan Allan]... |
168,541 | Given positive integers \$w\$ and \$h\$ output \$w\$ columns and \$h\$ rows of text as described below.
The first row begins with 11 `0`s, the second row with 10 `1`s, third with nine `2`s and so on down the the tenth row with two `9`s. On each of these first ten rows, following the initial run of consecutive digits, ... | 2018/07/13 | [
"https://codegolf.stackexchange.com/questions/168541",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/75553/"
] | [C (gcc)](https://gcc.gnu.org/), ~~101~~ ~~100~~ 99 bytes
=========================================================
* Saved a byte thanks to [pizzapants184](https://codegolf.stackexchange.com/users/44694/pizzapants184).
* Saved a byte.
```c
s,t;a(i,r){for(t=~0;++t<r;puts(""))for(s=0;s<i;putchar(48+(t+(s>10-t)*(10*s+9... | Canvas, 14 bytes
================
```
[⁷{¹∔⁶+»¹m◂@]]
```
[Try it here!](https://dzaima.github.io/Canvas/?u=JXVGRjNCJXUyMDc3JXVGRjVCJUI5JXUyMjE0JXUyMDc2JXVGRjBCJUJCJUI5JXVGRjREJXUyNUMyJXVGRjIwJXVGRjNEJXVGRjNE,i=MTMlMEExNQ__,v=4)
While making this I noticed in several places I had negative modulos in Canvas (here, it... |
168,541 | Given positive integers \$w\$ and \$h\$ output \$w\$ columns and \$h\$ rows of text as described below.
The first row begins with 11 `0`s, the second row with 10 `1`s, third with nine `2`s and so on down the the tenth row with two `9`s. On each of these first ten rows, following the initial run of consecutive digits, ... | 2018/07/13 | [
"https://codegolf.stackexchange.com/questions/168541",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/75553/"
] | [C (gcc)](https://gcc.gnu.org/), ~~101~~ ~~100~~ 99 bytes
=========================================================
* Saved a byte thanks to [pizzapants184](https://codegolf.stackexchange.com/users/44694/pizzapants184).
* Saved a byte.
```c
s,t;a(i,r){for(t=~0;++t<r;puts(""))for(s=0;s<i;putchar(48+(t+(s>10-t)*(10*s+9... | [Jelly](https://github.com/DennisMitchell/jelly), 14 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
====================================================================================================================
```
_@þ:2+6«"J$’%⁵
```
A dyadic link taking \$w\$ on the left and \$h\$ on the righ... |
168,541 | Given positive integers \$w\$ and \$h\$ output \$w\$ columns and \$h\$ rows of text as described below.
The first row begins with 11 `0`s, the second row with 10 `1`s, third with nine `2`s and so on down the the tenth row with two `9`s. On each of these first ten rows, following the initial run of consecutive digits, ... | 2018/07/13 | [
"https://codegolf.stackexchange.com/questions/168541",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/75553/"
] | [C (gcc)](https://gcc.gnu.org/), ~~101~~ ~~100~~ 99 bytes
=========================================================
* Saved a byte thanks to [pizzapants184](https://codegolf.stackexchange.com/users/44694/pizzapants184).
* Saved a byte.
```c
s,t;a(i,r){for(t=~0;++t<r;puts(""))for(s=0;s<i;putchar(48+(t+(s>10-t)*(10*s+9... | [Kotlin](https://kotlinlang.org), 78 bytes
==========================================
```
{w:Int,h:Int->List(h){r->List(w){c->if(c<11-r)r%10
else(r+9*((c-9+r)/2))%10}}}
```
[Try it online!](https://tio.run/##3Vbbbtw2EH3nVzBGC0iJsruym8Q2kgDpBW2AACmSAEWR@oErUSsiEqmSVDZbw9/RD@qHpWeG2rWcC@C3AiV8EYdznzNDvnOxM/bj8q78wWsVd... |
168,541 | Given positive integers \$w\$ and \$h\$ output \$w\$ columns and \$h\$ rows of text as described below.
The first row begins with 11 `0`s, the second row with 10 `1`s, third with nine `2`s and so on down the the tenth row with two `9`s. On each of these first ten rows, following the initial run of consecutive digits, ... | 2018/07/13 | [
"https://codegolf.stackexchange.com/questions/168541",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/75553/"
] | Python 3, ~~94~~ ~~93~~ ~~78~~ ~~77~~ 74 bytes
==============================================
```
lambda x,y:[[[(j-i+10)//2%10,j][j+i<9]for i in range(x)]for j in range(y)]
```
-1 byte from [dylnan](https://codegolf.stackexchange.com/questions/168541/stacked-digit-staircases/168544#comment407367_168544)
-15 bytes by... | [Charcoal](https://github.com/somebody1234/Charcoal), ~~20~~ 17 bytes
=====================================================================
```
Eη⭆θ﹪⌊⟦ι÷⁺⁻ιλχ²⟧χ
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMM3sUAjQ0chuATISwdxCnUUfPNTSnPyNXwz8zJzS3M1ojN1FDzzSlwyyzJTUjUCckqLQVJAEiieo6mjYGgAJIw0YyFMELD@... |
168,541 | Given positive integers \$w\$ and \$h\$ output \$w\$ columns and \$h\$ rows of text as described below.
The first row begins with 11 `0`s, the second row with 10 `1`s, third with nine `2`s and so on down the the tenth row with two `9`s. On each of these first ten rows, following the initial run of consecutive digits, ... | 2018/07/13 | [
"https://codegolf.stackexchange.com/questions/168541",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/75553/"
] | Python 3, ~~94~~ ~~93~~ ~~78~~ ~~77~~ 74 bytes
==============================================
```
lambda x,y:[[[(j-i+10)//2%10,j][j+i<9]for i in range(x)]for j in range(y)]
```
-1 byte from [dylnan](https://codegolf.stackexchange.com/questions/168541/stacked-digit-staircases/168544#comment407367_168544)
-15 bytes by... | [Jelly](https://github.com/DennisMitchell/jelly), 19 bytes
==========================================================
Uses a very similar approach to [pizzapants'](https://codegolf.stackexchange.com/a/168544/59487) and [Neil's](https://codegolf.stackexchange.com/a/168548/59487). Saved 1 byte thanks to [Jonathan Allan]... |
168,541 | Given positive integers \$w\$ and \$h\$ output \$w\$ columns and \$h\$ rows of text as described below.
The first row begins with 11 `0`s, the second row with 10 `1`s, third with nine `2`s and so on down the the tenth row with two `9`s. On each of these first ten rows, following the initial run of consecutive digits, ... | 2018/07/13 | [
"https://codegolf.stackexchange.com/questions/168541",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/75553/"
] | Python 3, ~~94~~ ~~93~~ ~~78~~ ~~77~~ 74 bytes
==============================================
```
lambda x,y:[[[(j-i+10)//2%10,j][j+i<9]for i in range(x)]for j in range(y)]
```
-1 byte from [dylnan](https://codegolf.stackexchange.com/questions/168541/stacked-digit-staircases/168544#comment407367_168544)
-15 bytes by... | Canvas, 14 bytes
================
```
[⁷{¹∔⁶+»¹m◂@]]
```
[Try it here!](https://dzaima.github.io/Canvas/?u=JXVGRjNCJXUyMDc3JXVGRjVCJUI5JXUyMjE0JXUyMDc2JXVGRjBCJUJCJUI5JXVGRjREJXUyNUMyJXVGRjIwJXVGRjNEJXVGRjNE,i=MTMlMEExNQ__,v=4)
While making this I noticed in several places I had negative modulos in Canvas (here, it... |
168,541 | Given positive integers \$w\$ and \$h\$ output \$w\$ columns and \$h\$ rows of text as described below.
The first row begins with 11 `0`s, the second row with 10 `1`s, third with nine `2`s and so on down the the tenth row with two `9`s. On each of these first ten rows, following the initial run of consecutive digits, ... | 2018/07/13 | [
"https://codegolf.stackexchange.com/questions/168541",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/75553/"
] | Python 3, ~~94~~ ~~93~~ ~~78~~ ~~77~~ 74 bytes
==============================================
```
lambda x,y:[[[(j-i+10)//2%10,j][j+i<9]for i in range(x)]for j in range(y)]
```
-1 byte from [dylnan](https://codegolf.stackexchange.com/questions/168541/stacked-digit-staircases/168544#comment407367_168544)
-15 bytes by... | [Jelly](https://github.com/DennisMitchell/jelly), 14 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
====================================================================================================================
```
_@þ:2+6«"J$’%⁵
```
A dyadic link taking \$w\$ on the left and \$h\$ on the righ... |
168,541 | Given positive integers \$w\$ and \$h\$ output \$w\$ columns and \$h\$ rows of text as described below.
The first row begins with 11 `0`s, the second row with 10 `1`s, third with nine `2`s and so on down the the tenth row with two `9`s. On each of these first ten rows, following the initial run of consecutive digits, ... | 2018/07/13 | [
"https://codegolf.stackexchange.com/questions/168541",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/75553/"
] | Python 3, ~~94~~ ~~93~~ ~~78~~ ~~77~~ 74 bytes
==============================================
```
lambda x,y:[[[(j-i+10)//2%10,j][j+i<9]for i in range(x)]for j in range(y)]
```
-1 byte from [dylnan](https://codegolf.stackexchange.com/questions/168541/stacked-digit-staircases/168544#comment407367_168544)
-15 bytes by... | [Kotlin](https://kotlinlang.org), 78 bytes
==========================================
```
{w:Int,h:Int->List(h){r->List(w){c->if(c<11-r)r%10
else(r+9*((c-9+r)/2))%10}}}
```
[Try it online!](https://tio.run/##3Vbbbtw2EH3nVzBGC0iJsruym8Q2kgDpBW2AACmSAEWR@oErUSsiEqmSVDZbw9/RD@qHpWeG2rWcC@C3AiV8EYdznzNDvnOxM/bj8q78wWsVd... |
31,955 | To the best of my knowledge, energy equals work, $\mathrm{E = W}$; work equals force multiplied by distance, $\mathrm{W = Fm}$ ; force equals mass multiplied by acceleration, $\mathrm{F = MA}$; and acceleration equals distance per second squared, $\mathrm{A = m \setminus s^2}$. However, when I substitute those values i... | 2015/05/24 | [
"https://chemistry.stackexchange.com/questions/31955",
"https://chemistry.stackexchange.com",
"https://chemistry.stackexchange.com/users/15929/"
] | The kinetic energy $E\_\text{k}$ equals the work $W$ done on an object:
$$E\_\text{k}=W$$
The work $W$ is the result of a force $F$ on a distance $s$. If $F$ is constant, the work $W$ is equal to the force $F$ multiplied by the distance $s$:
$$W=Fs$$
The force $F$ on an object is equal to the mass $m$ of that object mu... | @Loong's answer is perfect but I just want to show another method which can be used even if the acceleration is **not** uniform.
$$a=\frac{dv}{dt} = \frac{dv}{dx} \times \frac{dx}{dt}$$
Hence $$a=v\frac{dv}{dx}$$
Force is mass times acceleration.
Hence $$F=ma=mv \frac{dv}{dx}$$
For a small distance $dx$ moved, the ... |
5,838,764 | I'm working on a function that takes filepaths and dices them up into smaller sections.
For example, if the input parameter was "cd mypath/mystuff/stack/overflow/string", I want to be able to return "cd" "mypath", "mystuff", "stack", "overflow", and "string" in succession.
While I could simply continually use "getcha... | 2011/04/30 | [
"https://Stackoverflow.com/questions/5838764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/355682/"
] | You can use the `char * strtok ( char * str, const char * delimiters );` using `/` as separator.
An example here:
<http://www.cplusplus.com/reference/clibrary/cstring/strtok/>
```
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char* argv[]) {
if (argc != 2) {
fprintf(stderr, "Usa... | Here's an example of how `sscanf()` can stop after a certain character.
```
sscanf("abcd/efgh", "%[^/]", &buf);
printf("%s\n", buf);
```
Should produce
```
abcd
```
EDIT: You could try something like this to advance sscanf() input. I have not tested this for various edge cases, but it should get the idea across.
... |
5,838,764 | I'm working on a function that takes filepaths and dices them up into smaller sections.
For example, if the input parameter was "cd mypath/mystuff/stack/overflow/string", I want to be able to return "cd" "mypath", "mystuff", "stack", "overflow", and "string" in succession.
While I could simply continually use "getcha... | 2011/04/30 | [
"https://Stackoverflow.com/questions/5838764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/355682/"
] | You can use the `char * strtok ( char * str, const char * delimiters );` using `/` as separator.
An example here:
<http://www.cplusplus.com/reference/clibrary/cstring/strtok/>
```
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char* argv[]) {
if (argc != 2) {
fprintf(stderr, "Usa... | Here is an example using regcomp, regexec. Compile and run it with the first arg being the character you are searching on, while the second arg is the string to search.
For example, a.out X abcXdefXghiXjkl will print abc def ghi jkl on separate lines.
```
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#in... |
5,838,764 | I'm working on a function that takes filepaths and dices them up into smaller sections.
For example, if the input parameter was "cd mypath/mystuff/stack/overflow/string", I want to be able to return "cd" "mypath", "mystuff", "stack", "overflow", and "string" in succession.
While I could simply continually use "getcha... | 2011/04/30 | [
"https://Stackoverflow.com/questions/5838764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/355682/"
] | Here's an example of how `sscanf()` can stop after a certain character.
```
sscanf("abcd/efgh", "%[^/]", &buf);
printf("%s\n", buf);
```
Should produce
```
abcd
```
EDIT: You could try something like this to advance sscanf() input. I have not tested this for various edge cases, but it should get the idea across.
... | Here is an example using regcomp, regexec. Compile and run it with the first arg being the character you are searching on, while the second arg is the string to search.
For example, a.out X abcXdefXghiXjkl will print abc def ghi jkl on separate lines.
```
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#in... |
338,195 | I have a big .gz file. I would like to split it into 100 smaller gzip files, that can each be decompressed by itself. In other words: I am not looking for a way of chopping up the .gz file into chunks that would have to be put back together to be able to decompress it. I want to be able to decompress each of the smalle... | 2017/01/17 | [
"https://unix.stackexchange.com/questions/338195",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/2972/"
] | Split and join of the big file works, but it is impossible to decompress pieces of the compressed file, because essential informations are distributed through the whole dataset. Another way; split the uncompressed file and compress the single parts. Now you can decompress each pieces. But why? You have to merge all dec... | Except my error, i think this is not possible, without alterate your file in losing the ability to rebuild and decompress the big file because you will lose the metadata (header and tail) from the first big file compress and those metadata don't exist for each of your small file.
But you could create a wrapper that co... |
47,606,668 | I have two main html elements. First one is a group of options, the second is a `ul` where I display the content, like this:
```
<optgroup style="display:none;" class="groupOfOptions">
<option value="15" data-upsell="presentation1">
Item 1
</option>
<option value="3" data-upsell="presentation2">
Item 2
... | 2017/12/02 | [
"https://Stackoverflow.com/questions/47606668",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | There are too many questions and they are too generic. But in most cases:
1. No way
2. it's up to you, your app's logic and particular case. Say if there is water leak somewhere in the city is it expected to stop water supply system completely? Typically there is concrete module/part that does not make sense to proces... | 1. Only if you have a certain scenario to handle a particular error. For example, a duplicated unique key, for which you have a fall-back scenario. (note that you should always check for this particular error, and re-throw the exception otherwise).
But for a regular query, only to handle an arbitrary error - just li... |
717,136 | I have the following cron job running a Python script which seems to install okay with no issues after creating it in Crontab and saving (this is on a server running Centos7). I'm not seeing either a log file nor any output sent in to the email address included. I've tried this:
```
*/2 * * * * /home/local/DEV/mdub/F... | 2015/08/27 | [
"https://serverfault.com/questions/717136",
"https://serverfault.com",
"https://serverfault.com/users/-1/"
] | Firstly, when configuring a crontab use the full path for any commands and scripts you are calling. For example:
* `tee` should be `/usr/bin/tee`
* `mailx` should be `/bin/mailx`
* `date` should be `/bin/date`
Note: If the paths are different on your system change as appropriate
Also, chaining commands in a crontab ... | Cron doesn't allow % characters. |
717,136 | I have the following cron job running a Python script which seems to install okay with no issues after creating it in Crontab and saving (this is on a server running Centos7). I'm not seeing either a log file nor any output sent in to the email address included. I've tried this:
```
*/2 * * * * /home/local/DEV/mdub/F... | 2015/08/27 | [
"https://serverfault.com/questions/717136",
"https://serverfault.com",
"https://serverfault.com/users/-1/"
] | The best practice here is to write a script and call that script by full path within cron. This really is just reinforcing what Gene stated, but writing a script that will run those commands allows you the ability to test the script before placing it in a cron.
Additionally, this makes cron easier to read over the lon... | Cron doesn't allow % characters. |
259,392 | We are seeing restore taking more than 25 minutes for a simple 4 mb file .Restore progresses to 100%,but it wont update any status from there
When checked in error log ,we could see below error...
>
> Process 0:0:0 (0x12c8) Worker 0x000000CB5481A160 appears to be non-yielding on Scheduler 0. Thread creation time: 13... | 2020/02/11 | [
"https://dba.stackexchange.com/questions/259392",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/31995/"
] | The size of the backup file is only partly relevant. The restore process first have to create the database files (the "containers" as I like to think of them) and they need to have the same size as when the backup was produced.
So you have have a database with only small amount of information, but sitting in large dat... | I had the same problem it was due to the size of the DB. Although the backup shows 9 MB, when I right click the DB in SQL server management and select properties, the size shown was 25 GB! What I did is that I changed the DB to "Simple Recovery", shrinked the log file,backup again, and I could restore now. |
1,372,048 | I am in really big trouble right now, so a VERY quick solution would be much appreciated. I was in an SSH session on my laptop that has LUKS encryption, and I thought I was restoring its header. But I realized later that I had actually SSH'd to my desktop and accidentally used the LUKS header backup file to restore on ... | 2018/11/02 | [
"https://superuser.com/questions/1372048",
"https://superuser.com",
"https://superuser.com/users/959792/"
] | This is a VERY early release version of the tabbed interface Microsoft is developing for future versions of Windows. I've had it in my Fast Ring Insiders builds of Windows 10 for 6 months or more at this point.
The basic premise of the UI is that any window can be grouped with any other application window, and that is... | Are you referring to the feature of having multiple tabs? I remember seeing it from the windows insider program. It is called "Sets" where you can have tabs for every window and application but if this is not what you are talking about could you give some more information. |
672,721 | I am trying to solve the problem: A, B are given point. **a** is the position vector of A, and **b** is the position vector of B. I want to find the equation of perpendicular bisector of AB in a vector form.
I solved this problem in a regular form, which I first set A $(x\_1,y\_1)$ B $(x\_2,y\_2)$, then the equation o... | 2014/02/11 | [
"https://math.stackexchange.com/questions/672721",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/95064/"
] | It *is* likely more helpful to set out the problem using vector forms for the relevant lines. The vector $ \ \vec{c} \ = \ \vec{AB} \ $ is $ \ \vec{c} \ = \ \vec{b} \ - \ \vec{a} \ $ (since $ \ \vec{a} \ + \ \vec{c} \ = \ \vec{b} \ $ ) . It appears that you are working in $ \ \mathbb{R}^2 \ $ , so we have
$$ \vec{a} ... | **Hint**: The geometrical meaning of the formula $\vec r=\vec r\_0+t\vec v$ is a line that passes in $\vec r\_0$ (for $t=0$) and is directed along $\vec v$. So what you need is a point that the line goes through, and a direction. The point is easy - that's simply the midpoint between $\vec a$ and $\vec b$.
The direct... |
672,721 | I am trying to solve the problem: A, B are given point. **a** is the position vector of A, and **b** is the position vector of B. I want to find the equation of perpendicular bisector of AB in a vector form.
I solved this problem in a regular form, which I first set A $(x\_1,y\_1)$ B $(x\_2,y\_2)$, then the equation o... | 2014/02/11 | [
"https://math.stackexchange.com/questions/672721",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/95064/"
] | It *is* likely more helpful to set out the problem using vector forms for the relevant lines. The vector $ \ \vec{c} \ = \ \vec{AB} \ $ is $ \ \vec{c} \ = \ \vec{b} \ - \ \vec{a} \ $ (since $ \ \vec{a} \ + \ \vec{c} \ = \ \vec{b} \ $ ) . It appears that you are working in $ \ \mathbb{R}^2 \ $ , so we have
$$ \vec{a} ... | Note, for the question to be meaningful, we must be working in a plane (otherwise 'the' perpendicular bisector is not defined). Let $\hat{z}$ be a vector pointing out of the plane.
We want the equation of a line which passes through the midpoint of $\mathbf{a}$ and $\mathbf{b}$ and is perpendicular to $\mathbf{a}-\mat... |
110,748 | How do I use relational operators on vectors?
```
{1, 2, 3} > {0, 1, 2}
(*outputs {1, 2, 3} > {0, 1, 2}*)
```
More generally, I want `{a,b}>{c,d}` to be equivalent to `a>c && b>d`. Or, I would want to say `vars>0` where `vars` is a vector of my variables and that one constraint forces them all to be strictly positiv... | 2016/03/22 | [
"https://mathematica.stackexchange.com/questions/110748",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/25422/"
] | ```
And @@ Thread[{a, b} > {c, d}]
(* a > c && b > d *)
``` | You can also use the [BoolEval](http://packagedata.net/index.php/links/examples/id/31) package. You'd use it like this:
```
Needs["BoolEval`"]
FreeQ[BoolEval[{1, 2, 3} > {0, 1, 2}], 0]
(* True *)
```
Or
```
Times @@ BoolEval[{1, 2, 3} > {0, 1, 2}] == 1
```
The point being that `BoolEval` returns a 1 or a 0 for ea... |
110,748 | How do I use relational operators on vectors?
```
{1, 2, 3} > {0, 1, 2}
(*outputs {1, 2, 3} > {0, 1, 2}*)
```
More generally, I want `{a,b}>{c,d}` to be equivalent to `a>c && b>d`. Or, I would want to say `vars>0` where `vars` is a vector of my variables and that one constraint forces them all to be strictly positiv... | 2016/03/22 | [
"https://mathematica.stackexchange.com/questions/110748",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/25422/"
] | ```
And @@ Thread[{a, b} > {c, d}]
(* a > c && b > d *)
``` | Here is a new operator ( `⪢`,alias `\[NestedGreaterGreater] )` that is a generalisation of the built-in `>` :
```
NestedGreaterGreater[x___] := And @@ Thread[Greater[x]]
```
This permits interesting operations :
* `{a, b} ⪢ {c, d}`
>
> (a > c) && (b > d)
>
>
>
* `{a, b} ⪢ {c, d} ⪢ {e, f}`
>
> (a > c > e) &... |
110,748 | How do I use relational operators on vectors?
```
{1, 2, 3} > {0, 1, 2}
(*outputs {1, 2, 3} > {0, 1, 2}*)
```
More generally, I want `{a,b}>{c,d}` to be equivalent to `a>c && b>d`. Or, I would want to say `vars>0` where `vars` is a vector of my variables and that one constraint forces them all to be strictly positiv... | 2016/03/22 | [
"https://mathematica.stackexchange.com/questions/110748",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/25422/"
] | Here is a new operator ( `⪢`,alias `\[NestedGreaterGreater] )` that is a generalisation of the built-in `>` :
```
NestedGreaterGreater[x___] := And @@ Thread[Greater[x]]
```
This permits interesting operations :
* `{a, b} ⪢ {c, d}`
>
> (a > c) && (b > d)
>
>
>
* `{a, b} ⪢ {c, d} ⪢ {e, f}`
>
> (a > c > e) &... | You can also use the [BoolEval](http://packagedata.net/index.php/links/examples/id/31) package. You'd use it like this:
```
Needs["BoolEval`"]
FreeQ[BoolEval[{1, 2, 3} > {0, 1, 2}], 0]
(* True *)
```
Or
```
Times @@ BoolEval[{1, 2, 3} > {0, 1, 2}] == 1
```
The point being that `BoolEval` returns a 1 or a 0 for ea... |
311,701 | Usually we use the word "breakfast" in the morning to mean to eat something, but what word do we use to mean "afternoon breakfast" and "evening breakfast"? | 2022/03/19 | [
"https://ell.stackexchange.com/questions/311701",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/152969/"
] | The expression "falling (or going) down a rabbit hole" does refer to Alice in Wonderland, but specifically it means getting sucked into a never-ending activity - similar to the seemingly bottomless hole that Alice falls down.
In this case the activity is Googling all the jazz clubs in Paris.
The only relevance of "dr... | "Going down the rabbit hole" is an allusion to *Alice in Wonderland*, and means "begin a process that is strange, complex or chaotic".
So Mindy means that the Jazz clubs are strange or chaotic. But she is entering this situation when drunk (and therefore less able to deal with complexity). It is just expressing that M... |
19,926 | I'm new to electrical engineering and I am currently trying to make a motor turn on for one second, turn off for one second, and repeat.
I'm using an Arduino Uno's `digitalWrite()` feature to activate a transistor, allowing the external 9V battery to turn on the motor.
Although everything is responding, instead of th... | 2016/01/24 | [
"https://arduino.stackexchange.com/questions/19926",
"https://arduino.stackexchange.com",
"https://arduino.stackexchange.com/users/16697/"
] | I can't make much sense of your diagram- but this is the correct way to do it:

[simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fcGWWK.png) – Schematic created using [CircuitLab](https://www.circuitlab.com/)
R1 is low enough that the... | There are multiple things wrong with your drawn schematic:
* The ground symbol is not wrong but really misleading.
* You forgot to add a flyback diode.
* You wired the load the wrong way: the load is placed between the collector and VCC, not between emitter and GND.
* The base resistor is way too high. |
5,027,999 | Yesterday I was giving a talk about the new C# "async" feature, in particular delving into what the generated code looked like, and `the GetAwaiter()` / `BeginAwait()` / `EndAwait()` calls.
We looked in some detail at the state machine generated by the C# compiler, and there were two aspects we couldn't understand:
*... | 2011/02/17 | [
"https://Stackoverflow.com/questions/5027999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22656/"
] | if it was kept at 1 (first case) you would get a call to `EndAwait` without a call to `BeginAwait`. If it's kept at 2 (second case) you'd get the same result just on the other awaiter.
I'm guessing that calling the BeginAwait returns false if it has be started already (a guess from my side) and keeps the original valu... | Could it be something to do with stacked/nested async calls ?..
i.e:
```
async Task m1()
{
await m2;
}
async Task m2()
{
await m3();
}
async Task m3()
{
Thread.Sleep(10000);
}
```
Does the movenext delegate get called multiple times in this situation ?
Just a punt really? |
5,027,999 | Yesterday I was giving a talk about the new C# "async" feature, in particular delving into what the generated code looked like, and `the GetAwaiter()` / `BeginAwait()` / `EndAwait()` calls.
We looked in some detail at the state machine generated by the C# compiler, and there were two aspects we couldn't understand:
*... | 2011/02/17 | [
"https://Stackoverflow.com/questions/5027999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22656/"
] | Could it be something to do with stacked/nested async calls ?..
i.e:
```
async Task m1()
{
await m2;
}
async Task m2()
{
await m3();
}
async Task m3()
{
Thread.Sleep(10000);
}
```
Does the movenext delegate get called multiple times in this situation ?
Just a punt really? | Explanation of actual states:
possible states:
* **0** Initialized (i think so) **or** waiting for end of operation
* **>0** just called MoveNext, chosing next state
* **-1** ended
Is it possible that this implementation just wants to assure that if another Call to MoveNext from whereever happens (while waiting) it ... |
5,027,999 | Yesterday I was giving a talk about the new C# "async" feature, in particular delving into what the generated code looked like, and `the GetAwaiter()` / `BeginAwait()` / `EndAwait()` calls.
We looked in some detail at the state machine generated by the C# compiler, and there were two aspects we couldn't understand:
*... | 2011/02/17 | [
"https://Stackoverflow.com/questions/5027999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22656/"
] | Okay, I finally have a real answer. I sort of worked it out on my own, but only after Lucian Wischik from the VB part of the team confirmed that there really is a good reason for it. Many thanks to him - and please visit [his blog](https://learn.microsoft.com/en-us/archive/blogs/lucian/) (on [archive.org](https://web.a... | Could it be something to do with stacked/nested async calls ?..
i.e:
```
async Task m1()
{
await m2;
}
async Task m2()
{
await m3();
}
async Task m3()
{
Thread.Sleep(10000);
}
```
Does the movenext delegate get called multiple times in this situation ?
Just a punt really? |
5,027,999 | Yesterday I was giving a talk about the new C# "async" feature, in particular delving into what the generated code looked like, and `the GetAwaiter()` / `BeginAwait()` / `EndAwait()` calls.
We looked in some detail at the state machine generated by the C# compiler, and there were two aspects we couldn't understand:
*... | 2011/02/17 | [
"https://Stackoverflow.com/questions/5027999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22656/"
] | if it was kept at 1 (first case) you would get a call to `EndAwait` without a call to `BeginAwait`. If it's kept at 2 (second case) you'd get the same result just on the other awaiter.
I'm guessing that calling the BeginAwait returns false if it has be started already (a guess from my side) and keeps the original valu... | Explanation of actual states:
possible states:
* **0** Initialized (i think so) **or** waiting for end of operation
* **>0** just called MoveNext, chosing next state
* **-1** ended
Is it possible that this implementation just wants to assure that if another Call to MoveNext from whereever happens (while waiting) it ... |
5,027,999 | Yesterday I was giving a talk about the new C# "async" feature, in particular delving into what the generated code looked like, and `the GetAwaiter()` / `BeginAwait()` / `EndAwait()` calls.
We looked in some detail at the state machine generated by the C# compiler, and there were two aspects we couldn't understand:
*... | 2011/02/17 | [
"https://Stackoverflow.com/questions/5027999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22656/"
] | Okay, I finally have a real answer. I sort of worked it out on my own, but only after Lucian Wischik from the VB part of the team confirmed that there really is a good reason for it. Many thanks to him - and please visit [his blog](https://learn.microsoft.com/en-us/archive/blogs/lucian/) (on [archive.org](https://web.a... | if it was kept at 1 (first case) you would get a call to `EndAwait` without a call to `BeginAwait`. If it's kept at 2 (second case) you'd get the same result just on the other awaiter.
I'm guessing that calling the BeginAwait returns false if it has be started already (a guess from my side) and keeps the original valu... |
5,027,999 | Yesterday I was giving a talk about the new C# "async" feature, in particular delving into what the generated code looked like, and `the GetAwaiter()` / `BeginAwait()` / `EndAwait()` calls.
We looked in some detail at the state machine generated by the C# compiler, and there were two aspects we couldn't understand:
*... | 2011/02/17 | [
"https://Stackoverflow.com/questions/5027999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22656/"
] | Okay, I finally have a real answer. I sort of worked it out on my own, but only after Lucian Wischik from the VB part of the team confirmed that there really is a good reason for it. Many thanks to him - and please visit [his blog](https://learn.microsoft.com/en-us/archive/blogs/lucian/) (on [archive.org](https://web.a... | Explanation of actual states:
possible states:
* **0** Initialized (i think so) **or** waiting for end of operation
* **>0** just called MoveNext, chosing next state
* **-1** ended
Is it possible that this implementation just wants to assure that if another Call to MoveNext from whereever happens (while waiting) it ... |
71,624,954 | So Currently, I am creating a modal that is centered in the middle of the page by position absolute. The problem is when I adjust my broswer height and only the height, it will push the modal up and touch the top of the screen and even go pass it. I just want to know how to stop that from helping.
```
.modal-container... | 2022/03/26 | [
"https://Stackoverflow.com/questions/71624954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17159523/"
] | You could use viewport unit for the height.
Viewport units are based on the dimensions of the viewport (width and height of the visible browser page, excluding toolbars, search bars).
* vh - viewport height
* vw - viewport width
1vh - 1% of viewport's height.
So in your modal you can do something like,
```
.modal-... | You can use the flex property to align content in the center of the model so it will automatically adjust the browser height. Please check the below example
```
.modal-container {
position: absolute;
width: 500px;
margin: 0 auto;
left: 0;
right: 0;
bottom: 0;
top: 0;
display: flex;
... |
36,603,715 | I'm trying to concatenate two column values inside a list and respectively select all columns but all I can achieve is get a concatenated column inside list with no other existing columns data .As I loose other columns data inside list because I'm using `select` to concatenate .
**Linq Query:**
```
data = data.Selec... | 2016/04/13 | [
"https://Stackoverflow.com/questions/36603715",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3460734/"
] | Try something like this...
```
data = data.Select(m => new
{
Name = $"{m.Id} {m.Place}", // Edit to add string interpolation
Place = m.Place,
Address = m.Address,
etc = m.etc
});
```
While you don't "need" to include a name for m.Place, m.Address, etc. (Visual Studio will name them appropriately base... | Use `select new`:
```
var data2 = from c in data
select new
{
Name = c.Id + " " + c.Place,
Place = c.Place,
Address = c.Address
};
```
Or:
```
var data3 = data.Select(c => new { c.Address, Name = string.Format("{0} {1}", c.Id, c.Pla... |
36,603,715 | I'm trying to concatenate two column values inside a list and respectively select all columns but all I can achieve is get a concatenated column inside list with no other existing columns data .As I loose other columns data inside list because I'm using `select` to concatenate .
**Linq Query:**
```
data = data.Selec... | 2016/04/13 | [
"https://Stackoverflow.com/questions/36603715",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3460734/"
] | Assuming you want to update specific fields you could use the foreach clause. This will update the values in place without needing to call ToList as well.
```
data.ForEach(m => m.Name = m.Id + m.Place);
``` | Use `select new`:
```
var data2 = from c in data
select new
{
Name = c.Id + " " + c.Place,
Place = c.Place,
Address = c.Address
};
```
Or:
```
var data3 = data.Select(c => new { c.Address, Name = string.Format("{0} {1}", c.Id, c.Pla... |
36,603,715 | I'm trying to concatenate two column values inside a list and respectively select all columns but all I can achieve is get a concatenated column inside list with no other existing columns data .As I loose other columns data inside list because I'm using `select` to concatenate .
**Linq Query:**
```
data = data.Selec... | 2016/04/13 | [
"https://Stackoverflow.com/questions/36603715",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3460734/"
] | Try something like this...
```
data = data.Select(m => new
{
Name = $"{m.Id} {m.Place}", // Edit to add string interpolation
Place = m.Place,
Address = m.Address,
etc = m.etc
});
```
While you don't "need" to include a name for m.Place, m.Address, etc. (Visual Studio will name them appropriately base... | There are already two answers which should work for you. But they give you a list of anonymous objects.
The below will give a list of your custom class(*instead of anonymous object*) with the desired result.
```
var result = data.Select(m => new Category
{ Name = m.Name = m.Id + m.Pla... |
36,603,715 | I'm trying to concatenate two column values inside a list and respectively select all columns but all I can achieve is get a concatenated column inside list with no other existing columns data .As I loose other columns data inside list because I'm using `select` to concatenate .
**Linq Query:**
```
data = data.Selec... | 2016/04/13 | [
"https://Stackoverflow.com/questions/36603715",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3460734/"
] | Assuming you want to update specific fields you could use the foreach clause. This will update the values in place without needing to call ToList as well.
```
data.ForEach(m => m.Name = m.Id + m.Place);
``` | There are already two answers which should work for you. But they give you a list of anonymous objects.
The below will give a list of your custom class(*instead of anonymous object*) with the desired result.
```
var result = data.Select(m => new Category
{ Name = m.Name = m.Id + m.Pla... |
25,177,004 | I was hoping this would be really simple in angular.
I have an list with translators and other users
```
[{user: 'a',languages:['french','english','spanish']},
{user: 'b'}]
```
I then have an ng-repeat where I only want to display the users who have languages
```
ng-repeat="translator in users | filter: {language... | 2014/08/07 | [
"https://Stackoverflow.com/questions/25177004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48067/"
] | ```
<div ng-repeat="translator in users | filter : { languages : '!!' }">
```
Explanation:
------------
Consider a list as below:
```
$scope.items = [
{
propertyOne: 'a',
propertyTwo: 'hello'
},
{
propertyOne: 'b',
propertyTwo: null
},
{
propertyOne: 'c',... | Controller:
```
var app = angular.module('app',[]);
app.controller('ctrl', function($scope) {
$scope.hasLanguage = function(user) {
return user.hasOwnProperty('languages');
}
});
```
HTML:
```
ng-repeat="translator in users | filter: hasLanguage"
``` |
11,968,403 | I want to show current date and time in my c++ program. I did this simply by these lines of code:
```
char date[9], time[9];
_strdate( date );
_strtime( time );
cout << "Current date and time: " << date << " " << time << endl;
```
This perfectly worked in MS Visual C++ 2010 and Dev C++ 4.9.9.2. But this doesn't wo... | 2012/08/15 | [
"https://Stackoverflow.com/questions/11968403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1570812/"
] | These functions are not part of standard C++; they are Microsoft-specific extensions, and thus may not be available everywhere.
For similar functionality, you may try combining `time`, `localtime` and `strftime`. | The function you are looking for is [`strftime`](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/strftime.3.html). |
11,968,403 | I want to show current date and time in my c++ program. I did this simply by these lines of code:
```
char date[9], time[9];
_strdate( date );
_strtime( time );
cout << "Current date and time: " << date << " " << time << endl;
```
This perfectly worked in MS Visual C++ 2010 and Dev C++ 4.9.9.2. But this doesn't wo... | 2012/08/15 | [
"https://Stackoverflow.com/questions/11968403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1570812/"
] | ```
std::string _strdate_alternative()
{
char cptime[50];
time_t now = time(NULL);
strftime(cptime, 50, "%b. %d, %Y", localtime(&now)); //short month name
return std::string(cptime);
}
```
As said before, there is no such function in standard c/c++ library.
You can use this alternative. Code is based on some info... | These functions are not part of standard C++; they are Microsoft-specific extensions, and thus may not be available everywhere.
For similar functionality, you may try combining `time`, `localtime` and `strftime`. |
11,968,403 | I want to show current date and time in my c++ program. I did this simply by these lines of code:
```
char date[9], time[9];
_strdate( date );
_strtime( time );
cout << "Current date and time: " << date << " " << time << endl;
```
This perfectly worked in MS Visual C++ 2010 and Dev C++ 4.9.9.2. But this doesn't wo... | 2012/08/15 | [
"https://Stackoverflow.com/questions/11968403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1570812/"
] | ```
std::string _strdate_alternative()
{
char cptime[50];
time_t now = time(NULL);
strftime(cptime, 50, "%b. %d, %Y", localtime(&now)); //short month name
return std::string(cptime);
}
```
As said before, there is no such function in standard c/c++ library.
You can use this alternative. Code is based on some info... | The function you are looking for is [`strftime`](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/strftime.3.html). |
2,496,512 | Let $exp(k)$ be the exponential distribution, $k>0$. Then it has density
$$ f(x)= \begin{cases} ke^{-kx} & \text{ if } 0\leq x < \infty\\
0 &\text{otherwise}
\end{cases} $$
I want to find the convolution of $n$ exponential distributions. For $n=2$ I have
$$ \int\_{\mathbb{R}} f(x-t)f(t) dt =\int\_0^x (k e^{-k(x-t)}k... | 2017/10/30 | [
"https://math.stackexchange.com/questions/2496512",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/104220/"
] | For $n=2$, you found that $$f\_2(x)=k^2x^{2-1}e^{-kx}$$ The tricky part is that actually there is also a hidden $1/(2-1)!=1$. (you couldn't have known that, unless you calculated also the $n=3$ case). So, the inductive hypothesis for $n\ge 3$: $$f\_n(x)=\frac{1}{(n-1)!}k^{n}x^{n-1}e^{-kx}$$ for $0\le x<+\infty$ and $f\... | We have that for a R.V. $X$ exponentially distributed that it´s density function is given by:
$$
\\ f\_X(x)=\begin{cases}
\lambda e^{-\lambda x} & x\geq 0\\
0 & x<0
\end{cases}
$$
Define $S\_n=\sum\_{k=1}^n X\_k$.
Then, as You have already shown, the sum of two exponential R.V´s has density
$$
\begin{aligned}
f\_{... |
276,347 | I am not a techie but using ubuntu for the last 3 years
now I have a question to ask...I am translating a book
so I need two screens opening at the same time one opening into the pdf file from the pc other opening into the web for researching side by side
I went thru the web but could not find an answer
help me ... | 2013/03/31 | [
"https://askubuntu.com/questions/276347",
"https://askubuntu.com",
"https://askubuntu.com/users/145668/"
] | If you have a additional monitor, then you can connect it to the CPU/Laptop with a VGA cable. Then in your Ubuntu system,
* Open “**System Settings**” from “**Dash Home**” and there select
“**Displays**”.
* If your monitor does not appear there, click on “**Detect
Displays**”. Now you’ll see two monitors.
 bonuses (such as [topaz socketed helms](http://diablo2.diablowiki.net/Magic_Find#Magic_Find_Equipment)) increase rune and gem drop rates? | 2011/09/17 | [
"https://gaming.stackexchange.com/questions/30601",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/121/"
] | No, they do not affect runes or gems. [So sayeth the Arreat Summit](http://classic.battle.net/diablo2exp/items/magic/magicfind.shtml):
>
> What exactly are "Magic Items"
>
>
> Magic Items in this definition include
> Magic Items, Set Items, Unique Items and Rare Items.
>
>
> | No, magic find has no affect at all on [rune drops](http://diablo2.diablowiki.net/Rune_hunting). You are just as likely to get an Ist from a countess with 0% mf and 400% mf.
I do not know if MF has an effect on gems, I don't think this has been looked in to in as much detail as gems are fairly common, especially by do... |
30,601 | Do items with [Magic Find](http://diablo2.diablowiki.net/Magic_Find) bonuses (such as [topaz socketed helms](http://diablo2.diablowiki.net/Magic_Find#Magic_Find_Equipment)) increase rune and gem drop rates? | 2011/09/17 | [
"https://gaming.stackexchange.com/questions/30601",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/121/"
] | No, they do not affect runes or gems. [So sayeth the Arreat Summit](http://classic.battle.net/diablo2exp/items/magic/magicfind.shtml):
>
> What exactly are "Magic Items"
>
>
> Magic Items in this definition include
> Magic Items, Set Items, Unique Items and Rare Items.
>
>
> | Magic find only affects what "color" an item is, after it is already determined what kind of item is to be dropped. Therefore, it cannot increase the chance that you get runes, gems, rings, amulets, charms, or whatever else. Those will drop completely randomly, based only on the drop tables.
Once an item that can have... |
11,609,480 | My application is a Windows Forms one.
I tried using the windows wallpaper, but this depends on the "Fill", "Stretch", "Fit" or "Tile" settings.
I just need the image as it is on the desktop, but including the part "under" the taskbar, because this part is visible in case of transparent taskbar.
Why I need this?
Bec... | 2012/07/23 | [
"https://Stackoverflow.com/questions/11609480",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/521446/"
] | You need to cast the bit field to an integer.
```
mysql> select hasMultipleColors+0 from pumps where id = 1;
```
This is because of a bug, see: <http://bugs.mysql.com/bug.php?id=43670>. The status says: Won't fix. | You need to perform a conversion as `bit 1` is not printable.
`SELECT hasMultipleColors+0 from pumps where id = 1;`
See more here:
<http://dev.mysql.com/doc/refman/5.0/en/bit-field-literals.html> |
11,609,480 | My application is a Windows Forms one.
I tried using the windows wallpaper, but this depends on the "Fill", "Stretch", "Fit" or "Tile" settings.
I just need the image as it is on the desktop, but including the part "under" the taskbar, because this part is visible in case of transparent taskbar.
Why I need this?
Bec... | 2012/07/23 | [
"https://Stackoverflow.com/questions/11609480",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/521446/"
] | You need to perform a conversion as `bit 1` is not printable.
`SELECT hasMultipleColors+0 from pumps where id = 1;`
See more here:
<http://dev.mysql.com/doc/refman/5.0/en/bit-field-literals.html> | The actual reason for the effect you see, is that it's done right and as expected.
The `bit` field has bits and thus return bits, and trying to output a single bit as a character will show the character with the given bit-value – in this case a zero-width control character.
Some software may handle this automagically... |
11,609,480 | My application is a Windows Forms one.
I tried using the windows wallpaper, but this depends on the "Fill", "Stretch", "Fit" or "Tile" settings.
I just need the image as it is on the desktop, but including the part "under" the taskbar, because this part is visible in case of transparent taskbar.
Why I need this?
Bec... | 2012/07/23 | [
"https://Stackoverflow.com/questions/11609480",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/521446/"
] | You need to cast the bit field to an integer.
```
mysql> select hasMultipleColors+0 from pumps where id = 1;
```
This is because of a bug, see: <http://bugs.mysql.com/bug.php?id=43670>. The status says: Won't fix. | The actual reason for the effect you see, is that it's done right and as expected.
The `bit` field has bits and thus return bits, and trying to output a single bit as a character will show the character with the given bit-value – in this case a zero-width control character.
Some software may handle this automagically... |
11,609,480 | My application is a Windows Forms one.
I tried using the windows wallpaper, but this depends on the "Fill", "Stretch", "Fit" or "Tile" settings.
I just need the image as it is on the desktop, but including the part "under" the taskbar, because this part is visible in case of transparent taskbar.
Why I need this?
Bec... | 2012/07/23 | [
"https://Stackoverflow.com/questions/11609480",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/521446/"
] | You need to cast the bit field to an integer.
```
mysql> select hasMultipleColors+0 from pumps where id = 1;
```
This is because of a bug, see: <http://bugs.mysql.com/bug.php?id=43670>. The status says: Won't fix. | You can cast BIT field to unsigned.
```
SELECT CAST(hasMultipleColors AS UNSIGNED) AS hasMultipleColors
FROM pumps
WHERE id = 1
```
It will return 1 or 0 based on the value of `hasMultipleColors`. |
11,609,480 | My application is a Windows Forms one.
I tried using the windows wallpaper, but this depends on the "Fill", "Stretch", "Fit" or "Tile" settings.
I just need the image as it is on the desktop, but including the part "under" the taskbar, because this part is visible in case of transparent taskbar.
Why I need this?
Bec... | 2012/07/23 | [
"https://Stackoverflow.com/questions/11609480",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/521446/"
] | You can cast BIT field to unsigned.
```
SELECT CAST(hasMultipleColors AS UNSIGNED) AS hasMultipleColors
FROM pumps
WHERE id = 1
```
It will return 1 or 0 based on the value of `hasMultipleColors`. | The actual reason for the effect you see, is that it's done right and as expected.
The `bit` field has bits and thus return bits, and trying to output a single bit as a character will show the character with the given bit-value – in this case a zero-width control character.
Some software may handle this automagically... |
39,521,243 | I just can't get QtConcurrent::run working with an overloaded static method:
```
class Foobar {
public:
static ResType foo(const cv::Mat& data, const QStringList& names, int clusters = 5);
static ResType foo(const cv::Mat& data, const cv::TermCriteria& tc, const QStringList& names, const QStringList& otherName... | 2016/09/15 | [
"https://Stackoverflow.com/questions/39521243",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/768656/"
] | The answer is that static member function type is a regular function, not a member function, because it doesn't have the implicit `this`, so removing the `Foobar::` part before `*` should since the compilation issue.
Edit:
After the question edition and the answer added by OP, I want to mention that `std::bind` is no... | std::bind to the rescue. For some reason, it can figure out the right type:
```
#include <functional>
void test() {
auto fn = std::bind(
static_cast<DkGmm (*)(const cv::Mat&, const cv::TermCriteria&, const QStringList&, const QStringList&, int, int)>(&DkGmm::fromData),
sampleData, tc, mDimNames, m... |
18,259,228 | I'm not sure if this is possible ... but I'd like to use the autoComplete component, where the value attribute is of type String and where the completeMethod returns a List of some heavy object.
It is also a requirement for me to use `forceSelection="false"`
This is what I think should work (but doesn't):
```
... | 2013/08/15 | [
"https://Stackoverflow.com/questions/18259228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1524381/"
] | It would be very helpful if you could be a little more precise in the following areas:
* Can the application survive if the background process gets terminated WHILE the main application is running?
* Does the background process get terminated and begun multiple times WHILE the main application is running?
* Do you hav... | first of all why you are not using hostname?
it seems that your app read the IP at startup and keep it without refreshing |
112,191 | yesterday I was shooting as a eventphotographer and suddenly my IR beam of the flash didn't work anymore. (Probably I changed some settings while talking with someone? Idk...)
Some quick facts:
* The flash is newer than 6 months old
* Unfortunately I don't have the YN wireless device to update to the latest version
*... | 2019/09/22 | [
"https://photo.stackexchange.com/questions/112191",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/87090/"
] | It's a Yongnuo, a/k/a a "disposable flash." Some last longer than others, but you should always have one more than you need with you when using them for a shoot. Eventually, you'll need the extra one. | Check your camera settings anyway, they have to be just right for AF Assist light to work. See D7100 manual page 233 about option A4, which has to be ON. And then it must be AF-S mode (or Single Servo if AF-A). And also, Center focus point selected in Single Point mode, or Auto Area mode. See page 233 to ensure they ar... |
185,366 | Human beings contain mana, which is the energy required for life. Mana grows over the course of a person's life, being released at the moment of death. Demons can feed on this energy to increase their power through the creation of pacts with humans in exchange for magical power. When a demon makes a pact with a witch, ... | 2020/09/12 | [
"https://worldbuilding.stackexchange.com/questions/185366",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/52361/"
] | **A set number of Demon Seeds (and social issues):**
These are solid answers, but I have a slightly different take. Since the demon places a seed in a new recruit, which expands over time, make each demon only able to generate a set number of seeds. This can be according to ability (people have 10 fingers, Demons have... | **The power curve for highly skilled witches is quadratic in nature.**
A lowly acolyte witch is worth barely even enough to replace the power given with her soul. This will be our unit of measure, AP (acolyte power).
So our lowly acolyte, works hard but doesn't manage to learn much and only becomes a tier 2 acolyte n... |
185,366 | Human beings contain mana, which is the energy required for life. Mana grows over the course of a person's life, being released at the moment of death. Demons can feed on this energy to increase their power through the creation of pacts with humans in exchange for magical power. When a demon makes a pact with a witch, ... | 2020/09/12 | [
"https://worldbuilding.stackexchange.com/questions/185366",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/52361/"
] | I'm half tempted to post this as a comment, because it's *obvious*, but...
Make "mana return" correlated to skill, such that the soul of a highly talented witch is more valuable than that of a mediocre witch.
Properly tuned, this can easily have the desired effect. For instance, say it takes ten times as much effort ... | Witches are Fast Food
---------------------
---
[](https://i.stack.imgur.com/T5rti.png)
>
> Human beings contain mana, which is the energy required for life. Mana
> grows over the course of a person's life, being released at the moment
> of death. ... |
185,366 | Human beings contain mana, which is the energy required for life. Mana grows over the course of a person's life, being released at the moment of death. Demons can feed on this energy to increase their power through the creation of pacts with humans in exchange for magical power. When a demon makes a pact with a witch, ... | 2020/09/12 | [
"https://worldbuilding.stackexchange.com/questions/185366",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/52361/"
] | **Learning takes time and devotion and getting more witches reduces power**
There's two things at work here. Demons give their power and after death witches give their power.
At first a demon might not notice, but giving more and more power to more and more witches reduces their own power, weakening them. This can be... | Witches are Fast Food
---------------------
---
[](https://i.stack.imgur.com/T5rti.png)
>
> Human beings contain mana, which is the energy required for life. Mana
> grows over the course of a person's life, being released at the moment
> of death. ... |
185,366 | Human beings contain mana, which is the energy required for life. Mana grows over the course of a person's life, being released at the moment of death. Demons can feed on this energy to increase their power through the creation of pacts with humans in exchange for magical power. When a demon makes a pact with a witch, ... | 2020/09/12 | [
"https://worldbuilding.stackexchange.com/questions/185366",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/52361/"
] | Adding to Matthew's excellent answer, throw in a risk factor to sweeten the value of existing vetted witches over untested recruits.
For example, imagine that a demon must invest three unit of power into a potential witch just to give her the possibility of reaching mediocre level, but that there is a 75% chance that ... | **Learning takes time and devotion and getting more witches reduces power**
There's two things at work here. Demons give their power and after death witches give their power.
At first a demon might not notice, but giving more and more power to more and more witches reduces their own power, weakening them. This can be... |
185,366 | Human beings contain mana, which is the energy required for life. Mana grows over the course of a person's life, being released at the moment of death. Demons can feed on this energy to increase their power through the creation of pacts with humans in exchange for magical power. When a demon makes a pact with a witch, ... | 2020/09/12 | [
"https://worldbuilding.stackexchange.com/questions/185366",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/52361/"
] | Adding to Matthew's excellent answer, throw in a risk factor to sweeten the value of existing vetted witches over untested recruits.
For example, imagine that a demon must invest three unit of power into a potential witch just to give her the possibility of reaching mediocre level, but that there is a 75% chance that ... | **A set number of Demon Seeds (and social issues):**
These are solid answers, but I have a slightly different take. Since the demon places a seed in a new recruit, which expands over time, make each demon only able to generate a set number of seeds. This can be according to ability (people have 10 fingers, Demons have... |
185,366 | Human beings contain mana, which is the energy required for life. Mana grows over the course of a person's life, being released at the moment of death. Demons can feed on this energy to increase their power through the creation of pacts with humans in exchange for magical power. When a demon makes a pact with a witch, ... | 2020/09/12 | [
"https://worldbuilding.stackexchange.com/questions/185366",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/52361/"
] | Witches are Fast Food
---------------------
---
[](https://i.stack.imgur.com/T5rti.png)
>
> Human beings contain mana, which is the energy required for life. Mana
> grows over the course of a person's life, being released at the moment
> of death. ... | **The power curve for highly skilled witches is quadratic in nature.**
A lowly acolyte witch is worth barely even enough to replace the power given with her soul. This will be our unit of measure, AP (acolyte power).
So our lowly acolyte, works hard but doesn't manage to learn much and only becomes a tier 2 acolyte n... |
185,366 | Human beings contain mana, which is the energy required for life. Mana grows over the course of a person's life, being released at the moment of death. Demons can feed on this energy to increase their power through the creation of pacts with humans in exchange for magical power. When a demon makes a pact with a witch, ... | 2020/09/12 | [
"https://worldbuilding.stackexchange.com/questions/185366",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/52361/"
] | I'm half tempted to post this as a comment, because it's *obvious*, but...
Make "mana return" correlated to skill, such that the soul of a highly talented witch is more valuable than that of a mediocre witch.
Properly tuned, this can easily have the desired effect. For instance, say it takes ten times as much effort ... | **Learning takes time and devotion and getting more witches reduces power**
There's two things at work here. Demons give their power and after death witches give their power.
At first a demon might not notice, but giving more and more power to more and more witches reduces their own power, weakening them. This can be... |
185,366 | Human beings contain mana, which is the energy required for life. Mana grows over the course of a person's life, being released at the moment of death. Demons can feed on this energy to increase their power through the creation of pacts with humans in exchange for magical power. When a demon makes a pact with a witch, ... | 2020/09/12 | [
"https://worldbuilding.stackexchange.com/questions/185366",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/52361/"
] | Witches are Fast Food
---------------------
---
[](https://i.stack.imgur.com/T5rti.png)
>
> Human beings contain mana, which is the energy required for life. Mana
> grows over the course of a person's life, being released at the moment
> of death. ... | Instead of a cost, it can be a special reward. Some demons have figured out that if they help the seed growths on particularly gifted individuals, the quantity of mana liberated is astronomical. But it only happens with the finest, even a very strong selection of witches does not guarantee this effect.
Furthermore, to... |
185,366 | Human beings contain mana, which is the energy required for life. Mana grows over the course of a person's life, being released at the moment of death. Demons can feed on this energy to increase their power through the creation of pacts with humans in exchange for magical power. When a demon makes a pact with a witch, ... | 2020/09/12 | [
"https://worldbuilding.stackexchange.com/questions/185366",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/52361/"
] | **Learning takes time and devotion and getting more witches reduces power**
There's two things at work here. Demons give their power and after death witches give their power.
At first a demon might not notice, but giving more and more power to more and more witches reduces their own power, weakening them. This can be... | **A set number of Demon Seeds (and social issues):**
These are solid answers, but I have a slightly different take. Since the demon places a seed in a new recruit, which expands over time, make each demon only able to generate a set number of seeds. This can be according to ability (people have 10 fingers, Demons have... |
185,366 | Human beings contain mana, which is the energy required for life. Mana grows over the course of a person's life, being released at the moment of death. Demons can feed on this energy to increase their power through the creation of pacts with humans in exchange for magical power. When a demon makes a pact with a witch, ... | 2020/09/12 | [
"https://worldbuilding.stackexchange.com/questions/185366",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/52361/"
] | Adding to Matthew's excellent answer, throw in a risk factor to sweeten the value of existing vetted witches over untested recruits.
For example, imagine that a demon must invest three unit of power into a potential witch just to give her the possibility of reaching mediocre level, but that there is a 75% chance that ... | Witches are Fast Food
---------------------
---
[](https://i.stack.imgur.com/T5rti.png)
>
> Human beings contain mana, which is the energy required for life. Mana
> grows over the course of a person's life, being released at the moment
> of death. ... |
38,821,297 | I am new to Python and I am trying to install scrapy, I have python 2.7.12 and pip 8.1.2 on windows 10. when I give the command 'pip install scrapy' it tries to install lxml and gives the below error. I downloaded the libxml2 binary, extracted to a folder and added the bin folder in path variable.But still the same iss... | 2016/08/08 | [
"https://Stackoverflow.com/questions/38821297",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2928913/"
] | you can simply use one of these [whl files](http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml), based on your system.
After download it, use these command in where you download that file:
```
pip install ***.whl
``` | Scrapy's docummentation [recommends using Anaconda](http://doc.scrapy.org/en/latest/intro/install.html#anaconda) to install the package. Lxml package is really tricky to install on windows and anaconda is a really straigh-forward shortcut.
There's also unnoficial binaries of lxml [mentioned in lxml's docummentation](... |
38,821,297 | I am new to Python and I am trying to install scrapy, I have python 2.7.12 and pip 8.1.2 on windows 10. when I give the command 'pip install scrapy' it tries to install lxml and gives the below error. I downloaded the libxml2 binary, extracted to a folder and added the bin folder in path variable.But still the same iss... | 2016/08/08 | [
"https://Stackoverflow.com/questions/38821297",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2928913/"
] | you can simply use one of these [whl files](http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml), based on your system.
After download it, use these command in where you download that file:
```
pip install ***.whl
``` | What version of pip do you have?
Just upgrading pip helps in my case
```
pip install --upgrade pip
``` |
43,001,690 | I found this project on the web: <http://cyntss.github.io/Parallax-img-scroll/>
And I am wondering if I want to change the `data-ps-vertical-position""` on resize how can I do that? I have tried updating the data value using the following approach: `$('div#frame-1').attr( 'data-ps-vertical-position','1900');` however ... | 2017/03/24 | [
"https://Stackoverflow.com/questions/43001690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1974930/"
] | The solution described in the accepted answer gets the job done but for the cost of losing type safety.
**If you want to keep the type-safety** going I would suggest the following:
Create `dom.d.ts` file in `@types` folder in your sources (or configure [`typeRoots`](https://www.typescriptlang.org/tsconfig#typeRoots) ... | I ended up taking a different approach. Instead, I made a wrapper class that extended EventTarget.
```
type AudioEvent = {bytes: Uint8Array};
interface IAudioEventTarget {
addListener(callback: (evt: CustomEvent<AudioEvent>) => void): void
dispatch(event: AudioEvent): boolean;
removeListener(callback: (evt: Cus... |
43,001,690 | I found this project on the web: <http://cyntss.github.io/Parallax-img-scroll/>
And I am wondering if I want to change the `data-ps-vertical-position""` on resize how can I do that? I have tried updating the data value using the following approach: `$('div#frame-1').attr( 'data-ps-vertical-position','1900');` however ... | 2017/03/24 | [
"https://Stackoverflow.com/questions/43001690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1974930/"
] | `CustomEvent` is a generic type. You can pass the type of the `detail` property as a parameter (it defaults to `any`). Here is how it is defined in [lib.dom.d.ts](https://github.com/microsoft/TypeScript/blob/master/lib/lib.dom.d.ts) (which is in the `lib` directory of your npm typescript installation):
```js
interface... | maybe overly complicated but typesafe?
```
interface FizzInfo {
amount: string;
}
interface BuzzInfo {
level: number;
}
interface FizzBuzzEventMap {
fizz: CustomEvent<FizzInfo>;
buzz: CustomEvent<BuzzInfo>;
}
interface FizzerBuzzer extends EventTarget {
addEventListener<K extends keyof FizzBuzzEventMap>(t... |
43,001,690 | I found this project on the web: <http://cyntss.github.io/Parallax-img-scroll/>
And I am wondering if I want to change the `data-ps-vertical-position""` on resize how can I do that? I have tried updating the data value using the following approach: `$('div#frame-1').attr( 'data-ps-vertical-position','1900');` however ... | 2017/03/24 | [
"https://Stackoverflow.com/questions/43001690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1974930/"
] | The solution described in the accepted answer gets the job done but for the cost of losing type safety.
**If you want to keep the type-safety** going I would suggest the following:
Create `dom.d.ts` file in `@types` folder in your sources (or configure [`typeRoots`](https://www.typescriptlang.org/tsconfig#typeRoots) ... | maybe overly complicated but typesafe?
```
interface FizzInfo {
amount: string;
}
interface BuzzInfo {
level: number;
}
interface FizzBuzzEventMap {
fizz: CustomEvent<FizzInfo>;
buzz: CustomEvent<BuzzInfo>;
}
interface FizzerBuzzer extends EventTarget {
addEventListener<K extends keyof FizzBuzzEventMap>(t... |
43,001,690 | I found this project on the web: <http://cyntss.github.io/Parallax-img-scroll/>
And I am wondering if I want to change the `data-ps-vertical-position""` on resize how can I do that? I have tried updating the data value using the following approach: `$('div#frame-1').attr( 'data-ps-vertical-position','1900');` however ... | 2017/03/24 | [
"https://Stackoverflow.com/questions/43001690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1974930/"
] | The property name is `detail` and not `details`. The correct code needs to be:
```
let div: any = document.getElementById("my_div");
let c_event = new CustomEvent("build",{detail: 3});
div.addEventListener("build", function(e: CustomEvent) { // change here Event to CustomEvent
console.log(e.detail);
}.bind(this)... | maybe overly complicated but typesafe?
```
interface FizzInfo {
amount: string;
}
interface BuzzInfo {
level: number;
}
interface FizzBuzzEventMap {
fizz: CustomEvent<FizzInfo>;
buzz: CustomEvent<BuzzInfo>;
}
interface FizzerBuzzer extends EventTarget {
addEventListener<K extends keyof FizzBuzzEventMap>(t... |
43,001,690 | I found this project on the web: <http://cyntss.github.io/Parallax-img-scroll/>
And I am wondering if I want to change the `data-ps-vertical-position""` on resize how can I do that? I have tried updating the data value using the following approach: `$('div#frame-1').attr( 'data-ps-vertical-position','1900');` however ... | 2017/03/24 | [
"https://Stackoverflow.com/questions/43001690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1974930/"
] | The property name is `detail` and not `details`. The correct code needs to be:
```
let div: any = document.getElementById("my_div");
let c_event = new CustomEvent("build",{detail: 3});
div.addEventListener("build", function(e: CustomEvent) { // change here Event to CustomEvent
console.log(e.detail);
}.bind(this)... | I ended up taking a different approach. Instead, I made a wrapper class that extended EventTarget.
```
type AudioEvent = {bytes: Uint8Array};
interface IAudioEventTarget {
addListener(callback: (evt: CustomEvent<AudioEvent>) => void): void
dispatch(event: AudioEvent): boolean;
removeListener(callback: (evt: Cus... |
43,001,690 | I found this project on the web: <http://cyntss.github.io/Parallax-img-scroll/>
And I am wondering if I want to change the `data-ps-vertical-position""` on resize how can I do that? I have tried updating the data value using the following approach: `$('div#frame-1').attr( 'data-ps-vertical-position','1900');` however ... | 2017/03/24 | [
"https://Stackoverflow.com/questions/43001690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1974930/"
] | The solution described in the accepted answer gets the job done but for the cost of losing type safety.
**If you want to keep the type-safety** going I would suggest the following:
Create `dom.d.ts` file in `@types` folder in your sources (or configure [`typeRoots`](https://www.typescriptlang.org/tsconfig#typeRoots) ... | `CustomEvent` is a generic type. You can pass the type of the `detail` property as a parameter (it defaults to `any`). Here is how it is defined in [lib.dom.d.ts](https://github.com/microsoft/TypeScript/blob/master/lib/lib.dom.d.ts) (which is in the `lib` directory of your npm typescript installation):
```js
interface... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.