qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
50,753,645
I am facing the following situation: I own a domain name, let's say example.com at name.com We have a website hosted at bluehost on a shared hosting with an IP1 We have an ERP (odoo) hosted at digitalocean on a droplet where Nginx is running and where IP2 is allocated. The erp is accesible via IP2:port\_number I am tr...
2018/06/08
[ "https://Stackoverflow.com/questions/50753645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5594353/" ]
How a form need be setup **0. Static design** Html markup should hold how the design is structured and laid out. Any permanent classes are to be applied directly in markup. **1. Constructor** Setup dependencies, like services, providers, configuration etc. These enable the component to manage itself along with inter...
ngOnChanges() is called whenever input bound properties of its component changes, it receives an object called SimpleChanges which contains changed and previous property. ngOnInit() is used to initialize things in a component,unlike ngOnChanges() it is called only once and after first ngOnChanges().
50,753,645
I am facing the following situation: I own a domain name, let's say example.com at name.com We have a website hosted at bluehost on a shared hosting with an IP1 We have an ERP (odoo) hosted at digitalocean on a droplet where Nginx is running and where IP2 is allocated. The erp is accesible via IP2:port\_number I am tr...
2018/06/08
[ "https://Stackoverflow.com/questions/50753645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5594353/" ]
ngOnInit and ngOnChanges are functions belonging to a component life-cycle method groups and they are executed in a different moment of our component (that's why name life-cycle). Here is a list of all of them: [![enter image description here](https://i.stack.imgur.com/JwzQ4.png)](https://i.stack.imgur.com/JwzQ4.png)
ngOnChanges() is called whenever input bound properties of its component changes, it receives an object called SimpleChanges which contains changed and previous property. ngOnInit() is used to initialize things in a component,unlike ngOnChanges() it is called only once and after first ngOnChanges().
50,753,645
I am facing the following situation: I own a domain name, let's say example.com at name.com We have a website hosted at bluehost on a shared hosting with an IP1 We have an ERP (odoo) hosted at digitalocean on a droplet where Nginx is running and where IP2 is allocated. The erp is accesible via IP2:port\_number I am tr...
2018/06/08
[ "https://Stackoverflow.com/questions/50753645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5594353/" ]
How a form need be setup **0. Static design** Html markup should hold how the design is structured and laid out. Any permanent classes are to be applied directly in markup. **1. Constructor** Setup dependencies, like services, providers, configuration etc. These enable the component to manage itself along with inter...
ngOnChanges will be called first on the life cycle hook when there is a change to the component inputs through the parent. ngOnInit will be called only once on initializing the component after the first ngOnChanges called.
50,753,645
I am facing the following situation: I own a domain name, let's say example.com at name.com We have a website hosted at bluehost on a shared hosting with an IP1 We have an ERP (odoo) hosted at digitalocean on a droplet where Nginx is running and where IP2 is allocated. The erp is accesible via IP2:port\_number I am tr...
2018/06/08
[ "https://Stackoverflow.com/questions/50753645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5594353/" ]
ngOnInit and ngOnChanges are functions belonging to a component life-cycle method groups and they are executed in a different moment of our component (that's why name life-cycle). Here is a list of all of them: [![enter image description here](https://i.stack.imgur.com/JwzQ4.png)](https://i.stack.imgur.com/JwzQ4.png)
ngOnChanges will be called first on the life cycle hook when there is a change to the component inputs through the parent. ngOnInit will be called only once on initializing the component after the first ngOnChanges called.
50,753,645
I am facing the following situation: I own a domain name, let's say example.com at name.com We have a website hosted at bluehost on a shared hosting with an IP1 We have an ERP (odoo) hosted at digitalocean on a droplet where Nginx is running and where IP2 is allocated. The erp is accesible via IP2:port\_number I am tr...
2018/06/08
[ "https://Stackoverflow.com/questions/50753645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5594353/" ]
How a form need be setup **0. Static design** Html markup should hold how the design is structured and laid out. Any permanent classes are to be applied directly in markup. **1. Constructor** Setup dependencies, like services, providers, configuration etc. These enable the component to manage itself along with inter...
ngOnInit and ngOnChanges are functions belonging to a component life-cycle method groups and they are executed in a different moment of our component (that's why name life-cycle). Here is a list of all of them: [![enter image description here](https://i.stack.imgur.com/JwzQ4.png)](https://i.stack.imgur.com/JwzQ4.png)
4,966,169
example: in abc[2] we find 3rd bit as set then , the actual bit number would be 8\*2+3 that is 19th bit is set!!! like that.
2011/02/11
[ "https://Stackoverflow.com/questions/4966169", "https://Stackoverflow.com", "https://Stackoverflow.com/users/591925/" ]
you can do a simple bit op check: ``` abc[i] & (1 << n) ``` that will be `0` if bit is not set and `(1 << n)` if it is set
This helps? ``` int l = sizeof(abc); int k = sizeof(*abc); int i, j; for (i = 0; i < l; ++i) { char n = abc[i]; for (j = 0; j < k; ++j) { if (n & 0x01) printf("Bit number %d is set.\n", (l*k)-i); n = n >> 1; } } ```
4,966,169
example: in abc[2] we find 3rd bit as set then , the actual bit number would be 8\*2+3 that is 19th bit is set!!! like that.
2011/02/11
[ "https://Stackoverflow.com/questions/4966169", "https://Stackoverflow.com", "https://Stackoverflow.com/users/591925/" ]
you can do a simple bit op check: ``` abc[i] & (1 << n) ``` that will be `0` if bit is not set and `(1 << n)` if it is set
When using GCC you can fasten your bitmap lookup using * [\_\_builtin\_ctzl(word)](http://gcc.gnu.org/onlinedocs/gcc-4.5.2/gcc/Other-Builtins.html#index-g_t_005f_005fbuiltin_005fctzl-3060 "__builtin_ctzl") to locate the first bit (low order) set in a uint32\_t * (((sizeof(word) \* 8) - 1) - [\_\_builtin\_clzl(word))](...
4,966,169
example: in abc[2] we find 3rd bit as set then , the actual bit number would be 8\*2+3 that is 19th bit is set!!! like that.
2011/02/11
[ "https://Stackoverflow.com/questions/4966169", "https://Stackoverflow.com", "https://Stackoverflow.com/users/591925/" ]
When using GCC you can fasten your bitmap lookup using * [\_\_builtin\_ctzl(word)](http://gcc.gnu.org/onlinedocs/gcc-4.5.2/gcc/Other-Builtins.html#index-g_t_005f_005fbuiltin_005fctzl-3060 "__builtin_ctzl") to locate the first bit (low order) set in a uint32\_t * (((sizeof(word) \* 8) - 1) - [\_\_builtin\_clzl(word))](...
This helps? ``` int l = sizeof(abc); int k = sizeof(*abc); int i, j; for (i = 0; i < l; ++i) { char n = abc[i]; for (j = 0; j < k; ++j) { if (n & 0x01) printf("Bit number %d is set.\n", (l*k)-i); n = n >> 1; } } ```
17,925,648
So I'm doing some refactoring and it's really annoying that I don't get all the errors up front. How can I either increase the limit or remove the limit, so that the compiler will output all the errors it can find?
2013/07/29
[ "https://Stackoverflow.com/questions/17925648", "https://Stackoverflow.com", "https://Stackoverflow.com/users/310121/" ]
So I found how to do it. You add this compiler flag: ``` -ferror-limit=0 ``` 0 means that it will not stop because of too many errors. This seems to be a question and answer that explains how to add a compiler flag in Xcode 4: [Xcode Project-Wide compiler flag](https://stackoverflow.com/questions/7932834/xcode-pro...
Preferences > General > [x] Continue Building After Errors [![image of preferences dialog](https://i.stack.imgur.com/JDaeN.png)](https://i.stack.imgur.com/JDaeN.png)
17,925,648
So I'm doing some refactoring and it's really annoying that I don't get all the errors up front. How can I either increase the limit or remove the limit, so that the compiler will output all the errors it can find?
2013/07/29
[ "https://Stackoverflow.com/questions/17925648", "https://Stackoverflow.com", "https://Stackoverflow.com/users/310121/" ]
So I found how to do it. You add this compiler flag: ``` -ferror-limit=0 ``` 0 means that it will not stop because of too many errors. This seems to be a question and answer that explains how to add a compiler flag in Xcode 4: [Xcode Project-Wide compiler flag](https://stackoverflow.com/questions/7932834/xcode-pro...
Here is the complete syntax to compile and pass the flags to the make command: ``` make install CFLAGS="-ferror-limit=0" ``` Also as outlined in the link below: <https://developer.apple.com/library/content/documentation/Porting/Conceptual/PortingUnix/compiling/compiling.html>
17,925,648
So I'm doing some refactoring and it's really annoying that I don't get all the errors up front. How can I either increase the limit or remove the limit, so that the compiler will output all the errors it can find?
2013/07/29
[ "https://Stackoverflow.com/questions/17925648", "https://Stackoverflow.com", "https://Stackoverflow.com/users/310121/" ]
Preferences > General > [x] Continue Building After Errors [![image of preferences dialog](https://i.stack.imgur.com/JDaeN.png)](https://i.stack.imgur.com/JDaeN.png)
Here is the complete syntax to compile and pass the flags to the make command: ``` make install CFLAGS="-ferror-limit=0" ``` Also as outlined in the link below: <https://developer.apple.com/library/content/documentation/Porting/Conceptual/PortingUnix/compiling/compiling.html>
6,160
**September update:** Community Ads are now live network-wide. All ads with a score of 6 or higher, or with a score of 4 or higher *and* no downvotes will be displayed (except for any that have a note from the CM Team explaining why it wasn't selected). Go to [the main post on MSE](https://meta.stackexchange.com/q/3645...
2021/06/17
[ "https://stats.meta.stackexchange.com/questions/6160", "https://stats.meta.stackexchange.com", "https://stats.meta.stackexchange.com/users/72321/" ]
Algorithms for automatic model selection [Algorithms for automatic model selection](https://stats.stackexchange.com/questions/20836) Ad size: right sidebar Site(s) to be displayed in: all
What are the shortcomings of the Mean Absolute Percentage Error (MAPE)? [What are the shortcomings of the Mean Absolute Percentage Error (MAPE)?](https://stats.stackexchange.com/questions/299712) Ad size: right sidebar Site(s) to be displayed in: all
6,160
**September update:** Community Ads are now live network-wide. All ads with a score of 6 or higher, or with a score of 4 or higher *and* no downvotes will be displayed (except for any that have a note from the CM Team explaining why it wasn't selected). Go to [the main post on MSE](https://meta.stackexchange.com/q/3645...
2021/06/17
[ "https://stats.meta.stackexchange.com/questions/6160", "https://stats.meta.stackexchange.com", "https://stats.meta.stackexchange.com/users/72321/" ]
[![Common topics on Matter Modeling SE](https://i.stack.imgur.com/GVzhj.png)](https://mattermodeling.stackexchange.com/)
How to find a good fit for semi-sinusoidal model in R? [How to find a good fit for semi-sinusoidal model in R?](https://stats.stackexchange.com/questions/60500) Ad size: right sidebar Site(s) to be displayed in: all
6,160
**September update:** Community Ads are now live network-wide. All ads with a score of 6 or higher, or with a score of 4 or higher *and* no downvotes will be displayed (except for any that have a note from the CM Team explaining why it wasn't selected). Go to [the main post on MSE](https://meta.stackexchange.com/q/3645...
2021/06/17
[ "https://stats.meta.stackexchange.com/questions/6160", "https://stats.meta.stackexchange.com", "https://stats.meta.stackexchange.com/users/72321/" ]
Why is accuracy not the best measure for assessing classification models? [Why is accuracy not the best measure for assessing classification models?](https://stats.stackexchange.com/questions/312780/) Ad size: right sidebar Site(s) to be displayed in: all
Can simple linear regression be done without using plots and linear algebra? [Can simple linear regression be done without using plots and linear algebra?](https://stats.stackexchange.com/questions/204930) Ad size: right sidebar Site(s) to be displayed in: all
6,160
**September update:** Community Ads are now live network-wide. All ads with a score of 6 or higher, or with a score of 4 or higher *and* no downvotes will be displayed (except for any that have a note from the CM Team explaining why it wasn't selected). Go to [the main post on MSE](https://meta.stackexchange.com/q/3645...
2021/06/17
[ "https://stats.meta.stackexchange.com/questions/6160", "https://stats.meta.stackexchange.com", "https://stats.meta.stackexchange.com/users/72321/" ]
When if ever is a median statistic a sufficient statistic? [When if ever is a median statistic a sufficient statistic?](https://stats.stackexchange.com/questions/122917) Ad size: right sidebar Site(s) to be displayed in: all
How to find a good fit for semi-sinusoidal model in R? [How to find a good fit for semi-sinusoidal model in R?](https://stats.stackexchange.com/questions/60500) Ad size: right sidebar Site(s) to be displayed in: all
6,160
**September update:** Community Ads are now live network-wide. All ads with a score of 6 or higher, or with a score of 4 or higher *and* no downvotes will be displayed (except for any that have a note from the CM Team explaining why it wasn't selected). Go to [the main post on MSE](https://meta.stackexchange.com/q/3645...
2021/06/17
[ "https://stats.meta.stackexchange.com/questions/6160", "https://stats.meta.stackexchange.com", "https://stats.meta.stackexchange.com/users/72321/" ]
What should I do when my neural network doesn't learn? [What should I do when my neural network doesn't learn?](https://stats.stackexchange.com/questions/352036) Ad size: right sidebar Site(s) to be displayed in: all
When to choose SARSA vs. Q Learning [When to choose SARSA vs. Q Learning](https://stats.stackexchange.com/questions/326788) Ad size: right sidebar Site(s) to be displayed in: all
6,160
**September update:** Community Ads are now live network-wide. All ads with a score of 6 or higher, or with a score of 4 or higher *and* no downvotes will be displayed (except for any that have a note from the CM Team explaining why it wasn't selected). Go to [the main post on MSE](https://meta.stackexchange.com/q/3645...
2021/06/17
[ "https://stats.meta.stackexchange.com/questions/6160", "https://stats.meta.stackexchange.com", "https://stats.meta.stackexchange.com/users/72321/" ]
Problems with pie charts [Problems with pie charts](https://stats.stackexchange.com/questions/8974) Ad size: right sidebar Site(s) to be displayed in: all
[![Common topics on Matter Modeling SE](https://i.stack.imgur.com/GVzhj.png)](https://mattermodeling.stackexchange.com/)
6,160
**September update:** Community Ads are now live network-wide. All ads with a score of 6 or higher, or with a score of 4 or higher *and* no downvotes will be displayed (except for any that have a note from the CM Team explaining why it wasn't selected). Go to [the main post on MSE](https://meta.stackexchange.com/q/3645...
2021/06/17
[ "https://stats.meta.stackexchange.com/questions/6160", "https://stats.meta.stackexchange.com", "https://stats.meta.stackexchange.com/users/72321/" ]
What should I do when my neural network doesn't learn? [What should I do when my neural network doesn't learn?](https://stats.stackexchange.com/questions/352036) Ad size: right sidebar Site(s) to be displayed in: all
Can simple linear regression be done without using plots and linear algebra? [Can simple linear regression be done without using plots and linear algebra?](https://stats.stackexchange.com/questions/204930) Ad size: right sidebar Site(s) to be displayed in: all
6,160
**September update:** Community Ads are now live network-wide. All ads with a score of 6 or higher, or with a score of 4 or higher *and* no downvotes will be displayed (except for any that have a note from the CM Team explaining why it wasn't selected). Go to [the main post on MSE](https://meta.stackexchange.com/q/3645...
2021/06/17
[ "https://stats.meta.stackexchange.com/questions/6160", "https://stats.meta.stackexchange.com", "https://stats.meta.stackexchange.com/users/72321/" ]
[![Need Data? Open Data Stack Exchange](https://i.stack.imgur.com/wqiQI.png)](http://opendata.stackexchange.com/)
Can simple linear regression be done without using plots and linear algebra? [Can simple linear regression be done without using plots and linear algebra?](https://stats.stackexchange.com/questions/204930) Ad size: right sidebar Site(s) to be displayed in: all
6,160
**September update:** Community Ads are now live network-wide. All ads with a score of 6 or higher, or with a score of 4 or higher *and* no downvotes will be displayed (except for any that have a note from the CM Team explaining why it wasn't selected). Go to [the main post on MSE](https://meta.stackexchange.com/q/3645...
2021/06/17
[ "https://stats.meta.stackexchange.com/questions/6160", "https://stats.meta.stackexchange.com", "https://stats.meta.stackexchange.com/users/72321/" ]
Why is accuracy not the best measure for assessing classification models? [Why is accuracy not the best measure for assessing classification models?](https://stats.stackexchange.com/questions/312780/) Ad size: right sidebar Site(s) to be displayed in: all
Principled way of collapsing categorical variables with many levels? [Principled way of collapsing categorical variables with many levels?](https://stats.stackexchange.com/questions/146907) Ad size: right sidebar Site(s) to be displayed in: all
6,160
**September update:** Community Ads are now live network-wide. All ads with a score of 6 or higher, or with a score of 4 or higher *and* no downvotes will be displayed (except for any that have a note from the CM Team explaining why it wasn't selected). Go to [the main post on MSE](https://meta.stackexchange.com/q/3645...
2021/06/17
[ "https://stats.meta.stackexchange.com/questions/6160", "https://stats.meta.stackexchange.com", "https://stats.meta.stackexchange.com/users/72321/" ]
Why do we only see L1 and L2 regularization but not other norms? [Why do we only see $L\_1$ and $L\_2$ regularization but not other norms?](https://stats.stackexchange.com/questions/269298) Ad size: right sidebar Site(s) to be displayed in: all
Algorithms for automatic model selection [Algorithms for automatic model selection](https://stats.stackexchange.com/questions/20836) Ad size: right sidebar Site(s) to be displayed in: all
11,772,080
I am using Java 7, `NIO` package rather than `IO`, but JFileChooser uses `File` class to `getSelectedFile()`, but in NIO there is only `Path` class. How can I use `NIO` classes with `JFileChooser` ?
2012/08/02
[ "https://Stackoverflow.com/questions/11772080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/276660/" ]
``` Path path = selectedFile.toPath(); ```
try this : ``` File file = Paths.get(URI).toFile(); ```
11,772,080
I am using Java 7, `NIO` package rather than `IO`, but JFileChooser uses `File` class to `getSelectedFile()`, but in NIO there is only `Path` class. How can I use `NIO` classes with `JFileChooser` ?
2012/08/02
[ "https://Stackoverflow.com/questions/11772080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/276660/" ]
``` yourPath = yourJFileChooser.getSelectedFile().toPath(); ```
try this : ``` File file = Paths.get(URI).toFile(); ```
11,772,080
I am using Java 7, `NIO` package rather than `IO`, but JFileChooser uses `File` class to `getSelectedFile()`, but in NIO there is only `Path` class. How can I use `NIO` classes with `JFileChooser` ?
2012/08/02
[ "https://Stackoverflow.com/questions/11772080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/276660/" ]
``` Path path = selectedFile.toPath(); ```
``` yourPath = yourJFileChooser.getSelectedFile().toPath(); ```
74,577,761
I have a df with a column that some values are having `...` and some `..` and some are without dots. ``` Type range Mike 10..13 Ni 3..4 NANA 2...3 Gi 2 ``` desired output should look like this ``` Type range Mike 10 Mike 11 Mike 12 MIke 13 Ni 3 Ni 4 N...
2022/11/25
[ "https://Stackoverflow.com/questions/74577761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17561414/" ]
Parse str as list first and then [explode](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.explode.html): ``` import re def str_to_list(s): if not s: return [] nums = re.split('\.{2,3}', s) if len(nums) == 1: return nums return list(range(int(nums[0]), int(nums[1]) +...
An approach using [`numpy.arange`](https://numpy.org/doc/stable/reference/generated/numpy.arange.html) with [`pandas.DataFrame.explode`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.explode.html) : ``` out = ( df .assign(range= df["range"] ...
60,124,368
In get Number method. when I use Random() method android studio give me error message Cannot create an instance of an abstract class please tell me how to solve this error. ``` class MainActivityDataGenerator : ViewModel() { private lateinit var myRandomNumber : String fun getNumber(): String{ Log.i(T...
2020/02/08
[ "https://Stackoverflow.com/questions/60124368", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10852037/" ]
I guess it's the difference in import statement. If you want to use the Kotlin Random class then use like this. with below import. ``` import kotlin.random.Random //..... val random = Random(12) ``` if you want to use the Java one which you seems to then use it like this. ``` import java.util.* //..... va...
You need to provide a seed number to Random class to create an object. Here I modified your code and explained everything inside code with comments. ``` import android.util.Log import androidx.lifecycle.ViewModel import kotlin.random.Random class MainActivityDataGenerator : ViewModel() { private lateinit var myRa...
44,155,922
I have a map drawn in CorelDRAW that shows the location of some company assets. Each one in shown as a square on the map. My aim is to create an interactive version of the map, where the user can click on a square and be shown more information about the asset. CorelDRAW allows me to specify a name for each shape. Then...
2017/05/24
[ "https://Stackoverflow.com/questions/44155922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7962446/" ]
Be sure that your css rule for background is directly inside html file and not inside your css file which have to load too. ``` <app-root> <div style="background-image: url('')"></div> </app-root> ``` And if your image isn't too big, you can convert it to base64 on website like [this](https://www.base64-image.de...
I would recommend using ngSwitch [here](https://angular.io/docs/ts/latest/api/common/index/NgSwitch-directive.html) ``` <div [ngSwitch]='status'> <div *ngSwitchCase="'loading'"> <!-- all of the inline styles and massive SVG markup for my spinner --> </div> <div *ngSwitchCase="'active'"> </div> ...
44,155,922
I have a map drawn in CorelDRAW that shows the location of some company assets. Each one in shown as a square on the map. My aim is to create an interactive version of the map, where the user can click on a square and be shown more information about the asset. CorelDRAW allows me to specify a name for each shape. Then...
2017/05/24
[ "https://Stackoverflow.com/questions/44155922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7962446/" ]
Be sure that your css rule for background is directly inside html file and not inside your css file which have to load too. ``` <app-root> <div style="background-image: url('')"></div> </app-root> ``` And if your image isn't too big, you can convert it to base64 on website like [this](https://www.base64-image.de...
The part where the loading screen is taken care in my repo ``` constructor(private router: Router,private _loadingSvc: LoadingAnimateService) { router.events.subscribe((event: RouterEvent) => { this.navigationInterceptor(event); }); } // Shows and hides the loading spinner dur...
32,680,732
I tried send it by fileTransfer method: ``` let modelURL = NSBundle.mainBundle().URLForResource("my_app", withExtension: "momd")! WCSession.defaultSession().transferFile(modelURL, metadata:nil) ``` but I get error: > > Optional(Error Domain=WCErrorDomain Code=7008 "Invalid parameter passed to WatchConnectivity AP...
2015/09/20
[ "https://Stackoverflow.com/questions/32680732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1753184/" ]
You are trying to send the entire “momd” directory. The transfer file API of WatchConnectivity does not seem to support transferring directories, and is therefore returning an error in -session:didFinishFileTransfer:error: To resolve this problem you have a couple of options: 1. Serialize the momd directory into a si...
This is probably what you are looking for: `Watch Connectivity Framework` More Here: <https://developer.apple.com/library/prerelease/ios/documentation/WatchConnectivity/Reference/WatchConnectivity_framework/index.html> And here: <https://forums.developer.apple.com/thread/3927> Quoting from the **forums.developer.app...
6,590,117
``` Array ( [n] => Unover [i] => 250 ) Array ( [n] => Un [i] => 195 ) Array ( [n] => Iliad [i] => 110 ) ``` They are in the form of $arr['Unover']['i']. I'd like to sort them based on the i smallest to largest, can't figure how to do it without completely wrecking the array and no idea where ...
2011/07/05
[ "https://Stackoverflow.com/questions/6590117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/586712/" ]
[`Write-Debug`](http://technet.microsoft.com/en-us/library/dd347714.aspx) is designed for outputting simple messages when debug preferences are set in a particular [way](http://ss64.com/ps/write-debug.html). It takes only a string, not just anything like `Write-Host` does (and magically formats). You will have to forma...
Write-Debug: ``` Write-Debug [-Message] <string> [<CommonParameters>] ``` It expects a string. It is unable to convert a string array to a string as the error says. The reason why it expects a string is because it `writes debug messages to the console from a script or command.` Note that Write-Output and Write-Host...
6,590,117
``` Array ( [n] => Unover [i] => 250 ) Array ( [n] => Un [i] => 195 ) Array ( [n] => Iliad [i] => 110 ) ``` They are in the form of $arr['Unover']['i']. I'd like to sort them based on the i smallest to largest, can't figure how to do it without completely wrecking the array and no idea where ...
2011/07/05
[ "https://Stackoverflow.com/questions/6590117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/586712/" ]
If you want write-debug to handle each one separately: ``` [string[]]$test = @("test1", "test2", "test3") Write-Output $test test1 test2 test3 $DebugPreference = "Inquire" $test | Write-Debug DEBUG: test1 DEBUG: test2 DEBUG: test3 ```
[`Write-Debug`](http://technet.microsoft.com/en-us/library/dd347714.aspx) is designed for outputting simple messages when debug preferences are set in a particular [way](http://ss64.com/ps/write-debug.html). It takes only a string, not just anything like `Write-Host` does (and magically formats). You will have to forma...
6,590,117
``` Array ( [n] => Unover [i] => 250 ) Array ( [n] => Un [i] => 195 ) Array ( [n] => Iliad [i] => 110 ) ``` They are in the form of $arr['Unover']['i']. I'd like to sort them based on the i smallest to largest, can't figure how to do it without completely wrecking the array and no idea where ...
2011/07/05
[ "https://Stackoverflow.com/questions/6590117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/586712/" ]
I kept having the same problem, and none of the solutions I found above or anywhere else would work in the general case. For example, the first answer above works only because the array is an array of strings. If it's an array of anything else, that solution breaks, and Write-Debug will output the object type, and not ...
[`Write-Debug`](http://technet.microsoft.com/en-us/library/dd347714.aspx) is designed for outputting simple messages when debug preferences are set in a particular [way](http://ss64.com/ps/write-debug.html). It takes only a string, not just anything like `Write-Host` does (and magically formats). You will have to forma...
6,590,117
``` Array ( [n] => Unover [i] => 250 ) Array ( [n] => Un [i] => 195 ) Array ( [n] => Iliad [i] => 110 ) ``` They are in the form of $arr['Unover']['i']. I'd like to sort them based on the i smallest to largest, can't figure how to do it without completely wrecking the array and no idea where ...
2011/07/05
[ "https://Stackoverflow.com/questions/6590117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/586712/" ]
If you want write-debug to handle each one separately: ``` [string[]]$test = @("test1", "test2", "test3") Write-Output $test test1 test2 test3 $DebugPreference = "Inquire" $test | Write-Debug DEBUG: test1 DEBUG: test2 DEBUG: test3 ```
Write-Debug: ``` Write-Debug [-Message] <string> [<CommonParameters>] ``` It expects a string. It is unable to convert a string array to a string as the error says. The reason why it expects a string is because it `writes debug messages to the console from a script or command.` Note that Write-Output and Write-Host...
6,590,117
``` Array ( [n] => Unover [i] => 250 ) Array ( [n] => Un [i] => 195 ) Array ( [n] => Iliad [i] => 110 ) ``` They are in the form of $arr['Unover']['i']. I'd like to sort them based on the i smallest to largest, can't figure how to do it without completely wrecking the array and no idea where ...
2011/07/05
[ "https://Stackoverflow.com/questions/6590117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/586712/" ]
I kept having the same problem, and none of the solutions I found above or anywhere else would work in the general case. For example, the first answer above works only because the array is an array of strings. If it's an array of anything else, that solution breaks, and Write-Debug will output the object type, and not ...
Write-Debug: ``` Write-Debug [-Message] <string> [<CommonParameters>] ``` It expects a string. It is unable to convert a string array to a string as the error says. The reason why it expects a string is because it `writes debug messages to the console from a script or command.` Note that Write-Output and Write-Host...
6,590,117
``` Array ( [n] => Unover [i] => 250 ) Array ( [n] => Un [i] => 195 ) Array ( [n] => Iliad [i] => 110 ) ``` They are in the form of $arr['Unover']['i']. I'd like to sort them based on the i smallest to largest, can't figure how to do it without completely wrecking the array and no idea where ...
2011/07/05
[ "https://Stackoverflow.com/questions/6590117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/586712/" ]
I kept having the same problem, and none of the solutions I found above or anywhere else would work in the general case. For example, the first answer above works only because the array is an array of strings. If it's an array of anything else, that solution breaks, and Write-Debug will output the object type, and not ...
If you want write-debug to handle each one separately: ``` [string[]]$test = @("test1", "test2", "test3") Write-Output $test test1 test2 test3 $DebugPreference = "Inquire" $test | Write-Debug DEBUG: test1 DEBUG: test2 DEBUG: test3 ```
65,105,209
![Else is executed](https://i.stack.imgur.com/Px5Xg.png) the if else statement is not working for me
2020/12/02
[ "https://Stackoverflow.com/questions/65105209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14747792/" ]
``` print('Hello There') number=int(input('please provide a number')) if number%2==0: print ('even') else: print('odd') ``` Just read about the `modulus %`
`/` is the division operator. If you want to check for evenness vs oddness, you should be looking at the remainder, and using the module (`%`) operator: ```py if number % 2 == 0: print("even") else: print("odd") ```
44,868,612
I'm doing a project in MapReduce using Amazon Web Services and I'm having this error: > > FATAL [main] org.apache.hadoop.mapred.YarnChild: Error running child : > java.lang.StackOverflowError at > java.util.regex.Pattern$GroupHead.match(Pattern.java:4658) > > > I read a few other questions to understand why th...
2017/07/02
[ "https://Stackoverflow.com/questions/44868612", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5182830/" ]
Try this: ``` \s+(?=(?:(?:[^"]*"){2})*[^"]*$) ``` [Demo](https://regex101.com/r/fn1IoR/2/) ``` String string = "abc d<\\janhaeussler.com/?sioc_type=user &sioc_id=1/> \"HEY 1\" 2 3 <.org/1999/02/22-rdf-syntax-ns#type/> \"tra la\" <asdfadsf sadfasdf/> 4 \"sdf sdf\" 5 6"; String[] res=string.split("\\s+(?=(...
Don't use `split()`. Use a `find()` loop instead, with this regex: ```none (?:<[^<]*> | "[^"]*" | \S )+ ``` Example: ``` String input = "<\\janhaeussler.com/?sioc_type=user&sioc_id=1/> \"HEY\" <.org/1999/02/22-rdf-syntax-ns#type/>"; Pattern p = Pattern.compile("(?:<[^<]*>|\"[^\"]*\"|\\S)+"); for (Ma...
44,868,612
I'm doing a project in MapReduce using Amazon Web Services and I'm having this error: > > FATAL [main] org.apache.hadoop.mapred.YarnChild: Error running child : > java.lang.StackOverflowError at > java.util.regex.Pattern$GroupHead.match(Pattern.java:4658) > > > I read a few other questions to understand why th...
2017/07/02
[ "https://Stackoverflow.com/questions/44868612", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5182830/" ]
Try this: ``` \s+(?=(?:(?:[^"]*"){2})*[^"]*$) ``` [Demo](https://regex101.com/r/fn1IoR/2/) ``` String string = "abc d<\\janhaeussler.com/?sioc_type=user &sioc_id=1/> \"HEY 1\" 2 3 <.org/1999/02/22-rdf-syntax-ns#type/> \"tra la\" <asdfadsf sadfasdf/> 4 \"sdf sdf\" 5 6"; String[] res=string.split("\\s+(?=(...
You could try to match: tags OR what's between the double quotes OR the remaining non-whitespaces. ``` <[^>]+>|"[^"]+"|\S+ ``` For example: ``` String str = "<\\janhaeussler.com/?sioc_type=user&sioc_id=1/> \"HEY\" YOU! \"How Are You?\" <.org/1999/02/22-rdf-syntax-ns#type/>"; final java.util.regex.Pattern pattern =...
25,866,078
I am trying to read txt file using `RandomAccessFile` and `FileChannel` which contains large number of float / integer values, but at after the all conversations using `ByteBuffer` the values which I get as a result are not the same with the ones in txt file. Here is how I am doing it : ``` RandomAccessFile mR...
2014/09/16
[ "https://Stackoverflow.com/questions/25866078", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1511776/" ]
It is a text file, not a random access file. You should be reading with a `BufferedReader`. It´s got a `readLine()` that returns a String, and then you can just go with `Double.valueOf(String)`. There´s more code here [How to use Buffered Reader in Java](https://stackoverflow.com/questions/16265693/how-to-use-buffered...
Android-Developer again, i see you try the binary-file-approach... to do this you must convert your data Create a **new** Java-Project and use your original methods there to load the the values from a xml/text-file and convert it into floats... (yes, it will take some time then, but it provided valid data...) once yo...
51,886,330
In my project I have included a third-party bundle via composer containing multiple forms like: ``` namespace acme\ContactBundle\Form\Type; class PersonType extends AbstractType { /** * @param FormBuilderInterface $builder * @param array $options */ public function buildForm(FormBuilderInterfa...
2018/08/16
[ "https://Stackoverflow.com/questions/51886330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
That's is because you are using : `Dart version 2.1.0-dev.0.0.flutter-be6309690f` and the plugin named `flutter_circular_chart` has a `constraint` <https://github.com/xqwzts/flutter_circular_chart/blob/master/pubspec.yaml> ``` environment: sdk: '>=1.19.0 <2.0.0' ``` You can fork the project and update the sdk c...
Use devendency\_override with same version witch need for same for other dependency. Like google\_maps\_flutter: ^0.5.28+1 needs intl to be 0.16.0 then craete dependency\_overrides: intl: ^0.16.0 below of dev\_dependencies: flutter\_test: sdk: flutter run project until it not run on device. Enjoy. Thanks..
12,015,139
I'm having some cookie/oauth issues. What I'm trying to achieve is have a new tab open up, have the user go through google's oauth flow, and upon returning to the app they should be able to make requests to our api with the cookie they receive, but.. I have no idea how to save that cookie. If I go into chrome's inspect...
2012/08/18
[ "https://Stackoverflow.com/questions/12015139", "https://Stackoverflow.com", "https://Stackoverflow.com/users/434445/" ]
Why do you have to save it as a cookie? You have localStorage (or [forge.prefs](http://docs.trigger.io/en/v1.4/modules/prefs.html?highlight=prefs#prefs.set), but not sure how those work exactly). You're in a mobile app, so the security of localStorage isn't a worry.
I use angular-storage. It is perfect for storing the token. <https://github.com/auth0/angular-storage> To save your token after login: ``` store.set('jwt', data.token); store.set('user', jwtHelper.decodeToken(store.get('jwt'))); ``` Then to check if your token is valid: ``` .run(function($rootScope, ...
448,554
I use my AirPods Pro 2 for both my MacBook but also on another device. What I notice is that when my MacBook is asleep, but I take out my AirPods, it will cause my MacBook to wake up. I looked through the settings in my MacBook but I only see the basic bluetooth options for the AirPods. I can't seem to find a setting ...
2022/10/03
[ "https://apple.stackexchange.com/questions/448554", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/473526/" ]
As much as I love the shell, it’s unforgiving with wildcards and spaces in general and worse if your script gets to folders you didn’t expect. Your case of all within one folder and no recursion limits your risk to [script this cleanly](https://apple.stackexchange.com/a/448509/5472). To prepare, empty trash (so you ca...
In Terminal, `rm *\ 2.ext` should work. PS: To be sure that the correct files get deleted, run `ls *\ 2.ext` first, or use `rm -i *\ 2.ext` to be prompted for each file.
448,554
I use my AirPods Pro 2 for both my MacBook but also on another device. What I notice is that when my MacBook is asleep, but I take out my AirPods, it will cause my MacBook to wake up. I looked through the settings in my MacBook but I only see the basic bluetooth options for the AirPods. I can't seem to find a setting ...
2022/10/03
[ "https://apple.stackexchange.com/questions/448554", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/473526/" ]
[nohillside's answer](https://apple.stackexchange.com/a/448509) to use `rm *\ 2.ext` will work just fine, but if you want extra confidence it's doing the right thing, you can instead use ``` mkdir to_be_deleted mv -- *\ 2.ext to_be_deleted ``` That'll put all the files you want deleted in a separate folder - you can...
In Terminal, `rm *\ 2.ext` should work. PS: To be sure that the correct files get deleted, run `ls *\ 2.ext` first, or use `rm -i *\ 2.ext` to be prompted for each file.
448,554
I use my AirPods Pro 2 for both my MacBook but also on another device. What I notice is that when my MacBook is asleep, but I take out my AirPods, it will cause my MacBook to wake up. I looked through the settings in my MacBook but I only see the basic bluetooth options for the AirPods. I can't seem to find a setting ...
2022/10/03
[ "https://apple.stackexchange.com/questions/448554", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/473526/" ]
In Terminal, `rm *\ 2.ext` should work. PS: To be sure that the correct files get deleted, run `ls *\ 2.ext` first, or use `rm -i *\ 2.ext` to be prompted for each file.
As noted by others, there might be issues here with shell scripting depending on how the duplicates were made. You could theoretically avoid those by copying the folder and trying it first, but the only way to totally verify is if you went through them by hand which somewhat defeats the purpose. This is a Python file ...
448,554
I use my AirPods Pro 2 for both my MacBook but also on another device. What I notice is that when my MacBook is asleep, but I take out my AirPods, it will cause my MacBook to wake up. I looked through the settings in my MacBook but I only see the basic bluetooth options for the AirPods. I can't seem to find a setting ...
2022/10/03
[ "https://apple.stackexchange.com/questions/448554", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/473526/" ]
In Terminal, `rm *\ 2.ext` should work. PS: To be sure that the correct files get deleted, run `ls *\ 2.ext` first, or use `rm -i *\ 2.ext` to be prompted for each file.
A very unpopular opinion is to use a dedicated duplicate removal software rather than trying to mess up with terminal. Even if you are pro-terminal user you might end up deleting important files. There are few reasons. 1. Softwares are developed after succeeding a lot of cases. 2. They compare file content rather tha...
448,554
I use my AirPods Pro 2 for both my MacBook but also on another device. What I notice is that when my MacBook is asleep, but I take out my AirPods, it will cause my MacBook to wake up. I looked through the settings in my MacBook but I only see the basic bluetooth options for the AirPods. I can't seem to find a setting ...
2022/10/03
[ "https://apple.stackexchange.com/questions/448554", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/473526/" ]
As much as I love the shell, it’s unforgiving with wildcards and spaces in general and worse if your script gets to folders you didn’t expect. Your case of all within one folder and no recursion limits your risk to [script this cleanly](https://apple.stackexchange.com/a/448509/5472). To prepare, empty trash (so you ca...
[nohillside's answer](https://apple.stackexchange.com/a/448509) to use `rm *\ 2.ext` will work just fine, but if you want extra confidence it's doing the right thing, you can instead use ``` mkdir to_be_deleted mv -- *\ 2.ext to_be_deleted ``` That'll put all the files you want deleted in a separate folder - you can...
448,554
I use my AirPods Pro 2 for both my MacBook but also on another device. What I notice is that when my MacBook is asleep, but I take out my AirPods, it will cause my MacBook to wake up. I looked through the settings in my MacBook but I only see the basic bluetooth options for the AirPods. I can't seem to find a setting ...
2022/10/03
[ "https://apple.stackexchange.com/questions/448554", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/473526/" ]
As much as I love the shell, it’s unforgiving with wildcards and spaces in general and worse if your script gets to folders you didn’t expect. Your case of all within one folder and no recursion limits your risk to [script this cleanly](https://apple.stackexchange.com/a/448509/5472). To prepare, empty trash (so you ca...
As noted by others, there might be issues here with shell scripting depending on how the duplicates were made. You could theoretically avoid those by copying the folder and trying it first, but the only way to totally verify is if you went through them by hand which somewhat defeats the purpose. This is a Python file ...
448,554
I use my AirPods Pro 2 for both my MacBook but also on another device. What I notice is that when my MacBook is asleep, but I take out my AirPods, it will cause my MacBook to wake up. I looked through the settings in my MacBook but I only see the basic bluetooth options for the AirPods. I can't seem to find a setting ...
2022/10/03
[ "https://apple.stackexchange.com/questions/448554", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/473526/" ]
As much as I love the shell, it’s unforgiving with wildcards and spaces in general and worse if your script gets to folders you didn’t expect. Your case of all within one folder and no recursion limits your risk to [script this cleanly](https://apple.stackexchange.com/a/448509/5472). To prepare, empty trash (so you ca...
A very unpopular opinion is to use a dedicated duplicate removal software rather than trying to mess up with terminal. Even if you are pro-terminal user you might end up deleting important files. There are few reasons. 1. Softwares are developed after succeeding a lot of cases. 2. They compare file content rather tha...
448,554
I use my AirPods Pro 2 for both my MacBook but also on another device. What I notice is that when my MacBook is asleep, but I take out my AirPods, it will cause my MacBook to wake up. I looked through the settings in my MacBook but I only see the basic bluetooth options for the AirPods. I can't seem to find a setting ...
2022/10/03
[ "https://apple.stackexchange.com/questions/448554", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/473526/" ]
[nohillside's answer](https://apple.stackexchange.com/a/448509) to use `rm *\ 2.ext` will work just fine, but if you want extra confidence it's doing the right thing, you can instead use ``` mkdir to_be_deleted mv -- *\ 2.ext to_be_deleted ``` That'll put all the files you want deleted in a separate folder - you can...
As noted by others, there might be issues here with shell scripting depending on how the duplicates were made. You could theoretically avoid those by copying the folder and trying it first, but the only way to totally verify is if you went through them by hand which somewhat defeats the purpose. This is a Python file ...
448,554
I use my AirPods Pro 2 for both my MacBook but also on another device. What I notice is that when my MacBook is asleep, but I take out my AirPods, it will cause my MacBook to wake up. I looked through the settings in my MacBook but I only see the basic bluetooth options for the AirPods. I can't seem to find a setting ...
2022/10/03
[ "https://apple.stackexchange.com/questions/448554", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/473526/" ]
[nohillside's answer](https://apple.stackexchange.com/a/448509) to use `rm *\ 2.ext` will work just fine, but if you want extra confidence it's doing the right thing, you can instead use ``` mkdir to_be_deleted mv -- *\ 2.ext to_be_deleted ``` That'll put all the files you want deleted in a separate folder - you can...
A very unpopular opinion is to use a dedicated duplicate removal software rather than trying to mess up with terminal. Even if you are pro-terminal user you might end up deleting important files. There are few reasons. 1. Softwares are developed after succeeding a lot of cases. 2. They compare file content rather tha...
30,742,889
Can't figure out how to get this work: ``` //Have a tiny CustomServiceLoader implementation public class MyServiceLoader { static private Map<Class<?>, Class<?>> CONTENTS = new HashMap<>(); static public <S, T extends S> void registerClassForInterface(Class<T> c, Class<S> i) { if (c == null) { ...
2015/06/09
[ "https://Stackoverflow.com/questions/30742889", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1823351/" ]
You're using the raw type `Class`. ``` Class c = GiftdServiceLoader.getClassForInterface(APIAsyncLoaderTask.class); ``` All generatic types and generic type parameters in any method invoked on such a reference are erased. Parameterize it correctly ``` Class<APIAsyncLoaderTask> c = MyServiceLoader.getClassForInterf...
You have the raw form of the `Class` class in the preceding line: ``` Class c = GiftdServiceLoader.getClassForInterface(APIAsyncLoaderTask.class); ``` Therefore, the `newInstance()` method returns an `Object`, which can't be assigned to an `APIAsyncLoaderTask`. But coming out of a `Map<Class<?>, Class<?>>`, the bes...
8,069,236
This gives me seg fault 11 when I input the string. Why am i getting the seg fault? It's so simple... where is the seg fault coming from? ``` int main(){ char * str; printf ("please enter string : "); cin >> str; // reverse_str(str); } ```
2011/11/09
[ "https://Stackoverflow.com/questions/8069236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1038203/" ]
You have not allocated any memory to `str`. So you are trying to essentially write to a pointer which cannot hold the string. Essentially this leads to an Undefined Behavior and a seg fault. The solution is: You should use **[std::string](http://www.google.co.in/url?sa=t&rct=j&q=std::string&source=web&cd=1&ved=0CC...
Segmentation faults occur when a program accesses memory that doesn't belong to it. The pointer `str` is not initialized. It doesn't point at any memory. The stream-extraction operator `>>` doesn't allocate new memory for the string it reads; it expects the pointer to already point to a buffer that it can fill. It does...
8,069,236
This gives me seg fault 11 when I input the string. Why am i getting the seg fault? It's so simple... where is the seg fault coming from? ``` int main(){ char * str; printf ("please enter string : "); cin >> str; // reverse_str(str); } ```
2011/11/09
[ "https://Stackoverflow.com/questions/8069236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1038203/" ]
You should use `std::string` instead. Your declaration: ``` char * str; ``` declares only a pointer, but does not allocate a memory region for the string to be stored. The solutions could have been ``` char str[256]; ``` or ``` char * str = new char[256]; ``` However, they are *very* bad style because you wo...
Use `std::string`. Or, if you just want to use char \* (discouraged): ``` char * str = new char[256]; cin >> str; ```
8,069,236
This gives me seg fault 11 when I input the string. Why am i getting the seg fault? It's so simple... where is the seg fault coming from? ``` int main(){ char * str; printf ("please enter string : "); cin >> str; // reverse_str(str); } ```
2011/11/09
[ "https://Stackoverflow.com/questions/8069236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1038203/" ]
You should use `std::string` instead. Your declaration: ``` char * str; ``` declares only a pointer, but does not allocate a memory region for the string to be stored. The solutions could have been ``` char str[256]; ``` or ``` char * str = new char[256]; ``` However, they are *very* bad style because you wo...
You need to allocate memory first for `str`. You declared only a pointer ``` char* str = (char*)malloc(MAX_SIZE_OF_BUFFER); ```
8,069,236
This gives me seg fault 11 when I input the string. Why am i getting the seg fault? It's so simple... where is the seg fault coming from? ``` int main(){ char * str; printf ("please enter string : "); cin >> str; // reverse_str(str); } ```
2011/11/09
[ "https://Stackoverflow.com/questions/8069236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1038203/" ]
You have not allocated any memory to `str`. So you are trying to essentially write to a pointer which cannot hold the string. Essentially this leads to an Undefined Behavior and a seg fault. The solution is: You should use **[std::string](http://www.google.co.in/url?sa=t&rct=j&q=std::string&source=web&cd=1&ved=0CC...
You should use `std::string` instead. Your declaration: ``` char * str; ``` declares only a pointer, but does not allocate a memory region for the string to be stored. The solutions could have been ``` char str[256]; ``` or ``` char * str = new char[256]; ``` However, they are *very* bad style because you wo...
8,069,236
This gives me seg fault 11 when I input the string. Why am i getting the seg fault? It's so simple... where is the seg fault coming from? ``` int main(){ char * str; printf ("please enter string : "); cin >> str; // reverse_str(str); } ```
2011/11/09
[ "https://Stackoverflow.com/questions/8069236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1038203/" ]
You have not allocated any memory to `str`. So you are trying to essentially write to a pointer which cannot hold the string. Essentially this leads to an Undefined Behavior and a seg fault. The solution is: You should use **[std::string](http://www.google.co.in/url?sa=t&rct=j&q=std::string&source=web&cd=1&ved=0CC...
You need to allocate memory first for `str`. You declared only a pointer ``` char* str = (char*)malloc(MAX_SIZE_OF_BUFFER); ```
8,069,236
This gives me seg fault 11 when I input the string. Why am i getting the seg fault? It's so simple... where is the seg fault coming from? ``` int main(){ char * str; printf ("please enter string : "); cin >> str; // reverse_str(str); } ```
2011/11/09
[ "https://Stackoverflow.com/questions/8069236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1038203/" ]
You have not allocated any memory to `str`. So you are trying to essentially write to a pointer which cannot hold the string. Essentially this leads to an Undefined Behavior and a seg fault. The solution is: You should use **[std::string](http://www.google.co.in/url?sa=t&rct=j&q=std::string&source=web&cd=1&ved=0CC...
Use `std::string`. Or, if you just want to use char \* (discouraged): ``` char * str = new char[256]; cin >> str; ```
8,069,236
This gives me seg fault 11 when I input the string. Why am i getting the seg fault? It's so simple... where is the seg fault coming from? ``` int main(){ char * str; printf ("please enter string : "); cin >> str; // reverse_str(str); } ```
2011/11/09
[ "https://Stackoverflow.com/questions/8069236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1038203/" ]
`str` doesn't point to anything sensible. You need to have a memory to write to. ``` std::string str; std::cout << "please enter string: "; std::cin >> str; ```
Your first line, `char * str` declares a raw pointer and doesn't initialize it or allocate any memory. That means it could point anywhere, and most likely not somewhere valid or useful. You most likely segfault when you try to use it on the 3rd line. Can you use `std::string` instead? It'll be much easier and safer tha...
8,069,236
This gives me seg fault 11 when I input the string. Why am i getting the seg fault? It's so simple... where is the seg fault coming from? ``` int main(){ char * str; printf ("please enter string : "); cin >> str; // reverse_str(str); } ```
2011/11/09
[ "https://Stackoverflow.com/questions/8069236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1038203/" ]
You should use `std::string` instead. Your declaration: ``` char * str; ``` declares only a pointer, but does not allocate a memory region for the string to be stored. The solutions could have been ``` char str[256]; ``` or ``` char * str = new char[256]; ``` However, they are *very* bad style because you wo...
Your first line, `char * str` declares a raw pointer and doesn't initialize it or allocate any memory. That means it could point anywhere, and most likely not somewhere valid or useful. You most likely segfault when you try to use it on the 3rd line. Can you use `std::string` instead? It'll be much easier and safer tha...
8,069,236
This gives me seg fault 11 when I input the string. Why am i getting the seg fault? It's so simple... where is the seg fault coming from? ``` int main(){ char * str; printf ("please enter string : "); cin >> str; // reverse_str(str); } ```
2011/11/09
[ "https://Stackoverflow.com/questions/8069236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1038203/" ]
You should use `std::string` instead. Your declaration: ``` char * str; ``` declares only a pointer, but does not allocate a memory region for the string to be stored. The solutions could have been ``` char str[256]; ``` or ``` char * str = new char[256]; ``` However, they are *very* bad style because you wo...
Segmentation faults occur when a program accesses memory that doesn't belong to it. The pointer `str` is not initialized. It doesn't point at any memory. The stream-extraction operator `>>` doesn't allocate new memory for the string it reads; it expects the pointer to already point to a buffer that it can fill. It does...
8,069,236
This gives me seg fault 11 when I input the string. Why am i getting the seg fault? It's so simple... where is the seg fault coming from? ``` int main(){ char * str; printf ("please enter string : "); cin >> str; // reverse_str(str); } ```
2011/11/09
[ "https://Stackoverflow.com/questions/8069236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1038203/" ]
Your first line, `char * str` declares a raw pointer and doesn't initialize it or allocate any memory. That means it could point anywhere, and most likely not somewhere valid or useful. You most likely segfault when you try to use it on the 3rd line. Can you use `std::string` instead? It'll be much easier and safer tha...
You need to allocate memory first for `str`. You declared only a pointer ``` char* str = (char*)malloc(MAX_SIZE_OF_BUFFER); ```
67,104,574
I'm creating an `aws_subnet` and referencing it in another resource. Example: ``` resource "aws_subnet" "mango" { vpc_id = aws_vpc.mango.id cidr_block = "${var.subnet_cidr}" } ``` The reference ``` network_configuration { subnets = "${aws_subnet.mango.id}" } ``` When planning it I...
2021/04/15
[ "https://Stackoverflow.com/questions/67104574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17450994/" ]
This is a case of [explicit dependency](https://learn.hashicorp.com/tutorials/terraform/dependencies#manage-explicit-dependencies). The argument `depends_on` similar to CloudFormation's `DependsOn` solves such dependencies. Note: *"Since Terraform will wait to create the dependent resource until after the specified re...
The information like `ID` or other such information which will be generated by AWS, cannot be predicted by `terraform plan` as this step only does a dry run and doesn't apply any changes. The fields which have `known only after apply` is not an error, but just informs the user that these fields only get populated in t...
67,104,574
I'm creating an `aws_subnet` and referencing it in another resource. Example: ``` resource "aws_subnet" "mango" { vpc_id = aws_vpc.mango.id cidr_block = "${var.subnet_cidr}" } ``` The reference ``` network_configuration { subnets = "${aws_subnet.mango.id}" } ``` When planning it I...
2021/04/15
[ "https://Stackoverflow.com/questions/67104574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17450994/" ]
This is a case of [explicit dependency](https://learn.hashicorp.com/tutorials/terraform/dependencies#manage-explicit-dependencies). The argument `depends_on` similar to CloudFormation's `DependsOn` solves such dependencies. Note: *"Since Terraform will wait to create the dependent resource until after the specified re...
This line: ``` cidr_block = "${var.subnet_cidr}" ``` should look like ``` cidr_block = var.subnet_cidr ``` And this line: ``` subnets = "${aws_subnet.mango.id}" ``` should look like ``` subnets = aws_subnet.mango.id ``` Terraform gives a warning when a string value only has a template in...
67,104,574
I'm creating an `aws_subnet` and referencing it in another resource. Example: ``` resource "aws_subnet" "mango" { vpc_id = aws_vpc.mango.id cidr_block = "${var.subnet_cidr}" } ``` The reference ``` network_configuration { subnets = "${aws_subnet.mango.id}" } ``` When planning it I...
2021/04/15
[ "https://Stackoverflow.com/questions/67104574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17450994/" ]
This is a case of [explicit dependency](https://learn.hashicorp.com/tutorials/terraform/dependencies#manage-explicit-dependencies). The argument `depends_on` similar to CloudFormation's `DependsOn` solves such dependencies. Note: *"Since Terraform will wait to create the dependent resource until after the specified re...
The error in this case is not the string "known only after apply" but the message "Incorrect attribute value type". `subnets` (plural) requires a *list* of strings but you gave only one string. ``` network_configuration { subnets = ["${aws_subnet.mango.id}"] } ``` The `depends_on` is not necessary in thi...
26,002,958
This HTML / JS code : ``` <script> window.onload = function(e) { window.onkeydown = function(event) { if (event.ctrlKey && (event.keyCode == 61 || event.keyCode == 187)) { event.preventDefault(); alert("hello"); return false; } } } </script> <p>Blah</p> ```...
2014/09/23
[ "https://Stackoverflow.com/questions/26002958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1422096/" ]
Seems like this is problem with `ctrlKey`. Assuming you use Mac OS X system you need to check for `metaKey` too, so your code should be: ``` if ((event.ctrlKey || event.metaKey) && (event.keyCode == 61 || event.keyCode == 187)) ```
We probably have different keyboard layouts or something, but my `+` and `-` signs on my numpad have the key code values 107 and 109. (<http://www.asquare.net/javascript/tests/KeyCode.html>) The code snippet below works in safari for me. ```js window.onkeydown = function (event) { if (event.ctrlKey && (event.key...
26,002,958
This HTML / JS code : ``` <script> window.onload = function(e) { window.onkeydown = function(event) { if (event.ctrlKey && (event.keyCode == 61 || event.keyCode == 187)) { event.preventDefault(); alert("hello"); return false; } } } </script> <p>Blah</p> ```...
2014/09/23
[ "https://Stackoverflow.com/questions/26002958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1422096/" ]
Seems like this is problem with `ctrlKey`. Assuming you use Mac OS X system you need to check for `metaKey` too, so your code should be: ``` if ((event.ctrlKey || event.metaKey) && (event.keyCode == 61 || event.keyCode == 187)) ```
You can try this: ``` window.onkeydown = function(event) { if (event.ctrlKey && (event.keyCode == 61 || event.keyCode == 187)) { if (event.preventDefault){ event.preventDefault(); } else { event.returnValue = false; } alert("...
26,002,958
This HTML / JS code : ``` <script> window.onload = function(e) { window.onkeydown = function(event) { if (event.ctrlKey && (event.keyCode == 61 || event.keyCode == 187)) { event.preventDefault(); alert("hello"); return false; } } } </script> <p>Blah</p> ```...
2014/09/23
[ "https://Stackoverflow.com/questions/26002958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1422096/" ]
Seems like this is problem with `ctrlKey`. Assuming you use Mac OS X system you need to check for `metaKey` too, so your code should be: ``` if ((event.ctrlKey || event.metaKey) && (event.keyCode == 61 || event.keyCode == 187)) ```
The key codes for zoom are different across browsers: ``` Opera MSIE Firefox Safari Chrome 61 187 107 187 187 = + 109 189 109 189 189 - _ ``` Also try : ``` event.stopImmediatePropagation(); ``` To prevent other handlers from executing.
26,002,958
This HTML / JS code : ``` <script> window.onload = function(e) { window.onkeydown = function(event) { if (event.ctrlKey && (event.keyCode == 61 || event.keyCode == 187)) { event.preventDefault(); alert("hello"); return false; } } } </script> <p>Blah</p> ```...
2014/09/23
[ "https://Stackoverflow.com/questions/26002958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1422096/" ]
We probably have different keyboard layouts or something, but my `+` and `-` signs on my numpad have the key code values 107 and 109. (<http://www.asquare.net/javascript/tests/KeyCode.html>) The code snippet below works in safari for me. ```js window.onkeydown = function (event) { if (event.ctrlKey && (event.key...
You can try this: ``` window.onkeydown = function(event) { if (event.ctrlKey && (event.keyCode == 61 || event.keyCode == 187)) { if (event.preventDefault){ event.preventDefault(); } else { event.returnValue = false; } alert("...
26,002,958
This HTML / JS code : ``` <script> window.onload = function(e) { window.onkeydown = function(event) { if (event.ctrlKey && (event.keyCode == 61 || event.keyCode == 187)) { event.preventDefault(); alert("hello"); return false; } } } </script> <p>Blah</p> ```...
2014/09/23
[ "https://Stackoverflow.com/questions/26002958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1422096/" ]
We probably have different keyboard layouts or something, but my `+` and `-` signs on my numpad have the key code values 107 and 109. (<http://www.asquare.net/javascript/tests/KeyCode.html>) The code snippet below works in safari for me. ```js window.onkeydown = function (event) { if (event.ctrlKey && (event.key...
The key codes for zoom are different across browsers: ``` Opera MSIE Firefox Safari Chrome 61 187 107 187 187 = + 109 189 109 189 189 - _ ``` Also try : ``` event.stopImmediatePropagation(); ``` To prevent other handlers from executing.
845,426
`/etc/hosts` lets you set system-wide hostname lookups. Is there a place in OS X to set per-user hostnames? I use two user accounts on my laptop and I'd like to override IP addresses for just one of those accounts. Is that possible?
2014/11/26
[ "https://superuser.com/questions/845426", "https://superuser.com", "https://superuser.com/users/39309/" ]
No, DNS is global. You don't mention any details. You could redefine: thissite.com 0.0.0.0 mythissite.com 122.122.122.122 <-- with the IP address of the real site. Then only people who know that thissite.com is broken and to use mythissinte.com instead would be able to access thissite.com
There is no such thing in any operating system, but you can swap `/etc/hosts` file by some script when user is logging in. I don't know much about OS X, you may have to restart one or more network services after that file swap. You also might want to change permissions or owner on `/etc/hosts` file, if your script wi...
45,794,275
In my application I am using authentication with Google account. When the user logs in for the first time list of google accounts used on the device is displayed and user can log in by picking one of available accounts. But when the user logs out and then try to log in again the list is no longer displayed and he is au...
2017/08/21
[ "https://Stackoverflow.com/questions/45794275", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8404031/" ]
Try this : ``` htmlCanvas.onclick= function(evt) { img.src = images[count]; img.width = 80/100* htmlCanvas.width; img.height = 80/100* htmlCanvas.height; var x = evt.offsetX - img.width/2, y = evt.offsetY - img.height/2; // context.drawImage(img, x, y); ...
``` context.drawImage(img, 0, 0,img.width,img.height,0,0,htmlCanvas.width,htmlCanvas.height); ``` you also can use `background-size:cover;`
45,794,275
In my application I am using authentication with Google account. When the user logs in for the first time list of google accounts used on the device is displayed and user can log in by picking one of available accounts. But when the user logs out and then try to log in again the list is no longer displayed and he is au...
2017/08/21
[ "https://Stackoverflow.com/questions/45794275", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8404031/" ]
Try this : ``` htmlCanvas.onclick= function(evt) { img.src = images[count]; img.width = 80/100* htmlCanvas.width; img.height = 80/100* htmlCanvas.height; var x = evt.offsetX - img.width/2, y = evt.offsetY - img.height/2; // context.drawImage(img, x, y); ...
The max-height/width doesn't work because everything within the canvas is independent from your css. If you want to set the image to 80% use `htmlCanvas.width` and `htmlCanvas.height` to calculate the new size and use `context.drawImage(img, x, y, w, h)` to set the image size when drawing. Maybe [this post](https://s...
3,591,833
> > Let $F(x)=x^{3}+2 x-2,$ let $\alpha \in \mathbb{C}$ be a root of $F,$ and let $K=\mathbb{Q}(\alpha)$ > > > Find $a, b, c \in \mathbb{Q}$ such that $\alpha^{4}=a \alpha^{2}+b \alpha+c$ > > > We have that [$K:\mathbb{Q}]=3$. I know that such a thing is possible, but do not know in what manner to proceed. Plea...
2020/03/23
[ "https://math.stackexchange.com/questions/3591833", "https://math.stackexchange.com", "https://math.stackexchange.com/users/716605/" ]
$\alpha$ is a root of $F$, so $\alpha^3 + 2\alpha - 2 = ?$ And you should be able to solve that for $\alpha^4$ (by multiplying by one thing, then moving all non-$\alpha^4$ terms to the right-hand side).
Since $\alpha$ is a root of $f(x) = x^3 + 2x - 2, \tag 1$ we have $\alpha^3 + 2\alpha - 2 = 0, \tag 2$ or $\alpha^3 = -2\alpha + 2; \tag 3$ thus, $\alpha^4 = -2\alpha^2 + 2\alpha; \tag 4$ therefore, $a = -2, \tag 5$ $b = 2, \tag 6$ and $c = 0. \tag 7$ In order to show uniqueness, suppose there are $q, r, ...
42,950,167
For me it is not clear what the difference is between a WebSphere Message Broker and the WebSphere MQ . According to wikipedia the message broker translates and routes the message. Which would lead me to believe the WebSphere MQ is the queue, but it is not clear from all of the marketing information what the core tas...
2017/03/22
[ "https://Stackoverflow.com/questions/42950167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/273096/" ]
WebSphere Message Broker is not a component of WebSphere MQ Series (moreover, starting from v10 of Message Broker you don't need to have WebSphere MQ installed at all on your system in order to run message broker). Think about WebSphere MQ as of a transport layer - you can send a message and receive it on another end ...
If an analogy helps, MQ is like an HTTP client and HTTP server, whereas MB/IIB is more of a gateway (proxy). Usually they emphasize **disparate systems** and **transformations** in the MB/IIB context.
42,950,167
For me it is not clear what the difference is between a WebSphere Message Broker and the WebSphere MQ . According to wikipedia the message broker translates and routes the message. Which would lead me to believe the WebSphere MQ is the queue, but it is not clear from all of the marketing information what the core tas...
2017/03/22
[ "https://Stackoverflow.com/questions/42950167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/273096/" ]
If an analogy helps, MQ is like an HTTP client and HTTP server, whereas MB/IIB is more of a gateway (proxy). Usually they emphasize **disparate systems** and **transformations** in the MB/IIB context.
WebSpher MQ is an implementation of JSM plus a bit more, Message Broker or IIB as its called now is an ESB, It enables communication between separate system by transforming message from one definition to another. MQ is one of the many transport channels that WMB can use to send and receive messages.
42,950,167
For me it is not clear what the difference is between a WebSphere Message Broker and the WebSphere MQ . According to wikipedia the message broker translates and routes the message. Which would lead me to believe the WebSphere MQ is the queue, but it is not clear from all of the marketing information what the core tas...
2017/03/22
[ "https://Stackoverflow.com/questions/42950167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/273096/" ]
WebSphere Message Broker is not a component of WebSphere MQ Series (moreover, starting from v10 of Message Broker you don't need to have WebSphere MQ installed at all on your system in order to run message broker). Think about WebSphere MQ as of a transport layer - you can send a message and receive it on another end ...
WebSpher MQ is an implementation of JSM plus a bit more, Message Broker or IIB as its called now is an ESB, It enables communication between separate system by transforming message from one definition to another. MQ is one of the many transport channels that WMB can use to send and receive messages.
2,341,335
**Preamble** I know from linear algebra that any vector in a vector space can be written as a linear combination of basis vectors. However, in physics, unit vectors are used as basis vectors, which brings me to my question. **Note**: I do not have the math tools to formally prove any of this... I just need an explanat...
2017/06/29
[ "https://math.stackexchange.com/questions/2341335", "https://math.stackexchange.com", "https://math.stackexchange.com/users/458997/" ]
The term *unit vector* is well-defined: a vector of length one. The term *basis vector* is taken out of context, and doesn't make sense on its own. A *basis* of a vector space $V$ is a set of vectors $\left\{v\_1,\dots, v\_n\right\}$ such each vector $v\in V$ can be written uniquely as a linear combination of $v\_1,\d...
Being a "basis vector" is not a property of vectors on their own, so your questions have no clear answer. Take, for instance, the real plane. One basis here would be $\{(1,0),(1,1)\}$. So in this case, those two would be basis vectors. On the other hand, if you take $\{(2,2),(1,1)\}$, then this set of vectors forms n...
32,046,116
I have sql Upgrade script which has many sql statements(DDL,DML). When i ran this upgrade script in SQL developer, it runs successufully.I also provide in my script at the bottom commit. I can see all the changes in the database after running this upgrade script except the unique index constraints. When i insert few du...
2015/08/17
[ "https://Stackoverflow.com/questions/32046116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4508605/" ]
As A Hocevar noted, if you create an index ``` create unique index test_ux on test(id); ``` you see it in the Indexes tab of the table properties (not in the Constraints tab). Please note that COMMIT is not required here, it is done implicitely in each DDL statement. More usual source of problems are stale metadat...
I am assuming you are trying to look for index on a table in the correct tab in sql developer. If you are not able to see the index there, one reason could be that your user (the one with which you are logged in) doesn't have proper rights to see the Index.
32,046,116
I have sql Upgrade script which has many sql statements(DDL,DML). When i ran this upgrade script in SQL developer, it runs successufully.I also provide in my script at the bottom commit. I can see all the changes in the database after running this upgrade script except the unique index constraints. When i insert few du...
2015/08/17
[ "https://Stackoverflow.com/questions/32046116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4508605/" ]
As A Hocevar noted, if you create an index ``` create unique index test_ux on test(id); ``` you see it in the Indexes tab of the table properties (not in the Constraints tab). Please note that COMMIT is not required here, it is done implicitely in each DDL statement. More usual source of problems are stale metadat...
If you not obtain any error, the solution is very simple and tedious. SQL Developer doesn't refresh his fetched structures. Kindly push Refresh blue icon (or use Ctrl-R) in Connections view or disconnect and connect again (or restart SQL Developer) to see your changes in structures.
14,156,007
I was evaluating the outlook redemption for conversion of .eml to .msg file and subsequently purchase of the software. what I found was it uses current user login to connect to outlook and convert a .eml file to .msg. but I would like to know is that if we deploy this on the server we would use a service account for ...
2013/01/04
[ "https://Stackoverflow.com/questions/14156007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1948304/" ]
You can use LogonExchangeMailbox(User, ServerName) or LogonPstStore(Path, Format, DisplayName, Password, Encryption) <http://www.dimastr.com/redemption/rdo/rdosession.htm>
Keep in mind you do not need to log in to convert an EML file to MSG: call RDOSession.CreateMessageFroMMsgFIle (returns RDOMail object), call RDOMail.IMport(..., olRfc822) to import the EML file, then RDOMail.Save.
18,138,150
I'm trying to make an `HTTPGET` request to a REST server, the URL i need to send contains many parameters: This is the URI : `http://darate.free.fr/rest/api.php?rquest=addUser&&login=samuel&&password=0757bed3d74ccc8fc8e67a13983fc95dca209407&&firstname=samuel&&lastname=barbier` I need to get the Login,password,first,...
2013/08/08
[ "https://Stackoverflow.com/questions/18138150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2302854/" ]
I prefer to use [`Uri.Builder`](http://developer.android.com/reference/android/net/Uri.Builder.html) for building `Uri`s. It makes sure everything is escaped properly. My typical code: ``` Uri.Builder builder = Uri.parse(BASE_URI).buildUpon(); builder.appendPath(REQUEST_PATH); builder.builder.appendQueryParameter("p...
I hope you can use webview.posturl shown below ``` webview.postUrl("http://5.39.186.164/SEBC.php?user="+username)); ``` It also worked fine for me to get the username from the database. I hope it will help you.
11,248,235
I am reading Code Complete. In that book, Steve McConnell warns that "Developer tests tend to be 'clean tests.' Developers tend to test for whether the code works (clean test) rather than test for all the ways the code breaks (dirty tests)." How do I write a test for the way the code breaks? I mean, I can write tests...
2012/06/28
[ "https://Stackoverflow.com/questions/11248235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/821742/" ]
I think you are on the right path here. Tests to prove that the code works would call a method with sensible, meaningful and expected inputs, with the program in normal state. While tests to break the code try to think "out of the box" regarding that piece of code, thus use any sort of senseless or unexpected input. W...
What author most likely meant by *clean test* is test that verifies only [*happy path*](http://en.wikipedia.org/wiki/Happy_path) of method execution. Testing happy path is usually easiest and people might tend to think that since *it works*, their job with writing tests is done. This rarely is the case. Consider: ```...
11,248,235
I am reading Code Complete. In that book, Steve McConnell warns that "Developer tests tend to be 'clean tests.' Developers tend to test for whether the code works (clean test) rather than test for all the ways the code breaks (dirty tests)." How do I write a test for the way the code breaks? I mean, I can write tests...
2012/06/28
[ "https://Stackoverflow.com/questions/11248235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/821742/" ]
I think you are on the right path here. Tests to prove that the code works would call a method with sensible, meaningful and expected inputs, with the program in normal state. While tests to break the code try to think "out of the box" regarding that piece of code, thus use any sort of senseless or unexpected input. W...
Elisabeth Hendrickson, of [Test Obsessed](http://testobsessed.com/blog/2007/02/19/test-heuristics-cheat-sheet/), has a [Test Heuristics Cheat Sheet](http://testobsessed.com/wp-content/uploads/2011/04/testheuristicscheatsheetv1.pdf) in which she lists *all sorts* of testing approaches. The document is broadly about test...
15,206,166
I am using storyboards. I have used auto layout but its not working with ios5 and give crashes so I want to remove it. However, How can I uncheck the auto layout. But if I uncheck auto layout, How can i set my screens for both iPhone 4 and 5 Regards
2013/03/04
[ "https://Stackoverflow.com/questions/15206166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1921872/" ]
You can disable autolayout in IB but set the constraints programatically in the view controller, based on whether the iOS version on the device supports it or not by, for example, checking if the NSLayoutConstraint class can be found: ``` if (NSClassFromString(@"NSLayoutConstraint")) { //create constraints } ``` ...
You can uncheck auto layout from the Storyboard Utilities tab. If you aren't using auto layout you can use strings and structs or make adjustments programatically. ![enter image description here](https://i.stack.imgur.com/wFxGJ.jpg)
15,206,166
I am using storyboards. I have used auto layout but its not working with ios5 and give crashes so I want to remove it. However, How can I uncheck the auto layout. But if I uncheck auto layout, How can i set my screens for both iPhone 4 and 5 Regards
2013/03/04
[ "https://Stackoverflow.com/questions/15206166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1921872/" ]
You can uncheck auto layout from the Storyboard Utilities tab. If you aren't using auto layout you can use strings and structs or make adjustments programatically. ![enter image description here](https://i.stack.imgur.com/wFxGJ.jpg)
For the use the Auto Layout use the springs in the story board for each view depending on how you want to resize them! Naturally you will need ``` view.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleWidth ``` In the StoryBoard when you set a string or strut that means you are ...
15,206,166
I am using storyboards. I have used auto layout but its not working with ios5 and give crashes so I want to remove it. However, How can I uncheck the auto layout. But if I uncheck auto layout, How can i set my screens for both iPhone 4 and 5 Regards
2013/03/04
[ "https://Stackoverflow.com/questions/15206166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1921872/" ]
You can disable autolayout in IB but set the constraints programatically in the view controller, based on whether the iOS version on the device supports it or not by, for example, checking if the NSLayoutConstraint class can be found: ``` if (NSClassFromString(@"NSLayoutConstraint")) { //create constraints } ``` ...
For the use the Auto Layout use the springs in the story board for each view depending on how you want to resize them! Naturally you will need ``` view.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleWidth ``` In the StoryBoard when you set a string or strut that means you are ...
7,035,049
How can I join these 2 queries together. ``` SELECT * FROM tbl_person WHERE tbl_person.status_id = '+ status_dg.selectedItem.status_id +'; SELECT * FROM tbl_settings WHERE tbl_settings.status_id = '+ status_dg.selectedItem.status_id +'; ``` I tried this but doesn't seem to work. ``` SELECT * FROM tbl_...
2011/08/12
[ "https://Stackoverflow.com/questions/7035049", "https://Stackoverflow.com", "https://Stackoverflow.com/users/258594/" ]
Do not know what you need probably union? ``` SELECT * FROM tbl_person WHERE tbl_person.status_id = '+ status_dg.selectedItem.status_id +' union SELECT * FROM tbl_status WHERE tbl_status.status_id = '+ status_dg.selectedItem.status_id +' ``` 1.You should AVOID using "\*" to select all records. You should ...
Without more information on your table schema, try: ``` SELECT * FROM tbl_person, tbl_settings WHERE tbl_person.status_id = tbl_settings.status_id AND tbl_person.status_id = '+status_dg.selectedItem.status_id+' ``` This will join the 2 tables, `tbl_person` and `tbl_status`, on `status_id`, and only retr...
7,035,049
How can I join these 2 queries together. ``` SELECT * FROM tbl_person WHERE tbl_person.status_id = '+ status_dg.selectedItem.status_id +'; SELECT * FROM tbl_settings WHERE tbl_settings.status_id = '+ status_dg.selectedItem.status_id +'; ``` I tried this but doesn't seem to work. ``` SELECT * FROM tbl_...
2011/08/12
[ "https://Stackoverflow.com/questions/7035049", "https://Stackoverflow.com", "https://Stackoverflow.com/users/258594/" ]
I am a little confused with your question because you used tbl\_person and tbl\_status firstly, then you tried to test by joining tbl\_person and tbl\_settings. Which two tables do you want to join? If you want to join tbl\_person and tbl\_settings, how about this. ``` SELECT * FROM tbl_person JOIN tbl_settin...
Without more information on your table schema, try: ``` SELECT * FROM tbl_person, tbl_settings WHERE tbl_person.status_id = tbl_settings.status_id AND tbl_person.status_id = '+status_dg.selectedItem.status_id+' ``` This will join the 2 tables, `tbl_person` and `tbl_status`, on `status_id`, and only retr...
7,035,049
How can I join these 2 queries together. ``` SELECT * FROM tbl_person WHERE tbl_person.status_id = '+ status_dg.selectedItem.status_id +'; SELECT * FROM tbl_settings WHERE tbl_settings.status_id = '+ status_dg.selectedItem.status_id +'; ``` I tried this but doesn't seem to work. ``` SELECT * FROM tbl_...
2011/08/12
[ "https://Stackoverflow.com/questions/7035049", "https://Stackoverflow.com", "https://Stackoverflow.com/users/258594/" ]
Do not know what you need probably union? ``` SELECT * FROM tbl_person WHERE tbl_person.status_id = '+ status_dg.selectedItem.status_id +' union SELECT * FROM tbl_status WHERE tbl_status.status_id = '+ status_dg.selectedItem.status_id +' ``` 1.You should AVOID using "\*" to select all records. You should ...
To join the tables, you need to define the joining fields, which in your case seems to be the status\_id fields. This might not work correctly, but if you look at the last line you'll need that in your query: ``` SELECT * FROM tbl_person, tbl_settings WHERE ( tbl_person.status_id='+status_dg.selectedItem.status_...
7,035,049
How can I join these 2 queries together. ``` SELECT * FROM tbl_person WHERE tbl_person.status_id = '+ status_dg.selectedItem.status_id +'; SELECT * FROM tbl_settings WHERE tbl_settings.status_id = '+ status_dg.selectedItem.status_id +'; ``` I tried this but doesn't seem to work. ``` SELECT * FROM tbl_...
2011/08/12
[ "https://Stackoverflow.com/questions/7035049", "https://Stackoverflow.com", "https://Stackoverflow.com/users/258594/" ]
I am a little confused with your question because you used tbl\_person and tbl\_status firstly, then you tried to test by joining tbl\_person and tbl\_settings. Which two tables do you want to join? If you want to join tbl\_person and tbl\_settings, how about this. ``` SELECT * FROM tbl_person JOIN tbl_settin...
To join the tables, you need to define the joining fields, which in your case seems to be the status\_id fields. This might not work correctly, but if you look at the last line you'll need that in your query: ``` SELECT * FROM tbl_person, tbl_settings WHERE ( tbl_person.status_id='+status_dg.selectedItem.status_...
47,912,642
Let say I have a `Map<Date, List<Integer>>`, where list of integers is just a list of numbers thrown in lottery draw. It may look like this: ``` Wed Nov 15 13:31:45 EST 2017=[1, 2, 3, 4, 5, 6], Wed Nov 22 13:31:45 EST 2017=[7, 8, 9, 10, 11, 12], Wed Nov 29 13:31:45 EST 2017=[13, 14, 15, 16, 17, 18], Wed Dec 13 13:3...
2017/12/20
[ "https://Stackoverflow.com/questions/47912642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1712442/" ]
If I am not mistaken you are looking for something like this (assuming `Date` is `Comparable`): ``` map.entrySet() .stream() .flatMap(x -> x.getValue().stream().map(y -> new AbstractMap.SimpleEntry<>(x.getKey(), y))) .collect(Collectors.groupingBy( Entry::getValu...
Here's a succint way to do it (without streams, though): ``` Map<Integer, Date> result = new HashMap<>(); map.forEach((date, list) -> list.forEach(n -> result.merge(n, date, (oldDate, newDate) -> newDate.after(oldDate) ? newDate : oldDate))); ``` This iterates the `map` map and for each one of its `(date, list)...
27,842,921
``` #include<stdio.h> int main() { int i; goto l; for(i = 0; i < 5; i++) { l:printf("Hi\n"); } return 0; } ``` The above code gives output three times Hi . I don't have any idea how it happens, please expalin it. If i reducde value of 5 to 3 then only once the Hi printed.
2015/01/08
[ "https://Stackoverflow.com/questions/27842921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3671587/" ]
iCloud doesn't support a pretty wide range of calendar-query requests. You may be stuck downloading the entire collection first.
The url you are using to post request must contain ics file link along with the UID in request.
4,214,815
I have a simple webservice running in Visual Studio. If I attempt to view the metadata it is missing information about the operation and so svcutil generates client code without any methods. Is there anything wrong with my setup? ``` <system.serviceModel> <bindings> <basicHttpBinding> <bind...
2010/11/18
[ "https://Stackoverflow.com/questions/4214815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/236733/" ]
Worked it out. Setting ReplyAction="\*" for an OperationContract means the WsdlExporter (which publishes the metadata) will ignore that Operation. Setting any other value fixes it. What bothers me about this is that svcutil will by default set replyaction to \* which means svcutil by default creates services for which...
try removing `FCRPublish` from the address of your enpoint... your mex endpoint is there and seems ok, so I believe it should work
12,598,223
I need to get both table and here is the table structure Table A ------- * UserID * Username * Status * IntroCode Table B ------- * IntroCode * UserID I want to get the table a data and join with table b on tblA.IntroCode = tblB.IntroCode, then get the username of tblB.userID. How can i do such join ? I tried hal...
2012/09/26
[ "https://Stackoverflow.com/questions/12598223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/235119/" ]
``` SELECT B.userID from TableA A LEFT JOIN TableB B on A.IntroCode=B.IntroCode ```
use this query ``` SELECT * FROM tblA INNER JOIN tblB ON tblA.IntroCode = tblB.IntroCode where tblB.userid = value ```
12,598,223
I need to get both table and here is the table structure Table A ------- * UserID * Username * Status * IntroCode Table B ------- * IntroCode * UserID I want to get the table a data and join with table b on tblA.IntroCode = tblB.IntroCode, then get the username of tblB.userID. How can i do such join ? I tried hal...
2012/09/26
[ "https://Stackoverflow.com/questions/12598223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/235119/" ]
Use this query. ``` SELECT TableA.Username FROM TableA JOIN TableB ON (TableA.IntroCode = TableB.IntroCode); ```
use this query ``` SELECT * FROM tblA INNER JOIN tblB ON tblA.IntroCode = tblB.IntroCode where tblB.userid = value ```
12,598,223
I need to get both table and here is the table structure Table A ------- * UserID * Username * Status * IntroCode Table B ------- * IntroCode * UserID I want to get the table a data and join with table b on tblA.IntroCode = tblB.IntroCode, then get the username of tblB.userID. How can i do such join ? I tried hal...
2012/09/26
[ "https://Stackoverflow.com/questions/12598223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/235119/" ]
``` SELECT column_name(s) FROM TableA LEFT JOIN TableB ON TableA.UserID=TableB.UserID ```
use this query ``` SELECT * FROM tblA INNER JOIN tblB ON tblA.IntroCode = tblB.IntroCode where tblB.userid = value ```
12,598,223
I need to get both table and here is the table structure Table A ------- * UserID * Username * Status * IntroCode Table B ------- * IntroCode * UserID I want to get the table a data and join with table b on tblA.IntroCode = tblB.IntroCode, then get the username of tblB.userID. How can i do such join ? I tried hal...
2012/09/26
[ "https://Stackoverflow.com/questions/12598223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/235119/" ]
This is just a simple join. ``` SELECT a.*, b.* -- select your desired columns here FROM tableA a INNER JOIN tableB b ON a.IntroCode = b.IntroCode WHERE b.userid = valueHere ``` **UPDATE 1** ``` SELECT a.UserID, a.`Username` OrigUserName, a.`Status`, c.`Usernam...
``` SELECT B.userID from TableA A LEFT JOIN TableB B on A.IntroCode=B.IntroCode ```
12,598,223
I need to get both table and here is the table structure Table A ------- * UserID * Username * Status * IntroCode Table B ------- * IntroCode * UserID I want to get the table a data and join with table b on tblA.IntroCode = tblB.IntroCode, then get the username of tblB.userID. How can i do such join ? I tried hal...
2012/09/26
[ "https://Stackoverflow.com/questions/12598223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/235119/" ]
``` select a.*,b.IntroCode from TableA a left join TableB b on a.IntroCode = b.IntroCode ```
use this query ``` SELECT * FROM tblA INNER JOIN tblB ON tblA.IntroCode = tblB.IntroCode where tblB.userid = value ```
12,598,223
I need to get both table and here is the table structure Table A ------- * UserID * Username * Status * IntroCode Table B ------- * IntroCode * UserID I want to get the table a data and join with table b on tblA.IntroCode = tblB.IntroCode, then get the username of tblB.userID. How can i do such join ? I tried hal...
2012/09/26
[ "https://Stackoverflow.com/questions/12598223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/235119/" ]
This is just a simple join. ``` SELECT a.*, b.* -- select your desired columns here FROM tableA a INNER JOIN tableB b ON a.IntroCode = b.IntroCode WHERE b.userid = valueHere ``` **UPDATE 1** ``` SELECT a.UserID, a.`Username` OrigUserName, a.`Status`, c.`Usernam...
you have to give the columns with same name an unique value: ``` SELECT a.UserID as uid_a, b.UserID as uid_b FROM tableA a INNER JOIN tableB b ON a.IntroCode = b.IntroCode WHERE b.UserID = 1 ```
12,598,223
I need to get both table and here is the table structure Table A ------- * UserID * Username * Status * IntroCode Table B ------- * IntroCode * UserID I want to get the table a data and join with table b on tblA.IntroCode = tblB.IntroCode, then get the username of tblB.userID. How can i do such join ? I tried hal...
2012/09/26
[ "https://Stackoverflow.com/questions/12598223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/235119/" ]
This is just a simple join. ``` SELECT a.*, b.* -- select your desired columns here FROM tableA a INNER JOIN tableB b ON a.IntroCode = b.IntroCode WHERE b.userid = valueHere ``` **UPDATE 1** ``` SELECT a.UserID, a.`Username` OrigUserName, a.`Status`, c.`Usernam...
``` SELECT column_name(s) FROM TableA LEFT JOIN TableB ON TableA.UserID=TableB.UserID ```