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
50,376,116
I am quite new in C# and I found something unexpected in string comparison which I don't really understand. Can someone please explain me why the comparison between characters gave the opposite result as the comparison of one character length strings in the following code ? I expected that `"9" < "="` will be `true` (as unicode code of '9' (57) is less than unicode code of '=' (61) ) but it is false... What is the comparison logic of strings behind and why is it different than comparing the characters ? Code: ``` bool resChComp = '9' < '='; bool resStrComp = String.Compare("9", "=") < 0; Console.WriteLine($"\n'9' < '=' : {resChComp}, \"9\" < \"=\" : { resStrComp }"); ``` Output: ``` '9' < '=' : True, "9" < "=" : False ```
2018/05/16
[ "https://Stackoverflow.com/questions/50376116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9801081/" ]
The default string comparison is doing a 'word sort'. [From the documentation](https://msdn.microsoft.com/en-us/library/system.globalization.compareoptions(v=vs.110).aspx), > > The .NET Framework uses three distinct ways of sorting: word sort, string sort, and ordinal sort. Word sort performs a culture-sensitive comparison of strings. Certain nonalphanumeric characters might have special weights assigned to them. For example, the hyphen ("-") might have a very small weight assigned to it so that "coop" and "co-op" appear next to each other in a sorted list. String sort is similar to word sort, except that there are no special cases. Therefore, all nonalphanumeric symbols come before all alphanumeric characters. Ordinal sort compares strings based on the Unicode values of each element of the string. > > > The comparison you are expecting is the ordinal comparison, which you can get by using `StringComparison.Ordinal` in the `String.Compare` overload, like so: ``` bool resStrComp = String.Compare("9", "=", StringComparison.Ordinal) < 0; ``` This will compare the strings by using their unicode values, in the same way comparing a character to another character does.
In the case of character comparison, the characters will be cast to an `int` corresponding to the ASCII value. `9` has an ASCII value of 57, and `=` has a value of 61. This means that string comparison and character comparison aren't comparing exactly the same thing (which is why they may have different results).
50,376,116
I am quite new in C# and I found something unexpected in string comparison which I don't really understand. Can someone please explain me why the comparison between characters gave the opposite result as the comparison of one character length strings in the following code ? I expected that `"9" < "="` will be `true` (as unicode code of '9' (57) is less than unicode code of '=' (61) ) but it is false... What is the comparison logic of strings behind and why is it different than comparing the characters ? Code: ``` bool resChComp = '9' < '='; bool resStrComp = String.Compare("9", "=") < 0; Console.WriteLine($"\n'9' < '=' : {resChComp}, \"9\" < \"=\" : { resStrComp }"); ``` Output: ``` '9' < '=' : True, "9" < "=" : False ```
2018/05/16
[ "https://Stackoverflow.com/questions/50376116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9801081/" ]
The default string comparison is doing a 'word sort'. [From the documentation](https://msdn.microsoft.com/en-us/library/system.globalization.compareoptions(v=vs.110).aspx), > > The .NET Framework uses three distinct ways of sorting: word sort, string sort, and ordinal sort. Word sort performs a culture-sensitive comparison of strings. Certain nonalphanumeric characters might have special weights assigned to them. For example, the hyphen ("-") might have a very small weight assigned to it so that "coop" and "co-op" appear next to each other in a sorted list. String sort is similar to word sort, except that there are no special cases. Therefore, all nonalphanumeric symbols come before all alphanumeric characters. Ordinal sort compares strings based on the Unicode values of each element of the string. > > > The comparison you are expecting is the ordinal comparison, which you can get by using `StringComparison.Ordinal` in the `String.Compare` overload, like so: ``` bool resStrComp = String.Compare("9", "=", StringComparison.Ordinal) < 0; ``` This will compare the strings by using their unicode values, in the same way comparing a character to another character does.
This is because [String.Compare](https://msdn.microsoft.com/en-us/library/84787k22(v=vs.110).aspx) uses word sort orders by default, rather than numeric values for characters. It just happens to be that for the culture being used, `9` comes before `=` in the sort order. If you specify Ordinal (binary) sort rules, mentioned [here](https://msdn.microsoft.com/en-us/library/system.stringcomparison(v=vs.110).aspx), it will work as you expect. ``` bool resStrComp = String.Compare("9", "=", StringComparison.Ordinal) < 0; ```
66,356,156
I am using a transfer learning model is a ay very similar to that explained in [Chollet's keras Transfer learning guide](https://keras.io/guides/transfer_learning/). To avoid problems with the batch normalization layer, as stated in the guide and many other places, I have to insert the original pretrained base model as a functional model with the training=false option like this: ``` inputs = layers.Input(shape=(224,224, 3)) x = img_augmentation(inputs) baseModel = VGG19(weights="imagenet", include_top=False,input_tensor=x) x=baseModel(x,training=False) # construct the head of the model that will be placed on top of the # the base model x=Conv2D(32,2)(x) headModel = AveragePooling2D(pool_size=(4, 4))(x) headModel = Flatten(name="flatten")(headModel) headModel = Dense(64, activation="relu")(headModel) headModel = Dropout(0.5)(headModel) headModel = Dense(3, activation="softmax")(headModel) model = Model(inputs, outputs=headModel) ``` My problem is that I need to use gradcam as in [Chollet's gradcam example page](https://keras.io/examples/vision/grad_cam/). To do this I need access to the basemodel last convolutional layer but when I summarize my model I get: ``` Model: "model_163" _________________________________________________________________ Layer (type) Output Shape Param # ================================================================= input_3 (InputLayer) [(None, 224, 224, 3)] 0 _________________________________________________________________ img_augmentation (Sequential (None, 224, 224, 3) 0 _________________________________________________________________ vgg19 (Functional) (None, 7, 7, 512) 20024384 _________________________________________________________________ conv2d_2 (Conv2D) (None, 6, 6, 32) 65568 _________________________________________________________________ average_pooling2d_2 (Average (None, 1, 1, 32) 0 _________________________________________________________________ flatten (Flatten) (None, 32) 0 _________________________________________________________________ dense_4 (Dense) (None, 64) 2112 _________________________________________________________________ dropout_2 (Dropout) (None, 64) 0 _________________________________________________________________ dense_5 (Dense) (None, 3) 195 ================================================================= Total params: 20,092,259 Trainable params: 67,875 Non-trainable params: 20,024,384 __________________________________________ ``` Thus, the outputs I need are inside one of the vgg19 functional model layers. How can I access this layer without having to remove the training=True option?
2021/02/24
[ "https://Stackoverflow.com/questions/66356156", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10685631/" ]
You can slice the dataframe in a for loop and write the slices to sheets: ``` GROUP_LENGTH = 1000000 # set nr of rows to slice df with pd.ExcelWriter('output.xlsx') as writer: for i in range(0, len(df), GROUP_LENGTH): df[i : i+GROUP_LENGTH].to_excel(writer, sheet_name='Row {}'.format(i), index=False, header=True) ```
This depends on the total size of the dataframe as Excel has workbook size limits, but you can try something like; ``` GROUP_LENGTH = 1000000 writer = pd.ExcelWriter('test.xlsx') number_of_chunks = math.ceil(len(df)/GROUP_LENGTH) chunks = np.array_split(df,number_of_chunks) sheet_number = 0 for chunk in chunks: chunk.to_excel(writer,sheet_name=sheet_number) sheet_number+=1 writer.save() ```
66,356,156
I am using a transfer learning model is a ay very similar to that explained in [Chollet's keras Transfer learning guide](https://keras.io/guides/transfer_learning/). To avoid problems with the batch normalization layer, as stated in the guide and many other places, I have to insert the original pretrained base model as a functional model with the training=false option like this: ``` inputs = layers.Input(shape=(224,224, 3)) x = img_augmentation(inputs) baseModel = VGG19(weights="imagenet", include_top=False,input_tensor=x) x=baseModel(x,training=False) # construct the head of the model that will be placed on top of the # the base model x=Conv2D(32,2)(x) headModel = AveragePooling2D(pool_size=(4, 4))(x) headModel = Flatten(name="flatten")(headModel) headModel = Dense(64, activation="relu")(headModel) headModel = Dropout(0.5)(headModel) headModel = Dense(3, activation="softmax")(headModel) model = Model(inputs, outputs=headModel) ``` My problem is that I need to use gradcam as in [Chollet's gradcam example page](https://keras.io/examples/vision/grad_cam/). To do this I need access to the basemodel last convolutional layer but when I summarize my model I get: ``` Model: "model_163" _________________________________________________________________ Layer (type) Output Shape Param # ================================================================= input_3 (InputLayer) [(None, 224, 224, 3)] 0 _________________________________________________________________ img_augmentation (Sequential (None, 224, 224, 3) 0 _________________________________________________________________ vgg19 (Functional) (None, 7, 7, 512) 20024384 _________________________________________________________________ conv2d_2 (Conv2D) (None, 6, 6, 32) 65568 _________________________________________________________________ average_pooling2d_2 (Average (None, 1, 1, 32) 0 _________________________________________________________________ flatten (Flatten) (None, 32) 0 _________________________________________________________________ dense_4 (Dense) (None, 64) 2112 _________________________________________________________________ dropout_2 (Dropout) (None, 64) 0 _________________________________________________________________ dense_5 (Dense) (None, 3) 195 ================================================================= Total params: 20,092,259 Trainable params: 67,875 Non-trainable params: 20,024,384 __________________________________________ ``` Thus, the outputs I need are inside one of the vgg19 functional model layers. How can I access this layer without having to remove the training=True option?
2021/02/24
[ "https://Stackoverflow.com/questions/66356156", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10685631/" ]
You can slice the dataframe in a for loop and write the slices to sheets: ``` GROUP_LENGTH = 1000000 # set nr of rows to slice df with pd.ExcelWriter('output.xlsx') as writer: for i in range(0, len(df), GROUP_LENGTH): df[i : i+GROUP_LENGTH].to_excel(writer, sheet_name='Row {}'.format(i), index=False, header=True) ```
I know it's old but I was able to do it using [np.array\_split](https://numpy.org/doc/stable/reference/generated/numpy.array_split.html) ``` count = 1 splits = np.array_splits(df, length) for df in splits: df.to_excel(f'output {count}.xlsx', header=True, index=False) count += 1 ```
21,625,541
I have this `layout` ``` <ScrollView> <TextView android:id="@+id/textView" /> </ScrollView> ``` When I try to set a too long text, this `Textview` doesn't show that. ``` //OnCreate //... TextView textView = (TextView) findViewById(R.id.textView); textView.setText("..."); //Here is a text with more than 2500 //chars and at least have 10 \n char //(it means has at least 10 paragraph) ``` How can do I show that text? > > Edit One : > > > Even I set a `background` to that `TextView` and the `TextView` does'nt show that background
2014/02/07
[ "https://Stackoverflow.com/questions/21625541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1803735/" ]
you can set ``` android:maxLines="1" android:ellipsize="end" ``` to your textview, so the text which long than your textview will be hide.
Use this : ``` EditText thumbnailView = (EditText) findViewById(R.id.enterBearingNo_editText_id); TextView messageView = (TextView) findViewById(R.id.string2); String text = "LargeText"; Display display = getWindowManager().getDefaultDisplay(); FlowTextHelper.tryFlowText(text, thumbnailView, messageView, display); ``` `FlowTextHelper.class` ``` class FlowTextHelper { static boolean mNewClassAvailable; static { if (Integer.valueOf(Build.VERSION.SDK) >= 8) { // Froyo 2.2, API level 8 mNewClassAvailable = true; } // Also you can use this trick if you don't know the exact version: /* * try { * Class.forName("android.text.style.LeadingMarginSpan$LeadingMarginSpan2" * ); mNewClassAvailable = true; } catch (Exception ex) { * mNewClassAvailable = false; } */ } public static void tryFlowText(String text, View thumbnailView, TextView messageView, Display display) { // There is nothing I can do for older versions, so just return if (!mNewClassAvailable) return; // Get height and width of the image and height of the text line thumbnailView.measure(display.getWidth(), display.getHeight()); int height = thumbnailView.getMeasuredHeight(); int width = thumbnailView.getMeasuredWidth(); float textLineHeight = messageView.getPaint().getTextSize(); // Set the span according to the number of lines and width of the image int lines = (int) Math.round(height / textLineHeight); // For an html text you can use this line: SpannableStringBuilder ss = // (SpannableStringBuilder)Html.fromHtml(text); SpannableString ss = new SpannableString(text); ss.setSpan(new MyLeadingMarginSpan2(lines, width), 0, ss.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); messageView.setText(ss); // Align the text with the image by removing the rule that the text is // to the right of the image RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) messageView .getLayoutParams(); int[] rules = params.getRules(); rules[RelativeLayout.RIGHT_OF] = 0; } public static void tryFlowTextPrice(String text, TextView messageView, Display display) { // There is nothing I can do for older versions, so just return if (!mNewClassAvailable) return; // Get height and width of the image and height of the text line // thumbnailView.measure(display.getWidth(), display.getHeight()); // int height = thumbnailView.getMeasuredHeight(); // int width = thumbnailView.getMeasuredWidth(); float textLineHeight = messageView.getPaint().getTextSize(); // Set the span according to the number of lines and width of the image // int lines = (int) Math.round(height / textLineHeight); // For an html text you can use this line: SpannableStringBuilder ss = // (SpannableStringBuilder)Html.fromHtml(text); SpannableString ss = new SpannableString(text); // ss.setSpan(new MyLeadingMarginSpan2(lines, width), 0, ss.length(), // Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); messageView.setText(ss); // Align the text with the image by removing the rule that the text is // to the right of the image // LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) // messageView // .getLayoutParams(); // int[] rules = params.getRules(); // rules[RelativeLayout.RIGHT_OF] = 0; } } ```
21,625,541
I have this `layout` ``` <ScrollView> <TextView android:id="@+id/textView" /> </ScrollView> ``` When I try to set a too long text, this `Textview` doesn't show that. ``` //OnCreate //... TextView textView = (TextView) findViewById(R.id.textView); textView.setText("..."); //Here is a text with more than 2500 //chars and at least have 10 \n char //(it means has at least 10 paragraph) ``` How can do I show that text? > > Edit One : > > > Even I set a `background` to that `TextView` and the `TextView` does'nt show that background
2014/02/07
[ "https://Stackoverflow.com/questions/21625541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1803735/" ]
you can set ``` android:maxLines="1" android:ellipsize="end" ``` to your textview, so the text which long than your textview will be hide.
Because `android:singleLine="true"` attribute has been deprecated, set the following attributes to your TextView: ``` android:ellipsize="end" android:maxLines="1" ``` The TextView will then show only the text that can fit to your TextView, followed by an ellipsis `...`
21,625,541
I have this `layout` ``` <ScrollView> <TextView android:id="@+id/textView" /> </ScrollView> ``` When I try to set a too long text, this `Textview` doesn't show that. ``` //OnCreate //... TextView textView = (TextView) findViewById(R.id.textView); textView.setText("..."); //Here is a text with more than 2500 //chars and at least have 10 \n char //(it means has at least 10 paragraph) ``` How can do I show that text? > > Edit One : > > > Even I set a `background` to that `TextView` and the `TextView` does'nt show that background
2014/02/07
[ "https://Stackoverflow.com/questions/21625541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1803735/" ]
you can set ``` android:maxLines="1" android:ellipsize="end" ``` to your textview, so the text which long than your textview will be hide.
i dont know if this will help you but saw this on developer.android... > > With Android 8.0 (API level 26) and higher, you can instruct a TextView to let the text size expand or contract automatically to fill its layout based on the TextView's characteristics and boundaries. This setting makes it easier to optimize the text size on different screens with dynamic content. > > > ``` android:autoSizeTextType="uniform" ``` > > There are **three** ways you can set up the autosizing of TextView: > > > [Default](https://developer.android.com/guide/topics/ui/look-and-feel/autosizing-textview#default) [Granularity](https://developer.android.com/guide/topics/ui/look-and-feel/autosizing-textview#granularity) [Preset Sizes](https://developer.android.com/guide/topics/ui/look-and-feel/autosizing-textview#preset-sizes) ================================================= [readMore](https://developer.android.com/guide/topics/ui/look-and-feel/autosizing-textview#default)
62,072,437
I am trying to get the URL for the image associated with a given URL. Using Apple's `LPLinkMetadata`, I am able to get the URL's `title` and `description`, but I cannot figure out how to access the metadata's image URL. I have access to `data.imageProvider` but I am not sure how to use it. ``` import LinkPresentation final class URLHelper { @available(iOS 13.0, *) static func fetchURLPreview(url: URL) { let metadataProvider = LPMetadataProvider() metadataProvider.startFetchingMetadata(for: url) { (metadata, error) in DispatchQueue.main.async { if let _ = error { // handle error } else if let data = metadata { let urlTitle = data.title let urlImageUrl = data.???????? } } } } } ```
2020/05/28
[ "https://Stackoverflow.com/questions/62072437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7639373/" ]
Check below my code for get image URL from LPLinkMetadata. ``` let metadataProvider = LPMetadataProvider() let url = URL(string: "https://www.facebook.com/")! metadataProvider.startFetchingMetadata(for: url) { metadata, error in if error != nil { return } metadata?.imageProvider?.loadFileRepresentation(forTypeIdentifier: kUTTypeImage as String, completionHandler: { (url, imageProviderError) in if imageProviderError != nil { return } let myImage = UIImage(contentsOfFile: (url?.path)!) }) } ```
``` let _ = md.imageProvider?.loadObject(ofClass: UIImage.self, completionHandler: { image, err in DispatchQueue.main.async { self?.imageViewWebSite.image = image as? UIImage } }) ```
67,410,109
I'm writing a batch script that will check the MD5sum of all files in a folder and i found this script on this site for /r %%f in (\*) do (certutil -hashfile "%%f" MD5) >> output.txt This one is working but any idea how can i get the hash only, without the other text [Please see text highlighted on this image](https://i.stack.imgur.com/orxyO.png) Thanks!
2021/05/05
[ "https://Stackoverflow.com/questions/67410109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15847598/" ]
Since the two lines that you don't want to include both contain the string `hash` somewhere in them, you can use `find` to filter those lines out. ``` for /r %%f in (*) do (certutil -hashfile "%%f" MD5 | find /v "hash") >> output.txt ``` `find /v` says "return all lines that do not contain this string."
DOS is hard to work with (compared to bash on linux, for example), but I managed to get something like this working locally: Simple example using just `:` as a deliminator (like in your example, where the MD5 hash is after the `:`): ``` $ @echo hello:me hello:me $ for /f "tokens=1,2 delims==:" %a in ('echo hello:me') do @echo %b me ``` * `tokens=1,2`: fetch tokens 1 & 2 - assign to %a %b respectively * `delims==:`: tokenize on `:` * `echo %b`: print token #2 Extrapolate to your case (which I can't reproduce locally, so this is a guess): ``` $ for /f "tokens=1,2 delims==:" %a in ('for /r %%f in (*) do (certutil -hashfile "%%f" MD5)') do @echo %b ``` See if that gets you closer.
722,991
Let us assume there is a car of mass $m\_1$ on top of which there is a block of mass $m\_2$. The car is moving with velocity $v$. If suddenly,the block falls down,then it is common sense that the speed of the car will increase since the car has become light. But how do we feel this using rigorous mathematics and conservation of momentum? Please allow me to express myself: Suppose we consider the car without the block as the system. So that means the momentum of the car will be conserved. So $m\_1v=m\_1v\_{\mathrm{final}}$ meaning final and initial velocities will be same, however that is clearly not true. That means in the *only car system*,some kind of external force is acting on the *only car system*. But what is this external force? If we draw the free body diagram of the car,what will be the direction of this external force? What does a block having to fall from the car,got to do with external force? *In other words,how do we define external force in this system?* Is this force the normal vector that we use to represent force on a body?If that's case,could you please show this force as vector? I am extremely sorry if my question sounds dumb. But i can't feel the conservation of momentum due to the vague definition of external force *here*. Or a rigorous mathematical calculation *proving* that the momentum of the car and block system will be conserved here will be very helpful(like we deduce the formula in collision problems).
2022/08/14
[ "https://physics.stackexchange.com/questions/722991", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/311011/" ]
When you look at a change in mass you always have to consider the conservation of the total momentum. Let's look at the car, but let's make it a car in space for simplicity, going at $ vM$, (this includes the brick with mass $m$). The mass you subtract will always have a momentum before and after the separation and you always have to consider both. The only way to make your scenario sensible would be something like this: Let's say the brick was just attached with a little cable (that is weightless and magically does not enact any forces) which you now cut so that the brick will continue to float next to your car with $ v m$, for ever if you don't do anything else. > > Suppose we consider the car without the block as the system. So that means the momentum of the car will be conserved. > > > That is really the crux, this kind of just "cutting things out" of your system can only be done with things that don't interact with anything in your system. Really the cutting of the magic cable is not a physical act, as it changes nothing, it's just a change in perspective. The car now has smaller momentum $v (M-m)$, the brick will have $ v m$, together still $v (M-m) + v m =vM$ right? BUT that only works because they don't interact *the cable was never really there to begin with*. That you are asking now which force changed the momentum of the car, is like going from an inertial system in which the car is moving $ P = vM$ to one inside the car $ P' = 0$ and asking where is the force that stopped the car? There is none, you just changed perspective.
As explained in some of the answers, the car does not accelerate when the block falls. However there is a "if". The car's velocity does not change if the car is moving without its engine turned on. If the engine is on, providing a forward force F, then the car accelerates when its mass decreases. $ a= \frac{F}{m} $. Reduce m translates into an increase of the acceleration.
722,991
Let us assume there is a car of mass $m\_1$ on top of which there is a block of mass $m\_2$. The car is moving with velocity $v$. If suddenly,the block falls down,then it is common sense that the speed of the car will increase since the car has become light. But how do we feel this using rigorous mathematics and conservation of momentum? Please allow me to express myself: Suppose we consider the car without the block as the system. So that means the momentum of the car will be conserved. So $m\_1v=m\_1v\_{\mathrm{final}}$ meaning final and initial velocities will be same, however that is clearly not true. That means in the *only car system*,some kind of external force is acting on the *only car system*. But what is this external force? If we draw the free body diagram of the car,what will be the direction of this external force? What does a block having to fall from the car,got to do with external force? *In other words,how do we define external force in this system?* Is this force the normal vector that we use to represent force on a body?If that's case,could you please show this force as vector? I am extremely sorry if my question sounds dumb. But i can't feel the conservation of momentum due to the vague definition of external force *here*. Or a rigorous mathematical calculation *proving* that the momentum of the car and block system will be conserved here will be very helpful(like we deduce the formula in collision problems).
2022/08/14
[ "https://physics.stackexchange.com/questions/722991", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/311011/" ]
When you look at a change in mass you always have to consider the conservation of the total momentum. Let's look at the car, but let's make it a car in space for simplicity, going at $ vM$, (this includes the brick with mass $m$). The mass you subtract will always have a momentum before and after the separation and you always have to consider both. The only way to make your scenario sensible would be something like this: Let's say the brick was just attached with a little cable (that is weightless and magically does not enact any forces) which you now cut so that the brick will continue to float next to your car with $ v m$, for ever if you don't do anything else. > > Suppose we consider the car without the block as the system. So that means the momentum of the car will be conserved. > > > That is really the crux, this kind of just "cutting things out" of your system can only be done with things that don't interact with anything in your system. Really the cutting of the magic cable is not a physical act, as it changes nothing, it's just a change in perspective. The car now has smaller momentum $v (M-m)$, the brick will have $ v m$, together still $v (M-m) + v m =vM$ right? BUT that only works because they don't interact *the cable was never really there to begin with*. That you are asking now which force changed the momentum of the car, is like going from an inertial system in which the car is moving $ P = vM$ to one inside the car $ P' = 0$ and asking where is the force that stopped the car? There is none, you just changed perspective.
Here is your wrong assumption: "If suddenly,the block falls down,then it is common sense that the speed of the car will increase since the car has become light" There are two problems. The first is that Newton's First Law means that the block cannot simply "fall down." There has to be some force on it that causes it to accelerate. The second problem is that the car does not necessarily change its velocity. Whether or not the car changes its velocity depends on what causes the block to move. The key is whether the force that causes the block to fall is an internal force or an external force. The law of conservation of momentum says $$\Delta P = F\_{external} \Delta t$$ The total momentum of a system can only change when there is an external force. That means a force that is between an object in the system and an object outside the system. Forces between the car and the block don't change the total momentum, but forces between the block and some other object can change the total momentum. Here are two different examples: **Example 1 -- Internal forces only** The car and the block are traveling at $v\_{c1} = v\_{b1} = v$. The driver of the car pushes the block backwards with a force $F$ for a short time $\Delta t$, which causes the block to fall off the car. This is an internal force, so the momentum of the car+block is conserved. The block now has velocity $v - F\Delta t/m\_b$ and the car now has velocity $v + F\Delta t /m\_c$. In terms of Newton's Third Law, the force from the car caused the block to accelerate backward, and the equal and opposite force from the block on the car caused the car to accelerate forward. **Example 2 -- External force** The car and the block are traveling at $v\_{c1} = v\_{b1}=v$. A bird flies by and hits the block, knocking it off the top of the car. The bird applies a force to the block $F$ for a time $\Delta t$. The force from the bird is an external force, so it does change the total momentum of the car plus the block. The velocity of the block is now $v - F\Delta t/m\_b$ but the velocity of the car is still $v$. The total momentum of the car plus block is now $$P\_{final} = P\_{initial} - F\Delta t$$ **Conclusion** What happens to the car when the block falls depends on what made the block fall. The law of conservation of momentum doesn't guarantee that the car will automatically change velocity just because the block does. We still have to think about which forces are causing the changes.
722,991
Let us assume there is a car of mass $m\_1$ on top of which there is a block of mass $m\_2$. The car is moving with velocity $v$. If suddenly,the block falls down,then it is common sense that the speed of the car will increase since the car has become light. But how do we feel this using rigorous mathematics and conservation of momentum? Please allow me to express myself: Suppose we consider the car without the block as the system. So that means the momentum of the car will be conserved. So $m\_1v=m\_1v\_{\mathrm{final}}$ meaning final and initial velocities will be same, however that is clearly not true. That means in the *only car system*,some kind of external force is acting on the *only car system*. But what is this external force? If we draw the free body diagram of the car,what will be the direction of this external force? What does a block having to fall from the car,got to do with external force? *In other words,how do we define external force in this system?* Is this force the normal vector that we use to represent force on a body?If that's case,could you please show this force as vector? I am extremely sorry if my question sounds dumb. But i can't feel the conservation of momentum due to the vague definition of external force *here*. Or a rigorous mathematical calculation *proving* that the momentum of the car and block system will be conserved here will be very helpful(like we deduce the formula in collision problems).
2022/08/14
[ "https://physics.stackexchange.com/questions/722991", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/311011/" ]
When the object over the car falls down, it keeps at first the same horizontal velocity. The total linear momentum (car + object) doesn't change. So there is no reason to expect a change of the car velocity. Of course, as soon as the object hits the road, it will stop due to the friction, but that is another story.
Here is your wrong assumption: "If suddenly,the block falls down,then it is common sense that the speed of the car will increase since the car has become light" There are two problems. The first is that Newton's First Law means that the block cannot simply "fall down." There has to be some force on it that causes it to accelerate. The second problem is that the car does not necessarily change its velocity. Whether or not the car changes its velocity depends on what causes the block to move. The key is whether the force that causes the block to fall is an internal force or an external force. The law of conservation of momentum says $$\Delta P = F\_{external} \Delta t$$ The total momentum of a system can only change when there is an external force. That means a force that is between an object in the system and an object outside the system. Forces between the car and the block don't change the total momentum, but forces between the block and some other object can change the total momentum. Here are two different examples: **Example 1 -- Internal forces only** The car and the block are traveling at $v\_{c1} = v\_{b1} = v$. The driver of the car pushes the block backwards with a force $F$ for a short time $\Delta t$, which causes the block to fall off the car. This is an internal force, so the momentum of the car+block is conserved. The block now has velocity $v - F\Delta t/m\_b$ and the car now has velocity $v + F\Delta t /m\_c$. In terms of Newton's Third Law, the force from the car caused the block to accelerate backward, and the equal and opposite force from the block on the car caused the car to accelerate forward. **Example 2 -- External force** The car and the block are traveling at $v\_{c1} = v\_{b1}=v$. A bird flies by and hits the block, knocking it off the top of the car. The bird applies a force to the block $F$ for a time $\Delta t$. The force from the bird is an external force, so it does change the total momentum of the car plus the block. The velocity of the block is now $v - F\Delta t/m\_b$ but the velocity of the car is still $v$. The total momentum of the car plus block is now $$P\_{final} = P\_{initial} - F\Delta t$$ **Conclusion** What happens to the car when the block falls depends on what made the block fall. The law of conservation of momentum doesn't guarantee that the car will automatically change velocity just because the block does. We still have to think about which forces are causing the changes.
722,991
Let us assume there is a car of mass $m\_1$ on top of which there is a block of mass $m\_2$. The car is moving with velocity $v$. If suddenly,the block falls down,then it is common sense that the speed of the car will increase since the car has become light. But how do we feel this using rigorous mathematics and conservation of momentum? Please allow me to express myself: Suppose we consider the car without the block as the system. So that means the momentum of the car will be conserved. So $m\_1v=m\_1v\_{\mathrm{final}}$ meaning final and initial velocities will be same, however that is clearly not true. That means in the *only car system*,some kind of external force is acting on the *only car system*. But what is this external force? If we draw the free body diagram of the car,what will be the direction of this external force? What does a block having to fall from the car,got to do with external force? *In other words,how do we define external force in this system?* Is this force the normal vector that we use to represent force on a body?If that's case,could you please show this force as vector? I am extremely sorry if my question sounds dumb. But i can't feel the conservation of momentum due to the vague definition of external force *here*. Or a rigorous mathematical calculation *proving* that the momentum of the car and block system will be conserved here will be very helpful(like we deduce the formula in collision problems).
2022/08/14
[ "https://physics.stackexchange.com/questions/722991", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/311011/" ]
When the object over the car falls down, it keeps at first the same horizontal velocity. The total linear momentum (car + object) doesn't change. So there is no reason to expect a change of the car velocity. Of course, as soon as the object hits the road, it will stop due to the friction, but that is another story.
if an object is moving with a constant velocity in the absence of any forces, and apart of it self falls off. The momentum of the object decreases, only because of a loss of mass. the velocity of the object will not change as no forces are acting on it. With a car its slightly different. assuming no air resistance to less complicate things. the engine constantly does work on the car, this causes some constant acceleration F/m = a. If the car loses mass, The same force, is now applied to a smaller mass. Causing a greater acceleration. with air resistance the effect is an increase to some higher constant velocity.
722,991
Let us assume there is a car of mass $m\_1$ on top of which there is a block of mass $m\_2$. The car is moving with velocity $v$. If suddenly,the block falls down,then it is common sense that the speed of the car will increase since the car has become light. But how do we feel this using rigorous mathematics and conservation of momentum? Please allow me to express myself: Suppose we consider the car without the block as the system. So that means the momentum of the car will be conserved. So $m\_1v=m\_1v\_{\mathrm{final}}$ meaning final and initial velocities will be same, however that is clearly not true. That means in the *only car system*,some kind of external force is acting on the *only car system*. But what is this external force? If we draw the free body diagram of the car,what will be the direction of this external force? What does a block having to fall from the car,got to do with external force? *In other words,how do we define external force in this system?* Is this force the normal vector that we use to represent force on a body?If that's case,could you please show this force as vector? I am extremely sorry if my question sounds dumb. But i can't feel the conservation of momentum due to the vague definition of external force *here*. Or a rigorous mathematical calculation *proving* that the momentum of the car and block system will be conserved here will be very helpful(like we deduce the formula in collision problems).
2022/08/14
[ "https://physics.stackexchange.com/questions/722991", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/311011/" ]
> > If suddenly, the block falls down, then it is common sense that the > speed of the car will increase since the car has become light. > > > It's not really common sense. For a real scenario the car will encounter external dissipative forces, primarily air drag, that needs to be matched by a forward static friction force applied by the road to the wheel (in response to wheel torque) for a net force of zero. Since the block is on top of the car, part of the air drag force is associated with the block. If the block falls off, the air drag force is reduced. Then, if the applied torque to the wheel(s) is unchanged, there will be a net force acting forward resulting in acceleration of the car. On the other hand, if the block were inside the car it would experience no air drag. If it were dropped out the window, there would be no change in the external forces acting upon the car. The car will continue to move with the same velocity. > > Suppose we consider the car without the block as the system. So that > means the momentum of the car will be conserved. > > > Sticking with the "real car scenario" discussed above, momentum is not conserved because the removal of the block results in a reduction of the air drag force acting on the car, resulting in a net forward force and acceleration. > > That means in the only car system, some kind of external force is > acting on the only car system. But what is this external force? > > > Again, there are two main external forces acting on the car- air drag and the static friction force the road applies to the drive wheel(s) which is equal and opposite to the force the drive wheel(s) applies to the road per Newton's 3rd law. The loss of the block reduces the air drag force for a net force forward on the car. > > If we draw the free body diagram of the car, what will be the > direction of this external force? > > > A free body diagram of the car will show a static friction force applied to the wheel acting forward and an opposing air drag force acting backwards. When the two forces are equal the car is moving at constant velocity. When the block falls off, there will be a reduction in the drag force resulting in a net external force acting forward. > > What does a block having to fall from the car, got to do with external > force? > > > The air drag force acting backwards on the car is reduced when the block falls off. > > In other words, how do we define external force in this system? Is > this force the normal vector that we use to represent force on a body? > If that's case, could you please show this force as vector? > > > In this example the only forces of interested are the horizontal forces. So the vectors for the static friction force and air drag force are simply vectors in the horizontal direction. Hope this helps.
Here is your wrong assumption: "If suddenly,the block falls down,then it is common sense that the speed of the car will increase since the car has become light" There are two problems. The first is that Newton's First Law means that the block cannot simply "fall down." There has to be some force on it that causes it to accelerate. The second problem is that the car does not necessarily change its velocity. Whether or not the car changes its velocity depends on what causes the block to move. The key is whether the force that causes the block to fall is an internal force or an external force. The law of conservation of momentum says $$\Delta P = F\_{external} \Delta t$$ The total momentum of a system can only change when there is an external force. That means a force that is between an object in the system and an object outside the system. Forces between the car and the block don't change the total momentum, but forces between the block and some other object can change the total momentum. Here are two different examples: **Example 1 -- Internal forces only** The car and the block are traveling at $v\_{c1} = v\_{b1} = v$. The driver of the car pushes the block backwards with a force $F$ for a short time $\Delta t$, which causes the block to fall off the car. This is an internal force, so the momentum of the car+block is conserved. The block now has velocity $v - F\Delta t/m\_b$ and the car now has velocity $v + F\Delta t /m\_c$. In terms of Newton's Third Law, the force from the car caused the block to accelerate backward, and the equal and opposite force from the block on the car caused the car to accelerate forward. **Example 2 -- External force** The car and the block are traveling at $v\_{c1} = v\_{b1}=v$. A bird flies by and hits the block, knocking it off the top of the car. The bird applies a force to the block $F$ for a time $\Delta t$. The force from the bird is an external force, so it does change the total momentum of the car plus the block. The velocity of the block is now $v - F\Delta t/m\_b$ but the velocity of the car is still $v$. The total momentum of the car plus block is now $$P\_{final} = P\_{initial} - F\Delta t$$ **Conclusion** What happens to the car when the block falls depends on what made the block fall. The law of conservation of momentum doesn't guarantee that the car will automatically change velocity just because the block does. We still have to think about which forces are causing the changes.
722,991
Let us assume there is a car of mass $m\_1$ on top of which there is a block of mass $m\_2$. The car is moving with velocity $v$. If suddenly,the block falls down,then it is common sense that the speed of the car will increase since the car has become light. But how do we feel this using rigorous mathematics and conservation of momentum? Please allow me to express myself: Suppose we consider the car without the block as the system. So that means the momentum of the car will be conserved. So $m\_1v=m\_1v\_{\mathrm{final}}$ meaning final and initial velocities will be same, however that is clearly not true. That means in the *only car system*,some kind of external force is acting on the *only car system*. But what is this external force? If we draw the free body diagram of the car,what will be the direction of this external force? What does a block having to fall from the car,got to do with external force? *In other words,how do we define external force in this system?* Is this force the normal vector that we use to represent force on a body?If that's case,could you please show this force as vector? I am extremely sorry if my question sounds dumb. But i can't feel the conservation of momentum due to the vague definition of external force *here*. Or a rigorous mathematical calculation *proving* that the momentum of the car and block system will be conserved here will be very helpful(like we deduce the formula in collision problems).
2022/08/14
[ "https://physics.stackexchange.com/questions/722991", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/311011/" ]
> > If suddenly, the block falls down, then it is common sense that the > speed of the car will increase since the car has become light. > > > It's not really common sense. For a real scenario the car will encounter external dissipative forces, primarily air drag, that needs to be matched by a forward static friction force applied by the road to the wheel (in response to wheel torque) for a net force of zero. Since the block is on top of the car, part of the air drag force is associated with the block. If the block falls off, the air drag force is reduced. Then, if the applied torque to the wheel(s) is unchanged, there will be a net force acting forward resulting in acceleration of the car. On the other hand, if the block were inside the car it would experience no air drag. If it were dropped out the window, there would be no change in the external forces acting upon the car. The car will continue to move with the same velocity. > > Suppose we consider the car without the block as the system. So that > means the momentum of the car will be conserved. > > > Sticking with the "real car scenario" discussed above, momentum is not conserved because the removal of the block results in a reduction of the air drag force acting on the car, resulting in a net forward force and acceleration. > > That means in the only car system, some kind of external force is > acting on the only car system. But what is this external force? > > > Again, there are two main external forces acting on the car- air drag and the static friction force the road applies to the drive wheel(s) which is equal and opposite to the force the drive wheel(s) applies to the road per Newton's 3rd law. The loss of the block reduces the air drag force for a net force forward on the car. > > If we draw the free body diagram of the car, what will be the > direction of this external force? > > > A free body diagram of the car will show a static friction force applied to the wheel acting forward and an opposing air drag force acting backwards. When the two forces are equal the car is moving at constant velocity. When the block falls off, there will be a reduction in the drag force resulting in a net external force acting forward. > > What does a block having to fall from the car, got to do with external > force? > > > The air drag force acting backwards on the car is reduced when the block falls off. > > In other words, how do we define external force in this system? Is > this force the normal vector that we use to represent force on a body? > If that's case, could you please show this force as vector? > > > In this example the only forces of interested are the horizontal forces. So the vectors for the static friction force and air drag force are simply vectors in the horizontal direction. Hope this helps.
if an object is moving with a constant velocity in the absence of any forces, and apart of it self falls off. The momentum of the object decreases, only because of a loss of mass. the velocity of the object will not change as no forces are acting on it. With a car its slightly different. assuming no air resistance to less complicate things. the engine constantly does work on the car, this causes some constant acceleration F/m = a. If the car loses mass, The same force, is now applied to a smaller mass. Causing a greater acceleration. with air resistance the effect is an increase to some higher constant velocity.
722,991
Let us assume there is a car of mass $m\_1$ on top of which there is a block of mass $m\_2$. The car is moving with velocity $v$. If suddenly,the block falls down,then it is common sense that the speed of the car will increase since the car has become light. But how do we feel this using rigorous mathematics and conservation of momentum? Please allow me to express myself: Suppose we consider the car without the block as the system. So that means the momentum of the car will be conserved. So $m\_1v=m\_1v\_{\mathrm{final}}$ meaning final and initial velocities will be same, however that is clearly not true. That means in the *only car system*,some kind of external force is acting on the *only car system*. But what is this external force? If we draw the free body diagram of the car,what will be the direction of this external force? What does a block having to fall from the car,got to do with external force? *In other words,how do we define external force in this system?* Is this force the normal vector that we use to represent force on a body?If that's case,could you please show this force as vector? I am extremely sorry if my question sounds dumb. But i can't feel the conservation of momentum due to the vague definition of external force *here*. Or a rigorous mathematical calculation *proving* that the momentum of the car and block system will be conserved here will be very helpful(like we deduce the formula in collision problems).
2022/08/14
[ "https://physics.stackexchange.com/questions/722991", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/311011/" ]
When the object over the car falls down, it keeps at first the same horizontal velocity. The total linear momentum (car + object) doesn't change. So there is no reason to expect a change of the car velocity. Of course, as soon as the object hits the road, it will stop due to the friction, but that is another story.
When you look at a change in mass you always have to consider the conservation of the total momentum. Let's look at the car, but let's make it a car in space for simplicity, going at $ vM$, (this includes the brick with mass $m$). The mass you subtract will always have a momentum before and after the separation and you always have to consider both. The only way to make your scenario sensible would be something like this: Let's say the brick was just attached with a little cable (that is weightless and magically does not enact any forces) which you now cut so that the brick will continue to float next to your car with $ v m$, for ever if you don't do anything else. > > Suppose we consider the car without the block as the system. So that means the momentum of the car will be conserved. > > > That is really the crux, this kind of just "cutting things out" of your system can only be done with things that don't interact with anything in your system. Really the cutting of the magic cable is not a physical act, as it changes nothing, it's just a change in perspective. The car now has smaller momentum $v (M-m)$, the brick will have $ v m$, together still $v (M-m) + v m =vM$ right? BUT that only works because they don't interact *the cable was never really there to begin with*. That you are asking now which force changed the momentum of the car, is like going from an inertial system in which the car is moving $ P = vM$ to one inside the car $ P' = 0$ and asking where is the force that stopped the car? There is none, you just changed perspective.
722,991
Let us assume there is a car of mass $m\_1$ on top of which there is a block of mass $m\_2$. The car is moving with velocity $v$. If suddenly,the block falls down,then it is common sense that the speed of the car will increase since the car has become light. But how do we feel this using rigorous mathematics and conservation of momentum? Please allow me to express myself: Suppose we consider the car without the block as the system. So that means the momentum of the car will be conserved. So $m\_1v=m\_1v\_{\mathrm{final}}$ meaning final and initial velocities will be same, however that is clearly not true. That means in the *only car system*,some kind of external force is acting on the *only car system*. But what is this external force? If we draw the free body diagram of the car,what will be the direction of this external force? What does a block having to fall from the car,got to do with external force? *In other words,how do we define external force in this system?* Is this force the normal vector that we use to represent force on a body?If that's case,could you please show this force as vector? I am extremely sorry if my question sounds dumb. But i can't feel the conservation of momentum due to the vague definition of external force *here*. Or a rigorous mathematical calculation *proving* that the momentum of the car and block system will be conserved here will be very helpful(like we deduce the formula in collision problems).
2022/08/14
[ "https://physics.stackexchange.com/questions/722991", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/311011/" ]
When you look at a change in mass you always have to consider the conservation of the total momentum. Let's look at the car, but let's make it a car in space for simplicity, going at $ vM$, (this includes the brick with mass $m$). The mass you subtract will always have a momentum before and after the separation and you always have to consider both. The only way to make your scenario sensible would be something like this: Let's say the brick was just attached with a little cable (that is weightless and magically does not enact any forces) which you now cut so that the brick will continue to float next to your car with $ v m$, for ever if you don't do anything else. > > Suppose we consider the car without the block as the system. So that means the momentum of the car will be conserved. > > > That is really the crux, this kind of just "cutting things out" of your system can only be done with things that don't interact with anything in your system. Really the cutting of the magic cable is not a physical act, as it changes nothing, it's just a change in perspective. The car now has smaller momentum $v (M-m)$, the brick will have $ v m$, together still $v (M-m) + v m =vM$ right? BUT that only works because they don't interact *the cable was never really there to begin with*. That you are asking now which force changed the momentum of the car, is like going from an inertial system in which the car is moving $ P = vM$ to one inside the car $ P' = 0$ and asking where is the force that stopped the car? There is none, you just changed perspective.
if an object is moving with a constant velocity in the absence of any forces, and apart of it self falls off. The momentum of the object decreases, only because of a loss of mass. the velocity of the object will not change as no forces are acting on it. With a car its slightly different. assuming no air resistance to less complicate things. the engine constantly does work on the car, this causes some constant acceleration F/m = a. If the car loses mass, The same force, is now applied to a smaller mass. Causing a greater acceleration. with air resistance the effect is an increase to some higher constant velocity.
722,991
Let us assume there is a car of mass $m\_1$ on top of which there is a block of mass $m\_2$. The car is moving with velocity $v$. If suddenly,the block falls down,then it is common sense that the speed of the car will increase since the car has become light. But how do we feel this using rigorous mathematics and conservation of momentum? Please allow me to express myself: Suppose we consider the car without the block as the system. So that means the momentum of the car will be conserved. So $m\_1v=m\_1v\_{\mathrm{final}}$ meaning final and initial velocities will be same, however that is clearly not true. That means in the *only car system*,some kind of external force is acting on the *only car system*. But what is this external force? If we draw the free body diagram of the car,what will be the direction of this external force? What does a block having to fall from the car,got to do with external force? *In other words,how do we define external force in this system?* Is this force the normal vector that we use to represent force on a body?If that's case,could you please show this force as vector? I am extremely sorry if my question sounds dumb. But i can't feel the conservation of momentum due to the vague definition of external force *here*. Or a rigorous mathematical calculation *proving* that the momentum of the car and block system will be conserved here will be very helpful(like we deduce the formula in collision problems).
2022/08/14
[ "https://physics.stackexchange.com/questions/722991", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/311011/" ]
When you look at a change in mass you always have to consider the conservation of the total momentum. Let's look at the car, but let's make it a car in space for simplicity, going at $ vM$, (this includes the brick with mass $m$). The mass you subtract will always have a momentum before and after the separation and you always have to consider both. The only way to make your scenario sensible would be something like this: Let's say the brick was just attached with a little cable (that is weightless and magically does not enact any forces) which you now cut so that the brick will continue to float next to your car with $ v m$, for ever if you don't do anything else. > > Suppose we consider the car without the block as the system. So that means the momentum of the car will be conserved. > > > That is really the crux, this kind of just "cutting things out" of your system can only be done with things that don't interact with anything in your system. Really the cutting of the magic cable is not a physical act, as it changes nothing, it's just a change in perspective. The car now has smaller momentum $v (M-m)$, the brick will have $ v m$, together still $v (M-m) + v m =vM$ right? BUT that only works because they don't interact *the cable was never really there to begin with*. That you are asking now which force changed the momentum of the car, is like going from an inertial system in which the car is moving $ P = vM$ to one inside the car $ P' = 0$ and asking where is the force that stopped the car? There is none, you just changed perspective.
The car's environment is not fully indicated in the question. The word *falls* implies a gravity. Assuming the car travels on a road then the falling of the block is perpendicular to the cars motion. In this case the car and the block can be analyzed as separate systems. **For the car** the normal force is reduced thus reducing friction: 1. If the engine applies a constant force then the car will accelerate. At the moment the block is detached, momentum is conserved. After the car will establish a new momentum. This has nothing to do with conservation of momentum. 2. If the engine applies a constant velocity then the car will not accelerate. Momentum is conserved when the block is released. As time goes by the car's momentum is not considered conserved, but rather maintained by inertia while the car's engine is used to deal with friction. **For the block**: In the absence of friction, the block will continue to move at the velocity of release, parallel to the car. So *horizontal* momentum of the block is conserved. The force of gravity will accelerate the block downward increasing the *vertical* momentum of the block. Notice that the combined system *horizontal* momentum is conserved in the absence of friction. The only external force acting on the car is friction that is overcome by the engine. In the absence of friction there is no *net* external force on the car. In the absence of friction the only force acting on the released block is gravity. There is no interaction between the car and the block.
722,991
Let us assume there is a car of mass $m\_1$ on top of which there is a block of mass $m\_2$. The car is moving with velocity $v$. If suddenly,the block falls down,then it is common sense that the speed of the car will increase since the car has become light. But how do we feel this using rigorous mathematics and conservation of momentum? Please allow me to express myself: Suppose we consider the car without the block as the system. So that means the momentum of the car will be conserved. So $m\_1v=m\_1v\_{\mathrm{final}}$ meaning final and initial velocities will be same, however that is clearly not true. That means in the *only car system*,some kind of external force is acting on the *only car system*. But what is this external force? If we draw the free body diagram of the car,what will be the direction of this external force? What does a block having to fall from the car,got to do with external force? *In other words,how do we define external force in this system?* Is this force the normal vector that we use to represent force on a body?If that's case,could you please show this force as vector? I am extremely sorry if my question sounds dumb. But i can't feel the conservation of momentum due to the vague definition of external force *here*. Or a rigorous mathematical calculation *proving* that the momentum of the car and block system will be conserved here will be very helpful(like we deduce the formula in collision problems).
2022/08/14
[ "https://physics.stackexchange.com/questions/722991", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/311011/" ]
> > If suddenly, the block falls down, then it is common sense that the > speed of the car will increase since the car has become light. > > > It's not really common sense. For a real scenario the car will encounter external dissipative forces, primarily air drag, that needs to be matched by a forward static friction force applied by the road to the wheel (in response to wheel torque) for a net force of zero. Since the block is on top of the car, part of the air drag force is associated with the block. If the block falls off, the air drag force is reduced. Then, if the applied torque to the wheel(s) is unchanged, there will be a net force acting forward resulting in acceleration of the car. On the other hand, if the block were inside the car it would experience no air drag. If it were dropped out the window, there would be no change in the external forces acting upon the car. The car will continue to move with the same velocity. > > Suppose we consider the car without the block as the system. So that > means the momentum of the car will be conserved. > > > Sticking with the "real car scenario" discussed above, momentum is not conserved because the removal of the block results in a reduction of the air drag force acting on the car, resulting in a net forward force and acceleration. > > That means in the only car system, some kind of external force is > acting on the only car system. But what is this external force? > > > Again, there are two main external forces acting on the car- air drag and the static friction force the road applies to the drive wheel(s) which is equal and opposite to the force the drive wheel(s) applies to the road per Newton's 3rd law. The loss of the block reduces the air drag force for a net force forward on the car. > > If we draw the free body diagram of the car, what will be the > direction of this external force? > > > A free body diagram of the car will show a static friction force applied to the wheel acting forward and an opposing air drag force acting backwards. When the two forces are equal the car is moving at constant velocity. When the block falls off, there will be a reduction in the drag force resulting in a net external force acting forward. > > What does a block having to fall from the car, got to do with external > force? > > > The air drag force acting backwards on the car is reduced when the block falls off. > > In other words, how do we define external force in this system? Is > this force the normal vector that we use to represent force on a body? > If that's case, could you please show this force as vector? > > > In this example the only forces of interested are the horizontal forces. So the vectors for the static friction force and air drag force are simply vectors in the horizontal direction. Hope this helps.
As explained in some of the answers, the car does not accelerate when the block falls. However there is a "if". The car's velocity does not change if the car is moving without its engine turned on. If the engine is on, providing a forward force F, then the car accelerates when its mass decreases. $ a= \frac{F}{m} $. Reduce m translates into an increase of the acceleration.
280,765
What precisely does the first few words of this sentence mean? > > For all Clark says, mental items that have Euler circles as their content could mean what they do by some naturalistic theory of content, just as we suppose that mental representations of natural objects do. > > > Would it have the same exact meaning if it said: > > Clark is saying mental items that have Euler circles as their content could mean what they do by some naturalistic theory of content, just as we suppose that mental representations of natural objects do. > > > (quotation from "[Defending the Bounds of Cognition](https://books.google.com/books?id=DxQNhOS8VjQC&printsec=frontcover&dq=%22Defending+the+Bounds+of+Cognition%22+%22The+Extended+Mind%22&hl=en&sa=X&ved=0ahUKEwjWjMv97ZvPAhVH-GMKHXYpBPsQ6AEIHjAA#v=onepage&q=%22Defending%20the%20Bounds%20of%20Cognition%22&f=false)" by Fred Adams and Ken Aizawa)
2015/10/17
[ "https://english.stackexchange.com/questions/280765", "https://english.stackexchange.com", "https://english.stackexchange.com/users/143203/" ]
There are actually two ways to understand "For all Clark says" in the OP's example. One is the interpretation that chasly from uk and Brian Donovan give of it: "For all Clark says" means something like "Notwithstanding all the information that Clark provides." A second (and contrary) interpretation sees "For all Clark says" as being more akin to the idiomatic expression "For all we know," which implies "Given the limited knowledge we possess." In the OP's example, this second interpretation might work out as "Given the [incomplete] account that Clark offers." The two meanings disagree on the question of whether the conclusion that follows the opening "For all Clark says" represents a result contrary to Clark's assertions (the position that the first interpretation above takes) or represents a result—of unspecified plausibility—that is not incompatible with Clark's commentary (the position that the second interpretation above takes). An example where the first interpretation of the phrase "For all he says" seems clearly correct appears in Rose Macaulay, [*The Towers of Trebizond*](https://books.google.com/books?id=Jlyc6mGk0xIC&pg=PA259&dq=%22for+all+he+says%22&hl=en&sa=X&ved=0ahUKEwjJ-qbOg67KAhVS3WMKHVc4DREQ6AEIODAF#v=onepage&q=%22for%20all%20he%20says%22&f=false) (2003): > > Father Hugh thinks it would have a tremendous effect on simple, inexperienced people like televiewers; he thinks they would say, 'I must join the Church, if that's what its services are like.' Mind you, I wouldn't let *him* take part, he'd put in far too much Latin and worry people. **For all he says** he isn't, he's a bit of an ultramontane, in practice though not in theory, and we can't have *that* in the Church of England, we must stay dyed-in-the-wool Anglican. > > > An example where the second interpretation of the phrase "For all he says" seems correct appears in R.P. Winnington-Ingram, [*Mode in Ancient Greek Music*](https://books.google.com/books?id=BqREBgAAQBAJ&pg=PA81&dq=%22for+all+he+says%22&hl=en&sa=X&ved=0ahUKEwjfp_2_h67KAhUO42MKHYXYA244ChDoAQgnMAI#v=onepage&q=%22for%20all%20he%20says%22&f=false) (2015): > > Centuries later, the nature of Ptolemy's theoretical system is fairly clear. Seven τονοι provided melodies which, like the ‘αρμονιαι, differed in character; and these τονοι were modes, being in essence species of the octave. Ptolemy offers no information about the relative values of their notes; **for all he says** we might believe that Mese (κατα δυναμιν) acted as tonic in each of them. > > > And an example where either interpretation might be valid appears in Ruth Anna Putnam, "[Perception: From Moore to Austin](https://books.google.com/books?id=_fOFAgAAQBAJ&pg=PA183&dq=%22for+all+he+says%22&hl=en&sa=X&ved=0ahUKEwjJ-qbOg67KAhVS3WMKHVc4DREQ6AEIITAB#v=onepage&q=%22for%20all%20he%20says%22&f=false)" in *The Story of Analytic Philosophy: Plot and Heroes* (2002): > > Let us begin, then, with the analysis of sense perception that Moore offers in "Refutation of Idealism" in opposition to what he takes to be the Idealists' account. All sensations, he says, involve two terms: a respect in which they are alike, which he calls "consciousness" or, later, "awareness" and a respect in which they differ, which he calls the "object." For example, an awareness of a blue sky and an awareness of a green meadow are alike in being awarenesses but differ in their objects. Of course, Moore does not speak of blue skies and green meadows, he speaks merely of blue and of green, and he means, I think, that we are aware of the property blue. On the other hand, in his reply to Ducasse in the Schilpp volume (Schilpp 1942), Moore tells us that to say that blue exists is to say that some object that is blue exists; so, to be aware of blue may be to be aware of some blue object, and **for all he says** in “The Refutation of Idealism" that object might be the sky. > > >
> > For all Clark says, mental items that have Euler circles as their content could mean what they do by some naturalistic theory of content... > > > Would it have the same exact meaning if it said: > > Clark is saying mental items that have Euler circles as their content could mean what they do by some naturalistic theory of content... > > > No, almost the opposite. Here are some paraphrases: Despite what Clark says... In spite of what Clark says... Regardless of what Clarke says... Whatever Clark may say ...
66,684
I plan on taking a new job that does not allow employee 401k contributions for the first 6 months. I am used to maxing out my 401k, and this seems like a dangerous amount of money that I don't want to get too comfortable with, only to have to part with it later when I can start contributing to the new 401k (by my calculations that's almost $700 a paycheck as of the year 2016). I have a Roth IRA that I plan to continue maxing out during this time. I have read [this question](https://money.stackexchange.com/questions/54156/what-to-do-with-extra-money-when-company-doesnt-offer-401k), but I feel my situation is a bit different since this is temporary. I would like to know some temporary (but not necessarily short term) investments to help me stay familiar with what my salary will be like once I make contributions again. Also, I have no debt to pay down, and have a very comfortable emergency fund (in my opinion anyway). In summary, I will have to stop making 401k contributions while starting a new job for the 1st 6 months. How should I invest ~$350 a week during this 6 months when I already max my Roth IRA and without having ridiculous brokerage fees (buying stock every week through my bank or some other broker that charges for each transaction)? Buy a bunch of lotto tickets? Start sleeping on a money pillow? Just eat the brokerage fees and invest in some stock anyway (or try to play around in something like Loyal3)? What are some good options? And sorry, sending out that money to any of you is NOT an option!
2016/06/28
[ "https://money.stackexchange.com/questions/66684", "https://money.stackexchange.com", "https://money.stackexchange.com/users/24189/" ]
$9000 over 6 months is great, I'd use it for long term savings regardless of the 401(k) situation. There's nothing wrong with a mix of pre and post tax money for retirement. In fact, it's a great way to avoid paying too much tax should your 401(k) withdrawals in retirement push you into a higher bracket. Just invest this as you would your other long term money.
I would open a taxable account with the same custodian that manages your Roth IRA (e.g., Vanguard, Fidelity, etc.). Then within the taxable account I would invest the extra money in low cost, broad market index funds that are tax efficient. Unlike in your 401(k) and Roth IRA, you will now have tax implications if your funds produce dividends or realize a capital gain. That is why tax-efficient funds are important to minimize this as much as possible. The [3-fund portfolio](https://www.bogleheads.org/wiki/Three-fund_portfolio) is a popular choice for taxable accounts because of simplicity and the tax efficiency of broad market index funds that are part of the three fund portfolio. The 3-fund portfolio normally consists of * Broad market US stock index fund * Broad market international stock index fund * Broad market bond fund Depending on your tax bracket you may want to consider municipal bonds in your taxable instead of taxable bonds if your tax bracket is 25% or higher. Another option is to [forgo bonds altogether in the taxable account](https://www.bogleheads.org/wiki/Tax-efficient_fund_placement) and just hold bonds in retirement accounts while keeping tax efficient domestic and international tock funds in your taxable account. Then adjust the bond portion upward in your retirement accounts to account for the additional stocks in your taxable accounts. This will maintain the asset allocation that you've already chosen that is appropriate for your age and goals.
66,684
I plan on taking a new job that does not allow employee 401k contributions for the first 6 months. I am used to maxing out my 401k, and this seems like a dangerous amount of money that I don't want to get too comfortable with, only to have to part with it later when I can start contributing to the new 401k (by my calculations that's almost $700 a paycheck as of the year 2016). I have a Roth IRA that I plan to continue maxing out during this time. I have read [this question](https://money.stackexchange.com/questions/54156/what-to-do-with-extra-money-when-company-doesnt-offer-401k), but I feel my situation is a bit different since this is temporary. I would like to know some temporary (but not necessarily short term) investments to help me stay familiar with what my salary will be like once I make contributions again. Also, I have no debt to pay down, and have a very comfortable emergency fund (in my opinion anyway). In summary, I will have to stop making 401k contributions while starting a new job for the 1st 6 months. How should I invest ~$350 a week during this 6 months when I already max my Roth IRA and without having ridiculous brokerage fees (buying stock every week through my bank or some other broker that charges for each transaction)? Buy a bunch of lotto tickets? Start sleeping on a money pillow? Just eat the brokerage fees and invest in some stock anyway (or try to play around in something like Loyal3)? What are some good options? And sorry, sending out that money to any of you is NOT an option!
2016/06/28
[ "https://money.stackexchange.com/questions/66684", "https://money.stackexchange.com", "https://money.stackexchange.com/users/24189/" ]
I'm a bit hesitant to put this in an answer as I don't know if specific investment advice is appropriate, but this has grown way too long for a comment. The typical answer given for people who don't have the time, experience, knowledge or inclination to pick specific stocks to hold should instead invest in ETFs ([exchange-traded](https://en.wikipedia.org/wiki/Exchange-traded_fund#Index_ETFs) [**index funds**](https://en.wikipedia.org/wiki/Index_fund).) What these basically do is attempt to simulate a particular market or stock exchange. An S&P 500 index fund will (generally) attempt to hold shares in the stocks that make up that index. They only have to follow an index, not try to beat it so are called "passively" managed. They have very low expense ratios (far below 1%) and are considered a good choice for investors who want to hold stock without significant effort or expense and who's main goal is [time in the market](https://us.axa.com/axa-products/investment-strategies/articles/market-strategies-time-vs-timing.html). It's a contentious topic but on average an index (and therefore an index fund) will go even with or outperform most actively managed funds. With a sufficiently long investment horizon, which you have, these may be ideal for you. Trading in ETFs is also typically cheap because they are traded like stock. There are plenty of low-fee online brokers and virtually all will allow trading in ETFs. My broker even has a list of several hundred popular ETFs that can be traded for free. The golden rule in investing is that you should **never buy into something you don't understand.** Don't buy individual stock with little information: it's often little more than gambling. The same goes for trading platforms like Loyal3. Don't use them unless you know their business model and what they stand to gain from your custom. As mentioned I can trade certain funds for free with my broker, but I know why they can offer that and how they're still making money.
If your main concern is simply the psychological effect of not seeing the money, rather than getting return on the money, you should look into whether your employer will allow you to have direct deposit into two different accounts. If so, have what would have gone into your 401(k) go into a new bank account that you never look at. You might even be able to find a bank willing to give you a bonus for opening an account.
66,684
I plan on taking a new job that does not allow employee 401k contributions for the first 6 months. I am used to maxing out my 401k, and this seems like a dangerous amount of money that I don't want to get too comfortable with, only to have to part with it later when I can start contributing to the new 401k (by my calculations that's almost $700 a paycheck as of the year 2016). I have a Roth IRA that I plan to continue maxing out during this time. I have read [this question](https://money.stackexchange.com/questions/54156/what-to-do-with-extra-money-when-company-doesnt-offer-401k), but I feel my situation is a bit different since this is temporary. I would like to know some temporary (but not necessarily short term) investments to help me stay familiar with what my salary will be like once I make contributions again. Also, I have no debt to pay down, and have a very comfortable emergency fund (in my opinion anyway). In summary, I will have to stop making 401k contributions while starting a new job for the 1st 6 months. How should I invest ~$350 a week during this 6 months when I already max my Roth IRA and without having ridiculous brokerage fees (buying stock every week through my bank or some other broker that charges for each transaction)? Buy a bunch of lotto tickets? Start sleeping on a money pillow? Just eat the brokerage fees and invest in some stock anyway (or try to play around in something like Loyal3)? What are some good options? And sorry, sending out that money to any of you is NOT an option!
2016/06/28
[ "https://money.stackexchange.com/questions/66684", "https://money.stackexchange.com", "https://money.stackexchange.com/users/24189/" ]
I'm a bit hesitant to put this in an answer as I don't know if specific investment advice is appropriate, but this has grown way too long for a comment. The typical answer given for people who don't have the time, experience, knowledge or inclination to pick specific stocks to hold should instead invest in ETFs ([exchange-traded](https://en.wikipedia.org/wiki/Exchange-traded_fund#Index_ETFs) [**index funds**](https://en.wikipedia.org/wiki/Index_fund).) What these basically do is attempt to simulate a particular market or stock exchange. An S&P 500 index fund will (generally) attempt to hold shares in the stocks that make up that index. They only have to follow an index, not try to beat it so are called "passively" managed. They have very low expense ratios (far below 1%) and are considered a good choice for investors who want to hold stock without significant effort or expense and who's main goal is [time in the market](https://us.axa.com/axa-products/investment-strategies/articles/market-strategies-time-vs-timing.html). It's a contentious topic but on average an index (and therefore an index fund) will go even with or outperform most actively managed funds. With a sufficiently long investment horizon, which you have, these may be ideal for you. Trading in ETFs is also typically cheap because they are traded like stock. There are plenty of low-fee online brokers and virtually all will allow trading in ETFs. My broker even has a list of several hundred popular ETFs that can be traded for free. The golden rule in investing is that you should **never buy into something you don't understand.** Don't buy individual stock with little information: it's often little more than gambling. The same goes for trading platforms like Loyal3. Don't use them unless you know their business model and what they stand to gain from your custom. As mentioned I can trade certain funds for free with my broker, but I know why they can offer that and how they're still making money.
Two options not mentioned: -No information about your emergency fund in your question. If you don't have 6 months of expenses saved up in a "safe" place (high yield savings account or money market fund) I'd add to that first. -Could you auto-withdraw the amount over six months, then when you can start contributing, contribute twice as much so you are still putting in $18,000 a "year"? The amount you pulled into savings the first 6 months could be used to make up for the extra income coming out after the six months are over. Depending on your income, and since you have the ability to save, it's important not to "lose" access to these tax efficient accounts. And also... -After-tax brokerage account (as mentioned above) is also fine. But if you will use this money for downpayment on a home or something similar within the next five years, I wouldn't recommend investing it. However, having money invested in an after-tax account isn't a terrible thing, yes you'll get taxed when you sell the investments but you have a lot of flexibility to access that money at any time, unlike your retirement accounts.
66,684
I plan on taking a new job that does not allow employee 401k contributions for the first 6 months. I am used to maxing out my 401k, and this seems like a dangerous amount of money that I don't want to get too comfortable with, only to have to part with it later when I can start contributing to the new 401k (by my calculations that's almost $700 a paycheck as of the year 2016). I have a Roth IRA that I plan to continue maxing out during this time. I have read [this question](https://money.stackexchange.com/questions/54156/what-to-do-with-extra-money-when-company-doesnt-offer-401k), but I feel my situation is a bit different since this is temporary. I would like to know some temporary (but not necessarily short term) investments to help me stay familiar with what my salary will be like once I make contributions again. Also, I have no debt to pay down, and have a very comfortable emergency fund (in my opinion anyway). In summary, I will have to stop making 401k contributions while starting a new job for the 1st 6 months. How should I invest ~$350 a week during this 6 months when I already max my Roth IRA and without having ridiculous brokerage fees (buying stock every week through my bank or some other broker that charges for each transaction)? Buy a bunch of lotto tickets? Start sleeping on a money pillow? Just eat the brokerage fees and invest in some stock anyway (or try to play around in something like Loyal3)? What are some good options? And sorry, sending out that money to any of you is NOT an option!
2016/06/28
[ "https://money.stackexchange.com/questions/66684", "https://money.stackexchange.com", "https://money.stackexchange.com/users/24189/" ]
I'm a bit hesitant to put this in an answer as I don't know if specific investment advice is appropriate, but this has grown way too long for a comment. The typical answer given for people who don't have the time, experience, knowledge or inclination to pick specific stocks to hold should instead invest in ETFs ([exchange-traded](https://en.wikipedia.org/wiki/Exchange-traded_fund#Index_ETFs) [**index funds**](https://en.wikipedia.org/wiki/Index_fund).) What these basically do is attempt to simulate a particular market or stock exchange. An S&P 500 index fund will (generally) attempt to hold shares in the stocks that make up that index. They only have to follow an index, not try to beat it so are called "passively" managed. They have very low expense ratios (far below 1%) and are considered a good choice for investors who want to hold stock without significant effort or expense and who's main goal is [time in the market](https://us.axa.com/axa-products/investment-strategies/articles/market-strategies-time-vs-timing.html). It's a contentious topic but on average an index (and therefore an index fund) will go even with or outperform most actively managed funds. With a sufficiently long investment horizon, which you have, these may be ideal for you. Trading in ETFs is also typically cheap because they are traded like stock. There are plenty of low-fee online brokers and virtually all will allow trading in ETFs. My broker even has a list of several hundred popular ETFs that can be traded for free. The golden rule in investing is that you should **never buy into something you don't understand.** Don't buy individual stock with little information: it's often little more than gambling. The same goes for trading platforms like Loyal3. Don't use them unless you know their business model and what they stand to gain from your custom. As mentioned I can trade certain funds for free with my broker, but I know why they can offer that and how they're still making money.
Short answer is fund a Roth. If you are under 50 then you can put in $5500 or $6500 if you are older. Great to have money in two buckets one pre tax and one post tax. Plus you can be aggressive putting money in it because you can always take money you put in the Roth out of the Roth with no tax or penalty. Taxes are historically low so it makes a lot of sense to diversify your retirement.
66,684
I plan on taking a new job that does not allow employee 401k contributions for the first 6 months. I am used to maxing out my 401k, and this seems like a dangerous amount of money that I don't want to get too comfortable with, only to have to part with it later when I can start contributing to the new 401k (by my calculations that's almost $700 a paycheck as of the year 2016). I have a Roth IRA that I plan to continue maxing out during this time. I have read [this question](https://money.stackexchange.com/questions/54156/what-to-do-with-extra-money-when-company-doesnt-offer-401k), but I feel my situation is a bit different since this is temporary. I would like to know some temporary (but not necessarily short term) investments to help me stay familiar with what my salary will be like once I make contributions again. Also, I have no debt to pay down, and have a very comfortable emergency fund (in my opinion anyway). In summary, I will have to stop making 401k contributions while starting a new job for the 1st 6 months. How should I invest ~$350 a week during this 6 months when I already max my Roth IRA and without having ridiculous brokerage fees (buying stock every week through my bank or some other broker that charges for each transaction)? Buy a bunch of lotto tickets? Start sleeping on a money pillow? Just eat the brokerage fees and invest in some stock anyway (or try to play around in something like Loyal3)? What are some good options? And sorry, sending out that money to any of you is NOT an option!
2016/06/28
[ "https://money.stackexchange.com/questions/66684", "https://money.stackexchange.com", "https://money.stackexchange.com/users/24189/" ]
I would open a taxable account with the same custodian that manages your Roth IRA (e.g., Vanguard, Fidelity, etc.). Then within the taxable account I would invest the extra money in low cost, broad market index funds that are tax efficient. Unlike in your 401(k) and Roth IRA, you will now have tax implications if your funds produce dividends or realize a capital gain. That is why tax-efficient funds are important to minimize this as much as possible. The [3-fund portfolio](https://www.bogleheads.org/wiki/Three-fund_portfolio) is a popular choice for taxable accounts because of simplicity and the tax efficiency of broad market index funds that are part of the three fund portfolio. The 3-fund portfolio normally consists of * Broad market US stock index fund * Broad market international stock index fund * Broad market bond fund Depending on your tax bracket you may want to consider municipal bonds in your taxable instead of taxable bonds if your tax bracket is 25% or higher. Another option is to [forgo bonds altogether in the taxable account](https://www.bogleheads.org/wiki/Tax-efficient_fund_placement) and just hold bonds in retirement accounts while keeping tax efficient domestic and international tock funds in your taxable account. Then adjust the bond portion upward in your retirement accounts to account for the additional stocks in your taxable accounts. This will maintain the asset allocation that you've already chosen that is appropriate for your age and goals.
I'm a bit hesitant to put this in an answer as I don't know if specific investment advice is appropriate, but this has grown way too long for a comment. The typical answer given for people who don't have the time, experience, knowledge or inclination to pick specific stocks to hold should instead invest in ETFs ([exchange-traded](https://en.wikipedia.org/wiki/Exchange-traded_fund#Index_ETFs) [**index funds**](https://en.wikipedia.org/wiki/Index_fund).) What these basically do is attempt to simulate a particular market or stock exchange. An S&P 500 index fund will (generally) attempt to hold shares in the stocks that make up that index. They only have to follow an index, not try to beat it so are called "passively" managed. They have very low expense ratios (far below 1%) and are considered a good choice for investors who want to hold stock without significant effort or expense and who's main goal is [time in the market](https://us.axa.com/axa-products/investment-strategies/articles/market-strategies-time-vs-timing.html). It's a contentious topic but on average an index (and therefore an index fund) will go even with or outperform most actively managed funds. With a sufficiently long investment horizon, which you have, these may be ideal for you. Trading in ETFs is also typically cheap because they are traded like stock. There are plenty of low-fee online brokers and virtually all will allow trading in ETFs. My broker even has a list of several hundred popular ETFs that can be traded for free. The golden rule in investing is that you should **never buy into something you don't understand.** Don't buy individual stock with little information: it's often little more than gambling. The same goes for trading platforms like Loyal3. Don't use them unless you know their business model and what they stand to gain from your custom. As mentioned I can trade certain funds for free with my broker, but I know why they can offer that and how they're still making money.
66,684
I plan on taking a new job that does not allow employee 401k contributions for the first 6 months. I am used to maxing out my 401k, and this seems like a dangerous amount of money that I don't want to get too comfortable with, only to have to part with it later when I can start contributing to the new 401k (by my calculations that's almost $700 a paycheck as of the year 2016). I have a Roth IRA that I plan to continue maxing out during this time. I have read [this question](https://money.stackexchange.com/questions/54156/what-to-do-with-extra-money-when-company-doesnt-offer-401k), but I feel my situation is a bit different since this is temporary. I would like to know some temporary (but not necessarily short term) investments to help me stay familiar with what my salary will be like once I make contributions again. Also, I have no debt to pay down, and have a very comfortable emergency fund (in my opinion anyway). In summary, I will have to stop making 401k contributions while starting a new job for the 1st 6 months. How should I invest ~$350 a week during this 6 months when I already max my Roth IRA and without having ridiculous brokerage fees (buying stock every week through my bank or some other broker that charges for each transaction)? Buy a bunch of lotto tickets? Start sleeping on a money pillow? Just eat the brokerage fees and invest in some stock anyway (or try to play around in something like Loyal3)? What are some good options? And sorry, sending out that money to any of you is NOT an option!
2016/06/28
[ "https://money.stackexchange.com/questions/66684", "https://money.stackexchange.com", "https://money.stackexchange.com/users/24189/" ]
I would open a taxable account with the same custodian that manages your Roth IRA (e.g., Vanguard, Fidelity, etc.). Then within the taxable account I would invest the extra money in low cost, broad market index funds that are tax efficient. Unlike in your 401(k) and Roth IRA, you will now have tax implications if your funds produce dividends or realize a capital gain. That is why tax-efficient funds are important to minimize this as much as possible. The [3-fund portfolio](https://www.bogleheads.org/wiki/Three-fund_portfolio) is a popular choice for taxable accounts because of simplicity and the tax efficiency of broad market index funds that are part of the three fund portfolio. The 3-fund portfolio normally consists of * Broad market US stock index fund * Broad market international stock index fund * Broad market bond fund Depending on your tax bracket you may want to consider municipal bonds in your taxable instead of taxable bonds if your tax bracket is 25% or higher. Another option is to [forgo bonds altogether in the taxable account](https://www.bogleheads.org/wiki/Tax-efficient_fund_placement) and just hold bonds in retirement accounts while keeping tax efficient domestic and international tock funds in your taxable account. Then adjust the bond portion upward in your retirement accounts to account for the additional stocks in your taxable accounts. This will maintain the asset allocation that you've already chosen that is appropriate for your age and goals.
Short answer is fund a Roth. If you are under 50 then you can put in $5500 or $6500 if you are older. Great to have money in two buckets one pre tax and one post tax. Plus you can be aggressive putting money in it because you can always take money you put in the Roth out of the Roth with no tax or penalty. Taxes are historically low so it makes a lot of sense to diversify your retirement.
66,684
I plan on taking a new job that does not allow employee 401k contributions for the first 6 months. I am used to maxing out my 401k, and this seems like a dangerous amount of money that I don't want to get too comfortable with, only to have to part with it later when I can start contributing to the new 401k (by my calculations that's almost $700 a paycheck as of the year 2016). I have a Roth IRA that I plan to continue maxing out during this time. I have read [this question](https://money.stackexchange.com/questions/54156/what-to-do-with-extra-money-when-company-doesnt-offer-401k), but I feel my situation is a bit different since this is temporary. I would like to know some temporary (but not necessarily short term) investments to help me stay familiar with what my salary will be like once I make contributions again. Also, I have no debt to pay down, and have a very comfortable emergency fund (in my opinion anyway). In summary, I will have to stop making 401k contributions while starting a new job for the 1st 6 months. How should I invest ~$350 a week during this 6 months when I already max my Roth IRA and without having ridiculous brokerage fees (buying stock every week through my bank or some other broker that charges for each transaction)? Buy a bunch of lotto tickets? Start sleeping on a money pillow? Just eat the brokerage fees and invest in some stock anyway (or try to play around in something like Loyal3)? What are some good options? And sorry, sending out that money to any of you is NOT an option!
2016/06/28
[ "https://money.stackexchange.com/questions/66684", "https://money.stackexchange.com", "https://money.stackexchange.com/users/24189/" ]
$9000 over 6 months is great, I'd use it for long term savings regardless of the 401(k) situation. There's nothing wrong with a mix of pre and post tax money for retirement. In fact, it's a great way to avoid paying too much tax should your 401(k) withdrawals in retirement push you into a higher bracket. Just invest this as you would your other long term money.
I'm a bit hesitant to put this in an answer as I don't know if specific investment advice is appropriate, but this has grown way too long for a comment. The typical answer given for people who don't have the time, experience, knowledge or inclination to pick specific stocks to hold should instead invest in ETFs ([exchange-traded](https://en.wikipedia.org/wiki/Exchange-traded_fund#Index_ETFs) [**index funds**](https://en.wikipedia.org/wiki/Index_fund).) What these basically do is attempt to simulate a particular market or stock exchange. An S&P 500 index fund will (generally) attempt to hold shares in the stocks that make up that index. They only have to follow an index, not try to beat it so are called "passively" managed. They have very low expense ratios (far below 1%) and are considered a good choice for investors who want to hold stock without significant effort or expense and who's main goal is [time in the market](https://us.axa.com/axa-products/investment-strategies/articles/market-strategies-time-vs-timing.html). It's a contentious topic but on average an index (and therefore an index fund) will go even with or outperform most actively managed funds. With a sufficiently long investment horizon, which you have, these may be ideal for you. Trading in ETFs is also typically cheap because they are traded like stock. There are plenty of low-fee online brokers and virtually all will allow trading in ETFs. My broker even has a list of several hundred popular ETFs that can be traded for free. The golden rule in investing is that you should **never buy into something you don't understand.** Don't buy individual stock with little information: it's often little more than gambling. The same goes for trading platforms like Loyal3. Don't use them unless you know their business model and what they stand to gain from your custom. As mentioned I can trade certain funds for free with my broker, but I know why they can offer that and how they're still making money.
66,684
I plan on taking a new job that does not allow employee 401k contributions for the first 6 months. I am used to maxing out my 401k, and this seems like a dangerous amount of money that I don't want to get too comfortable with, only to have to part with it later when I can start contributing to the new 401k (by my calculations that's almost $700 a paycheck as of the year 2016). I have a Roth IRA that I plan to continue maxing out during this time. I have read [this question](https://money.stackexchange.com/questions/54156/what-to-do-with-extra-money-when-company-doesnt-offer-401k), but I feel my situation is a bit different since this is temporary. I would like to know some temporary (but not necessarily short term) investments to help me stay familiar with what my salary will be like once I make contributions again. Also, I have no debt to pay down, and have a very comfortable emergency fund (in my opinion anyway). In summary, I will have to stop making 401k contributions while starting a new job for the 1st 6 months. How should I invest ~$350 a week during this 6 months when I already max my Roth IRA and without having ridiculous brokerage fees (buying stock every week through my bank or some other broker that charges for each transaction)? Buy a bunch of lotto tickets? Start sleeping on a money pillow? Just eat the brokerage fees and invest in some stock anyway (or try to play around in something like Loyal3)? What are some good options? And sorry, sending out that money to any of you is NOT an option!
2016/06/28
[ "https://money.stackexchange.com/questions/66684", "https://money.stackexchange.com", "https://money.stackexchange.com/users/24189/" ]
$9000 over 6 months is great, I'd use it for long term savings regardless of the 401(k) situation. There's nothing wrong with a mix of pre and post tax money for retirement. In fact, it's a great way to avoid paying too much tax should your 401(k) withdrawals in retirement push you into a higher bracket. Just invest this as you would your other long term money.
If your main concern is simply the psychological effect of not seeing the money, rather than getting return on the money, you should look into whether your employer will allow you to have direct deposit into two different accounts. If so, have what would have gone into your 401(k) go into a new bank account that you never look at. You might even be able to find a bank willing to give you a bonus for opening an account.
66,684
I plan on taking a new job that does not allow employee 401k contributions for the first 6 months. I am used to maxing out my 401k, and this seems like a dangerous amount of money that I don't want to get too comfortable with, only to have to part with it later when I can start contributing to the new 401k (by my calculations that's almost $700 a paycheck as of the year 2016). I have a Roth IRA that I plan to continue maxing out during this time. I have read [this question](https://money.stackexchange.com/questions/54156/what-to-do-with-extra-money-when-company-doesnt-offer-401k), but I feel my situation is a bit different since this is temporary. I would like to know some temporary (but not necessarily short term) investments to help me stay familiar with what my salary will be like once I make contributions again. Also, I have no debt to pay down, and have a very comfortable emergency fund (in my opinion anyway). In summary, I will have to stop making 401k contributions while starting a new job for the 1st 6 months. How should I invest ~$350 a week during this 6 months when I already max my Roth IRA and without having ridiculous brokerage fees (buying stock every week through my bank or some other broker that charges for each transaction)? Buy a bunch of lotto tickets? Start sleeping on a money pillow? Just eat the brokerage fees and invest in some stock anyway (or try to play around in something like Loyal3)? What are some good options? And sorry, sending out that money to any of you is NOT an option!
2016/06/28
[ "https://money.stackexchange.com/questions/66684", "https://money.stackexchange.com", "https://money.stackexchange.com/users/24189/" ]
$9000 over 6 months is great, I'd use it for long term savings regardless of the 401(k) situation. There's nothing wrong with a mix of pre and post tax money for retirement. In fact, it's a great way to avoid paying too much tax should your 401(k) withdrawals in retirement push you into a higher bracket. Just invest this as you would your other long term money.
Short answer is fund a Roth. If you are under 50 then you can put in $5500 or $6500 if you are older. Great to have money in two buckets one pre tax and one post tax. Plus you can be aggressive putting money in it because you can always take money you put in the Roth out of the Roth with no tax or penalty. Taxes are historically low so it makes a lot of sense to diversify your retirement.
66,684
I plan on taking a new job that does not allow employee 401k contributions for the first 6 months. I am used to maxing out my 401k, and this seems like a dangerous amount of money that I don't want to get too comfortable with, only to have to part with it later when I can start contributing to the new 401k (by my calculations that's almost $700 a paycheck as of the year 2016). I have a Roth IRA that I plan to continue maxing out during this time. I have read [this question](https://money.stackexchange.com/questions/54156/what-to-do-with-extra-money-when-company-doesnt-offer-401k), but I feel my situation is a bit different since this is temporary. I would like to know some temporary (but not necessarily short term) investments to help me stay familiar with what my salary will be like once I make contributions again. Also, I have no debt to pay down, and have a very comfortable emergency fund (in my opinion anyway). In summary, I will have to stop making 401k contributions while starting a new job for the 1st 6 months. How should I invest ~$350 a week during this 6 months when I already max my Roth IRA and without having ridiculous brokerage fees (buying stock every week through my bank or some other broker that charges for each transaction)? Buy a bunch of lotto tickets? Start sleeping on a money pillow? Just eat the brokerage fees and invest in some stock anyway (or try to play around in something like Loyal3)? What are some good options? And sorry, sending out that money to any of you is NOT an option!
2016/06/28
[ "https://money.stackexchange.com/questions/66684", "https://money.stackexchange.com", "https://money.stackexchange.com/users/24189/" ]
$9000 over 6 months is great, I'd use it for long term savings regardless of the 401(k) situation. There's nothing wrong with a mix of pre and post tax money for retirement. In fact, it's a great way to avoid paying too much tax should your 401(k) withdrawals in retirement push you into a higher bracket. Just invest this as you would your other long term money.
Two options not mentioned: -No information about your emergency fund in your question. If you don't have 6 months of expenses saved up in a "safe" place (high yield savings account or money market fund) I'd add to that first. -Could you auto-withdraw the amount over six months, then when you can start contributing, contribute twice as much so you are still putting in $18,000 a "year"? The amount you pulled into savings the first 6 months could be used to make up for the extra income coming out after the six months are over. Depending on your income, and since you have the ability to save, it's important not to "lose" access to these tax efficient accounts. And also... -After-tax brokerage account (as mentioned above) is also fine. But if you will use this money for downpayment on a home or something similar within the next five years, I wouldn't recommend investing it. However, having money invested in an after-tax account isn't a terrible thing, yes you'll get taxed when you sell the investments but you have a lot of flexibility to access that money at any time, unlike your retirement accounts.
63,053,117
I am trying to connect to a google cloud VM instance having no external IP address via `cloud shell` and `cloud SDK`. Google document says that we can connect it using IAP Connecting through IAP: **refer** [using IAP](https://cloud.google.com/compute/docs/instances/connecting-advanced#bastion_host) a) Grant the `roles/iap.tunnelResourceAccessor` role to the user that wants to connect to the **VM**. b) Connect to the **VM** using below command ``` gcloud compute ssh instance-name --zone zone ``` OR Using `IAP` for `TCP` forwarding: refer [using TCP forwarding](https://cloud.google.com/iap/docs/using-tcp-forwarding) we can also connect by setting a ingress firewall rule for `IP` `'35.235.240.0/20'` with port `TCP:22` and select a `IAM` role Select `Cloud IAP > IAP-Secured Tunnel User` what's the difference between these two different approach and what's the difference in these two separate IAM roles ``` roles/iap.tunnelResourceAccessor IAP-secured Tunnel User ``` I am new to cloud so please bear with my basic knowledge.
2020/07/23
[ "https://Stackoverflow.com/questions/63053117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10316689/" ]
It's exactly the same thing. Look at [this page](https://cloud.google.com/iap/docs/managing-access#roles) > > IAP-Secured Tunnel User (roles/iap.tunnelResourceAccessor) > > > You have the display name of the role: `IAP-Secured Tunnel User` that you see in the GUI, and you have the technical name of the role `roles/iap.tunnelResourceAccessor` that you have to use in the script and CLI
The link mentioned in the question ("refer [using IAP](https://cloud.google.com/compute/docs/instances/connecting-advanced#bastion_host)") actually points to the [Connecting to instances that do not have external IP addresses > Connecting through a bastion host](https://cloud.google.com/compute/docs/instances/connecting-advanced#bastion_host). Connection through a **bastion host** is another method apart from access via IAP. As described in the document [Connecting to instances that do not have external IP addresses > Connecting through IAP](https://cloud.google.com/compute/docs/instances/connecting-advanced#cloud_iap), > > IAP's TCP forwarding feature wraps an SSH connection inside HTTPS. > IAP's TCP forwarding feature then sends it to the remote instance. > > > Therefore both parts of the question (before OR and after OR) belong to the same access method: [Connect using Identity-Aware Proxy for TCP forwarding](https://cloud.google.com/compute/docs/instances/connecting-advanced#cloud_iap). Hence the answer to the first question is **"no difference"** because all of that describes how the IAP TCP forwarding works and those are the steps to set it up and use: **1.** Create a firewall rule that: * applies to all VM instances that you want to be accessible by using IAP; * allows ingress traffic from the IP range `35.235.240.0/20` (this range contains all IP addresses that IAP uses for TCP forwarding); * allows connections to all ports that you want to be accessible by using IAP TCP forwarding, for example, port `22` for SSH. **2.** Grant permissions to use IAP: * Use GCP Console or gcloud to add a role `IAP-Secured Tunnel User` (`roles/iap.tunnelResourceAccessor`) to users. Note: Users with `Owner` access to a project **always have permission** to use IAP for TCP forwarding. **3.** Connect to the target VM with one of the following tools: * GCP Console: use the `SSH` button in the Cloud Console; * `gcloud compute ssh INSTANCE_NAME` There's an important explanation of how IAP TCP forwarding is invoked for accessing a VM instance without Public IP. See [Identity-Aware Proxy > Doc > Using IAP for TCP forwarding](https://cloud.google.com/iap/docs/using-tcp-forwarding): NOTE. If the instance doesn't have a Public IP address, the connection **automatically uses IAP TCP tunneling**. If the instance does have a public IP address, the connection uses the public IP address instead of IAP TCP tunneling. You can use the `--tunnel-through-iap` flag so that `gcloud compute ssh` always uses IAP TCP tunneling. As already noted by [guillaume blaquiere](https://stackoverflow.com/users/11372593/guillaume-blaquiere), `roles/iap.tunnelResourceAccessor` and `IAP-secured Tunnel User` are not the different IAM roles, but the **Role Name** and the **Role Title** of the same Role. There is one more resource that represents this in a convenient form: [Cloud IAM > Doc > Understanding roles > Predefined roles > Cloud IAP roles](https://cloud.google.com/iam/docs/understanding-roles#cloud-iap-roles)
26,798,762
I used Laravel whereNotIn for exclude some project ids, for do that first i create exclude project id array like this $doNotDisplayThisProjectsIds = array(4, 6, 20); and exclude this projects using this query: ``` Project::whereNotIn('prject_id', $doNotDisplayThisProjectsIds)->get(); ``` Now I want to change project status too. Enable - 1, Disable - 0, so i want to filter status - 1 result set, how to do that? please help me
2014/11/07
[ "https://Stackoverflow.com/questions/26798762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3099298/" ]
Your question is really complex because `console.log` needs a css string argument for every `%c` in your message. But since you do that dynamically, you cannot hard code your arguments for `console.log`, what leads to the problem, that you need to call `console.log` with an array of arguments. For this problem the `.apply` method can be used: ``` console.log.apply(console, args); ``` But to use this, you need to set up an array for the arguments: ``` var args = [msg]; ``` and fill it with the needed amount of css styles, which is a little complicated, because you need to find all the appearances of `%c` in your message and toggle between two (or more if you want) css styles: ``` var helpString = msg; var toggleNextString = false; while (helpString.indexOf("%c") != -1) { if (!toggleNextString) args.push(cssStrNew); else args.push(cssStrStandard); toggleNextString = !toggleNextString; helpString = helpString.substr(helpString.indexOf("%c") + 2); } ``` Note: I used two strings for the standard log css and for the color red. Putting all of this together, the function looks like this: ``` function redLog(msg, regExp) { var cssStrNew = 'color: red;'; var cssStrStandard = 'color: black'; if (msg && regExp) { msg = msg.replace(regExp, '%c$&%c'); var args = [msg]; var helpString = msg; var toggleNextString = false; while (helpString.indexOf("%c") != -1) { if (!toggleNextString) args.push(cssStrNew); else args.push(cssStrStandard); toggleNextString = !toggleNextString; helpString = helpString.substr(helpString.indexOf("%c") + 2); } console.log.apply(console, args); } else { msg = "%c" + msg console.log(msg, cssStrNew); } } ``` Here is working [fiddle](http://jsfiddle.net/vjw7ke0o/2/) IMPORTANT: `%c` doesn't work within all browsers (for Firefox you can use Firebug) (afaik)
Well try this, although you need still work on the regExp. This is just a tip ( how to display your message with a color ) , your question is more complex and bit messy. You trying to add several parameters into your function, you should try use 1 parameter color and make an array of it. Inside the function you would organize it properly for your needs. Edit2. Outcome is Page**1**, Page%c2 , where (%c2 doesn't want to get bold here) **bold** stands for blue. As I know there is no closing bracket for %c, so you need to explode parameter 1 by a comma (,) -> assign to table and lunch console.log foreach element in array. ``` if (msg && regExp) { msg = msg.replace(regExp, '%c$&'); // '$&' inserts the matched substring. console.log(""+msg+"", cssStr); } ``` --- ``` function redLog(msg, regExp) { var cssStr = 'color: blue; font-size: x-large'; if (msg && regExp) { msg = msg.replace(regExp, '%c$&%c'); // '$&' inserts the matched substring. console.log("%c"+msg+"", cssStr); } else { console.log(msg); } } redLog('Page1, Page2', /\d/g); ```
26,798,762
I used Laravel whereNotIn for exclude some project ids, for do that first i create exclude project id array like this $doNotDisplayThisProjectsIds = array(4, 6, 20); and exclude this projects using this query: ``` Project::whereNotIn('prject_id', $doNotDisplayThisProjectsIds)->get(); ``` Now I want to change project status too. Enable - 1, Disable - 0, so i want to filter status - 1 result set, how to do that? please help me
2014/11/07
[ "https://Stackoverflow.com/questions/26798762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3099298/" ]
Your question is really complex because `console.log` needs a css string argument for every `%c` in your message. But since you do that dynamically, you cannot hard code your arguments for `console.log`, what leads to the problem, that you need to call `console.log` with an array of arguments. For this problem the `.apply` method can be used: ``` console.log.apply(console, args); ``` But to use this, you need to set up an array for the arguments: ``` var args = [msg]; ``` and fill it with the needed amount of css styles, which is a little complicated, because you need to find all the appearances of `%c` in your message and toggle between two (or more if you want) css styles: ``` var helpString = msg; var toggleNextString = false; while (helpString.indexOf("%c") != -1) { if (!toggleNextString) args.push(cssStrNew); else args.push(cssStrStandard); toggleNextString = !toggleNextString; helpString = helpString.substr(helpString.indexOf("%c") + 2); } ``` Note: I used two strings for the standard log css and for the color red. Putting all of this together, the function looks like this: ``` function redLog(msg, regExp) { var cssStrNew = 'color: red;'; var cssStrStandard = 'color: black'; if (msg && regExp) { msg = msg.replace(regExp, '%c$&%c'); var args = [msg]; var helpString = msg; var toggleNextString = false; while (helpString.indexOf("%c") != -1) { if (!toggleNextString) args.push(cssStrNew); else args.push(cssStrStandard); toggleNextString = !toggleNextString; helpString = helpString.substr(helpString.indexOf("%c") + 2); } console.log.apply(console, args); } else { msg = "%c" + msg console.log(msg, cssStrNew); } } ``` Here is working [fiddle](http://jsfiddle.net/vjw7ke0o/2/) IMPORTANT: `%c` doesn't work within all browsers (for Firefox you can use Firebug) (afaik)
For every `%c` there needs to be a style. In your case, if you only want the numbers to be highlighted then you could make your function generic by passing the highlight and normal colors as parameters as well: ``` function colorLog(string, regexp, style, normalStyle) { var msg = string.replace(regexp, function (s) { return "%c" + s + "%c" }); var css = [msg]; var occurances = string.match(regexp).length; while (css.length < occurances * 2) css = css.concat([style, normalStyle]); console.log.apply(console, css); } ``` And then you call it like this: ``` colorLog('Page-1, 23rd-Page, Page-3', /\d+/g, 'color:blue', 'color:black'); ``` The idea is to create an array out of strings and flatten it out using `apply`. You could further simplify your call by passing only the color names and create the style string inside the function. You can do a multi-line with different colors by making just a minimal changes. ***Demo: <http://jsfiddle.net/abhitalks/ydLmtm3a/4/>*** .
26,798,762
I used Laravel whereNotIn for exclude some project ids, for do that first i create exclude project id array like this $doNotDisplayThisProjectsIds = array(4, 6, 20); and exclude this projects using this query: ``` Project::whereNotIn('prject_id', $doNotDisplayThisProjectsIds)->get(); ``` Now I want to change project status too. Enable - 1, Disable - 0, so i want to filter status - 1 result set, how to do that? please help me
2014/11/07
[ "https://Stackoverflow.com/questions/26798762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3099298/" ]
Your question is really complex because `console.log` needs a css string argument for every `%c` in your message. But since you do that dynamically, you cannot hard code your arguments for `console.log`, what leads to the problem, that you need to call `console.log` with an array of arguments. For this problem the `.apply` method can be used: ``` console.log.apply(console, args); ``` But to use this, you need to set up an array for the arguments: ``` var args = [msg]; ``` and fill it with the needed amount of css styles, which is a little complicated, because you need to find all the appearances of `%c` in your message and toggle between two (or more if you want) css styles: ``` var helpString = msg; var toggleNextString = false; while (helpString.indexOf("%c") != -1) { if (!toggleNextString) args.push(cssStrNew); else args.push(cssStrStandard); toggleNextString = !toggleNextString; helpString = helpString.substr(helpString.indexOf("%c") + 2); } ``` Note: I used two strings for the standard log css and for the color red. Putting all of this together, the function looks like this: ``` function redLog(msg, regExp) { var cssStrNew = 'color: red;'; var cssStrStandard = 'color: black'; if (msg && regExp) { msg = msg.replace(regExp, '%c$&%c'); var args = [msg]; var helpString = msg; var toggleNextString = false; while (helpString.indexOf("%c") != -1) { if (!toggleNextString) args.push(cssStrNew); else args.push(cssStrStandard); toggleNextString = !toggleNextString; helpString = helpString.substr(helpString.indexOf("%c") + 2); } console.log.apply(console, args); } else { msg = "%c" + msg console.log(msg, cssStrNew); } } ``` Here is working [fiddle](http://jsfiddle.net/vjw7ke0o/2/) IMPORTANT: `%c` doesn't work within all browsers (for Firefox you can use Firebug) (afaik)
Thanks very much, @Markai and @abhitalks, "console.log.apply(console, args)" is indeed the key to my problem. Below is my solution inspired by Markai. ```js function colorLog(str, regExp, style, normalStyle) { if (str && regExp) { var css = [], i = 1, // css[0] is reserved for msg msg = str.replace(regExp, function (m) { css[i++] = style; css[i++] = normalStyle; return '%c' + m + '%c'; }); css[0] = msg; console.log.apply(console, css); } else { console.log(str); } } function redLog(str, regExp) { colorLog(str, regExp, 'color:red', 'color:black'); } redLog('Page-1, 23rd-Page, Page-3', /\d+/g); ```
26,798,762
I used Laravel whereNotIn for exclude some project ids, for do that first i create exclude project id array like this $doNotDisplayThisProjectsIds = array(4, 6, 20); and exclude this projects using this query: ``` Project::whereNotIn('prject_id', $doNotDisplayThisProjectsIds)->get(); ``` Now I want to change project status too. Enable - 1, Disable - 0, so i want to filter status - 1 result set, how to do that? please help me
2014/11/07
[ "https://Stackoverflow.com/questions/26798762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3099298/" ]
Your question is really complex because `console.log` needs a css string argument for every `%c` in your message. But since you do that dynamically, you cannot hard code your arguments for `console.log`, what leads to the problem, that you need to call `console.log` with an array of arguments. For this problem the `.apply` method can be used: ``` console.log.apply(console, args); ``` But to use this, you need to set up an array for the arguments: ``` var args = [msg]; ``` and fill it with the needed amount of css styles, which is a little complicated, because you need to find all the appearances of `%c` in your message and toggle between two (or more if you want) css styles: ``` var helpString = msg; var toggleNextString = false; while (helpString.indexOf("%c") != -1) { if (!toggleNextString) args.push(cssStrNew); else args.push(cssStrStandard); toggleNextString = !toggleNextString; helpString = helpString.substr(helpString.indexOf("%c") + 2); } ``` Note: I used two strings for the standard log css and for the color red. Putting all of this together, the function looks like this: ``` function redLog(msg, regExp) { var cssStrNew = 'color: red;'; var cssStrStandard = 'color: black'; if (msg && regExp) { msg = msg.replace(regExp, '%c$&%c'); var args = [msg]; var helpString = msg; var toggleNextString = false; while (helpString.indexOf("%c") != -1) { if (!toggleNextString) args.push(cssStrNew); else args.push(cssStrStandard); toggleNextString = !toggleNextString; helpString = helpString.substr(helpString.indexOf("%c") + 2); } console.log.apply(console, args); } else { msg = "%c" + msg console.log(msg, cssStrNew); } } ``` Here is working [fiddle](http://jsfiddle.net/vjw7ke0o/2/) IMPORTANT: `%c` doesn't work within all browsers (for Firefox you can use Firebug) (afaik)
Сan even shorter: ``` string='';//random string for painting //color classifier - 6 types of non-breaking space: for(let i=120;i--;) string+=`${'\u180E\u200B\u200C\u200D\u2060\uFEFF'[6*Math.random()^0]}${'+-0'[3*Math.random()^0]}`; css = [string];//preparing an array for spread //we are returning the replaced string in css[0], using as the second argument .replace() a arrow function (which writes to a global variables): css[0] = css[0].replace(/(\u180E[\+\-0])|(\u200B[\+\-0])|(\u200C[\+\-0])|(\u200D[\+\-0])|(\u2060[\+\-0])|(\uFEFF[\+\-0])/g, (match, $1, $2, $3, $4, $5, $6) => { if ($1) {css.push('color: blue;')} if ($2) {css.push('color: red;')} if ($3) {css.push('color: green;')} if ($4) {css.push('color: yellow;')} if ($5) {css.push('color: magenta;')} if ($6) {css.push('color: cyan;')} return`%c${match}`});//so that neighboring '%c' do not overlap console.log(...css); ``` Here we do not use flags and explicit loops. We use only one function. You can write instructions of multiple choice for global variable css[] (like a 'switch...case') on one line: ``` css.push(`color: ${'blue red green yellow magenta cyan'.split(' ')[Math.log2(+('0b'+[$6, $5, $4, $3, $2, $1].map(e=>+!!e).join('')))]};`); ``` – in the first step array of regex capturing groups transformed at bit field, further we find log2(*field*), which is the position in the array of colors at RPN. So length of the function is 5 lines, not counting the first 2 lines containing 'random()' for test (which you can also write on one line using recursion: ``` css = [(s=>(f = (i, recursion =_=>(s+=`${'\u180E\u200B\u200C\u200D\u2060\uFEFF'[6*Math.random()^0]}${'+-0'[3*Math.random()^0]}`, f(--i)))=>!i? s :recursion())(120))('')]; ``` ). Thus, we can use in theory max up to 6! = 720 colors, i.e. you need `&h100`3/6! = 23302 groups for a standard palette with a depth of 24 bits. **Open a console** by browser on this page and run: ```js (a => (a.type = 'text/javascript', a.id = 'demo_console', a.innerHTML = `const css = [(s=>(f = (i, recursion =_=>(s+=\`$\{'\u180E\u200B\u200C\u200D\u2060\uFEFF'[6*Math.random()^0]}$\{'+-0'[3*Math.random()^0]}\`, f(--i)))=>!i? s :recursion())(120))('')]; css[0] = css[0].replace(/(\u180E[\+\-0])|(\u200B[\+\-0])|(\u200C[\+\-0])|(\u200D[\+\-0])|(\u2060[\+\-0])|(\uFEFF[\+\-0])/g, (match, $1, $2, $3, $4, $5, $6)=>\{ css.push(\`color: $\{'blue red green yellow magenta cyan'.split(' ')[Math.log2(+('0b'+[$6, $5, $4, $3, $2, $1].map(e=>+!!e).join('')))]};\`); return\`%c$\{match}\`}); console.log(...css);` ))(document.getElementsByTagName('head')[0].appendChild(document.createElement('script'))) ```
9,442,879
Query `Select 9/5` 'Showing output as `1` I want to get the exact ouput for 9/5 Expected Ouput ``` 1.8 instead of 1 ``` How to make a query
2012/02/25
[ "https://Stackoverflow.com/questions/9442879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1157846/" ]
The problem is it is doing integer math. You can explicitly treat them as decimal numbers by adding `.0`: ``` SELECT 9.0 / 5.0 ``` You can also use CONVERT or CAST to be even more explicit: ``` SELECT CONVERT(DECIMAL(9,4), 9) / CONVERT(DECIMAL(9,4), 5) ``` Note: If either of the operands are decimal numbers, the result will be a decimal number, so you technically only have to convert one of them. So any of these will also work: ``` SELECT 9 / 5.0 SELECT 9.0 / 5 SELECT CONVERT(DECIMAL(9,4), 9) / 5 SELECT 9 / CONVERT(DECIMAL(9,4), 5) ``` The reason it works this was is because the ANSI/ISO-SQL standard actually says that the results of mathematical operations must be the same data type as one of the operands. So if both of the operands are integers, the result according to the ANSI/ISO-SQL standard must also be an integer. MySQL violates the standard here (presumably in the interest of practicality), but MS SQL complies with it.
I don't have access to sql-server, and mysql seems to give the correct answer. However, I'd try forcing one or both of the arguments to be floats (i.e SELECT 9.0 /5.0)
244,496
Using cesium it is possible to pan the 2D map having Asia as the center? Example as shown in the image. [![enter image description here](https://i.stack.imgur.com/3sLUS.png)](https://i.stack.imgur.com/3sLUS.png)
2017/06/19
[ "https://gis.stackexchange.com/questions/244496", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/99353/" ]
solved the problem by using cesium 1.34 And the following codes ``` var target = new Cesium.Cartesian3.fromDegrees(103.85195, 1.290270, 35000000); viewer.camera.setView( { destination : target, orientation: { heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north) pitch : Cesium.Math.toRadians(-90), // default value (looking down) roll : 0.0 // default value }}); ```
Give this a try: ``` Cesium.Camera.DEFAULT_VIEW_RECTANGLE = Cesium.Rectangle.fromDegrees(0, -89, 170, 89); Cesium.Camera.DEFAULT_VIEW_FACTOR = 1.1; var viewer = new Cesium.Viewer('cesiumContainer'); viewer.scene.morphTo2D(0); ``` Note the `fromDegrees` parameters are: West, South, East, North. Also note this sets up the default (home) view this way. If you wanted to pan the camera here at runtime, there are other ways to do this, see the [Camera Demo](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Camera.html&label=Showcases).
221,378
Here is my bash script that I just wrote to count line of code for JavaScript project. It will list number of: * Comment lines * Blank lines * All lines Here is my script: ``` #!/bin/bash fileExt="*.js" allFiles=$(find ./ -name "$fileExt") commentLines=$((perl -ne 'print "$1\n" while /(^\s+\/\/\s*\w+)/sg' $allFiles;\ perl -0777 -ne 'print "$1\n" while /(\*\*.*?\*\/)/sg' $allFiles) | wc -l) blankLines=$(grep '^[[:space:]]*//' -r --include $fileExt | wc -l) allLines=$(echo $allFiles | xargs wc -l | tail -n 1 | cut -d " " -f 2) echo -e "\nTotal comments line is: $commentLines.\n\ Total blank lines is: $blankLines.\n\ \nTotal all lines is: $allLines." ``` Let me explain it a little bit: ### First, we need to list all files that end with ".js" within the project: ``` allFiles=$(find ./ -name "$fileExt") ``` ### Second, we count all comment lines: ``` commentLines=$((perl -ne 'print "$1\n" while /(^\s+\/\/\s*\w+)/sg' $allFiles;\ perl -0777 -ne 'print "$1\n" while /(\*\*.*?\*\/)/sg' $allFiles) | wc -l) ``` There are 2 types of comment lines in JavaScript: 1. Line start with only space and `//` or only `//` Example: ``` //this is a comment line ``` // this is a comment line // this also is a comment line All above are comment lines, and we got 3 lines total here. But the following is not comment lines: ``` function foo(params 1) { // return void } ``` The line contains `// return void` is not considered as a comment, so we do not need to count it. And for the kind of comment line. I using the regex with `perl` to print all comment lines that match with regex: ``` /(^\s+\/\/\s*\w+)/sg ``` 2. Multi-line comment ([JSDOC](https://en.wikipedia.org/wiki/JSDoc)): Example: ``` /** * return something * @param {object} obj * return void */ ``` So we need to count all number of lines that start from the line with `/**` and end with `*/`, we have 5 lines here. I use this regex to match: ``` perl -0777 -ne 'print "$1\n" while /(\*\*.*?\*\/)/sg' $allFiles ``` So the total number of comment lines is the sum of two types comment lines above. ### Third We need to count blank lines. I use the following command to match: ``` grep '^[[:space:]]*//' -r --include $fileExt | wc -l ``` ### Finally We need to count all lines: ``` echo $allFiles | xargs wc -l | tail -n 1 | cut -d " " -f 2 ``` I wonder if my solution is good enough or not.
2019/05/31
[ "https://codereview.stackexchange.com/questions/221378", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/188476/" ]
> > > ```bsh > fileExt="*.js" > allFiles=$(find ./ -name $fileExt) > > ``` > > This is a bug. The wildcard in `$fileExt` will be expanded by the shell, and cause a syntax error when the current directory has more than one matching file in it: ``` $ touch a.js b.js $ fileExt="*.js" $ find ./ -name $fileExt find: paths must precede expression: `b.js' find: possible unquoted pattern after predicate `-name'? ``` You need to quote the variable. Better yet, use the `globstar` option to populate an array and eliminate `find` altogether: ```bsh fileExt="js" shopt -s globstar declare -a allFiles=( **/*.$fileExt ) grep … "${allFiles[@]}" # to use the array ``` This regex does not match blank lines: > > > ```bsh > grep '^[[:space:]]*//' > > ``` > > Just `/*` is enough to start a multi-line comment in JavaScript (not `/**`). The script reads every file four times. That is slow. Since you're using Perl already, just let it count everything. Then you don't need to capture the file names at all, since they are used only once: ```bsh #!/bin/bash shopt -s globstar exec perl -nle ' BEGIN { @ARGV=grep -f, @ARGV or die "no matching files\n"; $comment = $blank = 0; } if ( m{ ^\s*/\* }x .. m{ \*/ }x or m{ ^\s*// }x ) { $comment++ } elsif ( m{ ^\s*$ }x ) { $blank++ } END { print "$comment comment lines; $blank blank lines; $. total lines" } ' **/*.js ``` At this point we're barely using bash anymore, and the globbing can be moved inside the Perl script, using the File::Find module: ```perl #!/usr/bin/perl -wnl BEGIN { use strict; use File::Find; my $ext="js"; my @dirs=( @ARGV ? @ARGV : '.' ); @ARGV=(); find(sub { -f and /\.$ext$/o and push @ARGV, $File::Find::name }, @dirs ); our ($comment, $blank) = (0, 0); } if ( m{ ^\s*/\* }x .. m{ \*/ }x or m{ ^\s*// }x ) { $comment++ } elsif ( m{ ^\s*$ }x ) { $blank++ } END { print "$comment comment lines; $blank blank lines; $. total lines"; } ```
General ======= Run `shellcheck` on this script - almost all variable expansions are unquoted, but need to be quoted. That will also highlight the non-portable `echo -e` (prefer `printf` instead) and a dodgy use of `$((` where `$( (` would be safer. I recommend setting `-u` and `-e` shell options to help you catch more errors. Flexibility =========== Instead of requiring users to change to the top directory of the project, we could allow them to specify one or more directories as command-line arguments, and use current directory as a fallback if no arguments are provided: ``` dirs=("${@:-.}") ``` Finding files ============= `allFiles` will include directories and other non-regular files, if they happen to end in `.js`. We need to add a file type predicate: ``` allFiles=$(find "${dirs[@]}" -name "$fileExt" -type f) ``` Since we're using Bash, it makes sense to take advantage of array variables - though we'll still have problems for filenames containing whitespace. To fix that, we need to read answers to [*How can I store the “find” command results as an array in Bash?*](//stackoverflow.com/q/23356779): ``` allFiles=() while IFS= read -r -d ''; do allFiles+=("$REPLY") done < <(find ./ -name "$fileExt" -type f -print0) ``` It may almost be simpler to set `globstar` shell option and then remove non-regular files from the glob result. Counting comment lines ====================== I didn't follow your Perl code, but I have an alternative approach using `sed`: * convert all lines from initial `/**` to final `*/` to begin with `//` instead, * then keep only the lines beginning with optional whitespace then `//`: ``` sed -e '\!^[[:blank:]]*/\*\*!,\!\*/!s/.*/\\\\/' \ -e '\|^[[:blank:]]*//|!d' ``` (Actually, that's a lot less pretty than I'd hoped!) Blank lines =========== Here, we've used the regular expression that matches comment lines. We want `'^[[:blank:]]*$'` instead, to match lines that contain *only* (optional) whitespace. All lines ========= Again, over-complicated: just `cat` the files together and then use `wc -l`. Printing ======== I find it easier to visualise output formatting if we simply use a here-document: ``` cat <<EOF Total comments lines is: $commentLines. Total blank lines is: $blankLines. Total all lines is: $allLines. EOF exit ``` --- Modified code ============= ``` #!/bin/bash set -eu fileExt='*.js' dirs=("${@:-/usr/lib/nodejs/lodash}") allFiles=() while IFS= read -r -d ''; do allFiles+=("$REPLY") done < <(find "${dirs[@]}" -name "$fileExt" -type f -print0) commentLines=$(sed -e '\!^[[:blank:]]*/\*\*!,\!\*/!s/.*/\\\\/' \ -e '\|^[[:blank:]]*//|!d' \ "${allFiles[@]}" | wc -l) blankLines=$(cat "${allFiles[@]}" | grep -c '^[[:blank:]]*$') allLines=$(cat "${allFiles[@]}" | wc -l) cat <<EOF Total comment lines is: $commentLines. Total blank lines is: $blankLines. Total all lines is: $allLines. EOF ``` Although this makes three passes over the input files, that might be an acceptable trade-off against the complexity of a single-pass approach here (and is already the approach taken in the original code). --- Single-pass version using `awk` =============================== A single-pass version doesn't require us to use an array to store the filenames; we can simply stream the file contents into a suitable counting function. We could implement that counting function in shell, but it's probably easier to write a short `awk` program. Note that with no arrays, we can make this a POSIX shell program: ``` #!/bin/sh set -eu fileExt='*.js' find "${@:-.}" -name "$fileExt" -type f -print0 | xargs -0 cat | awk 'BEGIN { all = 0; blank = 0; comment = 0; incomment = 0; } { ++all if ($0 ~ "/\\*") { incomment = 1 } if (incomment) { ++comment; if ($0 ~ "\\*/") incomment = 0; } else { blank += ($0 ~ "^[[:blank:]]*$"); comment += ($0 ~ "^[[:blank:]]*//") } } END { print "Total comment lines is:", comment print "Total blank lines is:", blank print "Total all lines is:", all }' ```
1,586,477
The common multiplication rules are $$(-1) \cdot (-1) = +1 \\ (+1) \cdot (+1) = +1$$ But these rules seem asymmetric. Because of these rules it is not possible e.g. to solve the equation $$x^2 = -1 $$ without introducing complex numbers. There would be two "more symmetric" alternatives: $$(-1) \cdot (-1) = -1 \\ (+1) \cdot (+1) = +1$$ or $$(-1) \cdot (-1) = +1 \\ (+1) \cdot (+1) = -1$$ Both alternatives would allow to solve the equations $$x^2 = +1 \\ x^2 = -1 $$ without the need to introduce complex numbers. However the two more symmetric alternatives are not used. What is the reason for that? Would math break down, if one would adopt one of these different conventions?
2015/12/23
[ "https://math.stackexchange.com/questions/1586477", "https://math.stackexchange.com", "https://math.stackexchange.com/users/27609/" ]
A lot of math would break down if you use that, yes. For example, with our multiplication, we have the property that for any three numbers $a,b,c$, we have $$a(b+c) = ab + bc$$ This would not hold anymore in your case, since $$0 = -1\cdot 0 = -1\cdot (1 + (-1)) \neq 1\cdot (-1) + (-1)\cdot (-1) = -1 -1 =-2$$ This is assuming that the new multiplication is still commutative and that $1$ is still the "*unit*" of multiplication, i.e. that $1\cdot x = x$ for all $x$. --- In fact, all you need to prove that $(-1)\cdot (-1) = 1$ is the rule $a(b+c) = ab+bc$, and the property that $1\cdot x = x$, since you can see that if this rule is true, then $$0 = (-1)\cdot 0 = (-1)\cdot (1+(-1)) = (-1)\cdot 1 + (-1)\cdot(-1) $$ which means that $0=(-1)\cdot (-1) + (-1)\cdot 1$ or in other words that $(-1)\cdot (-1) = 1$.
**Here is a very "naive" way of answering this question.** --- When trying to define the following: 1. Positive $\times$ Positive $=$? 2. Positive $\times$ Negative $=$? 3. Negative $\times$ Positive $=$? 4. Negative $\times$ Negative $=$? We first need to ensure that the answers to #2 and #3 are identical. This is because multiplication is **commutative** ($\forall a,b:a\times b=b\times a$). --- Let's arbitrarily define: * Positive $\times$ Negative $=$ Negative * Negative $\times$ Positive $=$ Negative As you can see: * In the output, the sign of the positive input has been inverted * In the output, the sign of the negative input has been preserved Following this "behavior", the answers to #1# and #4 are clear: * Positive $\times$ Positive $=$ Positive * Negative $\times$ Negative $=$ Positive --- Of course, we could always arbitrarily define: * Positive $\times$ Negative $=$ Positive * Negative $\times$ Positive $=$ Positive And subsequently: * Positive $\times$ Positive $=$ Negative * Negative $\times$ Negative $=$ Negative But that would only make a semantic swap between "positive" and "negative".
1,586,477
The common multiplication rules are $$(-1) \cdot (-1) = +1 \\ (+1) \cdot (+1) = +1$$ But these rules seem asymmetric. Because of these rules it is not possible e.g. to solve the equation $$x^2 = -1 $$ without introducing complex numbers. There would be two "more symmetric" alternatives: $$(-1) \cdot (-1) = -1 \\ (+1) \cdot (+1) = +1$$ or $$(-1) \cdot (-1) = +1 \\ (+1) \cdot (+1) = -1$$ Both alternatives would allow to solve the equations $$x^2 = +1 \\ x^2 = -1 $$ without the need to introduce complex numbers. However the two more symmetric alternatives are not used. What is the reason for that? Would math break down, if one would adopt one of these different conventions?
2015/12/23
[ "https://math.stackexchange.com/questions/1586477", "https://math.stackexchange.com", "https://math.stackexchange.com/users/27609/" ]
A lot of math would break down if you use that, yes. For example, with our multiplication, we have the property that for any three numbers $a,b,c$, we have $$a(b+c) = ab + bc$$ This would not hold anymore in your case, since $$0 = -1\cdot 0 = -1\cdot (1 + (-1)) \neq 1\cdot (-1) + (-1)\cdot (-1) = -1 -1 =-2$$ This is assuming that the new multiplication is still commutative and that $1$ is still the "*unit*" of multiplication, i.e. that $1\cdot x = x$ for all $x$. --- In fact, all you need to prove that $(-1)\cdot (-1) = 1$ is the rule $a(b+c) = ab+bc$, and the property that $1\cdot x = x$, since you can see that if this rule is true, then $$0 = (-1)\cdot 0 = (-1)\cdot (1+(-1)) = (-1)\cdot 1 + (-1)\cdot(-1) $$ which means that $0=(-1)\cdot (-1) + (-1)\cdot 1$ or in other words that $(-1)\cdot (-1) = 1$.
Math would certainly break down, here's why. Assume that every number is equal to itself, addition is associative, multiplication distributes over addition , $1$ and $-1$ are additive inverses, $1$ is the multiplicative identity, and $0$ is the additive identity. Then it follows that: $$\begin{array}{lll} \bigg(1\cdot 1 + 1\cdot (-1)\bigg) + (-1)\cdot(-1) &=& \bigg(1\cdot 1 + 1\cdot (-1)\bigg) + (-1)\cdot(-1)\\ \bigg(1\cdot 1 + 1\cdot (-1)\bigg) + (-1)\cdot(-1) &=& 1\cdot 1 + \bigg(1\cdot (-1) + (-1)\cdot(-1)\bigg)\\ 1\bigg(1+(-1)\bigg) + (-1)\cdot(-1) &=& 1\cdot 1 + (-1)\bigg(1 + (-1)\bigg)\\ 1\bigg(0\bigg) + (-1)\cdot(-1) &=& 1\cdot 1 + (-1)\bigg(0\bigg)\\ 0 + (-1)\cdot(-1) &=& 1\cdot 1 + 0\\ (-1)\cdot(-1) &=& 1\cdot 1 \\ \end{array}$$ The only loose end not assumed above is $(-1)\cdot 0 = 0$ $$(-1)\cdot 0 = (-1)(0+0)$$ $$(-1)\cdot 0 = (-1)\cdot 0+ (-1)\cdot 0$$ $$\dots$$
1,586,477
The common multiplication rules are $$(-1) \cdot (-1) = +1 \\ (+1) \cdot (+1) = +1$$ But these rules seem asymmetric. Because of these rules it is not possible e.g. to solve the equation $$x^2 = -1 $$ without introducing complex numbers. There would be two "more symmetric" alternatives: $$(-1) \cdot (-1) = -1 \\ (+1) \cdot (+1) = +1$$ or $$(-1) \cdot (-1) = +1 \\ (+1) \cdot (+1) = -1$$ Both alternatives would allow to solve the equations $$x^2 = +1 \\ x^2 = -1 $$ without the need to introduce complex numbers. However the two more symmetric alternatives are not used. What is the reason for that? Would math break down, if one would adopt one of these different conventions?
2015/12/23
[ "https://math.stackexchange.com/questions/1586477", "https://math.stackexchange.com", "https://math.stackexchange.com/users/27609/" ]
A lot of math would break down if you use that, yes. For example, with our multiplication, we have the property that for any three numbers $a,b,c$, we have $$a(b+c) = ab + bc$$ This would not hold anymore in your case, since $$0 = -1\cdot 0 = -1\cdot (1 + (-1)) \neq 1\cdot (-1) + (-1)\cdot (-1) = -1 -1 =-2$$ This is assuming that the new multiplication is still commutative and that $1$ is still the "*unit*" of multiplication, i.e. that $1\cdot x = x$ for all $x$. --- In fact, all you need to prove that $(-1)\cdot (-1) = 1$ is the rule $a(b+c) = ab+bc$, and the property that $1\cdot x = x$, since you can see that if this rule is true, then $$0 = (-1)\cdot 0 = (-1)\cdot (1+(-1)) = (-1)\cdot 1 + (-1)\cdot(-1) $$ which means that $0=(-1)\cdot (-1) + (-1)\cdot 1$ or in other words that $(-1)\cdot (-1) = 1$.
The rules $(-1)\cdot(-1)=1$ and $1 \cdot 1 = 1$ aren't *conventions*. They are *consequences* of how we define our number system: specifically, of what multiplication is, and what the symbol $-1$ means. You can, if you like, define brand new operations, with different symbols, obeying different rules, and study the properties of such systems. That is in fact what group theory is all about.
1,586,477
The common multiplication rules are $$(-1) \cdot (-1) = +1 \\ (+1) \cdot (+1) = +1$$ But these rules seem asymmetric. Because of these rules it is not possible e.g. to solve the equation $$x^2 = -1 $$ without introducing complex numbers. There would be two "more symmetric" alternatives: $$(-1) \cdot (-1) = -1 \\ (+1) \cdot (+1) = +1$$ or $$(-1) \cdot (-1) = +1 \\ (+1) \cdot (+1) = -1$$ Both alternatives would allow to solve the equations $$x^2 = +1 \\ x^2 = -1 $$ without the need to introduce complex numbers. However the two more symmetric alternatives are not used. What is the reason for that? Would math break down, if one would adopt one of these different conventions?
2015/12/23
[ "https://math.stackexchange.com/questions/1586477", "https://math.stackexchange.com", "https://math.stackexchange.com/users/27609/" ]
In some branches we do have that $1\cdot 1=-1$. However, the role of $1$ is *by definition* that of a neutral element of multiplication (like $0$ is neutral for addition), i.e., $1\cdot x=x\cdot 1=x$ holds (or is postulated to hold) for all $x$. So specifically $1\cdot 1=1$. This does not immediately contradict your idea of $1\cdot 1=-1$, it just implies $1=-1$ or in other words $2=0$. This equation does hold in the field $\Bbb F\_2$ of two elements or more generally in fields of what is called characteristic $2$, which are widely applied for example in computer science and coding theory and other areas. Apart from this way of sneaking away from the original question, it may be that your main problem comes from the introductory words "The common multiplication rules are..." In fact, what you cite then are *not* the common *basic* rules (or axioms) of multiplication, which are instead $$ a\cdot(b\cdot c)=(a\cdot b)\cdot c,\qquad (a+b)\cdot c=(a\cdot c)+(b\cdot c),\quad a\cdot(b+c)=(a\cdot b)+(a\cdot c).$$ We can *infer* the rest from these. Specifically, the properties of *addition* force us to accept that $0\cdot a=a\cdot 0=0$ for all $a$: From $0+0=0$ and distributivity we see that $0\cdot a=(0+0)\cdot a=0\cdot a+0\cdot a$, hence $0\cdot a=0$ and similarly for the other order. As a consequence of this, we have $a\cdot b+a\cdot c=0$ whenever $b+c=0$, i.e. $a\cdot(-b)=-(a\cdot b)$ (and similarly $(-a)\cdot b=-(a\cdot b)$). So at any rate $(-a)\cdot(-a)+a\cdot(-a)=0$ and $a\cdot a+a\cdot (-a)=0$ and consequently $$(-a)\cdot(-a)=a\cdot a.$$
**Here is a very "naive" way of answering this question.** --- When trying to define the following: 1. Positive $\times$ Positive $=$? 2. Positive $\times$ Negative $=$? 3. Negative $\times$ Positive $=$? 4. Negative $\times$ Negative $=$? We first need to ensure that the answers to #2 and #3 are identical. This is because multiplication is **commutative** ($\forall a,b:a\times b=b\times a$). --- Let's arbitrarily define: * Positive $\times$ Negative $=$ Negative * Negative $\times$ Positive $=$ Negative As you can see: * In the output, the sign of the positive input has been inverted * In the output, the sign of the negative input has been preserved Following this "behavior", the answers to #1# and #4 are clear: * Positive $\times$ Positive $=$ Positive * Negative $\times$ Negative $=$ Positive --- Of course, we could always arbitrarily define: * Positive $\times$ Negative $=$ Positive * Negative $\times$ Positive $=$ Positive And subsequently: * Positive $\times$ Positive $=$ Negative * Negative $\times$ Negative $=$ Negative But that would only make a semantic swap between "positive" and "negative".
1,586,477
The common multiplication rules are $$(-1) \cdot (-1) = +1 \\ (+1) \cdot (+1) = +1$$ But these rules seem asymmetric. Because of these rules it is not possible e.g. to solve the equation $$x^2 = -1 $$ without introducing complex numbers. There would be two "more symmetric" alternatives: $$(-1) \cdot (-1) = -1 \\ (+1) \cdot (+1) = +1$$ or $$(-1) \cdot (-1) = +1 \\ (+1) \cdot (+1) = -1$$ Both alternatives would allow to solve the equations $$x^2 = +1 \\ x^2 = -1 $$ without the need to introduce complex numbers. However the two more symmetric alternatives are not used. What is the reason for that? Would math break down, if one would adopt one of these different conventions?
2015/12/23
[ "https://math.stackexchange.com/questions/1586477", "https://math.stackexchange.com", "https://math.stackexchange.com/users/27609/" ]
In some branches we do have that $1\cdot 1=-1$. However, the role of $1$ is *by definition* that of a neutral element of multiplication (like $0$ is neutral for addition), i.e., $1\cdot x=x\cdot 1=x$ holds (or is postulated to hold) for all $x$. So specifically $1\cdot 1=1$. This does not immediately contradict your idea of $1\cdot 1=-1$, it just implies $1=-1$ or in other words $2=0$. This equation does hold in the field $\Bbb F\_2$ of two elements or more generally in fields of what is called characteristic $2$, which are widely applied for example in computer science and coding theory and other areas. Apart from this way of sneaking away from the original question, it may be that your main problem comes from the introductory words "The common multiplication rules are..." In fact, what you cite then are *not* the common *basic* rules (or axioms) of multiplication, which are instead $$ a\cdot(b\cdot c)=(a\cdot b)\cdot c,\qquad (a+b)\cdot c=(a\cdot c)+(b\cdot c),\quad a\cdot(b+c)=(a\cdot b)+(a\cdot c).$$ We can *infer* the rest from these. Specifically, the properties of *addition* force us to accept that $0\cdot a=a\cdot 0=0$ for all $a$: From $0+0=0$ and distributivity we see that $0\cdot a=(0+0)\cdot a=0\cdot a+0\cdot a$, hence $0\cdot a=0$ and similarly for the other order. As a consequence of this, we have $a\cdot b+a\cdot c=0$ whenever $b+c=0$, i.e. $a\cdot(-b)=-(a\cdot b)$ (and similarly $(-a)\cdot b=-(a\cdot b)$). So at any rate $(-a)\cdot(-a)+a\cdot(-a)=0$ and $a\cdot a+a\cdot (-a)=0$ and consequently $$(-a)\cdot(-a)=a\cdot a.$$
Math would certainly break down, here's why. Assume that every number is equal to itself, addition is associative, multiplication distributes over addition , $1$ and $-1$ are additive inverses, $1$ is the multiplicative identity, and $0$ is the additive identity. Then it follows that: $$\begin{array}{lll} \bigg(1\cdot 1 + 1\cdot (-1)\bigg) + (-1)\cdot(-1) &=& \bigg(1\cdot 1 + 1\cdot (-1)\bigg) + (-1)\cdot(-1)\\ \bigg(1\cdot 1 + 1\cdot (-1)\bigg) + (-1)\cdot(-1) &=& 1\cdot 1 + \bigg(1\cdot (-1) + (-1)\cdot(-1)\bigg)\\ 1\bigg(1+(-1)\bigg) + (-1)\cdot(-1) &=& 1\cdot 1 + (-1)\bigg(1 + (-1)\bigg)\\ 1\bigg(0\bigg) + (-1)\cdot(-1) &=& 1\cdot 1 + (-1)\bigg(0\bigg)\\ 0 + (-1)\cdot(-1) &=& 1\cdot 1 + 0\\ (-1)\cdot(-1) &=& 1\cdot 1 \\ \end{array}$$ The only loose end not assumed above is $(-1)\cdot 0 = 0$ $$(-1)\cdot 0 = (-1)(0+0)$$ $$(-1)\cdot 0 = (-1)\cdot 0+ (-1)\cdot 0$$ $$\dots$$
1,586,477
The common multiplication rules are $$(-1) \cdot (-1) = +1 \\ (+1) \cdot (+1) = +1$$ But these rules seem asymmetric. Because of these rules it is not possible e.g. to solve the equation $$x^2 = -1 $$ without introducing complex numbers. There would be two "more symmetric" alternatives: $$(-1) \cdot (-1) = -1 \\ (+1) \cdot (+1) = +1$$ or $$(-1) \cdot (-1) = +1 \\ (+1) \cdot (+1) = -1$$ Both alternatives would allow to solve the equations $$x^2 = +1 \\ x^2 = -1 $$ without the need to introduce complex numbers. However the two more symmetric alternatives are not used. What is the reason for that? Would math break down, if one would adopt one of these different conventions?
2015/12/23
[ "https://math.stackexchange.com/questions/1586477", "https://math.stackexchange.com", "https://math.stackexchange.com/users/27609/" ]
In some branches we do have that $1\cdot 1=-1$. However, the role of $1$ is *by definition* that of a neutral element of multiplication (like $0$ is neutral for addition), i.e., $1\cdot x=x\cdot 1=x$ holds (or is postulated to hold) for all $x$. So specifically $1\cdot 1=1$. This does not immediately contradict your idea of $1\cdot 1=-1$, it just implies $1=-1$ or in other words $2=0$. This equation does hold in the field $\Bbb F\_2$ of two elements or more generally in fields of what is called characteristic $2$, which are widely applied for example in computer science and coding theory and other areas. Apart from this way of sneaking away from the original question, it may be that your main problem comes from the introductory words "The common multiplication rules are..." In fact, what you cite then are *not* the common *basic* rules (or axioms) of multiplication, which are instead $$ a\cdot(b\cdot c)=(a\cdot b)\cdot c,\qquad (a+b)\cdot c=(a\cdot c)+(b\cdot c),\quad a\cdot(b+c)=(a\cdot b)+(a\cdot c).$$ We can *infer* the rest from these. Specifically, the properties of *addition* force us to accept that $0\cdot a=a\cdot 0=0$ for all $a$: From $0+0=0$ and distributivity we see that $0\cdot a=(0+0)\cdot a=0\cdot a+0\cdot a$, hence $0\cdot a=0$ and similarly for the other order. As a consequence of this, we have $a\cdot b+a\cdot c=0$ whenever $b+c=0$, i.e. $a\cdot(-b)=-(a\cdot b)$ (and similarly $(-a)\cdot b=-(a\cdot b)$). So at any rate $(-a)\cdot(-a)+a\cdot(-a)=0$ and $a\cdot a+a\cdot (-a)=0$ and consequently $$(-a)\cdot(-a)=a\cdot a.$$
The rules $(-1)\cdot(-1)=1$ and $1 \cdot 1 = 1$ aren't *conventions*. They are *consequences* of how we define our number system: specifically, of what multiplication is, and what the symbol $-1$ means. You can, if you like, define brand new operations, with different symbols, obeying different rules, and study the properties of such systems. That is in fact what group theory is all about.
1,586,477
The common multiplication rules are $$(-1) \cdot (-1) = +1 \\ (+1) \cdot (+1) = +1$$ But these rules seem asymmetric. Because of these rules it is not possible e.g. to solve the equation $$x^2 = -1 $$ without introducing complex numbers. There would be two "more symmetric" alternatives: $$(-1) \cdot (-1) = -1 \\ (+1) \cdot (+1) = +1$$ or $$(-1) \cdot (-1) = +1 \\ (+1) \cdot (+1) = -1$$ Both alternatives would allow to solve the equations $$x^2 = +1 \\ x^2 = -1 $$ without the need to introduce complex numbers. However the two more symmetric alternatives are not used. What is the reason for that? Would math break down, if one would adopt one of these different conventions?
2015/12/23
[ "https://math.stackexchange.com/questions/1586477", "https://math.stackexchange.com", "https://math.stackexchange.com/users/27609/" ]
The rules $(-1)\cdot(-1)=1$ and $1 \cdot 1 = 1$ aren't *conventions*. They are *consequences* of how we define our number system: specifically, of what multiplication is, and what the symbol $-1$ means. You can, if you like, define brand new operations, with different symbols, obeying different rules, and study the properties of such systems. That is in fact what group theory is all about.
**Here is a very "naive" way of answering this question.** --- When trying to define the following: 1. Positive $\times$ Positive $=$? 2. Positive $\times$ Negative $=$? 3. Negative $\times$ Positive $=$? 4. Negative $\times$ Negative $=$? We first need to ensure that the answers to #2 and #3 are identical. This is because multiplication is **commutative** ($\forall a,b:a\times b=b\times a$). --- Let's arbitrarily define: * Positive $\times$ Negative $=$ Negative * Negative $\times$ Positive $=$ Negative As you can see: * In the output, the sign of the positive input has been inverted * In the output, the sign of the negative input has been preserved Following this "behavior", the answers to #1# and #4 are clear: * Positive $\times$ Positive $=$ Positive * Negative $\times$ Negative $=$ Positive --- Of course, we could always arbitrarily define: * Positive $\times$ Negative $=$ Positive * Negative $\times$ Positive $=$ Positive And subsequently: * Positive $\times$ Positive $=$ Negative * Negative $\times$ Negative $=$ Negative But that would only make a semantic swap between "positive" and "negative".
1,586,477
The common multiplication rules are $$(-1) \cdot (-1) = +1 \\ (+1) \cdot (+1) = +1$$ But these rules seem asymmetric. Because of these rules it is not possible e.g. to solve the equation $$x^2 = -1 $$ without introducing complex numbers. There would be two "more symmetric" alternatives: $$(-1) \cdot (-1) = -1 \\ (+1) \cdot (+1) = +1$$ or $$(-1) \cdot (-1) = +1 \\ (+1) \cdot (+1) = -1$$ Both alternatives would allow to solve the equations $$x^2 = +1 \\ x^2 = -1 $$ without the need to introduce complex numbers. However the two more symmetric alternatives are not used. What is the reason for that? Would math break down, if one would adopt one of these different conventions?
2015/12/23
[ "https://math.stackexchange.com/questions/1586477", "https://math.stackexchange.com", "https://math.stackexchange.com/users/27609/" ]
The rules $(-1)\cdot(-1)=1$ and $1 \cdot 1 = 1$ aren't *conventions*. They are *consequences* of how we define our number system: specifically, of what multiplication is, and what the symbol $-1$ means. You can, if you like, define brand new operations, with different symbols, obeying different rules, and study the properties of such systems. That is in fact what group theory is all about.
Math would certainly break down, here's why. Assume that every number is equal to itself, addition is associative, multiplication distributes over addition , $1$ and $-1$ are additive inverses, $1$ is the multiplicative identity, and $0$ is the additive identity. Then it follows that: $$\begin{array}{lll} \bigg(1\cdot 1 + 1\cdot (-1)\bigg) + (-1)\cdot(-1) &=& \bigg(1\cdot 1 + 1\cdot (-1)\bigg) + (-1)\cdot(-1)\\ \bigg(1\cdot 1 + 1\cdot (-1)\bigg) + (-1)\cdot(-1) &=& 1\cdot 1 + \bigg(1\cdot (-1) + (-1)\cdot(-1)\bigg)\\ 1\bigg(1+(-1)\bigg) + (-1)\cdot(-1) &=& 1\cdot 1 + (-1)\bigg(1 + (-1)\bigg)\\ 1\bigg(0\bigg) + (-1)\cdot(-1) &=& 1\cdot 1 + (-1)\bigg(0\bigg)\\ 0 + (-1)\cdot(-1) &=& 1\cdot 1 + 0\\ (-1)\cdot(-1) &=& 1\cdot 1 \\ \end{array}$$ The only loose end not assumed above is $(-1)\cdot 0 = 0$ $$(-1)\cdot 0 = (-1)(0+0)$$ $$(-1)\cdot 0 = (-1)\cdot 0+ (-1)\cdot 0$$ $$\dots$$
15,523,000
In terms of x compared to y. * Does x comply with sql standards better? [apologies if subjective] * Is x more efficient than y? * Or are these scripts completely different and to be used in different contexts? x ``` SELECT * FROM a INNER JOIN b ON COALESCE(b.columntojoin, b.alternatecolumn) = a.columntojoin ``` y ``` SELECT * FROM a INNER JOIN b ON (case when b.columntojoin is null then b.alternatecolumn else b.columntojoin end) = a.columntojoin ```
2013/03/20
[ "https://Stackoverflow.com/questions/15523000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1179880/" ]
`COALESCE` is essentially a shorthanded `CASE` statement. Both are **exactly** the same. There is also `ISNULL` in SQL Server (differs in other DBMSs), but that's actually a non-standard feature and is actually more limited that `COALESCE`.
In this case I would use `COALESCE` ( which provides more levels than `ISNULL`) rather than the `CASE` stement. The `CASE` statement seems a bit bulky here, seeing as you are only checking for `NULL`s anyway.
16,834,923
I try to invoke URL API at the best GPS location. User clicks the button that fires **findMe** method to set up *desiredAccuracy* and *distanceFilter* and run **`[self.locationManager startUpdatingLocation]`**. I check the best vertical and horizontal accuracy and if they don't change in the next iteration I run API and **`[self.locationManager stopUpdatingLocation]`** The point is that after that the best accuracy is changed and **`-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation`** is run a few times even if I stop updating location. ``` -(void)findMe { self.locationManager.desiredAccuracy = kCLLocationAccuracyBest; self.locationManager.distanceFilter = kCLDistanceFilterNone; [self.locationManager startUpdatingLocation]; } -(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { double longitude = newLocation.coordinate.longitude; double latitude = newLocation.coordinate.latitude; if ( ((_bestVertivalAccuracy == 0) || (_bestVertivalAccuracy > newLocation.verticalAccuracy)) || ((_bestHorizontalAccuracy == 0) || (_bestHorizontalAccuracy > newLocation.horizontalAccuracy)) ) { NSLog(@"bestVer: %f", _bestVertivalAccuracy); NSLog(@"bestHor: %f", _bestHorizontalAccuracy); NSLog(@"Given ver: %f", newLocation.verticalAccuracy); NSLog(@"Given hor: %f", newLocation.horizontalAccuracy); NSLog(@"-------------------------------------------------------"); _bestVertivalAccuracy = newLocation.verticalAccuracy; _bestHorizontalAccuracy = newLocation.horizontalAccuracy; return; } [_locationManager stopUpdatingLocation]; [POSharedLocation sharedInstance].lng = longitude; [POSharedLocation sharedInstance].lat = latitude; [POSharedLocation sharedInstance].showUserLocation = YES; NSLog(@"Longitude : %f", longitude); NSLog(@"Latitude : %f", latitude); NSLog(@"Acc. Ver: %f", newLocation.verticalAccuracy); NSLog(@"Acc. Hor: %f", newLocation.horizontalAccuracy); NSLog(@"-------------------------------------------------------"); _resultsVC = [[ResultsListViewController alloc] init]; UINavigationController *navVC = [[UINavigationController alloc] initWithRootViewController:_resultsVC]; NSString *locationQuery = [NSString stringWithFormat:@"/json?method=find&lat=%f&lng=%f&distance=%f", latitude, longitude, _distance]; NSString *url = [API_URL stringByAppendingString:locationQuery]; NSString* urlEncoded = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; // For debuging only NSLog(@"URL: %@", urlEncoded); NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlEncoded]]; // Run an asynchronous connection and download the JSON (void)[[NSURLConnection alloc] initWithRequest:request delegate:_resultsVC startImmediately:YES]; [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; [self presentModalViewController:navVC animated:YES]; [navVC release]; } ``` And the output: ``` 2013-05-30 12:59:13.906 MyApp[30569:907] bestVer: 0.000000 2013-05-30 12:59:13.918 MyApp[30569:907] bestHor: 0.000000 2013-05-30 12:59:13.922 MyApp[30569:907] Given ver: 3.000000 2013-05-30 12:59:13.927 MyApp[30569:907] Given hor: 50.000000 2013-05-30 12:59:13.933 MyApp[30569:907] ------------------------------------------------------- 2013-05-30 12:59:14.112 MyApp[30569:907] Longitude : 16.934037 2013-05-30 12:59:14.114 MyApp[30569:907] Latitude : 51.096827 2013-05-30 12:59:14.116 MyApp[30569:907] Acc. Ver: 10.000000 2013-05-30 12:59:14.119 MyApp[30569:907] Acc. Hor: 1414.000000 2013-05-30 12:59:14.131 MyApp[30569:907] ------------------------------------------------------- 2013-05-30 12:59:14.138 MyApp[30569:907] URL: http://example.com/json?method=find&lat=51.096827&lng=16.934037&distance=1.000000 2013-05-30 12:59:14.241 MyApp[30569:907] Longitude : 16.933006 2013-05-30 12:59:14.244 MyApp[30569:907] Latitude : 51.096140 2013-05-30 12:59:14.247 MyApp[30569:907] Acc. Ver: 10.000000 2013-05-30 12:59:14.248 MyApp[30569:907] Acc. Hor: 1414.000000 2013-05-30 12:59:14.250 MyApp[30569:907] ------------------------------------------------------- 2013-05-30 12:59:14.253 MyApp[30569:907] URL: http://example.com/json?method=find&lat=51.096140&lng=16.933006&distance=1.000000 2013-05-30 12:59:14.256 MyApp[30569:907] Warning: Attempt to present <UINavigationController: 0x1e068fd0> on <HomeViewController: 0x1d572130> while a presentation is in progress! 2013-05-30 12:59:14.260 MyApp[30569:907] Longitude : 16.932491 2013-05-30 12:59:14.262 MyApp[30569:907] Latitude : 51.095797 2013-05-30 12:59:14.263 MyApp[30569:907] Acc. Ver: 10.000000 2013-05-30 12:59:14.264 MyApp[30569:907] Acc. Hor: 1414.000000 2013-05-30 12:59:14.269 MyApp[30569:907] ------------------------------------------------------- 2013-05-30 12:59:14.287 MyApp[30569:907] URL: http://example.com/json?method=find&lat=51.095797&lng=16.932491&distance=1.000000 2013-05-30 12:59:14.291 MyApp[30569:907] Warning: Attempt to present <UINavigationController: 0x1d599790> on <HomeViewController: 0x1d572130> while a presentation is in progress! 2013-05-30 12:59:14.298 MyApp[30569:907] Longitude : 16.932234 2013-05-30 12:59:14.301 MyApp[30569:907] Latitude : 51.095625 2013-05-30 12:59:14.302 MyApp[30569:907] Acc. Ver: 10.000000 2013-05-30 12:59:14.303 MyApp[30569:907] Acc. Hor: 1414.000000 2013-05-30 12:59:14.304 MyApp[30569:907] ------------------------------------------------------- 2013-05-30 12:59:14.307 MyApp[30569:907] URL: http://example.com/json?method=find&lat=51.095625&lng=16.932234&distance=1.000000 2013-05-30 12:59:14.309 MyApp[30569:907] Warning: Attempt to present <UINavigationController: 0x1e06c930> on <HomeViewController: 0x1d572130> while a presentation is in progress! ``` As you can see, API is called a few times while it should be called only once. Any idea how to make it better?
2013/05/30
[ "https://Stackoverflow.com/questions/16834923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2435994/" ]
Try by setting nil to your locationManagers delegate ``` _locationManager.delegate = nil; ```
Don't rely on the location manager calling your delegate method a specific number of times. You don't control the location manager, so depending on specific behavior beyond what's documented is always going to cause problems for you. You do control your own code, though, so make it do what you want: if you no longer want location updates, have your delegate method ignore updates when you don't want them, or just set the location manager's delegate to nil.
16,834,923
I try to invoke URL API at the best GPS location. User clicks the button that fires **findMe** method to set up *desiredAccuracy* and *distanceFilter* and run **`[self.locationManager startUpdatingLocation]`**. I check the best vertical and horizontal accuracy and if they don't change in the next iteration I run API and **`[self.locationManager stopUpdatingLocation]`** The point is that after that the best accuracy is changed and **`-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation`** is run a few times even if I stop updating location. ``` -(void)findMe { self.locationManager.desiredAccuracy = kCLLocationAccuracyBest; self.locationManager.distanceFilter = kCLDistanceFilterNone; [self.locationManager startUpdatingLocation]; } -(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { double longitude = newLocation.coordinate.longitude; double latitude = newLocation.coordinate.latitude; if ( ((_bestVertivalAccuracy == 0) || (_bestVertivalAccuracy > newLocation.verticalAccuracy)) || ((_bestHorizontalAccuracy == 0) || (_bestHorizontalAccuracy > newLocation.horizontalAccuracy)) ) { NSLog(@"bestVer: %f", _bestVertivalAccuracy); NSLog(@"bestHor: %f", _bestHorizontalAccuracy); NSLog(@"Given ver: %f", newLocation.verticalAccuracy); NSLog(@"Given hor: %f", newLocation.horizontalAccuracy); NSLog(@"-------------------------------------------------------"); _bestVertivalAccuracy = newLocation.verticalAccuracy; _bestHorizontalAccuracy = newLocation.horizontalAccuracy; return; } [_locationManager stopUpdatingLocation]; [POSharedLocation sharedInstance].lng = longitude; [POSharedLocation sharedInstance].lat = latitude; [POSharedLocation sharedInstance].showUserLocation = YES; NSLog(@"Longitude : %f", longitude); NSLog(@"Latitude : %f", latitude); NSLog(@"Acc. Ver: %f", newLocation.verticalAccuracy); NSLog(@"Acc. Hor: %f", newLocation.horizontalAccuracy); NSLog(@"-------------------------------------------------------"); _resultsVC = [[ResultsListViewController alloc] init]; UINavigationController *navVC = [[UINavigationController alloc] initWithRootViewController:_resultsVC]; NSString *locationQuery = [NSString stringWithFormat:@"/json?method=find&lat=%f&lng=%f&distance=%f", latitude, longitude, _distance]; NSString *url = [API_URL stringByAppendingString:locationQuery]; NSString* urlEncoded = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; // For debuging only NSLog(@"URL: %@", urlEncoded); NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlEncoded]]; // Run an asynchronous connection and download the JSON (void)[[NSURLConnection alloc] initWithRequest:request delegate:_resultsVC startImmediately:YES]; [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; [self presentModalViewController:navVC animated:YES]; [navVC release]; } ``` And the output: ``` 2013-05-30 12:59:13.906 MyApp[30569:907] bestVer: 0.000000 2013-05-30 12:59:13.918 MyApp[30569:907] bestHor: 0.000000 2013-05-30 12:59:13.922 MyApp[30569:907] Given ver: 3.000000 2013-05-30 12:59:13.927 MyApp[30569:907] Given hor: 50.000000 2013-05-30 12:59:13.933 MyApp[30569:907] ------------------------------------------------------- 2013-05-30 12:59:14.112 MyApp[30569:907] Longitude : 16.934037 2013-05-30 12:59:14.114 MyApp[30569:907] Latitude : 51.096827 2013-05-30 12:59:14.116 MyApp[30569:907] Acc. Ver: 10.000000 2013-05-30 12:59:14.119 MyApp[30569:907] Acc. Hor: 1414.000000 2013-05-30 12:59:14.131 MyApp[30569:907] ------------------------------------------------------- 2013-05-30 12:59:14.138 MyApp[30569:907] URL: http://example.com/json?method=find&lat=51.096827&lng=16.934037&distance=1.000000 2013-05-30 12:59:14.241 MyApp[30569:907] Longitude : 16.933006 2013-05-30 12:59:14.244 MyApp[30569:907] Latitude : 51.096140 2013-05-30 12:59:14.247 MyApp[30569:907] Acc. Ver: 10.000000 2013-05-30 12:59:14.248 MyApp[30569:907] Acc. Hor: 1414.000000 2013-05-30 12:59:14.250 MyApp[30569:907] ------------------------------------------------------- 2013-05-30 12:59:14.253 MyApp[30569:907] URL: http://example.com/json?method=find&lat=51.096140&lng=16.933006&distance=1.000000 2013-05-30 12:59:14.256 MyApp[30569:907] Warning: Attempt to present <UINavigationController: 0x1e068fd0> on <HomeViewController: 0x1d572130> while a presentation is in progress! 2013-05-30 12:59:14.260 MyApp[30569:907] Longitude : 16.932491 2013-05-30 12:59:14.262 MyApp[30569:907] Latitude : 51.095797 2013-05-30 12:59:14.263 MyApp[30569:907] Acc. Ver: 10.000000 2013-05-30 12:59:14.264 MyApp[30569:907] Acc. Hor: 1414.000000 2013-05-30 12:59:14.269 MyApp[30569:907] ------------------------------------------------------- 2013-05-30 12:59:14.287 MyApp[30569:907] URL: http://example.com/json?method=find&lat=51.095797&lng=16.932491&distance=1.000000 2013-05-30 12:59:14.291 MyApp[30569:907] Warning: Attempt to present <UINavigationController: 0x1d599790> on <HomeViewController: 0x1d572130> while a presentation is in progress! 2013-05-30 12:59:14.298 MyApp[30569:907] Longitude : 16.932234 2013-05-30 12:59:14.301 MyApp[30569:907] Latitude : 51.095625 2013-05-30 12:59:14.302 MyApp[30569:907] Acc. Ver: 10.000000 2013-05-30 12:59:14.303 MyApp[30569:907] Acc. Hor: 1414.000000 2013-05-30 12:59:14.304 MyApp[30569:907] ------------------------------------------------------- 2013-05-30 12:59:14.307 MyApp[30569:907] URL: http://example.com/json?method=find&lat=51.095625&lng=16.932234&distance=1.000000 2013-05-30 12:59:14.309 MyApp[30569:907] Warning: Attempt to present <UINavigationController: 0x1e06c930> on <HomeViewController: 0x1d572130> while a presentation is in progress! ``` As you can see, API is called a few times while it should be called only once. Any idea how to make it better?
2013/05/30
[ "https://Stackoverflow.com/questions/16834923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2435994/" ]
Try by setting nil to your locationManagers delegate ``` _locationManager.delegate = nil; ```
As suggested, adding it as answer. Two ways to do this, 1. Use a flag, check `flag=false` before making url request. After url request is sent set `flag=true`. 2. During view controller initialisation, start getting location updates, store the coords and in `findMe` method just make the URL request with stored coords.
16,834,923
I try to invoke URL API at the best GPS location. User clicks the button that fires **findMe** method to set up *desiredAccuracy* and *distanceFilter* and run **`[self.locationManager startUpdatingLocation]`**. I check the best vertical and horizontal accuracy and if they don't change in the next iteration I run API and **`[self.locationManager stopUpdatingLocation]`** The point is that after that the best accuracy is changed and **`-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation`** is run a few times even if I stop updating location. ``` -(void)findMe { self.locationManager.desiredAccuracy = kCLLocationAccuracyBest; self.locationManager.distanceFilter = kCLDistanceFilterNone; [self.locationManager startUpdatingLocation]; } -(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { double longitude = newLocation.coordinate.longitude; double latitude = newLocation.coordinate.latitude; if ( ((_bestVertivalAccuracy == 0) || (_bestVertivalAccuracy > newLocation.verticalAccuracy)) || ((_bestHorizontalAccuracy == 0) || (_bestHorizontalAccuracy > newLocation.horizontalAccuracy)) ) { NSLog(@"bestVer: %f", _bestVertivalAccuracy); NSLog(@"bestHor: %f", _bestHorizontalAccuracy); NSLog(@"Given ver: %f", newLocation.verticalAccuracy); NSLog(@"Given hor: %f", newLocation.horizontalAccuracy); NSLog(@"-------------------------------------------------------"); _bestVertivalAccuracy = newLocation.verticalAccuracy; _bestHorizontalAccuracy = newLocation.horizontalAccuracy; return; } [_locationManager stopUpdatingLocation]; [POSharedLocation sharedInstance].lng = longitude; [POSharedLocation sharedInstance].lat = latitude; [POSharedLocation sharedInstance].showUserLocation = YES; NSLog(@"Longitude : %f", longitude); NSLog(@"Latitude : %f", latitude); NSLog(@"Acc. Ver: %f", newLocation.verticalAccuracy); NSLog(@"Acc. Hor: %f", newLocation.horizontalAccuracy); NSLog(@"-------------------------------------------------------"); _resultsVC = [[ResultsListViewController alloc] init]; UINavigationController *navVC = [[UINavigationController alloc] initWithRootViewController:_resultsVC]; NSString *locationQuery = [NSString stringWithFormat:@"/json?method=find&lat=%f&lng=%f&distance=%f", latitude, longitude, _distance]; NSString *url = [API_URL stringByAppendingString:locationQuery]; NSString* urlEncoded = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; // For debuging only NSLog(@"URL: %@", urlEncoded); NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlEncoded]]; // Run an asynchronous connection and download the JSON (void)[[NSURLConnection alloc] initWithRequest:request delegate:_resultsVC startImmediately:YES]; [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; [self presentModalViewController:navVC animated:YES]; [navVC release]; } ``` And the output: ``` 2013-05-30 12:59:13.906 MyApp[30569:907] bestVer: 0.000000 2013-05-30 12:59:13.918 MyApp[30569:907] bestHor: 0.000000 2013-05-30 12:59:13.922 MyApp[30569:907] Given ver: 3.000000 2013-05-30 12:59:13.927 MyApp[30569:907] Given hor: 50.000000 2013-05-30 12:59:13.933 MyApp[30569:907] ------------------------------------------------------- 2013-05-30 12:59:14.112 MyApp[30569:907] Longitude : 16.934037 2013-05-30 12:59:14.114 MyApp[30569:907] Latitude : 51.096827 2013-05-30 12:59:14.116 MyApp[30569:907] Acc. Ver: 10.000000 2013-05-30 12:59:14.119 MyApp[30569:907] Acc. Hor: 1414.000000 2013-05-30 12:59:14.131 MyApp[30569:907] ------------------------------------------------------- 2013-05-30 12:59:14.138 MyApp[30569:907] URL: http://example.com/json?method=find&lat=51.096827&lng=16.934037&distance=1.000000 2013-05-30 12:59:14.241 MyApp[30569:907] Longitude : 16.933006 2013-05-30 12:59:14.244 MyApp[30569:907] Latitude : 51.096140 2013-05-30 12:59:14.247 MyApp[30569:907] Acc. Ver: 10.000000 2013-05-30 12:59:14.248 MyApp[30569:907] Acc. Hor: 1414.000000 2013-05-30 12:59:14.250 MyApp[30569:907] ------------------------------------------------------- 2013-05-30 12:59:14.253 MyApp[30569:907] URL: http://example.com/json?method=find&lat=51.096140&lng=16.933006&distance=1.000000 2013-05-30 12:59:14.256 MyApp[30569:907] Warning: Attempt to present <UINavigationController: 0x1e068fd0> on <HomeViewController: 0x1d572130> while a presentation is in progress! 2013-05-30 12:59:14.260 MyApp[30569:907] Longitude : 16.932491 2013-05-30 12:59:14.262 MyApp[30569:907] Latitude : 51.095797 2013-05-30 12:59:14.263 MyApp[30569:907] Acc. Ver: 10.000000 2013-05-30 12:59:14.264 MyApp[30569:907] Acc. Hor: 1414.000000 2013-05-30 12:59:14.269 MyApp[30569:907] ------------------------------------------------------- 2013-05-30 12:59:14.287 MyApp[30569:907] URL: http://example.com/json?method=find&lat=51.095797&lng=16.932491&distance=1.000000 2013-05-30 12:59:14.291 MyApp[30569:907] Warning: Attempt to present <UINavigationController: 0x1d599790> on <HomeViewController: 0x1d572130> while a presentation is in progress! 2013-05-30 12:59:14.298 MyApp[30569:907] Longitude : 16.932234 2013-05-30 12:59:14.301 MyApp[30569:907] Latitude : 51.095625 2013-05-30 12:59:14.302 MyApp[30569:907] Acc. Ver: 10.000000 2013-05-30 12:59:14.303 MyApp[30569:907] Acc. Hor: 1414.000000 2013-05-30 12:59:14.304 MyApp[30569:907] ------------------------------------------------------- 2013-05-30 12:59:14.307 MyApp[30569:907] URL: http://example.com/json?method=find&lat=51.095625&lng=16.932234&distance=1.000000 2013-05-30 12:59:14.309 MyApp[30569:907] Warning: Attempt to present <UINavigationController: 0x1e06c930> on <HomeViewController: 0x1d572130> while a presentation is in progress! ``` As you can see, API is called a few times while it should be called only once. Any idea how to make it better?
2013/05/30
[ "https://Stackoverflow.com/questions/16834923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2435994/" ]
Don't rely on the location manager calling your delegate method a specific number of times. You don't control the location manager, so depending on specific behavior beyond what's documented is always going to cause problems for you. You do control your own code, though, so make it do what you want: if you no longer want location updates, have your delegate method ignore updates when you don't want them, or just set the location manager's delegate to nil.
As suggested, adding it as answer. Two ways to do this, 1. Use a flag, check `flag=false` before making url request. After url request is sent set `flag=true`. 2. During view controller initialisation, start getting location updates, store the coords and in `findMe` method just make the URL request with stored coords.
51,737
I subscribed in a 1Mbps broadband internet (data only). The provider said that customers would only get 60% of it which is approximately 600kbps of the 1Mbps, which is enough for me. But I've been observing my download speed and it is limited to only 12%, i can't get past 120kbps. Every time my DL speed exceeds 120kbps it suddenly drops down again. I think mine is filtered. Is there a way around this? My modem router is Prolink ADSL2+.
2009/10/06
[ "https://superuser.com/questions/51737", "https://superuser.com", "https://superuser.com/users/-1/" ]
1Mbps = 1 Mega **bit** per second and 1 [**byte**](http://en.wikipedia.org/wiki/Byte) = 8 [**bits**](http://en.wikipedia.org/wiki/Bit) so 1 Mbps = 0.125 Mega **byte** per second. Bit is typically represented by a lowercase `b`. While byte is typically represented by an uppercase `B` So 8 M**b**ps = 1 M**B**ps. This is a classic marketing ploy since all the speeds look like they're 8x faster. On the plus side, you're actually getting the full bandwidth you're paying for. I pay for a line that's *up to* 10 Mbps and only ever get about 8 Mbps. **Edit:** If you understand the bit vs byte issue, then make sure the speed readings you're getting are correct. Running a [speed test](http://www.speedtest.net/) while no other internet activity is happening is the best way to get an accurate reading of your connection speed, applications often have an inaccurate speed reading.
Are you sure that you're not hitting 120 kilo**bytes** per second (kB/sec) (which is close enough to 1 mega**bit** per second [mbps])? 1 kB/sec is the same as 8 kilobits per second (kbps) See [Wikipedia for more explanation on data rate units](http://en.wikipedia.org/wiki/Data_rate_units). --- **To bring an end to all the speculation going on here...** what does <http://www.speedtest.net/> tell you? ---
51,737
I subscribed in a 1Mbps broadband internet (data only). The provider said that customers would only get 60% of it which is approximately 600kbps of the 1Mbps, which is enough for me. But I've been observing my download speed and it is limited to only 12%, i can't get past 120kbps. Every time my DL speed exceeds 120kbps it suddenly drops down again. I think mine is filtered. Is there a way around this? My modem router is Prolink ADSL2+.
2009/10/06
[ "https://superuser.com/questions/51737", "https://superuser.com", "https://superuser.com/users/-1/" ]
1Mbps = 1 Mega **bit** per second and 1 [**byte**](http://en.wikipedia.org/wiki/Byte) = 8 [**bits**](http://en.wikipedia.org/wiki/Bit) so 1 Mbps = 0.125 Mega **byte** per second. Bit is typically represented by a lowercase `b`. While byte is typically represented by an uppercase `B` So 8 M**b**ps = 1 M**B**ps. This is a classic marketing ploy since all the speeds look like they're 8x faster. On the plus side, you're actually getting the full bandwidth you're paying for. I pay for a line that's *up to* 10 Mbps and only ever get about 8 Mbps. **Edit:** If you understand the bit vs byte issue, then make sure the speed readings you're getting are correct. Running a [speed test](http://www.speedtest.net/) while no other internet activity is happening is the best way to get an accurate reading of your connection speed, applications often have an inaccurate speed reading.
Some ISPs do take measures to cap bandwidth. Some have even covertly resorted to [traffic shaping](http://en.wikipedia.org/wiki/Traffic_shaping) (limited speed based on the type of data). Whether they have the right to is debatable (see [net neutrality](http://en.wikipedia.org/wiki/Net_neutrality)). Comcast was recently caught doing this with [bitorrent](http://www.zeropaid.com/news/9544/comcast_sued_for_bittorrent_throttling_mulls_data_caps/) data. You can try to test this by downloading from various sources one at a time using different protocols and see if there are discrepancies. Keep in mind your speed is limited by the capacity of your download source as well. An overloaded website is going to be a slow download no matter what you try to do on your end.
51,737
I subscribed in a 1Mbps broadband internet (data only). The provider said that customers would only get 60% of it which is approximately 600kbps of the 1Mbps, which is enough for me. But I've been observing my download speed and it is limited to only 12%, i can't get past 120kbps. Every time my DL speed exceeds 120kbps it suddenly drops down again. I think mine is filtered. Is there a way around this? My modem router is Prolink ADSL2+.
2009/10/06
[ "https://superuser.com/questions/51737", "https://superuser.com", "https://superuser.com/users/-1/" ]
Are you sure that you're not hitting 120 kilo**bytes** per second (kB/sec) (which is close enough to 1 mega**bit** per second [mbps])? 1 kB/sec is the same as 8 kilobits per second (kbps) See [Wikipedia for more explanation on data rate units](http://en.wikipedia.org/wiki/Data_rate_units). --- **To bring an end to all the speculation going on here...** what does <http://www.speedtest.net/> tell you? ---
Some ISPs do take measures to cap bandwidth. Some have even covertly resorted to [traffic shaping](http://en.wikipedia.org/wiki/Traffic_shaping) (limited speed based on the type of data). Whether they have the right to is debatable (see [net neutrality](http://en.wikipedia.org/wiki/Net_neutrality)). Comcast was recently caught doing this with [bitorrent](http://www.zeropaid.com/news/9544/comcast_sued_for_bittorrent_throttling_mulls_data_caps/) data. You can try to test this by downloading from various sources one at a time using different protocols and see if there are discrepancies. Keep in mind your speed is limited by the capacity of your download source as well. An overloaded website is going to be a slow download no matter what you try to do on your end.
51,737
I subscribed in a 1Mbps broadband internet (data only). The provider said that customers would only get 60% of it which is approximately 600kbps of the 1Mbps, which is enough for me. But I've been observing my download speed and it is limited to only 12%, i can't get past 120kbps. Every time my DL speed exceeds 120kbps it suddenly drops down again. I think mine is filtered. Is there a way around this? My modem router is Prolink ADSL2+.
2009/10/06
[ "https://superuser.com/questions/51737", "https://superuser.com", "https://superuser.com/users/-1/" ]
1Mbps = 1 Mega **bit** per second and 1 [**byte**](http://en.wikipedia.org/wiki/Byte) = 8 [**bits**](http://en.wikipedia.org/wiki/Bit) so 1 Mbps = 0.125 Mega **byte** per second. Bit is typically represented by a lowercase `b`. While byte is typically represented by an uppercase `B` So 8 M**b**ps = 1 M**B**ps. This is a classic marketing ploy since all the speeds look like they're 8x faster. On the plus side, you're actually getting the full bandwidth you're paying for. I pay for a line that's *up to* 10 Mbps and only ever get about 8 Mbps. **Edit:** If you understand the bit vs byte issue, then make sure the speed readings you're getting are correct. Running a [speed test](http://www.speedtest.net/) while no other internet activity is happening is the best way to get an accurate reading of your connection speed, applications often have an inaccurate speed reading.
I think your question is about file transfer rate, not differences in in connection rates. It is not about bits or bytes or 1024. Your file transfer rate will not be synchronous with your connection rate, it will be about 1/8th of the connection rate. that is a MAX rate, so add to that the normal lag of the internet and you get total slowdown. This is an internet fact. A fact, that those of use using FTP have to deal with. I have attampted to research the issue, but there is not alot of information out there, since not alot of people do FTP, some who do don't realize they are (Google Docs), most FTP activity is small files, and for large files you can just stream the content. Generally, this is not a problem for DL, since we all have 10M or better home connections, so you can DL at about 1M. Where this really sucks is on Upload. Home internet connections have an upload rate of less then 1M, usually 768K or 512K. 1/8th of that sucks, about 100k is what i get on a good day, average is around 35k.
51,737
I subscribed in a 1Mbps broadband internet (data only). The provider said that customers would only get 60% of it which is approximately 600kbps of the 1Mbps, which is enough for me. But I've been observing my download speed and it is limited to only 12%, i can't get past 120kbps. Every time my DL speed exceeds 120kbps it suddenly drops down again. I think mine is filtered. Is there a way around this? My modem router is Prolink ADSL2+.
2009/10/06
[ "https://superuser.com/questions/51737", "https://superuser.com", "https://superuser.com/users/-1/" ]
Actually, there are three things going on. One is the bits versus bytes issue that others have mentioned. Another is that line speeds are reported in decimal units, not binary units. And a third is that the line has to carry not just data but also address and control information. A 1Mbps line carries 1,000,000 bits per second, or 125,000 bytes per second. Address and control information takes about 4% of the bandwidth, leaving about 120,000 bytes per second for data. A kilobyte of data is 1,024 bytes, so that means you would expect 117KB/s. So you're dead on.
To try to simplify the other answers, providers report in Bits because they give higher numbers. Most applications report in bytes. 1mbps connection = 128KB/s. When downloading in Firefox, Steam, uTorrent, etc. the highest speed you will ever see is 128KB/s. To reinforce what is happening, the difference between bytes and bits is 1/8, or 12.5%. This is surely what you're seeing. As far as seeing the actual cap, your bandwidth is limited to the advertised 1mbps by the company, and you can often see the bandwidth jump initially beyond the limit before the ISP caps the speed. As an example, I have a 10mbps connection, but our ISP offers a 20mbps package. While my speed is usually maxed out at 1.25MB/s, I can initially see the speed jump up to 2MB/s before slowing down to the speed I'm paying for.
51,737
I subscribed in a 1Mbps broadband internet (data only). The provider said that customers would only get 60% of it which is approximately 600kbps of the 1Mbps, which is enough for me. But I've been observing my download speed and it is limited to only 12%, i can't get past 120kbps. Every time my DL speed exceeds 120kbps it suddenly drops down again. I think mine is filtered. Is there a way around this? My modem router is Prolink ADSL2+.
2009/10/06
[ "https://superuser.com/questions/51737", "https://superuser.com", "https://superuser.com/users/-1/" ]
1Mbps = 1 Mega **bit** per second and 1 [**byte**](http://en.wikipedia.org/wiki/Byte) = 8 [**bits**](http://en.wikipedia.org/wiki/Bit) so 1 Mbps = 0.125 Mega **byte** per second. Bit is typically represented by a lowercase `b`. While byte is typically represented by an uppercase `B` So 8 M**b**ps = 1 M**B**ps. This is a classic marketing ploy since all the speeds look like they're 8x faster. On the plus side, you're actually getting the full bandwidth you're paying for. I pay for a line that's *up to* 10 Mbps and only ever get about 8 Mbps. **Edit:** If you understand the bit vs byte issue, then make sure the speed readings you're getting are correct. Running a [speed test](http://www.speedtest.net/) while no other internet activity is happening is the best way to get an accurate reading of your connection speed, applications often have an inaccurate speed reading.
Actually, there are three things going on. One is the bits versus bytes issue that others have mentioned. Another is that line speeds are reported in decimal units, not binary units. And a third is that the line has to carry not just data but also address and control information. A 1Mbps line carries 1,000,000 bits per second, or 125,000 bytes per second. Address and control information takes about 4% of the bandwidth, leaving about 120,000 bytes per second for data. A kilobyte of data is 1,024 bytes, so that means you would expect 117KB/s. So you're dead on.
51,737
I subscribed in a 1Mbps broadband internet (data only). The provider said that customers would only get 60% of it which is approximately 600kbps of the 1Mbps, which is enough for me. But I've been observing my download speed and it is limited to only 12%, i can't get past 120kbps. Every time my DL speed exceeds 120kbps it suddenly drops down again. I think mine is filtered. Is there a way around this? My modem router is Prolink ADSL2+.
2009/10/06
[ "https://superuser.com/questions/51737", "https://superuser.com", "https://superuser.com/users/-1/" ]
Are you sure that you're not hitting 120 kilo**bytes** per second (kB/sec) (which is close enough to 1 mega**bit** per second [mbps])? 1 kB/sec is the same as 8 kilobits per second (kbps) See [Wikipedia for more explanation on data rate units](http://en.wikipedia.org/wiki/Data_rate_units). --- **To bring an end to all the speculation going on here...** what does <http://www.speedtest.net/> tell you? ---
I think your question is about file transfer rate, not differences in in connection rates. It is not about bits or bytes or 1024. Your file transfer rate will not be synchronous with your connection rate, it will be about 1/8th of the connection rate. that is a MAX rate, so add to that the normal lag of the internet and you get total slowdown. This is an internet fact. A fact, that those of use using FTP have to deal with. I have attampted to research the issue, but there is not alot of information out there, since not alot of people do FTP, some who do don't realize they are (Google Docs), most FTP activity is small files, and for large files you can just stream the content. Generally, this is not a problem for DL, since we all have 10M or better home connections, so you can DL at about 1M. Where this really sucks is on Upload. Home internet connections have an upload rate of less then 1M, usually 768K or 512K. 1/8th of that sucks, about 100k is what i get on a good day, average is around 35k.
51,737
I subscribed in a 1Mbps broadband internet (data only). The provider said that customers would only get 60% of it which is approximately 600kbps of the 1Mbps, which is enough for me. But I've been observing my download speed and it is limited to only 12%, i can't get past 120kbps. Every time my DL speed exceeds 120kbps it suddenly drops down again. I think mine is filtered. Is there a way around this? My modem router is Prolink ADSL2+.
2009/10/06
[ "https://superuser.com/questions/51737", "https://superuser.com", "https://superuser.com/users/-1/" ]
Actually, there are three things going on. One is the bits versus bytes issue that others have mentioned. Another is that line speeds are reported in decimal units, not binary units. And a third is that the line has to carry not just data but also address and control information. A 1Mbps line carries 1,000,000 bits per second, or 125,000 bytes per second. Address and control information takes about 4% of the bandwidth, leaving about 120,000 bytes per second for data. A kilobyte of data is 1,024 bytes, so that means you would expect 117KB/s. So you're dead on.
I think your question is about file transfer rate, not differences in in connection rates. It is not about bits or bytes or 1024. Your file transfer rate will not be synchronous with your connection rate, it will be about 1/8th of the connection rate. that is a MAX rate, so add to that the normal lag of the internet and you get total slowdown. This is an internet fact. A fact, that those of use using FTP have to deal with. I have attampted to research the issue, but there is not alot of information out there, since not alot of people do FTP, some who do don't realize they are (Google Docs), most FTP activity is small files, and for large files you can just stream the content. Generally, this is not a problem for DL, since we all have 10M or better home connections, so you can DL at about 1M. Where this really sucks is on Upload. Home internet connections have an upload rate of less then 1M, usually 768K or 512K. 1/8th of that sucks, about 100k is what i get on a good day, average is around 35k.
51,737
I subscribed in a 1Mbps broadband internet (data only). The provider said that customers would only get 60% of it which is approximately 600kbps of the 1Mbps, which is enough for me. But I've been observing my download speed and it is limited to only 12%, i can't get past 120kbps. Every time my DL speed exceeds 120kbps it suddenly drops down again. I think mine is filtered. Is there a way around this? My modem router is Prolink ADSL2+.
2009/10/06
[ "https://superuser.com/questions/51737", "https://superuser.com", "https://superuser.com/users/-1/" ]
Are you sure that you're not hitting 120 kilo**bytes** per second (kB/sec) (which is close enough to 1 mega**bit** per second [mbps])? 1 kB/sec is the same as 8 kilobits per second (kbps) See [Wikipedia for more explanation on data rate units](http://en.wikipedia.org/wiki/Data_rate_units). --- **To bring an end to all the speculation going on here...** what does <http://www.speedtest.net/> tell you? ---
Actually, there are three things going on. One is the bits versus bytes issue that others have mentioned. Another is that line speeds are reported in decimal units, not binary units. And a third is that the line has to carry not just data but also address and control information. A 1Mbps line carries 1,000,000 bits per second, or 125,000 bytes per second. Address and control information takes about 4% of the bandwidth, leaving about 120,000 bytes per second for data. A kilobyte of data is 1,024 bytes, so that means you would expect 117KB/s. So you're dead on.
51,737
I subscribed in a 1Mbps broadband internet (data only). The provider said that customers would only get 60% of it which is approximately 600kbps of the 1Mbps, which is enough for me. But I've been observing my download speed and it is limited to only 12%, i can't get past 120kbps. Every time my DL speed exceeds 120kbps it suddenly drops down again. I think mine is filtered. Is there a way around this? My modem router is Prolink ADSL2+.
2009/10/06
[ "https://superuser.com/questions/51737", "https://superuser.com", "https://superuser.com/users/-1/" ]
Actually, there are three things going on. One is the bits versus bytes issue that others have mentioned. Another is that line speeds are reported in decimal units, not binary units. And a third is that the line has to carry not just data but also address and control information. A 1Mbps line carries 1,000,000 bits per second, or 125,000 bytes per second. Address and control information takes about 4% of the bandwidth, leaving about 120,000 bytes per second for data. A kilobyte of data is 1,024 bytes, so that means you would expect 117KB/s. So you're dead on.
Some ISPs do take measures to cap bandwidth. Some have even covertly resorted to [traffic shaping](http://en.wikipedia.org/wiki/Traffic_shaping) (limited speed based on the type of data). Whether they have the right to is debatable (see [net neutrality](http://en.wikipedia.org/wiki/Net_neutrality)). Comcast was recently caught doing this with [bitorrent](http://www.zeropaid.com/news/9544/comcast_sued_for_bittorrent_throttling_mulls_data_caps/) data. You can try to test this by downloading from various sources one at a time using different protocols and see if there are discrepancies. Keep in mind your speed is limited by the capacity of your download source as well. An overloaded website is going to be a slow download no matter what you try to do on your end.
10,211
Senator Ted Cruz [said](https://www.washingtonpost.com/news/post-politics/wp/2013/06/03/ted-cruz-abolish-the-irs/) > > I think we ought to abolish the IRS and instead move to a simple flat tax where the average American can fill out taxes on postcard. > > > What are the benefits the supporters of this plan ascribe to it and what are the drawbacks of the plan in the eyes of its opponents?
2016/03/14
[ "https://politics.stackexchange.com/questions/10211", "https://politics.stackexchange.com", "https://politics.stackexchange.com/users/6970/" ]
The "real" pros and cons are extremely complex, but the popular understanding of the plan is roughly as follows: **Pros:** It's fair for everyone because we all pay the same tax rate. No one gets disproportionately burdened or singled out. It's impossible for anyone to game the system or exploit loopholes because it's so simple. It eliminates the cost for the government of maintaining the IRS, saving taxpayers money. Eliminating the progressive tax system lowers taxes for the rich, allowing them to reinvest that money into the economy instead of sending it to the government to be wasted. **Cons:** It removes tax incentives that are economically useful, e.g. encouraging people to start small businesses by giving them tax breaks. Removing tax breaks may also increase the relative tax burden for the middle class, people with families, etc. who are already financially struggling in this economy. Rich people pay less taxes than they do now, and thus don't contribute their fair share to society, despite benefiting immensely from public spending.
The usually overlooked advantage is that the cost of collecting the tax is significantly reduced by such a system. Guesstimates currently place the cost of collecting one spendable tax dollar at over $5. Reducing that cost by even 20% means that there is an additional dollar in the economy for every single tax dollar that can be spent. The IRS budget is currently over $11 billion dollars, and many times that amount is spent on tax lawyers. The costs to individuals and companies involved in calculating, collecting, auditing and paying taxes are all significant and are often more then the actual tax bill. This is just draining resources out of the economy to nobodies advantage. The simplest and fairest system that I have heard of is called the fixed base flat rate. The government already publishes the Federal poverty level income. Every taxable entity gets to deduct twice that amount from their gross taxable income and they a flat rate of the remaining income as tax. So what should the rate be? The 2017 US GDP was just under $20 trillion and the federal budget was ~$4trillion (20%). The tax take was $3.3trillion (the difference adds to the national debt), so I suggest start at a flat 20% and let the cost savings reduce the national debt. ``` Box 1, gross taxable income, Box 2 poverty level * 2, Box 3, taxable income (box1 - box2) Box 4, tax (Box3 times 0.20) ``` Example1 - Income $65,000 ``` Box 1 Gross income $65000 Box 2 poverty level $12,486 * 2 $25000 Box 3 taxable income $40000 Box 4 tax $ 8000 ``` Example2 - Income $650,000 ``` Box 1 Gross income $650000 Box 2 poverty level $12,486 * 2 $ 25000 Box 3 taxable income $625000 Box 4 tax $125000 ``` Example3 - Income $6,500,000 ``` Box 1 Gross income $6500000 Box 2 poverty level $12,486 * 2 $ 25000 Box 3 taxable income $6475000 Box 4 tax $1295000 ``` Example4 - Income $35,000 ``` Box 1 Gross income $35000 Box 2 poverty level $12,486 * 2 $25000 Box 3 taxable income $10000 Box 4 tax $ 2000 ```
10,211
Senator Ted Cruz [said](https://www.washingtonpost.com/news/post-politics/wp/2013/06/03/ted-cruz-abolish-the-irs/) > > I think we ought to abolish the IRS and instead move to a simple flat tax where the average American can fill out taxes on postcard. > > > What are the benefits the supporters of this plan ascribe to it and what are the drawbacks of the plan in the eyes of its opponents?
2016/03/14
[ "https://politics.stackexchange.com/questions/10211", "https://politics.stackexchange.com", "https://politics.stackexchange.com/users/6970/" ]
The "real" pros and cons are extremely complex, but the popular understanding of the plan is roughly as follows: **Pros:** It's fair for everyone because we all pay the same tax rate. No one gets disproportionately burdened or singled out. It's impossible for anyone to game the system or exploit loopholes because it's so simple. It eliminates the cost for the government of maintaining the IRS, saving taxpayers money. Eliminating the progressive tax system lowers taxes for the rich, allowing them to reinvest that money into the economy instead of sending it to the government to be wasted. **Cons:** It removes tax incentives that are economically useful, e.g. encouraging people to start small businesses by giving them tax breaks. Removing tax breaks may also increase the relative tax burden for the middle class, people with families, etc. who are already financially struggling in this economy. Rich people pay less taxes than they do now, and thus don't contribute their fair share to society, despite benefiting immensely from public spending.
Before I get into the implications of the flat tax, let's define [progressive tax](https://en.wikipedia.org/wiki/Progressive_tax) and regressive tax. > > Progressive taxes are imposed in an attempt to reduce the tax incidence of people with a lower ability to pay, as such taxes shift the incidence increasingly to those with a higher ability-to-pay. The opposite of a progressive tax is a regressive tax, where the relative tax rate or burden decreases as an individual's ability to pay increases. > > > The term is frequently applied in reference to personal income taxes, in which people with lower income pay a lower percentage of that income in tax than do those with higher income. It can also apply to adjustments of the tax base by using tax exemptions, tax credits, or selective taxation that creates progressive distribution effects. > > > Implications of progressive taxation include... > Progressive taxation has also been positively associated with happiness, the subjective well-being of nations and citizen satisfaction with public goods, such as education and transportation. > Progressive taxation has a direct effect on reducing income inequality. This is especially true if taxation is used to fund progressive government spending such as transfer payments and social safety nets. > High levels of income inequality can have negative effects on long-term economic growth, employment, and class conflict. > The economists Thomas Piketty and Emmanuel Saez wrote that decreased progressiveness in US tax policy in the post World War II era has increased income inequality by enabling the wealthy greater access to capital. Some citations that follow come from <https://www.investopedia.com/terms/f/flattax.asp> Cons of a flat tax include the fact that it is a more regressive tax than our current tax code. > While a flat tax imposes the same tax percentage on all individuals regardless of income, many see it as a regressive tax. A regressive tax is on which taxes high-income earners at a lower percentage of their income and low-wage earners at a higher rate of their income. The tax is seen as regressive due to a more significant portion of the total funds available to the low-income earner going to the tax expenditure. Note also that Cruz's proposal is a flat tax PLUS deductions. > Typically, a flat tax applies the same tax rate to all taxpayers, with no deductions or exemptions allowed, but some politicians such as Ted Cruz and Rand Paul have proposed flat tax systems that keep certain deductions in place. A flat tax with deductions can be even more regressive than a flat tax with no deductions, since large deductions get utilized more often by wealthier taxpayers. Another feature of flat taxes... > Most flat tax systems or proposals do not tax income from dividends, distributions, capital gains, and other investments. This means that flat taxes only apply to some or none of the income of wealthy citizens who make their income from investment. However, the flat tax applies to ALL of the income of working class citizens who do not have any investments. So the effective tax rate on ALL income is actually lower on wealthy citizens and higher for poorer citizens. This is yet another way that a flat tax is even more regressive than it appears at face value. Since regressive taxes put a greater tax burden on the lower and middle class, they are more likely to hurt consumer spending, which can cause recession, reduced wages, job loss, and falling GDP. Since progressive taxes place a greater burden on the upper class, they are more likely to create ladders of upward [social mobility](https://en.wikipedia.org/wiki/Social_mobility), reduce investment from the wealthy, reduce the growth of large corporations, increase the expansion of small business, and reduce the overall value of the stock market.
10,211
Senator Ted Cruz [said](https://www.washingtonpost.com/news/post-politics/wp/2013/06/03/ted-cruz-abolish-the-irs/) > > I think we ought to abolish the IRS and instead move to a simple flat tax where the average American can fill out taxes on postcard. > > > What are the benefits the supporters of this plan ascribe to it and what are the drawbacks of the plan in the eyes of its opponents?
2016/03/14
[ "https://politics.stackexchange.com/questions/10211", "https://politics.stackexchange.com", "https://politics.stackexchange.com/users/6970/" ]
The "real" pros and cons are extremely complex, but the popular understanding of the plan is roughly as follows: **Pros:** It's fair for everyone because we all pay the same tax rate. No one gets disproportionately burdened or singled out. It's impossible for anyone to game the system or exploit loopholes because it's so simple. It eliminates the cost for the government of maintaining the IRS, saving taxpayers money. Eliminating the progressive tax system lowers taxes for the rich, allowing them to reinvest that money into the economy instead of sending it to the government to be wasted. **Cons:** It removes tax incentives that are economically useful, e.g. encouraging people to start small businesses by giving them tax breaks. Removing tax breaks may also increase the relative tax burden for the middle class, people with families, etc. who are already financially struggling in this economy. Rich people pay less taxes than they do now, and thus don't contribute their fair share to society, despite benefiting immensely from public spending.
> > Senator Ted Cruz said "I think we ought to abolish the IRS and instead > move to a simple flat tax where the average American can fill out > taxes on postcard." What are the benefits the supporters of this plan > ascribe to it and what are the drawbacks of the plan in the eyes of > its opponents? > > > Ted Cruz is being intentionally obtuse when he offers up this slogan. It is a pipe dream that can't meaningfully provide the benefits claimed. A Simple Flat Tax With "Postcard" Returns Can't Abolish The IRS =============================================================== First, somebody has to still prepare, receive and process the postcards, which would take a comparable amount of time to processing efiled tax returns. The "postcard tax return" plan, even in its ideal sense, saves money only on the taxpayer side, not on the government side. Second, the single biggest job of the IRS is forcing people to turn over money to them in cases where people don't pay (even if all taxes are withheld by employers and financial institutions, they have to spend time and money to do the withholding and some government agency has to make sure that they turn over the money they withhold). This job doesn't go away. Third, another very big job of the IRS is to pursue people who provide inaccurate information or untimely information to the IRS that causes their income to be incorrectly reported. Even if they are relying on "postcard returns" prepared based upon information returns of employers and banks and the like, there will still be mistakes and fraud in information return preparation. If your employer files a tax return saying you make $30,000 a year as Vice President of a 10,000 employee corporation, yet you have an expensive yacht and live in a mansion in NYC, somebody needs to audit the employer's information returns to catch this fraud, or widespread fraud will develop. Fourth, someone has to make rules regarding what does and doesn't count as income, whether that is the IRS or some replacement agency. Taxable income is an inherently arbitrary concept. It currently takes two thick books of statutes and six thick books of regulations to define it. Tax regulations are like speeches which as Abraham Lincoln, take more effort to make draft in a short version than to draft in a longer version. So, any effort to abolish the IRS would simply lead to a new agency with precisely the same job with a new name in the same cabinet level department of the United States government (i.e the Treasury Department). Tax Returns Aren't Complicated By Tax Rates That Aren't Flat ============================================================ About 97%+ of the work of preparing a tax return involves figuring out what someone's taxable income is and what tax credits they are entitled to, and only 3% or less of the work involves figuring out how much tax is owed based upon that taxable income. The more income someone earns, the smaller a proportion of the tax preparation time and tax return processing time goes into applying the tax rate to the person's taxable income. Most people just take taxable income and look it up in a table that comes with the form without doing any math at all. Also, calculating the tax due is already optional; you can already elect to let the IRS do that final step for you, if you want. A flat rate primarily leads to redistribution of wealth from low income earners to high income earners, by making the tax system less progressive, but since the progressive marginal tax rate structure is not the source of complexity in preparing income tax returns, eliminating progressive marginal tax rates won't make the tax system any simpler. Taxing all kinds of income at the same rate, rather than providing favorable tax rates for some kinds of income (e.g. corporate profits, long term capital gains, and qualified dividends), can sometimes make the tax system as a whole simpler by eliminating artificial tax incentives to turn income that would be taxed at an unfavorable tax rate into income that is taxed at a favorable tax rate through planning the way that businesses and business transactions are set up for tax purposes. But, the proposal of Ted Cruz and similar U.S. flat tax reformers [isn't truly a flat rate system](https://www.investopedia.com/terms/f/flattax.asp), he actually proposes taxing lots of kinds of investment income at a zero percent rate and earned wage and salary income at a flat rate. So, the need to police arbitrage between different tax rates continues to exist in his plan. In contrast, limiting progressive marginal tax rates on some kinds of income doesn't meaningfully add to the tax planning problem or make taxation more complex. There Is Some Irreducible Complexity In Any Income Tax ====================================================== The taxation of wage and salary earners could be made somewhat simpler by having the IRS send out a presumptive tax return to people (based upon employer prepared W-2s send to the IRS and 1099s from financial institutions sent to the IRS) with few if any deductions or credits. But, for people who take the Standard Deduction (most working class and most middle class families who rent their homes), preparing a tax return is already quite simple, and the credits that make their taxes simpler mostly benefit them and involve only a little more information. A reform of this kind has a strong likelihood of increasing the total tax burden on the low income taxpayers with the least discretionary income. On the other hand, most of the time and complexity of preparing tax returns for business owners and other self-employed people comes from gathering up lots of information on revenue received and expenses paid to determine profits which are the starting point for determining taxable income. But, it is basically impossible to have an income tax on self-employed people and businesses that doesn't require people to collect, summarize and report this information to a tax collection agency which in turn has the power to audit returns to see if they have omitted income or included expenses that aren't legitimate expenses. Similarly, you need rules to tell you went to count particular items of revenue towards income and when to count particular expenses, and someone has to write those rules and enforce them. Caveat: Tax Simplification Is Still A Worthy Cause ================================================== This isn't to say that there is anything wrong, in principle, with finding ways to actually simplify income taxation, or to find ways to reduce tax preparation burdens on taxpayers. The U.S. certainly doesn't have the simplest or least burdensome of all possible income tax systems, and simplification can often also reduce opportunities for tax evasion. For example, even within the U.S., the FICA tax system of the United States has much lower collection costs per dollar of revenue raised than the ordinary federal income tax system. But, no amount of tax simplification can eliminate the need for the IRS or an equivalent agency with a new name, and the kind of steps needed to simplify the tax code involve thousands of little complexities that need to be unraveled one by one in detail, not steps that can be taken in one fell swoop without bankrupting the federal government by eliminating almost all of its income tax revenues (something that even Ted Cruz does not support). It might be possible to make the IRS and the Tax Code a little smaller, but it can't simply be eliminated. Furthermore, the vast majority of true tax simplifications involve reducing barriers to getting tax breaks for the poor and middle class (like simplifying the earned income tax credit and Obamacare Premium Tax Credit) while removing loopholes and credits for businesses and affluent individuals (e.g. removing the complex R&D tax credit and the new passthrough taxation credit which are wildly complex). This is something that Ted Cruz and his supporters would almost certainly oppose in practice.
10,211
Senator Ted Cruz [said](https://www.washingtonpost.com/news/post-politics/wp/2013/06/03/ted-cruz-abolish-the-irs/) > > I think we ought to abolish the IRS and instead move to a simple flat tax where the average American can fill out taxes on postcard. > > > What are the benefits the supporters of this plan ascribe to it and what are the drawbacks of the plan in the eyes of its opponents?
2016/03/14
[ "https://politics.stackexchange.com/questions/10211", "https://politics.stackexchange.com", "https://politics.stackexchange.com/users/6970/" ]
The "real" pros and cons are extremely complex, but the popular understanding of the plan is roughly as follows: **Pros:** It's fair for everyone because we all pay the same tax rate. No one gets disproportionately burdened or singled out. It's impossible for anyone to game the system or exploit loopholes because it's so simple. It eliminates the cost for the government of maintaining the IRS, saving taxpayers money. Eliminating the progressive tax system lowers taxes for the rich, allowing them to reinvest that money into the economy instead of sending it to the government to be wasted. **Cons:** It removes tax incentives that are economically useful, e.g. encouraging people to start small businesses by giving them tax breaks. Removing tax breaks may also increase the relative tax burden for the middle class, people with families, etc. who are already financially struggling in this economy. Rich people pay less taxes than they do now, and thus don't contribute their fair share to society, despite benefiting immensely from public spending.
If you read the entire statement, he's not talking about eliminating the IRS itself, but going to a flat tax... eliminating the various tiers of taxation on income. The idea comes up every so often... but has one fundamental flaw. The US government, like most democratic governments, uses taxes to encourage or discourage actions. They may offer a tax break for a corporation to locate a factory in the US, as opposed to locating it elsewhere. There are tiers of taxation to encourage investment - capital gains tax tends to be lower than tax on wages earned... to encourage investment. Contributions to an IRA defer income tax to when someone isn't earning as much, as in retirement, and will pay less... unless a flat tax is instituted, in which case there is no advantage to contributing to an IRA. A flat tax also negates the concept that people who make more, should pay a higher percentage. The idea is that the country provides the circumstances where they can make more money, so they should give up a higher percentage if they do well. Given that the US remains a leader in innovation and invention, especially in the technical field, the idea that the country provides unique opportunities to make a lot of money is a valid concept. Given that the top five percent of citizens pay nearly half the current income tax revenues, a flat tax would hit the nation's budget balance particularly hard, when it's already well into the red, and has been for decades. For that reason alone, a flat tax would probably never pass congress. A flat tax eliminates a very powerful tool to encourage business and personal behavior, by making that behavior either very inexpensive, or very expensive, as the case may be. Even if a flat tax were passed, it would quickly be picked apart with tax breaks or tax penalties, as the need arises. And the cycle would start all over again. In the end, a flat tax is an election day red herring, that sounds good to a portion of the electorate, but ends up being impractical. Very much like Trump's wall or the free college education of Sanders, or increased immigration of Clinton. Sounds great, until you look into the details of what the actual cost and results would be... but that's another thread.
10,211
Senator Ted Cruz [said](https://www.washingtonpost.com/news/post-politics/wp/2013/06/03/ted-cruz-abolish-the-irs/) > > I think we ought to abolish the IRS and instead move to a simple flat tax where the average American can fill out taxes on postcard. > > > What are the benefits the supporters of this plan ascribe to it and what are the drawbacks of the plan in the eyes of its opponents?
2016/03/14
[ "https://politics.stackexchange.com/questions/10211", "https://politics.stackexchange.com", "https://politics.stackexchange.com/users/6970/" ]
Before I get into the implications of the flat tax, let's define [progressive tax](https://en.wikipedia.org/wiki/Progressive_tax) and regressive tax. > > Progressive taxes are imposed in an attempt to reduce the tax incidence of people with a lower ability to pay, as such taxes shift the incidence increasingly to those with a higher ability-to-pay. The opposite of a progressive tax is a regressive tax, where the relative tax rate or burden decreases as an individual's ability to pay increases. > > > The term is frequently applied in reference to personal income taxes, in which people with lower income pay a lower percentage of that income in tax than do those with higher income. It can also apply to adjustments of the tax base by using tax exemptions, tax credits, or selective taxation that creates progressive distribution effects. > > > Implications of progressive taxation include... > Progressive taxation has also been positively associated with happiness, the subjective well-being of nations and citizen satisfaction with public goods, such as education and transportation. > Progressive taxation has a direct effect on reducing income inequality. This is especially true if taxation is used to fund progressive government spending such as transfer payments and social safety nets. > High levels of income inequality can have negative effects on long-term economic growth, employment, and class conflict. > The economists Thomas Piketty and Emmanuel Saez wrote that decreased progressiveness in US tax policy in the post World War II era has increased income inequality by enabling the wealthy greater access to capital. Some citations that follow come from <https://www.investopedia.com/terms/f/flattax.asp> Cons of a flat tax include the fact that it is a more regressive tax than our current tax code. > While a flat tax imposes the same tax percentage on all individuals regardless of income, many see it as a regressive tax. A regressive tax is on which taxes high-income earners at a lower percentage of their income and low-wage earners at a higher rate of their income. The tax is seen as regressive due to a more significant portion of the total funds available to the low-income earner going to the tax expenditure. Note also that Cruz's proposal is a flat tax PLUS deductions. > Typically, a flat tax applies the same tax rate to all taxpayers, with no deductions or exemptions allowed, but some politicians such as Ted Cruz and Rand Paul have proposed flat tax systems that keep certain deductions in place. A flat tax with deductions can be even more regressive than a flat tax with no deductions, since large deductions get utilized more often by wealthier taxpayers. Another feature of flat taxes... > Most flat tax systems or proposals do not tax income from dividends, distributions, capital gains, and other investments. This means that flat taxes only apply to some or none of the income of wealthy citizens who make their income from investment. However, the flat tax applies to ALL of the income of working class citizens who do not have any investments. So the effective tax rate on ALL income is actually lower on wealthy citizens and higher for poorer citizens. This is yet another way that a flat tax is even more regressive than it appears at face value. Since regressive taxes put a greater tax burden on the lower and middle class, they are more likely to hurt consumer spending, which can cause recession, reduced wages, job loss, and falling GDP. Since progressive taxes place a greater burden on the upper class, they are more likely to create ladders of upward [social mobility](https://en.wikipedia.org/wiki/Social_mobility), reduce investment from the wealthy, reduce the growth of large corporations, increase the expansion of small business, and reduce the overall value of the stock market.
The usually overlooked advantage is that the cost of collecting the tax is significantly reduced by such a system. Guesstimates currently place the cost of collecting one spendable tax dollar at over $5. Reducing that cost by even 20% means that there is an additional dollar in the economy for every single tax dollar that can be spent. The IRS budget is currently over $11 billion dollars, and many times that amount is spent on tax lawyers. The costs to individuals and companies involved in calculating, collecting, auditing and paying taxes are all significant and are often more then the actual tax bill. This is just draining resources out of the economy to nobodies advantage. The simplest and fairest system that I have heard of is called the fixed base flat rate. The government already publishes the Federal poverty level income. Every taxable entity gets to deduct twice that amount from their gross taxable income and they a flat rate of the remaining income as tax. So what should the rate be? The 2017 US GDP was just under $20 trillion and the federal budget was ~$4trillion (20%). The tax take was $3.3trillion (the difference adds to the national debt), so I suggest start at a flat 20% and let the cost savings reduce the national debt. ``` Box 1, gross taxable income, Box 2 poverty level * 2, Box 3, taxable income (box1 - box2) Box 4, tax (Box3 times 0.20) ``` Example1 - Income $65,000 ``` Box 1 Gross income $65000 Box 2 poverty level $12,486 * 2 $25000 Box 3 taxable income $40000 Box 4 tax $ 8000 ``` Example2 - Income $650,000 ``` Box 1 Gross income $650000 Box 2 poverty level $12,486 * 2 $ 25000 Box 3 taxable income $625000 Box 4 tax $125000 ``` Example3 - Income $6,500,000 ``` Box 1 Gross income $6500000 Box 2 poverty level $12,486 * 2 $ 25000 Box 3 taxable income $6475000 Box 4 tax $1295000 ``` Example4 - Income $35,000 ``` Box 1 Gross income $35000 Box 2 poverty level $12,486 * 2 $25000 Box 3 taxable income $10000 Box 4 tax $ 2000 ```
10,211
Senator Ted Cruz [said](https://www.washingtonpost.com/news/post-politics/wp/2013/06/03/ted-cruz-abolish-the-irs/) > > I think we ought to abolish the IRS and instead move to a simple flat tax where the average American can fill out taxes on postcard. > > > What are the benefits the supporters of this plan ascribe to it and what are the drawbacks of the plan in the eyes of its opponents?
2016/03/14
[ "https://politics.stackexchange.com/questions/10211", "https://politics.stackexchange.com", "https://politics.stackexchange.com/users/6970/" ]
> > Senator Ted Cruz said "I think we ought to abolish the IRS and instead > move to a simple flat tax where the average American can fill out > taxes on postcard." What are the benefits the supporters of this plan > ascribe to it and what are the drawbacks of the plan in the eyes of > its opponents? > > > Ted Cruz is being intentionally obtuse when he offers up this slogan. It is a pipe dream that can't meaningfully provide the benefits claimed. A Simple Flat Tax With "Postcard" Returns Can't Abolish The IRS =============================================================== First, somebody has to still prepare, receive and process the postcards, which would take a comparable amount of time to processing efiled tax returns. The "postcard tax return" plan, even in its ideal sense, saves money only on the taxpayer side, not on the government side. Second, the single biggest job of the IRS is forcing people to turn over money to them in cases where people don't pay (even if all taxes are withheld by employers and financial institutions, they have to spend time and money to do the withholding and some government agency has to make sure that they turn over the money they withhold). This job doesn't go away. Third, another very big job of the IRS is to pursue people who provide inaccurate information or untimely information to the IRS that causes their income to be incorrectly reported. Even if they are relying on "postcard returns" prepared based upon information returns of employers and banks and the like, there will still be mistakes and fraud in information return preparation. If your employer files a tax return saying you make $30,000 a year as Vice President of a 10,000 employee corporation, yet you have an expensive yacht and live in a mansion in NYC, somebody needs to audit the employer's information returns to catch this fraud, or widespread fraud will develop. Fourth, someone has to make rules regarding what does and doesn't count as income, whether that is the IRS or some replacement agency. Taxable income is an inherently arbitrary concept. It currently takes two thick books of statutes and six thick books of regulations to define it. Tax regulations are like speeches which as Abraham Lincoln, take more effort to make draft in a short version than to draft in a longer version. So, any effort to abolish the IRS would simply lead to a new agency with precisely the same job with a new name in the same cabinet level department of the United States government (i.e the Treasury Department). Tax Returns Aren't Complicated By Tax Rates That Aren't Flat ============================================================ About 97%+ of the work of preparing a tax return involves figuring out what someone's taxable income is and what tax credits they are entitled to, and only 3% or less of the work involves figuring out how much tax is owed based upon that taxable income. The more income someone earns, the smaller a proportion of the tax preparation time and tax return processing time goes into applying the tax rate to the person's taxable income. Most people just take taxable income and look it up in a table that comes with the form without doing any math at all. Also, calculating the tax due is already optional; you can already elect to let the IRS do that final step for you, if you want. A flat rate primarily leads to redistribution of wealth from low income earners to high income earners, by making the tax system less progressive, but since the progressive marginal tax rate structure is not the source of complexity in preparing income tax returns, eliminating progressive marginal tax rates won't make the tax system any simpler. Taxing all kinds of income at the same rate, rather than providing favorable tax rates for some kinds of income (e.g. corporate profits, long term capital gains, and qualified dividends), can sometimes make the tax system as a whole simpler by eliminating artificial tax incentives to turn income that would be taxed at an unfavorable tax rate into income that is taxed at a favorable tax rate through planning the way that businesses and business transactions are set up for tax purposes. But, the proposal of Ted Cruz and similar U.S. flat tax reformers [isn't truly a flat rate system](https://www.investopedia.com/terms/f/flattax.asp), he actually proposes taxing lots of kinds of investment income at a zero percent rate and earned wage and salary income at a flat rate. So, the need to police arbitrage between different tax rates continues to exist in his plan. In contrast, limiting progressive marginal tax rates on some kinds of income doesn't meaningfully add to the tax planning problem or make taxation more complex. There Is Some Irreducible Complexity In Any Income Tax ====================================================== The taxation of wage and salary earners could be made somewhat simpler by having the IRS send out a presumptive tax return to people (based upon employer prepared W-2s send to the IRS and 1099s from financial institutions sent to the IRS) with few if any deductions or credits. But, for people who take the Standard Deduction (most working class and most middle class families who rent their homes), preparing a tax return is already quite simple, and the credits that make their taxes simpler mostly benefit them and involve only a little more information. A reform of this kind has a strong likelihood of increasing the total tax burden on the low income taxpayers with the least discretionary income. On the other hand, most of the time and complexity of preparing tax returns for business owners and other self-employed people comes from gathering up lots of information on revenue received and expenses paid to determine profits which are the starting point for determining taxable income. But, it is basically impossible to have an income tax on self-employed people and businesses that doesn't require people to collect, summarize and report this information to a tax collection agency which in turn has the power to audit returns to see if they have omitted income or included expenses that aren't legitimate expenses. Similarly, you need rules to tell you went to count particular items of revenue towards income and when to count particular expenses, and someone has to write those rules and enforce them. Caveat: Tax Simplification Is Still A Worthy Cause ================================================== This isn't to say that there is anything wrong, in principle, with finding ways to actually simplify income taxation, or to find ways to reduce tax preparation burdens on taxpayers. The U.S. certainly doesn't have the simplest or least burdensome of all possible income tax systems, and simplification can often also reduce opportunities for tax evasion. For example, even within the U.S., the FICA tax system of the United States has much lower collection costs per dollar of revenue raised than the ordinary federal income tax system. But, no amount of tax simplification can eliminate the need for the IRS or an equivalent agency with a new name, and the kind of steps needed to simplify the tax code involve thousands of little complexities that need to be unraveled one by one in detail, not steps that can be taken in one fell swoop without bankrupting the federal government by eliminating almost all of its income tax revenues (something that even Ted Cruz does not support). It might be possible to make the IRS and the Tax Code a little smaller, but it can't simply be eliminated. Furthermore, the vast majority of true tax simplifications involve reducing barriers to getting tax breaks for the poor and middle class (like simplifying the earned income tax credit and Obamacare Premium Tax Credit) while removing loopholes and credits for businesses and affluent individuals (e.g. removing the complex R&D tax credit and the new passthrough taxation credit which are wildly complex). This is something that Ted Cruz and his supporters would almost certainly oppose in practice.
The usually overlooked advantage is that the cost of collecting the tax is significantly reduced by such a system. Guesstimates currently place the cost of collecting one spendable tax dollar at over $5. Reducing that cost by even 20% means that there is an additional dollar in the economy for every single tax dollar that can be spent. The IRS budget is currently over $11 billion dollars, and many times that amount is spent on tax lawyers. The costs to individuals and companies involved in calculating, collecting, auditing and paying taxes are all significant and are often more then the actual tax bill. This is just draining resources out of the economy to nobodies advantage. The simplest and fairest system that I have heard of is called the fixed base flat rate. The government already publishes the Federal poverty level income. Every taxable entity gets to deduct twice that amount from their gross taxable income and they a flat rate of the remaining income as tax. So what should the rate be? The 2017 US GDP was just under $20 trillion and the federal budget was ~$4trillion (20%). The tax take was $3.3trillion (the difference adds to the national debt), so I suggest start at a flat 20% and let the cost savings reduce the national debt. ``` Box 1, gross taxable income, Box 2 poverty level * 2, Box 3, taxable income (box1 - box2) Box 4, tax (Box3 times 0.20) ``` Example1 - Income $65,000 ``` Box 1 Gross income $65000 Box 2 poverty level $12,486 * 2 $25000 Box 3 taxable income $40000 Box 4 tax $ 8000 ``` Example2 - Income $650,000 ``` Box 1 Gross income $650000 Box 2 poverty level $12,486 * 2 $ 25000 Box 3 taxable income $625000 Box 4 tax $125000 ``` Example3 - Income $6,500,000 ``` Box 1 Gross income $6500000 Box 2 poverty level $12,486 * 2 $ 25000 Box 3 taxable income $6475000 Box 4 tax $1295000 ``` Example4 - Income $35,000 ``` Box 1 Gross income $35000 Box 2 poverty level $12,486 * 2 $25000 Box 3 taxable income $10000 Box 4 tax $ 2000 ```
10,211
Senator Ted Cruz [said](https://www.washingtonpost.com/news/post-politics/wp/2013/06/03/ted-cruz-abolish-the-irs/) > > I think we ought to abolish the IRS and instead move to a simple flat tax where the average American can fill out taxes on postcard. > > > What are the benefits the supporters of this plan ascribe to it and what are the drawbacks of the plan in the eyes of its opponents?
2016/03/14
[ "https://politics.stackexchange.com/questions/10211", "https://politics.stackexchange.com", "https://politics.stackexchange.com/users/6970/" ]
If you read the entire statement, he's not talking about eliminating the IRS itself, but going to a flat tax... eliminating the various tiers of taxation on income. The idea comes up every so often... but has one fundamental flaw. The US government, like most democratic governments, uses taxes to encourage or discourage actions. They may offer a tax break for a corporation to locate a factory in the US, as opposed to locating it elsewhere. There are tiers of taxation to encourage investment - capital gains tax tends to be lower than tax on wages earned... to encourage investment. Contributions to an IRA defer income tax to when someone isn't earning as much, as in retirement, and will pay less... unless a flat tax is instituted, in which case there is no advantage to contributing to an IRA. A flat tax also negates the concept that people who make more, should pay a higher percentage. The idea is that the country provides the circumstances where they can make more money, so they should give up a higher percentage if they do well. Given that the US remains a leader in innovation and invention, especially in the technical field, the idea that the country provides unique opportunities to make a lot of money is a valid concept. Given that the top five percent of citizens pay nearly half the current income tax revenues, a flat tax would hit the nation's budget balance particularly hard, when it's already well into the red, and has been for decades. For that reason alone, a flat tax would probably never pass congress. A flat tax eliminates a very powerful tool to encourage business and personal behavior, by making that behavior either very inexpensive, or very expensive, as the case may be. Even if a flat tax were passed, it would quickly be picked apart with tax breaks or tax penalties, as the need arises. And the cycle would start all over again. In the end, a flat tax is an election day red herring, that sounds good to a portion of the electorate, but ends up being impractical. Very much like Trump's wall or the free college education of Sanders, or increased immigration of Clinton. Sounds great, until you look into the details of what the actual cost and results would be... but that's another thread.
The usually overlooked advantage is that the cost of collecting the tax is significantly reduced by such a system. Guesstimates currently place the cost of collecting one spendable tax dollar at over $5. Reducing that cost by even 20% means that there is an additional dollar in the economy for every single tax dollar that can be spent. The IRS budget is currently over $11 billion dollars, and many times that amount is spent on tax lawyers. The costs to individuals and companies involved in calculating, collecting, auditing and paying taxes are all significant and are often more then the actual tax bill. This is just draining resources out of the economy to nobodies advantage. The simplest and fairest system that I have heard of is called the fixed base flat rate. The government already publishes the Federal poverty level income. Every taxable entity gets to deduct twice that amount from their gross taxable income and they a flat rate of the remaining income as tax. So what should the rate be? The 2017 US GDP was just under $20 trillion and the federal budget was ~$4trillion (20%). The tax take was $3.3trillion (the difference adds to the national debt), so I suggest start at a flat 20% and let the cost savings reduce the national debt. ``` Box 1, gross taxable income, Box 2 poverty level * 2, Box 3, taxable income (box1 - box2) Box 4, tax (Box3 times 0.20) ``` Example1 - Income $65,000 ``` Box 1 Gross income $65000 Box 2 poverty level $12,486 * 2 $25000 Box 3 taxable income $40000 Box 4 tax $ 8000 ``` Example2 - Income $650,000 ``` Box 1 Gross income $650000 Box 2 poverty level $12,486 * 2 $ 25000 Box 3 taxable income $625000 Box 4 tax $125000 ``` Example3 - Income $6,500,000 ``` Box 1 Gross income $6500000 Box 2 poverty level $12,486 * 2 $ 25000 Box 3 taxable income $6475000 Box 4 tax $1295000 ``` Example4 - Income $35,000 ``` Box 1 Gross income $35000 Box 2 poverty level $12,486 * 2 $25000 Box 3 taxable income $10000 Box 4 tax $ 2000 ```
10,211
Senator Ted Cruz [said](https://www.washingtonpost.com/news/post-politics/wp/2013/06/03/ted-cruz-abolish-the-irs/) > > I think we ought to abolish the IRS and instead move to a simple flat tax where the average American can fill out taxes on postcard. > > > What are the benefits the supporters of this plan ascribe to it and what are the drawbacks of the plan in the eyes of its opponents?
2016/03/14
[ "https://politics.stackexchange.com/questions/10211", "https://politics.stackexchange.com", "https://politics.stackexchange.com/users/6970/" ]
Before I get into the implications of the flat tax, let's define [progressive tax](https://en.wikipedia.org/wiki/Progressive_tax) and regressive tax. > > Progressive taxes are imposed in an attempt to reduce the tax incidence of people with a lower ability to pay, as such taxes shift the incidence increasingly to those with a higher ability-to-pay. The opposite of a progressive tax is a regressive tax, where the relative tax rate or burden decreases as an individual's ability to pay increases. > > > The term is frequently applied in reference to personal income taxes, in which people with lower income pay a lower percentage of that income in tax than do those with higher income. It can also apply to adjustments of the tax base by using tax exemptions, tax credits, or selective taxation that creates progressive distribution effects. > > > Implications of progressive taxation include... > Progressive taxation has also been positively associated with happiness, the subjective well-being of nations and citizen satisfaction with public goods, such as education and transportation. > Progressive taxation has a direct effect on reducing income inequality. This is especially true if taxation is used to fund progressive government spending such as transfer payments and social safety nets. > High levels of income inequality can have negative effects on long-term economic growth, employment, and class conflict. > The economists Thomas Piketty and Emmanuel Saez wrote that decreased progressiveness in US tax policy in the post World War II era has increased income inequality by enabling the wealthy greater access to capital. Some citations that follow come from <https://www.investopedia.com/terms/f/flattax.asp> Cons of a flat tax include the fact that it is a more regressive tax than our current tax code. > While a flat tax imposes the same tax percentage on all individuals regardless of income, many see it as a regressive tax. A regressive tax is on which taxes high-income earners at a lower percentage of their income and low-wage earners at a higher rate of their income. The tax is seen as regressive due to a more significant portion of the total funds available to the low-income earner going to the tax expenditure. Note also that Cruz's proposal is a flat tax PLUS deductions. > Typically, a flat tax applies the same tax rate to all taxpayers, with no deductions or exemptions allowed, but some politicians such as Ted Cruz and Rand Paul have proposed flat tax systems that keep certain deductions in place. A flat tax with deductions can be even more regressive than a flat tax with no deductions, since large deductions get utilized more often by wealthier taxpayers. Another feature of flat taxes... > Most flat tax systems or proposals do not tax income from dividends, distributions, capital gains, and other investments. This means that flat taxes only apply to some or none of the income of wealthy citizens who make their income from investment. However, the flat tax applies to ALL of the income of working class citizens who do not have any investments. So the effective tax rate on ALL income is actually lower on wealthy citizens and higher for poorer citizens. This is yet another way that a flat tax is even more regressive than it appears at face value. Since regressive taxes put a greater tax burden on the lower and middle class, they are more likely to hurt consumer spending, which can cause recession, reduced wages, job loss, and falling GDP. Since progressive taxes place a greater burden on the upper class, they are more likely to create ladders of upward [social mobility](https://en.wikipedia.org/wiki/Social_mobility), reduce investment from the wealthy, reduce the growth of large corporations, increase the expansion of small business, and reduce the overall value of the stock market.
If you read the entire statement, he's not talking about eliminating the IRS itself, but going to a flat tax... eliminating the various tiers of taxation on income. The idea comes up every so often... but has one fundamental flaw. The US government, like most democratic governments, uses taxes to encourage or discourage actions. They may offer a tax break for a corporation to locate a factory in the US, as opposed to locating it elsewhere. There are tiers of taxation to encourage investment - capital gains tax tends to be lower than tax on wages earned... to encourage investment. Contributions to an IRA defer income tax to when someone isn't earning as much, as in retirement, and will pay less... unless a flat tax is instituted, in which case there is no advantage to contributing to an IRA. A flat tax also negates the concept that people who make more, should pay a higher percentage. The idea is that the country provides the circumstances where they can make more money, so they should give up a higher percentage if they do well. Given that the US remains a leader in innovation and invention, especially in the technical field, the idea that the country provides unique opportunities to make a lot of money is a valid concept. Given that the top five percent of citizens pay nearly half the current income tax revenues, a flat tax would hit the nation's budget balance particularly hard, when it's already well into the red, and has been for decades. For that reason alone, a flat tax would probably never pass congress. A flat tax eliminates a very powerful tool to encourage business and personal behavior, by making that behavior either very inexpensive, or very expensive, as the case may be. Even if a flat tax were passed, it would quickly be picked apart with tax breaks or tax penalties, as the need arises. And the cycle would start all over again. In the end, a flat tax is an election day red herring, that sounds good to a portion of the electorate, but ends up being impractical. Very much like Trump's wall or the free college education of Sanders, or increased immigration of Clinton. Sounds great, until you look into the details of what the actual cost and results would be... but that's another thread.
10,211
Senator Ted Cruz [said](https://www.washingtonpost.com/news/post-politics/wp/2013/06/03/ted-cruz-abolish-the-irs/) > > I think we ought to abolish the IRS and instead move to a simple flat tax where the average American can fill out taxes on postcard. > > > What are the benefits the supporters of this plan ascribe to it and what are the drawbacks of the plan in the eyes of its opponents?
2016/03/14
[ "https://politics.stackexchange.com/questions/10211", "https://politics.stackexchange.com", "https://politics.stackexchange.com/users/6970/" ]
> > Senator Ted Cruz said "I think we ought to abolish the IRS and instead > move to a simple flat tax where the average American can fill out > taxes on postcard." What are the benefits the supporters of this plan > ascribe to it and what are the drawbacks of the plan in the eyes of > its opponents? > > > Ted Cruz is being intentionally obtuse when he offers up this slogan. It is a pipe dream that can't meaningfully provide the benefits claimed. A Simple Flat Tax With "Postcard" Returns Can't Abolish The IRS =============================================================== First, somebody has to still prepare, receive and process the postcards, which would take a comparable amount of time to processing efiled tax returns. The "postcard tax return" plan, even in its ideal sense, saves money only on the taxpayer side, not on the government side. Second, the single biggest job of the IRS is forcing people to turn over money to them in cases where people don't pay (even if all taxes are withheld by employers and financial institutions, they have to spend time and money to do the withholding and some government agency has to make sure that they turn over the money they withhold). This job doesn't go away. Third, another very big job of the IRS is to pursue people who provide inaccurate information or untimely information to the IRS that causes their income to be incorrectly reported. Even if they are relying on "postcard returns" prepared based upon information returns of employers and banks and the like, there will still be mistakes and fraud in information return preparation. If your employer files a tax return saying you make $30,000 a year as Vice President of a 10,000 employee corporation, yet you have an expensive yacht and live in a mansion in NYC, somebody needs to audit the employer's information returns to catch this fraud, or widespread fraud will develop. Fourth, someone has to make rules regarding what does and doesn't count as income, whether that is the IRS or some replacement agency. Taxable income is an inherently arbitrary concept. It currently takes two thick books of statutes and six thick books of regulations to define it. Tax regulations are like speeches which as Abraham Lincoln, take more effort to make draft in a short version than to draft in a longer version. So, any effort to abolish the IRS would simply lead to a new agency with precisely the same job with a new name in the same cabinet level department of the United States government (i.e the Treasury Department). Tax Returns Aren't Complicated By Tax Rates That Aren't Flat ============================================================ About 97%+ of the work of preparing a tax return involves figuring out what someone's taxable income is and what tax credits they are entitled to, and only 3% or less of the work involves figuring out how much tax is owed based upon that taxable income. The more income someone earns, the smaller a proportion of the tax preparation time and tax return processing time goes into applying the tax rate to the person's taxable income. Most people just take taxable income and look it up in a table that comes with the form without doing any math at all. Also, calculating the tax due is already optional; you can already elect to let the IRS do that final step for you, if you want. A flat rate primarily leads to redistribution of wealth from low income earners to high income earners, by making the tax system less progressive, but since the progressive marginal tax rate structure is not the source of complexity in preparing income tax returns, eliminating progressive marginal tax rates won't make the tax system any simpler. Taxing all kinds of income at the same rate, rather than providing favorable tax rates for some kinds of income (e.g. corporate profits, long term capital gains, and qualified dividends), can sometimes make the tax system as a whole simpler by eliminating artificial tax incentives to turn income that would be taxed at an unfavorable tax rate into income that is taxed at a favorable tax rate through planning the way that businesses and business transactions are set up for tax purposes. But, the proposal of Ted Cruz and similar U.S. flat tax reformers [isn't truly a flat rate system](https://www.investopedia.com/terms/f/flattax.asp), he actually proposes taxing lots of kinds of investment income at a zero percent rate and earned wage and salary income at a flat rate. So, the need to police arbitrage between different tax rates continues to exist in his plan. In contrast, limiting progressive marginal tax rates on some kinds of income doesn't meaningfully add to the tax planning problem or make taxation more complex. There Is Some Irreducible Complexity In Any Income Tax ====================================================== The taxation of wage and salary earners could be made somewhat simpler by having the IRS send out a presumptive tax return to people (based upon employer prepared W-2s send to the IRS and 1099s from financial institutions sent to the IRS) with few if any deductions or credits. But, for people who take the Standard Deduction (most working class and most middle class families who rent their homes), preparing a tax return is already quite simple, and the credits that make their taxes simpler mostly benefit them and involve only a little more information. A reform of this kind has a strong likelihood of increasing the total tax burden on the low income taxpayers with the least discretionary income. On the other hand, most of the time and complexity of preparing tax returns for business owners and other self-employed people comes from gathering up lots of information on revenue received and expenses paid to determine profits which are the starting point for determining taxable income. But, it is basically impossible to have an income tax on self-employed people and businesses that doesn't require people to collect, summarize and report this information to a tax collection agency which in turn has the power to audit returns to see if they have omitted income or included expenses that aren't legitimate expenses. Similarly, you need rules to tell you went to count particular items of revenue towards income and when to count particular expenses, and someone has to write those rules and enforce them. Caveat: Tax Simplification Is Still A Worthy Cause ================================================== This isn't to say that there is anything wrong, in principle, with finding ways to actually simplify income taxation, or to find ways to reduce tax preparation burdens on taxpayers. The U.S. certainly doesn't have the simplest or least burdensome of all possible income tax systems, and simplification can often also reduce opportunities for tax evasion. For example, even within the U.S., the FICA tax system of the United States has much lower collection costs per dollar of revenue raised than the ordinary federal income tax system. But, no amount of tax simplification can eliminate the need for the IRS or an equivalent agency with a new name, and the kind of steps needed to simplify the tax code involve thousands of little complexities that need to be unraveled one by one in detail, not steps that can be taken in one fell swoop without bankrupting the federal government by eliminating almost all of its income tax revenues (something that even Ted Cruz does not support). It might be possible to make the IRS and the Tax Code a little smaller, but it can't simply be eliminated. Furthermore, the vast majority of true tax simplifications involve reducing barriers to getting tax breaks for the poor and middle class (like simplifying the earned income tax credit and Obamacare Premium Tax Credit) while removing loopholes and credits for businesses and affluent individuals (e.g. removing the complex R&D tax credit and the new passthrough taxation credit which are wildly complex). This is something that Ted Cruz and his supporters would almost certainly oppose in practice.
If you read the entire statement, he's not talking about eliminating the IRS itself, but going to a flat tax... eliminating the various tiers of taxation on income. The idea comes up every so often... but has one fundamental flaw. The US government, like most democratic governments, uses taxes to encourage or discourage actions. They may offer a tax break for a corporation to locate a factory in the US, as opposed to locating it elsewhere. There are tiers of taxation to encourage investment - capital gains tax tends to be lower than tax on wages earned... to encourage investment. Contributions to an IRA defer income tax to when someone isn't earning as much, as in retirement, and will pay less... unless a flat tax is instituted, in which case there is no advantage to contributing to an IRA. A flat tax also negates the concept that people who make more, should pay a higher percentage. The idea is that the country provides the circumstances where they can make more money, so they should give up a higher percentage if they do well. Given that the US remains a leader in innovation and invention, especially in the technical field, the idea that the country provides unique opportunities to make a lot of money is a valid concept. Given that the top five percent of citizens pay nearly half the current income tax revenues, a flat tax would hit the nation's budget balance particularly hard, when it's already well into the red, and has been for decades. For that reason alone, a flat tax would probably never pass congress. A flat tax eliminates a very powerful tool to encourage business and personal behavior, by making that behavior either very inexpensive, or very expensive, as the case may be. Even if a flat tax were passed, it would quickly be picked apart with tax breaks or tax penalties, as the need arises. And the cycle would start all over again. In the end, a flat tax is an election day red herring, that sounds good to a portion of the electorate, but ends up being impractical. Very much like Trump's wall or the free college education of Sanders, or increased immigration of Clinton. Sounds great, until you look into the details of what the actual cost and results would be... but that's another thread.
114,381
I don't remember much, but I recall reading a book with three short sci-fi stories like 20 years ago from my old school library. I just remember that one of the stories took place on the moon or some asteroid and the main character had some kind of encounter with some kind of ghosts/clones. Maybe another of the stories had something to do with Jupiter, but I am not sure at all. The title could be something like "Title of the first story" + "And another two stories", but not sure either. Sorry not having more details but it is being a long time and I just wanted to try here if there was any luck.
2016/01/10
[ "https://scifi.stackexchange.com/questions/114381", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/59065/" ]
[The Gods Themselves](https://en.wikipedia.org/wiki/The_Gods_Themselves) by Isaac Asimov? The book has three seemingly unrelated stories that turn out to be closely related to each other. The second story is set in a parallel universe where matter is able to pass through other matter, so some of the creatures are ghost-like. The third story is set on the moon. While it doesn't involve clones, it does involve genetic engineering. Even if it isn't the book you are thinking of it, go read it! It is a great book. Dr A wrote that it was his favourite novel. His very last story, "Gold" references the second story.
Kind of a shot in the dark, but maybe *The New Atlantis and Other Novellas of Science Fiction*? My limited evidence: 1) It does have exactly three stories 2) It is titled "story name and other stories" 3) The first story, Gene Wolfe's "Silhouette", does have to do with a ghost-like figure 4) It was published in 1975, so it's old enough to have been read "20 years ago"
36,965,553
Is there any difference between following two methods? Which one is preferable and why? Prg1: ``` public static boolean test() throws Exception { try { doSomething(); return true; } catch (Exception e) { throw new Exception("No!"); } } ``` Prg2: ``` public static boolean test() throws Exception { try { doSomething(); } catch (Exception e) { throw new Exception("No!"); } return true; } ```
2016/05/01
[ "https://Stackoverflow.com/questions/36965553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6228520/" ]
Nope there is no difference between both the methods. It will return true value in both the cases effectively by resuming the flow of the program as soon an and exception is handled. Catch will be accessed only when an exception occurs.
There is no difference, but the first Prg1 is faster than the Prg2.
36,965,553
Is there any difference between following two methods? Which one is preferable and why? Prg1: ``` public static boolean test() throws Exception { try { doSomething(); return true; } catch (Exception e) { throw new Exception("No!"); } } ``` Prg2: ``` public static boolean test() throws Exception { try { doSomething(); } catch (Exception e) { throw new Exception("No!"); } return true; } ```
2016/05/01
[ "https://Stackoverflow.com/questions/36965553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6228520/" ]
Consider these cases where you're not returning a constant expression: Case 1: ``` public static Val test() throws Exception { try { return doSomething(); } catch (Exception e) { throw new Exception("No!"); } // Unreachable code goes here } ``` Case 2: ``` public static Val test() throws Exception { Val toReturn = null; try { toReturn = doSomething(); } catch (Exception e) { throw new Exception("No!"); } return toReturn; } ``` I would prefer the first one. The second is more verbose and might cause some confusion when debugging. If `test()` incorrectly returns `null`, and you see `toReturn` being initialized to `null`, you might think the problem is in `test()` (especially when `test()` is not just a simple example like this). Even though it can only return `null` if `doSomething` returns `null`. But that might be hard to see at a glance. --- You could then argue that, for consistency's sake, it's better to *always* use the first form.
Nope there is no difference between both the methods. It will return true value in both the cases effectively by resuming the flow of the program as soon an and exception is handled. Catch will be accessed only when an exception occurs.
36,965,553
Is there any difference between following two methods? Which one is preferable and why? Prg1: ``` public static boolean test() throws Exception { try { doSomething(); return true; } catch (Exception e) { throw new Exception("No!"); } } ``` Prg2: ``` public static boolean test() throws Exception { try { doSomething(); } catch (Exception e) { throw new Exception("No!"); } return true; } ```
2016/05/01
[ "https://Stackoverflow.com/questions/36965553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6228520/" ]
Consider these cases where you're not returning a constant expression: Case 1: ``` public static Val test() throws Exception { try { return doSomething(); } catch (Exception e) { throw new Exception("No!"); } // Unreachable code goes here } ``` Case 2: ``` public static Val test() throws Exception { Val toReturn = null; try { toReturn = doSomething(); } catch (Exception e) { throw new Exception("No!"); } return toReturn; } ``` I would prefer the first one. The second is more verbose and might cause some confusion when debugging. If `test()` incorrectly returns `null`, and you see `toReturn` being initialized to `null`, you might think the problem is in `test()` (especially when `test()` is not just a simple example like this). Even though it can only return `null` if `doSomething` returns `null`. But that might be hard to see at a glance. --- You could then argue that, for consistency's sake, it's better to *always* use the first form.
There is no difference, but the first Prg1 is faster than the Prg2.
36,965,553
Is there any difference between following two methods? Which one is preferable and why? Prg1: ``` public static boolean test() throws Exception { try { doSomething(); return true; } catch (Exception e) { throw new Exception("No!"); } } ``` Prg2: ``` public static boolean test() throws Exception { try { doSomething(); } catch (Exception e) { throw new Exception("No!"); } return true; } ```
2016/05/01
[ "https://Stackoverflow.com/questions/36965553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6228520/" ]
*I'm assuming this is a general question. Otherwise I might comment on other aspects of your method(s).* I think in the case or small methods like these it doesn't really matter. The method is short enough to understand immediately what's going on, what's related to what etc. However, in the case of longer methods the flow is much easier to follow in the first example. *In my opinion*. It keeps together related code and related scenarios. When you're reading the method, the normal execution flow is not broken by the `catch` block, making it more obvious and "fluent". ``` public static boolean test() throws Exception { try { doSomething(); return true; } catch (Exception e) { throw new Exception("No!"); } } ``` But I won't generalize this for all methods; it's all about the context.
There is no difference, but the first Prg1 is faster than the Prg2.
36,965,553
Is there any difference between following two methods? Which one is preferable and why? Prg1: ``` public static boolean test() throws Exception { try { doSomething(); return true; } catch (Exception e) { throw new Exception("No!"); } } ``` Prg2: ``` public static boolean test() throws Exception { try { doSomething(); } catch (Exception e) { throw new Exception("No!"); } return true; } ```
2016/05/01
[ "https://Stackoverflow.com/questions/36965553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6228520/" ]
Consider these cases where you're not returning a constant expression: Case 1: ``` public static Val test() throws Exception { try { return doSomething(); } catch (Exception e) { throw new Exception("No!"); } // Unreachable code goes here } ``` Case 2: ``` public static Val test() throws Exception { Val toReturn = null; try { toReturn = doSomething(); } catch (Exception e) { throw new Exception("No!"); } return toReturn; } ``` I would prefer the first one. The second is more verbose and might cause some confusion when debugging. If `test()` incorrectly returns `null`, and you see `toReturn` being initialized to `null`, you might think the problem is in `test()` (especially when `test()` is not just a simple example like this). Even though it can only return `null` if `doSomething` returns `null`. But that might be hard to see at a glance. --- You could then argue that, for consistency's sake, it's better to *always* use the first form.
*I'm assuming this is a general question. Otherwise I might comment on other aspects of your method(s).* I think in the case or small methods like these it doesn't really matter. The method is short enough to understand immediately what's going on, what's related to what etc. However, in the case of longer methods the flow is much easier to follow in the first example. *In my opinion*. It keeps together related code and related scenarios. When you're reading the method, the normal execution flow is not broken by the `catch` block, making it more obvious and "fluent". ``` public static boolean test() throws Exception { try { doSomething(); return true; } catch (Exception e) { throw new Exception("No!"); } } ``` But I won't generalize this for all methods; it's all about the context.
42,760,243
i was trying to follow [this](https://laravel.com/docs/5.1/quickstart#installation) tutorial on Laravel, even though most of the code & directories there were outdated, i managed to make the "Add Task" and also The Form to show up after a few errors. now the problem, the delete button. when i click on it, it shows a "MethodNotAllowedHttpException". i changed the source code to match the newest version of Laravel. my form (current version) : ``` <form action="{{ url('/task/'.$task->id) }}" method="POST"> {{ method_field('DELETE') }} {{ csrf_field() }} <button type="submit" class="btn btn-danger"> <i class="fa fa-btn fa-trash"></i>Delete </button> </form> ``` my route : ``` Route::delete('/task/{id}', function ($id) { Task::findOrFail($id)->delete(); return redirect('/'); }); ``` i've been trying to fix this for 4 hours now, changing the methods of my route and form; but to no avail. this is my first question on this site, sorry if there's something wrong in this question. thanks~ edit: to further help the effort, here's the complete error log [Error log, in Google Chrome](https://i.stack.imgur.com/SWNoa.png)
2017/03/13
[ "https://Stackoverflow.com/questions/42760243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7702001/" ]
Change ``` <form action="{{ url('task/'.$task->id) }}" method="DELETE"> ``` to ``` <form action="{{ url('task/'.$task->id) }}" method="POST"> ``` Because form method DELETE does not exist, Laravel just "overwrites" this method with the hidden input "method" (you can place this input using "`{{ method_field('DELETE') }}`").
Form dosent support method Delete or Put ... It support only get and post methods, if You want implement delete in laravel this article will help you [link](https://stackoverflow.com/questions/28634798/how-can-i-delete-a-post-resource-in-laravel-5)
42,760,243
i was trying to follow [this](https://laravel.com/docs/5.1/quickstart#installation) tutorial on Laravel, even though most of the code & directories there were outdated, i managed to make the "Add Task" and also The Form to show up after a few errors. now the problem, the delete button. when i click on it, it shows a "MethodNotAllowedHttpException". i changed the source code to match the newest version of Laravel. my form (current version) : ``` <form action="{{ url('/task/'.$task->id) }}" method="POST"> {{ method_field('DELETE') }} {{ csrf_field() }} <button type="submit" class="btn btn-danger"> <i class="fa fa-btn fa-trash"></i>Delete </button> </form> ``` my route : ``` Route::delete('/task/{id}', function ($id) { Task::findOrFail($id)->delete(); return redirect('/'); }); ``` i've been trying to fix this for 4 hours now, changing the methods of my route and form; but to no avail. this is my first question on this site, sorry if there's something wrong in this question. thanks~ edit: to further help the effort, here's the complete error log [Error log, in Google Chrome](https://i.stack.imgur.com/SWNoa.png)
2017/03/13
[ "https://Stackoverflow.com/questions/42760243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7702001/" ]
Change ``` <form action="{{ url('task/'.$task->id) }}" method="DELETE"> ``` to ``` <form action="{{ url('task/'.$task->id) }}" method="POST"> ``` Because form method DELETE does not exist, Laravel just "overwrites" this method with the hidden input "method" (you can place this input using "`{{ method_field('DELETE') }}`").
Answer : Turns out the problem lies in the Database-table itself, let me explain : i was referring to a 'tasks' table that is referred as 'task' in code (no problem) BUT, i was referring to a column called "ID" in my table as "id" in my code, creating the error (a rookie mistake). thanks to @Autista\_z for the pointer, and everyone else below for the guidance!
42,760,243
i was trying to follow [this](https://laravel.com/docs/5.1/quickstart#installation) tutorial on Laravel, even though most of the code & directories there were outdated, i managed to make the "Add Task" and also The Form to show up after a few errors. now the problem, the delete button. when i click on it, it shows a "MethodNotAllowedHttpException". i changed the source code to match the newest version of Laravel. my form (current version) : ``` <form action="{{ url('/task/'.$task->id) }}" method="POST"> {{ method_field('DELETE') }} {{ csrf_field() }} <button type="submit" class="btn btn-danger"> <i class="fa fa-btn fa-trash"></i>Delete </button> </form> ``` my route : ``` Route::delete('/task/{id}', function ($id) { Task::findOrFail($id)->delete(); return redirect('/'); }); ``` i've been trying to fix this for 4 hours now, changing the methods of my route and form; but to no avail. this is my first question on this site, sorry if there's something wrong in this question. thanks~ edit: to further help the effort, here's the complete error log [Error log, in Google Chrome](https://i.stack.imgur.com/SWNoa.png)
2017/03/13
[ "https://Stackoverflow.com/questions/42760243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7702001/" ]
Answer : Turns out the problem lies in the Database-table itself, let me explain : i was referring to a 'tasks' table that is referred as 'task' in code (no problem) BUT, i was referring to a column called "ID" in my table as "id" in my code, creating the error (a rookie mistake). thanks to @Autista\_z for the pointer, and everyone else below for the guidance!
Form dosent support method Delete or Put ... It support only get and post methods, if You want implement delete in laravel this article will help you [link](https://stackoverflow.com/questions/28634798/how-can-i-delete-a-post-resource-in-laravel-5)
7,303,293
I am using MediaPlayer to try and stream video and audio from youtube. How do i go about doing this using the url: Example: ``` http://www.youtube.com/watch?v=SgGhtjKWLOE&feature=feedrec ``` EDIT: LogCat Error i get when using your methods. ``` 09-04 22:22:30.140: INFO/AwesomePlayer(85): setDataSource_l('http://www.youtube.com/watch?v=I3jv0IF9n6A') 09-04 22:22:30.140: INFO/NuHTTPDataSource(85): connect to www.youtube.com:80/watch?v=I3jv0IF9n6A @0 09-04 22:22:30.250: INFO/NuHTTPDataSource(85): connect to m.youtube.com:80/watch?desktop_uri=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DI3jv0IF9n6A&v=I3jv0IF9n6A&gl=US @0 09-04 22:22:30.410: INFO/NuHTTPDataSource(85): connect to m.youtube.com:80/#/watch?desktop_uri=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DI3jv0IF9n6A&v=I3jv0IF9n6A&gl=US @0 09-04 22:22:30.570: INFO/NuHTTPDataSource(85): Chunked transfer encoding applied. 09-04 22:22:30.570: WARN/NuHTTPDataSource(85): Server did not give us the content length! 09-04 22:22:31.000: INFO/NuCachedSource2(85): ERROR_END_OF_STREAM 09-04 22:22:31.630: ERROR/MediaPlayer(8404): error (1, -2147483648) 09-04 22:22:31.630: WARN/System.err(8404): java.io.IOException: Prepare failed.: status=0x1 09-04 22:22:31.630: WARN/System.err(8404): at android.media.MediaPlayer.prepare(Native Method) 09-04 22:22:31.630: WARN/System.err(8404): at com.fttech.example.youtube.example.AccessibleYouTube.watchVideo(AccessibleYouTube.java:139) 09-04 22:22:31.630: WARN/System.err(8404): at java.lang.reflect.Method.invokeNative(Native Method) 09-04 22:22:31.630: WARN/System.err(8404): at java.lang.reflect.Method.invoke(Method.java:491) 09-04 22:22:31.630: WARN/System.err(8404): at android.view.View$1.onClick(View.java:2678) 09-04 22:22:31.630: WARN/System.err(8404): at android.view.View.performClick(View.java:3110) 09-04 22:22:31.630: WARN/System.err(8404): at android.view.View$PerformClick.run(View.java:11928) 09-04 22:22:31.630: WARN/System.err(8404): at android.os.Handler.handleCallback(Handler.java:587) ``` 09-04 22:22:31.630: WARN/System.err(8404): at android.os.Handler.dispatchMessage(Handler.java:92)
2011/09/05
[ "https://Stackoverflow.com/questions/7303293", "https://Stackoverflow.com", "https://Stackoverflow.com/users/867895/" ]
If you're wanting to use `MediaPlayer` object then the following calls will work for you: ``` MediaPlayer mp = new MediaPlayer(); mp.setDataSource("http://www.youtube.com/watch?v=SgGhtjKWLOE&feature=feedrec"); mp.prepare(); mp.start(); ``` Otherwise, if you don't mind having the YouTube app take over, you can use the following code: ``` startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.youtube.com/watch?v=SgGhtjKWLOE&feature=feedrec"))); ```
``` Uri uri = Uri.parse("http://www.youtube.com/watch?v=SgGhtjKWLOE&feature=feedrec"); Intent i = new Intent("android.intent.action.VIEW"); i.setDataAndType(uri, "video/*"); startActivity(i); ```
523
My teacher recently rejected the idea of me using this site for a research paper, and I was wondering if you would think that this site could be considered a source.
2013/05/03
[ "https://history.meta.stackexchange.com/questions/523", "https://history.meta.stackexchange.com", "https://history.meta.stackexchange.com/users/2272/" ]
Your teacher was right to do so. This website would probably be a bad source to use as a primary reference in a paper. Any random moron in the world with internet access is free to post an answer here. (For exhibit A, click my name below...) However, if there's something that has you stumped in your research, I'd think it would be an excellent place to try to get your questions answered. Good answers here should be sourced with hyperlinks, so it would also (hopefully) be useful for digging up other references that **are** usable. Use the references we supply to help jump-start your research.
T.E.D. gave a really good answer! Here are my bits on this: If some answer in here really drives you in a new direction or brings up a new idea, you could of course give credit where credit should be given. Like "The following idea of sliced bread was brought up first by random moron in the world [1]: Sliced bread is really a new thing, people have started to research it [2]." And give good sources in [2]. It's neither better nor worse than any other form of "PC - Personal Communication". Explain the idea in full, give credit where credit goes, and cite real sources. As with PC you should assume, that your reader has either no access to the source or will not trust it, so back your stuff with other things.
523
My teacher recently rejected the idea of me using this site for a research paper, and I was wondering if you would think that this site could be considered a source.
2013/05/03
[ "https://history.meta.stackexchange.com/questions/523", "https://history.meta.stackexchange.com", "https://history.meta.stackexchange.com/users/2272/" ]
Your teacher was right to do so. This website would probably be a bad source to use as a primary reference in a paper. Any random moron in the world with internet access is free to post an answer here. (For exhibit A, click my name below...) However, if there's something that has you stumped in your research, I'd think it would be an excellent place to try to get your questions answered. Good answers here should be sourced with hyperlinks, so it would also (hopefully) be useful for digging up other references that **are** usable. Use the references we supply to help jump-start your research.
No, this website is not an academic source, in the same way that Wikipedia is not. Your first stop when asking a question should be the [Reference Desk](https://en.wikipedia.org/wiki/Wikipedia%3aReference_desk/Humanities) on Wikipedia. Anyone can answer there and you will find about as many incompetent fools as are here. However, Wikipedia's Reference Desk has a greater number of knowledgeable people -- including university professors of history, of whom there are none here -- than History Stack Exchange to point you in the right direction so that you can research an issue in depth. They also are more aggressive in handling trolls and extremists, which is a good thing.
523
My teacher recently rejected the idea of me using this site for a research paper, and I was wondering if you would think that this site could be considered a source.
2013/05/03
[ "https://history.meta.stackexchange.com/questions/523", "https://history.meta.stackexchange.com", "https://history.meta.stackexchange.com/users/2272/" ]
Your teacher was right to do so. This website would probably be a bad source to use as a primary reference in a paper. Any random moron in the world with internet access is free to post an answer here. (For exhibit A, click my name below...) However, if there's something that has you stumped in your research, I'd think it would be an excellent place to try to get your questions answered. Good answers here should be sourced with hyperlinks, so it would also (hopefully) be useful for digging up other references that **are** usable. Use the references we supply to help jump-start your research.
SE is even worse than Wikipedia, because it doesn't have such tight quality control and answers don't even need references. It's as much an academic source as instant messaging with people who claim to be experts.
63,950,846
I'm working to make my html responsiveness, I want to do something on IPhoneX(width:375px) when I write code: ``` @media(max-width:375px){ .news-posts-page .news-posts-section .elementor-posts{display: block;} } ``` this doesn't work for IPhoneX. but when I write this: ``` @media(max-width:980px){ .news-posts-page .news-posts-section .elementor-posts{display: block;} } ``` It works fine for IPhoneX, but here is issue. it creates problem for Ipad that I don't want. I want this code to work only for IPhoneX. How to do this?
2020/09/18
[ "https://Stackoverflow.com/questions/63950846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11090255/" ]
I actually tried that with a Different Approach, where I created 2 different stacks `temp` and `temp1`, instead of recursively calling the function I had internal checks and printed the output at the end ``` static void deleteFirstHalf(Stack<Integer> stack) { Stack<Integer> temp = new Stack<Integer>(); Stack<Integer> temp1 = new Stack<Integer>(); int i = stack.size(); int dest = stack.size() / 2; while (i-- > dest) { int t = stack.pop(); temp.push(t); } while (!temp.empty()) { int t = temp.pop(); // System.out.print(i + " size"); temp1.push(t); } System.out.print(temp1); } ```
Your bug comes from the fact that you're supposed to delete the bottom `floor(n/2)` elements, but instead you're keeping the top `floor(n/2)` elements. The reason it works for some test cases is that when n is even, keeping the top n/2 elements is the same as deleting the bottom n/2 elements. When n is odd, the code should keep one extra element. The solution is to change `if (curr < Math.floor(n/2))` to `if (curr < n/2 + n%2)`. For one, you can drop the `Math.floor()`, since integer division does floor division anyway. The key difference is the addition of `n%2`. `n%2` evaluates to 0 when n is even, and 1 when n is odd. What this does is if n is odd, it will make the code keep one extra element. (in the case of the 3rd test case, it will keep 10 instead of deleting it) If n is even, `n%2` evaluates to 0, so the algorithm behaves the same as before.
63,950,846
I'm working to make my html responsiveness, I want to do something on IPhoneX(width:375px) when I write code: ``` @media(max-width:375px){ .news-posts-page .news-posts-section .elementor-posts{display: block;} } ``` this doesn't work for IPhoneX. but when I write this: ``` @media(max-width:980px){ .news-posts-page .news-posts-section .elementor-posts{display: block;} } ``` It works fine for IPhoneX, but here is issue. it creates problem for Ipad that I don't want. I want this code to work only for IPhoneX. How to do this?
2020/09/18
[ "https://Stackoverflow.com/questions/63950846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11090255/" ]
I actually tried that with a Different Approach, where I created 2 different stacks `temp` and `temp1`, instead of recursively calling the function I had internal checks and printed the output at the end ``` static void deleteFirstHalf(Stack<Integer> stack) { Stack<Integer> temp = new Stack<Integer>(); Stack<Integer> temp1 = new Stack<Integer>(); int i = stack.size(); int dest = stack.size() / 2; while (i-- > dest) { int t = stack.pop(); temp.push(t); } while (!temp.empty()) { int t = temp.pop(); // System.out.print(i + " size"); temp1.push(t); } System.out.print(temp1); } ```
Instead of **curr<Math.floor(n/2)** try **n-curr > Math.floor(n/2)**
63,950,846
I'm working to make my html responsiveness, I want to do something on IPhoneX(width:375px) when I write code: ``` @media(max-width:375px){ .news-posts-page .news-posts-section .elementor-posts{display: block;} } ``` this doesn't work for IPhoneX. but when I write this: ``` @media(max-width:980px){ .news-posts-page .news-posts-section .elementor-posts{display: block;} } ``` It works fine for IPhoneX, but here is issue. it creates problem for Ipad that I don't want. I want this code to work only for IPhoneX. How to do this?
2020/09/18
[ "https://Stackoverflow.com/questions/63950846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11090255/" ]
I actually tried that with a Different Approach, where I created 2 different stacks `temp` and `temp1`, instead of recursively calling the function I had internal checks and printed the output at the end ``` static void deleteFirstHalf(Stack<Integer> stack) { Stack<Integer> temp = new Stack<Integer>(); Stack<Integer> temp1 = new Stack<Integer>(); int i = stack.size(); int dest = stack.size() / 2; while (i-- > dest) { int t = stack.pop(); temp.push(t); } while (!temp.empty()) { int t = temp.pop(); // System.out.print(i + " size"); temp1.push(t); } System.out.print(temp1); } ```
Instead of (curr<Math.floor(n/2)) try (curr < n-Math.floor(n/2))
4,163,043
I recently have been reading a book on proofs, and in the very first chapter it started to discuss implication. It gave implication's truth table and different ways of expressing implication, and it did attempt to explain it to the reader, but I still found myself confused on what implication actually is. [Implication's truth table](https://i.stack.imgur.com/jT5mg.jpg) [Implication with words](https://i.stack.imgur.com/DWzvc.jpg) [Explanation of Implication](https://i.stack.imgur.com/8qsQL.jpg) My confusion lies in what people say implication logically represents. Based on how its expressed with words "If A then B" you would think it meant "If A is true then B must be true". However, you have cases where something called vacuose truth applies(Another part of implication that I don't understand), which contradicts the initial assumption about implication with statements like "False ⇒ True" being true. I've seen videos where a college proffesor said it shows "the logical relationship between A and B" which didn't make sense to me, and forum posts from this site and others trying to explain it but each time I read them I find myself as or even more confused. I'm sorry if I sound frustrated or angry. I just really want to understand proofs, but I've found this one concept to be a roadblock to understanding the rest of the book. I'm also sorry if the format of the post is a little weird. This is the first time ever posting on this site, and I'm not sure how to do the fancy math format that I usually see on Math stackexchange. Any help trying to get me to understand this concept would be greatly appriciated!
2021/06/04
[ "https://math.stackexchange.com/questions/4163043", "https://math.stackexchange.com", "https://math.stackexchange.com/users/937566/" ]
You can think of $A \to B$ as asking *"If I give you $A$ can you return $B$?"*. This line of thinking is based on a [more general logic](https://en.wikipedia.org/wiki/Intuitionistic_logic) than classical logic, but here you don't need to know much about it except * *"$P$ is true"* should be understood as *"we have $P$"* * *"$P$ is false"* should be understood as *"there is no way we can get $P$"* So with this in mind let's look again at the truth table and what the answer is in every case. * No matter whether $A$ is true or false, if $B$ is true i.e. we have $B$, then we can definitely return $B$. So we have $A \to B$. * If $A$ is true and $B$ is false, i.e. there is no way to get $B$, then there is no way we can get $A \to B$. * The last case might still seem a bit strange: If $A$ is false and $B$ is false, i.e. there is no way to get $A$, then the answer to *"If I give you $A$ can you return $B$?"* is *"Well apparently then everything is possible, so I can also get you $B$"*. (In the end implication is -in this view- connected to functions. I wrote more about this [here](https://math.stackexchange.com/a/4120145/351999)) --- It's worth thinking about the *"$A$ is false implies everything"* a bit more. Let's say we restrict our interest to statements involving natural numbers only (very concretely I mean the first-order theory of Peano arithmetic) and assume we don't have -as of yet- any idea what a *false* statement is meant to be. There is however a prototypical very problematic statement; namely $0 = 1$. How problematic? Very much so! Because combined with induction, $0 = 1$ can be used to show $x = 0$ for every term $x$ and this enables us to show $0 = 1 \to B$ for every statement $B$. (every equation just becomes trivial if everything is $0$) We can now go ahead and define a statement $A$ to be *false* iff $A \to 0=1$. With this definition then, do we have $A \to B$ when $A$ is false? Well in this case * We are given $A$, we know $A$ is false and we want to return $B$. * $A$ false means $A \to 0=1$ and since we are also given $A$, we get $0=1$. * From $0 = 1$ we can get anything so in particular $B$. So you can think of false statements concretely as something like $0 = 1$, which really does make it possible to show anything in Peano arithmetic.
In a proof, an implication must be taken in its formal meaning and has little to do with an implied "cause-effect" relation. It is implicit that when you write an implication $P\implies Q$, the result of the evaluation of this boolean expression is *true*. The proposition $$n>0\implies n+1>0$$ can be true in three ways and false in one, namely * $n>0\land n+1>0,$ * $\color{red}{n>0\land n+1\le0},$ * $n\le0\land n+1>0,$ * $n\le0\land n+1\le0.$ As you can check explicitly, the red proposition is *impossible* while all others are possible, hence the implication always has a true value. Also note that the reverse relation is not an implication, $$n+1>0\ \not\!\!\!\implies n>0$$ because of the counterexample $$\color{red}{0+1>0\land 0>0}$$ which is yields a *false* value.
101,640
**Task description** > > You are given a list and an item, find the length of the longest consecutive subsequence of the list containing only the item. > > > **Testcases** ``` [1, 1, 2, 3] 1 -> 2 [1, 0, 0, 2, 3, 0, 4, 0, 0, 0, 6] 0 -> 3 ``` This code is pretty readable in my opinion but I fear that the \$O(N^2)\$ time complexity is sub-optimal. ``` def subsequences(arr) ((0...arr.length).to_a) .repeated_permutation(2) .select {|start, finish| finish >= start} .collect {|start, finish| arr[start..finish] } end def longest_item_only_subsequence_len(arr, item) subsequences(arr) .select {|seq| seq.all? {|i| i == item} } .max_by(&:length) .length end p subsequences([1, 2, 3]) p longest_item_only_subsequence_len([1, 0, 0, 2, 3, 0, 4, 0, 0, 0, 6], 0) ```
2015/08/22
[ "https://codereview.stackexchange.com/questions/101640", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/54718/" ]
Yes, `chunk` is the way to go. I'd write it differently, though, using a list-comphehension approach (in Ruby: `map`+`if`+`compact`. Or with a [custom](https://stackoverflow.com/questions/310426/list-comprehension-in-ruby) method.) and taking in account the edge case (no elements `item` in the array): ``` def longest_item_only_subsequence_len(xs, item) xs.chunk(&:itself).map { |y, ys| ys.size if y == item }.compact.max || 0 end ```
After some more thinking, I realized that `Array.chunk` is `O(N)` and what I was looking for: ``` def longest_item_only_subsequence_len(arr, item) return 0 if ! arr.include?(item) arr .chunk(&:itself) .select{|kind, _| kind == item} .collect {|_, subseq| subseq} .max_by(&:length) .length end ```
9,702,228
I have app with lot off activities and user can walk between activities. How to find if some activity is on stack ( just to call finish() ) or not on stack ?
2012/03/14
[ "https://Stackoverflow.com/questions/9702228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486578/" ]
I would say it is not overkill. Even if you are 100% certain (can you really be?) that you never need to provide your application in a different language, it makes the code much more readable, if it is not "littered" with strings/messages. Personally, I found out that I started writing much better (error) messages, once I moved all of them to resources. Before that I was trying too hard to make them "look nice" in the code, than to provide a really meaningful message. Of course, there are also drawbacks. While navigation usually doesn't suffer (ReSharper's "Go To Definition" works equally well with string resources), you don't get checking of `string.Format` parameters. Again, for me that was worth the price of having (arguably cleaner code and better messages). YMMV.
If you just use one language (i.e. English) now and in the future you can ignore ReSharper's internationalization features. But if it can happen that you will support other languages you should move all strings (that appear in user interface) to the Resources.
9,702,228
I have app with lot off activities and user can walk between activities. How to find if some activity is on stack ( just to call finish() ) or not on stack ?
2012/03/14
[ "https://Stackoverflow.com/questions/9702228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486578/" ]
I would say it is not overkill. Even if you are 100% certain (can you really be?) that you never need to provide your application in a different language, it makes the code much more readable, if it is not "littered" with strings/messages. Personally, I found out that I started writing much better (error) messages, once I moved all of them to resources. Before that I was trying too hard to make them "look nice" in the code, than to provide a really meaningful message. Of course, there are also drawbacks. While navigation usually doesn't suffer (ReSharper's "Go To Definition" works equally well with string resources), you don't get checking of `string.Format` parameters. Again, for me that was worth the price of having (arguably cleaner code and better messages). YMMV.
The `move to resource` feature was introduced to aid in internationalization. When R# detects a string which can be localized, it offers to move it to a resource file for you. The benefit of this is that the strings in the .resx can be changed to different languages without having to recompile any code. See the ReSharper documentation on this [here](http://www.jetbrains.com/resharper/features/internationalization.html).
44,991
The mitzvah of V'nishmartem ([Devarim 4:15](http://www.mechon-mamre.org/p/pt/pt0504.htm#15)) requires a person to take care of their health (Shulchan Aruch C.M. 427:8, Kitzur Shulchan Aruch 32:1). How far does this go? Do I have to exercise daily? Do I need to be in peak physical condition? Am I required to stay current on nutrition news to follow the healthiest eating and living habits? In short, how far do I have to go?
2014/09/01
[ "https://judaism.stackexchange.com/questions/44991", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/4794/" ]
The official position of the Conservative movement can be found in [Women and the Minyan](http://www.rabbinicalassembly.org/sites/default/files/public/halakhah/teshuvot/19912000/oh_55_1_2002.pdf) by Rabbi David J. Fine. It was released in 2002 as an explanation of the 1983 decision by the Jewish Theological Seminary to ordain women as rabbis and cantors. The main question that caused debate in the period of 1973-1983 was whether a woman could be a *sheliach tzibur*, an agent of the public who says prayers for those who cannot do it themselves. An agent must be at least as obligated as the person they are doing it on behalf of. The dean of the rabbinical school [Rabbi Joel Roth](http://en.wikipedia.org/wiki/Joel_Roth) argued that if a woman voluntarily takes on the obligation of praying every day, this obligation becomes binding on her. The traditionalists at JTS, including the great twentieth-century Talmudist [Rabbi Shaul Lieberman](http://en.wikipedia.org/wiki/Saul_Lieberman) argued that there is a clear hierarchy of obligation and that even if she took this obligation on voluntarily, it would still be a lesser obligation than that of a man. This was a bitter fight within the Conservative movement at the time and resulted in some people defecting from the movement to set up the [Union for Traditional Judaism](http://en.wikipedia.org/wiki/Union_for_Traditional_Judaism). A brief summary of this can be found in [Women in Judaism - Changes in the Conservative position](http://en.wikipedia.org/wiki/Women_in_Judaism#Changes_in_the_Conservative_position). A narrative account of the struggle can be found in the book ["One God Clapping"](http://rads.stackoverflow.com/amzn/click/1580231152) by Rabbi Alan Lew who was a student at JTS during this time.
there is not much discussion in halacha (talmud,rishonim,acharonim) on appointing female rabbis simply because it was never an issue until today due to several considerations. possibly among them: 1. the synagogue or study hall is dominated by the presence of men. men are commanded to pray in a minyan (congregation of at least 10 men) and study torah whereas women are not. hence the women will be in a predominantly male area. this will encourage mingling between the sexes by her example and this is highly discouraged in Judaism. "whoever talks excessively to women causes evil to himself and will end up inheriting gehinom" (Pirkei Avot). the ideal way is as "Avraham converted the men and Sarah the women". (Rashi Gen. 2:15). if these female rabbis just wanted a diploma to work in female institutions it would not be so controversial but this is not the case. 2. women have a subordinate role to men. this is not PC in our times but this is the official position of Judaism. the torah describes the woman as a helper to man (Gen.2:18). He will rule over you (ibid 3:16). a man is viewed as more of an authority figure. this is important for a leader of a congregation. 3. According to Rabbi Uziel Milevsky former chief rabbi of Mexico, women's minds function differently than men's. they tend to be less capable of objective thinking than men. the reason is that they internalize what they see and therefore have a hard time stepping back and looking at it objectively. for this they are disqualified from being witnesses (would also be absurd to have a rabbi or judge who is not even a kosher witness). the talmud is built on highly abstract arguments and remote cases whereas women's minds tend to be best at practical things. on this talmud says “Women’s wisdom is solely in the spindle.” 4. related to previous, the talmud itself discourages women from learning it. many of the talmudic sages discourage the study of torah by women with some even forbidding it such as Rabbi Eliezer, “The words of the Torah should be burned rather than entrusted to women” (JT Sotah 3:4, 16a. see commentaries there which says he holds it is forbidden). you have to ask yourself why these women are so gung ho about learning a book that holds this position update: The RCA (Rabinical council of America) [states](http://www.rabbis.org/news/article.cfm?id=105753) regarding a new school which ordains female rabbis: "the RCA views this event as a violation of our mesorah (tradition) and regrets that the leadership of the school has chosen a path that contradicts the norms of our community" found this quote on [emes v'emuna](http://haemtza.blogspot.co.il/2015/06/serving-god-and-empowering-women.html) which has a good discussion on this
44,991
The mitzvah of V'nishmartem ([Devarim 4:15](http://www.mechon-mamre.org/p/pt/pt0504.htm#15)) requires a person to take care of their health (Shulchan Aruch C.M. 427:8, Kitzur Shulchan Aruch 32:1). How far does this go? Do I have to exercise daily? Do I need to be in peak physical condition? Am I required to stay current on nutrition news to follow the healthiest eating and living habits? In short, how far do I have to go?
2014/09/01
[ "https://judaism.stackexchange.com/questions/44991", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/4794/" ]
The official position of the Conservative movement can be found in [Women and the Minyan](http://www.rabbinicalassembly.org/sites/default/files/public/halakhah/teshuvot/19912000/oh_55_1_2002.pdf) by Rabbi David J. Fine. It was released in 2002 as an explanation of the 1983 decision by the Jewish Theological Seminary to ordain women as rabbis and cantors. The main question that caused debate in the period of 1973-1983 was whether a woman could be a *sheliach tzibur*, an agent of the public who says prayers for those who cannot do it themselves. An agent must be at least as obligated as the person they are doing it on behalf of. The dean of the rabbinical school [Rabbi Joel Roth](http://en.wikipedia.org/wiki/Joel_Roth) argued that if a woman voluntarily takes on the obligation of praying every day, this obligation becomes binding on her. The traditionalists at JTS, including the great twentieth-century Talmudist [Rabbi Shaul Lieberman](http://en.wikipedia.org/wiki/Saul_Lieberman) argued that there is a clear hierarchy of obligation and that even if she took this obligation on voluntarily, it would still be a lesser obligation than that of a man. This was a bitter fight within the Conservative movement at the time and resulted in some people defecting from the movement to set up the [Union for Traditional Judaism](http://en.wikipedia.org/wiki/Union_for_Traditional_Judaism). A brief summary of this can be found in [Women in Judaism - Changes in the Conservative position](http://en.wikipedia.org/wiki/Women_in_Judaism#Changes_in_the_Conservative_position). A narrative account of the struggle can be found in the book ["One God Clapping"](http://rads.stackoverflow.com/amzn/click/1580231152) by Rabbi Alan Lew who was a student at JTS during this time.
Being [called] a Rabbi can mean: 1. **Someone respectful in the Jewish community and be elected to run the community**: a female Rebbetzin can be very respectful and can be elected to run the community based on Hilchos Shutfim (partnership). 2. **Being knowledgeable in Judaic sources and give answers**: women can be very knowledgable (so can Google). 3. **Passing exams for Rabbanut**: of course, see the previous point 4. **Having some guiding Ruach Hakodesh (being an Admo"R)**: unless a woman is a known prophet she can't have the necessary "closeness" to Hashem that specifically comes from studying the Torah for its sake (not for knowledge). As women lack that Mitzvah they lack that "ability", and therefore can't reach the necessary levels of Ruach Hakodesh. 5. **Being a Posek**: different movements see it differently - those who follow #2 and #3 - a woman can be a Posek, those who follow #4 they can't. --- We address this issue of female Rabbis a bit differently - it is not a matter of permitted or forbidden it is a matter of validity. For example, it is not "forbidden" for a woman to witness an event, just her testimony is not valid. So there's no problem with women being called Rabbis/Rebbetzins or whatnot, the question is about the validity of their deeds. For example, (some say that) if a Rabbi Posek that a chicken is Kosher or a stain is pure, he turns it into the reality of Kosher, but if I say it's Kosher, I don't set the reality and I might make others fail. So the question is "what's needed for a woman to reach that level of validity of her verdicts. It appears, that similarly to judges or witnesses, the Torah does not provide an option for a woman to set the reality. Therefore a woman can not become "that sort of" a Rabbi.
44,991
The mitzvah of V'nishmartem ([Devarim 4:15](http://www.mechon-mamre.org/p/pt/pt0504.htm#15)) requires a person to take care of their health (Shulchan Aruch C.M. 427:8, Kitzur Shulchan Aruch 32:1). How far does this go? Do I have to exercise daily? Do I need to be in peak physical condition? Am I required to stay current on nutrition news to follow the healthiest eating and living habits? In short, how far do I have to go?
2014/09/01
[ "https://judaism.stackexchange.com/questions/44991", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/4794/" ]
The same reason why there are no female masseurs - they're called masseuses! > > **Rabbi** (1) (*feminine: Rebbetzin*) A Torah scholar, teacher or authority. > > > **Rabbi** (2) (*feminine: Rabbi*) A scholar or teacher hired to lead a Jewish congregation. > > > In other words, the reason there are not female Orthodox rabbis is the same reason there are no gentile Orthodox rabbis (even though there are some in other movements): because Orthodoxy does not accept the second definition. There is no prohibition of a woman being a scholar, teacher or authority, which is why to this day we have among us world-class female rabbis known as rebbetzins (Rebbetzin Jungreis, Rebbetzin Heller, et al.)
there is not much discussion in halacha (talmud,rishonim,acharonim) on appointing female rabbis simply because it was never an issue until today due to several considerations. possibly among them: 1. the synagogue or study hall is dominated by the presence of men. men are commanded to pray in a minyan (congregation of at least 10 men) and study torah whereas women are not. hence the women will be in a predominantly male area. this will encourage mingling between the sexes by her example and this is highly discouraged in Judaism. "whoever talks excessively to women causes evil to himself and will end up inheriting gehinom" (Pirkei Avot). the ideal way is as "Avraham converted the men and Sarah the women". (Rashi Gen. 2:15). if these female rabbis just wanted a diploma to work in female institutions it would not be so controversial but this is not the case. 2. women have a subordinate role to men. this is not PC in our times but this is the official position of Judaism. the torah describes the woman as a helper to man (Gen.2:18). He will rule over you (ibid 3:16). a man is viewed as more of an authority figure. this is important for a leader of a congregation. 3. According to Rabbi Uziel Milevsky former chief rabbi of Mexico, women's minds function differently than men's. they tend to be less capable of objective thinking than men. the reason is that they internalize what they see and therefore have a hard time stepping back and looking at it objectively. for this they are disqualified from being witnesses (would also be absurd to have a rabbi or judge who is not even a kosher witness). the talmud is built on highly abstract arguments and remote cases whereas women's minds tend to be best at practical things. on this talmud says “Women’s wisdom is solely in the spindle.” 4. related to previous, the talmud itself discourages women from learning it. many of the talmudic sages discourage the study of torah by women with some even forbidding it such as Rabbi Eliezer, “The words of the Torah should be burned rather than entrusted to women” (JT Sotah 3:4, 16a. see commentaries there which says he holds it is forbidden). you have to ask yourself why these women are so gung ho about learning a book that holds this position update: The RCA (Rabinical council of America) [states](http://www.rabbis.org/news/article.cfm?id=105753) regarding a new school which ordains female rabbis: "the RCA views this event as a violation of our mesorah (tradition) and regrets that the leadership of the school has chosen a path that contradicts the norms of our community" found this quote on [emes v'emuna](http://haemtza.blogspot.co.il/2015/06/serving-god-and-empowering-women.html) which has a good discussion on this
44,991
The mitzvah of V'nishmartem ([Devarim 4:15](http://www.mechon-mamre.org/p/pt/pt0504.htm#15)) requires a person to take care of their health (Shulchan Aruch C.M. 427:8, Kitzur Shulchan Aruch 32:1). How far does this go? Do I have to exercise daily? Do I need to be in peak physical condition? Am I required to stay current on nutrition news to follow the healthiest eating and living habits? In short, how far do I have to go?
2014/09/01
[ "https://judaism.stackexchange.com/questions/44991", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/4794/" ]
The same reason why there are no female masseurs - they're called masseuses! > > **Rabbi** (1) (*feminine: Rebbetzin*) A Torah scholar, teacher or authority. > > > **Rabbi** (2) (*feminine: Rabbi*) A scholar or teacher hired to lead a Jewish congregation. > > > In other words, the reason there are not female Orthodox rabbis is the same reason there are no gentile Orthodox rabbis (even though there are some in other movements): because Orthodoxy does not accept the second definition. There is no prohibition of a woman being a scholar, teacher or authority, which is why to this day we have among us world-class female rabbis known as rebbetzins (Rebbetzin Jungreis, Rebbetzin Heller, et al.)
Being [called] a Rabbi can mean: 1. **Someone respectful in the Jewish community and be elected to run the community**: a female Rebbetzin can be very respectful and can be elected to run the community based on Hilchos Shutfim (partnership). 2. **Being knowledgeable in Judaic sources and give answers**: women can be very knowledgable (so can Google). 3. **Passing exams for Rabbanut**: of course, see the previous point 4. **Having some guiding Ruach Hakodesh (being an Admo"R)**: unless a woman is a known prophet she can't have the necessary "closeness" to Hashem that specifically comes from studying the Torah for its sake (not for knowledge). As women lack that Mitzvah they lack that "ability", and therefore can't reach the necessary levels of Ruach Hakodesh. 5. **Being a Posek**: different movements see it differently - those who follow #2 and #3 - a woman can be a Posek, those who follow #4 they can't. --- We address this issue of female Rabbis a bit differently - it is not a matter of permitted or forbidden it is a matter of validity. For example, it is not "forbidden" for a woman to witness an event, just her testimony is not valid. So there's no problem with women being called Rabbis/Rebbetzins or whatnot, the question is about the validity of their deeds. For example, (some say that) if a Rabbi Posek that a chicken is Kosher or a stain is pure, he turns it into the reality of Kosher, but if I say it's Kosher, I don't set the reality and I might make others fail. So the question is "what's needed for a woman to reach that level of validity of her verdicts. It appears, that similarly to judges or witnesses, the Torah does not provide an option for a woman to set the reality. Therefore a woman can not become "that sort of" a Rabbi.
44,991
The mitzvah of V'nishmartem ([Devarim 4:15](http://www.mechon-mamre.org/p/pt/pt0504.htm#15)) requires a person to take care of their health (Shulchan Aruch C.M. 427:8, Kitzur Shulchan Aruch 32:1). How far does this go? Do I have to exercise daily? Do I need to be in peak physical condition? Am I required to stay current on nutrition news to follow the healthiest eating and living habits? In short, how far do I have to go?
2014/09/01
[ "https://judaism.stackexchange.com/questions/44991", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/4794/" ]
[Rav Hershel Shachter](http://www.hakirah.org/Vol%2011%20Schachter.pdf) intimates that , since certain non-masoretic groups ordain women as rabbis, it is a violation on the level of "yeharag v'lo yaavor" (i.e. one must give up ones life, rather than trangress) to give Orthodox smicha to women. > > ...we encourage one > to give up his life in order to secure the continuation of the chain of > semichah from the days of Moshe Rabbeinu. > > > > > Rav Shachter goes on to explain that, although smicha today isn't the same as Biblical smicha, it is considered an extension of it, and thus, must conform to the same standards. Anyone who gives smicha outside of those standards, threatens the very existence of masoretic (i.e. halachically observant) Judaism.
there is not much discussion in halacha (talmud,rishonim,acharonim) on appointing female rabbis simply because it was never an issue until today due to several considerations. possibly among them: 1. the synagogue or study hall is dominated by the presence of men. men are commanded to pray in a minyan (congregation of at least 10 men) and study torah whereas women are not. hence the women will be in a predominantly male area. this will encourage mingling between the sexes by her example and this is highly discouraged in Judaism. "whoever talks excessively to women causes evil to himself and will end up inheriting gehinom" (Pirkei Avot). the ideal way is as "Avraham converted the men and Sarah the women". (Rashi Gen. 2:15). if these female rabbis just wanted a diploma to work in female institutions it would not be so controversial but this is not the case. 2. women have a subordinate role to men. this is not PC in our times but this is the official position of Judaism. the torah describes the woman as a helper to man (Gen.2:18). He will rule over you (ibid 3:16). a man is viewed as more of an authority figure. this is important for a leader of a congregation. 3. According to Rabbi Uziel Milevsky former chief rabbi of Mexico, women's minds function differently than men's. they tend to be less capable of objective thinking than men. the reason is that they internalize what they see and therefore have a hard time stepping back and looking at it objectively. for this they are disqualified from being witnesses (would also be absurd to have a rabbi or judge who is not even a kosher witness). the talmud is built on highly abstract arguments and remote cases whereas women's minds tend to be best at practical things. on this talmud says “Women’s wisdom is solely in the spindle.” 4. related to previous, the talmud itself discourages women from learning it. many of the talmudic sages discourage the study of torah by women with some even forbidding it such as Rabbi Eliezer, “The words of the Torah should be burned rather than entrusted to women” (JT Sotah 3:4, 16a. see commentaries there which says he holds it is forbidden). you have to ask yourself why these women are so gung ho about learning a book that holds this position update: The RCA (Rabinical council of America) [states](http://www.rabbis.org/news/article.cfm?id=105753) regarding a new school which ordains female rabbis: "the RCA views this event as a violation of our mesorah (tradition) and regrets that the leadership of the school has chosen a path that contradicts the norms of our community" found this quote on [emes v'emuna](http://haemtza.blogspot.co.il/2015/06/serving-god-and-empowering-women.html) which has a good discussion on this
44,991
The mitzvah of V'nishmartem ([Devarim 4:15](http://www.mechon-mamre.org/p/pt/pt0504.htm#15)) requires a person to take care of their health (Shulchan Aruch C.M. 427:8, Kitzur Shulchan Aruch 32:1). How far does this go? Do I have to exercise daily? Do I need to be in peak physical condition? Am I required to stay current on nutrition news to follow the healthiest eating and living habits? In short, how far do I have to go?
2014/09/01
[ "https://judaism.stackexchange.com/questions/44991", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/4794/" ]
[Rav Hershel Shachter](http://www.hakirah.org/Vol%2011%20Schachter.pdf) intimates that , since certain non-masoretic groups ordain women as rabbis, it is a violation on the level of "yeharag v'lo yaavor" (i.e. one must give up ones life, rather than trangress) to give Orthodox smicha to women. > > ...we encourage one > to give up his life in order to secure the continuation of the chain of > semichah from the days of Moshe Rabbeinu. > > > > > Rav Shachter goes on to explain that, although smicha today isn't the same as Biblical smicha, it is considered an extension of it, and thus, must conform to the same standards. Anyone who gives smicha outside of those standards, threatens the very existence of masoretic (i.e. halachically observant) Judaism.
Being [called] a Rabbi can mean: 1. **Someone respectful in the Jewish community and be elected to run the community**: a female Rebbetzin can be very respectful and can be elected to run the community based on Hilchos Shutfim (partnership). 2. **Being knowledgeable in Judaic sources and give answers**: women can be very knowledgable (so can Google). 3. **Passing exams for Rabbanut**: of course, see the previous point 4. **Having some guiding Ruach Hakodesh (being an Admo"R)**: unless a woman is a known prophet she can't have the necessary "closeness" to Hashem that specifically comes from studying the Torah for its sake (not for knowledge). As women lack that Mitzvah they lack that "ability", and therefore can't reach the necessary levels of Ruach Hakodesh. 5. **Being a Posek**: different movements see it differently - those who follow #2 and #3 - a woman can be a Posek, those who follow #4 they can't. --- We address this issue of female Rabbis a bit differently - it is not a matter of permitted or forbidden it is a matter of validity. For example, it is not "forbidden" for a woman to witness an event, just her testimony is not valid. So there's no problem with women being called Rabbis/Rebbetzins or whatnot, the question is about the validity of their deeds. For example, (some say that) if a Rabbi Posek that a chicken is Kosher or a stain is pure, he turns it into the reality of Kosher, but if I say it's Kosher, I don't set the reality and I might make others fail. So the question is "what's needed for a woman to reach that level of validity of her verdicts. It appears, that similarly to judges or witnesses, the Torah does not provide an option for a woman to set the reality. Therefore a woman can not become "that sort of" a Rabbi.
44,991
The mitzvah of V'nishmartem ([Devarim 4:15](http://www.mechon-mamre.org/p/pt/pt0504.htm#15)) requires a person to take care of their health (Shulchan Aruch C.M. 427:8, Kitzur Shulchan Aruch 32:1). How far does this go? Do I have to exercise daily? Do I need to be in peak physical condition? Am I required to stay current on nutrition news to follow the healthiest eating and living habits? In short, how far do I have to go?
2014/09/01
[ "https://judaism.stackexchange.com/questions/44991", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/4794/" ]
Being [called] a Rabbi can mean: 1. **Someone respectful in the Jewish community and be elected to run the community**: a female Rebbetzin can be very respectful and can be elected to run the community based on Hilchos Shutfim (partnership). 2. **Being knowledgeable in Judaic sources and give answers**: women can be very knowledgable (so can Google). 3. **Passing exams for Rabbanut**: of course, see the previous point 4. **Having some guiding Ruach Hakodesh (being an Admo"R)**: unless a woman is a known prophet she can't have the necessary "closeness" to Hashem that specifically comes from studying the Torah for its sake (not for knowledge). As women lack that Mitzvah they lack that "ability", and therefore can't reach the necessary levels of Ruach Hakodesh. 5. **Being a Posek**: different movements see it differently - those who follow #2 and #3 - a woman can be a Posek, those who follow #4 they can't. --- We address this issue of female Rabbis a bit differently - it is not a matter of permitted or forbidden it is a matter of validity. For example, it is not "forbidden" for a woman to witness an event, just her testimony is not valid. So there's no problem with women being called Rabbis/Rebbetzins or whatnot, the question is about the validity of their deeds. For example, (some say that) if a Rabbi Posek that a chicken is Kosher or a stain is pure, he turns it into the reality of Kosher, but if I say it's Kosher, I don't set the reality and I might make others fail. So the question is "what's needed for a woman to reach that level of validity of her verdicts. It appears, that similarly to judges or witnesses, the Torah does not provide an option for a woman to set the reality. Therefore a woman can not become "that sort of" a Rabbi.
there is not much discussion in halacha (talmud,rishonim,acharonim) on appointing female rabbis simply because it was never an issue until today due to several considerations. possibly among them: 1. the synagogue or study hall is dominated by the presence of men. men are commanded to pray in a minyan (congregation of at least 10 men) and study torah whereas women are not. hence the women will be in a predominantly male area. this will encourage mingling between the sexes by her example and this is highly discouraged in Judaism. "whoever talks excessively to women causes evil to himself and will end up inheriting gehinom" (Pirkei Avot). the ideal way is as "Avraham converted the men and Sarah the women". (Rashi Gen. 2:15). if these female rabbis just wanted a diploma to work in female institutions it would not be so controversial but this is not the case. 2. women have a subordinate role to men. this is not PC in our times but this is the official position of Judaism. the torah describes the woman as a helper to man (Gen.2:18). He will rule over you (ibid 3:16). a man is viewed as more of an authority figure. this is important for a leader of a congregation. 3. According to Rabbi Uziel Milevsky former chief rabbi of Mexico, women's minds function differently than men's. they tend to be less capable of objective thinking than men. the reason is that they internalize what they see and therefore have a hard time stepping back and looking at it objectively. for this they are disqualified from being witnesses (would also be absurd to have a rabbi or judge who is not even a kosher witness). the talmud is built on highly abstract arguments and remote cases whereas women's minds tend to be best at practical things. on this talmud says “Women’s wisdom is solely in the spindle.” 4. related to previous, the talmud itself discourages women from learning it. many of the talmudic sages discourage the study of torah by women with some even forbidding it such as Rabbi Eliezer, “The words of the Torah should be burned rather than entrusted to women” (JT Sotah 3:4, 16a. see commentaries there which says he holds it is forbidden). you have to ask yourself why these women are so gung ho about learning a book that holds this position update: The RCA (Rabinical council of America) [states](http://www.rabbis.org/news/article.cfm?id=105753) regarding a new school which ordains female rabbis: "the RCA views this event as a violation of our mesorah (tradition) and regrets that the leadership of the school has chosen a path that contradicts the norms of our community" found this quote on [emes v'emuna](http://haemtza.blogspot.co.il/2015/06/serving-god-and-empowering-women.html) which has a good discussion on this
44,991
The mitzvah of V'nishmartem ([Devarim 4:15](http://www.mechon-mamre.org/p/pt/pt0504.htm#15)) requires a person to take care of their health (Shulchan Aruch C.M. 427:8, Kitzur Shulchan Aruch 32:1). How far does this go? Do I have to exercise daily? Do I need to be in peak physical condition? Am I required to stay current on nutrition news to follow the healthiest eating and living habits? In short, how far do I have to go?
2014/09/01
[ "https://judaism.stackexchange.com/questions/44991", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/4794/" ]
[On the first page of Yoreh Deah](https://www.themercava.com/app/books/source/1070104) - וכן המנהג שאין הנשים שוחטות - [Rav Schechter quoted from The Rav](http://www.hakirah.org/Vol%2011%20Schachter.pdf) (Rav Joseph B. Soloveitchik) that this is because the shochet would commonly act as an assistant rabbi, and since that is assur, it became forbidden for women to be the town shochet.
there is not much discussion in halacha (talmud,rishonim,acharonim) on appointing female rabbis simply because it was never an issue until today due to several considerations. possibly among them: 1. the synagogue or study hall is dominated by the presence of men. men are commanded to pray in a minyan (congregation of at least 10 men) and study torah whereas women are not. hence the women will be in a predominantly male area. this will encourage mingling between the sexes by her example and this is highly discouraged in Judaism. "whoever talks excessively to women causes evil to himself and will end up inheriting gehinom" (Pirkei Avot). the ideal way is as "Avraham converted the men and Sarah the women". (Rashi Gen. 2:15). if these female rabbis just wanted a diploma to work in female institutions it would not be so controversial but this is not the case. 2. women have a subordinate role to men. this is not PC in our times but this is the official position of Judaism. the torah describes the woman as a helper to man (Gen.2:18). He will rule over you (ibid 3:16). a man is viewed as more of an authority figure. this is important for a leader of a congregation. 3. According to Rabbi Uziel Milevsky former chief rabbi of Mexico, women's minds function differently than men's. they tend to be less capable of objective thinking than men. the reason is that they internalize what they see and therefore have a hard time stepping back and looking at it objectively. for this they are disqualified from being witnesses (would also be absurd to have a rabbi or judge who is not even a kosher witness). the talmud is built on highly abstract arguments and remote cases whereas women's minds tend to be best at practical things. on this talmud says “Women’s wisdom is solely in the spindle.” 4. related to previous, the talmud itself discourages women from learning it. many of the talmudic sages discourage the study of torah by women with some even forbidding it such as Rabbi Eliezer, “The words of the Torah should be burned rather than entrusted to women” (JT Sotah 3:4, 16a. see commentaries there which says he holds it is forbidden). you have to ask yourself why these women are so gung ho about learning a book that holds this position update: The RCA (Rabinical council of America) [states](http://www.rabbis.org/news/article.cfm?id=105753) regarding a new school which ordains female rabbis: "the RCA views this event as a violation of our mesorah (tradition) and regrets that the leadership of the school has chosen a path that contradicts the norms of our community" found this quote on [emes v'emuna](http://haemtza.blogspot.co.il/2015/06/serving-god-and-empowering-women.html) which has a good discussion on this
44,991
The mitzvah of V'nishmartem ([Devarim 4:15](http://www.mechon-mamre.org/p/pt/pt0504.htm#15)) requires a person to take care of their health (Shulchan Aruch C.M. 427:8, Kitzur Shulchan Aruch 32:1). How far does this go? Do I have to exercise daily? Do I need to be in peak physical condition? Am I required to stay current on nutrition news to follow the healthiest eating and living habits? In short, how far do I have to go?
2014/09/01
[ "https://judaism.stackexchange.com/questions/44991", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/4794/" ]
[On the first page of Yoreh Deah](https://www.themercava.com/app/books/source/1070104) - וכן המנהג שאין הנשים שוחטות - [Rav Schechter quoted from The Rav](http://www.hakirah.org/Vol%2011%20Schachter.pdf) (Rav Joseph B. Soloveitchik) that this is because the shochet would commonly act as an assistant rabbi, and since that is assur, it became forbidden for women to be the town shochet.
Being [called] a Rabbi can mean: 1. **Someone respectful in the Jewish community and be elected to run the community**: a female Rebbetzin can be very respectful and can be elected to run the community based on Hilchos Shutfim (partnership). 2. **Being knowledgeable in Judaic sources and give answers**: women can be very knowledgable (so can Google). 3. **Passing exams for Rabbanut**: of course, see the previous point 4. **Having some guiding Ruach Hakodesh (being an Admo"R)**: unless a woman is a known prophet she can't have the necessary "closeness" to Hashem that specifically comes from studying the Torah for its sake (not for knowledge). As women lack that Mitzvah they lack that "ability", and therefore can't reach the necessary levels of Ruach Hakodesh. 5. **Being a Posek**: different movements see it differently - those who follow #2 and #3 - a woman can be a Posek, those who follow #4 they can't. --- We address this issue of female Rabbis a bit differently - it is not a matter of permitted or forbidden it is a matter of validity. For example, it is not "forbidden" for a woman to witness an event, just her testimony is not valid. So there's no problem with women being called Rabbis/Rebbetzins or whatnot, the question is about the validity of their deeds. For example, (some say that) if a Rabbi Posek that a chicken is Kosher or a stain is pure, he turns it into the reality of Kosher, but if I say it's Kosher, I don't set the reality and I might make others fail. So the question is "what's needed for a woman to reach that level of validity of her verdicts. It appears, that similarly to judges or witnesses, the Torah does not provide an option for a woman to set the reality. Therefore a woman can not become "that sort of" a Rabbi.
30,700,521
My script is not working, am I missing something? I just want my `navbar` to stay at the top. ``` $(document).ready(function(){ $(".navbar").affix({ offset: { top: 10 } }); }); ``` ```html <nav class="navbar navbar-fixed-top" id="my-navbar"> <div class="container"> <div class="navbar-header"> ``` ```css .navbar { background: rgba(0,0,0,0); font-size: 10pt; text-transform: uppercase; position: fixed; } ``` This rule is overriding `.navbar`: ``` #my-navbar { background: url(headers/macDark.jpg) no-repeat; height: 800px; background-size: cover; background-position: center; position: relative; z-index: -1; padding-top: 30px; } ```
2015/06/08
[ "https://Stackoverflow.com/questions/30700521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4297055/" ]
Here you go Affix script working in uppercase ```js $(document).ready(function() { $(".navbar").affix({ offset: { top: 10 } }); }); ``` ```css .navbar { background: rgba(0, 0, 0, 0); font-size: 10pt; text-transform: uppercase; position: fixed; } ``` ```html <nav class="navbar navbar-fixed-top" id="my-navbar"> <div class="container"> <div class="navbar-header"> <p>Affix script working</p> ```
Are you sure you want to use script for `navbar` staying at the top.. i recommend using `css` like this ```css .navbar { background: yellow; font-size: 10pt; text-transform: uppercase; position: fixed; width:100%; margin:0px; } .navbar li { display: inline-block; } ``` ```html <nav class="navbar navbar-fixed-top" id="my-navbar"> <div class="container"> <div class="navbar-header"> <ul> <li>nav1</li> <li>nav2</li> <li>nav2</li> </ul> </div> </div> </nav> <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>dsadada <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> ```
16,737,372
I Have a `gridview` in ASP, having `template Fields` containing `select`, `edit` and `delete` links each row, and the footer containing `insert` link. There are two `dropdownlists` in each row, let's say: `Category` and `sub-category`, when I change the contents of `category DropDownList` the `sub-category DropDownList` should automatically display the corresponding contents. I've tried to write a `onSelectedIndexChanged` handler, but I don't know how to continue. **Any Ideas?** *(bearing in mind that I did all the rowDataBound() codes to fill the Drop down lists)* **In other words, how to populate a dropdownlist other than in row\_databound()** code: ``` protected void grdBulkScheduler_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.DataRow) { DropDownList ddlCategory = (DropDownList)e.Row.FindControl("ddlCategory"); if (ddlCategory != null) { ddlCategory .DataSource = cData.GetCategory(); ddlCategory .DataValueField = "c_ID"; ddlCategory .DataTextField = "c_Text"; ddlCategory .DataBind(); } ``` Here I am finding the drop down list **category** from **GridViewRowEventArgs** **in the selectedIndexChanged handler, how can I find the DropDownList?** *since `DropDownList ddlCategory = (DropDownList)e.Row.FindControl("ddlCategory")` is not working*
2013/05/24
[ "https://Stackoverflow.com/questions/16737372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1522782/" ]
It sounds like you want to bind data to the subcategory dropdownlist using the value you have selected in the category dropdownlist. You can do: ``` protected void ddlCategory_SelectedIndexChanged(object sender, EventArgs e) { GridViewRow row = (GridViewRow)((DropDownList)sender).Parent.Parent; DropDownList ddlSubCategory = (DropDownList)row.FindControl("ddlSubCategory"); ddlSubCategory.DataSource = //whatever you want to bind, e.g. based on the selected value, using((DropDownList)sender).SelectedValue; ddlSubCategory.DataBind(); } ``` If I have misunderstood you, please correct me in a comment.
FindControl is not recursive and you have a number of `TableCell` controls in the `Cells` property on your `GridViewRow` before you get to the level where your control is, so changing it to something like this will work: ``` TableCell cell = (TableCell)e.Row.FindControl("idOfMyCellIfItHasOne"); DropDownList ddlCategory = (DropDownList)cell.FindControl("ddlCategory"); ``` Alternatively, if your cell/column has no ID and/or you know the position of the cell in the table isn't going to change, you can use the indexer on the `Cells` property: ``` DropDownList ddlCategory = (DropDownList)e.Row.Cells[cellIndex].FindControl("ddlCategory"); ```