qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
17,197,129
I have a datagrid which populates a datatable, I want to export the DataTable to excel on click of a button. I am using MVVM for this application. So is it ok to implement the export feature in my view? Secondly, as i am using xaml and desktop application, how do i capture the grid and its details. Can any one sugge...
2013/06/19
[ "https://Stackoverflow.com/questions/17197129", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1653540/" ]
This is what i have done and it helped me: ``` private readonly ICommand m_ExportButtonClick; private string ExcelFilePath = ""; public ICommand ExportButtonClick { get { return m_ExportButtonClick; } } private void OnRunExport() { try { if (queryDatatable == null || query...
Here's an extension method to output to any DataTable to a csv (which excel can open) ```vb Imports System.Text Imports System.IO Imports System.Runtime.CompilerServices Module ExtensionMethods <Extension()> _ Public Sub OutputAsCSV(ByVal dt As DataTable, ByVal filePath As String) Dim sb As New Strin...
17,197,129
I have a datagrid which populates a datatable, I want to export the DataTable to excel on click of a button. I am using MVVM for this application. So is it ok to implement the export feature in my view? Secondly, as i am using xaml and desktop application, how do i capture the grid and its details. Can any one sugge...
2013/06/19
[ "https://Stackoverflow.com/questions/17197129", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1653540/" ]
This is what i have done and it helped me: ``` private readonly ICommand m_ExportButtonClick; private string ExcelFilePath = ""; public ICommand ExportButtonClick { get { return m_ExportButtonClick; } } private void OnRunExport() { try { if (queryDatatable == null || query...
Try googling around a little. This is a very common problem and has been asked a lot already. Here's a good answer from this [SO question](https://stackoverflow.com/questions/3283204/convert-datatable-to-excel-2007-xlsx) ```cs public static void ExportToExcel<T>(IEnumerable<T> exportData) { Excel.ApplicationClass ...
71,940,399
I want to create an trigger inside an procedure. but after some research I got to know that it is not possible. can u suggest me another way I can achieve the below actions. (I cant share exact data and queries due to some reason. please refer similar queries.) ***What I want*** I have created an temporary table cont...
2022/04/20
[ "https://Stackoverflow.com/questions/71940399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17349359/" ]
``` const idx = headings.findIndex(el => el.text === 3 && el.type === "♠") headings.splice(idx,1) ```
You can also use filter ``` const newHeadings = headings.filter(item => !item.type === "♠") ``` If you also want to check for the value of `i` ``` const newHeadings = headings.filter((item, index)=> !(item.type === "♠" && item.text == (index + 1))) ``` This returns a new array and does not modify original
71,940,399
I want to create an trigger inside an procedure. but after some research I got to know that it is not possible. can u suggest me another way I can achieve the below actions. (I cant share exact data and queries due to some reason. please refer similar queries.) ***What I want*** I have created an temporary table cont...
2022/04/20
[ "https://Stackoverflow.com/questions/71940399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17349359/" ]
``` const idx = headings.findIndex(el => el.text === 3 && el.type === "♠") headings.splice(idx,1) ```
There are multiple ways to do it. You can use `filter` or `splice` method to do it. [filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) Here you can filter all other element then 3 and "♠" and assign it to new array. [findIndex](https://developer.mozilla.org/en-US/...
71,940,399
I want to create an trigger inside an procedure. but after some research I got to know that it is not possible. can u suggest me another way I can achieve the below actions. (I cant share exact data and queries due to some reason. please refer similar queries.) ***What I want*** I have created an temporary table cont...
2022/04/20
[ "https://Stackoverflow.com/questions/71940399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17349359/" ]
``` const idx = headings.findIndex(el => el.text === 3 && el.type === "♠") headings.splice(idx,1) ```
Use `lodash`'s [`_.remove`](https://lodash.com/docs/4.17.15#remove): ```js const headings = _.range(1, 13).map(i => ({text: i, type: "♠"})); _.remove(headings, {text: 3, type: "♠"}); console.log(headings); ``` ```html <script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js"></script> ``` ...
71,940,399
I want to create an trigger inside an procedure. but after some research I got to know that it is not possible. can u suggest me another way I can achieve the below actions. (I cant share exact data and queries due to some reason. please refer similar queries.) ***What I want*** I have created an temporary table cont...
2022/04/20
[ "https://Stackoverflow.com/questions/71940399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17349359/" ]
There are multiple ways to do it. You can use `filter` or `splice` method to do it. [filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) Here you can filter all other element then 3 and "♠" and assign it to new array. [findIndex](https://developer.mozilla.org/en-US/...
You can also use filter ``` const newHeadings = headings.filter(item => !item.type === "♠") ``` If you also want to check for the value of `i` ``` const newHeadings = headings.filter((item, index)=> !(item.type === "♠" && item.text == (index + 1))) ``` This returns a new array and does not modify original
71,940,399
I want to create an trigger inside an procedure. but after some research I got to know that it is not possible. can u suggest me another way I can achieve the below actions. (I cant share exact data and queries due to some reason. please refer similar queries.) ***What I want*** I have created an temporary table cont...
2022/04/20
[ "https://Stackoverflow.com/questions/71940399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17349359/" ]
There are multiple ways to do it. You can use `filter` or `splice` method to do it. [filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) Here you can filter all other element then 3 and "♠" and assign it to new array. [findIndex](https://developer.mozilla.org/en-US/...
Use `lodash`'s [`_.remove`](https://lodash.com/docs/4.17.15#remove): ```js const headings = _.range(1, 13).map(i => ({text: i, type: "♠"})); _.remove(headings, {text: 3, type: "♠"}); console.log(headings); ``` ```html <script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js"></script> ``` ...
1,078,704
I am using XUbuntu 18.04 and I am struggling to install my scanner. I have tried everything i have been able to find on both Brother homepage and AskUbuntu. I have newest brsaneconfig4, brscan-skey and rules. Command `brsaneconfig4 -`q returns: ``` (...) Devices on network 0 DCP-7055W "DCP-7055W" I:...
2018/09/26
[ "https://askubuntu.com/questions/1078704", "https://askubuntu.com", "https://askubuntu.com/users/864165/" ]
I came across the posting [Brother MFC-L2700DW printer can print, can’t scan](https://askubuntu.com/questions/970831/brother-mfc-l2700dw-printer-can-print-cant-scan) by oscar1919 on Ask Ubuntu. I have a Brother multi-function printer but a different model than that specified by Oscar. Oscar indicated that some of the ...
Additional answer here which works on every Ubuntu version so far. On brother website, there's a package that does that's called "Driver install tool". 1. download it 2. run in terminal 3. provide your model by typing it's name i.e: `DCP-9015CDW` follow the installer to also install a scanner drivers after printer i...
1,078,704
I am using XUbuntu 18.04 and I am struggling to install my scanner. I have tried everything i have been able to find on both Brother homepage and AskUbuntu. I have newest brsaneconfig4, brscan-skey and rules. Command `brsaneconfig4 -`q returns: ``` (...) Devices on network 0 DCP-7055W "DCP-7055W" I:...
2018/09/26
[ "https://askubuntu.com/questions/1078704", "https://askubuntu.com", "https://askubuntu.com/users/864165/" ]
I came across the posting [Brother MFC-L2700DW printer can print, can’t scan](https://askubuntu.com/questions/970831/brother-mfc-l2700dw-printer-can-print-cant-scan) by oscar1919 on Ask Ubuntu. I have a Brother multi-function printer but a different model than that specified by Oscar. Oscar indicated that some of the ...
Adding your username to the group that owns the scanner, `lp` in my case, may also be needed. `sudo adduser $USER lp`.
1,078,704
I am using XUbuntu 18.04 and I am struggling to install my scanner. I have tried everything i have been able to find on both Brother homepage and AskUbuntu. I have newest brsaneconfig4, brscan-skey and rules. Command `brsaneconfig4 -`q returns: ``` (...) Devices on network 0 DCP-7055W "DCP-7055W" I:...
2018/09/26
[ "https://askubuntu.com/questions/1078704", "https://askubuntu.com", "https://askubuntu.com/users/864165/" ]
Additional answer here which works on every Ubuntu version so far. On brother website, there's a package that does that's called "Driver install tool". 1. download it 2. run in terminal 3. provide your model by typing it's name i.e: `DCP-9015CDW` follow the installer to also install a scanner drivers after printer i...
Adding your username to the group that owns the scanner, `lp` in my case, may also be needed. `sudo adduser $USER lp`.
71,110
Some people erased three author names including mine from a paper previously submitted (and rejected by three different journals) and got it accepted by Case Reports In Emergency Medicine. I presented the publishing editor of the journal multiple clear proofs of the plagiarism. Although the journal declares that it c...
2016/06/10
[ "https://academia.stackexchange.com/questions/71110", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/56431/" ]
Working with the editor, until that process is finished, is probably the only thing to do at first. It will undoubtedly be a long process, with delays, so patience and persistence will be necessary. Try not to let the mobbing get to you, and try to remain calm and professional at all times, despite any pressure others ...
I always get down voted for saying this, but outside of Academia, if there is a very cut and dry case of someone trying to take ownership of works that you hold copyright in, then it would go to court and be handled in about a month or so (in Germany). I appreciate that going to court is something that is considered t...
71,110
Some people erased three author names including mine from a paper previously submitted (and rejected by three different journals) and got it accepted by Case Reports In Emergency Medicine. I presented the publishing editor of the journal multiple clear proofs of the plagiarism. Although the journal declares that it c...
2016/06/10
[ "https://academia.stackexchange.com/questions/71110", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/56431/" ]
Working with the editor, until that process is finished, is probably the only thing to do at first. It will undoubtedly be a long process, with delays, so patience and persistence will be necessary. Try not to let the mobbing get to you, and try to remain calm and professional at all times, despite any pressure others ...
Search for legal help from an expert in I.P. , expose them publicly and hope for the best. This doesn't mean that you'll be able to prove the rights if you didn't took enough precautions to protect your paper and ignorance by this side is hard to prove in court. The next time though, you can publish your own thesis/ess...
71,110
Some people erased three author names including mine from a paper previously submitted (and rejected by three different journals) and got it accepted by Case Reports In Emergency Medicine. I presented the publishing editor of the journal multiple clear proofs of the plagiarism. Although the journal declares that it c...
2016/06/10
[ "https://academia.stackexchange.com/questions/71110", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/56431/" ]
I always get down voted for saying this, but outside of Academia, if there is a very cut and dry case of someone trying to take ownership of works that you hold copyright in, then it would go to court and be handled in about a month or so (in Germany). I appreciate that going to court is something that is considered t...
Search for legal help from an expert in I.P. , expose them publicly and hope for the best. This doesn't mean that you'll be able to prove the rights if you didn't took enough precautions to protect your paper and ignorance by this side is hard to prove in court. The next time though, you can publish your own thesis/ess...
34,695,078
I'm having a problem updating php in Linux Redhat. I updated by ``` yum install php56w ``` But it says there's no repository for php56w. So I updated httpd by ``` yum update httpd ``` But since then, all websites(which is using php) are not working, they're showing 500 Internal server error. This seems to be per...
2016/01/09
[ "https://Stackoverflow.com/questions/34695078", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4319602/" ]
Which RHEL version? If it's RHEL 6 and you're upgrading the PHP version, you should use the PHP 5.6 software collection (<https://access.redhat.com/products/Red_Hat_Enterprise_Linux/Developer/#dev-page=5>). If it's RHEL 7 - I don't recall the default PHP version. :/
If you want PHP versions which are not considered stable enough by RedHat you will need to enable the EPEL repository and then install php like you tried before. Do the following for enabling EPEL repo, make sure you are a root user: ON RHEL/CentOS 7 64 Bit: ``` wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/e...
22,486,798
The following MPMoviePlayerController will not present in my iOS application. I am trying to make it appear when my tableView row is selected: ``` - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initW...
2014/03/18
[ "https://Stackoverflow.com/questions/22486798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3434331/" ]
`$result` is a boolean because the query you are executing is failing! A failed query gives off boolean `'false'`. Check you query. Try setting $start with a value before using it in your query.
Set $start = 1 before your query try again. ``` $start = 1; ```
424,214
Where can I exponentiate a $3\times 3$ matrix like $\left[\begin{array}{ccc} 0 & 1 & 0\\ 1 & 0 & 0\\ 0 & 0 & 0 \end{array}\right]$ online? Is there some website where this is possible? Thank you very much.
2013/06/19
[ "https://math.stackexchange.com/questions/424214", "https://math.stackexchange.com", "https://math.stackexchange.com/users/83056/" ]
Depending on which matrix exponential you want, you can use: * [*Wolfram Alpha 1st option: $e^{A}$*](http://www.wolframalpha.com/input/?i=matrixexp%28%7B%7B0%2C1%2C0%7D%2C%7B1%2C0%2C0%7D%2C%7B0%2C0%2C0%7D%7D%29) * [*Wolfram Alpha 2nd option: $e^{At}$*](http://www.wolframalpha.com/input/?i=matrixexp%28t+%7B%7B0%2C1%2C0...
Somewhat perversely, could I suggest you first try analytically, by [Sylvester's formula](https://en.wikipedia.org/wiki/Sylvester%27s_formula), or, more specifically, [simpler methods as below](https://en.wikipedia.org/wiki/Matrix_exponential#Computing_the_matrix_exponential)? Still, in your specific case, this would...
66,184,300
I have a df with customer\_id, year, order and a few other but unimportant columns. Every time when i get a new order, my code creates a new row, so there can be more than one row for each customer\_id. I want to create a new column 'actually', which includes 'True' if a customer\_id bought in 2020 or 2021. My Code is:...
2021/02/13
[ "https://Stackoverflow.com/questions/66184300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11203274/" ]
you can create the column name 'Actually' something like this. ``` list1=df['Customer_id'][df.year==2020].unique() list2=df['Customer_id'][df.year==2021].unique() df['Actually']=df['Customer_id'].apply( lambda x : x in list1 or x in list2) ```
You can use apply method, to avoid loops: ``` df['actually']=df['customer_id'].apply(lambda x: df[df.customer_id==x]['year'].str.contains('2020').any() or df[df.customer_id==x]['year'].str.contains('2021').any()) ```
66,184,300
I have a df with customer\_id, year, order and a few other but unimportant columns. Every time when i get a new order, my code creates a new row, so there can be more than one row for each customer\_id. I want to create a new column 'actually', which includes 'True' if a customer\_id bought in 2020 or 2021. My Code is:...
2021/02/13
[ "https://Stackoverflow.com/questions/66184300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11203274/" ]
Based on my understanding of your scaenario, here is a simple code: ```py import pandas as pd # Sample data to recreate the scenarion data = {'customer_id': ['c1','c2','c1','c4','c3','c3'], 'year': [2019, 2018,2021,2012,2020,2021], 'order': ['A1','A2','A3','A4','A5','A6']} df = pd.DataFrame.from_dict(data) # Creatin...
You can use apply method, to avoid loops: ``` df['actually']=df['customer_id'].apply(lambda x: df[df.customer_id==x]['year'].str.contains('2020').any() or df[df.customer_id==x]['year'].str.contains('2021').any()) ```
66,184,300
I have a df with customer\_id, year, order and a few other but unimportant columns. Every time when i get a new order, my code creates a new row, so there can be more than one row for each customer\_id. I want to create a new column 'actually', which includes 'True' if a customer\_id bought in 2020 or 2021. My Code is:...
2021/02/13
[ "https://Stackoverflow.com/questions/66184300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11203274/" ]
you can create the column name 'Actually' something like this. ``` list1=df['Customer_id'][df.year==2020].unique() list2=df['Customer_id'][df.year==2021].unique() df['Actually']=df['Customer_id'].apply( lambda x : x in list1 or x in list2) ```
Based on my understanding of your scaenario, here is a simple code: ```py import pandas as pd # Sample data to recreate the scenarion data = {'customer_id': ['c1','c2','c1','c4','c3','c3'], 'year': [2019, 2018,2021,2012,2020,2021], 'order': ['A1','A2','A3','A4','A5','A6']} df = pd.DataFrame.from_dict(data) # Creatin...
6,590,891
I want to create a computed column that is the concatenation of several other columns. In the below example, fulladdress is null in the result set when any of the 'real' columns is null. How can I adjust the computed column function to take into account the nullable columns? ``` CREATE TABLE Locations ( [id] [int]...
2011/07/06
[ "https://Stackoverflow.com/questions/6590891", "https://Stackoverflow.com", "https://Stackoverflow.com/users/156611/" ]
This gets messy pretty quick, but here's a start: ``` ISNULL(address,'') + ' ' + ISNULL(address2,'') + ' ' + ISNULL(city,'') + ' ' + ISNULL(state,'') + ' ' + ISNULL(zip,'') ``` (If `isnull` doesn't work, you can try `coalesce`. If neither work, share what DMBS you're using.)
You shouldn't have a full address column (which is a duplicate of other columns) stored in your database unless you have a good reason. The correct way would be to construct the full address string in your queries. By creating the field dynamically you reduce redundancy in the table and you have one less column to main...
18,979
Can any chess engine tell you why a move is bad or good? For example, say a chess engine says the score against my opponent is currently +2 in my favor. I then make a move and my score drops to say 1.4. Can any engine tell me what I did wrong such that my score dropped from 2 to 1.4 (assuming I didn't hang a piece or p...
2017/10/29
[ "https://chess.stackexchange.com/questions/18979", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/443/" ]
**Sort of (but not really) - and it's actually getting *harder* for engines to do this for you.** To understand why, you have to understand how the evaluation goes. Engines typically can make snap evaluations on a given position, giving it a raw point value. Then, whatever the position is, they play forward, trying to ...
The engine evaluation ("2"/"1.4") is in fact very similar to how a human would evaluate a position. It is basically a sum of various factors such as *material*, *king safety*, *piece activity*, etc. evaluated not for the current position but for the position some 20 moves ahead or so; assuming perfect play from both si...
18,979
Can any chess engine tell you why a move is bad or good? For example, say a chess engine says the score against my opponent is currently +2 in my favor. I then make a move and my score drops to say 1.4. Can any engine tell me what I did wrong such that my score dropped from 2 to 1.4 (assuming I didn't hang a piece or p...
2017/10/29
[ "https://chess.stackexchange.com/questions/18979", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/443/" ]
@D\_M mentioned about Chessmaster, but it only reports very simple static features such as: * Your queen is being attacked * You lose a pawn in the computer line * You win an exchange in the computer line Do you know why Chessmaster did that? That's because the implementation was easy. > > Can any engine tell me wh...
The engine evaluation ("2"/"1.4") is in fact very similar to how a human would evaluate a position. It is basically a sum of various factors such as *material*, *king safety*, *piece activity*, etc. evaluated not for the current position but for the position some 20 moves ahead or so; assuming perfect play from both si...
18,979
Can any chess engine tell you why a move is bad or good? For example, say a chess engine says the score against my opponent is currently +2 in my favor. I then make a move and my score drops to say 1.4. Can any engine tell me what I did wrong such that my score dropped from 2 to 1.4 (assuming I didn't hang a piece or p...
2017/10/29
[ "https://chess.stackexchange.com/questions/18979", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/443/" ]
**Sort of (but not really) - and it's actually getting *harder* for engines to do this for you.** To understand why, you have to understand how the evaluation goes. Engines typically can make snap evaluations on a given position, giving it a raw point value. Then, whatever the position is, they play forward, trying to ...
There've been attempts to make engines explain why moves are good or bad. Here's an [example](https://app.decodechess.com/) I am aware of. You could try clicking through the example to see how helpful it is.
18,979
Can any chess engine tell you why a move is bad or good? For example, say a chess engine says the score against my opponent is currently +2 in my favor. I then make a move and my score drops to say 1.4. Can any engine tell me what I did wrong such that my score dropped from 2 to 1.4 (assuming I didn't hang a piece or p...
2017/10/29
[ "https://chess.stackexchange.com/questions/18979", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/443/" ]
I think the chess engine can "tell" you, but in an indirect way. What I would do is to play several different moves from the same position. The chess engine will (presumably) give you a different score for each one. This will allow you to "rank" the various moves. Perhaps a pattern will emerge. If not, you might want...
No. Although Chessmaster as mentioned by everyone can tell you some basic things like if the following line will result in an exchange sacrifice or you may lose a pawn and so so. But you can also analyse this yourself by playing down the lines. There are no chess engines nor I see any in the near future that can expla...
18,979
Can any chess engine tell you why a move is bad or good? For example, say a chess engine says the score against my opponent is currently +2 in my favor. I then make a move and my score drops to say 1.4. Can any engine tell me what I did wrong such that my score dropped from 2 to 1.4 (assuming I didn't hang a piece or p...
2017/10/29
[ "https://chess.stackexchange.com/questions/18979", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/443/" ]
**Sort of (but not really) - and it's actually getting *harder* for engines to do this for you.** To understand why, you have to understand how the evaluation goes. Engines typically can make snap evaluations on a given position, giving it a raw point value. Then, whatever the position is, they play forward, trying to ...
Yes, I have seen programs that attempt to explain why a move is good or bad in language. Chessmaster 9000 would do this. Many engines will show you the best line for each move. So it can tell you that if you play g6, it expects the game to go f5 gxf5 Nxf5, whereas if you play b6 it expects the game to go a5 bxa5 Bxa5....
18,979
Can any chess engine tell you why a move is bad or good? For example, say a chess engine says the score against my opponent is currently +2 in my favor. I then make a move and my score drops to say 1.4. Can any engine tell me what I did wrong such that my score dropped from 2 to 1.4 (assuming I didn't hang a piece or p...
2017/10/29
[ "https://chess.stackexchange.com/questions/18979", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/443/" ]
**Sort of (but not really) - and it's actually getting *harder* for engines to do this for you.** To understand why, you have to understand how the evaluation goes. Engines typically can make snap evaluations on a given position, giving it a raw point value. Then, whatever the position is, they play forward, trying to ...
In addition to other answers, engines don't assess positions like humans, so they can't provide a good explanation why *they think* your move is inferior (emphasis on they think, not necessarily). But you can follow sidelines using engine suggestions and understand why it was inferior. At least this is what I do. Cou...
18,979
Can any chess engine tell you why a move is bad or good? For example, say a chess engine says the score against my opponent is currently +2 in my favor. I then make a move and my score drops to say 1.4. Can any engine tell me what I did wrong such that my score dropped from 2 to 1.4 (assuming I didn't hang a piece or p...
2017/10/29
[ "https://chess.stackexchange.com/questions/18979", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/443/" ]
Yes, I have seen programs that attempt to explain why a move is good or bad in language. Chessmaster 9000 would do this. Many engines will show you the best line for each move. So it can tell you that if you play g6, it expects the game to go f5 gxf5 Nxf5, whereas if you play b6 it expects the game to go a5 bxa5 Bxa5....
The engine evaluation ("2"/"1.4") is in fact very similar to how a human would evaluate a position. It is basically a sum of various factors such as *material*, *king safety*, *piece activity*, etc. evaluated not for the current position but for the position some 20 moves ahead or so; assuming perfect play from both si...
18,979
Can any chess engine tell you why a move is bad or good? For example, say a chess engine says the score against my opponent is currently +2 in my favor. I then make a move and my score drops to say 1.4. Can any engine tell me what I did wrong such that my score dropped from 2 to 1.4 (assuming I didn't hang a piece or p...
2017/10/29
[ "https://chess.stackexchange.com/questions/18979", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/443/" ]
Yes, I have seen programs that attempt to explain why a move is good or bad in language. Chessmaster 9000 would do this. Many engines will show you the best line for each move. So it can tell you that if you play g6, it expects the game to go f5 gxf5 Nxf5, whereas if you play b6 it expects the game to go a5 bxa5 Bxa5....
No. Although Chessmaster as mentioned by everyone can tell you some basic things like if the following line will result in an exchange sacrifice or you may lose a pawn and so so. But you can also analyse this yourself by playing down the lines. There are no chess engines nor I see any in the near future that can expla...
18,979
Can any chess engine tell you why a move is bad or good? For example, say a chess engine says the score against my opponent is currently +2 in my favor. I then make a move and my score drops to say 1.4. Can any engine tell me what I did wrong such that my score dropped from 2 to 1.4 (assuming I didn't hang a piece or p...
2017/10/29
[ "https://chess.stackexchange.com/questions/18979", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/443/" ]
I think the chess engine can "tell" you, but in an indirect way. What I would do is to play several different moves from the same position. The chess engine will (presumably) give you a different score for each one. This will allow you to "rank" the various moves. Perhaps a pattern will emerge. If not, you might want...
The engine evaluation ("2"/"1.4") is in fact very similar to how a human would evaluate a position. It is basically a sum of various factors such as *material*, *king safety*, *piece activity*, etc. evaluated not for the current position but for the position some 20 moves ahead or so; assuming perfect play from both si...
18,979
Can any chess engine tell you why a move is bad or good? For example, say a chess engine says the score against my opponent is currently +2 in my favor. I then make a move and my score drops to say 1.4. Can any engine tell me what I did wrong such that my score dropped from 2 to 1.4 (assuming I didn't hang a piece or p...
2017/10/29
[ "https://chess.stackexchange.com/questions/18979", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/443/" ]
**Sort of (but not really) - and it's actually getting *harder* for engines to do this for you.** To understand why, you have to understand how the evaluation goes. Engines typically can make snap evaluations on a given position, giving it a raw point value. Then, whatever the position is, they play forward, trying to ...
I think the chess engine can "tell" you, but in an indirect way. What I would do is to play several different moves from the same position. The chess engine will (presumably) give you a different score for each one. This will allow you to "rank" the various moves. Perhaps a pattern will emerge. If not, you might want...
51,019,433
I'm trying to develop a plugin, and I'm not the best at developing plugins. I do ofc know php, and oop, but the wp functions is pretty difficult to understand, and also the codex. I'm trying to make an "ORDERS" page, where you can click on a button, to go to `view_order.php` where it will fetch all the data from the s...
2018/06/25
[ "https://Stackoverflow.com/questions/51019433", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8533033/" ]
use this as a reference ``` <nav class="navbar navbar-expand-lg navbar-light bg-light"> <a class="navbar-brand" href="#">Navbar</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Togg...
I just tested on my phone and the navbar seems to be fixed no problem. Maybe adding this meta tag will help you `<meta name="viewport" content="width=device-width, initial-scale=1">`
31,409,502
I have a `table` that I want to select the very first `TH` only if it contains a `caption`. I thought it might be something like this: ```css .myTable caption + tr th:first-child { /* stuff */ } ``` It's instead selecting nothing. Is this a bug in CSS or just my logic? See my JSFiddle: <https://jsfiddle.net/ukb...
2015/07/14
[ "https://Stackoverflow.com/questions/31409502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1096126/" ]
The cause here is exactly the same as the one described in [this related question](https://stackoverflow.com/questions/5568859/why-doesnt-table-tr-td-work-when-using-the-child-selector) about the use of child selectors with `tr`. The problem is that `tr` elements are made children of an implicit `tbody` element, so wha...
You're forgetting about the `<tbody>` element which wraps the `<tr>` element. Even though not specified in your (otherwise invalid) HTML, the `<tbody>` element is automatically implemented by the browser as a way of validating this, so instead of: ``` <caption> <tr> ``` You end up with: ``` <caption> <tbody> <t...
120,326
I am a beginning graduate student in Mathematics. I have a professor who always brings up the fact that my GPA is not great in my undergraduate degree even though my performance is above the norm in the institution I am enrolled at the moment, so far I got straight A's in the graduate courses that I have completed. He ...
2018/11/19
[ "https://academia.stackexchange.com/questions/120326", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/99012/" ]
There are several possibilities. Some may be appropriate. Some may work. Or not. **Avoidance**. If possible, just avoid this person. Don't have anything to do with him. Difficult, I know. There are probably limited options to do that. **Ignore his taunts**. My guess is that he disgraces himself when he does this. I...
It would appear that he is trying to shame you to make himself feel better. This is not unusual behaviour, though you would hope for better from a senior academic. One solution is to call him on it enough to stop it but not enough to make an enemy of him: "Yes, my GPA was indeed 3.0. That seems to have really caught ...
120,326
I am a beginning graduate student in Mathematics. I have a professor who always brings up the fact that my GPA is not great in my undergraduate degree even though my performance is above the norm in the institution I am enrolled at the moment, so far I got straight A's in the graduate courses that I have completed. He ...
2018/11/19
[ "https://academia.stackexchange.com/questions/120326", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/99012/" ]
As I understand you, you are being *publicly* shamed (in front of fellow grad students) by this professor by dint of your undergrad record. If you are in the US, this is violating FERPA by revealing your academic record. Other countries have similar privacy laws. File a FERPA complaint and wipe that smug smile off his ...
It would appear that he is trying to shame you to make himself feel better. This is not unusual behaviour, though you would hope for better from a senior academic. One solution is to call him on it enough to stop it but not enough to make an enemy of him: "Yes, my GPA was indeed 3.0. That seems to have really caught ...
120,326
I am a beginning graduate student in Mathematics. I have a professor who always brings up the fact that my GPA is not great in my undergraduate degree even though my performance is above the norm in the institution I am enrolled at the moment, so far I got straight A's in the graduate courses that I have completed. He ...
2018/11/19
[ "https://academia.stackexchange.com/questions/120326", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/99012/" ]
I've gone through this nonsense before. Here is an interaction I had with one of my professors regarding an assignment I had in college, around 20 years ago: > > Me: Sir, I know what pride is but what is prejudice? > > Him: Prejudice means, "what I have against you" > > > Best part is, I still did not underst...
It would appear that he is trying to shame you to make himself feel better. This is not unusual behaviour, though you would hope for better from a senior academic. One solution is to call him on it enough to stop it but not enough to make an enemy of him: "Yes, my GPA was indeed 3.0. That seems to have really caught ...
120,326
I am a beginning graduate student in Mathematics. I have a professor who always brings up the fact that my GPA is not great in my undergraduate degree even though my performance is above the norm in the institution I am enrolled at the moment, so far I got straight A's in the graduate courses that I have completed. He ...
2018/11/19
[ "https://academia.stackexchange.com/questions/120326", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/99012/" ]
Seek advice from a trusted mentor. If you have another professor or advisor who you believe you can speak to about this, I would encourage you to explore that option. Not only is it important to have a positive influence to counteract the negative impact of this professor in your personal development, but quality ment...
I feel you have to be careful not to go nuclear, because if he is your professor you have to be careful not to move from "annoyance" to "threat" in his eyes, given he presumably grades your work. However, it seems like he's already put himself in a bad position since you said he "tries ... to humiliate me in front of o...
120,326
I am a beginning graduate student in Mathematics. I have a professor who always brings up the fact that my GPA is not great in my undergraduate degree even though my performance is above the norm in the institution I am enrolled at the moment, so far I got straight A's in the graduate courses that I have completed. He ...
2018/11/19
[ "https://academia.stackexchange.com/questions/120326", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/99012/" ]
As I understand you, you are being *publicly* shamed (in front of fellow grad students) by this professor by dint of your undergrad record. If you are in the US, this is violating FERPA by revealing your academic record. Other countries have similar privacy laws. File a FERPA complaint and wipe that smug smile off his ...
Seek advice from a trusted mentor. If you have another professor or advisor who you believe you can speak to about this, I would encourage you to explore that option. Not only is it important to have a positive influence to counteract the negative impact of this professor in your personal development, but quality ment...
120,326
I am a beginning graduate student in Mathematics. I have a professor who always brings up the fact that my GPA is not great in my undergraduate degree even though my performance is above the norm in the institution I am enrolled at the moment, so far I got straight A's in the graduate courses that I have completed. He ...
2018/11/19
[ "https://academia.stackexchange.com/questions/120326", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/99012/" ]
Seek advice from a trusted mentor. If you have another professor or advisor who you believe you can speak to about this, I would encourage you to explore that option. Not only is it important to have a positive influence to counteract the negative impact of this professor in your personal development, but quality ment...
It would appear that he is trying to shame you to make himself feel better. This is not unusual behaviour, though you would hope for better from a senior academic. One solution is to call him on it enough to stop it but not enough to make an enemy of him: "Yes, my GPA was indeed 3.0. That seems to have really caught ...
120,326
I am a beginning graduate student in Mathematics. I have a professor who always brings up the fact that my GPA is not great in my undergraduate degree even though my performance is above the norm in the institution I am enrolled at the moment, so far I got straight A's in the graduate courses that I have completed. He ...
2018/11/19
[ "https://academia.stackexchange.com/questions/120326", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/99012/" ]
Seek advice from a trusted mentor. If you have another professor or advisor who you believe you can speak to about this, I would encourage you to explore that option. Not only is it important to have a positive influence to counteract the negative impact of this professor in your personal development, but quality ment...
I will copy on [B.Goddard's answer](https://academia.stackexchange.com/a/120346/9200) - wipe the arrogant smile off their face. On the other hand, this will backfire to you in a matter of seconds, maybe sooner. So be ready for that. * File as many instances as you can of when you were mocked by that professor. * Look...
120,326
I am a beginning graduate student in Mathematics. I have a professor who always brings up the fact that my GPA is not great in my undergraduate degree even though my performance is above the norm in the institution I am enrolled at the moment, so far I got straight A's in the graduate courses that I have completed. He ...
2018/11/19
[ "https://academia.stackexchange.com/questions/120326", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/99012/" ]
There are several possibilities. Some may be appropriate. Some may work. Or not. **Avoidance**. If possible, just avoid this person. Don't have anything to do with him. Difficult, I know. There are probably limited options to do that. **Ignore his taunts**. My guess is that he disgraces himself when he does this. I...
I feel you have to be careful not to go nuclear, because if he is your professor you have to be careful not to move from "annoyance" to "threat" in his eyes, given he presumably grades your work. However, it seems like he's already put himself in a bad position since you said he "tries ... to humiliate me in front of o...
120,326
I am a beginning graduate student in Mathematics. I have a professor who always brings up the fact that my GPA is not great in my undergraduate degree even though my performance is above the norm in the institution I am enrolled at the moment, so far I got straight A's in the graduate courses that I have completed. He ...
2018/11/19
[ "https://academia.stackexchange.com/questions/120326", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/99012/" ]
As I understand you, you are being *publicly* shamed (in front of fellow grad students) by this professor by dint of your undergrad record. If you are in the US, this is violating FERPA by revealing your academic record. Other countries have similar privacy laws. File a FERPA complaint and wipe that smug smile off his ...
I feel you have to be careful not to go nuclear, because if he is your professor you have to be careful not to move from "annoyance" to "threat" in his eyes, given he presumably grades your work. However, it seems like he's already put himself in a bad position since you said he "tries ... to humiliate me in front of o...
120,326
I am a beginning graduate student in Mathematics. I have a professor who always brings up the fact that my GPA is not great in my undergraduate degree even though my performance is above the norm in the institution I am enrolled at the moment, so far I got straight A's in the graduate courses that I have completed. He ...
2018/11/19
[ "https://academia.stackexchange.com/questions/120326", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/99012/" ]
Maybe you could be interested in Non Violent Communication. From wikipedia: <https://en.wikipedia.org/wiki/Nonviolent_Communication> > > It is based on the idea that all human beings have the capacity for compassion and only resort to violence or behavior that harms themselves and others when they do not recognize m...
It would appear that he is trying to shame you to make himself feel better. This is not unusual behaviour, though you would hope for better from a senior academic. One solution is to call him on it enough to stop it but not enough to make an enemy of him: "Yes, my GPA was indeed 3.0. That seems to have really caught ...
37,383,507
Friends, I would like a permanent solution to a script to change password without email access cpanel. I tried the cpanel api but I could not ... Could you help me? I need a page where the User enter the email address and new password, after which the password is changed ... Please help me ...
2016/05/23
[ "https://Stackoverflow.com/questions/37383507", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6249483/" ]
``` - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType]; if (![mediaType isEqualToString:(NSString *)kUTTypeMovie]) return; ...
Swift 4 or later Working on My Side for the captured image Use : ``` imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]){ let fileName = FileInfo.getMediaName(info: info) } ``` class : pleas put the method **info[:]** ``` class FileInfo...
37,383,507
Friends, I would like a permanent solution to a script to change password without email access cpanel. I tried the cpanel api but I could not ... Could you help me? I need a page where the User enter the email address and new password, after which the password is changed ... Please help me ...
2016/05/23
[ "https://Stackoverflow.com/questions/37383507", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6249483/" ]
I know this thread is super old but i thought if someone finds it, here is a working answer in swift: ``` func fileName(for infoDict: [String : Any]) -> String? { guard let referenceURL = infoDict[UIImagePickerControllerReferenceURL] as? URL else { return nil } let result = PHAsset.fetchAssets(withALAssetURLs:...
Swift 4 or later Working on My Side for the captured image Use : ``` imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]){ let fileName = FileInfo.getMediaName(info: info) } ``` class : pleas put the method **info[:]** ``` class FileInfo...
35,122,934
I have my config/mail 'driver' set to mandrill, host, port, etc. including in services.php mandrill secret set. Sending Mail works fine locally, but on the live server I get: > > Class 'GuzzleHttp\Client' not found > > > I have tried "guzzlehttp/guzzle": "~5.3|~6.0", and then back to "guzzlehttp/guzzle": "~4.0",...
2016/02/01
[ "https://Stackoverflow.com/questions/35122934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3820348/" ]
Please follow these simple steps: **First:** Place this on top of your class ``` use Guzzlehttp\Client; ``` **Second:** Inside your function, instead of using ``` $client = new Client(); ``` use ``` $client = new \GuzzleHttp\Client(); ``` **reference:** <http://docs.guzzlephp.org/en/latest/quickstart.html>
try composer require guzzlehttp/guzzle without specifying the version. Worked for me
35,122,934
I have my config/mail 'driver' set to mandrill, host, port, etc. including in services.php mandrill secret set. Sending Mail works fine locally, but on the live server I get: > > Class 'GuzzleHttp\Client' not found > > > I have tried "guzzlehttp/guzzle": "~5.3|~6.0", and then back to "guzzlehttp/guzzle": "~4.0",...
2016/02/01
[ "https://Stackoverflow.com/questions/35122934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3820348/" ]
Please follow these simple steps: **First:** Place this on top of your class ``` use Guzzlehttp\Client; ``` **Second:** Inside your function, instead of using ``` $client = new Client(); ``` use ``` $client = new \GuzzleHttp\Client(); ``` **reference:** <http://docs.guzzlephp.org/en/latest/quickstart.html>
**Error ?** the library GuzzleHttp (which is a Simple interface for building query strings, POST requests, streaming large uploads, streaming large downloads, using HTTP cookies, uploading JSON data ) is either missing or mis-configured. **Solution :** run the following command on your terminal(root folder): ``` comp...
70,638
I have an ASCII-art box and I need a program to open it. Examples -------- Input: ``` ------- | | |_____| ``` Output: ``` / / / / / / / | | |_____| ``` Specification ============= * The first line will only consist of `-`, at least 3 of them * The middle rows will start with `|` ha...
2016/01/31
[ "https://codegolf.stackexchange.com/questions/70638", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/40695/" ]
JavaScript ES6, 57 bytes ------------------------ ``` s=>s[r="replace"](/-+/,s=>s[r](/-/g,` $'/`))[r](/-/g,' ') ``` Outputs a leading newline. Works by taking the row of `-`s and converting them into a triangle, then replacing the `-`s with spaces. Edit: Saved 5 bytes thanks to @edc65.
Python, 125 bytes (110 without box) =================================== ``` i="\n---\n| |\n|_|" l,b,r=i.count("-"),i.split('\n'),range for x in r(1,l):print" "*(l-x)+"/" for x in r(2,len(b)):print b[x] ``` If anyone has any idea how to shorten it, please let me know!
70,638
I have an ASCII-art box and I need a program to open it. Examples -------- Input: ``` ------- | | |_____| ``` Output: ``` / / / / / / / | | |_____| ``` Specification ============= * The first line will only consist of `-`, at least 3 of them * The middle rows will start with `|` ha...
2016/01/31
[ "https://codegolf.stackexchange.com/questions/70638", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/40695/" ]
**Perl, 61 54 33 + 3 = 36 characters** -------------------------------------- ``` s^-^" "x(length$')."/\n"^ge&chomp ``` Run it as ``` perl -ple 's^-^" "x(length${chr 39})."/\n"^ge&chomp' closed_box_file ``` Each `-` in first line is replaced by a string that is a result of concatenation of some number of , `/` an...
[Vyxal](https://github.com/Lyxal/Vyxal), 16 bytes ================================================= ``` L:£(&‹¥\/꘍,)□Ḣ⁋, ``` [Try it Online!](http://lyxal.pythonanywhere.com?flags=&code=L%3A%C2%A3%28%26%E2%80%B9%C2%A5%5C%2F%EA%98%8D%2C%29%E2%96%A1%E1%B8%A2%E2%81%8B%2C&inputs=----%0A%7C%20%20%7C%0A%7C__%7C&header=&fo...
70,638
I have an ASCII-art box and I need a program to open it. Examples -------- Input: ``` ------- | | |_____| ``` Output: ``` / / / / / / / | | |_____| ``` Specification ============= * The first line will only consist of `-`, at least 3 of them * The middle rows will start with `|` ha...
2016/01/31
[ "https://codegolf.stackexchange.com/questions/70638", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/40695/" ]
[JavaScript (Node.js)](https://nodejs.org), 56 bytes ==================================================== ```javascript a=>a[b="replace"](/-+/,c=>c[b](d=/-/g,` $'/`))[b](d,' ') ``` [Try it online!](https://tio.run/##JctBCoMwEEDRfU4RpJCEJs4JxouINOMYpSUYiaWr3D1qfcsP/0M/2jm/t69b0xTqjJWwo37EJoctEodm0OCeYBk77sdBTwgOFuvFQ...
[K (ngn/k)](https://github.com/ngn/k), 18 bytes =============================================== ``` {(" /"@|=#*x),1_x} ``` [Try it online!](https://tio.run/##y9bNS8/7/z/NqlpDSUFfyaHGVlmrQlPHML6i9n@ahpIuBChxKSgo1SiAQA2EHQ8CNUqa/wE "K (ngn/k) – Try It Online")
70,638
I have an ASCII-art box and I need a program to open it. Examples -------- Input: ``` ------- | | |_____| ``` Output: ``` / / / / / / / | | |_____| ``` Specification ============= * The first line will only consist of `-`, at least 3 of them * The middle rows will start with `|` ha...
2016/01/31
[ "https://codegolf.stackexchange.com/questions/70638", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/40695/" ]
[Charcoal](https://github.com/somebody1234/Charcoal/wiki), 14 [bytes](https://github.com/somebody1234/Charcoal/wiki/Code-page) ============================================================================================================================== ``` ↙L§⪪θ¶⁰M→✂⪪θ¶¹ ``` [Try it online (verbose)](https://tio.ru...
Ruby, 59 characters =================== (57 characters code + 2 characters command line options.) ```ruby s="" $_=$_.chars.map{(s<<" ")[1..-1]+?/}.reverse*$/if$.<2 ``` Sample run: ``` bash-4.3$ ruby -ple 's="";$_=$_.chars.map{(s<<" ")[1..-1]+?/}.reverse*$/if$.<2' <<< $'-------\n| |\n|_____|' / / ...
70,638
I have an ASCII-art box and I need a program to open it. Examples -------- Input: ``` ------- | | |_____| ``` Output: ``` / / / / / / / | | |_____| ``` Specification ============= * The first line will only consist of `-`, at least 3 of them * The middle rows will start with `|` ha...
2016/01/31
[ "https://codegolf.stackexchange.com/questions/70638", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/40695/" ]
[JavaScript (Node.js)](https://nodejs.org), 56 bytes ==================================================== ```javascript a=>a[b="replace"](/-+/,c=>c[b](d=/-/g,` $'/`))[b](d,' ') ``` [Try it online!](https://tio.run/##JctBCoMwEEDRfU4RpJCEJs4JxouINOMYpSUYiaWr3D1qfcsP/0M/2jm/t69b0xTqjJWwo37EJoctEodm0OCeYBk77sdBTwgOFuvFQ...
Python, 125 bytes (110 without box) =================================== ``` i="\n---\n| |\n|_|" l,b,r=i.count("-"),i.split('\n'),range for x in r(1,l):print" "*(l-x)+"/" for x in r(2,len(b)):print b[x] ``` If anyone has any idea how to shorten it, please let me know!
70,638
I have an ASCII-art box and I need a program to open it. Examples -------- Input: ``` ------- | | |_____| ``` Output: ``` / / / / / / / | | |_____| ``` Specification ============= * The first line will only consist of `-`, at least 3 of them * The middle rows will start with `|` ha...
2016/01/31
[ "https://codegolf.stackexchange.com/questions/70638", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/40695/" ]
**Perl, 61 54 33 + 3 = 36 characters** -------------------------------------- ``` s^-^" "x(length$')."/\n"^ge&chomp ``` Run it as ``` perl -ple 's^-^" "x(length${chr 39})."/\n"^ge&chomp' closed_box_file ``` Each `-` in first line is replaced by a string that is a result of concatenation of some number of , `/` an...
[05AB1E (legacy)](https://github.com/Adriandmen/05AB1E/tree/fb4a2ce2bce6660e1a680a74dd61b72c945e6c3b), 9 bytes ============================================================================================================== ``` g'/1.Λ|»» ``` [Try it online! (legacy-only)](https://tio.run/##MzBNTDJM/f8/XV3fUO/c7JpDuw/t...
70,638
I have an ASCII-art box and I need a program to open it. Examples -------- Input: ``` ------- | | |_____| ``` Output: ``` / / / / / / / | | |_____| ``` Specification ============= * The first line will only consist of `-`, at least 3 of them * The middle rows will start with `|` ha...
2016/01/31
[ "https://codegolf.stackexchange.com/questions/70638", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/40695/" ]
Pyth, ~~16~~ 14 bytes ===================== ``` j+_m+*;d\/Uz.z ``` Explanation ``` m Uz - [V for d in range(len(input()))] +*;d\/ - " "*d + "/" _ - ^[::-1] j+ .z - "\n".join(^+rest_of_input()) ``` Thanks [@FryAmTheEggman](https://codegolf.stackexchange.com/users/31625/fryam...
JavaScript ES6, 106 bytes ========================= ``` q=>(q=q.split` `,n=q[0].length,eval('for(i=0,r="";i<n;i++)r+=" ".repeat(n-i-1)+"/\\n"'),r+q.slice(1).join` `) ``` Simple enough: getting the length of the first line, creating a spaced-triangle with trailing `/`, and adding that to the original, sliced and join...
70,638
I have an ASCII-art box and I need a program to open it. Examples -------- Input: ``` ------- | | |_____| ``` Output: ``` / / / / / / / | | |_____| ``` Specification ============= * The first line will only consist of `-`, at least 3 of them * The middle rows will start with `|` ha...
2016/01/31
[ "https://codegolf.stackexchange.com/questions/70638", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/40695/" ]
CJam, 14 bytes ============== ``` l,{N'/@S*}%W%q ``` [Try it online!](http://cjam.tryitonline.net/#code=bCx7TicvQFMqfSVXJXE&input=LS0tLS0tLQp8ICAgICB8CnxfX19fX3w) ### How it works ``` l Read the first line from STDIN. , Compute the line's length. Result: L { }% Map; for each ...
Python 2, 100 bytes =================== ``` def o(b): m=b.split('\n')[1:] print"\n".join(["/".rjust(i)for i in range(len(m[0]),0,-1)]+m) ``` Defines a function `o` that takes a string as its input. (Full program wasn't specified in the question).
70,638
I have an ASCII-art box and I need a program to open it. Examples -------- Input: ``` ------- | | |_____| ``` Output: ``` / / / / / / / | | |_____| ``` Specification ============= * The first line will only consist of `-`, at least 3 of them * The middle rows will start with `|` ha...
2016/01/31
[ "https://codegolf.stackexchange.com/questions/70638", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/40695/" ]
Java 8, ~~158~~ 118 bytes ========================= This is just a start, but hey, FGITWFTW. ``` n->{String o="";int z=n.lastIndexOf("-"),i=z;for(;i-->0;o+="/\n")for(int y=i;y-->0;o+=" ");return o+n.substring(z+2);} ``` Expects input as a string, returns the box.
PowerShell, 55 bytes -------------------- ``` $d,$b=$args-split"`n";($d.length-1)..0|%{" "*$_+"/"};$b ``` Takes input `$args` as a string, `-split`s on newlines ``n` ([reference link](https://technet.microsoft.com/en-us/library/hh847835.aspx)), stores the first line into `$d` (as a string) and the remaining into `$...
70,638
I have an ASCII-art box and I need a program to open it. Examples -------- Input: ``` ------- | | |_____| ``` Output: ``` / / / / / / / | | |_____| ``` Specification ============= * The first line will only consist of `-`, at least 3 of them * The middle rows will start with `|` ha...
2016/01/31
[ "https://codegolf.stackexchange.com/questions/70638", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/40695/" ]
Retina, ~~34~~ 20 bytes ======================= ``` -(?=(-*))¶? $1/¶ - ``` In the first step every `-` is substituted with the `-`'s following it, a `/` and a newline. The newline at the end of the original first line is deleted. In the second step we change the new `-`'s to spaces which results in the desired outpu...
PowerShell, 55 bytes -------------------- ``` $d,$b=$args-split"`n";($d.length-1)..0|%{" "*$_+"/"};$b ``` Takes input `$args` as a string, `-split`s on newlines ``n` ([reference link](https://technet.microsoft.com/en-us/library/hh847835.aspx)), stores the first line into `$d` (as a string) and the remaining into `$...
70,631,273
I'm very enthausiast about vuejs but the composition API made me get lost slightly on reactivity: In a .vue child component a prop is passed (by another parent component), movies: ``` export default { props:{ movies: Array }, setup(props){} ``` . Placing in the **setup** function body of this c...
2022/01/08
[ "https://Stackoverflow.com/questions/70631273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1345112/" ]
Use `toRef` to maintain reactivity. ``` const moviesLocalRef = toRef(props, 'movies') ``` See <https://v3.vuejs.org/api/refs-api.html#toref> The rule is that a `reactive` object child property must always be accessed from the root of the object. `a.b.c.d`. You cannot just `break off a piece and modify it`, because ...
Important part of understanding Vue reactivity is understanding JavaScript - specifically difference between [Value and Reference](https://codeburst.io/explaining-value-vs-reference-in-javascript-647a975e12a0). If you are not sure what I'm talking about, read the article carefully... In following examples I will be us...
72,091
In Michael Ende's novel *The Neverending Story*, the character Yikka, a talking mule, keeps saying that her intuition comes from being "half an ass (donkey)." "When one is only half an ass, and not a whole one, one knows things." I don't have a German translation of the book to get the original phrase, but... is there ...
2022/11/03
[ "https://german.stackexchange.com/questions/72091", "https://german.stackexchange.com", "https://german.stackexchange.com/users/54378/" ]
In German it is > > Wenn man bloß ein halber Esel ist wie ich und kein ganzer, dann fühlt man so was. > > > This is a somewhat mysterious statement and there is nothing in German language or culture that explains it. I think one can only make conjectures about its meaning. 1. Naive explanation. The word "Esel" ...
To be honest, this question is subject to interpretation... But I'll give it a try. Since Yakka is a mule, she is *technically* half an ass and not a full one. I think Ende plays with different attributes, the word "Esel" (ass) and the animal have in German language and culture: * The word "Esel" is often used to desc...
36,354,704
My iOS app has a pretty common setup: it makes HTTP queries to an API server that responds with JSON objects. These JSON objects are then parsed to appropriate Swift objects. Initially I divided properties into required properties and optional properties, mostly based on my API server's database requirements. For exam...
2016/04/01
[ "https://Stackoverflow.com/questions/36354704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5264622/" ]
There are three ways you can go with this: 1. Always send all the JSON data, and leave your properties non-optional. 2. Make all the properties optional. 3. Make all the properties non-optional, and write your own `init(from:)` method to assign default values to missing values, as described in [this answer](https://st...
I typically make all non-critical properties optional, and then have a failable initializer. This allows me to better handle any changes in the JSON format or broken API contracts. For example: ``` class User { let id: Int let email: String var profile: String? var name: String? var motive: String? var ad...
36,354,704
My iOS app has a pretty common setup: it makes HTTP queries to an API server that responds with JSON objects. These JSON objects are then parsed to appropriate Swift objects. Initially I divided properties into required properties and optional properties, mostly based on my API server's database requirements. For exam...
2016/04/01
[ "https://Stackoverflow.com/questions/36354704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5264622/" ]
There are three ways you can go with this: 1. Always send all the JSON data, and leave your properties non-optional. 2. Make all the properties optional. 3. Make all the properties non-optional, and write your own `init(from:)` method to assign default values to missing values, as described in [this answer](https://st...
I would prefer using failable Initializer its neat compared to other options. So keep the required properties as non-optionals and create object only if they are present in the response (you can use if-let or gaurd-let to check this in response), else fail the creation of the object. Using this approach we avoid mak...
36,354,704
My iOS app has a pretty common setup: it makes HTTP queries to an API server that responds with JSON objects. These JSON objects are then parsed to appropriate Swift objects. Initially I divided properties into required properties and optional properties, mostly based on my API server's database requirements. For exam...
2016/04/01
[ "https://Stackoverflow.com/questions/36354704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5264622/" ]
The first thing to do is ask: Does an element of the “view that lists users' names” need to be the same kind of object as the model object behind a “User profile page”? Perhaps not. Maybe you should create a model specifically for the user list: ``` struct UserList: Decodable { struct Item: Decodable { va...
I would prefer using failable Initializer its neat compared to other options. So keep the required properties as non-optionals and create object only if they are present in the response (you can use if-let or gaurd-let to check this in response), else fail the creation of the object. Using this approach we avoid mak...
36,354,704
My iOS app has a pretty common setup: it makes HTTP queries to an API server that responds with JSON objects. These JSON objects are then parsed to appropriate Swift objects. Initially I divided properties into required properties and optional properties, mostly based on my API server's database requirements. For exam...
2016/04/01
[ "https://Stackoverflow.com/questions/36354704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5264622/" ]
Yes, you should use optional if the property is not necessary in API and if you want some value in the mandatory property then assign blank value: ``` class User { let id: Int? let email: String? = "" let profile: String? let name: String? = "" let motive: String? let address: String? let profilePhotoUrl...
I would prefer optional properties because you can not promise JSON values to be there all the time and any change on response property name would crash your app. If you do not use optional values, you have to control parameters while parsing and add a default value if you want a crash free app. And you wouldn't know ...
36,354,704
My iOS app has a pretty common setup: it makes HTTP queries to an API server that responds with JSON objects. These JSON objects are then parsed to appropriate Swift objects. Initially I divided properties into required properties and optional properties, mostly based on my API server's database requirements. For exam...
2016/04/01
[ "https://Stackoverflow.com/questions/36354704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5264622/" ]
I typically make all non-critical properties optional, and then have a failable initializer. This allows me to better handle any changes in the JSON format or broken API contracts. For example: ``` class User { let id: Int let email: String var profile: String? var name: String? var motive: String? var ad...
I would prefer using failable Initializer its neat compared to other options. So keep the required properties as non-optionals and create object only if they are present in the response (you can use if-let or gaurd-let to check this in response), else fail the creation of the object. Using this approach we avoid mak...
36,354,704
My iOS app has a pretty common setup: it makes HTTP queries to an API server that responds with JSON objects. These JSON objects are then parsed to appropriate Swift objects. Initially I divided properties into required properties and optional properties, mostly based on my API server's database requirements. For exam...
2016/04/01
[ "https://Stackoverflow.com/questions/36354704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5264622/" ]
The premise: > > Partial representing is a common pattern in REST. Does that mean all > properties in Swift need to be optionals? For example, the client > might just need a list of user ids for a view. Does that mean that all > the other properties (name, email, etc) need to be marked as optional? > Is this good...
This really depends on the way you are handling your data. If you are handling your data through a "Codable" class, then you have to write a custom decoder to throw an exception when you don't get certain expected values. Like so: ``` class User: Codable { let id: Int let email: String let profile: String...
36,354,704
My iOS app has a pretty common setup: it makes HTTP queries to an API server that responds with JSON objects. These JSON objects are then parsed to appropriate Swift objects. Initially I divided properties into required properties and optional properties, mostly based on my API server's database requirements. For exam...
2016/04/01
[ "https://Stackoverflow.com/questions/36354704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5264622/" ]
There are three ways you can go with this: 1. Always send all the JSON data, and leave your properties non-optional. 2. Make all the properties optional. 3. Make all the properties non-optional, and write your own `init(from:)` method to assign default values to missing values, as described in [this answer](https://st...
I would prefer optional properties because you can not promise JSON values to be there all the time and any change on response property name would crash your app. If you do not use optional values, you have to control parameters while parsing and add a default value if you want a crash free app. And you wouldn't know ...
36,354,704
My iOS app has a pretty common setup: it makes HTTP queries to an API server that responds with JSON objects. These JSON objects are then parsed to appropriate Swift objects. Initially I divided properties into required properties and optional properties, mostly based on my API server's database requirements. For exam...
2016/04/01
[ "https://Stackoverflow.com/questions/36354704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5264622/" ]
In my opinion, I will choose 1 of 2 solutions: 1. Edit my `init func` from `JSON` to `object`, init with default object values for all props (`id = -1, email = ''`), then read JSON with optional checking. 2. Create a new `class/struct` for that specific case.
I would prefer optional properties because you can not promise JSON values to be there all the time and any change on response property name would crash your app. If you do not use optional values, you have to control parameters while parsing and add a default value if you want a crash free app. And you wouldn't know ...
36,354,704
My iOS app has a pretty common setup: it makes HTTP queries to an API server that responds with JSON objects. These JSON objects are then parsed to appropriate Swift objects. Initially I divided properties into required properties and optional properties, mostly based on my API server's database requirements. For exam...
2016/04/01
[ "https://Stackoverflow.com/questions/36354704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5264622/" ]
There are three ways you can go with this: 1. Always send all the JSON data, and leave your properties non-optional. 2. Make all the properties optional. 3. Make all the properties non-optional, and write your own `init(from:)` method to assign default values to missing values, as described in [this answer](https://st...
The first thing to do is ask: Does an element of the “view that lists users' names” need to be the same kind of object as the model object behind a “User profile page”? Perhaps not. Maybe you should create a model specifically for the user list: ``` struct UserList: Decodable { struct Item: Decodable { va...
36,354,704
My iOS app has a pretty common setup: it makes HTTP queries to an API server that responds with JSON objects. These JSON objects are then parsed to appropriate Swift objects. Initially I divided properties into required properties and optional properties, mostly based on my API server's database requirements. For exam...
2016/04/01
[ "https://Stackoverflow.com/questions/36354704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5264622/" ]
The first thing to do is ask: Does an element of the “view that lists users' names” need to be the same kind of object as the model object behind a “User profile page”? Perhaps not. Maybe you should create a model specifically for the user list: ``` struct UserList: Decodable { struct Item: Decodable { va...
I typically make all non-critical properties optional, and then have a failable initializer. This allows me to better handle any changes in the JSON format or broken API contracts. For example: ``` class User { let id: Int let email: String var profile: String? var name: String? var motive: String? var ad...
8,401,785
Debugging a package procedure and am getting a no data found when there is in fact data. Testing just the SELECT ``` SELECT trim(trailing '/' from GL_SECURITY) as DUMMY FROM b2k_user@b2k WHERE sms_username = 'FUCHSB'; ``` This happily returns my value : '23706\*706' As soon as i try to have this selected INTO i g...
2011/12/06
[ "https://Stackoverflow.com/questions/8401785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1083699/" ]
I'm pretty sure I found the cause of this behaviour: I'm guessing that the column is actually of type CHAR and not VARCHAR2. Consider the following: ``` SQL> CREATE TABLE t (a CHAR(10)); Table created. SQL> INSERT INTO t VALUES ('FUCHSB'); 1 row created. SQL> SELECT * FROM t WHERE a = 'FUCHSB'; A ---------- FUCH...
I noticed another issue for the same error. ERROR at line xx: ORA-01403: no data found ORA-06512: at line xx ``` select abc into var from table ``` If the query return no data, above error will throw.
3,888,867
Currently I am studying Standard Template Library (STL). In this program I am storing some long values in Associative Container and then sorting them according to unit's place (according to the number in unit's place). **Code :** ``` #include <iostream> #include <set> #include <functional> using namespace std; cl...
2010/10/08
[ "https://Stackoverflow.com/questions/3888867", "https://Stackoverflow.com", "https://Stackoverflow.com/users/92487/" ]
The class's purpose is to implement a function that sorts the elements in the set in a given way. This is known as a predicate. It is implemented as a functor, i.e. by allowing the function operator to be used on an object (this is what std::set does beneath the hood). Doing so is the common way for STL and similar co...
`UnitLess` is a [binary predicate](http://www.sgi.com/tech/stl/BinaryPredicate.html), that is required to be a callable with two parameters in STL. By overloading the function-call operator in `UnitLess` instances of that type can be used like a function that takes two `longs` and returns a `bool`. ``` UnitLess f; f(...
3,888,867
Currently I am studying Standard Template Library (STL). In this program I am storing some long values in Associative Container and then sorting them according to unit's place (according to the number in unit's place). **Code :** ``` #include <iostream> #include <set> #include <functional> using namespace std; cl...
2010/10/08
[ "https://Stackoverflow.com/questions/3888867", "https://Stackoverflow.com", "https://Stackoverflow.com/users/92487/" ]
`UnitLess` is a [binary predicate](http://www.sgi.com/tech/stl/BinaryPredicate.html), that is required to be a callable with two parameters in STL. By overloading the function-call operator in `UnitLess` instances of that type can be used like a function that takes two `longs` and returns a `bool`. ``` UnitLess f; f(...
He has implemented a custom comparison used for std::set that only compares the units i.e. the amount modulo 10. Because std::set is a template, it just tries to call something that looks like a function, whether or not it is one or not. By overloading operator() you make it act like a function. Doing this can actuall...
3,888,867
Currently I am studying Standard Template Library (STL). In this program I am storing some long values in Associative Container and then sorting them according to unit's place (according to the number in unit's place). **Code :** ``` #include <iostream> #include <set> #include <functional> using namespace std; cl...
2010/10/08
[ "https://Stackoverflow.com/questions/3888867", "https://Stackoverflow.com", "https://Stackoverflow.com/users/92487/" ]
The class's purpose is to implement a function that sorts the elements in the set in a given way. This is known as a predicate. It is implemented as a functor, i.e. by allowing the function operator to be used on an object (this is what std::set does beneath the hood). Doing so is the common way for STL and similar co...
He has implemented a custom comparison used for std::set that only compares the units i.e. the amount modulo 10. Because std::set is a template, it just tries to call something that looks like a function, whether or not it is one or not. By overloading operator() you make it act like a function. Doing this can actuall...
810
I've had a suspicion for a while that there are simply not enough active users (or users with enough rep) on Fitness.SE to pass a community close vote. It looks like I might be correct. [Shog9](https://fitness.meta.stackexchange.com/questions/809/2019-a-year-in-moderation)'s previous post shows the statistic: ``` ...
2020/01/08
[ "https://fitness.meta.stackexchange.com/questions/810", "https://fitness.meta.stackexchange.com", "https://fitness.meta.stackexchange.com/users/31284/" ]
Change to 3 =========== Yes, I think the threshold should be lowered to 3 votes to close.
No Change ========= Keep the close threshold at 5 votes.
810
I've had a suspicion for a while that there are simply not enough active users (or users with enough rep) on Fitness.SE to pass a community close vote. It looks like I might be correct. [Shog9](https://fitness.meta.stackexchange.com/questions/809/2019-a-year-in-moderation)'s previous post shows the statistic: ``` ...
2020/01/08
[ "https://fitness.meta.stackexchange.com/questions/810", "https://fitness.meta.stackexchange.com", "https://fitness.meta.stackexchange.com/users/31284/" ]
This is now live! Thanks so much for your patience here while we got things worked out on our end. I've reviewed your history with closure on two points and find that it does look like this would be a good change to make here. The first thing I look at is the percentage of questions that get a first close flag or vot...
No Change ========= Keep the close threshold at 5 votes.
810
I've had a suspicion for a while that there are simply not enough active users (or users with enough rep) on Fitness.SE to pass a community close vote. It looks like I might be correct. [Shog9](https://fitness.meta.stackexchange.com/questions/809/2019-a-year-in-moderation)'s previous post shows the statistic: ``` ...
2020/01/08
[ "https://fitness.meta.stackexchange.com/questions/810", "https://fitness.meta.stackexchange.com", "https://fitness.meta.stackexchange.com/users/31284/" ]
This is now live! Thanks so much for your patience here while we got things worked out on our end. I've reviewed your history with closure on two points and find that it does look like this would be a good change to make here. The first thing I look at is the percentage of questions that get a first close flag or vot...
Change to 3 =========== Yes, I think the threshold should be lowered to 3 votes to close.
230
It's time to propose the topics for our Challenge Week! Some notes: 1. Propose one topic per answer (make it CW by checking the checkbox under your answer); Write them like `## Topic <br><br> "description"`. 2. No maximum of proposals, but don't just propose tons of stuff. Propose things that could stimulate q...
2012/01/24
[ "https://linguistics.meta.stackexchange.com/questions/230", "https://linguistics.meta.stackexchange.com", "https://linguistics.meta.stackexchange.com/users/111/" ]
Syntax ------ The rules and the study of rules that study the construction of sentences in a given language.
Phonology --------- The branch of linguistics which investigates the ways in which sounds are used systematically in different languages to form words and utterances.
230
It's time to propose the topics for our Challenge Week! Some notes: 1. Propose one topic per answer (make it CW by checking the checkbox under your answer); Write them like `## Topic <br><br> "description"`. 2. No maximum of proposals, but don't just propose tons of stuff. Propose things that could stimulate q...
2012/01/24
[ "https://linguistics.meta.stackexchange.com/questions/230", "https://linguistics.meta.stackexchange.com", "https://linguistics.meta.stackexchange.com/users/111/" ]
Syntax ------ The rules and the study of rules that study the construction of sentences in a given language.
Pragmatics ---------- A branch of linguistics which studies the ways in which context contributes to meaning.
230
It's time to propose the topics for our Challenge Week! Some notes: 1. Propose one topic per answer (make it CW by checking the checkbox under your answer); Write them like `## Topic <br><br> "description"`. 2. No maximum of proposals, but don't just propose tons of stuff. Propose things that could stimulate q...
2012/01/24
[ "https://linguistics.meta.stackexchange.com/questions/230", "https://linguistics.meta.stackexchange.com", "https://linguistics.meta.stackexchange.com/users/111/" ]
Second language(s) acquisition ------------------------------ Questions regarding the mechanisms for the acquisition of second languages.
Phonology --------- The branch of linguistics which investigates the ways in which sounds are used systematically in different languages to form words and utterances.
230
It's time to propose the topics for our Challenge Week! Some notes: 1. Propose one topic per answer (make it CW by checking the checkbox under your answer); Write them like `## Topic <br><br> "description"`. 2. No maximum of proposals, but don't just propose tons of stuff. Propose things that could stimulate q...
2012/01/24
[ "https://linguistics.meta.stackexchange.com/questions/230", "https://linguistics.meta.stackexchange.com", "https://linguistics.meta.stackexchange.com/users/111/" ]
Second language(s) acquisition ------------------------------ Questions regarding the mechanisms for the acquisition of second languages.
Pragmatics ---------- A branch of linguistics which studies the ways in which context contributes to meaning.
230
It's time to propose the topics for our Challenge Week! Some notes: 1. Propose one topic per answer (make it CW by checking the checkbox under your answer); Write them like `## Topic <br><br> "description"`. 2. No maximum of proposals, but don't just propose tons of stuff. Propose things that could stimulate q...
2012/01/24
[ "https://linguistics.meta.stackexchange.com/questions/230", "https://linguistics.meta.stackexchange.com", "https://linguistics.meta.stackexchange.com/users/111/" ]
Historical linguistics ---------------------- The study of how languages evolve over the centuries usually interests not only professional linguists, but also classicists, literary critics, as well as other users just interested in languages in general. Historical linguistics will probably make for a great challenge!
Phonology --------- The branch of linguistics which investigates the ways in which sounds are used systematically in different languages to form words and utterances.
230
It's time to propose the topics for our Challenge Week! Some notes: 1. Propose one topic per answer (make it CW by checking the checkbox under your answer); Write them like `## Topic <br><br> "description"`. 2. No maximum of proposals, but don't just propose tons of stuff. Propose things that could stimulate q...
2012/01/24
[ "https://linguistics.meta.stackexchange.com/questions/230", "https://linguistics.meta.stackexchange.com", "https://linguistics.meta.stackexchange.com/users/111/" ]
Historical linguistics ---------------------- The study of how languages evolve over the centuries usually interests not only professional linguists, but also classicists, literary critics, as well as other users just interested in languages in general. Historical linguistics will probably make for a great challenge!
Pragmatics ---------- A branch of linguistics which studies the ways in which context contributes to meaning.
230
It's time to propose the topics for our Challenge Week! Some notes: 1. Propose one topic per answer (make it CW by checking the checkbox under your answer); Write them like `## Topic <br><br> "description"`. 2. No maximum of proposals, but don't just propose tons of stuff. Propose things that could stimulate q...
2012/01/24
[ "https://linguistics.meta.stackexchange.com/questions/230", "https://linguistics.meta.stackexchange.com", "https://linguistics.meta.stackexchange.com/users/111/" ]
Computational Linguistics ------------------------- An interdisciplinary field dealing with the statistical or rule-based modeling of natural language from a computational perspective.
Phonology --------- The branch of linguistics which investigates the ways in which sounds are used systematically in different languages to form words and utterances.
230
It's time to propose the topics for our Challenge Week! Some notes: 1. Propose one topic per answer (make it CW by checking the checkbox under your answer); Write them like `## Topic <br><br> "description"`. 2. No maximum of proposals, but don't just propose tons of stuff. Propose things that could stimulate q...
2012/01/24
[ "https://linguistics.meta.stackexchange.com/questions/230", "https://linguistics.meta.stackexchange.com", "https://linguistics.meta.stackexchange.com/users/111/" ]
Computational Linguistics ------------------------- An interdisciplinary field dealing with the statistical or rule-based modeling of natural language from a computational perspective.
Pragmatics ---------- A branch of linguistics which studies the ways in which context contributes to meaning.
230
It's time to propose the topics for our Challenge Week! Some notes: 1. Propose one topic per answer (make it CW by checking the checkbox under your answer); Write them like `## Topic <br><br> "description"`. 2. No maximum of proposals, but don't just propose tons of stuff. Propose things that could stimulate q...
2012/01/24
[ "https://linguistics.meta.stackexchange.com/questions/230", "https://linguistics.meta.stackexchange.com", "https://linguistics.meta.stackexchange.com/users/111/" ]
Methodology ----------- Topics concerning how linguistic arguments are made, and what is permitted as evidence in supporting a linguistic argument. Questions ideally highlight debates in methodology and different methodological frameworks in different subfields.
Phonology --------- The branch of linguistics which investigates the ways in which sounds are used systematically in different languages to form words and utterances.
230
It's time to propose the topics for our Challenge Week! Some notes: 1. Propose one topic per answer (make it CW by checking the checkbox under your answer); Write them like `## Topic <br><br> "description"`. 2. No maximum of proposals, but don't just propose tons of stuff. Propose things that could stimulate q...
2012/01/24
[ "https://linguistics.meta.stackexchange.com/questions/230", "https://linguistics.meta.stackexchange.com", "https://linguistics.meta.stackexchange.com/users/111/" ]
Methodology ----------- Topics concerning how linguistic arguments are made, and what is permitted as evidence in supporting a linguistic argument. Questions ideally highlight debates in methodology and different methodological frameworks in different subfields.
Pragmatics ---------- A branch of linguistics which studies the ways in which context contributes to meaning.
21,604,866
This is the code that I'm using. I can hear that the notification is working, but no text. ``` @Override public void onReceive(Context context, Intent arg1) { showNotification(context); } private void showNotification(Context context) { PendingIntent contentIntent = PendingIntent.getActivity(context, 0, ...
2014/02/06
[ "https://Stackoverflow.com/questions/21604866", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1450116/" ]
if you are using support-v4 library the use this code ``` private void showNotification(Context context) { PendingIntent pIntent = PendingIntent.getActivity(context, 0, new Intent(context, DashBoard.class), 0); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this) ...
``` builder.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)); ```
21,604,866
This is the code that I'm using. I can hear that the notification is working, but no text. ``` @Override public void onReceive(Context context, Intent arg1) { showNotification(context); } private void showNotification(Context context) { PendingIntent contentIntent = PendingIntent.getActivity(context, 0, ...
2014/02/06
[ "https://Stackoverflow.com/questions/21604866", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1450116/" ]
You need to add an icon `new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.ic_launcher);`
``` builder.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)); ```
27,332,170
Everything seemed to be running okay (for several days), but I ran into an issue only once and having a really hard time to reproduce the problem. "Comparison method violates its general contract!" was thrown and completely caught me off guard. I have the following: ``` public class CustomComparator implements Compar...
2014/12/06
[ "https://Stackoverflow.com/questions/27332170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4222618/" ]
Java 7 has changed the behavior of their sorting algorithms a bit. They now throw an Exception if a violation of the general contract for the `compareTo` method is detected. You can read about that contract's properties for example [here](https://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html). In general...
Possibly that one of your parameter might be due to positive or negative infinity i.e. dividing by zero. Also don't rely upon == on double values. You should just use: ``` return Double.compare(this.getRank(), c.getRank()); ```
4,161,943
I am a beginner in js, and am puzzled by the following code: ``` Foo = function(arg) { this.arg = arg; }; Foo.prototype = { init: function () { var f = function () { alert("current arg: " + this.arg); // am expecting "bar", got undefined } f(); } }; var yo = Foo("bar")...
2010/11/12
[ "https://Stackoverflow.com/questions/4161943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11465/" ]
It depends on how the function was invoked. If invoked with keyword `new` then `this` refers to the object being constructed (which will be implicitly returned at the end of the function). If invoked as a normal function, `this` refers to the global `window` object. Example: ``` // Constructor for Foo, // (invoke w...
Vanilla functions will be run with `this` referring to `window`. Your second piece of code is a perfect example of how to work around this problem using closures. (You can also use `call` and `apply` to call a function with a particular context.)
615,875
Good afternoon, I would like to know how to colour the nodes A and Y in another colour (grey for example) without changing the colour of the other two nodes. Best regards. ``` \begin{figure}[h] \centering \begin{tikzpicture}[ node distance=1cm and 1cm, mynode/.style={draw,circle,text width=0.5cm,align=center} ] ...
2021/09/18
[ "https://tex.stackexchange.com/questions/615875", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/252116/" ]
Replace `\pgfcalendarweekdayshortname` by `\myweekday` and define the latter in the preamble as ``` \newcommand\myweekday[1]{\ifcase#1M\or T\or W\or T\or F\or S\or S\fi} ``` [![enter image description here](https://i.stack.imgur.com/Uh52X.png)](https://i.stack.imgur.com/Uh52X.png) ``` \documentclass[12pt]{article} ...
Using `\StrLeft` from the `xstring` package: ``` \documentclass[12pt]{article} \usepackage{tikz} \usetikzlibrary{calendar} \usepackage{xstring} \begin{document} \begin{tikzpicture} \calendar[dates=2021-01-01 to 2021-01-last, day list downward, day code={ \node[anchor = east]{\tikzday...
40,886,904
I've tried to build <https://github.com/DEVSENSE/Phalanger>, but after the build process it shows build errors. I tried VS 2015, maybe there it just a question of a wrong version? [![screenshot](https://i.stack.imgur.com/Q6qXv.png)](https://i.stack.imgur.com/Q6qXv.png)
2016/11/30
[ "https://Stackoverflow.com/questions/40886904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3941733/" ]
No. They are completely different. `test in [1,2,3]` checks if there is a property **named** `2` in the object. There is, it has the value `3`. `[1,2,3].indexOf(test)` gets the first property with the **value** `2` (which is in the property named `1`) > > suggest that you can't do in on an array, only on an object ...
The first checks for an index, or if property of an object exists, ``` console.log(test in [1,2,3]); ``` and not for a value in the array, as the second is doing. ``` console.log([1,2,3].indexOf(test) != -1); ```
40,886,904
I've tried to build <https://github.com/DEVSENSE/Phalanger>, but after the build process it shows build errors. I tried VS 2015, maybe there it just a question of a wrong version? [![screenshot](https://i.stack.imgur.com/Q6qXv.png)](https://i.stack.imgur.com/Q6qXv.png)
2016/11/30
[ "https://Stackoverflow.com/questions/40886904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3941733/" ]
The first checks for an index, or if property of an object exists, ``` console.log(test in [1,2,3]); ``` and not for a value in the array, as the second is doing. ``` console.log([1,2,3].indexOf(test) != -1); ```
Try this ``` var test = 2; var arrval= [1, 5, 2, 4]; var a = arrval.indexOf(test); if(a>-1) console.log("Having"); else console.log("Not Having"); ```
40,886,904
I've tried to build <https://github.com/DEVSENSE/Phalanger>, but after the build process it shows build errors. I tried VS 2015, maybe there it just a question of a wrong version? [![screenshot](https://i.stack.imgur.com/Q6qXv.png)](https://i.stack.imgur.com/Q6qXv.png)
2016/11/30
[ "https://Stackoverflow.com/questions/40886904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3941733/" ]
No. They are completely different. `test in [1,2,3]` checks if there is a property **named** `2` in the object. There is, it has the value `3`. `[1,2,3].indexOf(test)` gets the first property with the **value** `2` (which is in the property named `1`) > > suggest that you can't do in on an array, only on an object ...
As per [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/in), > > The in operator returns true if the specified property is in the specified object. > > > `in` will check for keys. Its similar to `Object.keys(array).indexOf(test)` ```js var a1 = [1,2,3]; var a2 = ['a', 'b', 'c'] ...
40,886,904
I've tried to build <https://github.com/DEVSENSE/Phalanger>, but after the build process it shows build errors. I tried VS 2015, maybe there it just a question of a wrong version? [![screenshot](https://i.stack.imgur.com/Q6qXv.png)](https://i.stack.imgur.com/Q6qXv.png)
2016/11/30
[ "https://Stackoverflow.com/questions/40886904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3941733/" ]
No. They are completely different. `test in [1,2,3]` checks if there is a property **named** `2` in the object. There is, it has the value `3`. `[1,2,3].indexOf(test)` gets the first property with the **value** `2` (which is in the property named `1`) > > suggest that you can't do in on an array, only on an object ...
Try this ``` var test = 2; var arrval= [1, 5, 2, 4]; var a = arrval.indexOf(test); if(a>-1) console.log("Having"); else console.log("Not Having"); ```
40,886,904
I've tried to build <https://github.com/DEVSENSE/Phalanger>, but after the build process it shows build errors. I tried VS 2015, maybe there it just a question of a wrong version? [![screenshot](https://i.stack.imgur.com/Q6qXv.png)](https://i.stack.imgur.com/Q6qXv.png)
2016/11/30
[ "https://Stackoverflow.com/questions/40886904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3941733/" ]
No. They are completely different. `test in [1,2,3]` checks if there is a property **named** `2` in the object. There is, it has the value `3`. `[1,2,3].indexOf(test)` gets the first property with the **value** `2` (which is in the property named `1`) > > suggest that you can't do in on an array, only on an object ...
> > The [**in operator**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/in) returns true if the specified property is in the > specified object. > > > Using `in` operator for an array checks of the `indices` and the `length` property - because those are the properties for an array: ...
40,886,904
I've tried to build <https://github.com/DEVSENSE/Phalanger>, but after the build process it shows build errors. I tried VS 2015, maybe there it just a question of a wrong version? [![screenshot](https://i.stack.imgur.com/Q6qXv.png)](https://i.stack.imgur.com/Q6qXv.png)
2016/11/30
[ "https://Stackoverflow.com/questions/40886904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3941733/" ]
As per [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/in), > > The in operator returns true if the specified property is in the specified object. > > > `in` will check for keys. Its similar to `Object.keys(array).indexOf(test)` ```js var a1 = [1,2,3]; var a2 = ['a', 'b', 'c'] ...
Try this ``` var test = 2; var arrval= [1, 5, 2, 4]; var a = arrval.indexOf(test); if(a>-1) console.log("Having"); else console.log("Not Having"); ```
40,886,904
I've tried to build <https://github.com/DEVSENSE/Phalanger>, but after the build process it shows build errors. I tried VS 2015, maybe there it just a question of a wrong version? [![screenshot](https://i.stack.imgur.com/Q6qXv.png)](https://i.stack.imgur.com/Q6qXv.png)
2016/11/30
[ "https://Stackoverflow.com/questions/40886904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3941733/" ]
> > The [**in operator**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/in) returns true if the specified property is in the > specified object. > > > Using `in` operator for an array checks of the `indices` and the `length` property - because those are the properties for an array: ...
Try this ``` var test = 2; var arrval= [1, 5, 2, 4]; var a = arrval.indexOf(test); if(a>-1) console.log("Having"); else console.log("Not Having"); ```
35,254,997
How to implement a button above the keyboard? (For example: "Notes" app, or [like this](http://i.stack.imgur.com/hrLlq.gif)
2016/02/07
[ "https://Stackoverflow.com/questions/35254997", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4478196/" ]
MKaro's solution works! I'll attach the Swift 3 version for faster copy-paste. **Swift 3:** ``` let keyboardToolbar = UIToolbar() keyboardToolbar.sizeToFit() keyboardToolbar.isTranslucent = false keyboardToolbar.barTintColor = UIColor.white let addButton = UIBarButtonItem( barButtonSystemItem: .done, target...
Its simple, all you need is to use UIToolBar and UIBarButtonItem. Here is a simple example, that make "Special Keyboard" for specific TextField: This code create the toolbar: ``` UIToolbar *keyboardToolbar = [[UIToolbar alloc] init]; [keyboardToolbar sizeToFit]; keyboardToolbar.translucent=NO; //if you want it. keyb...
72,144,828
``` class Dashboard extends Component { constructor(props) { super(props) this.state = { assetList: [], assetList1: []; } } componentDidMount = async () => { const web3 = window.web3 const LandData=Land.networks[networkId] if (LandData) { const landList = new web3.eth.Con...
2022/05/06
[ "https://Stackoverflow.com/questions/72144828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19055006/" ]
In React class components, there existed a single `state` object and you could update it with any properties you needed. State in React function components functions a little differently. React function components use the `useState` hook to explicitly declare a state variable and updater function. You can use a singl...
``` const Dashboard = () => { const [assetList, setAssetList] = useState([]) const [assetList1, setAssetList1] = useState([]) useEffect(() => { const web3 = window.web3 const LandData = Land.networks[networkId] if (LandData) { const landList = new web3.eth.Contract(Land....
66,386,300
I am doing below steps , and in the process I am losing the transformed data though I am using cache() on the data . **STEP -1 : READ DATA FROM CASSANDRA:** ``` data = spark_session.read \ .format('org.apache.spark.sql.cassandra') \ .options(table=table, keyspace=keyspace) \ .load(...
2021/02/26
[ "https://Stackoverflow.com/questions/66386300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8236029/" ]
**1. General approach: You can create a matrix in base R:** ``` ## vectors with same length obs_date <- c(1,2,3,1,2) yields <- c(0.05,0.06,0.01,0.02,0.04) maturities <- c(3,3,4,5,3) # creating matrix m <- matrix(c(obs_date, yields, maturities), ncol = 3) # print matrix print(m) # print class of m class(m) `...
Try this below code segment. You will need tidyverse package to be installed on your machine. ``` obs_date <- c(1,2,3,1,2) yields <- c(0.05,0.06,0.01,0.02,0.04) maturities <- c(3,3,4,5,3) library(tidyverse) mat <- tibble(obs_date, yields, maturities) mat ``` [![enter image description here](https://i.stack.imgur.com...