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 |
|---|---|---|---|---|---|
35,878,733 | My website: [click](http://szybkieczytanie.gda.pl/)
How to make the website bigger on mobile phones? I would like to have bigger logo and other stuff. The zoom property is not working on iPhone, as I have this in my CSS:
```css
@media screen and (max-width: 767px) {
body {
zoom: 150%;
-moz-trans... | 2016/03/08 | [
"https://Stackoverflow.com/questions/35878733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6035924/"
] | Zooming your website is a bad idea. Try adding this to your `<head>` and read more about the `viewport` meta tag on [Mozilla Developer Network](https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag).
```html
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimu... | first set your viewport
```
<meta name="viewport" content="user-scalable=yes, minimum-scale=0.75, maximum-scale=3.0" />
```
the write zoom like
```
zoom: 1.8;
``` |
46,676,443 | In a class, I have a vector of objects from a different class, like this:
```
class Foo {
private:
std::vector<Bar> barObject;
...
};
```
The class Bar defines a default constructor (all private variables initialize to zero), and a non-default constructor in which values can be fed in, as in:
```
Bar newBar(var... | 2017/10/10 | [
"https://Stackoverflow.com/questions/46676443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1232170/"
] | `resize` has an overload:
`void resize (size_type n, const value_type& val);`
This allows you to specify the value in newly allocated memory. However, if you want to allocate the vector as part of construction, you can do that as well. The vector has a constructor to do this:
```
vector (size_type n, const value_ty... | Answering on your question. Yes, you can do that kind of insert:
```
barObject.insert(i, tempBar);
```
Just make sure that iterator `i` is valid one:
```
std::vector<Bar>::iterator i = barObject.begin();
barObject.insert(i, tempBar);
``` |
768,510 | I have an assignment to create a GUI using MATLAB GUIDE and am having a problem with displaying an edited picture. I need to have buttons that edit the picture (eg. remove red, blue, green components and rotate) and display that edited picture. I am using `imshow` to display the edited picture but it displays in a new ... | 2009/04/20 | [
"https://Stackoverflow.com/questions/768510",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/90916/"
] | When you first plot the image with [`imshow`](https://www.mathworks.com/help/images/ref/imshow.html), have it return a handle to the image object it creates:
```
A = (the initial matrix of image data);
hImage = imshow(A);
```
Then, to update the image with new data, try the following instead of calling `imshow` agai... | The GUI m file functions automatically assign the image data to a variable called `hObject`. Once you have done your image alteration, you have to reassign the new data to `hObject`:
```
hObject = imshow(newimagedata)
```
Don't forget to update and save this operation by:
```
guidata(hObject, handles)
``` |
23,774 | I bought a Galaxy S3 (Android 4).
I downloaded the user manual, and I can't find a way to change the appearance. I **can** change the wallpaper and the font size, but I **can't** change drawer transition behavior, the general UI theme or the icon set. | 2012/06/03 | [
"https://android.stackexchange.com/questions/23774",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/14019/"
] | Download Apex launcher--
It has full support for themes and transitions, icons, etc-
For Icon packs, "ADW Icons" is a good keyword to use- since Apex will use ADW icons. | You could also go with [Go Launcher](https://play.google.com/store/apps/details?id=com.gau.go.launcherex), amongst many other choices. |
65,006,723 | I want to change my input which is object of nested arrays:
```
const bullets = {
one: [
[
1053, 2
],
[
2222, 7
]
],
two: [
[
1053, 4
],
[
2222, 1
]
],
three: [
[
1053, 6
],
[
2222, 12
],
],
};
```
into mapped output, which should look like this:
```
co... | 2020/11/25 | [
"https://Stackoverflow.com/questions/65006723",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11536237/"
] | You could [reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce) the objects values and check each iteration if there already is an object with the current label. If there is add the value to it's array.
Now instead of having properties like `a`, `b` or `c` i suggest ju... | I'd make an array of the properties to use (eg `a`, `b`, and `c`), then create an object indexed by labels, whose values are the items for the `result` array. Then you can iterate over the input and insert the values as required:
```js
const bullets = {
one: [
[
1053, 2
],
[
2222, 7
]
],
two: [
... |
65,006,723 | I want to change my input which is object of nested arrays:
```
const bullets = {
one: [
[
1053, 2
],
[
2222, 7
]
],
two: [
[
1053, 4
],
[
2222, 1
]
],
three: [
[
1053, 6
],
[
2222, 12
],
],
};
```
into mapped output, which should look like this:
```
co... | 2020/11/25 | [
"https://Stackoverflow.com/questions/65006723",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11536237/"
] | You could [reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce) the objects values and check each iteration if there already is an object with the current label. If there is add the value to it's array.
Now instead of having properties like `a`, `b` or `c` i suggest ju... | My answer is more like C style but it does same job.
```js
const bullets = {
one: [
[
1053, 2
],
[
2222, 7
]
],
two: [
[
1053, 4
],
[
2222, 1
]
],
three: [
[
1053, 6
],
[
2222, 12
],
],
};
var midResult = {}
var results = []
for (const key in bullets) {
co... |
65,006,723 | I want to change my input which is object of nested arrays:
```
const bullets = {
one: [
[
1053, 2
],
[
2222, 7
]
],
two: [
[
1053, 4
],
[
2222, 1
]
],
three: [
[
1053, 6
],
[
2222, 12
],
],
};
```
into mapped output, which should look like this:
```
co... | 2020/11/25 | [
"https://Stackoverflow.com/questions/65006723",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11536237/"
] | You could [reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce) the objects values and check each iteration if there already is an object with the current label. If there is add the value to it's array.
Now instead of having properties like `a`, `b` or `c` i suggest ju... | In [a comment](https://stackoverflow.com/q/65006723#comment114929295_65007110) on another answer, you implied that the key names (`'a'`, `'b'`, `'c'`) were not important. This is a technique that reuses the original names (`'one'`, `'two'`, `'three'`) instead.
```js
const transform = (bullets) => Object .entries (Obje... |
26,763,313 | I'm using rails 4.1 with heroku.
I have a problem with the date style of postgres.
When I run the app on my local machine everything works well, but after pushing to heroku it fails.
From heroku logs:
```
(PG::DatetimeFieldOverflow: ERROR: date/time field value out of range: "30/11/2014", Perhaps you need a differen... | 2014/11/05 | [
"https://Stackoverflow.com/questions/26763313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3764272/"
] | Some possible approaches you can use:
1. **handle booth paths as polygon and compare them as such**
see: [How to compare two shapes?](https://stackoverflow.com/a/22166032/2521214)
2. **use OCR algorithms/approaches**
see: [OCR and character similarity](https://stackoverflow.com/q/22786288/2521214)
3. **transform bot... | u could compare the mean and variances of the two set of points. If they are on straight lines, as you hypothesize, you could fit straight lines through the two datasets and then compare the parameters of the two straight lines to infer about their distances. It would be more helpful if you could tell the behavour of t... |
31,648,496 | I have a simple notepad with a rich text box. I have build the project to see if it works. I can open files with openFileDialog or save files with saveFileDialog.
The problem is :
if I set this notepad to by default program to open text files on windows, text doesn't appear in the notepad.
how can I make a function ... | 2015/07/27 | [
"https://Stackoverflow.com/questions/31648496",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4968909/"
] | The filename you double-click on in Explorer will be passed as an args parameter to your notepad app. So you can get the file path like this:
```
public static void Main(string[] args){
string path = args[0];
Application.Run(new Notepad(path));
}
``` | Here is an application that will read text from file if it is set as default file reader or if you drag-and-drop file to this app EXE.
This is console app but you should grasp a concept.
```
using System;
using System.IO;
namespace SampleFileOpener
{
class Program
{
static void Main(string[] args)
... |
31,648,496 | I have a simple notepad with a rich text box. I have build the project to see if it works. I can open files with openFileDialog or save files with saveFileDialog.
The problem is :
if I set this notepad to by default program to open text files on windows, text doesn't appear in the notepad.
how can I make a function ... | 2015/07/27 | [
"https://Stackoverflow.com/questions/31648496",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4968909/"
] | The filename you double-click on in Explorer will be passed as an args parameter to your notepad app. So you can get the file path like this:
```
public static void Main(string[] args){
string path = args[0];
Application.Run(new Notepad(path));
}
``` | In Form.cs (that contains designer), you can add this:
```
public void readOnOpen(string fileName)
{
path = fileName;
if (File.Exists(path))
{
// Write to file
textBox1.Text = File.ReadAllText(path);
}
}
```
In progr... |
51,798,764 | I used some free jquery libraries like jsPDF and html2pdf to export html as PDF in jquery. But non of them work properly for Persian language. How to export/convert html to PDF for Persian with Persian fonts in jquery or javascript?
please help me! | 2018/08/11 | [
"https://Stackoverflow.com/questions/51798764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9173378/"
] | You can use DocRaptor. It works for Persian and other utf-8 languages. but it's not free. In free version of library, advertising bar will be added to exporting PDF. | jsPDF can only render simple HTML to PDF
See below image, There is a tag which is not displaying properly in PDF view:

You need to use [iTextSharp](https://github.com/itext/itextsharp) in order to generate PDF from server side. it will also support ... |
51,798,764 | I used some free jquery libraries like jsPDF and html2pdf to export html as PDF in jquery. But non of them work properly for Persian language. How to export/convert html to PDF for Persian with Persian fonts in jquery or javascript?
please help me! | 2018/08/11 | [
"https://Stackoverflow.com/questions/51798764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9173378/"
] | You can use DocRaptor. It works for Persian and other utf-8 languages. but it's not free. In free version of library, advertising bar will be added to exporting PDF. | Try to use **[html2pdf](https://github.com/eKoopmans/html2pdf.js)** library for properly export Persian/Arabic characters. |
51,798,764 | I used some free jquery libraries like jsPDF and html2pdf to export html as PDF in jquery. But non of them work properly for Persian language. How to export/convert html to PDF for Persian with Persian fonts in jquery or javascript?
please help me! | 2018/08/11 | [
"https://Stackoverflow.com/questions/51798764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9173378/"
] | you can create a simple page with your report as html, and use Microsoft Print to PDF-se (Ctrl+P) to print to PDF-se and save locally | jsPDF can only render simple HTML to PDF
See below image, There is a tag which is not displaying properly in PDF view:

You need to use [iTextSharp](https://github.com/itext/itextsharp) in order to generate PDF from server side. it will also support ... |
51,798,764 | I used some free jquery libraries like jsPDF and html2pdf to export html as PDF in jquery. But non of them work properly for Persian language. How to export/convert html to PDF for Persian with Persian fonts in jquery or javascript?
please help me! | 2018/08/11 | [
"https://Stackoverflow.com/questions/51798764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9173378/"
] | you can create a simple page with your report as html, and use Microsoft Print to PDF-se (Ctrl+P) to print to PDF-se and save locally | Try to use **[html2pdf](https://github.com/eKoopmans/html2pdf.js)** library for properly export Persian/Arabic characters. |
46,932,373 | Context: In our data pipeline, we use spark SQL to run lots of queries that are supplied from our end users as text files that we then parameterise.
**Situation**:
Our queries look like:
```
INSERT OVERWRITE TABLE ... PARTITION (...)
SELECT
stuff
FROM
sometable
```
Issue is, when you look at the results of ... | 2017/10/25 | [
"https://Stackoverflow.com/questions/46932373",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3805082/"
] | Starting from spark 2.4 you can add a hint to the query to coalesce and repartition the final Select. For example:
```
INSERT OVERWRITE TABLE ... PARTITION (...)
SELECT /*+ REPARTITION(5) */ client_id, country FROM mytable;
```
This would generate 5 files.
Previously to Spark 2.4, and with a probable impact to the... | >
> (I'm aware that we should probably DISTRIBUTE BY our partition columns, but this is to provide the simplest possible example)
>
>
>
So it would seem that my attempt to simplify things is where I went wrong. If I `DISTRIBUTE BY` actual columns rather than the artificial `1` (i.e. `DISTRIBUTE BY load_date` or wh... |
46,932,373 | Context: In our data pipeline, we use spark SQL to run lots of queries that are supplied from our end users as text files that we then parameterise.
**Situation**:
Our queries look like:
```
INSERT OVERWRITE TABLE ... PARTITION (...)
SELECT
stuff
FROM
sometable
```
Issue is, when you look at the results of ... | 2017/10/25 | [
"https://Stackoverflow.com/questions/46932373",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3805082/"
] | >
> (I'm aware that we should probably DISTRIBUTE BY our partition columns, but this is to provide the simplest possible example)
>
>
>
So it would seem that my attempt to simplify things is where I went wrong. If I `DISTRIBUTE BY` actual columns rather than the artificial `1` (i.e. `DISTRIBUTE BY load_date` or wh... | that's been a real annoying problem for a while for me, and took a while for me to get around.
The following 2 approaches worked for me:
1. Running it externally as a beeline script:
```
set hive.exec.dynamic.partition.mode=nonstrict;
set hive.merge.mapfiles=true;
set hive.merge.mapredfiles=true;
... |
46,932,373 | Context: In our data pipeline, we use spark SQL to run lots of queries that are supplied from our end users as text files that we then parameterise.
**Situation**:
Our queries look like:
```
INSERT OVERWRITE TABLE ... PARTITION (...)
SELECT
stuff
FROM
sometable
```
Issue is, when you look at the results of ... | 2017/10/25 | [
"https://Stackoverflow.com/questions/46932373",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3805082/"
] | Starting from spark 2.4 you can add a hint to the query to coalesce and repartition the final Select. For example:
```
INSERT OVERWRITE TABLE ... PARTITION (...)
SELECT /*+ REPARTITION(5) */ client_id, country FROM mytable;
```
This would generate 5 files.
Previously to Spark 2.4, and with a probable impact to the... | that's been a real annoying problem for a while for me, and took a while for me to get around.
The following 2 approaches worked for me:
1. Running it externally as a beeline script:
```
set hive.exec.dynamic.partition.mode=nonstrict;
set hive.merge.mapfiles=true;
set hive.merge.mapredfiles=true;
... |
83,058 | I have the Pi 3 B+ and wanted to know if there was any way to turn of the need for the Wi-Fi localisation as when travelling around different countries and using my Pi as an access point I have keep changing it, whereas on the old Pi 3 B there was need to include this additional step? Hopefully someone may know what ne... | 2018/04/20 | [
"https://raspberrypi.stackexchange.com/questions/83058",
"https://raspberrypi.stackexchange.com",
"https://raspberrypi.stackexchange.com/users/85353/"
] | You can simply disable the wifi-country service with:
```
rpi3+ ~$ sudo systemctl disable wifi-country.service
```
But when I enable the service again it has no effect. `systemctl status wifi-country.service` tells me `Wi-Fi is disabled because the country is not set` but WiFi is always working. Seems to be a bug bu... | This is purely speculation on my part, but the Foundation states "WiFi is disabled until wireless regulatory domain is set (Pi 3 B+ only)".
I assume this is a condition of WiFi certification.
On the Pi3 the WiFi was restricted to channels 1-11, unless a suitable wireless regulatory domain is set. This satisfied all d... |
48,219,103 | Let's cut to the chase:
I want to write an iterative print statement, so that given
```
names = ["val_loss","accuracy","f2_loss"]
values= [0.2454431134, 0.832532234, 0.982762611]
```
the script should print so that numbers are round off to **6 decimal places**, and the list is **dynamically iterated on.**
Example... | 2018/01/12 | [
"https://Stackoverflow.com/questions/48219103",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1538324/"
] | You could use zip and fancy formatting ;)
```
strs = []
for (name, value) in zip(names, values):
strs.append("{}:{:.6f}".format(name, value))
print(', '.join(strs))
```
Or, as a fancy 1-liner...
```
print(', '.join(("{}:{:.6f}".format(n, v) for (n, v) in zip(names, values))))
```
**Explanation**
In Pyth... | you could do like this:-
strr = [name + ":" + str(value) + "," for name in names for value in values] |
64,467,332 | Data:
```
structure(list(Doy = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L,
1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 1L, 2L, 3L, 4L, 5L,
6L, 7L, 8L, 9L, 10L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L),
Greenup = c(108, NA, 107, NA, 108, 108, NA, 108, NA, 108,
96, 96, 97, 115, 114, 115, 97, 96, 96, 114, 99, 98, 99, 99,... | 2020/10/21 | [
"https://Stackoverflow.com/questions/64467332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8852035/"
] | The issue is that you already applied a `trans` in `scale_y_continuous`. To solve this issue you can get rid of the scale and make use of `coord_trans(y = "reverse", ylim=c(2016,2019), clip = "off")`. However, setting the limits will also remove your annotation which falls outside of the range of the limits. To solve t... | Maybe try this using `coord_cartesian()`:
```
library(ggplot2)
library(dplyr)
library(tidyr)
#Code
df_uncert %>%
pivot_longer(-c(Year,Doy)) %>%
na.omit() %>%
ggplot(., aes(y = Year, x = value, group = interaction(name,Year))) +
geom_boxplot(position = "identity", size = 0.25, outlier.shape = NA, width = 0.5) +... |
19,986,269 | I'm trying to work through some d3 tutorials so please bear with my noob questions. As I understand it, in order to create new elements of a certain type, you have to use `.selectAll()` on the non-existing elements and then use `.append()` to create them. That works great when there are no existing elements matching th... | 2013/11/14 | [
"https://Stackoverflow.com/questions/19986269",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/735374/"
] | You're saving the `rect` in `svg` and then appending to it. Simply save the `svg` element instead:
```
var svg = d3.select("body")
.append("svg")
.attr("width", w)
.attr("height", h);
// append base rectangle
svg.append("rect")
.attr("width", w)
.attr("height", h)
.attr("fill", "#ccc");
svg.se... | Change your data insert as follows:
```
svg.selectAll("rect.bars")
.data(dataset, function(d){return d;}) <-- Here *
.enter()
.append("rect")
...
```
* add the function to tell that you want to take into account all data not for the existing elements but really to generate new elements.
For more informa... |
116,822 | I have 2 questions related to a summing amplifier:
1. Why is the voltage at the inverting terminal of the input equal to zero?
2. Why is the current at the inverting terminal of the input equal to zero? | 2014/06/27 | [
"https://electronics.stackexchange.com/questions/116822",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/46346/"
] | >
> Why is the voltage at the inverting terminal of the input equal to zero?
>
>
>
Any opamp with negative feedback tries to keep its two inputs at the same voltage. Therefore, if the noninverting input is tied to ground, the action of the opamp is to keep the inverting input at ground, too.
>
> Why is the curre... | So, assuming you are using an inverting op amp with several resistors connected to the inverting terminal, the non-inverting terminal connected to ground, and a feedback resistor from the output to the inverting terminal?
In that case, the output of the amplifier will drive the feedback resistor to whatever voltage ne... |
116,822 | I have 2 questions related to a summing amplifier:
1. Why is the voltage at the inverting terminal of the input equal to zero?
2. Why is the current at the inverting terminal of the input equal to zero? | 2014/06/27 | [
"https://electronics.stackexchange.com/questions/116822",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/46346/"
] | >
> Why is the voltage at the inverting terminal of the input equal to zero?
>
>
>
Any opamp with negative feedback tries to keep its two inputs at the same voltage. Therefore, if the noninverting input is tied to ground, the action of the opamp is to keep the inverting input at ground, too.
>
> Why is the curre... | Let's assume, for the moment, that we're talking about real amplifiers. Then both of your questions are not (quite) based on accurate assumptions. Let's start with the second:
>
> 2.Why is the current at the inverting terminal of the input equal to zero?
>
>
>
Well, it's not. If you look at the data sheet for an... |
190,100 | Is there a formal term for "*gotten made*" or "*gotten synthesized*"?
To be more clear lets assume that I have a design for a special chair; I ask the carpenter to fix it for me because I don't have the tools. It won't be appropriate to say that the carpenter made/fabricated/manufactured the chair. I want to emphasize... | 2014/08/13 | [
"https://english.stackexchange.com/questions/190100",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/65734/"
] | **Commissioned**
a) An instruction, command, or role given to a person or group
b) An order for something, especially a work of art, to be produced specially:
*"Mozart at last received a commission to write an opera"*
c) A work produced in response to a commission
Source: <http://www.oxforddictionaries.com/definit... | If you don't mind drawing attention to yourself (as seems to be the case here), you could say
I **had** the chair made / constructed / crafted from ... (recycled plastic or whatever) |
190,100 | Is there a formal term for "*gotten made*" or "*gotten synthesized*"?
To be more clear lets assume that I have a design for a special chair; I ask the carpenter to fix it for me because I don't have the tools. It won't be appropriate to say that the carpenter made/fabricated/manufactured the chair. I want to emphasize... | 2014/08/13 | [
"https://english.stackexchange.com/questions/190100",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/65734/"
] | **Commissioned**
a) An instruction, command, or role given to a person or group
b) An order for something, especially a work of art, to be produced specially:
*"Mozart at last received a commission to write an opera"*
c) A work produced in response to a commission
Source: <http://www.oxforddictionaries.com/definit... | Maybe *engaged*?
>
> XYZ Carpentry Services were *engaged* to made/manufacture/build/construct the chair.
>
>
> |
190,100 | Is there a formal term for "*gotten made*" or "*gotten synthesized*"?
To be more clear lets assume that I have a design for a special chair; I ask the carpenter to fix it for me because I don't have the tools. It won't be appropriate to say that the carpenter made/fabricated/manufactured the chair. I want to emphasize... | 2014/08/13 | [
"https://english.stackexchange.com/questions/190100",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/65734/"
] | **Commissioned**
a) An instruction, command, or role given to a person or group
b) An order for something, especially a work of art, to be produced specially:
*"Mozart at last received a commission to write an opera"*
c) A work produced in response to a commission
Source: <http://www.oxforddictionaries.com/definit... | * **rendered**
* **executed** (*'design by me, implemented by craftsman'*)
* **implemented** |
190,100 | Is there a formal term for "*gotten made*" or "*gotten synthesized*"?
To be more clear lets assume that I have a design for a special chair; I ask the carpenter to fix it for me because I don't have the tools. It won't be appropriate to say that the carpenter made/fabricated/manufactured the chair. I want to emphasize... | 2014/08/13 | [
"https://english.stackexchange.com/questions/190100",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/65734/"
] | In the vein of @AlanSutherland's "*commissioned*", consider
>
> ***custom ordered*** (by *you*)
>
>
> ***made to order*** (by *ABC Carpentry*)
>
>
> For adjectives, ***custom tailored*** or simply ***tailored*** (in the US), or ***bespoke*** (in the UK, or pretentiously in the US)
>
>
> | If you don't mind drawing attention to yourself (as seems to be the case here), you could say
I **had** the chair made / constructed / crafted from ... (recycled plastic or whatever) |
190,100 | Is there a formal term for "*gotten made*" or "*gotten synthesized*"?
To be more clear lets assume that I have a design for a special chair; I ask the carpenter to fix it for me because I don't have the tools. It won't be appropriate to say that the carpenter made/fabricated/manufactured the chair. I want to emphasize... | 2014/08/13 | [
"https://english.stackexchange.com/questions/190100",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/65734/"
] | If you don't mind drawing attention to yourself (as seems to be the case here), you could say
I **had** the chair made / constructed / crafted from ... (recycled plastic or whatever) | * **rendered**
* **executed** (*'design by me, implemented by craftsman'*)
* **implemented** |
190,100 | Is there a formal term for "*gotten made*" or "*gotten synthesized*"?
To be more clear lets assume that I have a design for a special chair; I ask the carpenter to fix it for me because I don't have the tools. It won't be appropriate to say that the carpenter made/fabricated/manufactured the chair. I want to emphasize... | 2014/08/13 | [
"https://english.stackexchange.com/questions/190100",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/65734/"
] | In the vein of @AlanSutherland's "*commissioned*", consider
>
> ***custom ordered*** (by *you*)
>
>
> ***made to order*** (by *ABC Carpentry*)
>
>
> For adjectives, ***custom tailored*** or simply ***tailored*** (in the US), or ***bespoke*** (in the UK, or pretentiously in the US)
>
>
> | Maybe *engaged*?
>
> XYZ Carpentry Services were *engaged* to made/manufacture/build/construct the chair.
>
>
> |
190,100 | Is there a formal term for "*gotten made*" or "*gotten synthesized*"?
To be more clear lets assume that I have a design for a special chair; I ask the carpenter to fix it for me because I don't have the tools. It won't be appropriate to say that the carpenter made/fabricated/manufactured the chair. I want to emphasize... | 2014/08/13 | [
"https://english.stackexchange.com/questions/190100",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/65734/"
] | In the vein of @AlanSutherland's "*commissioned*", consider
>
> ***custom ordered*** (by *you*)
>
>
> ***made to order*** (by *ABC Carpentry*)
>
>
> For adjectives, ***custom tailored*** or simply ***tailored*** (in the US), or ***bespoke*** (in the UK, or pretentiously in the US)
>
>
> | * **rendered**
* **executed** (*'design by me, implemented by craftsman'*)
* **implemented** |
190,100 | Is there a formal term for "*gotten made*" or "*gotten synthesized*"?
To be more clear lets assume that I have a design for a special chair; I ask the carpenter to fix it for me because I don't have the tools. It won't be appropriate to say that the carpenter made/fabricated/manufactured the chair. I want to emphasize... | 2014/08/13 | [
"https://english.stackexchange.com/questions/190100",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/65734/"
] | Maybe *engaged*?
>
> XYZ Carpentry Services were *engaged* to made/manufacture/build/construct the chair.
>
>
> | * **rendered**
* **executed** (*'design by me, implemented by craftsman'*)
* **implemented** |
7,577,275 | I am trying to hook up a script to Microsoft's World-Wide Telescope app. The latter listens on port 5050 for commands. It is running on the same machine as the browser (Chrome right now, but as far as I can tell the behavior is the same with Firefox 7 and IE 9).
I am sending a "Access-Control-Allow-Origin: \*" header ... | 2011/09/28 | [
"https://Stackoverflow.com/questions/7577275",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/968133/"
] | For Dropzone.js case.
In my case it's was caused because of [`timeout` option](http://www.dropzonejs.com/#config-timeout) value was too low by default. So increase it by your needs.
```
{
// other dropzone options
timeout: 60000 * 10, // 10 minutes
...
}
``` | In my case, I Apache's mod-rewrite was matching the url and redirecting the request to https.
Look at the request in chrome://net-internals/#events.
It will show an internal log of the request. Check for redirects. |
7,577,275 | I am trying to hook up a script to Microsoft's World-Wide Telescope app. The latter listens on port 5050 for commands. It is running on the same machine as the browser (Chrome right now, but as far as I can tell the behavior is the same with Firefox 7 and IE 9).
I am sending a "Access-Control-Allow-Origin: \*" header ... | 2011/09/28 | [
"https://Stackoverflow.com/questions/7577275",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/968133/"
] | I have had the same problem, for me I was creating the iframe for temporary manner and I was removing the iframe before the ajax become completes, so the browser would cancel my ajax request. | I had this error in a more spooky way: The network tab and the chrome://net-internals/#events did not show the request after the js was completed. When pausing the js in the error callcack the network tab did show the request as (cancelled). The was consistently called for exactly one (always the same) of several simil... |
7,577,275 | I am trying to hook up a script to Microsoft's World-Wide Telescope app. The latter listens on port 5050 for commands. It is running on the same machine as the browser (Chrome right now, but as far as I can tell the behavior is the same with Firefox 7 and IE 9).
I am sending a "Access-Control-Allow-Origin: \*" header ... | 2011/09/28 | [
"https://Stackoverflow.com/questions/7577275",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/968133/"
] | I got this error when making a request using http to a url that required https. I guess the ajax call is not handling the redirection. This is the case even with the crossDomain ajax option set to true (on JQuery 1.5.2). | I had this error in a more spooky way: The network tab and the chrome://net-internals/#events did not show the request after the js was completed. When pausing the js in the error callcack the network tab did show the request as (cancelled). The was consistently called for exactly one (always the same) of several simil... |
7,577,275 | I am trying to hook up a script to Microsoft's World-Wide Telescope app. The latter listens on port 5050 for commands. It is running on the same machine as the browser (Chrome right now, but as far as I can tell the behavior is the same with Firefox 7 and IE 9).
I am sending a "Access-Control-Allow-Origin: \*" header ... | 2011/09/28 | [
"https://Stackoverflow.com/questions/7577275",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/968133/"
] | ### Check for page reloads.
Problem:
In my case I was reloading the page using `location.reload()` inside click event, before Ajax being fired.
Also, there was second Ajax call in the success.
Solution:
I removed the the reload and put it inside success callback of last Ajax call and it worked. | I had this issue with a particular 3G network.
It would always fail on DELETE requests with `net_error = -101` in chrome://net-internals/#events.
Other networks worked just fine so I assume there was a faulty proxy server or something. |
7,577,275 | I am trying to hook up a script to Microsoft's World-Wide Telescope app. The latter listens on port 5050 for commands. It is running on the same machine as the browser (Chrome right now, but as far as I can tell the behavior is the same with Firefox 7 and IE 9).
I am sending a "Access-Control-Allow-Origin: \*" header ... | 2011/09/28 | [
"https://Stackoverflow.com/questions/7577275",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/968133/"
] | I had a similar problem. In my case, I'm trying to use a web service on a apache server + django (the service was written by myself). I was having the same output as you: Chrome says it was cancelled while FF does it okay. If I tried to access the service directly on the the browser instead of ajax, it would work as we... | ### Check for page reloads.
Problem:
In my case I was reloading the page using `location.reload()` inside click event, before Ajax being fired.
Also, there was second Ajax call in the success.
Solution:
I removed the the reload and put it inside success callback of last Ajax call and it worked. |
7,577,275 | I am trying to hook up a script to Microsoft's World-Wide Telescope app. The latter listens on port 5050 for commands. It is running on the same machine as the browser (Chrome right now, but as far as I can tell the behavior is the same with Firefox 7 and IE 9).
I am sending a "Access-Control-Allow-Origin: \*" header ... | 2011/09/28 | [
"https://Stackoverflow.com/questions/7577275",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/968133/"
] | In my case I was having `type='submit'` so when I was submitting the form the page was reloading before the ajax hit going so a simple solution was to have `type="button"`. If you don't specify a type it's **`submit`** by default so you've gotta specify **`type="button"`**
**`type='submit'` => `type='button'`**
**OR*... | I had this issue with a particular 3G network.
It would always fail on DELETE requests with `net_error = -101` in chrome://net-internals/#events.
Other networks worked just fine so I assume there was a faulty proxy server or something. |
7,577,275 | I am trying to hook up a script to Microsoft's World-Wide Telescope app. The latter listens on port 5050 for commands. It is running on the same machine as the browser (Chrome right now, but as far as I can tell the behavior is the same with Firefox 7 and IE 9).
I am sending a "Access-Control-Allow-Origin: \*" header ... | 2011/09/28 | [
"https://Stackoverflow.com/questions/7577275",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/968133/"
] | If anyone else runs into this, the issue we had was that we were making the ajax request from a link, and not preventing the link from being followed. So if you are doing this in an `onclick` attribute, make sure to `return false;` as well. | I had a similar issue. Using chrome://net-internals/#events I was able to see that my issue was due to some silent redirect. My get request was being fired in an onload script. The url was of the form, "<http://example.com/inner-path>" and the 301 was permanently redirecting to "/inner-path". To fix the issue I just ch... |
7,577,275 | I am trying to hook up a script to Microsoft's World-Wide Telescope app. The latter listens on port 5050 for commands. It is running on the same machine as the browser (Chrome right now, but as far as I can tell the behavior is the same with Firefox 7 and IE 9).
I am sending a "Access-Control-Allow-Origin: \*" header ... | 2011/09/28 | [
"https://Stackoverflow.com/questions/7577275",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/968133/"
] | If you're using Chrome you can't see enough information in the standard Chrome networking panel to determine the root cause of a `(canceled)` request.
You need to use `chrome://net-internals/#events` which will show you the gory detail of the request you are sending - including hidden redirects / security information ... | I have had the same problem, for me I was creating the iframe for temporary manner and I was removing the iframe before the ajax become completes, so the browser would cancel my ajax request. |
7,577,275 | I am trying to hook up a script to Microsoft's World-Wide Telescope app. The latter listens on port 5050 for commands. It is running on the same machine as the browser (Chrome right now, but as far as I can tell the behavior is the same with Firefox 7 and IE 9).
I am sending a "Access-Control-Allow-Origin: \*" header ... | 2011/09/28 | [
"https://Stackoverflow.com/questions/7577275",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/968133/"
] | Two possibilities are there when AJAX request gets dropped (if not Cross-Origin request):
1. You are not preventing the element's default behavior for the event.
2. You set timeout of AJAX too low, or network/application backend server is slow.
**Solution for 1)**:
Add `return false;` or `e.preventDefault();` in the... | I had a similar issue. Using chrome://net-internals/#events I was able to see that my issue was due to some silent redirect. My get request was being fired in an onload script. The url was of the form, "<http://example.com/inner-path>" and the 301 was permanently redirecting to "/inner-path". To fix the issue I just ch... |
7,577,275 | I am trying to hook up a script to Microsoft's World-Wide Telescope app. The latter listens on port 5050 for commands. It is running on the same machine as the browser (Chrome right now, but as far as I can tell the behavior is the same with Firefox 7 and IE 9).
I am sending a "Access-Control-Allow-Origin: \*" header ... | 2011/09/28 | [
"https://Stackoverflow.com/questions/7577275",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/968133/"
] | In my case I was having `type='submit'` so when I was submitting the form the page was reloading before the ajax hit going so a simple solution was to have `type="button"`. If you don't specify a type it's **`submit`** by default so you've gotta specify **`type="button"`**
**`type='submit'` => `type='button'`**
**OR*... | ### Check for page reloads.
Problem:
In my case I was reloading the page using `location.reload()` inside click event, before Ajax being fired.
Also, there was second Ajax call in the success.
Solution:
I removed the the reload and put it inside success callback of last Ajax call and it worked. |
63,397 | >
> 山下先生のせんこうはれきしでしたか。
>
>
>
To answer the above sentence, would the sentences below be acceptable?
1. はい、そうでした。
2. はい、そうです。
Is 1 the only acceptable answer since the question is in past tense? | 2018/12/14 | [
"https://japanese.stackexchange.com/questions/63397",
"https://japanese.stackexchange.com",
"https://japanese.stackexchange.com/users/32258/"
] | Both are possible, and the choice will depend on the context and the mood. (Why is the first question in the past tense?) If you are objectively saying "Yes (that *is* right)", そうです is the natural choice. But そうでした is also fine in the following situations:
* When you are vividly recalling him at some point in the past... | I would say
>
> はい、そうです。
>
>
>
because it means `Yes, that is correct`.
Answering with `はい、そうでした` may be ok but it sounds a bit strange to me as it sounds like `Yes, that was correct`.
Other answers I may hear people say would be
>
> はい、れきしでした
>
>
> はい、れきしです
>
>
> |
116,550 | Your task is to write a program which, given a number and a string, splits the string into chunks of that size and reverses them.
Rules
-----
Your program will receive a positive integer `n`, as well as a string `s` with length at least one consisting of only printable ASCII (not including whitespace). The string sho... | 2017/04/14 | [
"https://codegolf.stackexchange.com/questions/116550",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/60042/"
] | [Jelly](https://github.com/DennisMitchell/jelly), 2 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
===================================================================================================================
```
sṚ
```
A full program that prints the result.
**[Try it online!](https://tio.run... | q, 20 bytes
===========
An anonymous composition of built-ins:
```
'[raze reverse@;cut]
```
Example:
```
q)'[raze reverse@;cut][2;"abcdefghi"]
"ighefcdab"
```
(equivalent to lambda `{raze reverse x cut y}`) |
116,550 | Your task is to write a program which, given a number and a string, splits the string into chunks of that size and reverses them.
Rules
-----
Your program will receive a positive integer `n`, as well as a string `s` with length at least one consisting of only printable ASCII (not including whitespace). The string sho... | 2017/04/14 | [
"https://codegolf.stackexchange.com/questions/116550",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/60042/"
] | [Perl 6](https://perl6.org), ~~28~~ 20 bytes
============================================
```perl6
{$^b.comb($^a).reverse.join}
```
[Try it](https://tio.run/nexus/perl6#XU7ZTsMwEHz3V4wqCyVKSA8ED41S8Q/wiCrZzuZAzaE4rYAq/HrYuIW2rOTR7OzsrPeWcHiKTCyqT9yZJiUk41FudWSaSntyq/yoowN1lqL3pqyHkX3PPdkeCXZlTdbzo0q1axwFUK3tHN5bGviM... | [Elixir](https://elixir-lang.org/), 35 bytes
============================================
```
&Enum.reverse Enum.chunk_every&2,&1
```
[Try it online!](https://tio.run/##XY3BDoIwEETvfEWTJqBJQwSjN48ePPkJplu2lChgihj15@sWJEL3sjuzLzN4q16Vdfrg4mPT16nFJ9oO2SCU6ZvrxTvvOBdx5k7n9N4/OqbTVS4SCapAXZpkzRgvDWpVSIhmzFYkum1BWpAfgjgt... |
116,550 | Your task is to write a program which, given a number and a string, splits the string into chunks of that size and reverses them.
Rules
-----
Your program will receive a positive integer `n`, as well as a string `s` with length at least one consisting of only printable ASCII (not including whitespace). The string sho... | 2017/04/14 | [
"https://codegolf.stackexchange.com/questions/116550",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/60042/"
] | [V](https://github.com/DJMcMayhem/V), ~~13~~ 10 bytes
=====================================================
```
òÀ|lDÏpòÍî
```
[Try it online!](https://tio.run/nexus/v#@3940@GGmhyXw/0FQFbv4XX//ycmJaekpqVn/DcCAA "V – TIO Nexus")
```
ò ò ' Recursively
À| ' Go to the "nth" column
l ' Move on... | [Husk](https://github.com/barbuz/Husk), 3 bytes
===============================================
```
Σ↔C
```
[Try it online!](https://tio.run/##yygtzv7//9ziR21TnP///6@UmJSckpqWnqH03xgA "Husk – Try It Online")
Takes input as two separate command-line arguments, which thanks to Husk's strong typing and overloaded buil... |
116,550 | Your task is to write a program which, given a number and a string, splits the string into chunks of that size and reverses them.
Rules
-----
Your program will receive a positive integer `n`, as well as a string `s` with length at least one consisting of only printable ASCII (not including whitespace). The string sho... | 2017/04/14 | [
"https://codegolf.stackexchange.com/questions/116550",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/60042/"
] | [Jelly](https://github.com/DennisMitchell/jelly), 2 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
===================================================================================================================
```
sṚ
```
A full program that prints the result.
**[Try it online!](https://tio.run... | [CJam](https://sourceforge.net/p/cjam), 5 bytes
===============================================
```
q~/W%
```
Input is a number and a string enclosed in double quotes, separated by whitespace.
[Try it online!](https://tio.run/nexus/cjam#@19Ypx@u@v@/kYJSYlJySmpaeoYSAA "CJam – TIO Nexus") Or [verify all test cases](h... |
116,550 | Your task is to write a program which, given a number and a string, splits the string into chunks of that size and reverses them.
Rules
-----
Your program will receive a positive integer `n`, as well as a string `s` with length at least one consisting of only printable ASCII (not including whitespace). The string sho... | 2017/04/14 | [
"https://codegolf.stackexchange.com/questions/116550",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/60042/"
] | [Stacked](https://github.com/ConorOBrien-Foxx/stacked), 9 bytes
===============================================================
```
#<rev''#`
```
[Try it online!](https://tio.run/nexus/stacked#U09MSk5JTUvPUFcw@q9sU5Rapq6unPA/v7TkPwA "Stacked – TIO Nexus")
`#<` chunks, `rev` reverses, and `''#`` joins by empty strin... | [Implicit](//git.io/sS), ~~4~~ 3 bytes
======================================
```
×®"
```
[Try it online!](https://tio.run/##K87MLchJLS5JTM7@///w9EPrlP7/T0xKTklNS8/I5DIGAA)
```
×®" « input: string, integer »;
× « split string into chunks of integer »;
® « reverse entire stack ... |
116,550 | Your task is to write a program which, given a number and a string, splits the string into chunks of that size and reverses them.
Rules
-----
Your program will receive a positive integer `n`, as well as a string `s` with length at least one consisting of only printable ASCII (not including whitespace). The string sho... | 2017/04/14 | [
"https://codegolf.stackexchange.com/questions/116550",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/60042/"
] | [Implicit](//git.io/sS), ~~4~~ 3 bytes
======================================
```
×®"
```
[Try it online!](https://tio.run/##K87MLchJLS5JTM7@///w9EPrlP7/T0xKTklNS8/I5DIGAA)
```
×®" « input: string, integer »;
× « split string into chunks of integer »;
® « reverse entire stack ... | [Factor](https://factorcode.org/), 24 bytes
===========================================
```factor
[ group reverse concat ]
```
[Try it online!](https://tio.run/##bZG9jsIwEIR7P8XiBzgdoLsCpGsRzTWIClGsnbWTgjhnO0gQ8ey5DbHFjzLdzH6alXYN6uh8v99tfzcrwBCcDmC9a5uqttB4ivHS@KqOEOivpVpTgLUQnQBWByBR6YKMLSX7BdxgNgxsSUYXqBIljXMKvcL... |
116,550 | Your task is to write a program which, given a number and a string, splits the string into chunks of that size and reverses them.
Rules
-----
Your program will receive a positive integer `n`, as well as a string `s` with length at least one consisting of only printable ASCII (not including whitespace). The string sho... | 2017/04/14 | [
"https://codegolf.stackexchange.com/questions/116550",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/60042/"
] | Pyth, 4 bytes
=============
```
s_cF
```
Takes input as `"s",n`: [Try it for yourself!](http://pyth.herokuapp.com/?code=s_cF&input=%22abcdefgh%22%2C2&debug=0) | Ruby, 37 Bytes
==============
```ruby
->n,s{s.scan(/.{1,#{n}}/).reverse*''}
```
Sample run:
```
irb(main):001:0> ->n,s{s.scan(/.{1,#{n}}/).reverse*''}[3,'abcdefgh']
=> "ghdefabc"
``` |
116,550 | Your task is to write a program which, given a number and a string, splits the string into chunks of that size and reverses them.
Rules
-----
Your program will receive a positive integer `n`, as well as a string `s` with length at least one consisting of only printable ASCII (not including whitespace). The string sho... | 2017/04/14 | [
"https://codegolf.stackexchange.com/questions/116550",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/60042/"
] | PowerShell, ~~56~~ 49 bytes
===========================
-7 bytes thanks to [mazzy](https://codegolf.stackexchange.com/users/80745/mazzy)
```
param($n,$s)$s-split"(.{$n})"-ne''|%{$r=$_+$r};$r
```
[Try it online!](https://tio.run/##XZDhSsQwEIT/5ymWsmdatKIn@kM5uAcRjqRN2kJNayIo9vrsdS6pnOdCwuzk2yXMOHwaH1rT9wtb2tG0jMqrt5... | Cheddar, 25 bytes
=================
```
s->n->s.chunk(n).rev.fuse
```
[Try it online!](https://vihan.org/p/tio/?l=cheddar&p=y0ktUUizVSjWtcvTtSvWS84ozcvWyNPUK0ot00srLU5VsOYqKMrMAyrSUMpIzcnJV9LUMNK0/g8A) |
116,550 | Your task is to write a program which, given a number and a string, splits the string into chunks of that size and reverses them.
Rules
-----
Your program will receive a positive integer `n`, as well as a string `s` with length at least one consisting of only printable ASCII (not including whitespace). The string sho... | 2017/04/14 | [
"https://codegolf.stackexchange.com/questions/116550",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/60042/"
] | [Ohm](https://github.com/MiningPotatoes/Ohm), 5 bytes
=====================================================
```
σ]QWJ
```
[Try it online!](https://tio.run/##y8/I/f//fHNsYLjX//9p@flJiUVJiVVcxgA "Ohm – Try It Online")
### Explanation
```
σ]QWJ
σ # Split input1 into input2 pieces
] # Flatten array
Q... | [Perl 5](https://www.perl.org/), 29 bytes
=========================================
My solution is almost the same as @Pavel.
Uses the `-lnM5.010` flags.
Just another 4-byte longer way to split line with **unpack** instead regexp match.
Needs one to calc penalty bytes for 3 flags?
Takes flag `M5.010` only one byte pen... |
116,550 | Your task is to write a program which, given a number and a string, splits the string into chunks of that size and reverses them.
Rules
-----
Your program will receive a positive integer `n`, as well as a string `s` with length at least one consisting of only printable ASCII (not including whitespace). The string sho... | 2017/04/14 | [
"https://codegolf.stackexchange.com/questions/116550",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/60042/"
] | JavaScript (ES6), 37 bytes
--------------------------
```
n=>F=s=>s&&F(s.slice(n))+s.slice(0,n)
```
Takes input by currying: number first, then string, like `f(2)("abcdefgh")`.
```js
let f =
n=>F=s=>s&&F(s.slice(n))+s.slice(0,n)
let g = (n, s) => console.log(`f(${n})("${s}"): ${f(n)(s)}`)
g(2, "abcdefgh")
g(3... | [V](https://github.com/DJMcMayhem/V), ~~13~~ 10 bytes
=====================================================
```
òÀ|lDÏpòÍî
```
[Try it online!](https://tio.run/nexus/v#@3940@GGmhyXw/0FQFbv4XX//ycmJaekpqVn/DcCAA "V – TIO Nexus")
```
ò ò ' Recursively
À| ' Go to the "nth" column
l ' Move on... |
82,278 | I have been at my new job for a few weeks. I was upfront during the interview and informed them that I would have to work limited hours, 4-5 hour shifts 20-25 hours a week. I have screwed up feet that cause me so much pain, and I have possibly been walking around for seven years with a torn MCL.
I am now being badger... | 2017/01/02 | [
"https://workplace.stackexchange.com/questions/82278",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/62311/"
] | You describe a situation where you were up front with the prospective employer about your needs, but they were not realistic when hiring you about their ability to support those needs.
This employer will continue to have a struggle to accept your legitimate desire for part-time work.
You have 2 options at this point:... | They will continue hounding you until you leave, you give in, or they give up. You want them to give up. Which means first you don't leave, and you never give in. Most importantly, in order to make them give up, you must *each single time* someone wants you to work more tell them in the most serious way that there is a... |
23,824,194 | Assume a method chooses an action depending on a value from a fairly large enum.
Our Sonar now complains about a high cyclomatic complexity (of about the number of case statements, naturally) of this method.
I know, large switch case statements are not really best style in OOP, but sometimes it is quite opportune to u... | 2014/05/23 | [
"https://Stackoverflow.com/questions/23824194",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2621706/"
] | Instead of using a large switch statement you can use the enums to build a state machine. What you do is take the code to parse the text in each case block, and put this in a method for each of the enum states.
From example
```
enum States implements State {
XML {
public boolean process(Context context) {... | I would suggest replacing a big switch with a hashmap/dictionary, and a command object :
```
Map<Op, Command> ops = new EnumMap<op>{{
//initialize with different command objects implementing same interface
}};
command = ops.get(result);
result = command.prepare();
``` |
23,824,194 | Assume a method chooses an action depending on a value from a fairly large enum.
Our Sonar now complains about a high cyclomatic complexity (of about the number of case statements, naturally) of this method.
I know, large switch case statements are not really best style in OOP, but sometimes it is quite opportune to u... | 2014/05/23 | [
"https://Stackoverflow.com/questions/23824194",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2621706/"
] | I would suggest replacing a big switch with a hashmap/dictionary, and a command object :
```
Map<Op, Command> ops = new EnumMap<op>{{
//initialize with different command objects implementing same interface
}};
command = ops.get(result);
result = command.prepare();
``` | You could move your logic to command classes with a shared interface (MyCommandInterface in exammple) and make make a mapping between the enum value and a command in the enum.
MyCommand implements the MyCommandInterface (Edited)
```
public enum MyEnum {
MyVALUE(new MyCommand()), MyVALUE2(new MyCommand());
priva... |
23,824,194 | Assume a method chooses an action depending on a value from a fairly large enum.
Our Sonar now complains about a high cyclomatic complexity (of about the number of case statements, naturally) of this method.
I know, large switch case statements are not really best style in OOP, but sometimes it is quite opportune to u... | 2014/05/23 | [
"https://Stackoverflow.com/questions/23824194",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2621706/"
] | Instead of using a large switch statement you can use the enums to build a state machine. What you do is take the code to parse the text in each case block, and put this in a method for each of the enum states.
From example
```
enum States implements State {
XML {
public boolean process(Context context) {... | You could move your logic to command classes with a shared interface (MyCommandInterface in exammple) and make make a mapping between the enum value and a command in the enum.
MyCommand implements the MyCommandInterface (Edited)
```
public enum MyEnum {
MyVALUE(new MyCommand()), MyVALUE2(new MyCommand());
priva... |
19,307 | I've tried both 7.x-1/7.x-2 branches of the Media module and can't find a way to set the alt-attribute on a image field using the media-widget.
When I change to the image widget it's possible to set title/alt. | 2012/01/10 | [
"https://drupal.stackexchange.com/questions/19307",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/333/"
] | After one whole day of searching and patching without success I finally found out I only simply had to download and enable [Token](https://www.drupal.org/project/token) module to make Media correctly set images `alt` and `title` attributes when inserting images in CKEditor wysiwyg. I wonder since this is nowhere stated... | There are two cases using the media file selector widget: in conjunction with *fieldS* and in conjunction with WYSIWYG editor image insert pop-up.
There are patches to the Media module for each of these that add alt/title text fields in appropriate places.
See <http://drupal.org/node/1307054> and <http://drupal.org/n... |
19,307 | I've tried both 7.x-1/7.x-2 branches of the Media module and can't find a way to set the alt-attribute on a image field using the media-widget.
When I change to the image widget it's possible to set title/alt. | 2012/01/10 | [
"https://drupal.stackexchange.com/questions/19307",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/333/"
] | After one whole day of searching and patching without success I finally found out I only simply had to download and enable [Token](https://www.drupal.org/project/token) module to make Media correctly set images `alt` and `title` attributes when inserting images in CKEditor wysiwyg. I wonder since this is nowhere stated... | Alt tags and title tags are now available in the 2.x-dev releases of the media module. |
17,590,007 | Is it possible to change the order of a column-header click sort?
I have a "ranking" column, which upon first click will sort by ASC, and only on 2nd click would go to DESC sort - I need to reverse that so that 1st click is DESC, and 2nd click is ASC.
Is this possible?
```
return new CSqlDataProvider($sql . $search,... | 2013/07/11 | [
"https://Stackoverflow.com/questions/17590007",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/280143/"
] | The only way I know of to do this is a hack that results in column arrows pointing the wrong way.
```
'desc' => 'rating * percent / 100 ASC',
'asc' => 'rating * percent / 100 DESC',
``` | I think it will show the `CGridView` in descending order by default if you click the header it will display in `ASC` if u want the reverse process do it in the reverse
```
public function search($status)
{
$criteria = new CDbCriteria;
$criteria->order = 'store_name desc';
}
``` |
17,590,007 | Is it possible to change the order of a column-header click sort?
I have a "ranking" column, which upon first click will sort by ASC, and only on 2nd click would go to DESC sort - I need to reverse that so that 1st click is DESC, and 2nd click is ASC.
Is this possible?
```
return new CSqlDataProvider($sql . $search,... | 2013/07/11 | [
"https://Stackoverflow.com/questions/17590007",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/280143/"
] | I think it will show the `CGridView` in descending order by default if you click the header it will display in `ASC` if u want the reverse process do it in the reverse
```
public function search($status)
{
$criteria = new CDbCriteria;
$criteria->order = 'store_name desc';
}
``` | As of Yii 1.1.3 there was added `default` key support for attributes settings. This does exactly what you want. Example:
```
'sort' => array(
'attributes' => array (
'enabled',
'store_name',
'rating' => array (
'desc' => 'rating * percent / 100 DESC',
'asc' => 'ratin... |
17,590,007 | Is it possible to change the order of a column-header click sort?
I have a "ranking" column, which upon first click will sort by ASC, and only on 2nd click would go to DESC sort - I need to reverse that so that 1st click is DESC, and 2nd click is ASC.
Is this possible?
```
return new CSqlDataProvider($sql . $search,... | 2013/07/11 | [
"https://Stackoverflow.com/questions/17590007",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/280143/"
] | The only way I know of to do this is a hack that results in column arrows pointing the wrong way.
```
'desc' => 'rating * percent / 100 ASC',
'asc' => 'rating * percent / 100 DESC',
``` | As of Yii 1.1.3 there was added `default` key support for attributes settings. This does exactly what you want. Example:
```
'sort' => array(
'attributes' => array (
'enabled',
'store_name',
'rating' => array (
'desc' => 'rating * percent / 100 DESC',
'asc' => 'ratin... |
12,016,328 | >
> syslog() generates a log message
>
>
> syslog(LOG\_ERR, "%s failed: %d (%m)", str, errno); syslog(LOG\_NOTICE,
> "%s failed: %d (%m)", str, errno); syslog(LOG\_INFO,"%s",str);
>
>
>
where does it store this info?
I can not find any file in the server by the name of LOG\_ERR, LOG\_NOTICE,LOG\_INFO.
Please ... | 2012/08/18 | [
"https://Stackoverflow.com/questions/12016328",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1447359/"
] | Under **Linux** you can find them here : `/var/log/syslog`, if you run this simple program:
```
#include <syslog.h>
int main(int argc, char **argv)
{
/* Various syslog messages */
syslog (LOG_CRIT, "%s", "That's critic");
syslog(LOG_ALERT, "An alert\n");
syslog(LOG_ERR, "Error on this ... | They get dumped into the syslog buffer where `syslogd`/`rsyslogd` picks them up and puts them in the appropriate locations as determined by its configuration in `/etc`. |
59,605,403 | I have a CallableStatement like
```
CallableStatement cStmt = connection.prepareCall("{ ? = call schemaName.doSomethingFunction(?) }"));
```
IntelliJ is showing error in the editor "Unable to resolve symbol 'schemaName'". Although the code executes fine but I want to remove this error.
I also have a data source set... | 2020/01/06 | [
"https://Stackoverflow.com/questions/59605403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4444884/"
] | You need to [configure the data source](https://www.jetbrains.com/help/idea/connecting-to-a-database.html) for this project and [synchronize](https://www.jetbrains.com/help/idea/cannot-find-a-database-object-in-the-database-tree-view.html#step-1-refresh-the-database-state) it so that you see this schema and this functi... | This should work, assuming you want to register `IN` and `OUT` parameters:
```
CallableStatement cStmt = connection.prepareCall("{ call schemaName.doSomethingFunction(?,?) }"));
```
**For Example**: you can register parameters, assuming first is `IN` parameter and second is `OUT` parameter:
```
cStmt.setInt(1, 3);
... |
12,483,330 | What is the best (and fastest) way, in Python 2.7.x, to check if a string (or any other data type) exists in a nested tuple?
For example:
```
RECIPES = (
('apple', 'sugar', 'extreme_Force'),
('banana', 'syrup', 'magical_ends'),
('caramel', 'chocolate', 'pancake_MONSTER'),
('banana',('someAnother','ban... | 2012/09/18 | [
"https://Stackoverflow.com/questions/12483330",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1505757/"
] | A generator could do this nicely if you only need the first match:
```
def find_location(text):
try:
return next((i, j)
for i, t in enumerate(RECIPES)
for j, v in enumerate(t)
if v == text)
except StopIteration:
return (None, None) # not found
```
Usage:
... | use a for-loop to find if the item exists or not, and break the loop as soon as it is found.
```
In [48]: RECIPES = (
....: ('apple', 'sugar', 'extreme_Force'),
....: ('banana', 'syrup', 'magical_ends'),
....: ('caramel', 'chocolate', 'pancake_MONSTER'),
....: )
In [49]: for i,x in enumerate(R... |
12,483,330 | What is the best (and fastest) way, in Python 2.7.x, to check if a string (or any other data type) exists in a nested tuple?
For example:
```
RECIPES = (
('apple', 'sugar', 'extreme_Force'),
('banana', 'syrup', 'magical_ends'),
('caramel', 'chocolate', 'pancake_MONSTER'),
('banana',('someAnother','ban... | 2012/09/18 | [
"https://Stackoverflow.com/questions/12483330",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1505757/"
] | A generator could do this nicely if you only need the first match:
```
def find_location(text):
try:
return next((i, j)
for i, t in enumerate(RECIPES)
for j, v in enumerate(t)
if v == text)
except StopIteration:
return (None, None) # not found
```
Usage:
... | Why not try `numpy`?
```
import numpy as np
RECIPES = (
('apple', 'sugar', 'extreme_Force'),
('banana', 'syrup', 'magical_ends'),
('caramel', 'chocolate', 'pancake_MONSTER'),
)
np_recipes = np.array(recipes)
indices = zip(*np.where( np_recipes == 'banana' ) ) #[(1, 0)]
```
This works for your example bec... |
12,483,330 | What is the best (and fastest) way, in Python 2.7.x, to check if a string (or any other data type) exists in a nested tuple?
For example:
```
RECIPES = (
('apple', 'sugar', 'extreme_Force'),
('banana', 'syrup', 'magical_ends'),
('caramel', 'chocolate', 'pancake_MONSTER'),
('banana',('someAnother','ban... | 2012/09/18 | [
"https://Stackoverflow.com/questions/12483330",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1505757/"
] | Recursive multi-location indexing:
```
import sys
from collections import Sequence,defaultdict
#making code python3-compatible
if sys.version_info[0] == 3:
basestring = str
def buildLocator(tree):
locator = defaultdict(list)
def fillLocator(tree, locator,location):
for index,item in enumerate(tre... | A generator could do this nicely if you only need the first match:
```
def find_location(text):
try:
return next((i, j)
for i, t in enumerate(RECIPES)
for j, v in enumerate(t)
if v == text)
except StopIteration:
return (None, None) # not found
```
Usage:
... |
12,483,330 | What is the best (and fastest) way, in Python 2.7.x, to check if a string (or any other data type) exists in a nested tuple?
For example:
```
RECIPES = (
('apple', 'sugar', 'extreme_Force'),
('banana', 'syrup', 'magical_ends'),
('caramel', 'chocolate', 'pancake_MONSTER'),
('banana',('someAnother','ban... | 2012/09/18 | [
"https://Stackoverflow.com/questions/12483330",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1505757/"
] | Recursive multi-location indexing:
```
import sys
from collections import Sequence,defaultdict
#making code python3-compatible
if sys.version_info[0] == 3:
basestring = str
def buildLocator(tree):
locator = defaultdict(list)
def fillLocator(tree, locator,location):
for index,item in enumerate(tre... | use a for-loop to find if the item exists or not, and break the loop as soon as it is found.
```
In [48]: RECIPES = (
....: ('apple', 'sugar', 'extreme_Force'),
....: ('banana', 'syrup', 'magical_ends'),
....: ('caramel', 'chocolate', 'pancake_MONSTER'),
....: )
In [49]: for i,x in enumerate(R... |
12,483,330 | What is the best (and fastest) way, in Python 2.7.x, to check if a string (or any other data type) exists in a nested tuple?
For example:
```
RECIPES = (
('apple', 'sugar', 'extreme_Force'),
('banana', 'syrup', 'magical_ends'),
('caramel', 'chocolate', 'pancake_MONSTER'),
('banana',('someAnother','ban... | 2012/09/18 | [
"https://Stackoverflow.com/questions/12483330",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1505757/"
] | Recursive multi-location indexing:
```
import sys
from collections import Sequence,defaultdict
#making code python3-compatible
if sys.version_info[0] == 3:
basestring = str
def buildLocator(tree):
locator = defaultdict(list)
def fillLocator(tree, locator,location):
for index,item in enumerate(tre... | Why not try `numpy`?
```
import numpy as np
RECIPES = (
('apple', 'sugar', 'extreme_Force'),
('banana', 'syrup', 'magical_ends'),
('caramel', 'chocolate', 'pancake_MONSTER'),
)
np_recipes = np.array(recipes)
indices = zip(*np.where( np_recipes == 'banana' ) ) #[(1, 0)]
```
This works for your example bec... |
44,113,269 | I need to perform these instructions in order to mount a device:
```
mkfs.ext4 -F /dev/disk/by-id/scsi-0DO_Volume_baz
mkdir -p /mnt/baz;
mount -o discard,defaults /dev/disk/by-id/scsi-0DO_Volume_baz /mnt/baz
echo /dev/disk/by-id/scsi-0DO_Volume_baz /mnt/baz ext4 defaults,nofail,discard 0 0 | sudo tee -a /etc/fstab
`... | 2017/05/22 | [
"https://Stackoverflow.com/questions/44113269",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3227319/"
] | You can use community [filesystem cookbook](https://supermarket.chef.io/cookbooks/filesystem) | If nothing else you can use a `bash` resource to run whatever you want. But in this case it would probably be easier to use a `directory` resource and a `mount` resource. The `mkfs` command is a bit harder to deal with since you only want to run that if the device isn't already initialized. You can usually use other co... |
58,629,218 | I install pychram to my Pop Os, but some case my pycharm is not work, becouse I want to completly remove pychrm. Any help will be appreciated | 2019/10/30 | [
"https://Stackoverflow.com/questions/58629218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11343535/"
] | With `.slice`, you're creating two copies of the array and then merging them. That's not very optimal, `.splice` on the other hand can be as fast as the underlying array implementation is.
Additionally in general, it's usually better to have methods that do what they say, even if there's an alternative. Both `.slice` ... | So I have an application written in PHP that naturally uses JS on the front end. This app allows a user to query the students within a school and district. So the flow goes: choose your district, that sends an ajax call to the server to retrieve the schools associated with that district. This then populates the next se... |
58,629,218 | I install pychram to my Pop Os, but some case my pycharm is not work, becouse I want to completly remove pychrm. Any help will be appreciated | 2019/10/30 | [
"https://Stackoverflow.com/questions/58629218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11343535/"
] | With `.slice`, you're creating two copies of the array and then merging them. That's not very optimal, `.splice` on the other hand can be as fast as the underlying array implementation is.
Additionally in general, it's usually better to have methods that do what they say, even if there's an alternative. Both `.slice` ... | splice is mutating existing array whereas slice creates a shallow copy of the array.
Use splice when you want to add/delete items from the original array.
Use slice when you want to copy the array.
In old js days slice was used to copy arguments into an array
```js
function () {
typeof arguments.map; // => 'undefin... |
58,629,218 | I install pychram to my Pop Os, but some case my pycharm is not work, becouse I want to completly remove pychrm. Any help will be appreciated | 2019/10/30 | [
"https://Stackoverflow.com/questions/58629218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11343535/"
] | With `.slice`, you're creating two copies of the array and then merging them. That's not very optimal, `.splice` on the other hand can be as fast as the underlying array implementation is.
Additionally in general, it's usually better to have methods that do what they say, even if there's an alternative. Both `.slice` ... | >
> Considering that you can do everything with slice that you can do with splice (given it takes a couple extra lines of code), when would you ever use splice over slice to modify an array?
>
>
>
First of all `slice` can't do what `splice` does and `splice` can't do what `slice` does. The important difference is ... |
58,629,218 | I install pychram to my Pop Os, but some case my pycharm is not work, becouse I want to completly remove pychrm. Any help will be appreciated | 2019/10/30 | [
"https://Stackoverflow.com/questions/58629218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11343535/"
] | splice is mutating existing array whereas slice creates a shallow copy of the array.
Use splice when you want to add/delete items from the original array.
Use slice when you want to copy the array.
In old js days slice was used to copy arguments into an array
```js
function () {
typeof arguments.map; // => 'undefin... | So I have an application written in PHP that naturally uses JS on the front end. This app allows a user to query the students within a school and district. So the flow goes: choose your district, that sends an ajax call to the server to retrieve the schools associated with that district. This then populates the next se... |
58,629,218 | I install pychram to my Pop Os, but some case my pycharm is not work, becouse I want to completly remove pychrm. Any help will be appreciated | 2019/10/30 | [
"https://Stackoverflow.com/questions/58629218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11343535/"
] | splice is mutating existing array whereas slice creates a shallow copy of the array.
Use splice when you want to add/delete items from the original array.
Use slice when you want to copy the array.
In old js days slice was used to copy arguments into an array
```js
function () {
typeof arguments.map; // => 'undefin... | >
> Considering that you can do everything with slice that you can do with splice (given it takes a couple extra lines of code), when would you ever use splice over slice to modify an array?
>
>
>
First of all `slice` can't do what `splice` does and `splice` can't do what `slice` does. The important difference is ... |
59,839,319 | I need to get the release date of a song.
In last.fm API, like described on the documentation, is enough to make an HTTP request to the server and it will reply with an XML (or JSON) that contain the field "" (like is shown in the Sample Response on the website).
The problem is that if I call with the same request in... | 2020/01/21 | [
"https://Stackoverflow.com/questions/59839319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11989919/"
] | Definitely an inconsistency in the Last.fm API documentation vs the actual response.
The only other place where such an info might be available is the artist.getTopAlbums, but the release date is not available there either.
So, to answer your question, no, it is not possible to get the release date of the album via t... | I'm having the same issue - the release date doesn't come back. I've opted to use the MusicBrainz API to get the album details. However the issue with that is the calls will come back as 500s if too many requests are made in quick succession - the only workaround that I can find is to put a second delay on each call, w... |
11,522,844 | I removed a development path in MKS and now I want to remove/delete the sandbox I created for it. In the UI I cannot drop a sandbox without opening it first, but I cannot open variant sandbox once their dev path was removed. In the command line interface "si dropsandbox" also reports an error related to the existence o... | 2012/07/17 | [
"https://Stackoverflow.com/questions/11522844",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/578668/"
] | The key for dropping your sandbox is to set the delete option to "nothing". This will prevent the MKS client from doing any project lookup on the server.
You can drop from the graphical client by right clicking on the "My Sandboxes" window, or from the command line:
```
si dropsandbox --delete=none c:\mysandbox\proje... | other option is to delete the sandbox directly using windows explorer, not the MKS GUI. important is to have the .pj file removed, then the sandbox will be ignored by MKS at all in its GUI. |
2,450,556 | I'm trying to set my simulation params in constant memory but without luck (CUDA.NET).
cudaMemcpyToSymbol function returns cudaErrorInvalidSymbol. The first parameter in cudaMemcpyToSymbol is string... Is it symbol name? actualy I don't understand how it could be resolved. Any help appreciated.
```
//init, load .cubin... | 2010/03/15 | [
"https://Stackoverflow.com/questions/2450556",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165614/"
] | Unfortunately the \_\_ constant \_\_ must be in the same file scope as the memcpy to the symbol, and in your case your \_\_ constant \_\_ is in a separate .cu file.
The simple way around this is to provide a wrapper function in your .cu file, for example:
```
__constant__ float param;
// Host function to set the con... | constant memory has implicit local scope linkage.
make sure declaration is in the same file where you use it. it sounds like you have two files.
may also have to declare `param` to array (or maybe not) |
2,450,556 | I'm trying to set my simulation params in constant memory but without luck (CUDA.NET).
cudaMemcpyToSymbol function returns cudaErrorInvalidSymbol. The first parameter in cudaMemcpyToSymbol is string... Is it symbol name? actualy I don't understand how it could be resolved. Any help appreciated.
```
//init, load .cubin... | 2010/03/15 | [
"https://Stackoverflow.com/questions/2450556",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165614/"
] | If this question is actual you can use **cuModuleGetGlobal** and next **cudaMemcpy** like this:
```
private bool setValueToSymbol(CUmodule module, string symbol, int value)
{
CUdeviceptr devPtr = new CUdeviceptr();
uint lenBytes = 0;
CUResult result = CUDADriver.cuModuleGetGlobal(ref devPtr, ref lenBytes, ... | constant memory has implicit local scope linkage.
make sure declaration is in the same file where you use it. it sounds like you have two files.
may also have to declare `param` to array (or maybe not) |
2,450,556 | I'm trying to set my simulation params in constant memory but without luck (CUDA.NET).
cudaMemcpyToSymbol function returns cudaErrorInvalidSymbol. The first parameter in cudaMemcpyToSymbol is string... Is it symbol name? actualy I don't understand how it could be resolved. Any help appreciated.
```
//init, load .cubin... | 2010/03/15 | [
"https://Stackoverflow.com/questions/2450556",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165614/"
] | Unfortunately the \_\_ constant \_\_ must be in the same file scope as the memcpy to the symbol, and in your case your \_\_ constant \_\_ is in a separate .cu file.
The simple way around this is to provide a wrapper function in your .cu file, for example:
```
__constant__ float param;
// Host function to set the con... | If this question is actual you can use **cuModuleGetGlobal** and next **cudaMemcpy** like this:
```
private bool setValueToSymbol(CUmodule module, string symbol, int value)
{
CUdeviceptr devPtr = new CUdeviceptr();
uint lenBytes = 0;
CUResult result = CUDADriver.cuModuleGetGlobal(ref devPtr, ref lenBytes, ... |
655,497 | I am looking to do this step: 'Creating a New FTP Site by Editing the IIS 7.0 Configuration Files' with a batch file and was wondering if anybody has done this already?
<http://learn.iis.net/page.aspx/301/creating-a-new-ftp-site/> | 2009/03/17 | [
"https://Stackoverflow.com/questions/655497",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Try this. You need to reference the COM component "AppHostAdminLibrary"
```
using AppHostAdminLibrary;
...
public void AddFtp7Site(String siteName, String siteId, String siteRoot) {
String configPath;
String configSectionName;
var fNewSite = false;
var fNewApplication = false;
var fNewVDir = fals... | Does this help?:
<http://blogs.iis.net/jaroslad/archive/2007/06/13/how-to-programatically-create-an-ftp7-site.aspx> |
44,829,147 | Is there any more functional alternative in Scala for an infinite loop?
```
while(true) {
if (condition) {
// Do something
} else {
Thread.sleep(interval);
}
}
``` | 2017/06/29 | [
"https://Stackoverflow.com/questions/44829147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/777833/"
] | You can do it recursively
```
@tailrec
def loop(): Nothing = {
if (condition) {
// Do something
} else {
Thread.sleep(interval);
}
loop()
}
``` | I guess infinite tail recursion:
```
@tailrec
def loop(): Nothing = {
if (condition) {
// Do something
} else {
Thread.sleep(interval);
}
loop()
}
``` |
44,829,147 | Is there any more functional alternative in Scala for an infinite loop?
```
while(true) {
if (condition) {
// Do something
} else {
Thread.sleep(interval);
}
}
``` | 2017/06/29 | [
"https://Stackoverflow.com/questions/44829147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/777833/"
] | One thing that you can do is using higher-order functions like `Stream.continually` and pair it up with a `for` comprehension:
```
import scala.util.Random
import scala.collection.immutable.Stream.continually
def rollTheDice: Int = Random.nextInt(6) + 1
for (n <- continually(rollTheDice)) {
println(s"the dice roll... | You can do it recursively
```
@tailrec
def loop(): Nothing = {
if (condition) {
// Do something
} else {
Thread.sleep(interval);
}
loop()
}
``` |
44,829,147 | Is there any more functional alternative in Scala for an infinite loop?
```
while(true) {
if (condition) {
// Do something
} else {
Thread.sleep(interval);
}
}
``` | 2017/06/29 | [
"https://Stackoverflow.com/questions/44829147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/777833/"
] | You can do it recursively
```
@tailrec
def loop(): Nothing = {
if (condition) {
// Do something
} else {
Thread.sleep(interval);
}
loop()
}
``` | Just to add to Stefano's great answer, in case someone is looking to a use-case like mine:
I was working on tasks from Kafka Streams course and needed to create an infinite stream of mock events to Kafka with some fields being completely random(amounts), but others rotated within a specific list(names).
The same appr... |
44,829,147 | Is there any more functional alternative in Scala for an infinite loop?
```
while(true) {
if (condition) {
// Do something
} else {
Thread.sleep(interval);
}
}
``` | 2017/06/29 | [
"https://Stackoverflow.com/questions/44829147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/777833/"
] | One thing that you can do is using higher-order functions like `Stream.continually` and pair it up with a `for` comprehension:
```
import scala.util.Random
import scala.collection.immutable.Stream.continually
def rollTheDice: Int = Random.nextInt(6) + 1
for (n <- continually(rollTheDice)) {
println(s"the dice roll... | I guess infinite tail recursion:
```
@tailrec
def loop(): Nothing = {
if (condition) {
// Do something
} else {
Thread.sleep(interval);
}
loop()
}
``` |
44,829,147 | Is there any more functional alternative in Scala for an infinite loop?
```
while(true) {
if (condition) {
// Do something
} else {
Thread.sleep(interval);
}
}
``` | 2017/06/29 | [
"https://Stackoverflow.com/questions/44829147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/777833/"
] | I guess infinite tail recursion:
```
@tailrec
def loop(): Nothing = {
if (condition) {
// Do something
} else {
Thread.sleep(interval);
}
loop()
}
``` | Just to add to Stefano's great answer, in case someone is looking to a use-case like mine:
I was working on tasks from Kafka Streams course and needed to create an infinite stream of mock events to Kafka with some fields being completely random(amounts), but others rotated within a specific list(names).
The same appr... |
44,829,147 | Is there any more functional alternative in Scala for an infinite loop?
```
while(true) {
if (condition) {
// Do something
} else {
Thread.sleep(interval);
}
}
``` | 2017/06/29 | [
"https://Stackoverflow.com/questions/44829147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/777833/"
] | One thing that you can do is using higher-order functions like `Stream.continually` and pair it up with a `for` comprehension:
```
import scala.util.Random
import scala.collection.immutable.Stream.continually
def rollTheDice: Int = Random.nextInt(6) + 1
for (n <- continually(rollTheDice)) {
println(s"the dice roll... | Just to add to Stefano's great answer, in case someone is looking to a use-case like mine:
I was working on tasks from Kafka Streams course and needed to create an infinite stream of mock events to Kafka with some fields being completely random(amounts), but others rotated within a specific list(names).
The same appr... |
67,478,804 | I have the following subscription in an angular application:
```
private _sub: Subscription;
```
On initialization I subscribe to a firebase get function:
```
this._sub = this.service.get('database1').subscribe(
data => {
this.ListOfData = data;
}
);
```
But depending on user input I change `databas... | 2021/05/10 | [
"https://Stackoverflow.com/questions/67478804",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14412611/"
] | Short answer: No it doesn't...I'll share the details on why
Whenever `.subscribe()` is called, [a new instance of a `Subscription` is created](https://rxjs.dev/guide/subscription) that holds resources that listen to the execution of the Observable. If you call `.subscribe()` and do not call `.unsubscribe()`, your Subs... | No, you have to unsubscribe. Sometimes they stay like sleeper cells to damage your application performance. Best practice is unsubscribe. |
11,980,983 | A simple question on how database Indexes work.
Suppose i have a table 'Student' with columns id(primary\_key), name and GPA. Assume that i have an index on id and on no other columns
Now if i query for a record using name and GPA(not with id), it has to search all records for a match. what is the advantage of index ... | 2012/08/16 | [
"https://Stackoverflow.com/questions/11980983",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/984735/"
] | >
> if i query for a record using name and GPA(not with id), it has to search all records for a match. what is the advantage of index here?
>
>
>
You are correct. There is no advantage, except that unique indexes may also enforce uniqueness
>
> Are the indexes effective only when the query contains the indexed c... | Just to add some examples to Bohemian's answer (and assuming a SQL RDBMS):
1. An index IX1 on Student(name) will benefit the following query:
`SELECT * FROM Student WHERE name = 'Bloggs';`
2. Similarly you would need an index say IX2 on Student(GPA) for
`SELECT * FROM Student WHERE GPA between 1 and 2;`
3. If you ha... |
53,804,011 | Winforms C#
I'm implementing a power up system in my snake game and every time i run the method to spawn a power up the window completely stops as if it was processing something heavy but forever. i don't get any error nor windows asking to close window.
this is my script:
```
private void spawn_powerup()
... | 2018/12/16 | [
"https://Stackoverflow.com/questions/53804011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10642253/"
] | You never set `done` to `false` inside your `do-while-loop`.
So if within your first iteration your if expression evaluates to `true`, `done` is set to `true` and your `do-while` runs forever
For what I think you want to achieve change your `do-while` condition to `!done`, but then you have to make sure that your `if... | First of all your while logic is wrong. While loop continues when it is set to `true`, and exits whenever it gets `false` or `break;` command is issued.
Also you are using Synchronous programming pattern. So your application runs on single thread and whenever you call long running function you application start to wai... |
53,804,011 | Winforms C#
I'm implementing a power up system in my snake game and every time i run the method to spawn a power up the window completely stops as if it was processing something heavy but forever. i don't get any error nor windows asking to close window.
this is my script:
```
private void spawn_powerup()
... | 2018/12/16 | [
"https://Stackoverflow.com/questions/53804011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10642253/"
] | You never set `done` to `false` inside your `do-while-loop`.
So if within your first iteration your if expression evaluates to `true`, `done` is set to `true` and your `do-while` runs forever
For what I think you want to achieve change your `do-while` condition to `!done`, but then you have to make sure that your `if... | Your loop conditions will never allow it to stop, since you wrote `while(done)`, which means: "while done is set to true", which it always is.
You should change you loop to this:
```
bool done = false;
do
{
(- your code here -)
} while (!done);
``` |
13,132,478 | I'm trying to write a very simple markup language in PHP that contains tags like [x=123], and I need to be able to match that tag and extract only the value of x.
I'm assuming the answer involves regex but maybe I'm wrong.
So if we had a string:
```
$str = "F9F[x=]]^$^$[x=123]#3j3E]]#J";
```
And a regular expressi... | 2012/10/30 | [
"https://Stackoverflow.com/questions/13132478",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1651225/"
] | Change the input type submit to button and make a click event for every button to submit respective form,
```
<input type="button" onClick="submit_form1()" value="submit form1">
<script type="text/javascript">
function submit_form1()
{ alert("submit me");
f1.submit();
}
</script>
``` | ```
<!--
(1) Property 'name' has no meaning in 'form' tag
(2) Set the desired URL in 'action'
(3) Set ID for the forms to call from JS
(4) Use JavaScript to call the '.submit()' method
-->
<form method="POST" action='your-page-url' id="form1">
<input type='submit' value='submit'/>
</form>
<form method="POST" action... |
13,132,478 | I'm trying to write a very simple markup language in PHP that contains tags like [x=123], and I need to be able to match that tag and extract only the value of x.
I'm assuming the answer involves regex but maybe I'm wrong.
So if we had a string:
```
$str = "F9F[x=]]^$^$[x=123]#3j3E]]#J";
```
And a regular expressi... | 2012/10/30 | [
"https://Stackoverflow.com/questions/13132478",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1651225/"
] | Change the input type submit to button and make a click event for every button to submit respective form,
```
<input type="button" onClick="submit_form1()" value="submit form1">
<script type="text/javascript">
function submit_form1()
{ alert("submit me");
f1.submit();
}
</script>
``` | `document.forms['f1'].submit();` first form will get submitted ,but here you does not need a js submission when you press submit the form corresponding to the that submit button will only be submitted .this will be clear if u print the post value at server side.in your second form u need a submit button not a simple bu... |
13,132,478 | I'm trying to write a very simple markup language in PHP that contains tags like [x=123], and I need to be able to match that tag and extract only the value of x.
I'm assuming the answer involves regex but maybe I'm wrong.
So if we had a string:
```
$str = "F9F[x=]]^$^$[x=123]#3j3E]]#J";
```
And a regular expressi... | 2012/10/30 | [
"https://Stackoverflow.com/questions/13132478",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1651225/"
] | You can send the form ID to a Javascript "submitter" function and use it to submit:
```
<form name="f1" id="f1" method='post' action=''>
<a href="javascript: submitform("f1")">submit</a>
</form>
<form name="f2" id="f2" method='post' action=''>
<input type='text' name='text2'>
<a href="javascript: submitform("f2... | ```
<!--
(1) Property 'name' has no meaning in 'form' tag
(2) Set the desired URL in 'action'
(3) Set ID for the forms to call from JS
(4) Use JavaScript to call the '.submit()' method
-->
<form method="POST" action='your-page-url' id="form1">
<input type='submit' value='submit'/>
</form>
<form method="POST" action... |
13,132,478 | I'm trying to write a very simple markup language in PHP that contains tags like [x=123], and I need to be able to match that tag and extract only the value of x.
I'm assuming the answer involves regex but maybe I'm wrong.
So if we had a string:
```
$str = "F9F[x=]]^$^$[x=123]#3j3E]]#J";
```
And a regular expressi... | 2012/10/30 | [
"https://Stackoverflow.com/questions/13132478",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1651225/"
] | You can send the form ID to a Javascript "submitter" function and use it to submit:
```
<form name="f1" id="f1" method='post' action=''>
<a href="javascript: submitform("f1")">submit</a>
</form>
<form name="f2" id="f2" method='post' action=''>
<input type='text' name='text2'>
<a href="javascript: submitform("f2... | `document.forms['f1'].submit();` first form will get submitted ,but here you does not need a js submission when you press submit the form corresponding to the that submit button will only be submitted .this will be clear if u print the post value at server side.in your second form u need a submit button not a simple bu... |
3,993,730 | I've heard it's better to read the [first edition](https://rads.stackoverflow.com/amzn/click/com/0134841972) of "Introduction to Functional Programming" by Bird & Wadler than the [second edition](https://rads.stackoverflow.com/amzn/click/com/0134843460). The first edition uses [Miranda](http://miranda.org.uk/), and the... | 2010/10/22 | [
"https://Stackoverflow.com/questions/3993730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/58634/"
] | I haven't read Bird & Wadler, but Miranda and Haskell are similar--purely functional, nonstrict, statically typed, etc. If language is your only consideration when choosing the edition, I'd choose Haskell because it's more popular and free, and hence easier to get hands-on experience with.
I haven't used Miranda, but ... | I used Haskell, it is a purely functional language and it is pretty standard. I don't remember Miranda very well but I think that is not purely functional, same as F# and Scala. My sugestion is learn the pure way, it is probaly the hardest but don't take any shortcut with functional programming, that way you will never... |
3,993,730 | I've heard it's better to read the [first edition](https://rads.stackoverflow.com/amzn/click/com/0134841972) of "Introduction to Functional Programming" by Bird & Wadler than the [second edition](https://rads.stackoverflow.com/amzn/click/com/0134843460). The first edition uses [Miranda](http://miranda.org.uk/), and the... | 2010/10/22 | [
"https://Stackoverflow.com/questions/3993730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/58634/"
] | I strongly recommend the second edition, which is an extensively revised, extended and mostly improved revision of the first edition. I have read both editions. The first edition has an example on solving the 8 queens problem with backtracking, unfortunately this example was dropped in the second edition. The second ed... | I used Haskell, it is a purely functional language and it is pretty standard. I don't remember Miranda very well but I think that is not purely functional, same as F# and Scala. My sugestion is learn the pure way, it is probaly the hardest but don't take any shortcut with functional programming, that way you will never... |
3,993,730 | I've heard it's better to read the [first edition](https://rads.stackoverflow.com/amzn/click/com/0134841972) of "Introduction to Functional Programming" by Bird & Wadler than the [second edition](https://rads.stackoverflow.com/amzn/click/com/0134843460). The first edition uses [Miranda](http://miranda.org.uk/), and the... | 2010/10/22 | [
"https://Stackoverflow.com/questions/3993730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/58634/"
] | I strongly recommend the second edition, which is an extensively revised, extended and mostly improved revision of the first edition. I have read both editions. The first edition has an example on solving the 8 queens problem with backtracking, unfortunately this example was dropped in the second edition. The second ed... | I haven't read Bird & Wadler, but Miranda and Haskell are similar--purely functional, nonstrict, statically typed, etc. If language is your only consideration when choosing the edition, I'd choose Haskell because it's more popular and free, and hence easier to get hands-on experience with.
I haven't used Miranda, but ... |
3,993,730 | I've heard it's better to read the [first edition](https://rads.stackoverflow.com/amzn/click/com/0134841972) of "Introduction to Functional Programming" by Bird & Wadler than the [second edition](https://rads.stackoverflow.com/amzn/click/com/0134843460). The first edition uses [Miranda](http://miranda.org.uk/), and the... | 2010/10/22 | [
"https://Stackoverflow.com/questions/3993730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/58634/"
] | I haven't read Bird & Wadler, but Miranda and Haskell are similar--purely functional, nonstrict, statically typed, etc. If language is your only consideration when choosing the edition, I'd choose Haskell because it's more popular and free, and hence easier to get hands-on experience with.
I haven't used Miranda, but ... | Yes, you should read the first or second edition of “Introduction to Functional Programming” by Bird & Wadler.
(I mean the inclusive or) |
3,993,730 | I've heard it's better to read the [first edition](https://rads.stackoverflow.com/amzn/click/com/0134841972) of "Introduction to Functional Programming" by Bird & Wadler than the [second edition](https://rads.stackoverflow.com/amzn/click/com/0134843460). The first edition uses [Miranda](http://miranda.org.uk/), and the... | 2010/10/22 | [
"https://Stackoverflow.com/questions/3993730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/58634/"
] | I strongly recommend the second edition, which is an extensively revised, extended and mostly improved revision of the first edition. I have read both editions. The first edition has an example on solving the 8 queens problem with backtracking, unfortunately this example was dropped in the second edition. The second ed... | Yes, you should read the first or second edition of “Introduction to Functional Programming” by Bird & Wadler.
(I mean the inclusive or) |
15,902,743 | any OpenCV expert?
I'm a bit new to OpenCV. I want to run the hog.cpp included under the ocl folder. I got errors compiling the file in MSVC++9.0
```
1>------ Build started: Project: hog_ocl, Configuration: Debug Win32 ------
1>Linking...
1>hog.obj : error LNK2019: unresolved external symbol "public: void __thiscall ... | 2013/04/09 | [
"https://Stackoverflow.com/questions/15902743",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3285872/"
] | It turns out that the library `opencv_ocl.lib` is needed to run this code and the same goes with the other examples under `ocl` folder. OpenCV must be built on your device using CMake and a C compiler (I used MSVC 2010). I managed to build it correctly after several days and long trials building/rebuilding and readings... | I think you need to include the features2d library. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.