qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
350,381
So I have a script that I want to run as root, without hangup and nicely. What order should I put the commands in? sudo nohup nice foo.bash & or nohup nice sudo foo.bash & etc. I suspect it doesn't matter but would like some insight from those who **really** know.
2008/12/08
[ "https://Stackoverflow.com/questions/350381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15948/" ]
If negative niceness is desired, I would do: sudo nohup nice command because according to `info coreutils' nohup should *preceed* nice. If I want a negative nice value, sudo must come before, since only root is able to use negative nice values. If positive niceness is desired, I would do simply: nohup nice sudo comman...
``` ~ $ sudo nohup nice whoami nohup: ignoring input and appending output to `nohup.out' ~ $ sudo cat nohup.out root ``` The difference between the first and second way you've done it is who owns the nohup.out file. `sudo` first will make it owned by root, `nohup` before sudo will make it owned by your user.
350,381
So I have a script that I want to run as root, without hangup and nicely. What order should I put the commands in? sudo nohup nice foo.bash & or nohup nice sudo foo.bash & etc. I suspect it doesn't matter but would like some insight from those who **really** know.
2008/12/08
[ "https://Stackoverflow.com/questions/350381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15948/" ]
sudo may not respect niceness. At least, it doesn't on my machine (Ubuntu 9.04). Running this: ``` nice sudo nice sudo nice nice ``` prints out 0 and 10. (Note that 'nice' with no command prints out the current niceness.)
the sudo should go last so that nohup and nice aren't running with root privileges. so the latter
350,381
So I have a script that I want to run as root, without hangup and nicely. What order should I put the commands in? sudo nohup nice foo.bash & or nohup nice sudo foo.bash & etc. I suspect it doesn't matter but would like some insight from those who **really** know.
2008/12/08
[ "https://Stackoverflow.com/questions/350381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15948/" ]
If negative niceness is desired, I would do: sudo nohup nice command because according to `info coreutils' nohup should *preceed* nice. If I want a negative nice value, sudo must come before, since only root is able to use negative nice values. If positive niceness is desired, I would do simply: nohup nice sudo comman...
I guess all of them do an exec\* syscall to pass the ball to the next one, so, whatever the order, it won't leave any hanging processes. I'd say that nohup should be last so that the two other don't clober the signal handler. (I'm sure nice does not play with signals, but sudo does.) Then, sudo and nice, it all depen...
350,381
So I have a script that I want to run as root, without hangup and nicely. What order should I put the commands in? sudo nohup nice foo.bash & or nohup nice sudo foo.bash & etc. I suspect it doesn't matter but would like some insight from those who **really** know.
2008/12/08
[ "https://Stackoverflow.com/questions/350381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15948/" ]
sudo may not respect niceness. At least, it doesn't on my machine (Ubuntu 9.04). Running this: ``` nice sudo nice sudo nice nice ``` prints out 0 and 10. (Note that 'nice' with no command prints out the current niceness.)
I guess all of them do an exec\* syscall to pass the ball to the next one, so, whatever the order, it won't leave any hanging processes. I'd say that nohup should be last so that the two other don't clober the signal handler. (I'm sure nice does not play with signals, but sudo does.) Then, sudo and nice, it all depen...
350,381
So I have a script that I want to run as root, without hangup and nicely. What order should I put the commands in? sudo nohup nice foo.bash & or nohup nice sudo foo.bash & etc. I suspect it doesn't matter but would like some insight from those who **really** know.
2008/12/08
[ "https://Stackoverflow.com/questions/350381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15948/" ]
**Disagree** with other answers. I recommend: `sudo nohup nice foo.sh` I have observed **nohup sudo** *#fail* -- ie nohup is not always transferred to sudo'd sub-sub-processes (this was for certain /etc/init.d scripts on Ubuntu which delegated to yet other scripts). Not sure why, certainly surprising, but was the cas...
I guess all of them do an exec\* syscall to pass the ball to the next one, so, whatever the order, it won't leave any hanging processes. I'd say that nohup should be last so that the two other don't clober the signal handler. (I'm sure nice does not play with signals, but sudo does.) Then, sudo and nice, it all depen...
4,225,891
I am implementing the next function: ``` private bool CheckRelativeIncrease(T pVal1, T pVal2, out T pFluctuation, int x) ``` where I compare if pVal2 has increased more than a "x%" over pVal1. I am using Generics to make the function work with int, short... I am using MiscUtils.Operator but the problem is that I can...
2010/11/19
[ "https://Stackoverflow.com/questions/4225891", "https://Stackoverflow.com", "https://Stackoverflow.com/users/513578/" ]
I don't believe we currently support operators on mixed types - but if you look at the code in `Operator<T>` it should be pretty easy to adapt it. Feel free to send me a patch :) Basically you'll need an `Operator<T1, T2, TResult>` which looks like `Operator<TValue, TResult>` except it uses different types for the dif...
There is also two-type multiply operation which you can use, according to [this documentation](http://www.yoda.arachsys.com/csharp/miscutil/usage/genericoperators.html): ``` public static TArg1 MultiplyAlternative(TArg1 value1, TArg2 value2) ```
4,225,891
I am implementing the next function: ``` private bool CheckRelativeIncrease(T pVal1, T pVal2, out T pFluctuation, int x) ``` where I compare if pVal2 has increased more than a "x%" over pVal1. I am using Generics to make the function work with int, short... I am using MiscUtils.Operator but the problem is that I can...
2010/11/19
[ "https://Stackoverflow.com/questions/4225891", "https://Stackoverflow.com", "https://Stackoverflow.com/users/513578/" ]
I don't believe we currently support operators on mixed types - but if you look at the code in `Operator<T>` it should be pretty easy to adapt it. Feel free to send me a patch :) Basically you'll need an `Operator<T1, T2, TResult>` which looks like `Operator<TValue, TResult>` except it uses different types for the dif...
Write another function to cast one type as another type. Make a nested call to that function within your code and problem solved.
16,306
Hy everyone, new here, I don't know much about how high pressure water pumping works - ( i'm just a programmer ) but i need to know if we can create water pressures `above 100 000 psi` for a crazy `water-jet cutting project` i have in mind :) What's the maximum pressure we can reach inside a single pump / or by connec...
2017/07/15
[ "https://engineering.stackexchange.com/questions/16306", "https://engineering.stackexchange.com", "https://engineering.stackexchange.com/users/12155/" ]
I think the theoretical limit is based on materials, as alephzero said. You have to make it out of something, and the yield strength of the material will have to be greater than the internal pressure. There is a practical limit as well, because there has to be a margin of safety - at such high pressures the system woul...
Based on your last edit adding reasoning about the effect of diameter / flow rate etc, I would suggest you should seriously look at cutting with two nozzles at the same time - your analysis based on all the other answers / comments doesn't leave much else.
16,306
Hy everyone, new here, I don't know much about how high pressure water pumping works - ( i'm just a programmer ) but i need to know if we can create water pressures `above 100 000 psi` for a crazy `water-jet cutting project` i have in mind :) What's the maximum pressure we can reach inside a single pump / or by connec...
2017/07/15
[ "https://engineering.stackexchange.com/questions/16306", "https://engineering.stackexchange.com", "https://engineering.stackexchange.com/users/12155/" ]
I think the theoretical limit is based on materials, as alephzero said. You have to make it out of something, and the yield strength of the material will have to be greater than the internal pressure. There is a practical limit as well, because there has to be a margin of safety - at such high pressures the system woul...
It is theoretically possible to drive a water jet to pressures of, say, 7,000,000 psi using explosives with a high detonation velocity, the shaped charge effect and a single use device. Higher pressures may well be possible with money, effort and optimization, for example swapping the RDX-based explosives in common sha...
44,940,861
I need to save the image by right clicking using selenium and also by "Authenticating the browser with username and password". the link which i am sending through selenium looks like this "<http://111.111.2.125/capture>". As I am new this concept, any suggestions will be highly helpful.
2017/07/06
[ "https://Stackoverflow.com/questions/44940861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8024851/" ]
No, there isn't any better way than looping. Not only is it cleaner than any other approach, it's also the fastest. ``` values := []int{4, 20, 0, -11, -10} min := values[0] for _, v := range values { if (v < min) { min = v } } fmt.Println(min) ``` **EDIT** Since there has been some dis...
You should write a loop. It does not make sense to create dozens of function in standard library to find min/max/count/count\_if/all\_of/any\_of/none\_of etc. like in C++ (most of them in 4 flavours according arguments).
44,940,861
I need to save the image by right clicking using selenium and also by "Authenticating the browser with username and password". the link which i am sending through selenium looks like this "<http://111.111.2.125/capture>". As I am new this concept, any suggestions will be highly helpful.
2017/07/06
[ "https://Stackoverflow.com/questions/44940861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8024851/" ]
General answer is: "Yes, you must use a loop, if you do not know exact number of items to compare". In this [package](https://github.com/adam-lavrik/go-imath) `Min` functions are implemented like: ```golang // For 2 values func Min(value_0, value_1 int) int { if value_0 < value_1 { return value_0 } ...
You should write a loop. It does not make sense to create dozens of function in standard library to find min/max/count/count\_if/all\_of/any\_of/none\_of etc. like in C++ (most of them in 4 flavours according arguments).
44,940,861
I need to save the image by right clicking using selenium and also by "Authenticating the browser with username and password". the link which i am sending through selenium looks like this "<http://111.111.2.125/capture>". As I am new this concept, any suggestions will be highly helpful.
2017/07/06
[ "https://Stackoverflow.com/questions/44940861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8024851/" ]
No, there isn't any better way than looping. Not only is it cleaner than any other approach, it's also the fastest. ``` values := []int{4, 20, 0, -11, -10} min := values[0] for _, v := range values { if (v < min) { min = v } } fmt.Println(min) ``` **EDIT** Since there has been some dis...
General answer is: "Yes, you must use a loop, if you do not know exact number of items to compare". In this [package](https://github.com/adam-lavrik/go-imath) `Min` functions are implemented like: ```golang // For 2 values func Min(value_0, value_1 int) int { if value_0 < value_1 { return value_0 } ...
47,095,078
I want to replace multiple char(s) in a string using a simple query for Oracle 11g. Now I use: ``` select regexp_replace(regexp_replace(regexp_replace(colName, 'a', 'x'), 'b', 'y' ) 'c', 'z') from myTable; ``` but I'm not very happy with it. What would be a more intuitive query that has the same output?
2017/11/03
[ "https://Stackoverflow.com/questions/47095078", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8597377/" ]
Since the Helm v3 release you can now define a schema for your **values**. On commands like `helm install` your provided values are automatically validated against the schema. Please see the official documentation: <https://helm.sh/docs/topics/charts/#schema-files> Schema validation works for subcharts too, this is a...
AFAIK, there isn't a tool for that. However, it shouldn't be that hard to make one, even using bash. For example, you need to export all key/value pairs like this `test.test1.test2` and grep for that string recursively in the templates folder. If you want to read yaml using bash, you can install `shyaml`. If you know h...
47,095,078
I want to replace multiple char(s) in a string using a simple query for Oracle 11g. Now I use: ``` select regexp_replace(regexp_replace(regexp_replace(colName, 'a', 'x'), 'b', 'y' ) 'c', 'z') from myTable; ``` but I'm not very happy with it. What would be a more intuitive query that has the same output?
2017/11/03
[ "https://Stackoverflow.com/questions/47095078", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8597377/" ]
AFAIK, there isn't a tool for that. However, it shouldn't be that hard to make one, even using bash. For example, you need to export all key/value pairs like this `test.test1.test2` and grep for that string recursively in the templates folder. If you want to read yaml using bash, you can install `shyaml`. If you know h...
helm lint --detect-unused-values
47,095,078
I want to replace multiple char(s) in a string using a simple query for Oracle 11g. Now I use: ``` select regexp_replace(regexp_replace(regexp_replace(colName, 'a', 'x'), 'b', 'y' ) 'c', 'z') from myTable; ``` but I'm not very happy with it. What would be a more intuitive query that has the same output?
2017/11/03
[ "https://Stackoverflow.com/questions/47095078", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8597377/" ]
Since the Helm v3 release you can now define a schema for your **values**. On commands like `helm install` your provided values are automatically validated against the schema. Please see the official documentation: <https://helm.sh/docs/topics/charts/#schema-files> Schema validation works for subcharts too, this is a...
helm lint --detect-unused-values
19,521,440
I am going to send some data to **current page** using ajax to insert something in database. Assume this ajax code: ``` $('#newPost :submit').click(function(e){ var BASE = 'http://localhost/project/public/'; e.preventDefault(); $.post(BASE, { 'message' : $('#newPost textarea.message').v...
2013/10/22
[ "https://Stackoverflow.com/questions/19521440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/884588/" ]
In your route, ``` Route::get('data', array('uses' => 'HomeController@store')); ``` In HomeController, ``` public function store() { $input = Input::all(); // form data // validation rules $rules = array( 'email' => 'required|email', 'name' => 'required', ); $validator = Validator::make($...
You could change ``` var BASE = 'http://localhost/project/public/'; ``` to ``` var BASE = '<php echo URL::route("name");?>' ``` Your route should then be: ``` Route::post('action', array('as' => 'name', 'uses' => 'HomeController@action')); ``` Note the use of the [named routes](http://laravel.com/docs/routing#...
37,597,357
I am trying to write a pair of overloaded functions, one that must be called for a pointer to a type that is not a B or a child of B, and the second must be called for pointers to B and children of B. At first I tried to use specialization of the template for B, but this doesn't work for derived classes of B. So I look...
2016/06/02
[ "https://Stackoverflow.com/questions/37597357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1007769/" ]
A very simple workaround is to pass the pointer again as a second function argument that is used to discriminate between the two versions ``` template<typename T> void fImpl(T* t, const void*) { std::cout << "general"; } template<typename T> void fImpl(T *b, const B*) { std::cout << "specific"; } template<typ...
Moving the SFINAE into the template parameters we can use ``` // if not B or a descendant template<typename T, typename enable_if<!is_base_of<B, T>::value>::type* = nullptr> void f(T *t) { cout << "T\n"; } // only if B or a descendant template<typename T, typename enable_if<is_base_of<B, T>::value>::type* = nullptr> ...
37,597,357
I am trying to write a pair of overloaded functions, one that must be called for a pointer to a type that is not a B or a child of B, and the second must be called for pointers to B and children of B. At first I tried to use specialization of the template for B, but this doesn't work for derived classes of B. So I look...
2016/06/02
[ "https://Stackoverflow.com/questions/37597357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1007769/" ]
A very simple workaround is to pass the pointer again as a second function argument that is used to discriminate between the two versions ``` template<typename T> void fImpl(T* t, const void*) { std::cout << "general"; } template<typename T> void fImpl(T *b, const B*) { std::cout << "specific"; } template<typ...
`typename enable_if<!is_base_of<B, T>::value, T>::type` is non deducible, so you have to call explicitly: ``` f<B>(&b); // Want B; f<D>(&d); // Want B; f<C>(&c); // Want T; ``` [Demo](http://coliru.stacked-crooked.com/a/9cde2503c4dde9a5) To be deducible, you may use SFINAE with one of the classical way: re...
32,816,792
I'm acquainting myself with c-strings and pointers by using a very simple program. This version, which passes in a string by reference, works: ``` #include <stdio.h> #include <string.h> #include <stdlib.h> void test(char **string) { *string = (char *)malloc(5); char *temp = "hell"; strcpy(*string, temp...
2015/09/28
[ "https://Stackoverflow.com/questions/32816792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5327876/" ]
When you pass an argument "by value", the value of the argument is *copied* into the formal argument in the function. Changing a copy (in your case `string` inside the `test` function) will of course not change the original (`string` in the `main` function). On a side-note, C doesn't actually have "pass by reference",...
In your second version, `string` *itself* is being passed by value, so you simply cannot change `string` itself. This is for the similar reason you cannot change the value of an `int` or `float` when it is passed by value. While an argument is being passed by value, there is a local copy created in the called function'...
32,816,792
I'm acquainting myself with c-strings and pointers by using a very simple program. This version, which passes in a string by reference, works: ``` #include <stdio.h> #include <string.h> #include <stdlib.h> void test(char **string) { *string = (char *)malloc(5); char *temp = "hell"; strcpy(*string, temp...
2015/09/28
[ "https://Stackoverflow.com/questions/32816792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5327876/" ]
Remember This : In C programming to use a value,you pass "by value". To change a value you must pass "by address". So,if what you want to change is an address,then you need to pass its address to change it.otherwise you may only use it.
In your second version, `string` *itself* is being passed by value, so you simply cannot change `string` itself. This is for the similar reason you cannot change the value of an `int` or `float` when it is passed by value. While an argument is being passed by value, there is a local copy created in the called function'...
32,816,792
I'm acquainting myself with c-strings and pointers by using a very simple program. This version, which passes in a string by reference, works: ``` #include <stdio.h> #include <string.h> #include <stdlib.h> void test(char **string) { *string = (char *)malloc(5); char *temp = "hell"; strcpy(*string, temp...
2015/09/28
[ "https://Stackoverflow.com/questions/32816792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5327876/" ]
Remember This : In C programming to use a value,you pass "by value". To change a value you must pass "by address". So,if what you want to change is an address,then you need to pass its address to change it.otherwise you may only use it.
When you pass an argument "by value", the value of the argument is *copied* into the formal argument in the function. Changing a copy (in your case `string` inside the `test` function) will of course not change the original (`string` in the `main` function). On a side-note, C doesn't actually have "pass by reference",...
32,816,792
I'm acquainting myself with c-strings and pointers by using a very simple program. This version, which passes in a string by reference, works: ``` #include <stdio.h> #include <string.h> #include <stdlib.h> void test(char **string) { *string = (char *)malloc(5); char *temp = "hell"; strcpy(*string, temp...
2015/09/28
[ "https://Stackoverflow.com/questions/32816792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5327876/" ]
When you pass an argument "by value", the value of the argument is *copied* into the formal argument in the function. Changing a copy (in your case `string` inside the `test` function) will of course not change the original (`string` in the `main` function). On a side-note, C doesn't actually have "pass by reference",...
In C, array type is represented as a pointer to its first element. `*` in type means "pointer to", but outside of type means "dereference pointer". When you pass argument to function, in the body of function, you have *copy* of the thing, that you passed. Lets analyse your code with that in mind: ``` void test(char **...
32,816,792
I'm acquainting myself with c-strings and pointers by using a very simple program. This version, which passes in a string by reference, works: ``` #include <stdio.h> #include <string.h> #include <stdlib.h> void test(char **string) { *string = (char *)malloc(5); char *temp = "hell"; strcpy(*string, temp...
2015/09/28
[ "https://Stackoverflow.com/questions/32816792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5327876/" ]
Remember This : In C programming to use a value,you pass "by value". To change a value you must pass "by address". So,if what you want to change is an address,then you need to pass its address to change it.otherwise you may only use it.
In C, array type is represented as a pointer to its first element. `*` in type means "pointer to", but outside of type means "dereference pointer". When you pass argument to function, in the body of function, you have *copy* of the thing, that you passed. Lets analyse your code with that in mind: ``` void test(char **...
14,113
I’m currently building a Desktop add-in tool with ArcObjects that: 1. Asks a user to select a feature class 2. Reprojects the feature class to Web Mercator 3. Executes some geoprocessing The initial coordinate system of the feature class could be one of many different geographic or projected systems. As a result I ne...
2011/08/29
[ "https://gis.stackexchange.com/questions/14113", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/3001/" ]
See c# code below. (Updated: refactored) ``` using System; using System.Collections.Generic; using System.Text; using System.IO; using ESRI.ArcGIS.Geometry; using System.Windows.Forms; using ESRI.ArcGIS.Carto; using ESRI.ArcGIS.Geodatabase; using ESRI.ArcGIS.Framework; namespace HansenAddin { public class PickGeo...
For the GetDir method, the second and third parameters should be the factory codes of the base geographic coordinate systems of the source and target coordinate systems. For projected coordinate systems, the ISpatialReference interface will provide the factory code of the coordinate system but not the base geographic c...
14,113
I’m currently building a Desktop add-in tool with ArcObjects that: 1. Asks a user to select a feature class 2. Reprojects the feature class to Web Mercator 3. Executes some geoprocessing The initial coordinate system of the feature class could be one of many different geographic or projected systems. As a result I ne...
2011/08/29
[ "https://gis.stackexchange.com/questions/14113", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/3001/" ]
See c# code below. (Updated: refactored) ``` using System; using System.Collections.Generic; using System.Text; using System.IO; using ESRI.ArcGIS.Geometry; using System.Windows.Forms; using ESRI.ArcGIS.Carto; using ESRI.ArcGIS.Geodatabase; using ESRI.ArcGIS.Framework; namespace HansenAddin { public class PickGeo...
The simplest method is write a python script (arcpy) and expose it how toolbox in arcobjects. Then you use arcobjects and call this tool. In arcpy you have ListTransformations (<http://resources.arcgis.com/en/help/main/10.1/index.html#/ListTransformations/018v0000001p000000/>) toolbox tool exposed with a toolbox: ``...
20,953,263
I'd like to return a total count, then also return the results of the where statement. ``` SELECT count(cases) from `table` WHERE stats = 'open'. ``` The above will count where stats = open, I need to do a count first of all cases, then also do a count of the where statement. Something like: ``` SELECT count(case...
2014/01/06
[ "https://Stackoverflow.com/questions/20953263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2096113/" ]
``` SELECT SUM( stats = 'open' ), -- count of all stats open SUM( stats <> 'open' ) -- count of all stats NOT open from `table`; ```
Try using : ``` SELECT COUNT(cases) FROM `table` HAVING stats = COUNT(open) ```
17,453,398
Maybe the question is easy, but I did not find the answer In my model I have rule: ``` array('name', 'length', 'max'=>65), ``` In my view I have code: ``` $form->textField($model,'name'); ``` After rendering i have: ``` <input id="name" type="text" value="" maxlength="65" name="name"> ``` Everything fine, bu...
2013/07/03
[ "https://Stackoverflow.com/questions/17453398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1964092/" ]
Try this: ``` foreach ($model->getValidators('name') as $validator) { if ($validator instanceof CStringValidator && $validator->max !== null) { echo 'this is the max length ' . $validator->max; break; } } ``` This would return all validators for the 'name' attribute. Then search for the `CStr...
You could use: ``` $model->getValidators('name'); ``` which would return you array of validators applied to 'name' attribute. Then find StringValidator and its field named 'max', for this example.
48,506,267
I'd like to develop a webpage that I can attack scripts to that reside in a bundle.js file. The problem is I can't for the life of me get my class to become visible to my html. I believe this must be a simple thing to do? First, my typescript **first.ts** ``` export class Startup { constructor(){ co...
2018/01/29
[ "https://Stackoverflow.com/questions/48506267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/371933/" ]
First, you should specify the `table` element before `tbody` to be conform to [the `table` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table) : > > Permitted content > > > In this order: > > > * an optional caption element, > * zero or more colgroup elements, > * an optional thead element, ...
You can use markdown style table. It's more readable than HTML one for developers. Example: ``` /** * 2 Device Connected possible states matrix * | | DIALING | ON_HOLD | RINGING | ON_CALL | IDLE | |---------|---------|---------|---------|---------|------| | DIALING | -- | YES | YES | YES ...
48,506,267
I'd like to develop a webpage that I can attack scripts to that reside in a bundle.js file. The problem is I can't for the life of me get my class to become visible to my html. I believe this must be a simple thing to do? First, my typescript **first.ts** ``` export class Startup { constructor(){ co...
2018/01/29
[ "https://Stackoverflow.com/questions/48506267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/371933/" ]
First, you should specify the `table` element before `tbody` to be conform to [the `table` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table) : > > Permitted content > > > In this order: > > > * an optional caption element, > * zero or more colgroup elements, > * an optional thead element, ...
You can use this [tool](https://ozh.github.io/ascii-tables/) and specify the output style is HTML.
48,506,267
I'd like to develop a webpage that I can attack scripts to that reside in a bundle.js file. The problem is I can't for the life of me get my class to become visible to my html. I believe this must be a simple thing to do? First, my typescript **first.ts** ``` export class Startup { constructor(){ co...
2018/01/29
[ "https://Stackoverflow.com/questions/48506267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/371933/" ]
As an alternative variant use `<pre></pre>` tag to render [markdown tables](https://www.tablesgenerator.com/markdown_tables#) ``` /** * Description * <pre> | Key | Value | |-------|-------------| | 1 | Value1 | | 2 | Value2 | *</pre> */ ``` Generates: ![](https://i.stack.imgur.com...
You can use markdown style table. It's more readable than HTML one for developers. Example: ``` /** * 2 Device Connected possible states matrix * | | DIALING | ON_HOLD | RINGING | ON_CALL | IDLE | |---------|---------|---------|---------|---------|------| | DIALING | -- | YES | YES | YES ...
48,506,267
I'd like to develop a webpage that I can attack scripts to that reside in a bundle.js file. The problem is I can't for the life of me get my class to become visible to my html. I believe this must be a simple thing to do? First, my typescript **first.ts** ``` export class Startup { constructor(){ co...
2018/01/29
[ "https://Stackoverflow.com/questions/48506267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/371933/" ]
You can use markdown style table. It's more readable than HTML one for developers. Example: ``` /** * 2 Device Connected possible states matrix * | | DIALING | ON_HOLD | RINGING | ON_CALL | IDLE | |---------|---------|---------|---------|---------|------| | DIALING | -- | YES | YES | YES ...
You can use this [tool](https://ozh.github.io/ascii-tables/) and specify the output style is HTML.
48,506,267
I'd like to develop a webpage that I can attack scripts to that reside in a bundle.js file. The problem is I can't for the life of me get my class to become visible to my html. I believe this must be a simple thing to do? First, my typescript **first.ts** ``` export class Startup { constructor(){ co...
2018/01/29
[ "https://Stackoverflow.com/questions/48506267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/371933/" ]
As an alternative variant use `<pre></pre>` tag to render [markdown tables](https://www.tablesgenerator.com/markdown_tables#) ``` /** * Description * <pre> | Key | Value | |-------|-------------| | 1 | Value1 | | 2 | Value2 | *</pre> */ ``` Generates: ![](https://i.stack.imgur.com...
You can use this [tool](https://ozh.github.io/ascii-tables/) and specify the output style is HTML.
18,160,623
``` select distinct vtw.lastname, vtw.firstname, vtw.dob, vtw.clubnumber, vtw.tournamentname, vtw.BossTournamentID, vtw.tournamentdatetime, vtw.tournamentid, tp.tournamentprizeid, tp.status, tp.place, p.prizeid,p.prizename, tp.bRedeemed, tp.CouponNumber from vwTournamentWinners vtw, tournamentprizes tp, prizes p wher...
2013/08/10
[ "https://Stackoverflow.com/questions/18160623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1742357/" ]
change the second select statement to: ``` SELECT BossID, Status, CouponNumber, FK_PrizeID, FK_WinnerID, PrizeName, FirstName, LastName, DOB , '', '' , '', '', '', '' ``` To ensure that both queries return the same amount of fields
select distinct vtw.lastname, vtw.firstname, vtw.dob, vtw.clubnumber, vtw.tournamentname, vtw.BossTournamentID, vtw.tournamentdatetime, vtw.tournamentid, tp.tournamentprizeid, tp.status, tp.place, p.prizeid, p.prizename, tp.bRedeemed, tp.CouponNumber, NULL from vwTournamentWinners vtw, tournamentprizes tp, prizes p w...
7,218,867
Well I have a WampServer installed on my WinXP box with PHP 3.5.3 and apache 2.2.17. Strangely the try catch block doesnt work, after some googling I could only find that the bug lies in eaccelerator (but phpinfo showed no trace of it). where am i going wrong?? ``` try{ echo "from try"; parent::conect(); }catch(Excep...
2011/08/28
[ "https://Stackoverflow.com/questions/7218867", "https://Stackoverflow.com", "https://Stackoverflow.com/users/751937/" ]
> > Notice: Undefined variable: a in blah on line 4 > > > This is not an exception. It is an error message. Or more specifically a notice, which classifies as debug message. Try/Catch will not capture them in a default PHP setup. You would need an error [handler](http://php.net/set_error_handler) which converts t...
Notice is not Exception. You can not catch it by try catch.
17,886,409
I have a tftp script here that when run it just hangs and brings me to a blank line (which tells me it's hanging). I can quit the script by Ctrl+C... ``` #!/bin/bash hostname=$1; filename=$2; tftp <</dev/null mode binary get $hostname:$filename quit ``` I have also tried to add EOF at the end of the script, but tha...
2013/07/26
[ "https://Stackoverflow.com/questions/17886409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/924501/" ]
You have /dev/null as a here document "delimiter" Try some random set of characters like EOF that have no meaning to the shell. And terminate the here doc ``` tftp <<-EOF mode binary get $hostname:$filename quit EOF ```
Okay so I just made this a background process by appending & to the end of the command. Then I ran $ echo $! for the PID. Then I ran $ kill PID. That was my solution to this, for now at least.
1,771
Although this may seem as a trivial question (not a trivial answer) I think to fully understand the question takes some serious thinking. Here I don't mean symbiosis as just existing near each other, I mean a form of mutualism. Many aquatic species experience this. When considering the concept of enforced symbiosis -...
2011/11/30
[ "https://philosophy.stackexchange.com/questions/1771", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/1157/" ]
It seems like you've already answered your own question, except I'm not sure it's typically called "symbiosis". The term is usually [used in biological contexts](http://en.wikipedia.org/wiki/Symbiosis); I think you're interested in more basically the idea of a [social contract](http://en.wikipedia.org/wiki/Social_contr...
The answer seems to be yes, from my understanding of the question. Taking the example of the tragedy of the commons, a group of people might jointly decide to hire a guard to make sure that none of use to much of a common resource. If they pay for the privilege, it shows that they benefit, and given that they are the...
1,771
Although this may seem as a trivial question (not a trivial answer) I think to fully understand the question takes some serious thinking. Here I don't mean symbiosis as just existing near each other, I mean a form of mutualism. Many aquatic species experience this. When considering the concept of enforced symbiosis -...
2011/11/30
[ "https://philosophy.stackexchange.com/questions/1771", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/1157/" ]
The answer seems to be yes, from my understanding of the question. Taking the example of the tragedy of the commons, a group of people might jointly decide to hire a guard to make sure that none of use to much of a common resource. If they pay for the privilege, it shows that they benefit, and given that they are the...
@mikhail: Kisho Kurakawa published a book entitled "The Philosophy of Symbiosis", in the 1950's. He was part of a forward thinking group of architects, designers, and artists who were rebuilding Japan after WWII. The name of the group was Metabolism, which is interesting in and of itself because of the symbiotic relati...
1,771
Although this may seem as a trivial question (not a trivial answer) I think to fully understand the question takes some serious thinking. Here I don't mean symbiosis as just existing near each other, I mean a form of mutualism. Many aquatic species experience this. When considering the concept of enforced symbiosis -...
2011/11/30
[ "https://philosophy.stackexchange.com/questions/1771", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/1157/" ]
It seems like you've already answered your own question, except I'm not sure it's typically called "symbiosis". The term is usually [used in biological contexts](http://en.wikipedia.org/wiki/Symbiosis); I think you're interested in more basically the idea of a [social contract](http://en.wikipedia.org/wiki/Social_contr...
@mikhail: Kisho Kurakawa published a book entitled "The Philosophy of Symbiosis", in the 1950's. He was part of a forward thinking group of architects, designers, and artists who were rebuilding Japan after WWII. The name of the group was Metabolism, which is interesting in and of itself because of the symbiotic relati...
18,336,663
Is there a way to check if TinyMCE is in fullscreen mode? I would like to press 'Esc' to exit full screen mode butI also use 'Esc' to cancel editing. Hence I would like a way to first check if the editor is in fullscereen mode.
2013/08/20
[ "https://Stackoverflow.com/questions/18336663", "https://Stackoverflow.com", "https://Stackoverflow.com/users/690430/" ]
When TinyMCE is in Fullscreen Mode "mce-fullscreen" class is appended to body tag. So all you need to do is check for the existence of mce-fullscreen class. ``` if $('.mce-fullscreen').length{ // Do something here,the editor is in fullscreen mode } ```
If you have access to the editor object: `editor.plugins.fullscreen.isFullscreen();`
18,336,663
Is there a way to check if TinyMCE is in fullscreen mode? I would like to press 'Esc' to exit full screen mode butI also use 'Esc' to cancel editing. Hence I would like a way to first check if the editor is in fullscereen mode.
2013/08/20
[ "https://Stackoverflow.com/questions/18336663", "https://Stackoverflow.com", "https://Stackoverflow.com/users/690430/" ]
When TinyMCE is in Fullscreen Mode "mce-fullscreen" class is appended to body tag. So all you need to do is check for the existence of mce-fullscreen class. ``` if $('.mce-fullscreen').length{ // Do something here,the editor is in fullscreen mode } ```
This way is quick and simple. ``` var catchFulscreen = function() { if( $('.mce-fullscreen').length > 1){ console.log('Now the editor is on fullscreen mode'); } } setInterval(catchFulscreen, 100); ``` This code was tested on TinyMce 4.1.x But I had wanted to know to access inited TinyMce Obj...
18,336,663
Is there a way to check if TinyMCE is in fullscreen mode? I would like to press 'Esc' to exit full screen mode butI also use 'Esc' to cancel editing. Hence I would like a way to first check if the editor is in fullscereen mode.
2013/08/20
[ "https://Stackoverflow.com/questions/18336663", "https://Stackoverflow.com", "https://Stackoverflow.com/users/690430/" ]
If you have access to the editor object: `editor.plugins.fullscreen.isFullscreen();`
This way is quick and simple. ``` var catchFulscreen = function() { if( $('.mce-fullscreen').length > 1){ console.log('Now the editor is on fullscreen mode'); } } setInterval(catchFulscreen, 100); ``` This code was tested on TinyMce 4.1.x But I had wanted to know to access inited TinyMce Obj...
18,336,663
Is there a way to check if TinyMCE is in fullscreen mode? I would like to press 'Esc' to exit full screen mode butI also use 'Esc' to cancel editing. Hence I would like a way to first check if the editor is in fullscereen mode.
2013/08/20
[ "https://Stackoverflow.com/questions/18336663", "https://Stackoverflow.com", "https://Stackoverflow.com/users/690430/" ]
The [fullscreen plugin](https://github.com/tinymce/tinymce/blob/master/js/tinymce/plugins/fullscreen/plugin.js#L88) fires an event, when its state changes: ``` var tinyOptions = { plugins: [ 'fullscreen' ], setup: function(editor) { editor.on('FullscreenStateChanged', function(e) { ...
If you have access to the editor object: `editor.plugins.fullscreen.isFullscreen();`
18,336,663
Is there a way to check if TinyMCE is in fullscreen mode? I would like to press 'Esc' to exit full screen mode butI also use 'Esc' to cancel editing. Hence I would like a way to first check if the editor is in fullscereen mode.
2013/08/20
[ "https://Stackoverflow.com/questions/18336663", "https://Stackoverflow.com", "https://Stackoverflow.com/users/690430/" ]
The [fullscreen plugin](https://github.com/tinymce/tinymce/blob/master/js/tinymce/plugins/fullscreen/plugin.js#L88) fires an event, when its state changes: ``` var tinyOptions = { plugins: [ 'fullscreen' ], setup: function(editor) { editor.on('FullscreenStateChanged', function(e) { ...
This way is quick and simple. ``` var catchFulscreen = function() { if( $('.mce-fullscreen').length > 1){ console.log('Now the editor is on fullscreen mode'); } } setInterval(catchFulscreen, 100); ``` This code was tested on TinyMce 4.1.x But I had wanted to know to access inited TinyMce Obj...
48,376
Suggest an explanation and method of improvement when a reaction has negative yield i.e. the mass of container with product is less than the mass of empty container. This happened to me twice in an orgo lab and I have no idea whats going on.
2016/03/23
[ "https://chemistry.stackexchange.com/questions/48376", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/27546/" ]
If the mass of the container with product is less than without then there are some possible mistakes: * you wrote down/used the wrong mass/container * you weighted the empty container with plug/screw cap and afterwards without * you changed the plug/screw cap * you had the container filled with a gas with higher densi...
At the risk of stating the obvious, one possible explanation is the release of a volatile product. Thus the use of thionyl chloride to produce an acyl chloride releases Sulphur dioxide which release takes mass with it.
9,207,762
I have some changed files I don't want to commit (e.g. web.config). Before I pull and update to new changesets, I have to shelve them. After the pull & update, I have to unshelve them. I'm currently using TortoiseHG. Is there any extension which can do this automatically?
2012/02/09
[ "https://Stackoverflow.com/questions/9207762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/210501/" ]
In Mercurial, just `hg pull -u`. Uncommitted changes are merged with the tip. Same result as shelve, pull/update, unshelve. With TortoiseHg a dialog will come up prompting for discard/shelve/merge. You may get a merge dialog this way but that would be true with the shelving approach because unshelve may have to merge ...
I would try a few different things with this. Regarding the Web.config file in particular, you might want to look at using local configuration files for overrides instead of leaving local changes uncommitted. (e.g. referencing an separate file that is in .hgignore). Projects I've worked on in the past did this to sep...
9,207,762
I have some changed files I don't want to commit (e.g. web.config). Before I pull and update to new changesets, I have to shelve them. After the pull & update, I have to unshelve them. I'm currently using TortoiseHG. Is there any extension which can do this automatically?
2012/02/09
[ "https://Stackoverflow.com/questions/9207762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/210501/" ]
I'd suggest something else: instead of always shelving and unshelving, you could use two different config files: one which is part of the repository and contains dummy/example data, and another one which each user really uses locally, which is ignored by Mercurial. Check out [this answer](https://stackoverflow.com/a/7...
I would try a few different things with this. Regarding the Web.config file in particular, you might want to look at using local configuration files for overrides instead of leaving local changes uncommitted. (e.g. referencing an separate file that is in .hgignore). Projects I've worked on in the past did this to sep...
9,207,762
I have some changed files I don't want to commit (e.g. web.config). Before I pull and update to new changesets, I have to shelve them. After the pull & update, I have to unshelve them. I'm currently using TortoiseHG. Is there any extension which can do this automatically?
2012/02/09
[ "https://Stackoverflow.com/questions/9207762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/210501/" ]
I'd suggest something else: instead of always shelving and unshelving, you could use two different config files: one which is part of the repository and contains dummy/example data, and another one which each user really uses locally, which is ignored by Mercurial. Check out [this answer](https://stackoverflow.com/a/7...
In Mercurial, just `hg pull -u`. Uncommitted changes are merged with the tip. Same result as shelve, pull/update, unshelve. With TortoiseHg a dialog will come up prompting for discard/shelve/merge. You may get a merge dialog this way but that would be true with the shelving approach because unshelve may have to merge ...
9,207,762
I have some changed files I don't want to commit (e.g. web.config). Before I pull and update to new changesets, I have to shelve them. After the pull & update, I have to unshelve them. I'm currently using TortoiseHG. Is there any extension which can do this automatically?
2012/02/09
[ "https://Stackoverflow.com/questions/9207762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/210501/" ]
In Mercurial, just `hg pull -u`. Uncommitted changes are merged with the tip. Same result as shelve, pull/update, unshelve. With TortoiseHg a dialog will come up prompting for discard/shelve/merge. You may get a merge dialog this way but that would be true with the shelving approach because unshelve may have to merge ...
Direct answer: <https://pypi.org/project/hg-autoshelve/> But a dedicated repository for configuration files seems a better idea as suggested by Christian Specht [there](https://stackoverflow.com/a/9233794/1548319)
9,207,762
I have some changed files I don't want to commit (e.g. web.config). Before I pull and update to new changesets, I have to shelve them. After the pull & update, I have to unshelve them. I'm currently using TortoiseHG. Is there any extension which can do this automatically?
2012/02/09
[ "https://Stackoverflow.com/questions/9207762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/210501/" ]
I'd suggest something else: instead of always shelving and unshelving, you could use two different config files: one which is part of the repository and contains dummy/example data, and another one which each user really uses locally, which is ignored by Mercurial. Check out [this answer](https://stackoverflow.com/a/7...
Direct answer: <https://pypi.org/project/hg-autoshelve/> But a dedicated repository for configuration files seems a better idea as suggested by Christian Specht [there](https://stackoverflow.com/a/9233794/1548319)
53,591,559
I have four `bool` values: ``` bool bValue1; bool bValue2; bool bValue3; bool bValue4; ``` The acceptable values are: ``` Scenario 1 | Scenario 2 | Scenario 3 bValue1: true | true | true bValue2: true | true | false bValue3: true | true | false bValue4: true | fals...
2018/12/03
[ "https://Stackoverflow.com/questions/53591559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2287576/" ]
Here's a simplified version: ``` if (bValue1 && (bValue2 == bValue3) && (bValue2 || !bValue4)) { // acceptable } else { // not acceptable } ``` Note, of course, this solution is more obfuscated than the original one, its meaning may be harder to understand. --- Update: MSalters in the comments found an eve...
You won't have to worry about invalid combinations of boolean flags if you get rid of the boolean flags. > > The acceptable values are: > > > > ``` > Scenario 1 | Scenario 2 | Scenario 3 > bValue1: true | true | true > bValue2: true | true | false > bValue3: true | true ...
53,591,559
I have four `bool` values: ``` bool bValue1; bool bValue2; bool bValue3; bool bValue4; ``` The acceptable values are: ``` Scenario 1 | Scenario 2 | Scenario 3 bValue1: true | true | true bValue2: true | true | false bValue3: true | true | false bValue4: true | fals...
2018/12/03
[ "https://Stackoverflow.com/questions/53591559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2287576/" ]
The real question here is: what happens when another developer (or even author) must change this code few months later. I would suggest modelling this as bit flags: ``` const int SCENARIO_1 = 0x0F; // 0b1111 if using c++14 const int SCENARIO_2 = 0x0E; // 0b1110 const int SCENARIO_3 = 0x08; // 0b1000 bool bValue1 = t...
I would also like to submit an other approach. My idea is to convert the bools into an integer and then compare using variadic templates: ``` unsigned bitmap_from_bools(bool b) { return b; } template<typename... args> unsigned bitmap_from_bools(bool b, args... pack) { return (bitmap_from_bools(b) << sizeof......
53,591,559
I have four `bool` values: ``` bool bValue1; bool bValue2; bool bValue3; bool bValue4; ``` The acceptable values are: ``` Scenario 1 | Scenario 2 | Scenario 3 bValue1: true | true | true bValue2: true | true | false bValue3: true | true | false bValue4: true | fals...
2018/12/03
[ "https://Stackoverflow.com/questions/53591559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2287576/" ]
As suggested by mch, you could do: ``` if(!((bValue1 && bValue2 && bValue3) || (bValue1 && !bValue2 && !bValue3 && !bValue4)) ) ``` where the first line covers the two first good cases, and the second line covers the last one. `[Live Demo](https://wandbox.org/permlink/UL1NPB108xvaP0zX)`, where I played around an...
Nested `if`s could be easier to read for some people. Here is my version ``` bool check(int bValue1, int bValue2, int bValue3, int bValue4) { if (bValue1) { if (bValue2) { // scenario 1-2 return bValue3; } else { // scenario 3 return !bValue3 && !bValue4; } } re...
53,591,559
I have four `bool` values: ``` bool bValue1; bool bValue2; bool bValue3; bool bValue4; ``` The acceptable values are: ``` Scenario 1 | Scenario 2 | Scenario 3 bValue1: true | true | true bValue2: true | true | false bValue3: true | true | false bValue4: true | fals...
2018/12/03
[ "https://Stackoverflow.com/questions/53591559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2287576/" ]
My previous answer is already the accepted answer, I add something here that I think is both readable, easy and in this case open to future modifications: Starting with @ZdeslavVojkovic answer (which I find quite good), I came up with this: ``` #include <iostream> #include <set> //using namespace std; int GetScenar...
``` If (!bValue1 || (bValue2 != bValue3) || (!bValue4 && bValue2)) { // you have a problem } ``` * b1 must always be true * b2 must always equal b3 * and b4 cannot be false if b2 (and b3) are true simple
53,591,559
I have four `bool` values: ``` bool bValue1; bool bValue2; bool bValue3; bool bValue4; ``` The acceptable values are: ``` Scenario 1 | Scenario 2 | Scenario 3 bValue1: true | true | true bValue2: true | true | false bValue3: true | true | false bValue4: true | fals...
2018/12/03
[ "https://Stackoverflow.com/questions/53591559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2287576/" ]
I'm not seeing any answers saying to name the scenarios, though the OP's solution does exactly that. To me it is best to encapsulate the comment of what each scenario is into either a variable name or function name. You're more likely to ignore a comment than a name, and if your logic changes in the future you're more...
use **bit field**: ``` unoin { struct { bool b1: 1; bool b2: 1; bool b3: 1; bool b4: 1; } b; int i; } u; // set: u.b.b1=true; ... // test if (u.i == 0x0f) {...} if (u.i == 0x0e) {...} if (u.i == 0x08) {...} ``` **PS**: That's a big pity to CPPers'. But, UB is not my worry, check it at <http:...
53,591,559
I have four `bool` values: ``` bool bValue1; bool bValue2; bool bValue3; bool bValue4; ``` The acceptable values are: ``` Scenario 1 | Scenario 2 | Scenario 3 bValue1: true | true | true bValue2: true | true | false bValue3: true | true | false bValue4: true | fals...
2018/12/03
[ "https://Stackoverflow.com/questions/53591559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2287576/" ]
A slight variation on @GianPaolo's fine answer, which some may find easier to read: ``` bool any_of_three_scenarios(bool v1, bool v2, bool v3, bool v4) { return (v1 && v2 && v3 && v4) // scenario 1 || (v1 && v2 && v3 && !v4) // scenario 2 || (v1 && !v2 && !v3 && !v4); // scenario 3 } if (any_of_t...
``` if(!bValue1) return false; if(bValue2 != bValue3) return false; if(bValue3 == false && bValuer4 == true) return false; return true; ```
53,591,559
I have four `bool` values: ``` bool bValue1; bool bValue2; bool bValue3; bool bValue4; ``` The acceptable values are: ``` Scenario 1 | Scenario 2 | Scenario 3 bValue1: true | true | true bValue2: true | true | false bValue3: true | true | false bValue4: true | fals...
2018/12/03
[ "https://Stackoverflow.com/questions/53591559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2287576/" ]
Every answer is overly complex and difficult to read. The best solution to this is a `switch()` statement. It is both readable and makes adding/modifying additional cases simple. Compilers are good at optimising `switch()` statements too. ``` switch( (bValue4 << 3) | (bValue3 << 2) | (bValue2 << 1) | (bValue1) ) { ...
You won't have to worry about invalid combinations of boolean flags if you get rid of the boolean flags. > > The acceptable values are: > > > > ``` > Scenario 1 | Scenario 2 | Scenario 3 > bValue1: true | true | true > bValue2: true | true | false > bValue3: true | true ...
53,591,559
I have four `bool` values: ``` bool bValue1; bool bValue2; bool bValue3; bool bValue4; ``` The acceptable values are: ``` Scenario 1 | Scenario 2 | Scenario 3 bValue1: true | true | true bValue2: true | true | false bValue3: true | true | false bValue4: true | fals...
2018/12/03
[ "https://Stackoverflow.com/questions/53591559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2287576/" ]
I would aim for simplicity and readability. ``` bool scenario1 = bValue1 && bValue2 && bValue3 && bValue4; bool scenario2 = bValue1 && bValue2 && bValue3 && !bValue4; bool scenario3 = bValue1 && !bValue2 && !bValue3 && !bValue4; if (scenario1 || scenario2 || scenario3) { // Do whatever. } ``` Make sure to repla...
**Focus on readability of the problem, not the specific "if" statement.** While this will produce more lines of code, and some may consider it either overkill or unnecessary. I'd suggest that abstracting your scenarios from the specific booleans is the best way to maintain readability. By splitting things into classe...
53,591,559
I have four `bool` values: ``` bool bValue1; bool bValue2; bool bValue3; bool bValue4; ``` The acceptable values are: ``` Scenario 1 | Scenario 2 | Scenario 3 bValue1: true | true | true bValue2: true | true | false bValue3: true | true | false bValue4: true | fals...
2018/12/03
[ "https://Stackoverflow.com/questions/53591559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2287576/" ]
**Focus on readability of the problem, not the specific "if" statement.** While this will produce more lines of code, and some may consider it either overkill or unnecessary. I'd suggest that abstracting your scenarios from the specific booleans is the best way to maintain readability. By splitting things into classe...
Doing bitwise operation looks very clean and understandable. ``` int bitwise = (bValue4 << 3) | (bValue3 << 2) | (bValue2 << 1) | (bValue1); if (bitwise == 0b1111 || bitwise == 0b0111 || bitwise == 0b0001) { //satisfying condition } ```
53,591,559
I have four `bool` values: ``` bool bValue1; bool bValue2; bool bValue3; bool bValue4; ``` The acceptable values are: ``` Scenario 1 | Scenario 2 | Scenario 3 bValue1: true | true | true bValue2: true | true | false bValue3: true | true | false bValue4: true | fals...
2018/12/03
[ "https://Stackoverflow.com/questions/53591559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2287576/" ]
My previous answer is already the accepted answer, I add something here that I think is both readable, easy and in this case open to future modifications: Starting with @ZdeslavVojkovic answer (which I find quite good), I came up with this: ``` #include <iostream> #include <set> //using namespace std; int GetScenar...
The accepted answer is fine when you've only got 3 cases, and where the logic for each is simple. But if the logic for each case were more complicated, or there are many more cases, a far better option is to use the [chain-of-responsibility](https://en.wikipedia.org/wiki/Chain-of-responsibility_pattern) design pattern...
26,113,161
Ok so I have been at this same error for about 18 hours and am totally lost. What I am trying to do is conduct a binary search where the search begins in the middle of the array and then eliminates half of the array everytime by comparing the term that was searched for to the middle term. So far my code is not producin...
2014/09/30
[ "https://Stackoverflow.com/questions/26113161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2034639/" ]
Alright thank you to RegularExpression for the suggestion to look at a method for comparing strings. I changed the code `if (contacts[middle] == searchTerm)` and `else if (contacts[middle] > searchTerm)` to `if (string.Compare(contacts[middle], searchTerm, true) == 0)` and `else if (string.Compare(contacts[middle...
If you want to solve this problem without using built-in Extension and Helper of programming language You Should do this : ( See the [online demo](https://dotnetfiddle.net/MylWxQ)) > > important: Your `Array` should be `sorted` because the `Binarry-Search` is not working on the `UnSorted` list. > > > ``` static ...
26,113,161
Ok so I have been at this same error for about 18 hours and am totally lost. What I am trying to do is conduct a binary search where the search begins in the middle of the array and then eliminates half of the array everytime by comparing the term that was searched for to the middle term. So far my code is not producin...
2014/09/30
[ "https://Stackoverflow.com/questions/26113161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2034639/" ]
Just use the [`List<T>.BinarySearch`](http://msdn.microsoft.com/en-us/library/w4e7fxsh(v=vs.110).aspx) method. ``` List<String> myList = new List<String>{"Apple", "Microsoft", "Yahoo", "StackOverflow" }; myList.Sort(); //Apple Microsoft StackOverflow Yahoo myList.BinarySearch("Yahoo"); // 3 ``` Or if using `Array`:...
Well, have you tried : ``` contacts.ToList().BinarySearch(searchTerm); ```
26,113,161
Ok so I have been at this same error for about 18 hours and am totally lost. What I am trying to do is conduct a binary search where the search begins in the middle of the array and then eliminates half of the array everytime by comparing the term that was searched for to the middle term. So far my code is not producin...
2014/09/30
[ "https://Stackoverflow.com/questions/26113161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2034639/" ]
Look at this method for comparing strings. It will tell you whether a string is greater, less, or equal (in value) to another string: <http://msdn.microsoft.com/en-us/library/zkcaxw5y%28v=vs.110%29.aspx>
If you want to solve this problem without using built-in Extension and Helper of programming language You Should do this : ( See the [online demo](https://dotnetfiddle.net/MylWxQ)) > > important: Your `Array` should be `sorted` because the `Binarry-Search` is not working on the `UnSorted` list. > > > ``` static ...
26,113,161
Ok so I have been at this same error for about 18 hours and am totally lost. What I am trying to do is conduct a binary search where the search begins in the middle of the array and then eliminates half of the array everytime by comparing the term that was searched for to the middle term. So far my code is not producin...
2014/09/30
[ "https://Stackoverflow.com/questions/26113161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2034639/" ]
Look at this method for comparing strings. It will tell you whether a string is greater, less, or equal (in value) to another string: <http://msdn.microsoft.com/en-us/library/zkcaxw5y%28v=vs.110%29.aspx>
Well, have you tried : ``` contacts.ToList().BinarySearch(searchTerm); ```
26,113,161
Ok so I have been at this same error for about 18 hours and am totally lost. What I am trying to do is conduct a binary search where the search begins in the middle of the array and then eliminates half of the array everytime by comparing the term that was searched for to the middle term. So far my code is not producin...
2014/09/30
[ "https://Stackoverflow.com/questions/26113161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2034639/" ]
Just use the [`List<T>.BinarySearch`](http://msdn.microsoft.com/en-us/library/w4e7fxsh(v=vs.110).aspx) method. ``` List<String> myList = new List<String>{"Apple", "Microsoft", "Yahoo", "StackOverflow" }; myList.Sort(); //Apple Microsoft StackOverflow Yahoo myList.BinarySearch("Yahoo"); // 3 ``` Or if using `Array`:...
If you want to solve this problem without using built-in Extension and Helper of programming language You Should do this : ( See the [online demo](https://dotnetfiddle.net/MylWxQ)) > > important: Your `Array` should be `sorted` because the `Binarry-Search` is not working on the `UnSorted` list. > > > ``` static ...
26,113,161
Ok so I have been at this same error for about 18 hours and am totally lost. What I am trying to do is conduct a binary search where the search begins in the middle of the array and then eliminates half of the array everytime by comparing the term that was searched for to the middle term. So far my code is not producin...
2014/09/30
[ "https://Stackoverflow.com/questions/26113161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2034639/" ]
Alright thank you to RegularExpression for the suggestion to look at a method for comparing strings. I changed the code `if (contacts[middle] == searchTerm)` and `else if (contacts[middle] > searchTerm)` to `if (string.Compare(contacts[middle], searchTerm, true) == 0)` and `else if (string.Compare(contacts[middle...
Well, have you tried : ``` contacts.ToList().BinarySearch(searchTerm); ```
26,113,161
Ok so I have been at this same error for about 18 hours and am totally lost. What I am trying to do is conduct a binary search where the search begins in the middle of the array and then eliminates half of the array everytime by comparing the term that was searched for to the middle term. So far my code is not producin...
2014/09/30
[ "https://Stackoverflow.com/questions/26113161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2034639/" ]
Alright thank you to RegularExpression for the suggestion to look at a method for comparing strings. I changed the code `if (contacts[middle] == searchTerm)` and `else if (contacts[middle] > searchTerm)` to `if (string.Compare(contacts[middle], searchTerm, true) == 0)` and `else if (string.Compare(contacts[middle...
If you want to do a binary search on a string array this is the way to do it. You may want to choose a different Culture for the StringComparer. ``` string[] arr = {"a","b","c","d","e","f","g"}; int k = Array.BinarySearch(arr,"d",StringComparer.InvariantCulture); ```
26,113,161
Ok so I have been at this same error for about 18 hours and am totally lost. What I am trying to do is conduct a binary search where the search begins in the middle of the array and then eliminates half of the array everytime by comparing the term that was searched for to the middle term. So far my code is not producin...
2014/09/30
[ "https://Stackoverflow.com/questions/26113161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2034639/" ]
Just use the [`List<T>.BinarySearch`](http://msdn.microsoft.com/en-us/library/w4e7fxsh(v=vs.110).aspx) method. ``` List<String> myList = new List<String>{"Apple", "Microsoft", "Yahoo", "StackOverflow" }; myList.Sort(); //Apple Microsoft StackOverflow Yahoo myList.BinarySearch("Yahoo"); // 3 ``` Or if using `Array`:...
If you want to do a binary search on a string array this is the way to do it. You may want to choose a different Culture for the StringComparer. ``` string[] arr = {"a","b","c","d","e","f","g"}; int k = Array.BinarySearch(arr,"d",StringComparer.InvariantCulture); ```
26,113,161
Ok so I have been at this same error for about 18 hours and am totally lost. What I am trying to do is conduct a binary search where the search begins in the middle of the array and then eliminates half of the array everytime by comparing the term that was searched for to the middle term. So far my code is not producin...
2014/09/30
[ "https://Stackoverflow.com/questions/26113161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2034639/" ]
Just use the [`List<T>.BinarySearch`](http://msdn.microsoft.com/en-us/library/w4e7fxsh(v=vs.110).aspx) method. ``` List<String> myList = new List<String>{"Apple", "Microsoft", "Yahoo", "StackOverflow" }; myList.Sort(); //Apple Microsoft StackOverflow Yahoo myList.BinarySearch("Yahoo"); // 3 ``` Or if using `Array`:...
Alright thank you to RegularExpression for the suggestion to look at a method for comparing strings. I changed the code `if (contacts[middle] == searchTerm)` and `else if (contacts[middle] > searchTerm)` to `if (string.Compare(contacts[middle], searchTerm, true) == 0)` and `else if (string.Compare(contacts[middle...
26,113,161
Ok so I have been at this same error for about 18 hours and am totally lost. What I am trying to do is conduct a binary search where the search begins in the middle of the array and then eliminates half of the array everytime by comparing the term that was searched for to the middle term. So far my code is not producin...
2014/09/30
[ "https://Stackoverflow.com/questions/26113161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2034639/" ]
Just use the [`List<T>.BinarySearch`](http://msdn.microsoft.com/en-us/library/w4e7fxsh(v=vs.110).aspx) method. ``` List<String> myList = new List<String>{"Apple", "Microsoft", "Yahoo", "StackOverflow" }; myList.Sort(); //Apple Microsoft StackOverflow Yahoo myList.BinarySearch("Yahoo"); // 3 ``` Or if using `Array`:...
Look at this method for comparing strings. It will tell you whether a string is greater, less, or equal (in value) to another string: <http://msdn.microsoft.com/en-us/library/zkcaxw5y%28v=vs.110%29.aspx>
40,394,168
I have four text files and I want to display it on the browser using the buttons I want to create four buttons when click on the 1st button first text should open. Please help me out from this I'm new to HTML and PHP.
2016/11/03
[ "https://Stackoverflow.com/questions/40394168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6704855/" ]
**To do this you need to read about php file functions.** Refer this link - <http://php.net/manual/en/function.file.php> Try below code: ``` <h2>Click</h2> <form action="" method="post"> <button name="click" class="click">Click me!</button> </form> <?php if(isset($_POST['click'])) { $filenam...
It seems that you dont need to necessarily read the file on the triggered action of clicking a button. If you are already reading the file, load it into a hidden HTML element, like a `<div>`, then use Javascript to show that on the click of the button. PHP: ``` $myFile = "file.txt"; $fh = fopen($myFile, 'r'); ...
17,991,603
I'm using `Jeditable` plugin of [Mika Tuupola](http://www.appelsiini.net/2008/4/autogrow-textarea-for-jeditable) with autogrowing. I've followed his indications but the console shows this error: ![enter image description here](https://i.stack.imgur.com/Y56o3.png) I'm using Symfony2 with `fosjsroutingbundle`; this is ...
2013/08/01
[ "https://Stackoverflow.com/questions/17991603", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The error indicates that you do not have jQuery in place or it is placed in the HTML document after the jEditable plugin. Make sure your scripts tags are sorted just like in the source code of this page: <http://www.appelsiini.net/projects/jeditable/custom.html> and all of them are properly loading. Edit: regarding y...
I had the same problem and it was because I had applied 'async' to the tag. I remove async and everything worked fine.
2,601,155
If the sides of a rectangle are $a+b$ and $\frac{1}{2}(a+b)$ does the area equal to $\frac{1}{2}a^2+\frac{1}{2}b^2$ or did I make a mistake somewhere?
2018/01/11
[ "https://math.stackexchange.com/questions/2601155", "https://math.stackexchange.com", "https://math.stackexchange.com/users/520067/" ]
It should be $\frac{1}{2}(a+b)^2=\frac{a^2+2ab+b^2}{2}\neq\frac{1}{2}a^2+\frac{1}{2}b^2$.
$(a+b)^2$ is not $a^2+b^2 \,! $ ; you should actually get $ \dfrac{a^2+b^2}{2} + ab.$
2,601,155
If the sides of a rectangle are $a+b$ and $\frac{1}{2}(a+b)$ does the area equal to $\frac{1}{2}a^2+\frac{1}{2}b^2$ or did I make a mistake somewhere?
2018/01/11
[ "https://math.stackexchange.com/questions/2601155", "https://math.stackexchange.com", "https://math.stackexchange.com/users/520067/" ]
It should be $\frac{1}{2}(a+b)^2=\frac{a^2+2ab+b^2}{2}\neq\frac{1}{2}a^2+\frac{1}{2}b^2$.
Let $a=2$ and $b=4$. The sides are $6$ and $3$, making the area $18$. But $\dfrac{2^2+4^2}2=10$ !
2,601,155
If the sides of a rectangle are $a+b$ and $\frac{1}{2}(a+b)$ does the area equal to $\frac{1}{2}a^2+\frac{1}{2}b^2$ or did I make a mistake somewhere?
2018/01/11
[ "https://math.stackexchange.com/questions/2601155", "https://math.stackexchange.com", "https://math.stackexchange.com/users/520067/" ]
It should be $\frac{1}{2}(a+b)^2=\frac{a^2+2ab+b^2}{2}\neq\frac{1}{2}a^2+\frac{1}{2}b^2$.
The two sides are a+b and 1/2(a+b) Area = a+b x 1/2(a+b) = a(a/2 +b/2) x b(a/2 + b/2) = (a^2 + 2ba + b^2)/2 = (a+b)^2/2 {ANS}
2,601,155
If the sides of a rectangle are $a+b$ and $\frac{1}{2}(a+b)$ does the area equal to $\frac{1}{2}a^2+\frac{1}{2}b^2$ or did I make a mistake somewhere?
2018/01/11
[ "https://math.stackexchange.com/questions/2601155", "https://math.stackexchange.com", "https://math.stackexchange.com/users/520067/" ]
Let $a=2$ and $b=4$. The sides are $6$ and $3$, making the area $18$. But $\dfrac{2^2+4^2}2=10$ !
$(a+b)^2$ is not $a^2+b^2 \,! $ ; you should actually get $ \dfrac{a^2+b^2}{2} + ab.$
2,601,155
If the sides of a rectangle are $a+b$ and $\frac{1}{2}(a+b)$ does the area equal to $\frac{1}{2}a^2+\frac{1}{2}b^2$ or did I make a mistake somewhere?
2018/01/11
[ "https://math.stackexchange.com/questions/2601155", "https://math.stackexchange.com", "https://math.stackexchange.com/users/520067/" ]
Let $a=2$ and $b=4$. The sides are $6$ and $3$, making the area $18$. But $\dfrac{2^2+4^2}2=10$ !
The two sides are a+b and 1/2(a+b) Area = a+b x 1/2(a+b) = a(a/2 +b/2) x b(a/2 + b/2) = (a^2 + 2ba + b^2)/2 = (a+b)^2/2 {ANS}
41,156,715
``` htmlfile=urllib.request.urlopen("https://hermes.goibibo.com/hotels/v2/search/data/v3/6771549831164675055/{pickUpDate}/{dropOffDate}/1-1_0?s=popularity&cur=INR&f={}&pid=0".format(pickUpDate=pickUpDate, dropOffDate=dropOffDate)) ```
2016/12/15
[ "https://Stackoverflow.com/questions/41156715", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7197858/" ]
You have three `{}` pairs but 2 values in your URL. You need to match the `{}` pairs with the given values. For instance: ``` "{v1} is {v2}. {v3}".format(v1="Cat", v2="Animal", v3="Absolutely!") ``` the string is **"Cat is Animal. Absolutely!"**
htmlfile=urllib.request.urlopen("<https://hermes.goibibo.com/hotels/v2/search/data/v3/6771549831164675055/>"+pickUpDate+"/"+dropOffDate+"/1-1\_0?s=popularity&cur=INR&f={}&pid=0")
41,156,715
``` htmlfile=urllib.request.urlopen("https://hermes.goibibo.com/hotels/v2/search/data/v3/6771549831164675055/{pickUpDate}/{dropOffDate}/1-1_0?s=popularity&cur=INR&f={}&pid=0".format(pickUpDate=pickUpDate, dropOffDate=dropOffDate)) ```
2016/12/15
[ "https://Stackoverflow.com/questions/41156715", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7197858/" ]
At the end of your string you have `"..INR&f={}&pid=0".format()`. If this is not a placeholder into which you want to place text via `.format()`, then change it to have double moustache brackets. i.e: `"...INR&f={{}}&pid=0".format()` This will tell `.format()` that you really just want the brackets to exist there as...
htmlfile=urllib.request.urlopen("<https://hermes.goibibo.com/hotels/v2/search/data/v3/6771549831164675055/>"+pickUpDate+"/"+dropOffDate+"/1-1\_0?s=popularity&cur=INR&f={}&pid=0")
41,156,715
``` htmlfile=urllib.request.urlopen("https://hermes.goibibo.com/hotels/v2/search/data/v3/6771549831164675055/{pickUpDate}/{dropOffDate}/1-1_0?s=popularity&cur=INR&f={}&pid=0".format(pickUpDate=pickUpDate, dropOffDate=dropOffDate)) ```
2016/12/15
[ "https://Stackoverflow.com/questions/41156715", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7197858/" ]
You have three `{}` pairs but 2 values in your URL. You need to match the `{}` pairs with the given values. For instance: ``` "{v1} is {v2}. {v3}".format(v1="Cat", v2="Animal", v3="Absolutely!") ``` the string is **"Cat is Animal. Absolutely!"**
At the end of your string you have `"..INR&f={}&pid=0".format()`. If this is not a placeholder into which you want to place text via `.format()`, then change it to have double moustache brackets. i.e: `"...INR&f={{}}&pid=0".format()` This will tell `.format()` that you really just want the brackets to exist there as...
27,550
I know I can go to the Maps app, and then click on the pin for my current location, and then select to share it, and then pick to send a message (vs. an email etc.) **But I can't find any way to send my location from the messages app, the way I might send a photo.** Which is silly - **how often are you hanging around...
2011/10/13
[ "https://apple.stackexchange.com/questions/27550", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/89/" ]
*Edit:* Sorry, I skimmed a bit and missed that you figured this part out already. I don't believe it can be done directly from the Messages app. In conceptual terms, the iOS model for data sharing is typically such that you send data from an app, but the "sending apps" generally can't grab data from elsewhere. This is ...
MultiTask to maps - drop your pin, share back to SMS/email. I suppose some twitter apps will let you geotag a post, but there's no way to pin an arbitrary SMS or email other than starting from Maps.
27,550
I know I can go to the Maps app, and then click on the pin for my current location, and then select to share it, and then pick to send a message (vs. an email etc.) **But I can't find any way to send my location from the messages app, the way I might send a photo.** Which is silly - **how often are you hanging around...
2011/10/13
[ "https://apple.stackexchange.com/questions/27550", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/89/" ]
*Edit:* Sorry, I skimmed a bit and missed that you figured this part out already. I don't believe it can be done directly from the Messages app. In conceptual terms, the iOS model for data sharing is typically such that you send data from an app, but the "sending apps" generally can't grab data from elsewhere. This is ...
You can search for a location and when the red pin is on the map you can click it and choose to share location. I think this works
27,550
I know I can go to the Maps app, and then click on the pin for my current location, and then select to share it, and then pick to send a message (vs. an email etc.) **But I can't find any way to send my location from the messages app, the way I might send a photo.** Which is silly - **how often are you hanging around...
2011/10/13
[ "https://apple.stackexchange.com/questions/27550", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/89/" ]
*Edit:* Sorry, I skimmed a bit and missed that you figured this part out already. I don't believe it can be done directly from the Messages app. In conceptual terms, the iOS model for data sharing is typically such that you send data from an app, but the "sending apps" generally can't grab data from elsewhere. This is ...
For iOS 8 or later, in iMessage once you have your conversation with the contact(s) you wish to send your location with, tap "Details" and then tap "Send Location".
27,550
I know I can go to the Maps app, and then click on the pin for my current location, and then select to share it, and then pick to send a message (vs. an email etc.) **But I can't find any way to send my location from the messages app, the way I might send a photo.** Which is silly - **how often are you hanging around...
2011/10/13
[ "https://apple.stackexchange.com/questions/27550", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/89/" ]
MultiTask to maps - drop your pin, share back to SMS/email. I suppose some twitter apps will let you geotag a post, but there's no way to pin an arbitrary SMS or email other than starting from Maps.
You can search for a location and when the red pin is on the map you can click it and choose to share location. I think this works
27,550
I know I can go to the Maps app, and then click on the pin for my current location, and then select to share it, and then pick to send a message (vs. an email etc.) **But I can't find any way to send my location from the messages app, the way I might send a photo.** Which is silly - **how often are you hanging around...
2011/10/13
[ "https://apple.stackexchange.com/questions/27550", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/89/" ]
For iOS 8 or later, in iMessage once you have your conversation with the contact(s) you wish to send your location with, tap "Details" and then tap "Send Location".
MultiTask to maps - drop your pin, share back to SMS/email. I suppose some twitter apps will let you geotag a post, but there's no way to pin an arbitrary SMS or email other than starting from Maps.
27,550
I know I can go to the Maps app, and then click on the pin for my current location, and then select to share it, and then pick to send a message (vs. an email etc.) **But I can't find any way to send my location from the messages app, the way I might send a photo.** Which is silly - **how often are you hanging around...
2011/10/13
[ "https://apple.stackexchange.com/questions/27550", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/89/" ]
For iOS 8 or later, in iMessage once you have your conversation with the contact(s) you wish to send your location with, tap "Details" and then tap "Send Location".
You can search for a location and when the red pin is on the map you can click it and choose to share location. I think this works
59,337,427
I am trying to test and example with MasterDetail. You can see the code in: <https://github.com/jrariasf/MD8/tree/master/MD8> The Master have 5 buttons to access to 4 detail pages (Home, MainPage, ViewA, ViewB and ViewC). From ViewA, with 2 buttons I am able to load ViewB and ViewC But I am not able to do that pu...
2019/12/14
[ "https://Stackoverflow.com/questions/59337427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2017712/" ]
One fo the first things you need to do is understand where you are Navigating from. Navigation in Xamarin.Forms is very dependent on where you are Navigating from. Remember that without Prism you would do something like this: ``` var mdp = new MyMasterDetailPage { Detail = new NavigationPage(new ViewA) }; ``` In...
Thanks a lot Dan Siegel ! (@Dan S.) I have just seen your comment, a month ago, sorry. I was a newbie in C# and Xamarin and Prism and I am still a newbie but less :-) I have learnt and tested a lot in the last weeks and I understand better the concepts. After reading you I know that ../{path} is only valid with a N...
3,577
They use silverlight -- therefore I installed moonlight but still get a black screen. Is there a way to watch it on Ubuntu? I now use a virtual (windows xp) machine so I can still watch it, but would like to know it there are possibilities.
2010/09/04
[ "https://askubuntu.com/questions/3577", "https://askubuntu.com", "https://askubuntu.com/users/1793/" ]
Normally speaking, Moonlight would do the job. However Eurosport (amongst others) employ a layer of DRM that Microsoft have not published technical documentation for. If they did, the DRM would likely be rendered completely useless as anybody could write an application that decoded their customers' streams. In the fut...
You might want to try the [Moonlight 3 Preview](http://go-mono.com/moonlight/prerelease.aspx) (this was needed for watching some Olympic video for instance, so may well work for Eurosport)
3,577
They use silverlight -- therefore I installed moonlight but still get a black screen. Is there a way to watch it on Ubuntu? I now use a virtual (windows xp) machine so I can still watch it, but would like to know it there are possibilities.
2010/09/04
[ "https://askubuntu.com/questions/3577", "https://askubuntu.com", "https://askubuntu.com/users/1793/" ]
Eurosport Player now works in Ubuntu with Firefox and Chrome without any additional steps. Hardware acceleration does not work though, but it is browser limitation on Linux based systems.
You might want to try the [Moonlight 3 Preview](http://go-mono.com/moonlight/prerelease.aspx) (this was needed for watching some Olympic video for instance, so may well work for Eurosport)
3,577
They use silverlight -- therefore I installed moonlight but still get a black screen. Is there a way to watch it on Ubuntu? I now use a virtual (windows xp) machine so I can still watch it, but would like to know it there are possibilities.
2010/09/04
[ "https://askubuntu.com/questions/3577", "https://askubuntu.com", "https://askubuntu.com/users/1793/" ]
Normally speaking, Moonlight would do the job. However Eurosport (amongst others) employ a layer of DRM that Microsoft have not published technical documentation for. If they did, the DRM would likely be rendered completely useless as anybody could write an application that decoded their customers' streams. In the fut...
Eurosport Player now works in Ubuntu with Firefox and Chrome without any additional steps. Hardware acceleration does not work though, but it is browser limitation on Linux based systems.
55,743,265
I am using in my reducers Map/Associative array to store object via string ID. When I need new item into Map I am using this construction ``` rows: { ...state.rows, [row.id]: row } ``` When I need delete item form map by Id I am using this. ``` const { [rowId]: deleted, ...rows } = state.rows; ``` Than in va...
2019/04/18
[ "https://Stackoverflow.com/questions/55743265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2026656/" ]
You could reduce the keys with the object. ```js var object = { id: 1, id1: 2, id2: 3 }, contentIds = ['id1', 'id2', 'id3'], result = contentIds.reduce((o, k) => ({ [k]: _, ...r } = o, r), object); console.log(result); ```
``` const myObj = { id1: 'test', id2: 'test', id3: 'test' } const idsToFilter = ['id1', 'id2'] const { id1, id2, ...filtered } = myObj console.log(filtered) ``` However you can't do that programmatically unless you know the exact ids you want to filter from the object however. if you want to do it based on an array o...
55,743,265
I am using in my reducers Map/Associative array to store object via string ID. When I need new item into Map I am using this construction ``` rows: { ...state.rows, [row.id]: row } ``` When I need delete item form map by Id I am using this. ``` const { [rowId]: deleted, ...rows } = state.rows; ``` Than in va...
2019/04/18
[ "https://Stackoverflow.com/questions/55743265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2026656/" ]
You could reduce the keys with the object. ```js var object = { id: 1, id1: 2, id2: 3 }, contentIds = ['id1', 'id2', 'id3'], result = contentIds.reduce((o, k) => ({ [k]: _, ...r } = o, r), object); console.log(result); ```
> > I am wander how can i do this if i have multiple Ids in array and I > need delete all of them via `...` operator and destructuring. > > > No you can't do this, you're probably getting confused with `rest` and `spread` syntax, `...` on the left hand side of assignment is `rest` syntax not `spread` [**Rest and...
55,743,265
I am using in my reducers Map/Associative array to store object via string ID. When I need new item into Map I am using this construction ``` rows: { ...state.rows, [row.id]: row } ``` When I need delete item form map by Id I am using this. ``` const { [rowId]: deleted, ...rows } = state.rows; ``` Than in va...
2019/04/18
[ "https://Stackoverflow.com/questions/55743265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2026656/" ]
> > I am wander how can i do this if i have multiple Ids in array and I > need delete all of them via `...` operator and destructuring. > > > No you can't do this, you're probably getting confused with `rest` and `spread` syntax, `...` on the left hand side of assignment is `rest` syntax not `spread` [**Rest and...
``` const myObj = { id1: 'test', id2: 'test', id3: 'test' } const idsToFilter = ['id1', 'id2'] const { id1, id2, ...filtered } = myObj console.log(filtered) ``` However you can't do that programmatically unless you know the exact ids you want to filter from the object however. if you want to do it based on an array o...
25,409,227
I am creating a reveal.js presentation. I wish to trigger some changes to the dom when a specific fragment is shown. The [documentation](https://github.com/hakimel/reveal.js/#fragment-events) shows a generic eventListener that that executes when the first fragment on a page is shown. I want to trigger an event that ad...
2014/08/20
[ "https://Stackoverflow.com/questions/25409227", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2588262/" ]
So the best solution does not involve the addEventListener at all. I was thinking way to hard. The correct answer in this case is to nest the fragment that needs to be removed or hidden, into another fragment that fades out. Then we use the Fragment Index data attachment to specify the order in which we want these fr...
The document doesn't indicate that it can listen on a particular element. It seems that it's up to you to check the element of the fragment being triggered is the one you want to modify. ``` Reveal.addEventListener( 'fragmentshown', function( event ) { if(event.fragment.id === 'bp30') { event.fragment.cl...
186,810
I distrust the Imperials (Legion) and want to join the Stormcloaks – always have. However, I (accidentally) completed the first quest of [*Joining the Legion*](http://elderscrolls.wikia.com/wiki/Joining_the_Legion) (“Clear out Fort Hraggstad”). I then started the [*Season Unending*](http://elderscrolls.wikia.com/wiki/...
2014/10/11
[ "https://gaming.stackexchange.com/questions/186810", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/2383/" ]
As long as you haven't given up the Jagged Crown, you should be able to switch to the stormcloaks. What I expect has happened is due to Season Unendiung -- specifically, you'll have to try to finish resolving the peace talks (in any manner of your choosing), before talking to Ulfric again. If that doesn't work, you m...
If you join The Dark Brotherhood and complete their missions you can't be in the Legion and toward the end of the Brotherhood's story line you can defeat General Tullius.
994,795
Can we represent set of irrational numbers as union of countable family of closed sets?
2014/10/28
[ "https://math.stackexchange.com/questions/994795", "https://math.stackexchange.com", "https://math.stackexchange.com/users/185549/" ]
The answer is NO. If $\mathbb R\!\smallsetminus\!\mathbb Q=\bigcup\_{n\in\mathbb N}F\_n$, where $F\_n$, $n\in\mathbb N$, are closed, then $$ \mathbb Q=\mathbb R\smallsetminus\!\bigcup\_{n\in\mathbb N}F\_n =\bigcap\_{n\in\mathbb N} (\mathbb R\!\smallsetminus\! F\_n)=\bigcap\_{n\in\mathbb N} U\_n $$ where $U\_n=\mathbb...
No, this is not possible, for if it was, ${\mathbb R}$ would be the union of countably many nowhere dense closed subsets, contradicting Baire's category theorem.
134,911
It looks like T-Mobile offers very cheap data-only plans, but these are only available for tablets. I have read that this is enforced by tracking your IMEI. I was wondering: Is it possible to change your phone's IMEI to a tablet's IMEI, to trick T-Mobile, so that you can get a data-only plan. Nobody really needs talk a...
2016/01/21
[ "https://android.stackexchange.com/questions/134911", "https://android.stackexchange.com", "https://android.stackexchange.com/users/44770/" ]
I faced this same problem a while ago. I could think of two things here. 1. In my case, I had problem with my router. Other devices connected to the same router had no issues. I had to reset the router and everything worked fine after connecting the device back to it. 2. Then, you say you have 'Clear cache data ...
Even I faced the same problem while using WiFi U can try these 1. Restart the router 2. Restart the device 3. Contact ISP 4. Going to settings and uninstall the updates of play store. As it is a system app, you can revert back to latest version after sometime Hope it helps
134,911
It looks like T-Mobile offers very cheap data-only plans, but these are only available for tablets. I have read that this is enforced by tracking your IMEI. I was wondering: Is it possible to change your phone's IMEI to a tablet's IMEI, to trick T-Mobile, so that you can get a data-only plan. Nobody really needs talk a...
2016/01/21
[ "https://android.stackexchange.com/questions/134911", "https://android.stackexchange.com", "https://android.stackexchange.com/users/44770/" ]
1. Force stop Google Play Store from Settings and clear the app's cache. 2. Force stop Google Service Framework and clear the cache. 3. Reboot Phone. 4. Check if the problem persists. This should do.
Even I faced the same problem while using WiFi U can try these 1. Restart the router 2. Restart the device 3. Contact ISP 4. Going to settings and uninstall the updates of play store. As it is a system app, you can revert back to latest version after sometime Hope it helps
134,911
It looks like T-Mobile offers very cheap data-only plans, but these are only available for tablets. I have read that this is enforced by tracking your IMEI. I was wondering: Is it possible to change your phone's IMEI to a tablet's IMEI, to trick T-Mobile, so that you can get a data-only plan. Nobody really needs talk a...
2016/01/21
[ "https://android.stackexchange.com/questions/134911", "https://android.stackexchange.com", "https://android.stackexchange.com/users/44770/" ]
I disabled IPv6 on my router and that seem to have resolved my issue.
Even I faced the same problem while using WiFi U can try these 1. Restart the router 2. Restart the device 3. Contact ISP 4. Going to settings and uninstall the updates of play store. As it is a system app, you can revert back to latest version after sometime Hope it helps
33,349,844
How could I have the first section be the height of the browser window on this template? <http://themes.3rdwavemedia.com/velocity/1.5.4> Apparently the class that I have to update is `promo section section-on-bg` it isn't working. I also tried `min-height 100%, height 100%`. Any help would be appreciated. Regards.
2015/10/26
[ "https://Stackoverflow.com/questions/33349844", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5489794/" ]
Your implementation's `iostream` header includes `string`. This is not something which you can or should rely on. If you want to use `std::string`, you should always `#include <string>`, otherwise your program might not run on different implementations, or even in later versions of your current one.
iostream includes `<string>`. It ripples through. Well actually that's implementation dependant and not a guarantee. You should explicitly include the headers you need.
33,349,844
How could I have the first section be the height of the browser window on this template? <http://themes.3rdwavemedia.com/velocity/1.5.4> Apparently the class that I have to update is `promo section section-on-bg` it isn't working. I also tried `min-height 100%, height 100%`. Any help would be appreciated. Regards.
2015/10/26
[ "https://Stackoverflow.com/questions/33349844", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5489794/" ]
Some header might include other headers, but that's an implementation issue and not something you can count on. Always explicitly include the headers you need.
iostream includes `<string>`. It ripples through. Well actually that's implementation dependant and not a guarantee. You should explicitly include the headers you need.