qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
5,789,198
hi all i am going to ask basic question i searched many links for my question but none of the things not given exact result.here is my question: I want to pass rect value and returning the same type using some transformation for that i wrote one method but it is giving me the errors i know it may be syntactically wron...
2011/04/26
[ "https://Stackoverflow.com/questions/5789198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/481455/" ]
Try with below ``` -(void)viewDidLoad{ CGRect testRect= [self getNewRect:self.view.frame]; } -(CGRect) getNewRect:(CGRect) normalRect{ //some transformation return tranfermedrect; } ``` Add below in .h file ``` -(CGRect) getNewRect:(CGRect) normalRect ; ```
``` -(void)viewDidLoad{ CGRect testRect= [self getNewRect:self.view.frame]; NSLog(@"New rect %@",NSStringFromCGRect(testRect)); } -(CGRect) getNewRect:(CGRect) normalRect{ //some transformation return tranformedRect; } ``` see if this works
5,789,198
hi all i am going to ask basic question i searched many links for my question but none of the things not given exact result.here is my question: I want to pass rect value and returning the same type using some transformation for that i wrote one method but it is giving me the errors i know it may be syntactically wron...
2011/04/26
[ "https://Stackoverflow.com/questions/5789198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/481455/" ]
Used following line you will solve your problem. ``` [self yourFunction:[NSValue valueWithCGRect:rectFrame]]; ``` Above line is the simple method call and in objective-C you can not send CGRect as a parameter. so you have to CGRect convert into NSValue. At called function you have get GGRect from NSValue ``` yourV...
``` -(void)viewDidLoad{ CGRect testRect= [self getNewRect:self.view.frame]; NSLog(@"New rect %@",NSStringFromCGRect(testRect)); } -(CGRect) getNewRect:(CGRect) normalRect{ //some transformation return tranformedRect; } ``` see if this works
36,051,593
I have a table `A_tbl` in my database. I have created a trigger on `A_tbl` to capture inserted records. Trigger is inserting records in my queue table `B_tbl`. This table has an `Identity` column with property "Not for replication" as 1. * `A_tbl` (Id, name, value) with `Id` as the primary key * `B_tbl` (uniqueId, Id)...
2016/03/17
[ "https://Stackoverflow.com/questions/36051593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3053643/" ]
You have to do something like this ``` SET IDENTITY_INSERT A_tbl ON Insert into B_tbl (uniqueid, Id) select 1, i.id from inserted SET IDENTITY_INSERT A_tbl OFF ```
The trigger code should contain the Identity insert ON option as below ``` SET IDENTITY_INSERT B_tbl ON Insert into B_tbl (uniqueid,Id) select identityvalue,i.Id from inserted SET IDENTITY_INSERT B_tbl OFF ```
36,051,593
I have a table `A_tbl` in my database. I have created a trigger on `A_tbl` to capture inserted records. Trigger is inserting records in my queue table `B_tbl`. This table has an `Identity` column with property "Not for replication" as 1. * `A_tbl` (Id, name, value) with `Id` as the primary key * `B_tbl` (uniqueId, Id)...
2016/03/17
[ "https://Stackoverflow.com/questions/36051593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3053643/" ]
You have to do something like this ``` SET IDENTITY_INSERT A_tbl ON Insert into B_tbl (uniqueid, Id) select 1, i.id from inserted SET IDENTITY_INSERT A_tbl OFF ```
Just to add one possible gotcha for people who like me did everything by the book and still got the message. Check for triggers on insert. They may be attempting to create more rows while executing code that does not have the explicit identity column values. If it's the case, disable the trigger (or drop and recreate...
36,051,593
I have a table `A_tbl` in my database. I have created a trigger on `A_tbl` to capture inserted records. Trigger is inserting records in my queue table `B_tbl`. This table has an `Identity` column with property "Not for replication" as 1. * `A_tbl` (Id, name, value) with `Id` as the primary key * `B_tbl` (uniqueId, Id)...
2016/03/17
[ "https://Stackoverflow.com/questions/36051593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3053643/" ]
There are basically 2 different ways to INSERT records without having an error: 1) When the IDENTITY\_INSERT is set OFF. The PRIMARY KEY **"ID" MUST NOT BE PRESENT** 2) When the IDENTITY\_INSERT is set ON. The PRIMARY KEY **"ID" MUST BE PRESENT** As per the following example from the same Table created with an IDENT...
The trigger code should contain the Identity insert ON option as below ``` SET IDENTITY_INSERT B_tbl ON Insert into B_tbl (uniqueid,Id) select identityvalue,i.Id from inserted SET IDENTITY_INSERT B_tbl OFF ```
36,051,593
I have a table `A_tbl` in my database. I have created a trigger on `A_tbl` to capture inserted records. Trigger is inserting records in my queue table `B_tbl`. This table has an `Identity` column with property "Not for replication" as 1. * `A_tbl` (Id, name, value) with `Id` as the primary key * `B_tbl` (uniqueId, Id)...
2016/03/17
[ "https://Stackoverflow.com/questions/36051593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3053643/" ]
There are basically 2 different ways to INSERT records without having an error: 1) When the IDENTITY\_INSERT is set OFF. The PRIMARY KEY **"ID" MUST NOT BE PRESENT** 2) When the IDENTITY\_INSERT is set ON. The PRIMARY KEY **"ID" MUST BE PRESENT** As per the following example from the same Table created with an IDENT...
Just to add one possible gotcha for people who like me did everything by the book and still got the message. Check for triggers on insert. They may be attempting to create more rows while executing code that does not have the explicit identity column values. If it's the case, disable the trigger (or drop and recreate...
108,561
For example this ham: [![enter image description here](https://i.stack.imgur.com/DuKkj.jpg)](https://i.stack.imgur.com/DuKkj.jpg) I see them in ham, sometimes chicken, salami, and similar. They seem to be small sphere shaped half to one millimeter in size.
2020/05/22
[ "https://cooking.stackexchange.com/questions/108561", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/62504/" ]
My experience comes from making salami sandwiches... In order to allow myself the luxury of eating something so grease-filled without guilt, I'll zap it in the microwave for 20-30 seconds to render out the fat. Since packing the salami with ground up fat is part of the process. Cooking the meat melts the fat globules a...
These holes/pores are mostly caused by spoilage bacteria, which produce gas as part of their metabolism; You can avoid it by using starter culture; Chr. Hansen has a culture called SafePro-ImPorous which will help solve this issue.
51,783,815
it's possible to target #kodak in accordion with div id? I just want to make link www.xy.cz/#15248756/#kodak , something like this, when user click on link, it will redirect to the accordion and to text with id "kodak". Thank you. See code below ``` <div class="vc_tta-panel vc_active" id="15248756"> <div class="bo...
2018/08/10
[ "https://Stackoverflow.com/questions/51783815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5982291/" ]
You shouldn't use `contains/1` as it will not work the way you might expect it, particularly if you're dealing with strings. It will recursively check if all parts are contained. So not only will it check if the string is contained in the array, but if the string is also a substring. You'll want to write out your cond...
One way would be to use `index/1`, e.g. ``` .servers[] | select( .tagNames | index("auto-test")) ``` This produces: ``` {"id":1,"tagNames":["auto-test","xxx"]} ``` If you want that wrapped in an array, you could (for example) wrap the filter above in square brackets.
51,783,815
it's possible to target #kodak in accordion with div id? I just want to make link www.xy.cz/#15248756/#kodak , something like this, when user click on link, it will redirect to the accordion and to text with id "kodak". Thank you. See code below ``` <div class="vc_tta-panel vc_active" id="15248756"> <div class="bo...
2018/08/10
[ "https://Stackoverflow.com/questions/51783815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5982291/" ]
You shouldn't use `contains/1` as it will not work the way you might expect it, particularly if you're dealing with strings. It will recursively check if all parts are contained. So not only will it check if the string is contained in the array, but if the string is also a substring. You'll want to write out your cond...
Another solution is to use the idiom: first(select(\_)): ``` jq '.servers[] | first(select(.tagNames[]=="auto-test"))' file ``` If the `first` is omitted, then the same item in the `servers` array might be emitted more than once.
51,783,815
it's possible to target #kodak in accordion with div id? I just want to make link www.xy.cz/#15248756/#kodak , something like this, when user click on link, it will redirect to the accordion and to text with id "kodak". Thank you. See code below ``` <div class="vc_tta-panel vc_active" id="15248756"> <div class="bo...
2018/08/10
[ "https://Stackoverflow.com/questions/51783815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5982291/" ]
One way would be to use `index/1`, e.g. ``` .servers[] | select( .tagNames | index("auto-test")) ``` This produces: ``` {"id":1,"tagNames":["auto-test","xxx"]} ``` If you want that wrapped in an array, you could (for example) wrap the filter above in square brackets.
Another solution is to use the idiom: first(select(\_)): ``` jq '.servers[] | first(select(.tagNames[]=="auto-test"))' file ``` If the `first` is omitted, then the same item in the `servers` array might be emitted more than once.
21,933,737
This is the pseudocode for the radix sort: ``` Pseudocode for Radix Sort: Radix-Sort(A, d) // Each key in A[1..n] is a d-digit integer. (Digits are // numbered 1 to d from right to left.) 1. for i = 1 to d do Use a stable sorting algorithm to sort A on digit i. ``` This is the Scala code for the radix sort: ``` obj...
2014/02/21
[ "https://Stackoverflow.com/questions/21933737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15441/" ]
Have you tried to search for `NSLocalizedString()`?
Add your language localize file into Localizable.strings. and also add all file into localization filed on project Info option...
55,754
I searched for the answer for this specific question of mine, but couldn't find it. So I'm sorry If I duplicated some thread. I was reading some stuff here about 自動詞 and 他動詞 and start wondering if all verbs in japanese come in transitive/intransitive pairs like 付く/付ける. Is this true?
2018/01/08
[ "https://japanese.stackexchange.com/questions/55754", "https://japanese.stackexchange.com", "https://japanese.stackexchange.com/users/26581/" ]
Not all verbs come in transitive/intransitive pairs. Quite a few intransitive verbs have no transitive counterpart. To name a few... > > ある、[行]{い}く、[来]{く}る、[歩]{ある}く、[走]{はし}る、[座]{すわ}る、かみつく、そびえる、[響]{ひび}く etc... > > > 行かせる, 来させる, 歩かせる etc. are causative forms (使役形), consisting of conjugated form 「行か」 + auxiliary ...
> > I was reading some stuff here about 自動詞 and 他動詞 and start wondering if all verbs in japanese come in transitive/intransitive pairs like 付く/付ける. > > Is this true? > > > No. Many Japanese verbs have intransitive and corresponding transitive verbs as written in the article [here](http://d.hatena.ne.jp/Pulin/...
55,754
I searched for the answer for this specific question of mine, but couldn't find it. So I'm sorry If I duplicated some thread. I was reading some stuff here about 自動詞 and 他動詞 and start wondering if all verbs in japanese come in transitive/intransitive pairs like 付く/付ける. Is this true?
2018/01/08
[ "https://japanese.stackexchange.com/questions/55754", "https://japanese.stackexchange.com", "https://japanese.stackexchange.com/users/26581/" ]
> > I was reading some stuff here about 自動詞 and 他動詞 and start wondering if all verbs in japanese come in transitive/intransitive pairs like 付く/付ける. > > Is this true? > > > No. Many Japanese verbs have intransitive and corresponding transitive verbs as written in the article [here](http://d.hatena.ne.jp/Pulin/...
They don't always come in pairs or obey the patterns, you can learn/study about transitive intransitive verbs with [Japanese Verbs Transitive Intransitive - TaJi - 他自](https://play.google.com/store/apps/details?id=io.yamayama.taji&hl=en) \*I am the developer of the app.
55,754
I searched for the answer for this specific question of mine, but couldn't find it. So I'm sorry If I duplicated some thread. I was reading some stuff here about 自動詞 and 他動詞 and start wondering if all verbs in japanese come in transitive/intransitive pairs like 付く/付ける. Is this true?
2018/01/08
[ "https://japanese.stackexchange.com/questions/55754", "https://japanese.stackexchange.com", "https://japanese.stackexchange.com/users/26581/" ]
Not all verbs come in transitive/intransitive pairs. Quite a few intransitive verbs have no transitive counterpart. To name a few... > > ある、[行]{い}く、[来]{く}る、[歩]{ある}く、[走]{はし}る、[座]{すわ}る、かみつく、そびえる、[響]{ひび}く etc... > > > 行かせる, 来させる, 歩かせる etc. are causative forms (使役形), consisting of conjugated form 「行か」 + auxiliary ...
They don't always come in pairs or obey the patterns, you can learn/study about transitive intransitive verbs with [Japanese Verbs Transitive Intransitive - TaJi - 他自](https://play.google.com/store/apps/details?id=io.yamayama.taji&hl=en) \*I am the developer of the app.
57,859,030
Working on an App that will require multiple screens. The below right now shows only two icons, more later, and i need them the be able to go the a corresponding screen when pressed. Everything works but the onPressed function. The error I get is > > The named parameter "onPressed" is not defined > > > Do I hav...
2019/09/09
[ "https://Stackoverflow.com/questions/57859030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1330633/" ]
`Card` doesn't support `onPressed` property, you already have `InkWell` which has `onTap`, you can put `onPressed` method action inside it. ``` onTap: () { Navigator.push(context, MaterialPageRoute(builder: (context)=>FoodScreen()) ); } ```
Card doesn't have any property of onpressed() you can add a floating button and Route it to the the second page i.e food\_screen.dart <https://api.flutter.dev/flutter/material/Card-class.html> [if you want to add a tap on Card Widget just wrap the card with GestureDetector.](https://api.flutter.dev/flutter/widgets/Ge...
73,851,917
I'm writing a simple program in c, **that prints all elements of an array.** The array is ``` char op[2][50] = {"option1", "option2"}; ``` the program is ``` int main(int argc, char * argv[]) { char spaces[6] = " "; int choice; char op[2][50] = {"option1", "option2"}; printf("\n\n\t===========...
2022/09/26
[ "https://Stackoverflow.com/questions/73851917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19969872/" ]
You can use a dictionary instead of if-else block. ```py options = { "C": "Capacitor", "D": "Diode", "IC": "IntigratedCircuit", "R": "Resistor", "T": "Transistor", "K": "Relay", } ``` and then ```py print(f"{ComponentIdentifier} is a {options[ComponentIdentifier]}!") ```
Commenter Deceze and Thefourtheye figured it out. Cleanest way in my case is using a dict ``` valueas = {'C': 'Capacitor', ...} [valueas[i] for i in some_list] ```
622,407
Consider the code ``` \documentclass{res} \setlength{\textheight}{9.5in} % increase text height to fit on 1-page \newlength{\imagewidth}\setlength{\imagewidth}{4em} \usepackage{graphicx} \usepackage{lipsum} \usepackage{zref-savepos} \makeatletter \@ifundefined{zsaveposx}{\let\zsaveposx\zsavepos}{} \makeatother \newc...
2021/11/12
[ "https://tex.stackexchange.com/questions/622407", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/192836/" ]
It might be that using a `pgfplotstable` table would work. It's certainly straightforward to plot columns from such a table, and use `x expr` to calculate a x-value for the plot. See example below. Individual values from the table can be accessed with `\pgfplotstablegetelem{<row>}{<column>}\of\tablename`, which saves ...
As an exercise, here is an solution with [`functional`](https://ctan.org/pkg/functional) package: ``` \documentclass{article} \usepackage{pgfplots} \usepackage{functional} \begin{document} \newcommand{\test}{3,4,2,5} \IgnoreSpacesOn \PrgNewFunction \MakeCoords {M} { \ClistClear \lTmpaClist \IntZero \lTmpaInt ...
622,407
Consider the code ``` \documentclass{res} \setlength{\textheight}{9.5in} % increase text height to fit on 1-page \newlength{\imagewidth}\setlength{\imagewidth}{4em} \usepackage{graphicx} \usepackage{lipsum} \usepackage{zref-savepos} \makeatletter \@ifundefined{zsaveposx}{\let\zsaveposx\zsavepos}{} \makeatother \newc...
2021/11/12
[ "https://tex.stackexchange.com/questions/622407", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/192836/" ]
It might be that using a `pgfplotstable` table would work. It's certainly straightforward to plot columns from such a table, and use `x expr` to calculate a x-value for the plot. See example below. Individual values from the table can be accessed with `\pgfplotstablegetelem{<row>}{<column>}\of\tablename`, which saves ...
You can use a `\foreach`-loop for collecting things within a scratch macro. When the loop is done use the scratch-macro for performing whatsoever action with the scratch-macro's expansion. Action could, e.g., be a command for defining a macro `\tester` holding coordinates. ``` \DefineCoordsMacro[*⟨x-shift of coordinat...
622,407
Consider the code ``` \documentclass{res} \setlength{\textheight}{9.5in} % increase text height to fit on 1-page \newlength{\imagewidth}\setlength{\imagewidth}{4em} \usepackage{graphicx} \usepackage{lipsum} \usepackage{zref-savepos} \makeatletter \@ifundefined{zsaveposx}{\let\zsaveposx\zsavepos}{} \makeatother \newc...
2021/11/12
[ "https://tex.stackexchange.com/questions/622407", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/192836/" ]
As an exercise, here is an solution with [`functional`](https://ctan.org/pkg/functional) package: ``` \documentclass{article} \usepackage{pgfplots} \usepackage{functional} \begin{document} \newcommand{\test}{3,4,2,5} \IgnoreSpacesOn \PrgNewFunction \MakeCoords {M} { \ClistClear \lTmpaClist \IntZero \lTmpaInt ...
You can use a `\foreach`-loop for collecting things within a scratch macro. When the loop is done use the scratch-macro for performing whatsoever action with the scratch-macro's expansion. Action could, e.g., be a command for defining a macro `\tester` holding coordinates. ``` \DefineCoordsMacro[*⟨x-shift of coordinat...
22,500,462
I'm expanding my cell via: ``` - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if(selectedRow && indexPath.row == selectedRow.row) { tableView.scrollEnabled = NO; return 480; } return 250; } - (void)tableView:(UITableView *)tableView didSele...
2014/03/19
[ "https://Stackoverflow.com/questions/22500462", "https://Stackoverflow.com", "https://Stackoverflow.com/users/987085/" ]
Try This : ``` - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if(selectedRow.row == indexPath.row) selectedRow = nil; else selectedRow = indexPath; [tableView beginUpdates]; [tableView endUpdates]; ...
I would suggest you to add a custom property like `isExpanded` in your tableView datasource object and switch that property based on selection and return height according to this value. For ex: In your `heightForRowAtIndexPath` method, you could have somthing like this. ``` if(yourCustomCell.isExpanded == true){ ...
22,500,462
I'm expanding my cell via: ``` - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if(selectedRow && indexPath.row == selectedRow.row) { tableView.scrollEnabled = NO; return 480; } return 250; } - (void)tableView:(UITableView *)tableView didSele...
2014/03/19
[ "https://Stackoverflow.com/questions/22500462", "https://Stackoverflow.com", "https://Stackoverflow.com/users/987085/" ]
Try this ``` - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if(selectedRow && indexPath.row == selectedRow.row) { tableView.scrollEnabled = NO; return 480; } tableView.scrollEnabled = YES; return 250; } - (void)tableView:(UITableView *...
Try This : ``` - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if(selectedRow.row == indexPath.row) selectedRow = nil; else selectedRow = indexPath; [tableView beginUpdates]; [tableView endUpdates]; ...
22,500,462
I'm expanding my cell via: ``` - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if(selectedRow && indexPath.row == selectedRow.row) { tableView.scrollEnabled = NO; return 480; } return 250; } - (void)tableView:(UITableView *)tableView didSele...
2014/03/19
[ "https://Stackoverflow.com/questions/22500462", "https://Stackoverflow.com", "https://Stackoverflow.com/users/987085/" ]
Try this ``` - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if(selectedRow && indexPath.row == selectedRow.row) { tableView.scrollEnabled = NO; return 480; } tableView.scrollEnabled = YES; return 250; } - (void)tableView:(UITableView *...
I would suggest you to add a custom property like `isExpanded` in your tableView datasource object and switch that property based on selection and return height according to this value. For ex: In your `heightForRowAtIndexPath` method, you could have somthing like this. ``` if(yourCustomCell.isExpanded == true){ ...
56,842,442
I have implemented the `ngx-file-drop` component in angular 7 application which allows drag and dropping files to upload. I need to change the background of the content area where while are dropped with an image. I have tried to `css` and also assign the `contentClassName` property like `contentClassName = "upload-ba...
2019/07/01
[ "https://Stackoverflow.com/questions/56842442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4607841/" ]
You could declare a field render function, for example: ``` ... renderField(name) { return ( <Field id={name} name={name} component={FormField} validate={this.myValidation} ... /> ); } ... render() { return ( <div> {this.renderField('firstName')} {this.ren...
You're doing it the way it should be done, you're writing out what you want (declaring these two fields). I don't see any reason to abstract this out any further. I know this isn't much of an answer but sometimes not doing stuff is better than spending extra time effort for minimal gains.
56,842,442
I have implemented the `ngx-file-drop` component in angular 7 application which allows drag and dropping files to upload. I need to change the background of the content area where while are dropped with an image. I have tried to `css` and also assign the `contentClassName` property like `contentClassName = "upload-ba...
2019/07/01
[ "https://Stackoverflow.com/questions/56842442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4607841/" ]
While this is probably overkill for two fields, you can also use a `map` function that returns an array of React components. ``` render() { return( <div> {['firstName', 'lastName'].map((el) => { return( <Field id={el} ...
You're doing it the way it should be done, you're writing out what you want (declaring these two fields). I don't see any reason to abstract this out any further. I know this isn't much of an answer but sometimes not doing stuff is better than spending extra time effort for minimal gains.
56,842,442
I have implemented the `ngx-file-drop` component in angular 7 application which allows drag and dropping files to upload. I need to change the background of the content area where while are dropped with an image. I have tried to `css` and also assign the `contentClassName` property like `contentClassName = "upload-ba...
2019/07/01
[ "https://Stackoverflow.com/questions/56842442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4607841/" ]
You could declare a field render function, for example: ``` ... renderField(name) { return ( <Field id={name} name={name} component={FormField} validate={this.myValidation} ... /> ); } ... render() { return ( <div> {this.renderField('firstName')} {this.ren...
While this is probably overkill for two fields, you can also use a `map` function that returns an array of React components. ``` render() { return( <div> {['firstName', 'lastName'].map((el) => { return( <Field id={el} ...
174,674
I have a text file containing a list of directories with its **absolute path** ``` $ cat DirectoriesToCopy.txt /data/Dir1 /data/Dir2 ``` I want to use rsync to copy all these directories preserving its absolute path to another location. I tried the following rsync command, but it doesn't work ``` rsync -avr --in...
2014/12/17
[ "https://unix.stackexchange.com/questions/174674", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/23105/" ]
Use the following command: ``` rsync -av --include-from=DirectoriesToCopy.txt --include /data/ --exclude='/data/*' --exclude='/*/' / /media/MyDestination/ ``` You need to include /data/ explicitly, you could also have added that to the list in the file. Then exclude all other directories (order is important with inc...
The [rsync manual](http://rsync.samba.org/ftp/rsync/rsync.html) warns about this scenario (section “Include/exclude pattern rules”): > > this won't work: > > > > ``` > + /some/path/this-file-will-not-be-found > + /file-is-included > - * > > ``` > > This fails because the parent directory `"some"` is excluded by ...
174,674
I have a text file containing a list of directories with its **absolute path** ``` $ cat DirectoriesToCopy.txt /data/Dir1 /data/Dir2 ``` I want to use rsync to copy all these directories preserving its absolute path to another location. I tried the following rsync command, but it doesn't work ``` rsync -avr --in...
2014/12/17
[ "https://unix.stackexchange.com/questions/174674", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/23105/" ]
Use the following command: ``` rsync -av --include-from=DirectoriesToCopy.txt --include /data/ --exclude='/data/*' --exclude='/*/' / /media/MyDestination/ ``` You need to include /data/ explicitly, you could also have added that to the list in the file. Then exclude all other directories (order is important with inc...
> > I want to use rsync to copy all these directories [from a list] preserving its absolute path to another location > > > Don't use `--include` or `--filter` variations, as that will just confuse things. Instead, use `--files-from=_filename_`. (If you do, make sure you do *lots* of testing.) 1. Create the direct...
174,674
I have a text file containing a list of directories with its **absolute path** ``` $ cat DirectoriesToCopy.txt /data/Dir1 /data/Dir2 ``` I want to use rsync to copy all these directories preserving its absolute path to another location. I tried the following rsync command, but it doesn't work ``` rsync -avr --in...
2014/12/17
[ "https://unix.stackexchange.com/questions/174674", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/23105/" ]
> > I want to use rsync to copy all these directories [from a list] preserving its absolute path to another location > > > Don't use `--include` or `--filter` variations, as that will just confuse things. Instead, use `--files-from=_filename_`. (If you do, make sure you do *lots* of testing.) 1. Create the direct...
The [rsync manual](http://rsync.samba.org/ftp/rsync/rsync.html) warns about this scenario (section “Include/exclude pattern rules”): > > this won't work: > > > > ``` > + /some/path/this-file-will-not-be-found > + /file-is-included > - * > > ``` > > This fails because the parent directory `"some"` is excluded by ...
11,448,408
``` Thread myThread = new Thread(new ParameterizedThreadStart(threadFunction)); public void threadFunction() { // Run a finite code ... } ``` Question is: will `myThread` get disposed once `threadFunction()` is over?
2012/07/12
[ "https://Stackoverflow.com/questions/11448408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1073131/" ]
Threads don't need to be disposed. The `Thread` class does not implement `IDisposable` and it does not have a `Dispose` method. When your thread completes you don't need to do anything special to clean up.
YES.. the thread will stop and will be disposed once the function returns.. to hold the thread you will have to do something like ``` while(true){} ``` Alternatively if you dont want your thread to be disposed because creating a new thread consumes resources you should use a `ThreadPool` there is a class with ...
64,481,889
Removing neighbouring duplicates have been discussed before, but only in terms of direct neighbouring (one row above/below) [here](https://stackoverflow.com/questions/19463985/pandas-drop-consecutive-duplicates). I have the following dataframe: ``` df = pd.DataFrame(data={"item_no": [11, 4, 4, 4, 7, 8, 7, 11, 11, 5, ...
2020/10/22
[ "https://Stackoverflow.com/questions/64481889", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11764097/" ]
Please Try ``` df[df.item_no!=df.item_no.shift(1)] item_no time 0 11 1 1 4 2 4 7 5 5 8 6 6 7 7 7 11 8 9 5 10 11 6 12 12 4 13 ```
You can use shift to detect adjacent entries that have not changed. From there it is straigt forward: ``` df = pd.DataFrame(data={"item_no": [11, 4, 4, 4, 7, 8, 7, 11, 11, 5, 5, 6, 4], "time": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]}) ind = df['item_no']==df['item_no'].shift() df = df.loc[~ind] print(df) ite...
64,481,889
Removing neighbouring duplicates have been discussed before, but only in terms of direct neighbouring (one row above/below) [here](https://stackoverflow.com/questions/19463985/pandas-drop-consecutive-duplicates). I have the following dataframe: ``` df = pd.DataFrame(data={"item_no": [11, 4, 4, 4, 7, 8, 7, 11, 11, 5, ...
2020/10/22
[ "https://Stackoverflow.com/questions/64481889", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11764097/" ]
Please Try ``` df[df.item_no!=df.item_no.shift(1)] item_no time 0 11 1 1 4 2 4 7 5 5 8 6 6 7 7 7 11 8 9 5 10 11 6 12 12 4 13 ```
Try using `shift`: ``` df = df[df.shift(1) != df].dropna() print(df) item_no time 0 11 1 1 4 2 4 7 5 5 8 6 6 7 7 7 11 8 9 5 10 11 6 12 12 4 13 ```
52,176,501
Check following contrived program: ``` #include <functional> #include <memory> template<typename T> using UniPtr = std::unique_ptr<T, std::function<void(T*)>>; int* alloc() { return new int; } UniPtr<int> func() { auto dealloc = [](int* p){delete p;}; return UniPtr<int>{alloc(), dealloc}; } int main()...
2018/09/05
[ "https://Stackoverflow.com/questions/52176501", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2106207/" ]
> > I think after leaving the `func()` scope, the `dealloc` object should be freed, and it can't be referenced. > > > You don't need to worry about it. Yes the lambda object will be destroyed, but the pointer to function returned by the [lambda's function pointer conversion function](https://en.cppreference.com/w/...
If you defined `UniPtr` as ``` template<typename T> using UniPtr = std::unique_ptr<T, void(*)(T*)>; ``` then the following code is valid, there are no concerns about the lifetime of the deleter ``` UniPtr<int> func() { auto dealloc = [](int* p){delete p;}; return UniPtr<int>{alloc(), dealloc}; } ``` Quoti...
52,176,501
Check following contrived program: ``` #include <functional> #include <memory> template<typename T> using UniPtr = std::unique_ptr<T, std::function<void(T*)>>; int* alloc() { return new int; } UniPtr<int> func() { auto dealloc = [](int* p){delete p;}; return UniPtr<int>{alloc(), dealloc}; } int main()...
2018/09/05
[ "https://Stackoverflow.com/questions/52176501", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2106207/" ]
> > I think after leaving the `func()` scope, the `dealloc` object should be freed, and it can't be referenced. > > > You don't need to worry about it. Yes the lambda object will be destroyed, but the pointer to function returned by the [lambda's function pointer conversion function](https://en.cppreference.com/w/...
A little addition for implementation to the previous answers... ``` template<typename T, typename D> std::unique_ptr<T, D> make_unique_with_deleter(T* t, D d) { // granted copy elison since C++17 return std::unique_ptr<T, D> (t, d); } ``` using: ``` class A { }; auto up1 = make_unique_with_deleter(new A, [...
52,176,501
Check following contrived program: ``` #include <functional> #include <memory> template<typename T> using UniPtr = std::unique_ptr<T, std::function<void(T*)>>; int* alloc() { return new int; } UniPtr<int> func() { auto dealloc = [](int* p){delete p;}; return UniPtr<int>{alloc(), dealloc}; } int main()...
2018/09/05
[ "https://Stackoverflow.com/questions/52176501", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2106207/" ]
If you defined `UniPtr` as ``` template<typename T> using UniPtr = std::unique_ptr<T, void(*)(T*)>; ``` then the following code is valid, there are no concerns about the lifetime of the deleter ``` UniPtr<int> func() { auto dealloc = [](int* p){delete p;}; return UniPtr<int>{alloc(), dealloc}; } ``` Quoti...
A little addition for implementation to the previous answers... ``` template<typename T, typename D> std::unique_ptr<T, D> make_unique_with_deleter(T* t, D d) { // granted copy elison since C++17 return std::unique_ptr<T, D> (t, d); } ``` using: ``` class A { }; auto up1 = make_unique_with_deleter(new A, [...
60,283
In Chinese cuisine it's very common to start a vegetable stir fry with a bit of minced meat, typically pork, to give the dish a deeper flavor. To make a vegetarian version I usually just leave this out, but I've been wondering if something else would give a similar effect taste-wise. Typical meat replacements like tof...
2015/08/27
[ "https://cooking.stackexchange.com/questions/60283", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/37887/" ]
It seems like you are primarily interested in reproducing the umami of the meat. Tofu does in fact have glutamic acids that will add to the umami; just make sure to thoroughly dry the tofu (extracting as much liquid as possible) before use. In addition, you can use minced mushrooms, [as Stephie mentioned in the comment...
Let's recapitulate the textural options you have: * Crumbled firm tofu, sauteed (with or without some soy sauce and/or wheat paste - mind the color you want too!) * Brunoised/minced fresh/reconstituted shiitake mushroom (potent taste, and you get a great stock from rehydrating :) ), sauteed. * Brunoised/minced "perfec...
60,283
In Chinese cuisine it's very common to start a vegetable stir fry with a bit of minced meat, typically pork, to give the dish a deeper flavor. To make a vegetarian version I usually just leave this out, but I've been wondering if something else would give a similar effect taste-wise. Typical meat replacements like tof...
2015/08/27
[ "https://cooking.stackexchange.com/questions/60283", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/37887/" ]
Let's recapitulate the textural options you have: * Crumbled firm tofu, sauteed (with or without some soy sauce and/or wheat paste - mind the color you want too!) * Brunoised/minced fresh/reconstituted shiitake mushroom (potent taste, and you get a great stock from rehydrating :) ), sauteed. * Brunoised/minced "perfec...
This idea works for me when I'm cooking Italian-style foods, but it should translate to Chinese cooking with some modifications. I use green lentils, cooked through and then mashed and spiced. For Italian-style, I use cumin, smoked paprika, nutmeg, salt and pepper. For Chinese, I would suggest some hoi-sin sauce, wi...
60,283
In Chinese cuisine it's very common to start a vegetable stir fry with a bit of minced meat, typically pork, to give the dish a deeper flavor. To make a vegetarian version I usually just leave this out, but I've been wondering if something else would give a similar effect taste-wise. Typical meat replacements like tof...
2015/08/27
[ "https://cooking.stackexchange.com/questions/60283", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/37887/" ]
Don't know many dishes that start with pork mince because my experience is limited to North China, mostly Beijing. There, mince was added to noodles mostly; with veg was eggplant, sometimes mushrooms; and of course in Mao Po Tofu. I believe it's the mince browning that adds the flavor. Getting some good caramelized f...
This idea works for me when I'm cooking Italian-style foods, but it should translate to Chinese cooking with some modifications. I use green lentils, cooked through and then mashed and spiced. For Italian-style, I use cumin, smoked paprika, nutmeg, salt and pepper. For Chinese, I would suggest some hoi-sin sauce, wi...
60,283
In Chinese cuisine it's very common to start a vegetable stir fry with a bit of minced meat, typically pork, to give the dish a deeper flavor. To make a vegetarian version I usually just leave this out, but I've been wondering if something else would give a similar effect taste-wise. Typical meat replacements like tof...
2015/08/27
[ "https://cooking.stackexchange.com/questions/60283", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/37887/" ]
It seems like you are primarily interested in reproducing the umami of the meat. Tofu does in fact have glutamic acids that will add to the umami; just make sure to thoroughly dry the tofu (extracting as much liquid as possible) before use. In addition, you can use minced mushrooms, [as Stephie mentioned in the comment...
[**Jackfruit**](https://en.wikipedia.org/wiki/Jackfruit) supposedly works well as a pork substitute. [[Source](http://www.onegreenplanet.org/vegan-food/how-to-make-jackfruit-a-stand-out-substitute-for-meat/)]. * When jackfruit is ripe, it has a sweet taste and can be used in desserts but **when it’s unripe, the taste ...
60,283
In Chinese cuisine it's very common to start a vegetable stir fry with a bit of minced meat, typically pork, to give the dish a deeper flavor. To make a vegetarian version I usually just leave this out, but I've been wondering if something else would give a similar effect taste-wise. Typical meat replacements like tof...
2015/08/27
[ "https://cooking.stackexchange.com/questions/60283", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/37887/" ]
Serious Eats used a [dry fried minced mushrooms](http://www.seriouseats.com/2013/02/vegan-food-mapo-tofu-vegetarian-sichuan.html) to substitute for, in that case, beef in a dish. I don't know if it will substitute for pork mince in the same way, having no firsthand experience, but it may be worth trying. The results ar...
You could try pressed bean curd. If you chop it up, it might have a similar texture, and it does provide protein. It comes in plain and seasoned kinds that you can try.
60,283
In Chinese cuisine it's very common to start a vegetable stir fry with a bit of minced meat, typically pork, to give the dish a deeper flavor. To make a vegetarian version I usually just leave this out, but I've been wondering if something else would give a similar effect taste-wise. Typical meat replacements like tof...
2015/08/27
[ "https://cooking.stackexchange.com/questions/60283", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/37887/" ]
It seems like you are primarily interested in reproducing the umami of the meat. Tofu does in fact have glutamic acids that will add to the umami; just make sure to thoroughly dry the tofu (extracting as much liquid as possible) before use. In addition, you can use minced mushrooms, [as Stephie mentioned in the comment...
Straight up msg my guy, alternatively get some course salt and whole Sichuan peppercorns, toast together in a dry pan and pick out the peppers after it gets fragrant
60,283
In Chinese cuisine it's very common to start a vegetable stir fry with a bit of minced meat, typically pork, to give the dish a deeper flavor. To make a vegetarian version I usually just leave this out, but I've been wondering if something else would give a similar effect taste-wise. Typical meat replacements like tof...
2015/08/27
[ "https://cooking.stackexchange.com/questions/60283", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/37887/" ]
This idea works for me when I'm cooking Italian-style foods, but it should translate to Chinese cooking with some modifications. I use green lentils, cooked through and then mashed and spiced. For Italian-style, I use cumin, smoked paprika, nutmeg, salt and pepper. For Chinese, I would suggest some hoi-sin sauce, wi...
You could try pressed bean curd. If you chop it up, it might have a similar texture, and it does provide protein. It comes in plain and seasoned kinds that you can try.
60,283
In Chinese cuisine it's very common to start a vegetable stir fry with a bit of minced meat, typically pork, to give the dish a deeper flavor. To make a vegetarian version I usually just leave this out, but I've been wondering if something else would give a similar effect taste-wise. Typical meat replacements like tof...
2015/08/27
[ "https://cooking.stackexchange.com/questions/60283", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/37887/" ]
Let's recapitulate the textural options you have: * Crumbled firm tofu, sauteed (with or without some soy sauce and/or wheat paste - mind the color you want too!) * Brunoised/minced fresh/reconstituted shiitake mushroom (potent taste, and you get a great stock from rehydrating :) ), sauteed. * Brunoised/minced "perfec...
You could try pressed bean curd. If you chop it up, it might have a similar texture, and it does provide protein. It comes in plain and seasoned kinds that you can try.
60,283
In Chinese cuisine it's very common to start a vegetable stir fry with a bit of minced meat, typically pork, to give the dish a deeper flavor. To make a vegetarian version I usually just leave this out, but I've been wondering if something else would give a similar effect taste-wise. Typical meat replacements like tof...
2015/08/27
[ "https://cooking.stackexchange.com/questions/60283", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/37887/" ]
[**Jackfruit**](https://en.wikipedia.org/wiki/Jackfruit) supposedly works well as a pork substitute. [[Source](http://www.onegreenplanet.org/vegan-food/how-to-make-jackfruit-a-stand-out-substitute-for-meat/)]. * When jackfruit is ripe, it has a sweet taste and can be used in desserts but **when it’s unripe, the taste ...
Straight up msg my guy, alternatively get some course salt and whole Sichuan peppercorns, toast together in a dry pan and pick out the peppers after it gets fragrant
60,283
In Chinese cuisine it's very common to start a vegetable stir fry with a bit of minced meat, typically pork, to give the dish a deeper flavor. To make a vegetarian version I usually just leave this out, but I've been wondering if something else would give a similar effect taste-wise. Typical meat replacements like tof...
2015/08/27
[ "https://cooking.stackexchange.com/questions/60283", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/37887/" ]
It seems like you are primarily interested in reproducing the umami of the meat. Tofu does in fact have glutamic acids that will add to the umami; just make sure to thoroughly dry the tofu (extracting as much liquid as possible) before use. In addition, you can use minced mushrooms, [as Stephie mentioned in the comment...
Serious Eats used a [dry fried minced mushrooms](http://www.seriouseats.com/2013/02/vegan-food-mapo-tofu-vegetarian-sichuan.html) to substitute for, in that case, beef in a dish. I don't know if it will substitute for pork mince in the same way, having no firsthand experience, but it may be worth trying. The results ar...
65,215,019
I checked many other similar questions but I can't come up with a .htaccess rule that would work properly. I have a server containing a Knowledgebase system (knowledgebase.php). I don't want to show this `knowledgebase.php` in the URL, ever. Examples what I want: * <https://help.thecrypto.app> should show same url (...
2020/12/09
[ "https://Stackoverflow.com/questions/65215019", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1181261/" ]
You can use this : ``` RewriteEngine on #1) redirect "help.thecrypto.app/" to /knowledgebase.php RewriteCond %{HTTP_HOST} ^help.thecrypto.app$ [NC] RewriteRule ^knowledgebase\.php$ / [L,R] #2) internally map knowledgebase.php to the root / RewriteRule ^/?$ /knowledgebase.php [END] ``` This will serve `/knowledgebas...
Could you please try following, written based on your shown samples. Please clear your browser cache before testing urls. ``` RewriteEngine ON RewriteCond %{REQUEST_URI} ^/?$ RewritewriteRule ^ knowledgebase.php [L] RewriteCond %{REQUEST_URI} ^/(knowledgebase) [NC] RewriteCond %{QUERY_STRING} ^$ RewriteRule ^(.*)$ ht...
65,483,936
Why does this code produce an error? I followed the tutorial (what I thought as perfectly): ``` from kivy.app import App from kivy.uix.label import Label from kivy.uix.boxlayout import BoxLayout from kivy.uix.button import Button from kivy.uix.textinput import TextInput from kivy.core.window import Window import rando...
2020/12/28
[ "https://Stackoverflow.com/questions/65483936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13985847/" ]
The answer is to replace `size` and `size_hint` with `size_small` or `size_large` or whatever else size you want. With these commands, you can specify what size you want in kivy.
You miss-spelled `orientation` and passed `self.label` as an argument in `self.layout.add_widget(self.label)` instead of `label`. Change `label = Label(text="Remember me:/Rebecca")` to `self.label = Label(text="Remember me:/Rebecca")` and it should work.
65,483,936
Why does this code produce an error? I followed the tutorial (what I thought as perfectly): ``` from kivy.app import App from kivy.uix.label import Label from kivy.uix.boxlayout import BoxLayout from kivy.uix.button import Button from kivy.uix.textinput import TextInput from kivy.core.window import Window import rando...
2020/12/28
[ "https://Stackoverflow.com/questions/65483936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13985847/" ]
You miss-spelled `orientaion`. It should be `orientation` in: ``` self.layout = BoxLayout(orientaion='vertical',size=(Window.width, Window.height)) ```
You miss-spelled `orientation` and passed `self.label` as an argument in `self.layout.add_widget(self.label)` instead of `label`. Change `label = Label(text="Remember me:/Rebecca")` to `self.label = Label(text="Remember me:/Rebecca")` and it should work.
20,223,911
``` <?php var_dump(in_array('ddds', array(2,3,0))); ``` Why this function return true? We have a string which could be converted to 1 but why to 0?
2013/11/26
[ "https://Stackoverflow.com/questions/20223911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2886388/" ]
[Because 'ddds' is equal to 0 .](https://stackoverflow.com/questions/12151997/why-does-1234-1234-test-evaluate-to-true)
This is because `ddds == 0` is true ([demo](https://eval.in/73589)), and 0 is an element of your array. Set the `strict` parameter for [`in_array()`](http://php.net/in_array) to ensure the types are also considered. From the [documentation](http://php.net/in_array): > > If the third parameter strict is set to TRUE t...
69,638,005
I have this table, I need set ID column = 1 for the max value of column minutes, and the rest ID column = 0. Initial table: ``` Register |minutes | ID 10 |5 | 0 10 |6 | 0 10 |0 | 0 12 |3 | 0 12 |0 | 0 12 |4 | 0 ``` Final table: ```...
2021/10/19
[ "https://Stackoverflow.com/questions/69638005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/978839/" ]
You can use row\_number() in an updatable CTE: ``` with m as ( select *, row_number() over(partition by register order by minutes desc) rn from t ) update m set id=1 where rn=1 ```
Does this do what you want? ``` DECLARE @max INT SELECT TOP 1 @max = Minutes FROM YourTable ORDER BY Minutes DESC UPDATE YourTable SET ID = CASE WHEN Minutes = @max THEN 1 ELSE 0 END ```
69,638,005
I have this table, I need set ID column = 1 for the max value of column minutes, and the rest ID column = 0. Initial table: ``` Register |minutes | ID 10 |5 | 0 10 |6 | 0 10 |0 | 0 12 |3 | 0 12 |0 | 0 12 |4 | 0 ``` Final table: ```...
2021/10/19
[ "https://Stackoverflow.com/questions/69638005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/978839/" ]
Does this do what you want? ``` DECLARE @max INT SELECT TOP 1 @max = Minutes FROM YourTable ORDER BY Minutes DESC UPDATE YourTable SET ID = CASE WHEN Minutes = @max THEN 1 ELSE 0 END ```
If you don’t want to use CTE or variable tables: ``` UPDATE A SET A.ID = CASE WHEN B.RowNumber = 1 THEN 1 ELSE 0 END FROM table A JOIN ( SELECT *, row_number() over (PARTITION BY Register order by minutes DESC) AS RowNumber FROM table ...
69,638,005
I have this table, I need set ID column = 1 for the max value of column minutes, and the rest ID column = 0. Initial table: ``` Register |minutes | ID 10 |5 | 0 10 |6 | 0 10 |0 | 0 12 |3 | 0 12 |0 | 0 12 |4 | 0 ``` Final table: ```...
2021/10/19
[ "https://Stackoverflow.com/questions/69638005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/978839/" ]
Does this do what you want? ``` DECLARE @max INT SELECT TOP 1 @max = Minutes FROM YourTable ORDER BY Minutes DESC UPDATE YourTable SET ID = CASE WHEN Minutes = @max THEN 1 ELSE 0 END ```
I have left my previous answer in place as it represents the answer to the question as it was at the time of answering. Given the new information added to the question, the update query would be as below: ``` ;WITH MyCTE AS ( SELECT Register, Minutes, ID, ROW_NUMBER() OVER (PAR...
69,638,005
I have this table, I need set ID column = 1 for the max value of column minutes, and the rest ID column = 0. Initial table: ``` Register |minutes | ID 10 |5 | 0 10 |6 | 0 10 |0 | 0 12 |3 | 0 12 |0 | 0 12 |4 | 0 ``` Final table: ```...
2021/10/19
[ "https://Stackoverflow.com/questions/69638005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/978839/" ]
You can use row\_number() in an updatable CTE: ``` with m as ( select *, row_number() over(partition by register order by minutes desc) rn from t ) update m set id=1 where rn=1 ```
If you don’t want to use CTE or variable tables: ``` UPDATE A SET A.ID = CASE WHEN B.RowNumber = 1 THEN 1 ELSE 0 END FROM table A JOIN ( SELECT *, row_number() over (PARTITION BY Register order by minutes DESC) AS RowNumber FROM table ...
69,638,005
I have this table, I need set ID column = 1 for the max value of column minutes, and the rest ID column = 0. Initial table: ``` Register |minutes | ID 10 |5 | 0 10 |6 | 0 10 |0 | 0 12 |3 | 0 12 |0 | 0 12 |4 | 0 ``` Final table: ```...
2021/10/19
[ "https://Stackoverflow.com/questions/69638005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/978839/" ]
You can use row\_number() in an updatable CTE: ``` with m as ( select *, row_number() over(partition by register order by minutes desc) rn from t ) update m set id=1 where rn=1 ```
I have left my previous answer in place as it represents the answer to the question as it was at the time of answering. Given the new information added to the question, the update query would be as below: ``` ;WITH MyCTE AS ( SELECT Register, Minutes, ID, ROW_NUMBER() OVER (PAR...
53,810,436
``` <asp:TextBox ID="questionTb" runat="server" Height="160px" TextMode="MultiLine" Rows="10" MaxLength="2" Width="100%" OnTextChanged="questionTb_TextChanged"></asp:TextBox> ``` The above given code segment provides an output which is mentioned below. [![enter image description here](https://i.stack.imgur.com/H4Dy...
2018/12/17
[ "https://Stackoverflow.com/questions/53810436", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9560041/" ]
Here is a function to get the image as you are uploading using the **choose file** button ```js function readURL() { const myimg = document.getElementById("myimg"); const input = document.getElementById("myfile"); if(input.files && input.files[0]) { const reader = new FileReader(); reader.o...
Here is how I implemented it in my case: ``` onSelectFile(event) { if (event.target.files && event.target.files[0]) { var reader = new FileReader(); reader.readAsDataURL(event.target.files[0]); // read file as data url reader.onload = (event) => { // called once readAsDataURL is completed ...
53,810,436
``` <asp:TextBox ID="questionTb" runat="server" Height="160px" TextMode="MultiLine" Rows="10" MaxLength="2" Width="100%" OnTextChanged="questionTb_TextChanged"></asp:TextBox> ``` The above given code segment provides an output which is mentioned below. [![enter image description here](https://i.stack.imgur.com/H4Dy...
2018/12/17
[ "https://Stackoverflow.com/questions/53810436", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9560041/" ]
Here is a function to get the image as you are uploading using the **choose file** button ```js function readURL() { const myimg = document.getElementById("myimg"); const input = document.getElementById("myfile"); if(input.files && input.files[0]) { const reader = new FileReader(); reader.o...
``` <html> <head> <style> #preview { background: red; border: 1px solid green; } </style> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script src="http://jcrop-cdn.tapmodo.com/v0.9.12/js/jquery.Jcrop.min.js"></script> <link rel="styles...
53,810,436
``` <asp:TextBox ID="questionTb" runat="server" Height="160px" TextMode="MultiLine" Rows="10" MaxLength="2" Width="100%" OnTextChanged="questionTb_TextChanged"></asp:TextBox> ``` The above given code segment provides an output which is mentioned below. [![enter image description here](https://i.stack.imgur.com/H4Dy...
2018/12/17
[ "https://Stackoverflow.com/questions/53810436", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9560041/" ]
Here is a function to get the image as you are uploading using the **choose file** button ```js function readURL() { const myimg = document.getElementById("myimg"); const input = document.getElementById("myfile"); if(input.files && input.files[0]) { const reader = new FileReader(); reader.o...
```js // Set constraints for the video stream var constraints = { video: { facingMode: "user" }, audio: false }; // Define constants const cameraView = document.querySelector("#camera--view"), cameraOutput = document.querySelector("#camera--output"), cameraSensor = document.querySelector("#camera--sensor")...
53,810,436
``` <asp:TextBox ID="questionTb" runat="server" Height="160px" TextMode="MultiLine" Rows="10" MaxLength="2" Width="100%" OnTextChanged="questionTb_TextChanged"></asp:TextBox> ``` The above given code segment provides an output which is mentioned below. [![enter image description here](https://i.stack.imgur.com/H4Dy...
2018/12/17
[ "https://Stackoverflow.com/questions/53810436", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9560041/" ]
Here is a function to get the image as you are uploading using the **choose file** button ```js function readURL() { const myimg = document.getElementById("myimg"); const input = document.getElementById("myfile"); if(input.files && input.files[0]) { const reader = new FileReader(); reader.o...
I'm a bit late to the party on this one, but I was facing a very similar issue myself yesterday, but instead using NodeJS. My solution in the end was to break down the image into its RGBA values and check each row and column of the image to find where the image itself actually starts in comparison to the BG. In my ca...
53,810,436
``` <asp:TextBox ID="questionTb" runat="server" Height="160px" TextMode="MultiLine" Rows="10" MaxLength="2" Width="100%" OnTextChanged="questionTb_TextChanged"></asp:TextBox> ``` The above given code segment provides an output which is mentioned below. [![enter image description here](https://i.stack.imgur.com/H4Dy...
2018/12/17
[ "https://Stackoverflow.com/questions/53810436", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9560041/" ]
Here is how I implemented it in my case: ``` onSelectFile(event) { if (event.target.files && event.target.files[0]) { var reader = new FileReader(); reader.readAsDataURL(event.target.files[0]); // read file as data url reader.onload = (event) => { // called once readAsDataURL is completed ...
``` <html> <head> <style> #preview { background: red; border: 1px solid green; } </style> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script src="http://jcrop-cdn.tapmodo.com/v0.9.12/js/jquery.Jcrop.min.js"></script> <link rel="styles...
53,810,436
``` <asp:TextBox ID="questionTb" runat="server" Height="160px" TextMode="MultiLine" Rows="10" MaxLength="2" Width="100%" OnTextChanged="questionTb_TextChanged"></asp:TextBox> ``` The above given code segment provides an output which is mentioned below. [![enter image description here](https://i.stack.imgur.com/H4Dy...
2018/12/17
[ "https://Stackoverflow.com/questions/53810436", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9560041/" ]
Here is how I implemented it in my case: ``` onSelectFile(event) { if (event.target.files && event.target.files[0]) { var reader = new FileReader(); reader.readAsDataURL(event.target.files[0]); // read file as data url reader.onload = (event) => { // called once readAsDataURL is completed ...
```js // Set constraints for the video stream var constraints = { video: { facingMode: "user" }, audio: false }; // Define constants const cameraView = document.querySelector("#camera--view"), cameraOutput = document.querySelector("#camera--output"), cameraSensor = document.querySelector("#camera--sensor")...
53,810,436
``` <asp:TextBox ID="questionTb" runat="server" Height="160px" TextMode="MultiLine" Rows="10" MaxLength="2" Width="100%" OnTextChanged="questionTb_TextChanged"></asp:TextBox> ``` The above given code segment provides an output which is mentioned below. [![enter image description here](https://i.stack.imgur.com/H4Dy...
2018/12/17
[ "https://Stackoverflow.com/questions/53810436", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9560041/" ]
I'm a bit late to the party on this one, but I was facing a very similar issue myself yesterday, but instead using NodeJS. My solution in the end was to break down the image into its RGBA values and check each row and column of the image to find where the image itself actually starts in comparison to the BG. In my ca...
``` <html> <head> <style> #preview { background: red; border: 1px solid green; } </style> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script src="http://jcrop-cdn.tapmodo.com/v0.9.12/js/jquery.Jcrop.min.js"></script> <link rel="styles...
53,810,436
``` <asp:TextBox ID="questionTb" runat="server" Height="160px" TextMode="MultiLine" Rows="10" MaxLength="2" Width="100%" OnTextChanged="questionTb_TextChanged"></asp:TextBox> ``` The above given code segment provides an output which is mentioned below. [![enter image description here](https://i.stack.imgur.com/H4Dy...
2018/12/17
[ "https://Stackoverflow.com/questions/53810436", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9560041/" ]
I'm a bit late to the party on this one, but I was facing a very similar issue myself yesterday, but instead using NodeJS. My solution in the end was to break down the image into its RGBA values and check each row and column of the image to find where the image itself actually starts in comparison to the BG. In my ca...
```js // Set constraints for the video stream var constraints = { video: { facingMode: "user" }, audio: false }; // Define constants const cameraView = document.querySelector("#camera--view"), cameraOutput = document.querySelector("#camera--output"), cameraSensor = document.querySelector("#camera--sensor")...
32,397,792
This question has been asked a couple of times, but no response has worked for me. I tried to add width and height to container div ``` <div style="height:900px;width:1024px;"> Mapa <div id="map" class="map"></div> </div> ``` Tried either to add the domListener Event to google maps object or just using jque...
2015/09/04
[ "https://Stackoverflow.com/questions/32397792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/137040/" ]
You should add css to map div. ``` <div style="height:900px;width:1024px;"> Mapa <div style="height:900px;width:1024px;" id="map" class="map"></div> </div> ```
As [@egvrcn 's answer](https://stackoverflow.com/a/32397840/622813). But why are you using `.each()` ? You want to use **multiple maps** ? **Yes ?** ``` function initialize() { $(".map").each(function () { var $this = $(this); // ... var map = new google.maps.Map($this[0], mapOptions); ...
29,764,589
I have a query like this, ``` select * from my_table where `status`='1' ORDER BY FIELD(city_id,548) ASC; ``` My purpose is to show all records from the table, but records with `city_id=548` should come first. Currently its showing all records but no desired sorting! Any ideas?
2015/04/21
[ "https://Stackoverflow.com/questions/29764589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2775597/" ]
Actually it is working but you need to change it to `DESC` because `FIELD()` returns the `index` of the value in the parameter. Other than `FIELD()` which accepts multiple parameters, you can alternatively use `=` if you only have one condition. ``` ORDER BY (city_id = 548) DESC ``` when `city_id = 548` is `true`,...
Try like this descending order in sql is denoted by `DESC` keyword I think other values are smaller than 548 that's why it's not work as you expect ``` select * from my_table where `status`='1' ORDER BY FIELD(city_id,548) DESC; ```
36,832,529
In an online course, Kyle Simpson says the following code demonstrates the necessity of hoisting in javascript, because without hoisting "one of the functions would always be declared too late." ``` a(1) // 39 function a(foo){ if (foo > 20) return foo return b(foo+2) } function b(foo){ return c(foo) + 1 } ...
2016/04/25
[ "https://Stackoverflow.com/questions/36832529", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5351022/" ]
Convenience and placement of invocation aside, there are not any situations that require hoisting. Just make sure to declare all the functions before using them. Note: In some browser, `function a(){}` creates a function with name `a` while `var a = function(){}` does not (considered anonymous function). The functio...
The second block of code works fine because you are invoking `a(1)` after all the functions are initialized. Try the following block: ```js var a = function(foo){ if (foo > 20) return foo return b(foo+2) } var b = function(foo){ return c(foo) + 1 } a(1); var c = function(foo){ return a(foo*2) }...
36,832,529
In an online course, Kyle Simpson says the following code demonstrates the necessity of hoisting in javascript, because without hoisting "one of the functions would always be declared too late." ``` a(1) // 39 function a(foo){ if (foo > 20) return foo return b(foo+2) } function b(foo){ return c(foo) + 1 } ...
2016/04/25
[ "https://Stackoverflow.com/questions/36832529", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5351022/" ]
The claim I've made about a non-hoisted JS being unable to support mutual recursion is just conjecture for illustration purposes. It's designed to help understand the need for the language to know about variables available in the scope(s). It's not a prescription for exact language behavior. A language feature like ho...
The second block of code works fine because you are invoking `a(1)` after all the functions are initialized. Try the following block: ```js var a = function(foo){ if (foo > 20) return foo return b(foo+2) } var b = function(foo){ return c(foo) + 1 } a(1); var c = function(foo){ return a(foo*2) }...
36,832,529
In an online course, Kyle Simpson says the following code demonstrates the necessity of hoisting in javascript, because without hoisting "one of the functions would always be declared too late." ``` a(1) // 39 function a(foo){ if (foo > 20) return foo return b(foo+2) } function b(foo){ return c(foo) + 1 } ...
2016/04/25
[ "https://Stackoverflow.com/questions/36832529", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5351022/" ]
The claim I've made about a non-hoisted JS being unable to support mutual recursion is just conjecture for illustration purposes. It's designed to help understand the need for the language to know about variables available in the scope(s). It's not a prescription for exact language behavior. A language feature like ho...
Convenience and placement of invocation aside, there are not any situations that require hoisting. Just make sure to declare all the functions before using them. Note: In some browser, `function a(){}` creates a function with name `a` while `var a = function(){}` does not (considered anonymous function). The functio...
7,206
I am following this [link](https://souptacular.gitbooks.io/ethereum-tutorials-and-tips-by-hudson/content/private-chain.html) to make private Ethereum Chain.But running ``` geth --identity "Prashant" --genesis CustomGenesis.json --rpc --rpcport "8000" --rpccorsdomain "*" --datadir "chaindata" --port "30303" --nodiscove...
2016/07/19
[ "https://ethereum.stackexchange.com/questions/7206", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/3446/" ]
The most likely reason why you are getting this error is because the `--genesis` parameter is now deprecated and has been replaced with an `init` parameter. See [geth init, what are the arguments?](https://ethereum.stackexchange.com/questions/2641/geth-init-what-are-the-arguments) for details on how to use the `init` ...
The error i am able to reproduce is, ``` #################################################################### # # # --genesis is deprecated. Switch to use 'geth init /path/to/file' # # # ##...
253
How do I write an Arduino sketch and an Android application to talk to each other over a standard USB cable?
2014/02/16
[ "https://arduino.stackexchange.com/questions/253", "https://arduino.stackexchange.com", "https://arduino.stackexchange.com/users/186/" ]
Android devices usually don't have a USB host: they expect to be connected to some smarter device like your computer. Same goes with Arduino. For this reason Arduino made the [Mega ADK](http://arduino.cc/en/Main/ArduinoBoardADK) (that means [Accessory Development Kit](https://developer.android.com/tools/adk/index.html)...
The USB protocol requires one end to be a "host" and the other end to be a "peripheral", and it doesn't work if the devices at both ends of the cable are "peripherals". Alas, most Arduinos and many early Android devices are "peripherals", so connecting such devices with a standard USB cable doesn't work. Some modern A...
253
How do I write an Arduino sketch and an Android application to talk to each other over a standard USB cable?
2014/02/16
[ "https://arduino.stackexchange.com/questions/253", "https://arduino.stackexchange.com", "https://arduino.stackexchange.com/users/186/" ]
Android devices usually don't have a USB host: they expect to be connected to some smarter device like your computer. Same goes with Arduino. For this reason Arduino made the [Mega ADK](http://arduino.cc/en/Main/ArduinoBoardADK) (that means [Accessory Development Kit](https://developer.android.com/tools/adk/index.html)...
Processing is a great place to get started with device to device communication. The interface and language are very similar to Arduino and there are many examples to get you started. <http://playground.arduino.cc/Interfacing/Processing>
253
How do I write an Arduino sketch and an Android application to talk to each other over a standard USB cable?
2014/02/16
[ "https://arduino.stackexchange.com/questions/253", "https://arduino.stackexchange.com", "https://arduino.stackexchange.com/users/186/" ]
Android devices usually don't have a USB host: they expect to be connected to some smarter device like your computer. Same goes with Arduino. For this reason Arduino made the [Mega ADK](http://arduino.cc/en/Main/ArduinoBoardADK) (that means [Accessory Development Kit](https://developer.android.com/tools/adk/index.html)...
You never mentioned your tablet model... or Arduino model --------------------------------------------------------- There are some tablets designed to work with USB flash drives and printers. This is called OTG (on the go. **You need:** * A tablet supporting OTG * An OTG adapter that fits into your tablets USB slot ...
253
How do I write an Arduino sketch and an Android application to talk to each other over a standard USB cable?
2014/02/16
[ "https://arduino.stackexchange.com/questions/253", "https://arduino.stackexchange.com", "https://arduino.stackexchange.com/users/186/" ]
Android devices usually don't have a USB host: they expect to be connected to some smarter device like your computer. Same goes with Arduino. For this reason Arduino made the [Mega ADK](http://arduino.cc/en/Main/ArduinoBoardADK) (that means [Accessory Development Kit](https://developer.android.com/tools/adk/index.html)...
You can connect Android and Arduino with usb and use the easy tool App inventor 2 for android Did you try this new application : <https://play.google.com/store/apps/details?id=bp.usbbridge.appinvDemo> and full version : <https://play.google.com/store/apps/details?id=bp.usbbridge.appinv> Find Videos about Explication...
253
How do I write an Arduino sketch and an Android application to talk to each other over a standard USB cable?
2014/02/16
[ "https://arduino.stackexchange.com/questions/253", "https://arduino.stackexchange.com", "https://arduino.stackexchange.com/users/186/" ]
The USB protocol requires one end to be a "host" and the other end to be a "peripheral", and it doesn't work if the devices at both ends of the cable are "peripherals". Alas, most Arduinos and many early Android devices are "peripherals", so connecting such devices with a standard USB cable doesn't work. Some modern A...
You can connect Android and Arduino with usb and use the easy tool App inventor 2 for android Did you try this new application : <https://play.google.com/store/apps/details?id=bp.usbbridge.appinvDemo> and full version : <https://play.google.com/store/apps/details?id=bp.usbbridge.appinv> Find Videos about Explication...
253
How do I write an Arduino sketch and an Android application to talk to each other over a standard USB cable?
2014/02/16
[ "https://arduino.stackexchange.com/questions/253", "https://arduino.stackexchange.com", "https://arduino.stackexchange.com/users/186/" ]
Processing is a great place to get started with device to device communication. The interface and language are very similar to Arduino and there are many examples to get you started. <http://playground.arduino.cc/Interfacing/Processing>
You can connect Android and Arduino with usb and use the easy tool App inventor 2 for android Did you try this new application : <https://play.google.com/store/apps/details?id=bp.usbbridge.appinvDemo> and full version : <https://play.google.com/store/apps/details?id=bp.usbbridge.appinv> Find Videos about Explication...
253
How do I write an Arduino sketch and an Android application to talk to each other over a standard USB cable?
2014/02/16
[ "https://arduino.stackexchange.com/questions/253", "https://arduino.stackexchange.com", "https://arduino.stackexchange.com/users/186/" ]
You never mentioned your tablet model... or Arduino model --------------------------------------------------------- There are some tablets designed to work with USB flash drives and printers. This is called OTG (on the go. **You need:** * A tablet supporting OTG * An OTG adapter that fits into your tablets USB slot ...
You can connect Android and Arduino with usb and use the easy tool App inventor 2 for android Did you try this new application : <https://play.google.com/store/apps/details?id=bp.usbbridge.appinvDemo> and full version : <https://play.google.com/store/apps/details?id=bp.usbbridge.appinv> Find Videos about Explication...
11,491,203
When you have optional arguments that can have different types, which value is most suited to point out that the argument should not be taken into consideration? False or Null?
2012/07/15
[ "https://Stackoverflow.com/questions/11491203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/376947/" ]
`null` is the value used to represent "no value", whereas `false` means "no", "bad", "unsuccessful", "don't" etc. Therefore: `null`.
For optional arguments use `null` (generally). Use null, if you need to differentiate between boolean values (`true`/`false`) and nothing (`null`). On the other hand if you don't need to check for not-set argument and you are using boolean variable then I'd go for `false`.
11,491,203
When you have optional arguments that can have different types, which value is most suited to point out that the argument should not be taken into consideration? False or Null?
2012/07/15
[ "https://Stackoverflow.com/questions/11491203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/376947/" ]
For me this depends on what I'm going to do with the value of said argument... I am writing a database function where I can have default values as NULL ``` function somedbfunc($id = NULL, $column1 = NULL) ``` If these values are null my function may insert a blank record.. If I need to stop my function because of ...
For optional arguments use `null` (generally). Use null, if you need to differentiate between boolean values (`true`/`false`) and nothing (`null`). On the other hand if you don't need to check for not-set argument and you are using boolean variable then I'd go for `false`.
11,491,203
When you have optional arguments that can have different types, which value is most suited to point out that the argument should not be taken into consideration? False or Null?
2012/07/15
[ "https://Stackoverflow.com/questions/11491203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/376947/" ]
For optional arguments use `null` (generally). Use null, if you need to differentiate between boolean values (`true`/`false`) and nothing (`null`). On the other hand if you don't need to check for not-set argument and you are using boolean variable then I'd go for `false`.
As you are saying that you want to tell the "optional arguments" "not be taken into consideration", I will go for `null`. `False` is explicitly saying "no" to the recipient. which is a valid input.
11,491,203
When you have optional arguments that can have different types, which value is most suited to point out that the argument should not be taken into consideration? False or Null?
2012/07/15
[ "https://Stackoverflow.com/questions/11491203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/376947/" ]
`null` is the value used to represent "no value", whereas `false` means "no", "bad", "unsuccessful", "don't" etc. Therefore: `null`.
As you are saying that you want to tell the "optional arguments" "not be taken into consideration", I will go for `null`. `False` is explicitly saying "no" to the recipient. which is a valid input.
11,491,203
When you have optional arguments that can have different types, which value is most suited to point out that the argument should not be taken into consideration? False or Null?
2012/07/15
[ "https://Stackoverflow.com/questions/11491203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/376947/" ]
For me this depends on what I'm going to do with the value of said argument... I am writing a database function where I can have default values as NULL ``` function somedbfunc($id = NULL, $column1 = NULL) ``` If these values are null my function may insert a blank record.. If I need to stop my function because of ...
As you are saying that you want to tell the "optional arguments" "not be taken into consideration", I will go for `null`. `False` is explicitly saying "no" to the recipient. which is a valid input.
243,584
So, as the title says, what's the difference between **"lead in"** and **"lead to"**, as can be seen in this example taken from the novel *The Name of The Rose*: > > "Thus it happened that we turned westward... almost following the line of mountains that from Pisa **leads in** the direction of the pilgrim's way **to*...
2020/04/04
[ "https://ell.stackexchange.com/questions/243584", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/62054/" ]
This use of "lead" is followed by a direction/path, which could be a variety of prepositional phrases: * All roads lead **to Rome**. * All roads lead **from Rome**. * All roads lead **in that direction**. * All roads lead **over the hills**. etc.
"lead in" almost always comes before "the direction of" and it implies a future-tense state, as in > > This road will lead in the direction of- > > > **Note**: the proper past tense version of "Lead" is "Led" "Led to" implies a consequence of action, such as > > "Robbing that bank led to my time in prison" > ...
243,584
So, as the title says, what's the difference between **"lead in"** and **"lead to"**, as can be seen in this example taken from the novel *The Name of The Rose*: > > "Thus it happened that we turned westward... almost following the line of mountains that from Pisa **leads in** the direction of the pilgrim's way **to*...
2020/04/04
[ "https://ell.stackexchange.com/questions/243584", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/62054/" ]
The Name of the Rose by Umberto Eco was translated by a great translator. It is old fashioned on purpose. * In modern English, the from Pisa would be move: almost following the line of mountains that leads from Pisa in the direction of the pilgrim's way to Santiago. **|in the direction of the pilgrim's way] is one ph...
"lead in" almost always comes before "the direction of" and it implies a future-tense state, as in > > This road will lead in the direction of- > > > **Note**: the proper past tense version of "Lead" is "Led" "Led to" implies a consequence of action, such as > > "Robbing that bank led to my time in prison" > ...
243,584
So, as the title says, what's the difference between **"lead in"** and **"lead to"**, as can be seen in this example taken from the novel *The Name of The Rose*: > > "Thus it happened that we turned westward... almost following the line of mountains that from Pisa **leads in** the direction of the pilgrim's way **to*...
2020/04/04
[ "https://ell.stackexchange.com/questions/243584", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/62054/" ]
This use of "lead" is followed by a direction/path, which could be a variety of prepositional phrases: * All roads lead **to Rome**. * All roads lead **from Rome**. * All roads lead **in that direction**. * All roads lead **over the hills**. etc.
The Name of the Rose by Umberto Eco was translated by a great translator. It is old fashioned on purpose. * In modern English, the from Pisa would be move: almost following the line of mountains that leads from Pisa in the direction of the pilgrim's way to Santiago. **|in the direction of the pilgrim's way] is one ph...
6,159,224
So I read through [this](https://stackoverflow.com/questions/680021/is-it-possible-to-stop-execution-in-javascript-jquery) a bit, and it looks like JavaScript functions can't be explicitly killed off mid-run. What if I have a global variable, `window.currentlyProcessing` that manages this. ``` function contentsChanged...
2011/05/28
[ "https://Stackoverflow.com/questions/6159224", "https://Stackoverflow.com", "https://Stackoverflow.com/users/239879/" ]
Javascript is single threaded - one function is executed at a time, the function will never "run over itself" to begin with. `contentsChanged` will get called, will execute until the end, then any other stuff will happen.
That would prevent the logic from running if it's already running. If that's what you need to do, it should work.
61,406
This debate first started a decade ago but I want to modernize it. The reasons people wanted to be pilots. (I cant find a single reason why someone would want to become an ATC) * They watched Top Gun etc. and decided to be pilots. * Their grandparents were WW2 Veterans which fascinated them with war stories. * They s...
2019/03/20
[ "https://aviation.stackexchange.com/questions/61406", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/26701/" ]
I believe the information that you are looking for can be found in this [AOPA Report.](http://download.aopa.org/hr/Report_on_General_Aviation_Trends.pdf) Basically aviation is on a rebound. The report compares available data from 2015 to 2017 and the amount of pilot certificates being issued in the Private, Commercial,...
Not according to Boeing. They see a need for over 40,000+ new aircraft over the next 20 years. Ranting aside, it might be a good idea to think about why someone would want to be a PROFESSIONAL pilot. Maybe a little more than movies and grandpa's stories. Maybe a little more like a commitment to a career. If you are a...
66,387,405
``` String[] testing = new String[]{"Hat", "Cat", "Bear", "Tiger", "Bird"}; ``` Using the array above and **generating it in a random order**, I'm trying to check each String to the other, and if any are the same, then checking goes up by 1. Ex: if testing[0] == testing[1], checking++, if not, test[0] == test[2] and...
2021/02/26
[ "https://Stackoverflow.com/questions/66387405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13860442/" ]
you could also use printf, so you don't need to create other function for converting the number. ``` int i = 64; char c = 'a'; printf("number to ascii corresponding to %d is %c\n", i, i); printf("ascii to number corresponding to %c is %d\n", c, c); ``` the output is gonna be ``` number to ascii corresponding to 64...
```cpp #include <iostream> using namespace std; char toChar(int n) { if (n > 127 || n < 0) return 0; return (char)n; } int toInt(char c) { return (int)c; } int main() { int number = 97; cout << "char corresponding to number " << number << " is '" << toChar(number) << "'\n"; char ca...
66,387,405
``` String[] testing = new String[]{"Hat", "Cat", "Bear", "Tiger", "Bird"}; ``` Using the array above and **generating it in a random order**, I'm trying to check each String to the other, and if any are the same, then checking goes up by 1. Ex: if testing[0] == testing[1], checking++, if not, test[0] == test[2] and...
2021/02/26
[ "https://Stackoverflow.com/questions/66387405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13860442/" ]
Thank You very much Guys, I have done it with shorter and working code. ``` #include <iostream> using namespace std; int main(){ int a=68; cout<<char(a); char c='D'; cout<<int(c); return 0; } ```
```cpp #include <iostream> using namespace std; char toChar(int n) { if (n > 127 || n < 0) return 0; return (char)n; } int toInt(char c) { return (int)c; } int main() { int number = 97; cout << "char corresponding to number " << number << " is '" << toChar(number) << "'\n"; char ca...
66,387,405
``` String[] testing = new String[]{"Hat", "Cat", "Bear", "Tiger", "Bird"}; ``` Using the array above and **generating it in a random order**, I'm trying to check each String to the other, and if any are the same, then checking goes up by 1. Ex: if testing[0] == testing[1], checking++, if not, test[0] == test[2] and...
2021/02/26
[ "https://Stackoverflow.com/questions/66387405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13860442/" ]
you could also use printf, so you don't need to create other function for converting the number. ``` int i = 64; char c = 'a'; printf("number to ascii corresponding to %d is %c\n", i, i); printf("ascii to number corresponding to %c is %d\n", c, c); ``` the output is gonna be ``` number to ascii corresponding to 64...
May be you could start with the code below. If this is incomplete, could you please complete your question with test cases? ``` #include <iostream> using namespace std; char toChar(int n) { //you should test here the number shall be ranging from 0 to 127 return (char)n; } int toInt(char c) { return (int)c...
66,387,405
``` String[] testing = new String[]{"Hat", "Cat", "Bear", "Tiger", "Bird"}; ``` Using the array above and **generating it in a random order**, I'm trying to check each String to the other, and if any are the same, then checking goes up by 1. Ex: if testing[0] == testing[1], checking++, if not, test[0] == test[2] and...
2021/02/26
[ "https://Stackoverflow.com/questions/66387405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13860442/" ]
Thank You very much Guys, I have done it with shorter and working code. ``` #include <iostream> using namespace std; int main(){ int a=68; cout<<char(a); char c='D'; cout<<int(c); return 0; } ```
May be you could start with the code below. If this is incomplete, could you please complete your question with test cases? ``` #include <iostream> using namespace std; char toChar(int n) { //you should test here the number shall be ranging from 0 to 127 return (char)n; } int toInt(char c) { return (int)c...
3,963,272
Does this `regex` have one or two groups? I'm trying to access the `bookTitle` using the second group but getting an error: ``` Pattern pattern = Pattern.compile("^\\s*(.*?)\\s+-\\s+'(.*)'\\s*$"); Matcher matcher = pattern.matcher("William Faulkner - 'Light In August'"); String author = matcher.group(1).trim(); Strin...
2010/10/18
[ "https://Stackoverflow.com/questions/3963272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/313347/" ]
There are TWO groups but the error is because nothing is being done with the matcher. There is a IllegalStateException being thrown when trying to get the first group at `matcher.group(1)`. One of the methods `matches`, `lookingAt` or `find` must be called. This should do: ``` Pattern pattern = Pattern.compi...
Two groups -- `'` is not a special character in regexes. What is the error you're getting? Also, they **ARE NOT** zero-based. From the javadoc: > > Group zero denotes the entire pattern, > so the expression m.group(0) is > equivalent to m.group(). > > >
3,963,272
Does this `regex` have one or two groups? I'm trying to access the `bookTitle` using the second group but getting an error: ``` Pattern pattern = Pattern.compile("^\\s*(.*?)\\s+-\\s+'(.*)'\\s*$"); Matcher matcher = pattern.matcher("William Faulkner - 'Light In August'"); String author = matcher.group(1).trim(); Strin...
2010/10/18
[ "https://Stackoverflow.com/questions/3963272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/313347/" ]
Two groups -- `'` is not a special character in regexes. What is the error you're getting? Also, they **ARE NOT** zero-based. From the javadoc: > > Group zero denotes the entire pattern, > so the expression m.group(0) is > equivalent to m.group(). > > >
The problem is that the Matcher class seems to be lazy: it actually postpones the evaluation until the matches() method is called. Try this instead ``` Pattern pattern = Pattern.compile("^\\s*(.*)\\s+-\\s+'(.*)'\\s*$"); Matcher matcher = pattern.matcher("William Faulkner - 'Light In August'"); if (matcher.matches()) ...
3,963,272
Does this `regex` have one or two groups? I'm trying to access the `bookTitle` using the second group but getting an error: ``` Pattern pattern = Pattern.compile("^\\s*(.*?)\\s+-\\s+'(.*)'\\s*$"); Matcher matcher = pattern.matcher("William Faulkner - 'Light In August'"); String author = matcher.group(1).trim(); Strin...
2010/10/18
[ "https://Stackoverflow.com/questions/3963272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/313347/" ]
There are TWO groups but the error is because nothing is being done with the matcher. There is a IllegalStateException being thrown when trying to get the first group at `matcher.group(1)`. One of the methods `matches`, `lookingAt` or `find` must be called. This should do: ``` Pattern pattern = Pattern.compi...
Add one of following before you ask groups. ``` matcher.find(); matcher.maches(); ``` How this works: > > A matcher is created from a pattern by > invoking the pattern's matcher method. > Once created, a matcher can be used to > perform three different kinds of match > operations: > > > The **matches** met...
3,963,272
Does this `regex` have one or two groups? I'm trying to access the `bookTitle` using the second group but getting an error: ``` Pattern pattern = Pattern.compile("^\\s*(.*?)\\s+-\\s+'(.*)'\\s*$"); Matcher matcher = pattern.matcher("William Faulkner - 'Light In August'"); String author = matcher.group(1).trim(); Strin...
2010/10/18
[ "https://Stackoverflow.com/questions/3963272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/313347/" ]
Add one of following before you ask groups. ``` matcher.find(); matcher.maches(); ``` How this works: > > A matcher is created from a pattern by > invoking the pattern's matcher method. > Once created, a matcher can be used to > perform three different kinds of match > operations: > > > The **matches** met...
The problem is that the Matcher class seems to be lazy: it actually postpones the evaluation until the matches() method is called. Try this instead ``` Pattern pattern = Pattern.compile("^\\s*(.*)\\s+-\\s+'(.*)'\\s*$"); Matcher matcher = pattern.matcher("William Faulkner - 'Light In August'"); if (matcher.matches()) ...
3,963,272
Does this `regex` have one or two groups? I'm trying to access the `bookTitle` using the second group but getting an error: ``` Pattern pattern = Pattern.compile("^\\s*(.*?)\\s+-\\s+'(.*)'\\s*$"); Matcher matcher = pattern.matcher("William Faulkner - 'Light In August'"); String author = matcher.group(1).trim(); Strin...
2010/10/18
[ "https://Stackoverflow.com/questions/3963272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/313347/" ]
There are TWO groups but the error is because nothing is being done with the matcher. There is a IllegalStateException being thrown when trying to get the first group at `matcher.group(1)`. One of the methods `matches`, `lookingAt` or `find` must be called. This should do: ``` Pattern pattern = Pattern.compi...
The problem is that the Matcher class seems to be lazy: it actually postpones the evaluation until the matches() method is called. Try this instead ``` Pattern pattern = Pattern.compile("^\\s*(.*)\\s+-\\s+'(.*)'\\s*$"); Matcher matcher = pattern.matcher("William Faulkner - 'Light In August'"); if (matcher.matches()) ...
7,396,178
Im trying to store my data in an XML file using the XML Serialization. Question is, if my object has a collection member, can i serialize the collection as well? This is how my objects work. ``` class Project{ List<Iteration> } class Iteration{ List<Job> } class Job{ some other attributes } ``` So each project ha...
2011/09/13
[ "https://Stackoverflow.com/questions/7396178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/941680/" ]
I have used such a type of serialization before. If you have a simple application you can sometimes serialize your whole set of data from one root object (might be an antipattern somehow, but I know I have done it before). This should work with the default XML serializer in the XML.Serialization namespace, but you nee...
Have you considered using Json serialization instead? If you use something like Json.Net (available for Windows Phone 7), you should be able to serialize the entire object graph.
13,927,705
I am getting an error while writing a constructor which has some arguments to be passed. Searched previous threads but I am not getting it cleared. Here is my code : ``` #include<stdio.h> #include<iostream> #include<stdlib.h> using namespace std; int curr_state; //int signal[3],trans_in[7],trans_fin[7],trans_sig[7]...
2012/12/18
[ "https://Stackoverflow.com/questions/13927705", "https://Stackoverflow.com", "https://Stackoverflow.com/users/628116/" ]
The constructor for `state_machine` expects an `int trans[][10][10]`. This must be matched by the type of the `trans` array in main. You must change your main to ``` int main(int argc, char * argv[]) { int Q[5]={1,2,3,4,5}; int signals[3]={0,1,2}; int trans[][10][10]={{1,0,2},{1,1,0},{1,2,0},{2,0,3},{2,1,...
Your 3D arrays sizes that you specified needs to match **exactly**, which it does not. As the error says it is expecting `const int (*)[10][10]` if `int trans[][3][1]` became `int trans[][10][10]` this error will go away
13,927,705
I am getting an error while writing a constructor which has some arguments to be passed. Searched previous threads but I am not getting it cleared. Here is my code : ``` #include<stdio.h> #include<iostream> #include<stdlib.h> using namespace std; int curr_state; //int signal[3],trans_in[7],trans_fin[7],trans_sig[7]...
2012/12/18
[ "https://Stackoverflow.com/questions/13927705", "https://Stackoverflow.com", "https://Stackoverflow.com/users/628116/" ]
The constructor for `state_machine` expects an `int trans[][10][10]`. This must be matched by the type of the `trans` array in main. You must change your main to ``` int main(int argc, char * argv[]) { int Q[5]={1,2,3,4,5}; int signals[3]={0,1,2}; int trans[][10][10]={{1,0,2},{1,1,0},{1,2,0},{2,0,3},{2,1,...
First of all you cannot create `state_machine s;` as no body for ctor w/o parameters are available. Secondly, you need to call last line as `state_machine s(Q,signals,trans,start,end);` Thirdly, 3rd parameter passing for ctor is incorrect. for 3d array, indexes should match. make `int trans[][3][1]` to `int trans[][1...
22,524,921
I need same as I attached image file Its Camera Preview Screen : I want to design two transparent layout over framelayout so it looks like this, but when I run it show only camera screen(Framelayout). It not showing two relative layouts. ``` <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" ...
2014/03/20
[ "https://Stackoverflow.com/questions/22524921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1999595/" ]
Add ids to the two `RelativeLlayouts` in layout file.. and get the view object by like this ``` RelativeLayout layout1=(RelativeLayout) findViewById(R.id.topRelativeLayout); RelativeLayout layout2=(RelativeLayout) findViewById(R.id.bottomRelativeLayout); ``` and add this line in your onCreate and test once....
Try this first of all you have to set your background image to `FrameLayout`: ``` <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/camera_preview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" android...
24,662,089
I want to insert a record to a table called `Payment` which has column `ID` as the primary key(Auto Increment) and then I want to get that `ID` to use in a `WHERE` clause of another update statement. ``` var insertSatement = @"BEGIN INSERT INTO Payment (payment_type, reference, payment_date, total_records, total_amou...
2014/07/09
[ "https://Stackoverflow.com/questions/24662089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3364472/" ]
What you can also try is, change your statement like below ``` var insertSatement = @"BEGIN INSERT INTO Payment (payment_type, reference, payment_date, total_records, total_amount) VALUES(@type, @reference, @date, @totalRecords, @totalAmount ); SELECT CAST(scope_identity() AS int) "; ``` Then in your excecute non q...
You can use `SCOPE_IDENTITY` It will contain the latest value of the identity column from the newly inserted row <http://msdn.microsoft.com/en-us/library/ms190315.aspx>
16,376,138
I'm looking for the best way to preload images with jQuery. I tried using this code but it doesn't seem to work: ``` function preload(arrayOfImages) { $(arrayOfImages).each(function(){ $('<img/>')[0].src = this; // Alternatively you could use: // (new Image()).src = thi...
2013/05/04
[ "https://Stackoverflow.com/questions/16376138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Try it this way: ``` $.each( arrayOfImages, function( i, src ) { var img = new Image() img.src = src; img.load = function() { $("img[src=" + src + "]").fadeIn(); }; }); ```
Try this HTML ``` <div class="item"> <img src="placeholder.gif" data-src="img/lookbook_item1.jpg" alt="lookbook_item1" width="187" height="259"> </div> <div class="item"> <img src="placeholder.gif" data-src="img/lookbook_item2.jpg" alt="lookbook_item1" width="187" height="259"> </div> <div class="item"> <img sr...
138,908
How can I make a bash script executable by double clicking just like `.exe` files in Windows? I tried [creating a launcher and assigning the script to it](https://askubuntu.com/q/34597/24694), but there are two consequences: 1. the terminal twinkles, disappears, and nothing is done. 2. you must specify to run in termi...
2012/05/18
[ "https://askubuntu.com/questions/138908", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
You have to check 3 points : * Nautilus / Nemo configuration : <https://askubuntu.com/a/286651/301025> * The script file must be *executable*: <https://askubuntu.com/a/275714/301025> * The file system must allow *execution* : 1. Type `mount` in a console 2. Check if your file system has the `noexec` flag 3. Remove...
Specially for Android Studio You can follow my [original answer here](https://askubuntu.com/a/735658/410659): To Create Desktop Launcher: =========================== * Click on `Create Desktop Entry..` from **Tools** menu. [![enter image description here](https://i.stack.imgur.com/z0qpM.png)](https://i.stack.imgur.c...