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
64,656,055
I updated my project to create react app 4.0, and I'm slowing moving over my files to TypeScript. I know with this new version you don't have to repetitively import React from 'react'. However, within all of my TS files where I'm not importing React I receive this error: > > 'React' refers to a UMD global, but the cu...
2020/11/03
[ "https://Stackoverflow.com/questions/64656055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4021213/" ]
In my case, it was unrelated to any of this. I was using Visual Studio Code, and I opened the folder not at the root which had tsconfig.json file, but at one level inside at src folder. I was getting the error: `Parsing error: Cannot read file :C\MyProject\tsconfig.json.eslint` Which indirectly caused `'React' refer...
I had this happen when the file was in the root of the project instead of the src folder using Create React App.
64,656,055
I updated my project to create react app 4.0, and I'm slowing moving over my files to TypeScript. I know with this new version you don't have to repetitively import React from 'react'. However, within all of my TS files where I'm not importing React I receive this error: > > 'React' refers to a UMD global, but the cu...
2020/11/03
[ "https://Stackoverflow.com/questions/64656055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4021213/" ]
Create React App supports the new JSX transformation out of the box in version 4 but if you are using a custom setup, the following is needed to remove the TypeScript error when writing `jsx` without `import React from 'react'`: * `typescript` of at least version 4.1 * `react` and `react-dom` of at least version 17 * ...
What Dan wrote is correct you can change TS `config.json`: ``` // tsconfig.json { "compilerOptions": { ... "jsx": "react-jsx" ... }, } ``` Or just import React inside the file Component that's giving you the error: ``` import React from 'react' ```
64,656,055
I updated my project to create react app 4.0, and I'm slowing moving over my files to TypeScript. I know with this new version you don't have to repetitively import React from 'react'. However, within all of my TS files where I'm not importing React I receive this error: > > 'React' refers to a UMD global, but the cu...
2020/11/03
[ "https://Stackoverflow.com/questions/64656055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4021213/" ]
Create React App supports the new JSX transformation out of the box in version 4 but if you are using a custom setup, the following is needed to remove the TypeScript error when writing `jsx` without `import React from 'react'`: * `typescript` of at least version 4.1 * `react` and `react-dom` of at least version 17 * ...
My issue here was TypeScript-related and similar, but not exactly the same, as those solutions already published herein. What was wrong -------------- I added nested directories with source code which were not **include**d in my `tsconfig.json`. ### The solution Here's how I fixed it, simply adding additional `.ts`...
64,656,055
I updated my project to create react app 4.0, and I'm slowing moving over my files to TypeScript. I know with this new version you don't have to repetitively import React from 'react'. However, within all of my TS files where I'm not importing React I receive this error: > > 'React' refers to a UMD global, but the cu...
2020/11/03
[ "https://Stackoverflow.com/questions/64656055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4021213/" ]
I ran into this issue and finally realized that changing tsconfig.json doesn't work if you have ts-jest set up. Make sure if you have ts-jest set to: ```js module.exports = { ... globals: { ... "ts-jest": { ... tsconfig: { ... jsx: "react-jsx", // *** HERE *** ... ...
I had this happen when the file was in the root of the project instead of the src folder using Create React App.
674
This question involves not only those provided by the link, but also those "chess-themed" mathematics and computer science problems which are not included in the link. Who has published the most peer-reviewed articles on this topic amongst mathematicians and scientists? I know, for example, Euler at least looked at th...
2014/12/17
[ "https://hsm.stackexchange.com/questions/674", "https://hsm.stackexchange.com", "https://hsm.stackexchange.com/users/75/" ]
The general question is difficult to answer. Why were the British and Dutch scientists of 17-th century so impressive? Why was French science of the 18-th and 19-th century so impressive, especially in the early part of 19-th century ? The only thing which is clearly seen, is the correlation of these periods with vigo...
Given the historical circumstances the German education system might or might not have played a significant role in the formation of these scientists. In his collection of essays entitled "Brocas Brain", Carl Sagan gives some excellent insight into Einsteins biography: (I think [this](https://newrepublic.com/article/11...
674
This question involves not only those provided by the link, but also those "chess-themed" mathematics and computer science problems which are not included in the link. Who has published the most peer-reviewed articles on this topic amongst mathematicians and scientists? I know, for example, Euler at least looked at th...
2014/12/17
[ "https://hsm.stackexchange.com/questions/674", "https://hsm.stackexchange.com", "https://hsm.stackexchange.com/users/75/" ]
The general question is difficult to answer. Why were the British and Dutch scientists of 17-th century so impressive? Why was French science of the 18-th and 19-th century so impressive, especially in the early part of 19-th century ? The only thing which is clearly seen, is the correlation of these periods with vigo...
The German/Prussian education system was based on two pillars: The first was a mandatory comprehensive primary public school education with the aim to provide literacy, numeracy and good educational background for everybody (primary school = Volksschule). Even the most deserted villages got their “Volksschule”. The fol...
674
This question involves not only those provided by the link, but also those "chess-themed" mathematics and computer science problems which are not included in the link. Who has published the most peer-reviewed articles on this topic amongst mathematicians and scientists? I know, for example, Euler at least looked at th...
2014/12/17
[ "https://hsm.stackexchange.com/questions/674", "https://hsm.stackexchange.com", "https://hsm.stackexchange.com/users/75/" ]
Given the historical circumstances the German education system might or might not have played a significant role in the formation of these scientists. In his collection of essays entitled "Brocas Brain", Carl Sagan gives some excellent insight into Einsteins biography: (I think [this](https://newrepublic.com/article/11...
The German/Prussian education system was based on two pillars: The first was a mandatory comprehensive primary public school education with the aim to provide literacy, numeracy and good educational background for everybody (primary school = Volksschule). Even the most deserted villages got their “Volksschule”. The fol...
27,623
Eating with Left hand is Haram, in that concern I want to know that: Is taking Tea with using Tea-cup from left hand is haram?
2015/09/15
[ "https://islam.stackexchange.com/questions/27623", "https://islam.stackexchange.com", "https://islam.stackexchange.com/users/14118/" ]
Salamu Alaikum There is no Haram in drinking what is Halal. But it is Sunnah to Eat and Drink with your right hand and do other things such as cleaning with your left hand. > > Narrated Az-Zuhri: > > > From Salim, from his father, that the Messenger of > Allah (ﷺ) said: "When one of you eats, then let him eat wit...
``` In the name of Allah, the Entirely Merciful, the Especially Merciful ``` > > Is taking Tea with using Tea-cup from left hand is haram? > > > According to Shia Islam (and likewise I think Sunni Islam) it is not considered as a haram act as @goldPseudo mentioned in his comment as he said “Most inte...
240,197
I have been using ShareLaTeX for a long time and I like it very much, but lately it seems to me that it is not up-to-date. I had asked two questions [1](https://tex.stackexchange.com/questions/225593/extra-space-before-the-first-row-of-an-array), [2](https://tex.stackexchange.com/questions/227545/spacing-in-a-two-colu...
2015/04/23
[ "https://tex.stackexchange.com/questions/240197", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/45524/" ]
All maintenance issues should be addressed here: <https://github.com/sharelatex/sharelatex/issues> This site appears to be active as their have been opened, closed, and discussed issues during the last week.
ShareLaTeX Founder here: We are still very active and are still growing both the team and userbase. We will be updating to TeX Live 2015 very soon. Sorry if your packages are out of date, we maybe should start updating the tex version more often. In future the best thing todo is let us know you are having these prob...
24,049,946
I use an **IBM** processor, and I have barely begun to delve into **x86** assembly. Now that I have thoroughly read through an assembly book, I decided to put a simple program to the test (one that prints an exclamation mark on the screen): ``` .MODEL SMALL .CODE MOV AH,2h MOV DL,21h INT 21h INT 20...
2014/06/05
[ "https://Stackoverflow.com/questions/24049946", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3709221/" ]
TD (Turbo Debugger) is the wrong tool to run the program. You need only to type in the program name on the prompt: ``` C:\TASM>EXCLAMAT.exe ``` The message of TD "Program has no symbol table" is just a warning that you see the pure code and no labels or names. To avoid it: `TLINK /v EXCLAMAT;`
Don't you get some warnings when linking your assembled code? There are several issues when I test it: * you need to define the program entry point by setting a label at begining of code, then using the directive `end label_defined`, else you get this link error > > Fatal: No program entry point > > > * when produ...
31,945,786
I've been using `Ionic Framework` for about 4 months or so and am still learning the ropes to `AngularJS`. I'm trying to have `Angular` perform a calculation but it will not compute the correct way (does not appear to follow order of operations). The info binds fine between `Angular` and `HTL` because I've done several...
2015/08/11
[ "https://Stackoverflow.com/questions/31945786", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5215615/" ]
You pass `$encoded` at reverse but this variable is null, change it with `$str`. ``` $str = "abc"; echo reverse($str); ```
1) turn on error display in php <http://php.net/manual/en/function.error-reporting.php> 2) you are sending $encoded instead of $str in to the function 3) next time try and do your own homework
31,945,786
I've been using `Ionic Framework` for about 4 months or so and am still learning the ropes to `AngularJS`. I'm trying to have `Angular` perform a calculation but it will not compute the correct way (does not appear to follow order of operations). The info binds fine between `Angular` and `HTL` because I've done several...
2015/08/11
[ "https://Stackoverflow.com/questions/31945786", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5215615/" ]
'$encoded' only exists inside your function.. Call your function with your '$str'. ``` $str = "abc"; echo reverse($str); ```
1) turn on error display in php <http://php.net/manual/en/function.error-reporting.php> 2) you are sending $encoded instead of $str in to the function 3) next time try and do your own homework
9,014,143
By any chance is there a way to swap the two files in the Xcode 4 diff so that the previous revision of a file is on the left and the current working revision on the right? By default Xcode shows the working version on the left and previous revision on the right. I'm too use to most of the Windows diff programs where i...
2012/01/26
[ "https://Stackoverflow.com/questions/9014143", "https://Stackoverflow.com", "https://Stackoverflow.com/users/478665/" ]
It's 2016 and it finally looks like Apple has gave us a way to do this in XCode 7.3! [![enter image description here](https://i.stack.imgur.com/XSJwH.jpg)](https://i.stack.imgur.com/XSJwH.jpg)
Would love an answer to your actual question--haven't been able to find anything in XCode preferences. Sounds like maybe XCode is using FileMerge under the hood, but I didn't see anything in FileMerge's preferences about swapping the default left and right positions of files. Personally I use P4Merge, which works wel...
3,092
I often meet people who do not natively speak my language (German) but are learning it and would love to practice it by speaking German to me. **General Situation** The problem is that I talk in a slight dialect (Norddeutsch), speak very fast and often kind of unclear. Even other Germans occasionally have a hard time...
2017/08/31
[ "https://interpersonal.stackexchange.com/questions/3092", "https://interpersonal.stackexchange.com", "https://interpersonal.stackexchange.com/users/4754/" ]
I'm not sure but, based on what you've said, I might recommend slightly different phrasing. > > I talk in a slight dialect (Norddeutsch), speak very fast and often kind of unclear. Even other Germans occasionally have a hard time understanding me. > > > While this makes sense as a reason for you to not want to ta...
Maybe this could be useful. I have a friend who teaches language, several of them, and has lived in several countries while doing so. He teaches at a college level, so people often assume he *wants* to speak with them, help them, etc. He instead says he is a bit tired of it as he does it all the time (saying this to me...
3,092
I often meet people who do not natively speak my language (German) but are learning it and would love to practice it by speaking German to me. **General Situation** The problem is that I talk in a slight dialect (Norddeutsch), speak very fast and often kind of unclear. Even other Germans occasionally have a hard time...
2017/08/31
[ "https://interpersonal.stackexchange.com/questions/3092", "https://interpersonal.stackexchange.com", "https://interpersonal.stackexchange.com/users/4754/" ]
Put the blame *entirely* on yourself and don't even *hint* that their competence is relevant: > > ### I'm sorry, but my dialect makes it difficult for me to speak in regular German, even with natives. I'd appreciate it if we could continue in English. > > > That way they can't claim they can fix the problem.
Maybe this could be useful. I have a friend who teaches language, several of them, and has lived in several countries while doing so. He teaches at a college level, so people often assume he *wants* to speak with them, help them, etc. He instead says he is a bit tired of it as he does it all the time (saying this to me...
3,092
I often meet people who do not natively speak my language (German) but are learning it and would love to practice it by speaking German to me. **General Situation** The problem is that I talk in a slight dialect (Norddeutsch), speak very fast and often kind of unclear. Even other Germans occasionally have a hard time...
2017/08/31
[ "https://interpersonal.stackexchange.com/questions/3092", "https://interpersonal.stackexchange.com", "https://interpersonal.stackexchange.com/users/4754/" ]
Maybe this could be useful. I have a friend who teaches language, several of them, and has lived in several countries while doing so. He teaches at a college level, so people often assume he *wants* to speak with them, help them, etc. He instead says he is a bit tired of it as he does it all the time (saying this to me...
Nordisch by Nature. ;) If you have troubles communicating with people and they don't understand you even though you really try to speak clearly, then the issue might be in the other parts of how you communicate. Talking to people is not simply exchanging words (what you say), also the body language and structure is ve...
3,092
I often meet people who do not natively speak my language (German) but are learning it and would love to practice it by speaking German to me. **General Situation** The problem is that I talk in a slight dialect (Norddeutsch), speak very fast and often kind of unclear. Even other Germans occasionally have a hard time...
2017/08/31
[ "https://interpersonal.stackexchange.com/questions/3092", "https://interpersonal.stackexchange.com", "https://interpersonal.stackexchange.com/users/4754/" ]
Maybe this could be useful. I have a friend who teaches language, several of them, and has lived in several countries while doing so. He teaches at a college level, so people often assume he *wants* to speak with them, help them, etc. He instead says he is a bit tired of it as he does it all the time (saying this to me...
A common response among German-speakers when confronted with someone who is learning German is simply to reply in English. Since it's common, the speaker will just assume you're doing the cultural default. If the speaker presses you, explain in English that you speak a dialect of German that even many Germans don't und...
3,092
I often meet people who do not natively speak my language (German) but are learning it and would love to practice it by speaking German to me. **General Situation** The problem is that I talk in a slight dialect (Norddeutsch), speak very fast and often kind of unclear. Even other Germans occasionally have a hard time...
2017/08/31
[ "https://interpersonal.stackexchange.com/questions/3092", "https://interpersonal.stackexchange.com", "https://interpersonal.stackexchange.com/users/4754/" ]
I'm not sure but, based on what you've said, I might recommend slightly different phrasing. > > I talk in a slight dialect (Norddeutsch), speak very fast and often kind of unclear. Even other Germans occasionally have a hard time understanding me. > > > While this makes sense as a reason for you to not want to ta...
Put the blame *entirely* on yourself and don't even *hint* that their competence is relevant: > > ### I'm sorry, but my dialect makes it difficult for me to speak in regular German, even with natives. I'd appreciate it if we could continue in English. > > > That way they can't claim they can fix the problem.
3,092
I often meet people who do not natively speak my language (German) but are learning it and would love to practice it by speaking German to me. **General Situation** The problem is that I talk in a slight dialect (Norddeutsch), speak very fast and often kind of unclear. Even other Germans occasionally have a hard time...
2017/08/31
[ "https://interpersonal.stackexchange.com/questions/3092", "https://interpersonal.stackexchange.com", "https://interpersonal.stackexchange.com/users/4754/" ]
I'm not sure but, based on what you've said, I might recommend slightly different phrasing. > > I talk in a slight dialect (Norddeutsch), speak very fast and often kind of unclear. Even other Germans occasionally have a hard time understanding me. > > > While this makes sense as a reason for you to not want to ta...
Nordisch by Nature. ;) If you have troubles communicating with people and they don't understand you even though you really try to speak clearly, then the issue might be in the other parts of how you communicate. Talking to people is not simply exchanging words (what you say), also the body language and structure is ve...
3,092
I often meet people who do not natively speak my language (German) but are learning it and would love to practice it by speaking German to me. **General Situation** The problem is that I talk in a slight dialect (Norddeutsch), speak very fast and often kind of unclear. Even other Germans occasionally have a hard time...
2017/08/31
[ "https://interpersonal.stackexchange.com/questions/3092", "https://interpersonal.stackexchange.com", "https://interpersonal.stackexchange.com/users/4754/" ]
I'm not sure but, based on what you've said, I might recommend slightly different phrasing. > > I talk in a slight dialect (Norddeutsch), speak very fast and often kind of unclear. Even other Germans occasionally have a hard time understanding me. > > > While this makes sense as a reason for you to not want to ta...
A common response among German-speakers when confronted with someone who is learning German is simply to reply in English. Since it's common, the speaker will just assume you're doing the cultural default. If the speaker presses you, explain in English that you speak a dialect of German that even many Germans don't und...
3,092
I often meet people who do not natively speak my language (German) but are learning it and would love to practice it by speaking German to me. **General Situation** The problem is that I talk in a slight dialect (Norddeutsch), speak very fast and often kind of unclear. Even other Germans occasionally have a hard time...
2017/08/31
[ "https://interpersonal.stackexchange.com/questions/3092", "https://interpersonal.stackexchange.com", "https://interpersonal.stackexchange.com/users/4754/" ]
Put the blame *entirely* on yourself and don't even *hint* that their competence is relevant: > > ### I'm sorry, but my dialect makes it difficult for me to speak in regular German, even with natives. I'd appreciate it if we could continue in English. > > > That way they can't claim they can fix the problem.
Nordisch by Nature. ;) If you have troubles communicating with people and they don't understand you even though you really try to speak clearly, then the issue might be in the other parts of how you communicate. Talking to people is not simply exchanging words (what you say), also the body language and structure is ve...
3,092
I often meet people who do not natively speak my language (German) but are learning it and would love to practice it by speaking German to me. **General Situation** The problem is that I talk in a slight dialect (Norddeutsch), speak very fast and often kind of unclear. Even other Germans occasionally have a hard time...
2017/08/31
[ "https://interpersonal.stackexchange.com/questions/3092", "https://interpersonal.stackexchange.com", "https://interpersonal.stackexchange.com/users/4754/" ]
Put the blame *entirely* on yourself and don't even *hint* that their competence is relevant: > > ### I'm sorry, but my dialect makes it difficult for me to speak in regular German, even with natives. I'd appreciate it if we could continue in English. > > > That way they can't claim they can fix the problem.
A common response among German-speakers when confronted with someone who is learning German is simply to reply in English. Since it's common, the speaker will just assume you're doing the cultural default. If the speaker presses you, explain in English that you speak a dialect of German that even many Germans don't und...
67,960,187
Good day! I would like to ask a question about Tkinter Frame or Window. Does it support partial border like I want to have a border for only on the bottom and left side and opacity of let's say around 65%? Thank you!
2021/06/13
[ "https://Stackoverflow.com/questions/67960187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16215774/" ]
Your problem is here: ``` previous_digit[i] = input[i]; ``` `previous_digit` is of size 0 at that point. The subscript operator `[]` does not perform bounds check which is why you get a segfault instead of a well defined exception (accessing an out of bounds element). You should use `std::string::push_back` to add ...
There are multiple bugs in the shown code: ``` std::string previous_digit; // ... previous_digit[i] = input[i]; ``` Initially, `previous_digit` is an empty string. Subsequent code assigns something to `previous_digit[i]`. The `[]` operator overload in `std::string` must reference ***an existing char*** in ...
335,051
I saw this video: <https://youtu.be/KiJH1lgaHrY?t=1m49s> (at 1:49) where the guy touched the test pen with his fingers and the test pen lights up. How could it possible? I tried that on my test pen and it doesn't light up. Is it a special test pen?
2017/10/18
[ "https://electronics.stackexchange.com/questions/335051", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/164386/" ]
What I see in the video is (1) a button battery (coin cell) inside, with access by unscrewing the metal battery cover/cap (using slot type screwdriver at large diameter end of probe), and (2) the fuse continuity measurements that are shown require that you make contact with the battery cap with one finger while holding...
The finger is sensed, then the sense signal is used to tell another circuit to turn on the light. You might as well ask how it is possible for just a finger flick to turn on the light in a room when the finger did nothing electrical at all. Even more mysterious, the light persists after the finger is removed!
116,059
I am building a planetary system, but I always thought how many planets should I have in this system. When you look at our solar system there are 8 planets. Other exoplanetary systems can have up to the same amount. I am here wondering whether I should have the same amount or have more than what our solar system has. E...
2018/06/23
[ "https://worldbuilding.stackexchange.com/questions/116059", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/52321/" ]
The number of total planets doesn't really matter so much as how many of each type there are, and the moons can come in handy too. You have: * Rocks that are too close to the star (e.g. Mercury) * The "habitable zone" (e.g. Venus, Earth, Mars) - this is where you'll have your civilizations * The "gas giants" (e.g. Ju...
Hmm... In general, all known star systems with planets have **fewer** than eight known. Now for those with habitable worlds, that number on average will probably be higher (having outer-system gas giants helps with deflecting meteors/comets from coming to the inner worlds). In addition, many systems probably do have s...
116,059
I am building a planetary system, but I always thought how many planets should I have in this system. When you look at our solar system there are 8 planets. Other exoplanetary systems can have up to the same amount. I am here wondering whether I should have the same amount or have more than what our solar system has. E...
2018/06/23
[ "https://worldbuilding.stackexchange.com/questions/116059", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/52321/" ]
Hmm... In general, all known star systems with planets have **fewer** than eight known. Now for those with habitable worlds, that number on average will probably be higher (having outer-system gas giants helps with deflecting meteors/comets from coming to the inner worlds). In addition, many systems probably do have s...
Check out Artifexian on YouTube, this video in particular <https://youtu.be/J5xU-8Kb63Y>
116,059
I am building a planetary system, but I always thought how many planets should I have in this system. When you look at our solar system there are 8 planets. Other exoplanetary systems can have up to the same amount. I am here wondering whether I should have the same amount or have more than what our solar system has. E...
2018/06/23
[ "https://worldbuilding.stackexchange.com/questions/116059", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/52321/" ]
The number of total planets doesn't really matter so much as how many of each type there are, and the moons can come in handy too. You have: * Rocks that are too close to the star (e.g. Mercury) * The "habitable zone" (e.g. Venus, Earth, Mars) - this is where you'll have your civilizations * The "gas giants" (e.g. Ju...
Check out Artifexian on YouTube, this video in particular <https://youtu.be/J5xU-8Kb63Y>
68,218,322
I am trying to create a PSCustomObject that has multiple properties that are ArrayLists containing PSCustomObjects. I Am adding the parent object to an ArrayList as well. The idea is to create a relationship that I can easily parse out to yml or another format. For example, ```yml Hosts: # P...
2021/07/02
[ "https://Stackoverflow.com/questions/68218322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16361599/" ]
If I remember correct after clearing space and Restarting Docker from scratch worked for me.
On windows, open Docker desktop and click on the debug icon then restart. You can also consider "reset to factory defaults" [![](https://i.stack.imgur.com/eSTDo.png)](https://i.stack.imgur.com/eSTDo.png)
68,218,322
I am trying to create a PSCustomObject that has multiple properties that are ArrayLists containing PSCustomObjects. I Am adding the parent object to an ArrayList as well. The idea is to create a relationship that I can easily parse out to yml or another format. For example, ```yml Hosts: # P...
2021/07/02
[ "https://Stackoverflow.com/questions/68218322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16361599/" ]
If I remember correct after clearing space and Restarting Docker from scratch worked for me.
My case the reason is a corrupted SSD. When you see the error, check `dmesg`. Mine is brutal: ``` [ 5395.061163] blk_update_request: I/O error, dev sdb, sector 18906376 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0 [ 5395.061166] Buffer I/O error on dev sdb2, logical block 2363041, async page read [ 5395.061310] Abo...
68,218,322
I am trying to create a PSCustomObject that has multiple properties that are ArrayLists containing PSCustomObjects. I Am adding the parent object to an ArrayList as well. The idea is to create a relationship that I can easily parse out to yml or another format. For example, ```yml Hosts: # P...
2021/07/02
[ "https://Stackoverflow.com/questions/68218322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16361599/" ]
On windows, open Docker desktop and click on the debug icon then restart. You can also consider "reset to factory defaults" [![](https://i.stack.imgur.com/eSTDo.png)](https://i.stack.imgur.com/eSTDo.png)
My case the reason is a corrupted SSD. When you see the error, check `dmesg`. Mine is brutal: ``` [ 5395.061163] blk_update_request: I/O error, dev sdb, sector 18906376 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0 [ 5395.061166] Buffer I/O error on dev sdb2, logical block 2363041, async page read [ 5395.061310] Abo...
34,890,364
There has a `listView` and `imageView` in **Activity A**. If listView.size is equal to 0, it will display the image in the imageView, it not equal to 0, it will display the list. This is the xml of my Activtiy A. I want to make the text and button display below the image but I found it so difficult to adjust. ``` <R...
2016/01/20
[ "https://Stackoverflow.com/questions/34890364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5156075/" ]
SQLite-Net Extensions extends SQLite.Net with additional methods that loads and writes relationships. You are writing the relationship to database using `UpdateWithChildren` method, but you are not loading the relationship from database because `GetAll` is a plain SQLite.Net method. Try using any `*WithChildren` varia...
I had the same problem due to missing CascadeOperations = CascadeOperation.All. Add the instruction as below resolve my issue ``` [OneToMany(CascadeOperations = CascadeOperation.All)] ```
35,329,541
I wanted this part of the code to print false when using a word such as "soon" since there is an extra o missing from the list. I'm not exactly sure how remove a string so that it won't be used twice. ``` def word_from_lst(lst, word): """returns True if word can be obtained from a list of strings""" if...
2016/02/11
[ "https://Stackoverflow.com/questions/35329541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5911376/" ]
This should work ``` def word_from_lst(lst, word): """returns True if word can be obtained from a list of strings""" if word == " ": return True for letter in word: if letter in lst: lst.remove(letter) else: return False ...
**Edit 2: I misread the question. I will be more careful in the future.** I've kept the others of for reference in case they are needed. At any rate, this one should do what OP wants: ``` def canBeMade(listOfLetters, stringToMake): lDict = dict((letter, listOfLetters.count(letter)) for letter in set(listOfLetters)...
35,329,541
I wanted this part of the code to print false when using a word such as "soon" since there is an extra o missing from the list. I'm not exactly sure how remove a string so that it won't be used twice. ``` def word_from_lst(lst, word): """returns True if word can be obtained from a list of strings""" if...
2016/02/11
[ "https://Stackoverflow.com/questions/35329541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5911376/" ]
**Recusive Solution** Your solution is recursive, so let's start with that ``` def word_from_lst(lst, word): if word == " " or not word: return True if word[0] in lst: lst_ = lst[:] lst_.remove(word[0]) return word_from_lst(lst_...
**Edit 2: I misread the question. I will be more careful in the future.** I've kept the others of for reference in case they are needed. At any rate, this one should do what OP wants: ``` def canBeMade(listOfLetters, stringToMake): lDict = dict((letter, listOfLetters.count(letter)) for letter in set(listOfLetters)...
35,329,541
I wanted this part of the code to print false when using a word such as "soon" since there is an extra o missing from the list. I'm not exactly sure how remove a string so that it won't be used twice. ``` def word_from_lst(lst, word): """returns True if word can be obtained from a list of strings""" if...
2016/02/11
[ "https://Stackoverflow.com/questions/35329541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5911376/" ]
Why not use python built in set collection (unless you need to keep the original order...)? ``` clean_list = list(set(your_list)) ```
**Edit 2: I misread the question. I will be more careful in the future.** I've kept the others of for reference in case they are needed. At any rate, this one should do what OP wants: ``` def canBeMade(listOfLetters, stringToMake): lDict = dict((letter, listOfLetters.count(letter)) for letter in set(listOfLetters)...
35,329,541
I wanted this part of the code to print false when using a word such as "soon" since there is an extra o missing from the list. I'm not exactly sure how remove a string so that it won't be used twice. ``` def word_from_lst(lst, word): """returns True if word can be obtained from a list of strings""" if...
2016/02/11
[ "https://Stackoverflow.com/questions/35329541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5911376/" ]
This should work ``` def word_from_lst(lst, word): """returns True if word can be obtained from a list of strings""" if word == " ": return True for letter in word: if letter in lst: lst.remove(letter) else: return False ...
**[solution 1]** One possible way is to use dictionaries: ``` def word_from_lst(lst, word): char_count = {l:word.count(l) for l in word} for key, value in char_count.iteritems(): if lst.count(key) < value: return False return True print word_from_lst(["a", "s", "n", "f", "o"], "soon"...
35,329,541
I wanted this part of the code to print false when using a word such as "soon" since there is an extra o missing from the list. I'm not exactly sure how remove a string so that it won't be used twice. ``` def word_from_lst(lst, word): """returns True if word can be obtained from a list of strings""" if...
2016/02/11
[ "https://Stackoverflow.com/questions/35329541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5911376/" ]
**Recusive Solution** Your solution is recursive, so let's start with that ``` def word_from_lst(lst, word): if word == " " or not word: return True if word[0] in lst: lst_ = lst[:] lst_.remove(word[0]) return word_from_lst(lst_...
This should work ``` def word_from_lst(lst, word): """returns True if word can be obtained from a list of strings""" if word == " ": return True for letter in word: if letter in lst: lst.remove(letter) else: return False ...
35,329,541
I wanted this part of the code to print false when using a word such as "soon" since there is an extra o missing from the list. I'm not exactly sure how remove a string so that it won't be used twice. ``` def word_from_lst(lst, word): """returns True if word can be obtained from a list of strings""" if...
2016/02/11
[ "https://Stackoverflow.com/questions/35329541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5911376/" ]
This should work ``` def word_from_lst(lst, word): """returns True if word can be obtained from a list of strings""" if word == " ": return True for letter in word: if letter in lst: lst.remove(letter) else: return False ...
Why not use python built in set collection (unless you need to keep the original order...)? ``` clean_list = list(set(your_list)) ```
35,329,541
I wanted this part of the code to print false when using a word such as "soon" since there is an extra o missing from the list. I'm not exactly sure how remove a string so that it won't be used twice. ``` def word_from_lst(lst, word): """returns True if word can be obtained from a list of strings""" if...
2016/02/11
[ "https://Stackoverflow.com/questions/35329541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5911376/" ]
**Recusive Solution** Your solution is recursive, so let's start with that ``` def word_from_lst(lst, word): if word == " " or not word: return True if word[0] in lst: lst_ = lst[:] lst_.remove(word[0]) return word_from_lst(lst_...
**[solution 1]** One possible way is to use dictionaries: ``` def word_from_lst(lst, word): char_count = {l:word.count(l) for l in word} for key, value in char_count.iteritems(): if lst.count(key) < value: return False return True print word_from_lst(["a", "s", "n", "f", "o"], "soon"...
35,329,541
I wanted this part of the code to print false when using a word such as "soon" since there is an extra o missing from the list. I'm not exactly sure how remove a string so that it won't be used twice. ``` def word_from_lst(lst, word): """returns True if word can be obtained from a list of strings""" if...
2016/02/11
[ "https://Stackoverflow.com/questions/35329541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5911376/" ]
Why not use python built in set collection (unless you need to keep the original order...)? ``` clean_list = list(set(your_list)) ```
**[solution 1]** One possible way is to use dictionaries: ``` def word_from_lst(lst, word): char_count = {l:word.count(l) for l in word} for key, value in char_count.iteritems(): if lst.count(key) < value: return False return True print word_from_lst(["a", "s", "n", "f", "o"], "soon"...
35,329,541
I wanted this part of the code to print false when using a word such as "soon" since there is an extra o missing from the list. I'm not exactly sure how remove a string so that it won't be used twice. ``` def word_from_lst(lst, word): """returns True if word can be obtained from a list of strings""" if...
2016/02/11
[ "https://Stackoverflow.com/questions/35329541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5911376/" ]
**Recusive Solution** Your solution is recursive, so let's start with that ``` def word_from_lst(lst, word): if word == " " or not word: return True if word[0] in lst: lst_ = lst[:] lst_.remove(word[0]) return word_from_lst(lst_...
Why not use python built in set collection (unless you need to keep the original order...)? ``` clean_list = list(set(your_list)) ```
4,845,451
I have a many NSThreads, and I want to sleep during the time when they are working. How can I do it? Is there analogue of WinApi functions WaitForSingleObject/WaitForMultipleObjects in iOS SDK?
2011/01/30
[ "https://Stackoverflow.com/questions/4845451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/165547/" ]
There are quite a few ways, but my primary suggestion would be to look into using libdispatch. Instead of spawning NSThreads do: ``` dispatch_group_t group = dispatch_group_create(); dispatch_group_async(group, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ /* work to do in a thread goes here *...
It really sounds like you should re-think your app's architecture. Having many threads, especially on iOS, is pretty much guaranteed to be slower and, most definitely, buggier than a simpler design. On iOS, there is only one core and bus bandwidth is exceedingly limited. You would be far better off to use the higher ...
35,538,814
I have a bunch of `.java` files in a directory and I want to compile all of them to `.class` files via python code. As you know, the `Javac` command line tool is the tool that I must use and it require the name of `.java` files to be equal with the class name. Unfortunately for my `.java` files, it isn't. I mean they...
2016/02/21
[ "https://Stackoverflow.com/questions/35538814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3580433/" ]
In many cases a simple regex will work. If you want to be 100% certain I suggest using a full-blown Java parser like [javalang](https://github.com/c2nes/javalang) to parse each file, then walk the AST to pull out the class name. Something like ``` import glob import javalang # look at all .java files in the working...
This regex works for me. `(?<=^public class )\b.*\b(?= extends Applet)`. The way to use it correctly: ``` re.compile(ur'(?<=^public class )\b.*\b(?= extends Applet)', re.MULTILINE) ```
35,538,814
I have a bunch of `.java` files in a directory and I want to compile all of them to `.class` files via python code. As you know, the `Javac` command line tool is the tool that I must use and it require the name of `.java` files to be equal with the class name. Unfortunately for my `.java` files, it isn't. I mean they...
2016/02/21
[ "https://Stackoverflow.com/questions/35538814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3580433/" ]
In many cases a simple regex will work. If you want to be 100% certain I suggest using a full-blown Java parser like [javalang](https://github.com/c2nes/javalang) to parse each file, then walk the AST to pull out the class name. Something like ``` import glob import javalang # look at all .java files in the working...
You could come up with the following regex: ``` import re string = your_string_here classes = [x.strip() for x in re.findall(r'^(?:public class|package) ([^;]+?)(?=extends|;)', string, re.MULTILINE)] # look for public class or package at the start of the line # then anything but a semicolon # make sure the match is i...
40,047
``` " Get running OS let os = "" if has("win32") let os="win" else if has("unix") let s:uname = system("uname") if s:uname == "Darwin" let os="mac" else let os="unix" endif endif endif " Brackets expanding let preBracket="`" if os=="mac" let preBracket="$" endif exe 'vnoremap' . pr...
2012/06/05
[ "https://unix.stackexchange.com/questions/40047", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/2406/" ]
i manage to answer my own question, for comparing string in vimscript we should use `=~` instead of `==` . The reverse one is `!~` So edit this line `if s:uname == "Darwin"` to `if s:uname =~ "Darwin"` to make this little script work. I rewrite this as function: ``` function! GetRunningOS() if has("win32") ret...
Linux, OS X, FreeBSD, UNIX and a distro-specific (Debian) detection. ``` " OS Platform Detection let g:platform = 0 let g:distro = 0 " more distros to detect: "https://www.novell.com/coolsolutions/feature/11251.htm://www.novell.com/coolsolutions/feature/11251.html let g:uname = substitute(system("uname"), '\n\+$', ''...
25,541,866
a := make(chan struct{}) Such this, go channel take empty struct as input. Can this input be anything? thanks.
2014/08/28
[ "https://Stackoverflow.com/questions/25541866", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2495795/" ]
No: it can be an empty struct (`struct{}{}`), not "anything" To be "anything", you would need `interface{}`. As I explain in "[Go Golang : anonymous struct and empty struct](https://stackoverflow.com/a/22627240/6309)", an empty struct is useful to pass an object of size... 0! It is a good way to signal the completion...
`struct{}` is much like the unit type in other languages; it only has one value with no information. The values you get from such a channel would contain no information, but such a channel could be used for signalling when some event happened. A goroutine receiving from that channel would wake up whenever something is ...
140,504
Let $M$ be a closed, oriented manifold of dimension $n$. We know that the Chern character induces an isomorphism $K^\ast(M) \otimes \mathbb{Q} \cong H^\ast(M; \mathbb{Q})$ and now I was wondering how the preimage of the generator of $H^n(M)$ looks like. > > Is there a general description of the complex bundle $E \to ...
2013/08/26
[ "https://mathoverflow.net/questions/140504", "https://mathoverflow.net", "https://mathoverflow.net/users/13356/" ]
Suppose $M$ is a 2n dimensional manifold and $F$ is a rank $n$ complex vector bundle on $M$ with $c\_n(F)=k \in H^{2n}(M)$. Then $$ \sum\_{i=0}^n (-1)^i[\Lambda^iF^\*] $$ is an element in $K(M)$ which is the preimage of $k$ under the chern character map. Assuming that $k\neq 0$, this will be the preimage of a genera...
In algebraic geometry setting, this would be a structure sheaf of a point (or if you wish a linear combination of the vector bundles that provide projective resolution of such sheaf).
170,040
I've got a server running BES 5 that I'd like to rename. Does anyone have any docs on how to do this? I haven't found anything on RIMs site or when searching. UPDATE: In my case the SQL databases are on another server which is a dedicated SQL Server.
2010/08/13
[ "https://serverfault.com/questions/170040", "https://serverfault.com", "https://serverfault.com/users/1674/" ]
A similar question was asked on Experts Exchange <http://www.experts-exchange.com/Programming/Handhelds_-_PDAs/Blackberry/Q_23919386.html> Apparently, RIM says it's a bad idea to rename the server. It breaks SQL stuff (which is dependent on the system name). There may be ways to fix that, but the sure way of doing thi...
As much as I like to have all the servers fit a naming convention I find that the cons often outweigh the pros. Try renaming it and if things don't break that's great and if things do just revert (doesn't always work this way). If you have free time continue with this move but my guess is that if you take a moment to l...
51,296,632
I have a column in a dataframe `df$moves` which looks like this: ``` [1] "W1.d4 B1.d5 W2.c4 B2.e6 W3.Nc3 B3.Nf6 W4.cxd5 B4.exd5 W5.Bg5 B5.Be7 W6.e3 B6.Ne4 W7.Bxe7 B7.Nxc3 W8.Bxd8 B8.Nxd1 W9.Bxc7 B9.Nxb2 W10.Rb1 B10.Nc4 W11.Bxc4 B11.dxc4 W12.Ne2 B12.O-O W13.Nc3 B13.b6 W14.d5 B14.Na6 W15.Bd6 B15.Rd8 W16.Ba3 B16.Bb7 W17....
2018/07/12
[ "https://Stackoverflow.com/questions/51296632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4399461/" ]
You can convert it to a function (I'm not sure what the purpose of your `add_queen` function at the moment is as it just surrounding the loop) and then call using `adply` from `library(plyr)`. This should be faster than a loop but hard to tell for sure without the full data set ``` add_queen <- function(datarow) { ...
Here is a another solution completely vectorizing the solution and avoiding the plyr package. This should have additional improvement over the `adply` function. This assume your data frame is named: **datarow** with 1 column named moves. ``` library(stringi) #find index of last move( set default to 1 if move is not...
35,849,837
I have a stored procedure called 'authenticate' that returns me the user profile record if provided correct username and password. Now I am trying to get all users in system if 'authenticate' stored procedure returned me a record otherwise return nothing. I am trying something like this: ``` IF EXISTS EXECUTE authenti...
2016/03/07
[ "https://Stackoverflow.com/questions/35849837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/677206/" ]
You can transform your procedure into function: ``` create function dbo.authenticate(@UserName varchar(50), @Password varchar(50)) returns @found table(userName varchar(50), userPass varchar(50)) as begin -- some of your internal table declare @user table (userName varchar(50), userPass varchar(50)); insert into...
`EXISTS` takes a `SELECT` subquery not the results of a stored procedure. See [MSDN](https://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=EN-US&k=k(EXISTS_TSQL);k(SQL12.SWB.TSQLRESULTS.F1);k(SQL12.SWB.TSQLQUERY.F1);k(MISCELLANEOUSFILESPROJECT);k(DevLang-TSQL)&rd=true). You will need to either replicate your ...
35,849,837
I have a stored procedure called 'authenticate' that returns me the user profile record if provided correct username and password. Now I am trying to get all users in system if 'authenticate' stored procedure returned me a record otherwise return nothing. I am trying something like this: ``` IF EXISTS EXECUTE authenti...
2016/03/07
[ "https://Stackoverflow.com/questions/35849837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/677206/" ]
`EXISTS` takes a `SELECT` subquery not the results of a stored procedure. See [MSDN](https://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=EN-US&k=k(EXISTS_TSQL);k(SQL12.SWB.TSQLRESULTS.F1);k(SQL12.SWB.TSQLQUERY.F1);k(MISCELLANEOUSFILESPROJECT);k(DevLang-TSQL)&rd=true). You will need to either replicate your ...
I see several design problems: ### 1 Method "**Authenticate**" returns some rowset. Why? It is called "authenticate" - not "SelectAuthenticatedUserInfo". I assume this procedure does more than one job. Split it to real *authentication* method which gives probably an output variable with session-id or bit flag yes/no ...
35,849,837
I have a stored procedure called 'authenticate' that returns me the user profile record if provided correct username and password. Now I am trying to get all users in system if 'authenticate' stored procedure returned me a record otherwise return nothing. I am trying something like this: ``` IF EXISTS EXECUTE authenti...
2016/03/07
[ "https://Stackoverflow.com/questions/35849837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/677206/" ]
You can transform your procedure into function: ``` create function dbo.authenticate(@UserName varchar(50), @Password varchar(50)) returns @found table(userName varchar(50), userPass varchar(50)) as begin -- some of your internal table declare @user table (userName varchar(50), userPass varchar(50)); insert into...
I see several design problems: ### 1 Method "**Authenticate**" returns some rowset. Why? It is called "authenticate" - not "SelectAuthenticatedUserInfo". I assume this procedure does more than one job. Split it to real *authentication* method which gives probably an output variable with session-id or bit flag yes/no ...
33,941,495
In spring-webmvc, there is a param `detectHandlerMethodsInAncestorContexts` in [AbstractHandlerMethodMapping.java](https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/servlet/handler/AbstractHandlerMethodMapping.html). Its default value is false. How can I set it true?
2015/11/26
[ "https://Stackoverflow.com/questions/33941495", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5608889/" ]
Right Click on the file in Eclipse and select 'Replace With > Local History' Eclipse will show you a list of previous versions of the file (if it has any). You can replace the bad current version from those. Take the time to set up a backup system. Also use a version control system like Git or SVN to keep good copies ...
Try Preferences -> Workspace -> Text file encoding and other UTF-8
101,021
I'm travelling from Rutesheim to the Karlsruhe/Baden-Baden Airport, and I need to arrive ideally by 8am on a Sunday morning for a 10am flight. Is there any way I can do this by travelling through the Saturday night? I can't leave earlier than midnight, 12am. (Possibly 11pm but that would be pushing it!) In the UK the...
2017/08/28
[ "https://travel.stackexchange.com/questions/101021", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/67176/" ]
Night busses are very rare in Germany. Especially from small cities such as Rutesheim, there are very few options available. So let's try what we can get. The following is for random dates since I don't know when you will be travelling. Apparently, the S-Bahn is still running late from Rutesheim. It can bring you to...
A solution using public transport seems really a serious problem at this time of day and with the circumstances described by DCTLib. That's why I'd recommend a one-way car rental. Using a bigger car rental company like Europcar you could rent a car the day before in Stuttgart (airport for example) and return it at FKB...
101,021
I'm travelling from Rutesheim to the Karlsruhe/Baden-Baden Airport, and I need to arrive ideally by 8am on a Sunday morning for a 10am flight. Is there any way I can do this by travelling through the Saturday night? I can't leave earlier than midnight, 12am. (Possibly 11pm but that would be pushing it!) In the UK the...
2017/08/28
[ "https://travel.stackexchange.com/questions/101021", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/67176/" ]
Night busses are very rare in Germany. Especially from small cities such as Rutesheim, there are very few options available. So let's try what we can get. The following is for random dates since I don't know when you will be travelling. Apparently, the S-Bahn is still running late from Rutesheim. It can bring you to...
As Jörg and Sebastian already pointed out, the railway line between Rastatt (2nd closest station to FKB airport) and Baden-Baden (closest station) is disrupted until further notice, at least until 7 Oct 2017. There's a rail replacement bus service if you need to get to Baden-Baden. The journey planner at www.bahn.de ta...
101,021
I'm travelling from Rutesheim to the Karlsruhe/Baden-Baden Airport, and I need to arrive ideally by 8am on a Sunday morning for a 10am flight. Is there any way I can do this by travelling through the Saturday night? I can't leave earlier than midnight, 12am. (Possibly 11pm but that would be pushing it!) In the UK the...
2017/08/28
[ "https://travel.stackexchange.com/questions/101021", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/67176/" ]
As Jörg and Sebastian already pointed out, the railway line between Rastatt (2nd closest station to FKB airport) and Baden-Baden (closest station) is disrupted until further notice, at least until 7 Oct 2017. There's a rail replacement bus service if you need to get to Baden-Baden. The journey planner at www.bahn.de ta...
A solution using public transport seems really a serious problem at this time of day and with the circumstances described by DCTLib. That's why I'd recommend a one-way car rental. Using a bigger car rental company like Europcar you could rent a car the day before in Stuttgart (airport for example) and return it at FKB...
35,980,030
When I tried to import an excel file in odoo from Windows it worked perfectly. But when tried this from Ubuntu machine it didn't work. It showed me this error **"import preview failed due to: Unable to load "xlsx" file requires Python module "xlrd >= 0.8"**. Here's the screen shot [![Here's the screen shot](https:/...
2016/03/14
[ "https://Stackoverflow.com/questions/35980030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2311414/" ]
The error is saying that you need a python library "xlrd" in order to load this xlsx file. So make sure that you have installed [this](http://pypi.python.org/pypi/xlrd/0.9.2) python library in your openerp ubuntu machine. There's another way mentioned in odoo forum how you can installed it. Here it is First you have...
For Odoo 10, you need to install XLRD which is version 1.0.0 currently. ``` sudo -H pip install xlrd ``` The -H will take care of any error messages regarding the user environment. Then depending on your system, you **MUST** restart your odoo instance, or it will not recognize that XLRD is installed. Hope it helps...
19,200,688
I installed the curb gem by: ``` gem install curb ``` But when i include in my ruby code by require 'curb', it gives the following error ``` /Users/vishrutmehta/.rvm/gems/ruby-1.9.3-p448/gems/curb-0.8.5/lib/curl.rb:1:in `require'" dlopen(/Users/vishrutmehta/.rvm/gems/ruby-1.9.3-p448/gems/curb-0.8.5/lib/curb_core.bu...
2013/10/05
[ "https://Stackoverflow.com/questions/19200688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2795267/" ]
I had the same problem. Solved it by reinstalling curl from brew and linking it in to my path ``` brew install curl brew ln curl --force ```
I had this problem too; I had to run ``` gem pristine curb ``` to fix it.
69,563,691
I can see the history of my task using: ``` select * from table(information_schema.task_history()) where NAME = 'MY_TASK' order by scheduled_time; ``` But this specific task failed because of: ``` Statement reached its statement or warehouse timeout of 3,600 second(s) and was canceled. ``` So I issued the f...
2021/10/14
[ "https://Stackoverflow.com/questions/69563691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9682236/" ]
If you want your task to use a specific warehouse, you can define it when creating the task using the WAREHOUSE parameter, otherwise it will be serverless task and you can only define the USER\_TASK\_MANAGED\_INITIAL\_WAREHOUSE\_SIZE parameter. If you have problems with TIMEOUT on task, change the default value of the...
Try running SHOW TASKS [SHOW TASKS documentation](https://docs.snowflake.com/en/sql-reference/sql/show-tasks.html)
15,862,096
I want to accomplish the following effect. ([link](http://store.picbg.net/pubpic/25/76/efc484e23e212576.png)) The idea is that I want a transparent div on the top of the image and in this div i want to place a text with opacity: 1 (non-transparent) So far I managed to make the div transparent, but all the text in it...
2013/04/07
[ "https://Stackoverflow.com/questions/15862096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2013488/" ]
This should help you out. HTML: ``` <div class="image"> <img src="images/anyimg.jpg" alt="" /> <h2>Image text:<br />Image Text</h2> </div> ``` CSS: ``` .image { position: relative; margin-bottom: 20px; width: 100%; } h2 { position: absolute; top: 200px; left: 0; width: 100%; } h...
``` .image { position: absolute; top:200px; left:200px; z-index: -1; height:200px; width:200px; opacity:.5; } .text { position: absolute; top:50px; left:50px; z-index: 1000; opacity:1; } <div> <img src="image.jpg" class="imgage" /> <span class="text">Hello</span> </div> ```
682,273
I am trying to find a way to either disable or completely remove Chrome’s Task Manager. My proposed solution involves using a batch-file running in the background to detect if the Chrome Task Manager is open, and shut down Chrome if it is. Unfortunately, I do not know batch programming and am low on time for this prob...
2013/11/29
[ "https://superuser.com/questions/682273", "https://superuser.com", "https://superuser.com/users/-1/" ]
I’ll assume that your data start in Row 2, and that Column `C` is available for use as a “helper column”.  Put ``` =IF(A1=A2, C1, C1+1) ``` into cell `C2`.  (If Column `C` isn’t available, use one that is.  If your data start in Row 1, either insert a blank row, or (still) put the above into cell `C2`, but put `1` i...
I think your best bet is to use custom orders. If it doesn't have to be updated to often you could do it through `FILE>OPTIONS>ADVANCED>EDIT CUSTOM LISTS...` and just import the entire range. Then use that when sorting. VBA solution would be something like ``` Sub sort() Dim iCustListNum As Integer iCustListNum = A...
682,273
I am trying to find a way to either disable or completely remove Chrome’s Task Manager. My proposed solution involves using a batch-file running in the background to detect if the Chrome Task Manager is open, and shut down Chrome if it is. Unfortunately, I do not know batch programming and am low on time for this prob...
2013/11/29
[ "https://superuser.com/questions/682273", "https://superuser.com", "https://superuser.com/users/-1/" ]
I’ll assume that your data start in Row 2, and that Column `C` is available for use as a “helper column”.  Put ``` =IF(A1=A2, C1, C1+1) ``` into cell `C2`.  (If Column `C` isn’t available, use one that is.  If your data start in Row 1, either insert a blank row, or (still) put the above into cell `C2`, but put `1` i...
Quick and dirty:- 1. Copy the contents of column A into notepad, then recopy to the clipboard. 2. Select both columns. 3. Select the sort function and sort column A using the "custom list" order. 4. Enter the data from the clipboard into the custom list. 5. Add a level to the sort function and then sort by column B, "...
36,224,033
[`stargazer`](https://cran.r-project.org/web/packages/stargazer/stargazer.pdf) is a great tool to generate a regression table if you are not using [`bayesglm`](http://www.inside-r.org/packages/cran/arm/docs/bayesglm). For example, suppose I have the following data: ``` library(dplyr) set.seed(9782) N<-1000 df1 <- data...
2016/03/25
[ "https://Stackoverflow.com/questions/36224033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1800784/" ]
It looks like this does the trick: ``` library(texreg) htmlreg(fit) ``` and for text: ``` screenreg(list(fit)) ```
As @rawr points out in comments `stargazer` is -- while useful -- unfortunately written in a rather monolithic, hard-to-extend style. The [broom package](https://cran.r-project.org/package=broom) is (IMO) a nicely designed modular/object-oriented framework for extracting summary information from a large range of model ...
36,224,033
[`stargazer`](https://cran.r-project.org/web/packages/stargazer/stargazer.pdf) is a great tool to generate a regression table if you are not using [`bayesglm`](http://www.inside-r.org/packages/cran/arm/docs/bayesglm). For example, suppose I have the following data: ``` library(dplyr) set.seed(9782) N<-1000 df1 <- data...
2016/03/25
[ "https://Stackoverflow.com/questions/36224033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1800784/" ]
It looks like this does the trick: ``` library(texreg) htmlreg(fit) ``` and for text: ``` screenreg(list(fit)) ```
If you are OK with markdown, then the [generic `pander` S3 method](http://rapporter.github.io/pander/#generic-pander-method) usually does a pretty good job: ``` > pander(fit, round = 4) -------------------------------------------------------------- &nbsp; Estimate Std. Error t value Pr(>|t|) ------...
24,759,281
``` using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; using System.Timers; namespace ScrollLabelTest { class SaveOldHtml { private static int count; private static Timer _timer = new Timer(); private sta...
2014/07/15
[ "https://Stackoverflow.com/questions/24759281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3840992/" ]
If `LoadOldHtmlFiles()` takes >= 10 seconds then your timer will fire it repeatedly. Stop the timer and restart it in the `_timer_Elapsed` method: ``` static void _timer_Elapsed(object sender, ElapsedEventArgs e) { _timer.Stop(); LoadOldHtmlFiles(); _timer.Start(); } ```
If you place your main method inside timer tick function then your main method will be triggered after that timer is started, but to avoid this timer function being called again & again, stop this timer inside the timer tick function. ``` private void timer1_Tick(object sender, EventArgs e) { timer1.Stop(); <y...
50,547,782
I'm working on a project that requires me to massage some API data (shown in the snippet below as 'apiData'). The data structure I ultimately need for the charting library I'm using (Recharts) is this: ``` [ { date: '2018-04-24', TSLA: 283.37, AAPL: 250.01 }, { date: '2018-04-25', AAPL: 320.34 } ] ``` I've put t...
2018/05/26
[ "https://Stackoverflow.com/questions/50547782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6402725/" ]
A cleaner way than having to loop through the accumulated new array each time to look for a date is to use one master object with dates as keys Following I use `reduce()` to return a [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) (could be an object literal also) using da...
Just correcting your code only, else reduce should be used instead of map, for charts also. ```js formatChartData = (data) => { const chartData = data .reduce((arr, stock) => { const stockArr = stock.chart.map((item) => { let chartObj = {}; chartObj.date = item.date; chartOb...
50,547,782
I'm working on a project that requires me to massage some API data (shown in the snippet below as 'apiData'). The data structure I ultimately need for the charting library I'm using (Recharts) is this: ``` [ { date: '2018-04-24', TSLA: 283.37, AAPL: 250.01 }, { date: '2018-04-25', AAPL: 320.34 } ] ``` I've put t...
2018/05/26
[ "https://Stackoverflow.com/questions/50547782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6402725/" ]
A cleaner way than having to loop through the accumulated new array each time to look for a date is to use one master object with dates as keys Following I use `reduce()` to return a [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) (could be an object literal also) using da...
The problem is that your reduce function is running for each item in the data array. When it runs on the first item in the data array it returns: ``` [ { date: '2018-04-23', TSLA: 285.12 }, { date: '2018-04-24', TSLA: 283.37 } ] ``` When it runs on the second item in the array it returns this: ``` [ { ...
305,715
Hello I am creating a plot using tikz I have created 3 functions on a plot and took the area above each of them using drawge. My question is how I can fill the area above intersection of two functions ? or maybe I should create a polygon with the point of the intersection as one of the points of the polygon? The second...
2016/04/22
[ "https://tex.stackexchange.com/questions/305715", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/103402/" ]
Here's an example that 'automatically' redefines the subsubsection header number format and numbering and restores it with the next `\section`. I also used `\cleveref` so refer to the subsubsection as a Solution and not as a subsubsection. ``` \documentclass[10pt]{article} \usepackage{amsmath, amsthm, amssymb, amsf...
There are two *different* ways of suppressing subsubsection numbers: 1. Use `\subsubsection*`. This suppresses numbering completely and also supresses the addition of this subsubsection to the table of contents. 2. `\setcounter{secnumdepth}{2}` (you only need this command once, best in the preamble of the document). T...
305,715
Hello I am creating a plot using tikz I have created 3 functions on a plot and took the area above each of them using drawge. My question is how I can fill the area above intersection of two functions ? or maybe I should create a polygon with the point of the intersection as one of the points of the polygon? The second...
2016/04/22
[ "https://tex.stackexchange.com/questions/305715", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/103402/" ]
This is the solution I found using Christian Hupfer's suggestion in one of his comments. ``` \documentclass[10pt]{article} \usepackage{amsmath, amsthm, amssymb, amsfonts} \usepackage[width=5.5in, height=8in]{geometry} \theoremstyle{definition} \newtheorem{solution}{Solution} \begin{document} \section{Exact Solution...
There are two *different* ways of suppressing subsubsection numbers: 1. Use `\subsubsection*`. This suppresses numbering completely and also supresses the addition of this subsubsection to the table of contents. 2. `\setcounter{secnumdepth}{2}` (you only need this command once, best in the preamble of the document). T...
305,715
Hello I am creating a plot using tikz I have created 3 functions on a plot and took the area above each of them using drawge. My question is how I can fill the area above intersection of two functions ? or maybe I should create a polygon with the point of the intersection as one of the points of the polygon? The second...
2016/04/22
[ "https://tex.stackexchange.com/questions/305715", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/103402/" ]
Here's an example that 'automatically' redefines the subsubsection header number format and numbering and restores it with the next `\section`. I also used `\cleveref` so refer to the subsubsection as a Solution and not as a subsubsection. ``` \documentclass[10pt]{article} \usepackage{amsmath, amsthm, amssymb, amsf...
This is the solution I found using Christian Hupfer's suggestion in one of his comments. ``` \documentclass[10pt]{article} \usepackage{amsmath, amsthm, amssymb, amsfonts} \usepackage[width=5.5in, height=8in]{geometry} \theoremstyle{definition} \newtheorem{solution}{Solution} \begin{document} \section{Exact Solution...
305,715
Hello I am creating a plot using tikz I have created 3 functions on a plot and took the area above each of them using drawge. My question is how I can fill the area above intersection of two functions ? or maybe I should create a polygon with the point of the intersection as one of the points of the polygon? The second...
2016/04/22
[ "https://tex.stackexchange.com/questions/305715", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/103402/" ]
Here's an example that 'automatically' redefines the subsubsection header number format and numbering and restores it with the next `\section`. I also used `\cleveref` so refer to the subsubsection as a Solution and not as a subsubsection. ``` \documentclass[10pt]{article} \usepackage{amsmath, amsthm, amssymb, amsf...
If all you are concerned about is that the font for subsections is too large for your liking then change the definition of the subsection font. You can find the (sub)subsection code via `texdoc article`. In your preamble do ``` \makeatletter \renewcommand{\subsection}{...} % changing the font specification \makeatoth...
305,715
Hello I am creating a plot using tikz I have created 3 functions on a plot and took the area above each of them using drawge. My question is how I can fill the area above intersection of two functions ? or maybe I should create a polygon with the point of the intersection as one of the points of the polygon? The second...
2016/04/22
[ "https://tex.stackexchange.com/questions/305715", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/103402/" ]
This is the solution I found using Christian Hupfer's suggestion in one of his comments. ``` \documentclass[10pt]{article} \usepackage{amsmath, amsthm, amssymb, amsfonts} \usepackage[width=5.5in, height=8in]{geometry} \theoremstyle{definition} \newtheorem{solution}{Solution} \begin{document} \section{Exact Solution...
If all you are concerned about is that the font for subsections is too large for your liking then change the definition of the subsection font. You can find the (sub)subsection code via `texdoc article`. In your preamble do ``` \makeatletter \renewcommand{\subsection}{...} % changing the font specification \makeatoth...
59,562,542
After reading [C++ auto deduction of return type](https://stackoverflow.com/questions/29663495/c-auto-deduction-of-return-type/29663524#29663524) and [C++ : Vector of template class](https://stackoverflow.com/questions/16210707/c-vector-of-template-class), I'm still wondering how to do generic operations (*e.g.* operat...
2020/01/02
[ "https://Stackoverflow.com/questions/59562542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1315480/" ]
Just use a virtual function. The time you cast your variable from `Cache<int>` pointer type to `ICache` pointer you lose compile time information about it. That information is lost. You can use `dynamic_cast` in your `friend ICache::operator<<` to handle all the different types... To properly resolve type information u...
First, `reinterpret_cast` is a dangerous thing. In contexts of polymorphism you mostly want to use `dynamic_cast`. You problem is not about templates etc at all, but it is more about that you want to make the `operator<<` virtual, which is not possible, since it is a friend function. An easy workaround is the followin...
59,562,542
After reading [C++ auto deduction of return type](https://stackoverflow.com/questions/29663495/c-auto-deduction-of-return-type/29663524#29663524) and [C++ : Vector of template class](https://stackoverflow.com/questions/16210707/c-vector-of-template-class), I'm still wondering how to do generic operations (*e.g.* operat...
2020/01/02
[ "https://Stackoverflow.com/questions/59562542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1315480/" ]
There are various ways, but generally I would implement a single `operator<<()` that calls a virtual function. ``` class ICache { protected: // so the function is only accessible to derived classes virtual std::ostream print(std::ostream &out) const = 0; // force derived classes to override friend ...
First, `reinterpret_cast` is a dangerous thing. In contexts of polymorphism you mostly want to use `dynamic_cast`. You problem is not about templates etc at all, but it is more about that you want to make the `operator<<` virtual, which is not possible, since it is a friend function. An easy workaround is the followin...
59,562,542
After reading [C++ auto deduction of return type](https://stackoverflow.com/questions/29663495/c-auto-deduction-of-return-type/29663524#29663524) and [C++ : Vector of template class](https://stackoverflow.com/questions/16210707/c-vector-of-template-class), I'm still wondering how to do generic operations (*e.g.* operat...
2020/01/02
[ "https://Stackoverflow.com/questions/59562542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1315480/" ]
Just use a virtual function. The time you cast your variable from `Cache<int>` pointer type to `ICache` pointer you lose compile time information about it. That information is lost. You can use `dynamic_cast` in your `friend ICache::operator<<` to handle all the different types... To properly resolve type information u...
There are various ways, but generally I would implement a single `operator<<()` that calls a virtual function. ``` class ICache { protected: // so the function is only accessible to derived classes virtual std::ostream print(std::ostream &out) const = 0; // force derived classes to override friend ...
194,455
A prepositional phrase comprising a preposition and a noun phrase can generally function either as an adjectival phrase or as an adverbial phrase. > > *The book **on the table** is mine.* > (The prepositional phrase ***on the table*** is an adjectival phrase modifying the noun phrase *the book*.) > > > *Put the ...
2014/09/02
[ "https://english.stackexchange.com/questions/194455", "https://english.stackexchange.com", "https://english.stackexchange.com/users/27275/" ]
As noted in comments, a prepositional phrase using *during* can be used to modify a noun. The example used *during the day* to modify *work* used as the subject. The problem with your sentence lies elsewhere: it’s that *during* doesn’t work very well for *plans*. One has plans ***for*** one’s vacation, not “during” it...
> > "A prepositional phrase comprising a preposition and a noun phrase can generally function either as an adjectival phrase or as an adverbial phrase." > > > My use of the term, a *complement* only describes the relation one phrase has to another. It has nothing to do with whether that phrase is required syntacti...
46,043,272
Sorry for the horrible question title. What i'm trying to find is; is there a better way that uses less ruby and more ActiveRecord/SQL to do the same thing? ``` Job.level_count.keys[0..2].map do |loi| job_company_id = Job.find_by(level_of_interest: loi).company_id Company.find(job_company_id) end ```
2017/09/04
[ "https://Stackoverflow.com/questions/46043272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7619578/" ]
You can use `reduce` to group the objects: ```js function group(arr) { return arr.reduce(function(res, obj) { // for each object obj in the array arr var key = obj.locA + obj.locB; // let key be the concatination of locA and locB var newObj = {loc: key...
using lodash \_.keyBy you can split it on the bases of key. link to the function <https://lodash.com/docs/4.17.4#keyBy> .
46,043,272
Sorry for the horrible question title. What i'm trying to find is; is there a better way that uses less ruby and more ActiveRecord/SQL to do the same thing? ``` Job.level_count.keys[0..2].map do |loi| job_company_id = Job.find_by(level_of_interest: loi).company_id Company.find(job_company_id) end ```
2017/09/04
[ "https://Stackoverflow.com/questions/46043272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7619578/" ]
Something like this? ```js var dataset = [ {time: "t1", locA: "a1", locB: "b1", value: 0}, {time: "t1", locA: "a1", locB: "b2", value: 1}, {time: "t1", locA: "a2", locB: "b1", value: 2}, {time: "t1", locA: "a2", locB: "b2", value: 3}, {time: "t2", locA: "a1", locB: "b1", value: 4}, {time: "t2", locA: "a1", locB:...
using lodash \_.keyBy you can split it on the bases of key. link to the function <https://lodash.com/docs/4.17.4#keyBy> .
46,043,272
Sorry for the horrible question title. What i'm trying to find is; is there a better way that uses less ruby and more ActiveRecord/SQL to do the same thing? ``` Job.level_count.keys[0..2].map do |loi| job_company_id = Job.find_by(level_of_interest: loi).company_id Company.find(job_company_id) end ```
2017/09/04
[ "https://Stackoverflow.com/questions/46043272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7619578/" ]
Another short `Array.prototype.reduce()` approach: ```js var dataset = [ {time: "t1", locA: "a1", locB: "b1", value: "v1"}, {time: "t1", locA: "a1", locB: "b2", value: "v2"}, {time: "t1", locA: "a2", locB: "b1", value: "v3"}, {time: "t1", locA: "a2", locB: "b2", value: "v4"}, {time: "t2", locA: "a1", locB: "b1"...
using lodash \_.keyBy you can split it on the bases of key. link to the function <https://lodash.com/docs/4.17.4#keyBy> .
46,043,272
Sorry for the horrible question title. What i'm trying to find is; is there a better way that uses less ruby and more ActiveRecord/SQL to do the same thing? ``` Job.level_count.keys[0..2].map do |loi| job_company_id = Job.find_by(level_of_interest: loi).company_id Company.find(job_company_id) end ```
2017/09/04
[ "https://Stackoverflow.com/questions/46043272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7619578/" ]
You can use `reduce` to group the objects: ```js function group(arr) { return arr.reduce(function(res, obj) { // for each object obj in the array arr var key = obj.locA + obj.locB; // let key be the concatination of locA and locB var newObj = {loc: key...
Something like this? ```js var dataset = [ {time: "t1", locA: "a1", locB: "b1", value: 0}, {time: "t1", locA: "a1", locB: "b2", value: 1}, {time: "t1", locA: "a2", locB: "b1", value: 2}, {time: "t1", locA: "a2", locB: "b2", value: 3}, {time: "t2", locA: "a1", locB: "b1", value: 4}, {time: "t2", locA: "a1", locB:...
46,043,272
Sorry for the horrible question title. What i'm trying to find is; is there a better way that uses less ruby and more ActiveRecord/SQL to do the same thing? ``` Job.level_count.keys[0..2].map do |loi| job_company_id = Job.find_by(level_of_interest: loi).company_id Company.find(job_company_id) end ```
2017/09/04
[ "https://Stackoverflow.com/questions/46043272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7619578/" ]
You can use `reduce` to group the objects: ```js function group(arr) { return arr.reduce(function(res, obj) { // for each object obj in the array arr var key = obj.locA + obj.locB; // let key be the concatination of locA and locB var newObj = {loc: key...
I assumed the values are ordered by time in the original data set. Then it is just a matter of collating the data. ```js var dataset = [ {time: "t1", locA: "a1", locB: "b1", value: 'v1'}, {time: "t1", locA: "a1", locB: "b2", value: 'v2'}, {time: "t1", locA: "a2", locB: "b1", value: 'v3'}, {time: "t1", locA...
46,043,272
Sorry for the horrible question title. What i'm trying to find is; is there a better way that uses less ruby and more ActiveRecord/SQL to do the same thing? ``` Job.level_count.keys[0..2].map do |loi| job_company_id = Job.find_by(level_of_interest: loi).company_id Company.find(job_company_id) end ```
2017/09/04
[ "https://Stackoverflow.com/questions/46043272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7619578/" ]
Another short `Array.prototype.reduce()` approach: ```js var dataset = [ {time: "t1", locA: "a1", locB: "b1", value: "v1"}, {time: "t1", locA: "a1", locB: "b2", value: "v2"}, {time: "t1", locA: "a2", locB: "b1", value: "v3"}, {time: "t1", locA: "a2", locB: "b2", value: "v4"}, {time: "t2", locA: "a1", locB: "b1"...
You can use `reduce` to group the objects: ```js function group(arr) { return arr.reduce(function(res, obj) { // for each object obj in the array arr var key = obj.locA + obj.locB; // let key be the concatination of locA and locB var newObj = {loc: key...
46,043,272
Sorry for the horrible question title. What i'm trying to find is; is there a better way that uses less ruby and more ActiveRecord/SQL to do the same thing? ``` Job.level_count.keys[0..2].map do |loi| job_company_id = Job.find_by(level_of_interest: loi).company_id Company.find(job_company_id) end ```
2017/09/04
[ "https://Stackoverflow.com/questions/46043272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7619578/" ]
Something like this? ```js var dataset = [ {time: "t1", locA: "a1", locB: "b1", value: 0}, {time: "t1", locA: "a1", locB: "b2", value: 1}, {time: "t1", locA: "a2", locB: "b1", value: 2}, {time: "t1", locA: "a2", locB: "b2", value: 3}, {time: "t2", locA: "a1", locB: "b1", value: 4}, {time: "t2", locA: "a1", locB:...
I assumed the values are ordered by time in the original data set. Then it is just a matter of collating the data. ```js var dataset = [ {time: "t1", locA: "a1", locB: "b1", value: 'v1'}, {time: "t1", locA: "a1", locB: "b2", value: 'v2'}, {time: "t1", locA: "a2", locB: "b1", value: 'v3'}, {time: "t1", locA...
46,043,272
Sorry for the horrible question title. What i'm trying to find is; is there a better way that uses less ruby and more ActiveRecord/SQL to do the same thing? ``` Job.level_count.keys[0..2].map do |loi| job_company_id = Job.find_by(level_of_interest: loi).company_id Company.find(job_company_id) end ```
2017/09/04
[ "https://Stackoverflow.com/questions/46043272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7619578/" ]
Another short `Array.prototype.reduce()` approach: ```js var dataset = [ {time: "t1", locA: "a1", locB: "b1", value: "v1"}, {time: "t1", locA: "a1", locB: "b2", value: "v2"}, {time: "t1", locA: "a2", locB: "b1", value: "v3"}, {time: "t1", locA: "a2", locB: "b2", value: "v4"}, {time: "t2", locA: "a1", locB: "b1"...
Something like this? ```js var dataset = [ {time: "t1", locA: "a1", locB: "b1", value: 0}, {time: "t1", locA: "a1", locB: "b2", value: 1}, {time: "t1", locA: "a2", locB: "b1", value: 2}, {time: "t1", locA: "a2", locB: "b2", value: 3}, {time: "t2", locA: "a1", locB: "b1", value: 4}, {time: "t2", locA: "a1", locB:...
46,043,272
Sorry for the horrible question title. What i'm trying to find is; is there a better way that uses less ruby and more ActiveRecord/SQL to do the same thing? ``` Job.level_count.keys[0..2].map do |loi| job_company_id = Job.find_by(level_of_interest: loi).company_id Company.find(job_company_id) end ```
2017/09/04
[ "https://Stackoverflow.com/questions/46043272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7619578/" ]
Another short `Array.prototype.reduce()` approach: ```js var dataset = [ {time: "t1", locA: "a1", locB: "b1", value: "v1"}, {time: "t1", locA: "a1", locB: "b2", value: "v2"}, {time: "t1", locA: "a2", locB: "b1", value: "v3"}, {time: "t1", locA: "a2", locB: "b2", value: "v4"}, {time: "t2", locA: "a1", locB: "b1"...
I assumed the values are ordered by time in the original data set. Then it is just a matter of collating the data. ```js var dataset = [ {time: "t1", locA: "a1", locB: "b1", value: 'v1'}, {time: "t1", locA: "a1", locB: "b2", value: 'v2'}, {time: "t1", locA: "a2", locB: "b1", value: 'v3'}, {time: "t1", locA...
41,974,628
I'm trying to make a script to back up a MySQL database. I have a `config.yml` file: ``` DB_HOST :'localhost' DB_USER : 'root' DB_USER_PASSWORD:'P@$$w0rd' DB_NAME : 'moodle_data' BACKUP_PATH : '/var/lib/mysql/moodle_data' ``` Now I need to read this file. My Python code so far: ``` import yaml config = yaml.load(op...
2017/02/01
[ "https://Stackoverflow.com/questions/41974628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7234678/" ]
**To backup your data base**, you should be able to export it as a `.sql` file. If you're using a specific interface, look for `Export`. Then, for Python's yaml parser. ``` DB_HOST :'localhost' DB_USER : 'root' DB_USER_PASSWORD:'P@$$w0rd' DB_NAME : 'moodle_data' BACKUP_PATH : '/var/lib/mysql/moodle_data' ``` is a `...
Try this: ``` import yaml with open('config.yaml', 'r') as f: doc = yaml.load(f) ``` To access "DB\_NAME" you can use: ``` txt = doc["DB_NAME"] print txt ```
41,974,628
I'm trying to make a script to back up a MySQL database. I have a `config.yml` file: ``` DB_HOST :'localhost' DB_USER : 'root' DB_USER_PASSWORD:'P@$$w0rd' DB_NAME : 'moodle_data' BACKUP_PATH : '/var/lib/mysql/moodle_data' ``` Now I need to read this file. My Python code so far: ``` import yaml config = yaml.load(op...
2017/02/01
[ "https://Stackoverflow.com/questions/41974628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7234678/" ]
There are 2 issues: * As others have said, yaml.load() loads associative arrays as mappings, so you need to use `config['DB_NAME']`. * The syntax in your config file is not correct: in YAML, keys are separated from values by a colon+space. Should work if the file is formatted like this: ``` DB_HOST: 'localhost' DB_U...
Try this: ``` import yaml with open('config.yaml', 'r') as f: doc = yaml.load(f) ``` To access "DB\_NAME" you can use: ``` txt = doc["DB_NAME"] print txt ```
41,974,628
I'm trying to make a script to back up a MySQL database. I have a `config.yml` file: ``` DB_HOST :'localhost' DB_USER : 'root' DB_USER_PASSWORD:'P@$$w0rd' DB_NAME : 'moodle_data' BACKUP_PATH : '/var/lib/mysql/moodle_data' ``` Now I need to read this file. My Python code so far: ``` import yaml config = yaml.load(op...
2017/02/01
[ "https://Stackoverflow.com/questions/41974628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7234678/" ]
There are 2 issues: * As others have said, yaml.load() loads associative arrays as mappings, so you need to use `config['DB_NAME']`. * The syntax in your config file is not correct: in YAML, keys are separated from values by a colon+space. Should work if the file is formatted like this: ``` DB_HOST: 'localhost' DB_U...
**To backup your data base**, you should be able to export it as a `.sql` file. If you're using a specific interface, look for `Export`. Then, for Python's yaml parser. ``` DB_HOST :'localhost' DB_USER : 'root' DB_USER_PASSWORD:'P@$$w0rd' DB_NAME : 'moodle_data' BACKUP_PATH : '/var/lib/mysql/moodle_data' ``` is a `...
260,301
Stack Exchange already checks new questions and rejects them if they're exact duplicates. When this happens the asker gets a message about this. What it doesn't do is to check for *deleted* duplicate posts. So sometimes a spammer will ask the same seed question [over](https://writers.stackexchange.com/q/18026/1993) an...
2015/07/08
[ "https://meta.stackexchange.com/questions/260301", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/162102/" ]
> > Is StackExchange's styling copyrighted? > > > ### Yes it is. --- > > All the content contributed to Stack Overflow or other Stack Exchange sites is cc-wiki (aka cc-by-sa) licensed, intended to be shared and remixed. We even provide all our data as a convenient data dump, seeded by us. > > > But our cc-wik...
As far as my knowledge goes, technically, everything is copyrighted or has sort of copyright attachment to it even if they are allowing it under a permissive license such as GPL, CC, etc... As for the `key` CSS styling goes, I (*I'm not a lawyer, but just my thoughts*) don't think it will be an issue if you write your...
46,854,022
sorting a list of ten numbers with selection sort in assembly language. How does i convert this bubble sort method into selection sort method ``` `[org 0x0100] jmp start data: dw 60, 55, 45, 50, 40, 35, 25, 30, 10, 0 swap: db 0 start: mov bx, 0 ; initialize array index to zero mov byte [swap], 0 ; rest swap flag to n...
2017/10/20
[ "https://Stackoverflow.com/questions/46854022", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8751286/" ]
In the relationships you have to specify the name of the primary key when it is not called id, try to change the model like this: **SHOP** ``` public function products() { return $this->hasMany('App\Product', 'product_id'); //->withTimestamps(); } ``` **PRODUCT** ``` public function shop()...
If you are using resoure routes, then you need to specify the route key name as well: ``` public function getRouteKeyName() { return 'product_id'; } ```
46,854,022
sorting a list of ten numbers with selection sort in assembly language. How does i convert this bubble sort method into selection sort method ``` `[org 0x0100] jmp start data: dw 60, 55, 45, 50, 40, 35, 25, 30, 10, 0 swap: db 0 start: mov bx, 0 ; initialize array index to zero mov byte [swap], 0 ; rest swap flag to n...
2017/10/20
[ "https://Stackoverflow.com/questions/46854022", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8751286/" ]
In the relationships you have to specify the name of the primary key when it is not called id, try to change the model like this: **SHOP** ``` public function products() { return $this->hasMany('App\Product', 'product_id'); //->withTimestamps(); } ``` **PRODUCT** ``` public function shop()...
I had tried with my local with following: Schema: ``` Schema::create('shops', function (Blueprint $table) { $table->increments('id'); $table->string('name'); $table->timestamps(); }); Schema::create('products', function (Blueprint $table) { $table->increments('product_id'); $table->string('name')...
43,783,743
I have a script that restores db dump. As a parameter a database name is passed to this script. In a dump there is a following line: ``` ALTER DATABASE `previosDbName` CHARACTER ... ; ``` I have to change `previosDbName` to a value, passed as a parameter. I try to use `sed`, but it does not work. Here is a script: ...
2017/05/04
[ "https://Stackoverflow.com/questions/43783743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/511804/" ]
try this below code for children post ``` <?php $currentPostId = get_the_ID(); $args = array( 'post_type' => 'customer_care', 'post_parent' => $currentPostId ); $posts = new WP_Query($args); if( $posts->have_posts() ): while( $posts->have_posts() ) : $posts->the_post()...
``` //for display parent post <?php $args = array( 'posts_per_page' => 10, 'offset'=> 0, 'orderby' => 'menu_order' , 'post_type' => 'customer_care' ); $myposts = get_posts( $args ); foreach ( $myposts as $post ) : setup_postdata( $post ); ?> <li><a class="service-category-select" data-id="<?php echo s...
10,933,838
I know how to do it for a TXT file, but now I am having some trouble doing it for a CSV file. How can I read a CSV file from the bottom in Python?
2012/06/07
[ "https://Stackoverflow.com/questions/10933838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1234383/" ]
Pretty much the same way as for a text file: read the whole thing into a list and then go backwards: ``` import csv with open('test.csv', 'r') as textfile: for row in reversed(list(csv.reader(textfile))): print ', '.join(row) ``` If you want to get fancy, you could write a lot of code that reads blocks s...
Building on @mike-desimone 's answer. Here's a solution that provides the same structure as a python file object but is read in reverse, line by line: ``` import os class ReversedFile(object): def __init__(self, f, mode='r'): """ Wraps a file object with methods that make it be read in reverse lin...
10,933,838
I know how to do it for a TXT file, but now I am having some trouble doing it for a CSV file. How can I read a CSV file from the bottom in Python?
2012/06/07
[ "https://Stackoverflow.com/questions/10933838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1234383/" ]
Pretty much the same way as for a text file: read the whole thing into a list and then go backwards: ``` import csv with open('test.csv', 'r') as textfile: for row in reversed(list(csv.reader(textfile))): print ', '.join(row) ``` If you want to get fancy, you could write a lot of code that reads blocks s...
Go for it. This is simple program to reverse the rows from a CSV file. ``` import csv BC_file = open('Master.csv', 'rb') BC_reader = csv.reader(BC_file) next(BC_reader) for row in reversed(list(BC_reader)): print row[0] ```
10,933,838
I know how to do it for a TXT file, but now I am having some trouble doing it for a CSV file. How can I read a CSV file from the bottom in Python?
2012/06/07
[ "https://Stackoverflow.com/questions/10933838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1234383/" ]
Building on @mike-desimone 's answer. Here's a solution that provides the same structure as a python file object but is read in reverse, line by line: ``` import os class ReversedFile(object): def __init__(self, f, mode='r'): """ Wraps a file object with methods that make it be read in reverse lin...
Go for it. This is simple program to reverse the rows from a CSV file. ``` import csv BC_file = open('Master.csv', 'rb') BC_reader = csv.reader(BC_file) next(BC_reader) for row in reversed(list(BC_reader)): print row[0] ```
4,735,533
I'm using SharePoint 2010 and I'm configuring a web part using ChannelFactory and Certificate to access a WCF service. But I'm getting this error message: Error occured: Could not establish secure channel for SSL/TLS with authority 'my FQDN'. How could I configure my SharePoint web application to have access to read...
2011/01/19
[ "https://Stackoverflow.com/questions/4735533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/133212/" ]
No it doesn't but you can extend the functionality to do so by extending the \_initProductLayout method in Mage\_Catalog\_ProductController under where the code is this ``` $update = $this->getLayout()->getUpdate(); $update->addHandle('default'); $this->addActionLayoutHandles(); $update->addHandle('P...
If in case you want to switch view.phtml based on the attribute set then here is what you need to do: ``` <PRODUCT_ATTRIBUTE_SET_ID_9> <label>Catalog Product View (Default)</label> <reference name="product.info"> <action method="setTemplate"><template>catalog/product/custom-view.phtml</template></actio...
4,735,533
I'm using SharePoint 2010 and I'm configuring a web part using ChannelFactory and Certificate to access a WCF service. But I'm getting this error message: Error occured: Could not establish secure channel for SSL/TLS with authority 'my FQDN'. How could I configure my SharePoint web application to have access to read...
2011/01/19
[ "https://Stackoverflow.com/questions/4735533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/133212/" ]
No it doesn't but you can extend the functionality to do so by extending the \_initProductLayout method in Mage\_Catalog\_ProductController under where the code is this ``` $update = $this->getLayout()->getUpdate(); $update->addHandle('default'); $this->addActionLayoutHandles(); $update->addHandle('P...
There is a good tutorial on this: <http://magebase.com/magento-tutorials/creating-custom-layout-handles/> This uses following event: **controller\_action\_layout\_load\_before** For this I set up in config.xml following ``` <events> <controller_action_layout_load_before> <observers> <mymodule...
1,849,245
Python has [IPython](http://ipython.scipy.org/).. does OCaml have anything similar? I'd very much like to have command history, although other features would be nice too. I've read that I could get command history by running it in Emacs, but I don't use Emacs..
2009/12/04
[ "https://Stackoverflow.com/questions/1849245", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149330/" ]
[rlwrap](http://utopia.knoware.nl/~hlub/uck/rlwrap/) gives you readline features (history, editing commands, etc). Also, [Findlib](http://www.camlcity.org/archive/programming/findlib.html) adds some functionality, see the [quickstart](http://projects.camlcity.org/projects/dl/findlib-1.2.1/doc/guide-html/quickstart.html...
Use `ledit ocaml` with [ledit](http://cristal.inria.fr/~ddr/ledit/).
1,849,245
Python has [IPython](http://ipython.scipy.org/).. does OCaml have anything similar? I'd very much like to have command history, although other features would be nice too. I've read that I could get command history by running it in Emacs, but I don't use Emacs..
2009/12/04
[ "https://Stackoverflow.com/questions/1849245", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149330/" ]
[rlwrap](http://utopia.knoware.nl/~hlub/uck/rlwrap/) gives you readline features (history, editing commands, etc). Also, [Findlib](http://www.camlcity.org/archive/programming/findlib.html) adds some functionality, see the [quickstart](http://projects.camlcity.org/projects/dl/findlib-1.2.1/doc/guide-html/quickstart.html...
There's [utop](https://forge.ocamlcore.org/projects/utop/)! It has autocompletion, is emacs compatible and so on.
1,849,245
Python has [IPython](http://ipython.scipy.org/).. does OCaml have anything similar? I'd very much like to have command history, although other features would be nice too. I've read that I could get command history by running it in Emacs, but I don't use Emacs..
2009/12/04
[ "https://Stackoverflow.com/questions/1849245", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149330/" ]
[rlwrap](http://utopia.knoware.nl/~hlub/uck/rlwrap/) gives you readline features (history, editing commands, etc). Also, [Findlib](http://www.camlcity.org/archive/programming/findlib.html) adds some functionality, see the [quickstart](http://projects.camlcity.org/projects/dl/findlib-1.2.1/doc/guide-html/quickstart.html...
You can also use the online [toplevel](http://try.ocamlpro.com/).
1,849,245
Python has [IPython](http://ipython.scipy.org/).. does OCaml have anything similar? I'd very much like to have command history, although other features would be nice too. I've read that I could get command history by running it in Emacs, but I don't use Emacs..
2009/12/04
[ "https://Stackoverflow.com/questions/1849245", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149330/" ]
There's [utop](https://forge.ocamlcore.org/projects/utop/)! It has autocompletion, is emacs compatible and so on.
Use `ledit ocaml` with [ledit](http://cristal.inria.fr/~ddr/ledit/).