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
62,484,385
When we load a file using fstream header, we use `>>` and `getline()` to get one complete line. When writing it to an output file we use `<<` Is there any other alternate way to write the line in the output file instead of `<<`?
2020/06/20
[ "https://Stackoverflow.com/questions/62484385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13767930/" ]
You can use their API to get info about the ship. For example: ``` import re import json import requests url = 'https://www.marinetraffic.com/en/ais/details/ships/mmsi:255805792' ship_info_url = 'https://www.marinetraffic.com/en/vesselDetails/vesselInfo/shipid:{ship_id}' headers = {'User-Agent': 'Mozilla/5.0 (X11; ...
Could I suggest using VesselFinder instead of MarineTraffic? The data is the same but MarineTraffic is hard to scrape as it's all JavaScript, while VesselFinder can be scraped with just BeautifulSoup. VesselFinder also uses tables to show the data so it's easy to parse with pandas. Here's the code: ```py import pand...
179,129
Is the usage of 'the' correct in the sentences below? > > The taco was spicier than **the** American one. > > > The sushi was less expensive than **the** Japanese one. > > > I was asked by my friend why are we using 'the' here when we are comparing it with general tacos or sushis. I'm unable to explain it. We...
2018/09/08
[ "https://ell.stackexchange.com/questions/179129", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/81905/" ]
In your examples, "the" is a definite article used when a speaker wishes to refer to an item whose specific identity those in the conversation are familiar. For example, "the taco was spicier than an American one" (using the indefinite article a/an) says that the taco was spicier than ordinarily/generally found in the...
Generally, **we compare things that are similar.** So, you would not compare a taco to the "American one". If there are two types of tacos, American and Mexican (which is a bit weird since tacos are originally Mexican), you would say: - The American taco was spicier than the Mexican one. **The** is used because you ...
93,503
How to convert selected text to sentence case? like How Are YOU to this How are you
2010/01/09
[ "https://superuser.com/questions/93503", "https://superuser.com", "https://superuser.com/users/15114/" ]
``` ^!v:: clipboard:=ClipboardAll StringLower, string, clipboard StringTrimLeft, output, string, 1 StringLeft, FirstChar, string, 1 StringUpper, FirstChar, FirstChar sendraw %FirstChar%%output% Return ``` Horribly hacky, but it works :) Proof: How are you
In word 2003, select the text, "format" menu, "change case", "sentence case"
160,717
I'm trying to figure out if I can bypass requirement for tempered glass. I have 3 windows 40x69 ea, installed in a row separated by 1 1/2 inch material (2x8), all of this is installed in a rough opening in the front of the house. (most people have a bay/bow window there, in that rough opening, but the house I bought h...
2019/03/27
[ "https://diy.stackexchange.com/questions/160717", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/98736/" ]
Some areas may allow you to apply a [safety window film](https://www.windowtintkansascity.com/window-tinting-benefits/safety-and-security-window-film/tempered-glass-alternatives). I have only seen it on heritage houses where the original windows are essential to the character of the house but I hear it's common in comm...
No, it is not acceptable to use non-tempered glass, because the “seat” area is within 18” of the floor. The Code doesn’t say the window sill must be directly above the walking surface or if it could be recessed (like a window seat), etc. Plus, you don’t want to put family and friends in jeopardy by having them next ...
160,717
I'm trying to figure out if I can bypass requirement for tempered glass. I have 3 windows 40x69 ea, installed in a row separated by 1 1/2 inch material (2x8), all of this is installed in a rough opening in the front of the house. (most people have a bay/bow window there, in that rough opening, but the house I bought h...
2019/03/27
[ "https://diy.stackexchange.com/questions/160717", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/98736/" ]
No, it is not acceptable to use non-tempered glass, because the “seat” area is within 18” of the floor. The Code doesn’t say the window sill must be directly above the walking surface or if it could be recessed (like a window seat), etc. Plus, you don’t want to put family and friends in jeopardy by having them next ...
I would suggest instead use sealed units made for patio doors. That 69 x 40 is very close to the size patio door used in condos, where you have a step over sill between the room and the balcony. Since you are buying a standard size unit, you get the prices of mass production instead of a custom made sealed unit. If yo...
160,717
I'm trying to figure out if I can bypass requirement for tempered glass. I have 3 windows 40x69 ea, installed in a row separated by 1 1/2 inch material (2x8), all of this is installed in a rough opening in the front of the house. (most people have a bay/bow window there, in that rough opening, but the house I bought h...
2019/03/27
[ "https://diy.stackexchange.com/questions/160717", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/98736/" ]
No, it is not acceptable to use non-tempered glass, because the “seat” area is within 18” of the floor. The Code doesn’t say the window sill must be directly above the walking surface or if it could be recessed (like a window seat), etc. Plus, you don’t want to put family and friends in jeopardy by having them next ...
ALL FOUR REQUIREMENTS HAVE TO BE MET OR YOU DO NOT TEMPER. If the window is a double hung then the 9 sq ft rule only applies to the bottom sash. Even if the bottom sash is larger than 9 sq ft then ONLY the bottom sash needs to be tempered. You also have the option of installing an oriel single hung so that the bottom s...
160,717
I'm trying to figure out if I can bypass requirement for tempered glass. I have 3 windows 40x69 ea, installed in a row separated by 1 1/2 inch material (2x8), all of this is installed in a rough opening in the front of the house. (most people have a bay/bow window there, in that rough opening, but the house I bought h...
2019/03/27
[ "https://diy.stackexchange.com/questions/160717", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/98736/" ]
No, it is not acceptable to use non-tempered glass, because the “seat” area is within 18” of the floor. The Code doesn’t say the window sill must be directly above the walking surface or if it could be recessed (like a window seat), etc. Plus, you don’t want to put family and friends in jeopardy by having them next ...
If the bottom edge of glazing is 3" or more higher than the seat then you may be exempt? The requirement seems to be: The bottom edge of the glazing (not the seat) is less than 18 inches (457 mm) above the floor. 2018 International Building Code (2406.4.3)
160,717
I'm trying to figure out if I can bypass requirement for tempered glass. I have 3 windows 40x69 ea, installed in a row separated by 1 1/2 inch material (2x8), all of this is installed in a rough opening in the front of the house. (most people have a bay/bow window there, in that rough opening, but the house I bought h...
2019/03/27
[ "https://diy.stackexchange.com/questions/160717", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/98736/" ]
Some areas may allow you to apply a [safety window film](https://www.windowtintkansascity.com/window-tinting-benefits/safety-and-security-window-film/tempered-glass-alternatives). I have only seen it on heritage houses where the original windows are essential to the character of the house but I hear it's common in comm...
I would suggest instead use sealed units made for patio doors. That 69 x 40 is very close to the size patio door used in condos, where you have a step over sill between the room and the balcony. Since you are buying a standard size unit, you get the prices of mass production instead of a custom made sealed unit. If yo...
160,717
I'm trying to figure out if I can bypass requirement for tempered glass. I have 3 windows 40x69 ea, installed in a row separated by 1 1/2 inch material (2x8), all of this is installed in a rough opening in the front of the house. (most people have a bay/bow window there, in that rough opening, but the house I bought h...
2019/03/27
[ "https://diy.stackexchange.com/questions/160717", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/98736/" ]
Some areas may allow you to apply a [safety window film](https://www.windowtintkansascity.com/window-tinting-benefits/safety-and-security-window-film/tempered-glass-alternatives). I have only seen it on heritage houses where the original windows are essential to the character of the house but I hear it's common in comm...
ALL FOUR REQUIREMENTS HAVE TO BE MET OR YOU DO NOT TEMPER. If the window is a double hung then the 9 sq ft rule only applies to the bottom sash. Even if the bottom sash is larger than 9 sq ft then ONLY the bottom sash needs to be tempered. You also have the option of installing an oriel single hung so that the bottom s...
160,717
I'm trying to figure out if I can bypass requirement for tempered glass. I have 3 windows 40x69 ea, installed in a row separated by 1 1/2 inch material (2x8), all of this is installed in a rough opening in the front of the house. (most people have a bay/bow window there, in that rough opening, but the house I bought h...
2019/03/27
[ "https://diy.stackexchange.com/questions/160717", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/98736/" ]
Some areas may allow you to apply a [safety window film](https://www.windowtintkansascity.com/window-tinting-benefits/safety-and-security-window-film/tempered-glass-alternatives). I have only seen it on heritage houses where the original windows are essential to the character of the house but I hear it's common in comm...
If the bottom edge of glazing is 3" or more higher than the seat then you may be exempt? The requirement seems to be: The bottom edge of the glazing (not the seat) is less than 18 inches (457 mm) above the floor. 2018 International Building Code (2406.4.3)
160,717
I'm trying to figure out if I can bypass requirement for tempered glass. I have 3 windows 40x69 ea, installed in a row separated by 1 1/2 inch material (2x8), all of this is installed in a rough opening in the front of the house. (most people have a bay/bow window there, in that rough opening, but the house I bought h...
2019/03/27
[ "https://diy.stackexchange.com/questions/160717", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/98736/" ]
I would suggest instead use sealed units made for patio doors. That 69 x 40 is very close to the size patio door used in condos, where you have a step over sill between the room and the balcony. Since you are buying a standard size unit, you get the prices of mass production instead of a custom made sealed unit. If yo...
If the bottom edge of glazing is 3" or more higher than the seat then you may be exempt? The requirement seems to be: The bottom edge of the glazing (not the seat) is less than 18 inches (457 mm) above the floor. 2018 International Building Code (2406.4.3)
160,717
I'm trying to figure out if I can bypass requirement for tempered glass. I have 3 windows 40x69 ea, installed in a row separated by 1 1/2 inch material (2x8), all of this is installed in a rough opening in the front of the house. (most people have a bay/bow window there, in that rough opening, but the house I bought h...
2019/03/27
[ "https://diy.stackexchange.com/questions/160717", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/98736/" ]
ALL FOUR REQUIREMENTS HAVE TO BE MET OR YOU DO NOT TEMPER. If the window is a double hung then the 9 sq ft rule only applies to the bottom sash. Even if the bottom sash is larger than 9 sq ft then ONLY the bottom sash needs to be tempered. You also have the option of installing an oriel single hung so that the bottom s...
If the bottom edge of glazing is 3" or more higher than the seat then you may be exempt? The requirement seems to be: The bottom edge of the glazing (not the seat) is less than 18 inches (457 mm) above the floor. 2018 International Building Code (2406.4.3)
62,093,766
It's my firt time on react, and I'm trying to build a sign up form with steps. I read the documentation on material-ui and about ReactJS, but can't understand where I do mistakes. I'll paste the error: *"Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen fo...
2020/05/29
[ "https://Stackoverflow.com/questions/62093766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10402144/" ]
If you want to use JavaScript for this, something like this should do the trick. Is this something you are looking for? ```js (function() { const inputForm = document.querySelector('.js-formInputX'); const classFocus = "is-focused"; inputForm.addEventListener("focusin", (event)=> { let currentInput = ev...
May be this will help you out ```js document.querySelector(".sea").addEventListener('click',function(){ document.querySelector(".center").classList.add("active"); }); ``` ```css .container { display:flex; flex-direction:row; border:1px solid gray; width: 22%; he...
24,482,184
Other Activities in my application are opening and changing just fine, but for some reason this one specifically is crashing. Any idea what my issue is? This is the class file ``` package com.gcomcode.oakgang; import android.app.Activity; import android.content.Context; import android.content.res.TypedArray; imp...
2014/06/30
[ "https://Stackoverflow.com/questions/24482184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3155030/" ]
It's known trouble (feature) with android images. Google will show you tons of articles on this topic (Android images out of memory). You can find an article how android recommend to deal with this issue [here](http://developer.android.com/training/displaying-bitmaps/index.html).
Try to use this in manifest file inside application tag. ``` android:largeHeap="true" ```
62,398,339
I have a problem with the pixel shader, it compiles but does not renders anything and instead Directx gives out this error: D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: The Pixel Shader unit expects a Sampler configured for default filtering to be set at Slot 0, but the sampler bound at this slot is configured for c...
2020/06/15
[ "https://Stackoverflow.com/questions/62398339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12421918/" ]
You are declaring your sampler as a comparison sampler : ``` samplerDesc.Filter = D3D11_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR; ``` It should be : ``` samplerDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR; ``` Comparison sampler are used mostly for shadow maps, and declare as following in hlsl : ``` SamplerComparis...
`SamplerState` in HLSL is a "Effects" construct that only applies to `fx_*` profiles and using the [EFfects for Direct3D 11](https://github.com/Microsoft/FX11/wiki) runtime. For shader binding in your case, use: ``` sampler ss : register(s0); Texture2D<flaot4> shaderTex : register(t0); ```
58,393,930
New to python, would like to remove special characters and integers from column values. I do want to remain with only string characters in the column. For this case is *column C* that I do want to remove special characters like those slashes and numerics, see table ``` import pandas as pd data = {'A':['NW', 'NB', 'U...
2019/10/15
[ "https://Stackoverflow.com/questions/58393930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11883900/" ]
You could use [str.replace](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.replace.html) + [str.strip](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.strip.html) and finally [dropna](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.d...
Use `str.replace` **Ex:** ``` data = {'A':['NW', 'NB', 'UK', 'CAN', 'der'],'B':['Tom', 'nick', 'krish', 'jack','mark'], 'C':['|20|Empty,', 'Yes| -1', 'Male|-1|2-female|0', 'Yes| 1', 79]} df = pd.DataFrame(data) df["C"] = df["C"].str.replace(r"[^a-zA-Z]+", " ", regex=True).str.strip() print(df) ``` **Output:** ``...
58,393,930
New to python, would like to remove special characters and integers from column values. I do want to remain with only string characters in the column. For this case is *column C* that I do want to remove special characters like those slashes and numerics, see table ``` import pandas as pd data = {'A':['NW', 'NB', 'U...
2019/10/15
[ "https://Stackoverflow.com/questions/58393930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11883900/" ]
Use `str.replace` **Ex:** ``` data = {'A':['NW', 'NB', 'UK', 'CAN', 'der'],'B':['Tom', 'nick', 'krish', 'jack','mark'], 'C':['|20|Empty,', 'Yes| -1', 'Male|-1|2-female|0', 'Yes| 1', 79]} df = pd.DataFrame(data) df["C"] = df["C"].str.replace(r"[^a-zA-Z]+", " ", regex=True).str.strip() print(df) ``` **Output:** ``...
The below code should work, but might not be the optimal way of doing it. ``` df["C"].str.replace("[0-9]","").str.replace("|"," ").str.replace(",","").str.replace("-","").dropna() ```
58,393,930
New to python, would like to remove special characters and integers from column values. I do want to remain with only string characters in the column. For this case is *column C* that I do want to remove special characters like those slashes and numerics, see table ``` import pandas as pd data = {'A':['NW', 'NB', 'U...
2019/10/15
[ "https://Stackoverflow.com/questions/58393930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11883900/" ]
You could use [str.replace](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.replace.html) + [str.strip](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.strip.html) and finally [dropna](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.d...
Try this, using `.apply` ``` >>> df['C'].apply(lambda x: re.sub(r'[^a-zA-Z ]+', ' ', str(x))) 0 Empty 1 Yes 2 Male female 3 Yes 4 Name: C, dtype: object ```
58,393,930
New to python, would like to remove special characters and integers from column values. I do want to remain with only string characters in the column. For this case is *column C* that I do want to remove special characters like those slashes and numerics, see table ``` import pandas as pd data = {'A':['NW', 'NB', 'U...
2019/10/15
[ "https://Stackoverflow.com/questions/58393930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11883900/" ]
Try this, using `.apply` ``` >>> df['C'].apply(lambda x: re.sub(r'[^a-zA-Z ]+', ' ', str(x))) 0 Empty 1 Yes 2 Male female 3 Yes 4 Name: C, dtype: object ```
The below code should work, but might not be the optimal way of doing it. ``` df["C"].str.replace("[0-9]","").str.replace("|"," ").str.replace(",","").str.replace("-","").dropna() ```
58,393,930
New to python, would like to remove special characters and integers from column values. I do want to remain with only string characters in the column. For this case is *column C* that I do want to remove special characters like those slashes and numerics, see table ``` import pandas as pd data = {'A':['NW', 'NB', 'U...
2019/10/15
[ "https://Stackoverflow.com/questions/58393930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11883900/" ]
You could use [str.replace](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.replace.html) + [str.strip](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.strip.html) and finally [dropna](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.d...
The below code should work, but might not be the optimal way of doing it. ``` df["C"].str.replace("[0-9]","").str.replace("|"," ").str.replace(",","").str.replace("-","").dropna() ```
18,567,403
I want to vertically align all the input boxes in a particular is div my code is in <http://jsfiddle.net/eSPMr/72/> ``` <div id="editpart3"> <div id ="address1"> <p><b>Residential Address:</b></p> <p> Line1 : <input type="text" value="@Model.Mem_ResAdd1" name="Mem_ResAdd1" /></p> <p> Line2 : <input type="text" val...
2013/09/02
[ "https://Stackoverflow.com/questions/18567403", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2677745/" ]
in your example using statement is right, because you use resources only in scope of your method. For example: ``` Test1() { using (FileStream fs = new FileStream("c:\\test.txt", FileMode.Open)) { byte[] bufer = new byte[256]; fs.Read(bufer, 0, 256); } } ``` but if the resources are used ...
> > why should we use IDisposable > > > Short answer is that any class that doesn't implement IDisposable cannot be used with using. > > when using statement can itself release resources > > > no it cannot release resources itself. As i wrote above that you need to implement IDisposable inorder to be able ...
18,567,403
I want to vertically align all the input boxes in a particular is div my code is in <http://jsfiddle.net/eSPMr/72/> ``` <div id="editpart3"> <div id ="address1"> <p><b>Residential Address:</b></p> <p> Line1 : <input type="text" value="@Model.Mem_ResAdd1" name="Mem_ResAdd1" /></p> <p> Line2 : <input type="text" val...
2013/09/02
[ "https://Stackoverflow.com/questions/18567403", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2677745/" ]
The answer given by "No One" is correct that `using` block can only be used for the classes that implement the `IDisposable` interface and explanation for it is perfect. The question from your side is "Why I need to add IDisposable on Test class and But on code review, I was asked to implement IDisposable interface and...
Based on the information you provided, there is absolutely no reason to implement `IDisposable` or a finalizer on `Test`. Only implement a finalizer to release unmanaged resources (window handle, GDI handle, file handle). You usually do not have to ever do this unless you are PInvoking the Win32 API or something. Micr...
18,567,403
I want to vertically align all the input boxes in a particular is div my code is in <http://jsfiddle.net/eSPMr/72/> ``` <div id="editpart3"> <div id ="address1"> <p><b>Residential Address:</b></p> <p> Line1 : <input type="text" value="@Model.Mem_ResAdd1" name="Mem_ResAdd1" /></p> <p> Line2 : <input type="text" val...
2013/09/02
[ "https://Stackoverflow.com/questions/18567403", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2677745/" ]
Based on the information you provided, there is absolutely no reason to implement `IDisposable` or a finalizer on `Test`. Only implement a finalizer to release unmanaged resources (window handle, GDI handle, file handle). You usually do not have to ever do this unless you are PInvoking the Win32 API or something. Micr...
I think that the question is more like "Should I dispose the file immediately or with the Dispose method of the class that accesses to that file?" It depends: if you access the file only in the constructor in my opinion there is no reason to implement the IDisposable. Using is the right way Otherwise if you use the s...
18,567,403
I want to vertically align all the input boxes in a particular is div my code is in <http://jsfiddle.net/eSPMr/72/> ``` <div id="editpart3"> <div id ="address1"> <p><b>Residential Address:</b></p> <p> Line1 : <input type="text" value="@Model.Mem_ResAdd1" name="Mem_ResAdd1" /></p> <p> Line2 : <input type="text" val...
2013/09/02
[ "https://Stackoverflow.com/questions/18567403", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2677745/" ]
Based on the information you provided, there is absolutely no reason to implement `IDisposable` or a finalizer on `Test`. Only implement a finalizer to release unmanaged resources (window handle, GDI handle, file handle). You usually do not have to ever do this unless you are PInvoking the Win32 API or something. Micr...
> > why should we use IDisposable > > > Short answer is that any class that doesn't implement IDisposable cannot be used with using. > > when using statement can itself release resources > > > no it cannot release resources itself. As i wrote above that you need to implement IDisposable inorder to be able ...
18,567,403
I want to vertically align all the input boxes in a particular is div my code is in <http://jsfiddle.net/eSPMr/72/> ``` <div id="editpart3"> <div id ="address1"> <p><b>Residential Address:</b></p> <p> Line1 : <input type="text" value="@Model.Mem_ResAdd1" name="Mem_ResAdd1" /></p> <p> Line2 : <input type="text" val...
2013/09/02
[ "https://Stackoverflow.com/questions/18567403", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2677745/" ]
The answer given by "No One" is correct that `using` block can only be used for the classes that implement the `IDisposable` interface and explanation for it is perfect. The question from your side is "Why I need to add IDisposable on Test class and But on code review, I was asked to implement IDisposable interface and...
> > why should we use IDisposable > > > Short answer is that any class that doesn't implement IDisposable cannot be used with using. > > when using statement can itself release resources > > > no it cannot release resources itself. As i wrote above that you need to implement IDisposable inorder to be able ...
18,567,403
I want to vertically align all the input boxes in a particular is div my code is in <http://jsfiddle.net/eSPMr/72/> ``` <div id="editpart3"> <div id ="address1"> <p><b>Residential Address:</b></p> <p> Line1 : <input type="text" value="@Model.Mem_ResAdd1" name="Mem_ResAdd1" /></p> <p> Line2 : <input type="text" val...
2013/09/02
[ "https://Stackoverflow.com/questions/18567403", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2677745/" ]
in your example using statement is right, because you use resources only in scope of your method. For example: ``` Test1() { using (FileStream fs = new FileStream("c:\\test.txt", FileMode.Open)) { byte[] bufer = new byte[256]; fs.Read(bufer, 0, 256); } } ``` but if the resources are used ...
I think that the question is more like "Should I dispose the file immediately or with the Dispose method of the class that accesses to that file?" It depends: if you access the file only in the constructor in my opinion there is no reason to implement the IDisposable. Using is the right way Otherwise if you use the s...
18,567,403
I want to vertically align all the input boxes in a particular is div my code is in <http://jsfiddle.net/eSPMr/72/> ``` <div id="editpart3"> <div id ="address1"> <p><b>Residential Address:</b></p> <p> Line1 : <input type="text" value="@Model.Mem_ResAdd1" name="Mem_ResAdd1" /></p> <p> Line2 : <input type="text" val...
2013/09/02
[ "https://Stackoverflow.com/questions/18567403", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2677745/" ]
The answer given by "No One" is correct that `using` block can only be used for the classes that implement the `IDisposable` interface and explanation for it is perfect. The question from your side is "Why I need to add IDisposable on Test class and But on code review, I was asked to implement IDisposable interface and...
A little note first, since you seem a bit confused about how `using` and `IDisposable` interact with each other: The reason why you're able to say `using (FileStream fileStream = Whatever()) { ... }` is precisely because the `FileStream` class implements `IDisposable`. What your coworkers have suggested is that you imp...
18,567,403
I want to vertically align all the input boxes in a particular is div my code is in <http://jsfiddle.net/eSPMr/72/> ``` <div id="editpart3"> <div id ="address1"> <p><b>Residential Address:</b></p> <p> Line1 : <input type="text" value="@Model.Mem_ResAdd1" name="Mem_ResAdd1" /></p> <p> Line2 : <input type="text" val...
2013/09/02
[ "https://Stackoverflow.com/questions/18567403", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2677745/" ]
The answer given by "No One" is correct that `using` block can only be used for the classes that implement the `IDisposable` interface and explanation for it is perfect. The question from your side is "Why I need to add IDisposable on Test class and But on code review, I was asked to implement IDisposable interface and...
in your example using statement is right, because you use resources only in scope of your method. For example: ``` Test1() { using (FileStream fs = new FileStream("c:\\test.txt", FileMode.Open)) { byte[] bufer = new byte[256]; fs.Read(bufer, 0, 256); } } ``` but if the resources are used ...
18,567,403
I want to vertically align all the input boxes in a particular is div my code is in <http://jsfiddle.net/eSPMr/72/> ``` <div id="editpart3"> <div id ="address1"> <p><b>Residential Address:</b></p> <p> Line1 : <input type="text" value="@Model.Mem_ResAdd1" name="Mem_ResAdd1" /></p> <p> Line2 : <input type="text" val...
2013/09/02
[ "https://Stackoverflow.com/questions/18567403", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2677745/" ]
A little note first, since you seem a bit confused about how `using` and `IDisposable` interact with each other: The reason why you're able to say `using (FileStream fileStream = Whatever()) { ... }` is precisely because the `FileStream` class implements `IDisposable`. What your coworkers have suggested is that you imp...
> > why should we use IDisposable > > > Short answer is that any class that doesn't implement IDisposable cannot be used with using. > > when using statement can itself release resources > > > no it cannot release resources itself. As i wrote above that you need to implement IDisposable inorder to be able ...
18,567,403
I want to vertically align all the input boxes in a particular is div my code is in <http://jsfiddle.net/eSPMr/72/> ``` <div id="editpart3"> <div id ="address1"> <p><b>Residential Address:</b></p> <p> Line1 : <input type="text" value="@Model.Mem_ResAdd1" name="Mem_ResAdd1" /></p> <p> Line2 : <input type="text" val...
2013/09/02
[ "https://Stackoverflow.com/questions/18567403", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2677745/" ]
The answer given by "No One" is correct that `using` block can only be used for the classes that implement the `IDisposable` interface and explanation for it is perfect. The question from your side is "Why I need to add IDisposable on Test class and But on code review, I was asked to implement IDisposable interface and...
I think that the question is more like "Should I dispose the file immediately or with the Dispose method of the class that accesses to that file?" It depends: if you access the file only in the constructor in my opinion there is no reason to implement the IDisposable. Using is the right way Otherwise if you use the s...
37,389,064
I have a management web application located on a remote server. This app was written using a MEAN stack and I have a list of all the RESTful routes necessary to connect to the web app. I am writing a Java client application that needs to send and receive data from this management app. How do connect the client to the ...
2016/05/23
[ "https://Stackoverflow.com/questions/37389064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6370788/" ]
There are plenty of libraries to consume REST applications in Java nowadays. The standard ------------ The JAX-RS Client API ([`javax.ws.rs.client`](https://docs.oracle.com/javaee/7/api/javax/ws/rs/client/package-summary.html) package), defined in the [JSR 339](http://download.oracle.com/otn-pub/jcp/jaxrs-2_0-fr-eval...
I would begin by reading the documentation for [Jersey](https://jersey.java.net/), specifically the [Client](https://jersey.java.net/documentation/latest/client.html) portion. You will want to familiarize yourself with the `WebTarget` class and it is invoked (example from the documentation): ``` ClientConfig clientCon...
47,280,160
How can I query an Excel file where the rows and columns are reversed / rotated 90 degrees? Can it be done with a SELECT query, or do I need to recurse the cells programmatically? It's for a .NET app, so linq or other suggestions are welcome. [![Skewed Excel](https://i.stack.imgur.com/NC3EH.jpg)](https://i.stack.img...
2017/11/14
[ "https://Stackoverflow.com/questions/47280160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/806379/" ]
You could take a part of the string for year and month group in a hash table and take for every group a new array and put this array to the result set. ```js var data = [{ date: "2016-08-13" }, { date: "2016-07-23" }, { date: "2016-08-11" }, { date: "2016-08-10" }, { date: "2016-07-20" }, { date: "2016-07-21" }], ...
```js var data = [ { date: "2016-08-13"}, { date: "2016-07-23"}, { date: "2016-08-11"}, { date: "2016-08-10"}, { date: "2016-07-20"}, { date: "2016-07-21"}, ]; data.sort(function(a, b) { var aDate = new Date(a.date); var bDate = new Date(b.date); return bDate - aDate; }); console.log(d...
47,280,160
How can I query an Excel file where the rows and columns are reversed / rotated 90 degrees? Can it be done with a SELECT query, or do I need to recurse the cells programmatically? It's for a .NET app, so linq or other suggestions are welcome. [![Skewed Excel](https://i.stack.imgur.com/NC3EH.jpg)](https://i.stack.img...
2017/11/14
[ "https://Stackoverflow.com/questions/47280160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/806379/" ]
You could take a part of the string for year and month group in a hash table and take for every group a new array and put this array to the result set. ```js var data = [{ date: "2016-08-13" }, { date: "2016-07-23" }, { date: "2016-08-11" }, { date: "2016-08-10" }, { date: "2016-07-20" }, { date: "2016-07-21" }], ...
You can use `array#reduce` to group object based on month. ```js var data = [{ date: "2016-08-13"},{ date: "2016-07-23"},{ date: "2016-08-11"},{ date: "2016-08-10"},{ date: "2016-07-20"},{ date: "2016-07-21"}]; var result = data.reduce((res,obj) => { let [year, month, day] = obj.date.split('-'); if(res[month]...
47,280,160
How can I query an Excel file where the rows and columns are reversed / rotated 90 degrees? Can it be done with a SELECT query, or do I need to recurse the cells programmatically? It's for a .NET app, so linq or other suggestions are welcome. [![Skewed Excel](https://i.stack.imgur.com/NC3EH.jpg)](https://i.stack.img...
2017/11/14
[ "https://Stackoverflow.com/questions/47280160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/806379/" ]
You could take a part of the string for year and month group in a hash table and take for every group a new array and put this array to the result set. ```js var data = [{ date: "2016-08-13" }, { date: "2016-07-23" }, { date: "2016-08-11" }, { date: "2016-08-10" }, { date: "2016-07-20" }, { date: "2016-07-21" }], ...
Group by Month: ``` var groupedData = []; for(i=0;i<12;i++) groupedData.push([]); for(var index = 0;index<data.length;index++){ var date = new Date(data[index].date); groupedData[date.getMonth()] = data[index]; } ```
47,280,160
How can I query an Excel file where the rows and columns are reversed / rotated 90 degrees? Can it be done with a SELECT query, or do I need to recurse the cells programmatically? It's for a .NET app, so linq or other suggestions are welcome. [![Skewed Excel](https://i.stack.imgur.com/NC3EH.jpg)](https://i.stack.img...
2017/11/14
[ "https://Stackoverflow.com/questions/47280160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/806379/" ]
You could take a part of the string for year and month group in a hash table and take for every group a new array and put this array to the result set. ```js var data = [{ date: "2016-08-13" }, { date: "2016-07-23" }, { date: "2016-08-11" }, { date: "2016-08-10" }, { date: "2016-07-20" }, { date: "2016-07-21" }], ...
``` var data = [ { date: "2016-08-13"}, { date: "2016-07-23"}, { date: "2016-08-11"}, { date: "2016-08-10"}, { date: "2016-07-20"}, { date: "2016-07-21"} ]; var monthDateIndex = { "01": "Jan", "02" : "Feb", "03" : "mar", "04" : "april", "05" : "may", "06" : "june", "07" : "july", "08" : "august", "09" : "sep...
47,280,160
How can I query an Excel file where the rows and columns are reversed / rotated 90 degrees? Can it be done with a SELECT query, or do I need to recurse the cells programmatically? It's for a .NET app, so linq or other suggestions are welcome. [![Skewed Excel](https://i.stack.imgur.com/NC3EH.jpg)](https://i.stack.img...
2017/11/14
[ "https://Stackoverflow.com/questions/47280160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/806379/" ]
You can use `array#reduce` to group object based on month. ```js var data = [{ date: "2016-08-13"},{ date: "2016-07-23"},{ date: "2016-08-11"},{ date: "2016-08-10"},{ date: "2016-07-20"},{ date: "2016-07-21"}]; var result = data.reduce((res,obj) => { let [year, month, day] = obj.date.split('-'); if(res[month]...
```js var data = [ { date: "2016-08-13"}, { date: "2016-07-23"}, { date: "2016-08-11"}, { date: "2016-08-10"}, { date: "2016-07-20"}, { date: "2016-07-21"}, ]; data.sort(function(a, b) { var aDate = new Date(a.date); var bDate = new Date(b.date); return bDate - aDate; }); console.log(d...
47,280,160
How can I query an Excel file where the rows and columns are reversed / rotated 90 degrees? Can it be done with a SELECT query, or do I need to recurse the cells programmatically? It's for a .NET app, so linq or other suggestions are welcome. [![Skewed Excel](https://i.stack.imgur.com/NC3EH.jpg)](https://i.stack.img...
2017/11/14
[ "https://Stackoverflow.com/questions/47280160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/806379/" ]
You can use `array#reduce` to group object based on month. ```js var data = [{ date: "2016-08-13"},{ date: "2016-07-23"},{ date: "2016-08-11"},{ date: "2016-08-10"},{ date: "2016-07-20"},{ date: "2016-07-21"}]; var result = data.reduce((res,obj) => { let [year, month, day] = obj.date.split('-'); if(res[month]...
Group by Month: ``` var groupedData = []; for(i=0;i<12;i++) groupedData.push([]); for(var index = 0;index<data.length;index++){ var date = new Date(data[index].date); groupedData[date.getMonth()] = data[index]; } ```
47,280,160
How can I query an Excel file where the rows and columns are reversed / rotated 90 degrees? Can it be done with a SELECT query, or do I need to recurse the cells programmatically? It's for a .NET app, so linq or other suggestions are welcome. [![Skewed Excel](https://i.stack.imgur.com/NC3EH.jpg)](https://i.stack.img...
2017/11/14
[ "https://Stackoverflow.com/questions/47280160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/806379/" ]
You can use `array#reduce` to group object based on month. ```js var data = [{ date: "2016-08-13"},{ date: "2016-07-23"},{ date: "2016-08-11"},{ date: "2016-08-10"},{ date: "2016-07-20"},{ date: "2016-07-21"}]; var result = data.reduce((res,obj) => { let [year, month, day] = obj.date.split('-'); if(res[month]...
``` var data = [ { date: "2016-08-13"}, { date: "2016-07-23"}, { date: "2016-08-11"}, { date: "2016-08-10"}, { date: "2016-07-20"}, { date: "2016-07-21"} ]; var monthDateIndex = { "01": "Jan", "02" : "Feb", "03" : "mar", "04" : "april", "05" : "may", "06" : "june", "07" : "july", "08" : "august", "09" : "sep...
205,911
This is likely piling one mystery on another, but ... I was exploring a function $f(n): \mathbb{N} \mapsto \mathbb{N}$ defined as follows: $$ f(n) = \begin{cases} n^2 & \text{if} \;n \;\text{is prime} \\ \lfloor n/2 \rfloor & \text{if} \;n \;\text{is composite} \end{cases} $$ For example, $$ \begin{eqnarray\*} f(11) ...
2015/05/06
[ "https://mathoverflow.net/questions/205911", "https://mathoverflow.net", "https://mathoverflow.net/users/6094/" ]
Let us use a rough estimate for the probability of a large integer $n$ being prime as $\frac{1}{\ln n}$ (as suggested by [PNT](http://en.wikipedia.org/wiki/Prime_number_theorem)). Then the expectation of $\ln f(n)$ can be estimated as $$\frac{1}{\ln n}\cdot \ln n^2 + \left(1-\frac{1}{\ln n}\right)\cdot \ln \lfloor \fra...
The full detail of this is of course a complex matter but I can build out some structure and connect the problem to some powerful tools for you; namely that, like the Collatz conjecture, this structure descends linear combinations of [Lucas sequences](https://en.wikipedia.org/wiki/Lucas_sequence). The floor function o...
205,911
This is likely piling one mystery on another, but ... I was exploring a function $f(n): \mathbb{N} \mapsto \mathbb{N}$ defined as follows: $$ f(n) = \begin{cases} n^2 & \text{if} \;n \;\text{is prime} \\ \lfloor n/2 \rfloor & \text{if} \;n \;\text{is composite} \end{cases} $$ For example, $$ \begin{eqnarray\*} f(11) ...
2015/05/06
[ "https://mathoverflow.net/questions/205911", "https://mathoverflow.net", "https://mathoverflow.net/users/6094/" ]
Let us use a rough estimate for the probability of a large integer $n$ being prime as $\frac{1}{\ln n}$ (as suggested by [PNT](http://en.wikipedia.org/wiki/Prime_number_theorem)). Then the expectation of $\ln f(n)$ can be estimated as $$\frac{1}{\ln n}\cdot \ln n^2 + \left(1-\frac{1}{\ln n}\right)\cdot \ln \lfloor \fra...
This is not an answer, just a comment to give another display of the results for smaller $n$. It is produced using Pari/GP and its inherent "ispseudoprime()" function. I document the (odd) initial number $n$ and then a string of numbers. Here the numbers mean the number of consecutive division operations after one s...
205,911
This is likely piling one mystery on another, but ... I was exploring a function $f(n): \mathbb{N} \mapsto \mathbb{N}$ defined as follows: $$ f(n) = \begin{cases} n^2 & \text{if} \;n \;\text{is prime} \\ \lfloor n/2 \rfloor & \text{if} \;n \;\text{is composite} \end{cases} $$ For example, $$ \begin{eqnarray\*} f(11) ...
2015/05/06
[ "https://mathoverflow.net/questions/205911", "https://mathoverflow.net", "https://mathoverflow.net/users/6094/" ]
The full detail of this is of course a complex matter but I can build out some structure and connect the problem to some powerful tools for you; namely that, like the Collatz conjecture, this structure descends linear combinations of [Lucas sequences](https://en.wikipedia.org/wiki/Lucas_sequence). The floor function o...
This is not an answer, just a comment to give another display of the results for smaller $n$. It is produced using Pari/GP and its inherent "ispseudoprime()" function. I document the (odd) initial number $n$ and then a string of numbers. Here the numbers mean the number of consecutive division operations after one s...
116,714
I have added two mail accounts to Opera M2 (10.50). When I hit Compose it uses the mail account that's on the top of the list as default to send from. But I want it the other account to be on the top. How can I change this? Can't drag the account in the Mail and Chat accounts dialog. Didn't find anything about it in o...
2010/03/05
[ "https://superuser.com/questions/116714", "https://superuser.com", "https://superuser.com/users/62/" ]
Ok, I figured out a way, but hopefully someone else will have a less hackish way :p Close Opera and go to the Mail Root Directory of Opera and open up the `accounts.ini` file. There you'll find a section called `[Accounts]` at the top. In there you'll find some lines which reads `AccountX=Y`, where `X` is a sequential...
Interesting. I am also unable to find a setting for that! Suggest you delete and recreate the email accounts in reverse order, so that the desired account is at the top of the list and works as the 'default'.
8,903,688
I'm using the SharePoint Managed Client Object Model API to retrieve files from SharePoint to my console app which is written in C#. My code (abbreviated here) looks something like this: ``` ClientContext clientContext = GetClientContext(sitePath); Web rootWeb = clientContext.Web; var files= rootWeb.GetFolderByServer...
2012/01/18
[ "https://Stackoverflow.com/questions/8903688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/466086/" ]
I figured out my problem. My sitePath wasn't quite complete. I had part of the site prefixed to the relativeURL. So, I could create the site context and also get the folder but since the clientContext wasn't built completely with the site I wanted, I could never get the files.
I'm just starting myself, but my code looks just like yours, but I have this loop following it ``` ... clientContext.ExecuteQuery(); foreach( File file in files ) { Debug.WriteLine( file.ServerRelativeUrl + "\t Level: " + file.Level + "\t modified: " + file.TimeLastModified + "\t by: " + file.ModifiedBy.ToStr...
43,516,176
I have a form with a field which lets the user change the number of results on the page, the plan is that the form is submitted to update the results if they change the page size. ``` <form id="js-selectionForm" class="simple_form" method="get" action="/knowledge/contaminants.php"> <div class="pad-5"> ... </div> <div...
2017/04/20
[ "https://Stackoverflow.com/questions/43516176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3726831/" ]
You're checking it wrong way so consider this right logic for your desired output. ``` private void btnadd_Click(object sender, EventArgs e) { if (!rbmale.Checked && !rbfemale.Checked && !rbothers.Checked) { MessageBox.Show("Please select gender ", "Error"); return; } ``` > > **By writin...
It should be like ``` !rbmale.Checked && !rbfemale.Checked && !rbothers.Checked ```
43,516,176
I have a form with a field which lets the user change the number of results on the page, the plan is that the form is submitted to update the results if they change the page size. ``` <form id="js-selectionForm" class="simple_form" method="get" action="/knowledge/contaminants.php"> <div class="pad-5"> ... </div> <div...
2017/04/20
[ "https://Stackoverflow.com/questions/43516176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3726831/" ]
It should be like ``` !rbmale.Checked && !rbfemale.Checked && !rbothers.Checked ```
You can also write something like ``` if (!(rbmale.Checked || rbfemale.Checked || rbothers.Checked)) { } ```
43,516,176
I have a form with a field which lets the user change the number of results on the page, the plan is that the form is submitted to update the results if they change the page size. ``` <form id="js-selectionForm" class="simple_form" method="get" action="/knowledge/contaminants.php"> <div class="pad-5"> ... </div> <div...
2017/04/20
[ "https://Stackoverflow.com/questions/43516176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3726831/" ]
It should be like ``` !rbmale.Checked && !rbfemale.Checked && !rbothers.Checked ```
Guessing that Chirag has the answer that you are looking for but there are many ways to check if all the values are false. Here are some alternatives: ``` if (!rbmale.Checked & !rbfemale.Checked & !rbothers.Checked) { } if (new[] {rbmale.Checked,rbfemale.Checked,rbothers.Checked}.All(x => !x)) { } if (!rbmale.Check...
43,516,176
I have a form with a field which lets the user change the number of results on the page, the plan is that the form is submitted to update the results if they change the page size. ``` <form id="js-selectionForm" class="simple_form" method="get" action="/knowledge/contaminants.php"> <div class="pad-5"> ... </div> <div...
2017/04/20
[ "https://Stackoverflow.com/questions/43516176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3726831/" ]
You're checking it wrong way so consider this right logic for your desired output. ``` private void btnadd_Click(object sender, EventArgs e) { if (!rbmale.Checked && !rbfemale.Checked && !rbothers.Checked) { MessageBox.Show("Please select gender ", "Error"); return; } ``` > > **By writin...
You can also write something like ``` if (!(rbmale.Checked || rbfemale.Checked || rbothers.Checked)) { } ```
43,516,176
I have a form with a field which lets the user change the number of results on the page, the plan is that the form is submitted to update the results if they change the page size. ``` <form id="js-selectionForm" class="simple_form" method="get" action="/knowledge/contaminants.php"> <div class="pad-5"> ... </div> <div...
2017/04/20
[ "https://Stackoverflow.com/questions/43516176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3726831/" ]
You're checking it wrong way so consider this right logic for your desired output. ``` private void btnadd_Click(object sender, EventArgs e) { if (!rbmale.Checked && !rbfemale.Checked && !rbothers.Checked) { MessageBox.Show("Please select gender ", "Error"); return; } ``` > > **By writin...
Guessing that Chirag has the answer that you are looking for but there are many ways to check if all the values are false. Here are some alternatives: ``` if (!rbmale.Checked & !rbfemale.Checked & !rbothers.Checked) { } if (new[] {rbmale.Checked,rbfemale.Checked,rbothers.Checked}.All(x => !x)) { } if (!rbmale.Check...
3,333,449
On Wikipedia, the definition of the dirac delta function is given as: ![enter image description here](https://i.stack.imgur.com/T8mDe.png) Suppose I have a function where at two points, the function goes to infinity. Given that the distance between the two points is $a$, if I take $a$ tends to 0, will I get a Dirac d...
2019/08/25
[ "https://math.stackexchange.com/questions/3333449", "https://math.stackexchange.com", "https://math.stackexchange.com/users/639000/" ]
The Dirac delta as function takes continuous functions as arguments and returns their value at $x=0$. That is, another name would be "evaluation operator". In still another characterization, it is the unit of convolution, $f\*\delta=f$. If you want to think in real functions, you can only sensibly define approximatio...
Suppose a sequence $\delta\_n$ of functions is proposed to distributionally satisfy $\delta\_n\stackrel{n\to\infty}{\to}\delta$ (it has to be distributional convergence; it can't be pointwise, because $\delta$ isn't a true function). For $f$ a Schwartz function,$$f(0)=\int\_{\Bbb R}\delta(x)f(x)dx=\lim\_{n\to\infty}\in...
10,665,024
I m new in iphone.I need to know that how to get image from library without using UIImagePicker controller in iphone. i m picking image from library through UIImagePicker and store image name in Database but i want to fetch that images back from library with name without UIImagePicker controller. can anyone tell me h...
2012/05/19
[ "https://Stackoverflow.com/questions/10665024", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1278381/" ]
First of all , using UIImagePicker controller is the best way to do this but imposes UI restrictions. You can use ALAssetsLibrary to pick up images and show it in your own UI. Third and the most dirty technique would be to pick the image from imagepickercontroller and save it in your documentsDir to pick from there in...
You can try NSFileManager to access files of the camera directory /User/Media/DCIM/. And then open the files and loading them into UIImageViews. Not sure on how Apple would react on this as you're accessing files outside your apps sandbox.
10,665,024
I m new in iphone.I need to know that how to get image from library without using UIImagePicker controller in iphone. i m picking image from library through UIImagePicker and store image name in Database but i want to fetch that images back from library with name without UIImagePicker controller. can anyone tell me h...
2012/05/19
[ "https://Stackoverflow.com/questions/10665024", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1278381/" ]
The best way is uiimagePickercontroller. Or else You can save it in your database n retrieve it n display it on UIActionSheet as it will give look of imagepicker without using it.
You can try NSFileManager to access files of the camera directory /User/Media/DCIM/. And then open the files and loading them into UIImageViews. Not sure on how Apple would react on this as you're accessing files outside your apps sandbox.
10,665,024
I m new in iphone.I need to know that how to get image from library without using UIImagePicker controller in iphone. i m picking image from library through UIImagePicker and store image name in Database but i want to fetch that images back from library with name without UIImagePicker controller. can anyone tell me h...
2012/05/19
[ "https://Stackoverflow.com/questions/10665024", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1278381/" ]
The best way is uiimagePickercontroller. Or else You can save it in your database n retrieve it n display it on UIActionSheet as it will give look of imagepicker without using it.
First of all , using UIImagePicker controller is the best way to do this but imposes UI restrictions. You can use ALAssetsLibrary to pick up images and show it in your own UI. Third and the most dirty technique would be to pick the image from imagepickercontroller and save it in your documentsDir to pick from there in...
33,040,854
I'm using Anaconda to install Theano on MacOSX (Mavericks 10.9 ), just like this post explains: "[How to make Theano operate on Mac Lion?](https://stackoverflow.com/questions/30398000/how-to-make-theano-operate-on-mac-lion)" > > theano.test() > > > This command gives the same error as in the post above. It gives...
2015/10/09
[ "https://Stackoverflow.com/questions/33040854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1374969/" ]
The first error is not indicating that `gcc` failed to be found, rather it is saying that `gcc` reported an error and that error was that the file `cuda.h` could not be found. That error suggests you don't have the CUDA toolkit installed. You need to install this before proceeding to install PyCUDA. The CUDA toolkit c...
I resolved this same issue with a combination of two things: 1. Making sure `nvcc` is in your `PATH` seems resolve the compilation errors. If you then encounter the following linking error: `ld: file not found: @rpath/CUDA.framework/Versions/A/CUDA for architecture x86_64 clang: error: linker command failed with exit...
987,181
I need to automatically run my script `/var/www/html/configWWW` when any USB is plugged in to my Rasperry. UDEV RULE - `/etc/udev/rules.d/myRule.rules` ``` ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="****", ATTR{idProduct}=="****", RUN+="/var/www/html/configWWW" ``` MY SCRIPT `/var/www/html/configWWW` ``` #!...
2017/12/17
[ "https://askubuntu.com/questions/987181", "https://askubuntu.com", "https://askubuntu.com/users/772605/" ]
There is a problem running scripts from udev, very little survives when the sandbox is discarded (mounts, network connections ...). The second reason, scripts running from udev will block all further events for this or a dependent device and will eventually timeout and all running processes started by the script will b...
Better if you could add `udevadm info -a ...` to the post. Anyway, here few things I expect: * Set the script executable permission bit. * Change the rule filename to standard format, example `99-alpha.rules` * Check out the difference between `SUBSYSTEM` and `SUBSYSTEMS`, and between `ATTR` and `ATTRS`. See `man ude...
241,424
I'm generating a bunch of points inside a `BoundaryMeshRegion`. Then I generate the Voronoi mesh of the points, and take the intersection of the Voronoi cells into the region. How could I recover the adjacency of the resulting cells? The problem is that at the end I end up with a list of independent mesh cell regions, ...
2021/03/09
[ "https://mathematica.stackexchange.com/questions/241424", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/53229/" ]
This is surprisingly cumbersome. Even if one first converts all the `Boundary MeshRegion` s, then `RegionUnion` (which was my first guess) creates just a `MeshRegion` with only the boundary of the geometry stored as a single polygon. The following should work however. First we extract all the polygons in `myIntersecti...
An alternative approach to get intersection cells and face connectivity graph: ``` polygons = Graphics`PolygonUtils`PolygonCombine @ Graphics`PolygonUtils`PolygonIntersection[#, MeshPrimitives[myMeshRegion, 2]] & /@ MeshPrimitives[myVoronoi, 2]; Show[myMeshRegion, Graphics[{EdgeForm[White], RandomColo...
1,820,593
I know how to get the correct answer. > > $$\lim\_{x \to \infty } \sqrt{(x^2 + 7x)} - x$$ > $$\lim\_{x \to \infty } \frac{(x^2 + 7x) - x^2}{\sqrt{(x^2 + 7x)} + x}$$ > $$\lim\_{x \to \infty } \frac{7x}{\sqrt{x(x + 7)} + x}$$ > $$\lim\_{x \to \infty } \frac{7 \sqrt{x}}{\sqrt{(x + 7)} + \sqrt{x}}$$ > > > Now as ...
2016/06/10
[ "https://math.stackexchange.com/questions/1820593", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Hint $\infty-\infty$ is an indeterminate form it's not equal to $0$ so to get some finite value we multiply by conjugate
In the second way, you are making a mistake writing > > the value of $\lim\_{x \to \infty } \sqrt{(x + 7)}$ becomes similar to $\lim\_{x \to \infty } \sqrt{x}$ > > > In fact, for large values of $x$, $$\sqrt{x^2 + 7x}=x \sqrt{1+\frac 7 x}\approx x\left(1+\frac 7 {2x} \right)$$
1,820,593
I know how to get the correct answer. > > $$\lim\_{x \to \infty } \sqrt{(x^2 + 7x)} - x$$ > $$\lim\_{x \to \infty } \frac{(x^2 + 7x) - x^2}{\sqrt{(x^2 + 7x)} + x}$$ > $$\lim\_{x \to \infty } \frac{7x}{\sqrt{x(x + 7)} + x}$$ > $$\lim\_{x \to \infty } \frac{7 \sqrt{x}}{\sqrt{(x + 7)} + \sqrt{x}}$$ > > > Now as ...
2016/06/10
[ "https://math.stackexchange.com/questions/1820593", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
We can say that they are *almost* the same, so that in the difference the equal part cancel and what remains is exactly what in which they differ, so neglecting this part leads to an error.
Hint $\infty-\infty$ is an indeterminate form it's not equal to $0$ so to get some finite value we multiply by conjugate
1,820,593
I know how to get the correct answer. > > $$\lim\_{x \to \infty } \sqrt{(x^2 + 7x)} - x$$ > $$\lim\_{x \to \infty } \frac{(x^2 + 7x) - x^2}{\sqrt{(x^2 + 7x)} + x}$$ > $$\lim\_{x \to \infty } \frac{7x}{\sqrt{x(x + 7)} + x}$$ > $$\lim\_{x \to \infty } \frac{7 \sqrt{x}}{\sqrt{(x + 7)} + \sqrt{x}}$$ > > > Now as ...
2016/06/10
[ "https://math.stackexchange.com/questions/1820593", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
I think students often think that limits are an approximate tool and when dealing with limits we can replace $A$ by $B$ even when $A \neq B$. *Sorry!!! This is never the case in mathematics.* You can replace $A$ by $B$ only when $A = B$. Thus in your first approach when you reach the fraction $$\frac{7\sqrt{x}}{\sqrt{...
Hint $\infty-\infty$ is an indeterminate form it's not equal to $0$ so to get some finite value we multiply by conjugate
1,820,593
I know how to get the correct answer. > > $$\lim\_{x \to \infty } \sqrt{(x^2 + 7x)} - x$$ > $$\lim\_{x \to \infty } \frac{(x^2 + 7x) - x^2}{\sqrt{(x^2 + 7x)} + x}$$ > $$\lim\_{x \to \infty } \frac{7x}{\sqrt{x(x + 7)} + x}$$ > $$\lim\_{x \to \infty } \frac{7 \sqrt{x}}{\sqrt{(x + 7)} + \sqrt{x}}$$ > > > Now as ...
2016/06/10
[ "https://math.stackexchange.com/questions/1820593", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
We can say that they are *almost* the same, so that in the difference the equal part cancel and what remains is exactly what in which they differ, so neglecting this part leads to an error.
In the second way, you are making a mistake writing > > the value of $\lim\_{x \to \infty } \sqrt{(x + 7)}$ becomes similar to $\lim\_{x \to \infty } \sqrt{x}$ > > > In fact, for large values of $x$, $$\sqrt{x^2 + 7x}=x \sqrt{1+\frac 7 x}\approx x\left(1+\frac 7 {2x} \right)$$
1,820,593
I know how to get the correct answer. > > $$\lim\_{x \to \infty } \sqrt{(x^2 + 7x)} - x$$ > $$\lim\_{x \to \infty } \frac{(x^2 + 7x) - x^2}{\sqrt{(x^2 + 7x)} + x}$$ > $$\lim\_{x \to \infty } \frac{7x}{\sqrt{x(x + 7)} + x}$$ > $$\lim\_{x \to \infty } \frac{7 \sqrt{x}}{\sqrt{(x + 7)} + \sqrt{x}}$$ > > > Now as ...
2016/06/10
[ "https://math.stackexchange.com/questions/1820593", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Let $f:x \mapsto \sqrt x$ and $g: x \mapsto x^2+7x$. So you noticed that $g \sim (x\mapsto x^2)$ and then you concluded from that that $f\circ g \sim (x \mapsto f(x^2))$. Be this equivalence relation is generally not compatible with composition, hence the wrong result.
In the second way, you are making a mistake writing > > the value of $\lim\_{x \to \infty } \sqrt{(x + 7)}$ becomes similar to $\lim\_{x \to \infty } \sqrt{x}$ > > > In fact, for large values of $x$, $$\sqrt{x^2 + 7x}=x \sqrt{1+\frac 7 x}\approx x\left(1+\frac 7 {2x} \right)$$
1,820,593
I know how to get the correct answer. > > $$\lim\_{x \to \infty } \sqrt{(x^2 + 7x)} - x$$ > $$\lim\_{x \to \infty } \frac{(x^2 + 7x) - x^2}{\sqrt{(x^2 + 7x)} + x}$$ > $$\lim\_{x \to \infty } \frac{7x}{\sqrt{x(x + 7)} + x}$$ > $$\lim\_{x \to \infty } \frac{7 \sqrt{x}}{\sqrt{(x + 7)} + \sqrt{x}}$$ > > > Now as ...
2016/06/10
[ "https://math.stackexchange.com/questions/1820593", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
I think students often think that limits are an approximate tool and when dealing with limits we can replace $A$ by $B$ even when $A \neq B$. *Sorry!!! This is never the case in mathematics.* You can replace $A$ by $B$ only when $A = B$. Thus in your first approach when you reach the fraction $$\frac{7\sqrt{x}}{\sqrt{...
In the second way, you are making a mistake writing > > the value of $\lim\_{x \to \infty } \sqrt{(x + 7)}$ becomes similar to $\lim\_{x \to \infty } \sqrt{x}$ > > > In fact, for large values of $x$, $$\sqrt{x^2 + 7x}=x \sqrt{1+\frac 7 x}\approx x\left(1+\frac 7 {2x} \right)$$
1,820,593
I know how to get the correct answer. > > $$\lim\_{x \to \infty } \sqrt{(x^2 + 7x)} - x$$ > $$\lim\_{x \to \infty } \frac{(x^2 + 7x) - x^2}{\sqrt{(x^2 + 7x)} + x}$$ > $$\lim\_{x \to \infty } \frac{7x}{\sqrt{x(x + 7)} + x}$$ > $$\lim\_{x \to \infty } \frac{7 \sqrt{x}}{\sqrt{(x + 7)} + \sqrt{x}}$$ > > > Now as ...
2016/06/10
[ "https://math.stackexchange.com/questions/1820593", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
We can say that they are *almost* the same, so that in the difference the equal part cancel and what remains is exactly what in which they differ, so neglecting this part leads to an error.
Let $f:x \mapsto \sqrt x$ and $g: x \mapsto x^2+7x$. So you noticed that $g \sim (x\mapsto x^2)$ and then you concluded from that that $f\circ g \sim (x \mapsto f(x^2))$. Be this equivalence relation is generally not compatible with composition, hence the wrong result.
1,820,593
I know how to get the correct answer. > > $$\lim\_{x \to \infty } \sqrt{(x^2 + 7x)} - x$$ > $$\lim\_{x \to \infty } \frac{(x^2 + 7x) - x^2}{\sqrt{(x^2 + 7x)} + x}$$ > $$\lim\_{x \to \infty } \frac{7x}{\sqrt{x(x + 7)} + x}$$ > $$\lim\_{x \to \infty } \frac{7 \sqrt{x}}{\sqrt{(x + 7)} + \sqrt{x}}$$ > > > Now as ...
2016/06/10
[ "https://math.stackexchange.com/questions/1820593", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
I think students often think that limits are an approximate tool and when dealing with limits we can replace $A$ by $B$ even when $A \neq B$. *Sorry!!! This is never the case in mathematics.* You can replace $A$ by $B$ only when $A = B$. Thus in your first approach when you reach the fraction $$\frac{7\sqrt{x}}{\sqrt{...
Let $f:x \mapsto \sqrt x$ and $g: x \mapsto x^2+7x$. So you noticed that $g \sim (x\mapsto x^2)$ and then you concluded from that that $f\circ g \sim (x \mapsto f(x^2))$. Be this equivalence relation is generally not compatible with composition, hence the wrong result.
4,727,434
Normally, if I create: ``` <meter value="30" max="100">Low</meter> ``` I'll end up with a horizontal meter/bar if viewed on a browser that supports the html5 meter element. Is it possible to create a vertical meter with html5? The only solution I've been able to come up with so far is using CSS3 rotation (transfor...
2011/01/18
[ "https://Stackoverflow.com/questions/4727434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/500270/" ]
Transform is the answer. The whole point of meter is that it's a semantic, not a presentational element and you should be able to style it however you want with CSS>
Yeah transform is the only way to do this.. ``` -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); -o-transform: rotate(90deg); transform: rotate(90deg); ```
4,727,434
Normally, if I create: ``` <meter value="30" max="100">Low</meter> ``` I'll end up with a horizontal meter/bar if viewed on a browser that supports the html5 meter element. Is it possible to create a vertical meter with html5? The only solution I've been able to come up with so far is using CSS3 rotation (transfor...
2011/01/18
[ "https://Stackoverflow.com/questions/4727434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/500270/" ]
Transform is the answer. The whole point of meter is that it's a semantic, not a presentational element and you should be able to style it however you want with CSS>
Using transform on the meter element has a major drawback which I have yet to find an elegant way around, it doesn't seem to change the amount of horizontal width the element requires. eg, for a meter with width 180px and height 15px transformed by 270deg, the meter will show as a vertical bar with height 180px and wid...
4,727,434
Normally, if I create: ``` <meter value="30" max="100">Low</meter> ``` I'll end up with a horizontal meter/bar if viewed on a browser that supports the html5 meter element. Is it possible to create a vertical meter with html5? The only solution I've been able to come up with so far is using CSS3 rotation (transfor...
2011/01/18
[ "https://Stackoverflow.com/questions/4727434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/500270/" ]
Yeah transform is the only way to do this.. ``` -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); -o-transform: rotate(90deg); transform: rotate(90deg); ```
Using transform on the meter element has a major drawback which I have yet to find an elegant way around, it doesn't seem to change the amount of horizontal width the element requires. eg, for a meter with width 180px and height 15px transformed by 270deg, the meter will show as a vertical bar with height 180px and wid...
29,647,071
If I have two strings, Hello and Java. they are not the same size. If I wanted to concatenate them but make the larger string the same size by omit'ing chars how would I go about it? For example. Hello and Java would become elloJava and Day and test would become DayTes. All I have so far is the comparison. The print ...
2015/04/15
[ "https://Stackoverflow.com/questions/29647071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2427891/" ]
If the first String is longer : ``` // omit characters from the start of the first String System.out.print(a.substring(a.length-b.length)+b)); ``` If the second String is longer : ``` // omit characters from the end of the second String System.out.print(a+b.substring(0,a.length)); ```
You can use `String.substring`: ``` int minLength = Math.min(a.length(), b.length()); String concatenated = a.substring(a.length() - minLength) + b.substring(0, minLength); ```
29,647,071
If I have two strings, Hello and Java. they are not the same size. If I wanted to concatenate them but make the larger string the same size by omit'ing chars how would I go about it? For example. Hello and Java would become elloJava and Day and test would become DayTes. All I have so far is the comparison. The print ...
2015/04/15
[ "https://Stackoverflow.com/questions/29647071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2427891/" ]
You can use `String.substring`: ``` int minLength = Math.min(a.length(), b.length()); String concatenated = a.substring(a.length() - minLength) + b.substring(0, minLength); ```
``` public class Test { String a="Hello"; String b="Java"; public void addString() { int minLength = Math.min(a.length(), b.length()); String concatenated = a.substring(1, minLength+1) + b.substring(0, minLength); System.out.print("concatenated: " +concatenated); } ...
29,647,071
If I have two strings, Hello and Java. they are not the same size. If I wanted to concatenate them but make the larger string the same size by omit'ing chars how would I go about it? For example. Hello and Java would become elloJava and Day and test would become DayTes. All I have so far is the comparison. The print ...
2015/04/15
[ "https://Stackoverflow.com/questions/29647071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2427891/" ]
You can use `String.substring`: ``` int minLength = Math.min(a.length(), b.length()); String concatenated = a.substring(a.length() - minLength) + b.substring(0, minLength); ```
public class Test { ``` String a="Hello"; String b="Java"; public void addString() { int minLength = Math.min(a.length(), b.length()); String concatenated = a.substring(1, minLength+1) + b.substring(0, minLength); ``` OR String concatenated=((a+b).substring(1,a.length())+b); ``` System.out.print("conc...
29,647,071
If I have two strings, Hello and Java. they are not the same size. If I wanted to concatenate them but make the larger string the same size by omit'ing chars how would I go about it? For example. Hello and Java would become elloJava and Day and test would become DayTes. All I have so far is the comparison. The print ...
2015/04/15
[ "https://Stackoverflow.com/questions/29647071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2427891/" ]
If the first String is longer : ``` // omit characters from the start of the first String System.out.print(a.substring(a.length-b.length)+b)); ``` If the second String is longer : ``` // omit characters from the end of the second String System.out.print(a+b.substring(0,a.length)); ```
``` public class Test { String a="Hello"; String b="Java"; public void addString() { int minLength = Math.min(a.length(), b.length()); String concatenated = a.substring(1, minLength+1) + b.substring(0, minLength); System.out.print("concatenated: " +concatenated); } ...
29,647,071
If I have two strings, Hello and Java. they are not the same size. If I wanted to concatenate them but make the larger string the same size by omit'ing chars how would I go about it? For example. Hello and Java would become elloJava and Day and test would become DayTes. All I have so far is the comparison. The print ...
2015/04/15
[ "https://Stackoverflow.com/questions/29647071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2427891/" ]
If the first String is longer : ``` // omit characters from the start of the first String System.out.print(a.substring(a.length-b.length)+b)); ``` If the second String is longer : ``` // omit characters from the end of the second String System.out.print(a+b.substring(0,a.length)); ```
public class Test { ``` String a="Hello"; String b="Java"; public void addString() { int minLength = Math.min(a.length(), b.length()); String concatenated = a.substring(1, minLength+1) + b.substring(0, minLength); ``` OR String concatenated=((a+b).substring(1,a.length())+b); ``` System.out.print("conc...
9,157,744
I have a table named `contact`: ``` Create table contact ( Contact_ID int PK NOT NULL, Name varchar(20), MMS_Contact_ID varchar(10) NOT NULL ) ``` When am inserting the first 2 rows, `Contact_ID` and `Name`, i want to automatically update the third row (`MMS_Contact_ID`). Like this: ``` contact_ID Na...
2012/02/06
[ "https://Stackoverflow.com/questions/9157744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1191883/" ]
It should work if you define the charset in the `Content-Type` request header. I believe it is usually not defined by default. For example if you use jQuery to make the request you have to add "charset=utf-8" to the `contentType` option: <http://api.jquery.com/jQuery.ajax/> There's no way to force a web browser to sen...
What you do client-side affects how the data is sent. Apparently the data *is* sent as UTF-8 encoded, since the problem was in *reading* it server-side. So adding the `meta` (though OK) has no effect on this.
9,157,744
I have a table named `contact`: ``` Create table contact ( Contact_ID int PK NOT NULL, Name varchar(20), MMS_Contact_ID varchar(10) NOT NULL ) ``` When am inserting the first 2 rows, `Contact_ID` and `Name`, i want to automatically update the third row (`MMS_Contact_ID`). Like this: ``` contact_ID Na...
2012/02/06
[ "https://Stackoverflow.com/questions/9157744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1191883/" ]
It should work if you define the charset in the `Content-Type` request header. I believe it is usually not defined by default. For example if you use jQuery to make the request you have to add "charset=utf-8" to the `contentType` option: <http://api.jquery.com/jQuery.ajax/> There's no way to force a web browser to sen...
In pure HTML you should need `<form enctype="multipart/form-data" accept-charset="UTF-8">` set to submit utf-8 in the browser.
8,027,213
How to use getchar as the condition for a while loop and having it terminate when (c=getchar()) = EOF or '\n' or '\0'. I tried: ``` int c=0; while((c=getchar()) != EOF || '\n' || '\0'){ putchar(); } ``` Which did not work, If i entered: WEATHER(+enter). It did not terminate the loop. How can i make this work? Enl...
2011/11/06
[ "https://Stackoverflow.com/questions/8027213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1032182/" ]
I think this should work: ``` int c; while( (c=getchar()) != EOF && c!='\n' && c!='\0') { putchar(); } ``` but it might be better to just do: ``` int c=getchar(); while( c != EOF && c!='\n' && c!='\0'){ putchar(); c=getchar(); } ```
It does not work because `EOF || '\n' || '\0'` is a boolean expression which will always evaluate to `true` so the condition boils down to `if( c != true )`, which is only `true` if c is nul, which getchar() will not normally return. Assignments in conditions are always ill-advised, and some compilers will issue a war...
8,027,213
How to use getchar as the condition for a while loop and having it terminate when (c=getchar()) = EOF or '\n' or '\0'. I tried: ``` int c=0; while((c=getchar()) != EOF || '\n' || '\0'){ putchar(); } ``` Which did not work, If i entered: WEATHER(+enter). It did not terminate the loop. How can i make this work? Enl...
2011/11/06
[ "https://Stackoverflow.com/questions/8027213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1032182/" ]
Sadly, you'll need to decompose it into multiple statements. You are trying to perform the logical or of multiple things, and given "true" is "anything non-zero", and characters are just numbers, most of which are non-zero, you are basically saying "while c is not EOF, or TRUE or TRUE". I'm not entirely sure on the C ...
It does not work because `EOF || '\n' || '\0'` is a boolean expression which will always evaluate to `true` so the condition boils down to `if( c != true )`, which is only `true` if c is nul, which getchar() will not normally return. Assignments in conditions are always ill-advised, and some compilers will issue a war...
8,027,213
How to use getchar as the condition for a while loop and having it terminate when (c=getchar()) = EOF or '\n' or '\0'. I tried: ``` int c=0; while((c=getchar()) != EOF || '\n' || '\0'){ putchar(); } ``` Which did not work, If i entered: WEATHER(+enter). It did not terminate the loop. How can i make this work? Enl...
2011/11/06
[ "https://Stackoverflow.com/questions/8027213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1032182/" ]
``` while ((c = getchar()) != EOF && c != '\n' && c != '\0') { // loop body } ``` This works because the `&&` operator a) always evaluates the LHS expression first, and b) introduces a sequence point, so any side effects in the LHS expression (such as assigning the result of `getchar` to `c`) will be applied before...
If you're willing to forgo the `int c` and use `char` instead then one can code it shorter using standard library functions, while keeping the 'exclusion list' extensible: ``` char terminate_on[] = { EOF, '\n', '\0' }; /* needs to end with '\0' */ char c[2] = { '\0', '\0' }; while ((*c = getchar()) && !strpbrk(c, ...
8,027,213
How to use getchar as the condition for a while loop and having it terminate when (c=getchar()) = EOF or '\n' or '\0'. I tried: ``` int c=0; while((c=getchar()) != EOF || '\n' || '\0'){ putchar(); } ``` Which did not work, If i entered: WEATHER(+enter). It did not terminate the loop. How can i make this work? Enl...
2011/11/06
[ "https://Stackoverflow.com/questions/8027213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1032182/" ]
Sadly, you'll need to decompose it into multiple statements. You are trying to perform the logical or of multiple things, and given "true" is "anything non-zero", and characters are just numbers, most of which are non-zero, you are basically saying "while c is not EOF, or TRUE or TRUE". I'm not entirely sure on the C ...
Factor your code, e.g. ``` while (intint((int []){ EOF, '\n', 0 }, c=getchar(), 3) ... ``` Where `intint` is a function you write like `memchr` but takes an array of ints. :-) This answer is half a joke, since the other answers solve the the problem sufficiently well already, but the point is that often defining th...
8,027,213
How to use getchar as the condition for a while loop and having it terminate when (c=getchar()) = EOF or '\n' or '\0'. I tried: ``` int c=0; while((c=getchar()) != EOF || '\n' || '\0'){ putchar(); } ``` Which did not work, If i entered: WEATHER(+enter). It did not terminate the loop. How can i make this work? Enl...
2011/11/06
[ "https://Stackoverflow.com/questions/8027213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1032182/" ]
I think this should work: ``` int c; while( (c=getchar()) != EOF && c!='\n' && c!='\0') { putchar(); } ``` but it might be better to just do: ``` int c=getchar(); while( c != EOF && c!='\n' && c!='\0'){ putchar(); c=getchar(); } ```
A quite oversized, but very individual solution could be: ``` #include <stdarg.h> #define END_INPUT -12332 // not likely to be returned from getchar()... int is_any(int c, ...) { va_list ap; va_start(ap, c); int ret = 0; while (ret == 0) { int a = va_arg(ap, int); if (a == END_INPUT) br...
8,027,213
How to use getchar as the condition for a while loop and having it terminate when (c=getchar()) = EOF or '\n' or '\0'. I tried: ``` int c=0; while((c=getchar()) != EOF || '\n' || '\0'){ putchar(); } ``` Which did not work, If i entered: WEATHER(+enter). It did not terminate the loop. How can i make this work? Enl...
2011/11/06
[ "https://Stackoverflow.com/questions/8027213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1032182/" ]
I think this should work: ``` int c; while( (c=getchar()) != EOF && c!='\n' && c!='\0') { putchar(); } ``` but it might be better to just do: ``` int c=getchar(); while( c != EOF && c!='\n' && c!='\0'){ putchar(); c=getchar(); } ```
Sadly, you'll need to decompose it into multiple statements. You are trying to perform the logical or of multiple things, and given "true" is "anything non-zero", and characters are just numbers, most of which are non-zero, you are basically saying "while c is not EOF, or TRUE or TRUE". I'm not entirely sure on the C ...
8,027,213
How to use getchar as the condition for a while loop and having it terminate when (c=getchar()) = EOF or '\n' or '\0'. I tried: ``` int c=0; while((c=getchar()) != EOF || '\n' || '\0'){ putchar(); } ``` Which did not work, If i entered: WEATHER(+enter). It did not terminate the loop. How can i make this work? Enl...
2011/11/06
[ "https://Stackoverflow.com/questions/8027213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1032182/" ]
``` while ((c = getchar()) != EOF && c != '\n' && c != '\0') { // loop body } ``` This works because the `&&` operator a) always evaluates the LHS expression first, and b) introduces a sequence point, so any side effects in the LHS expression (such as assigning the result of `getchar` to `c`) will be applied before...
Factor your code, e.g. ``` while (intint((int []){ EOF, '\n', 0 }, c=getchar(), 3) ... ``` Where `intint` is a function you write like `memchr` but takes an array of ints. :-) This answer is half a joke, since the other answers solve the the problem sufficiently well already, but the point is that often defining th...
8,027,213
How to use getchar as the condition for a while loop and having it terminate when (c=getchar()) = EOF or '\n' or '\0'. I tried: ``` int c=0; while((c=getchar()) != EOF || '\n' || '\0'){ putchar(); } ``` Which did not work, If i entered: WEATHER(+enter). It did not terminate the loop. How can i make this work? Enl...
2011/11/06
[ "https://Stackoverflow.com/questions/8027213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1032182/" ]
You could use something like this: ``` int c = 0; while((c=getchar()) != EOF) { if ((c == 0) || (c == '\n')) break; putchar(c); } ```
I think this should work: ``` int c; while( (c=getchar()) != EOF && c!='\n' && c!='\0') { putchar(); } ``` but it might be better to just do: ``` int c=getchar(); while( c != EOF && c!='\n' && c!='\0'){ putchar(); c=getchar(); } ```
8,027,213
How to use getchar as the condition for a while loop and having it terminate when (c=getchar()) = EOF or '\n' or '\0'. I tried: ``` int c=0; while((c=getchar()) != EOF || '\n' || '\0'){ putchar(); } ``` Which did not work, If i entered: WEATHER(+enter). It did not terminate the loop. How can i make this work? Enl...
2011/11/06
[ "https://Stackoverflow.com/questions/8027213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1032182/" ]
You could use something like this: ``` int c = 0; while((c=getchar()) != EOF) { if ((c == 0) || (c == '\n')) break; putchar(c); } ```
If you're willing to forgo the `int c` and use `char` instead then one can code it shorter using standard library functions, while keeping the 'exclusion list' extensible: ``` char terminate_on[] = { EOF, '\n', '\0' }; /* needs to end with '\0' */ char c[2] = { '\0', '\0' }; while ((*c = getchar()) && !strpbrk(c, ...
8,027,213
How to use getchar as the condition for a while loop and having it terminate when (c=getchar()) = EOF or '\n' or '\0'. I tried: ``` int c=0; while((c=getchar()) != EOF || '\n' || '\0'){ putchar(); } ``` Which did not work, If i entered: WEATHER(+enter). It did not terminate the loop. How can i make this work? Enl...
2011/11/06
[ "https://Stackoverflow.com/questions/8027213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1032182/" ]
You could use something like this: ``` int c = 0; while((c=getchar()) != EOF) { if ((c == 0) || (c == '\n')) break; putchar(c); } ```
Factor your code, e.g. ``` while (intint((int []){ EOF, '\n', 0 }, c=getchar(), 3) ... ``` Where `intint` is a function you write like `memchr` but takes an array of ints. :-) This answer is half a joke, since the other answers solve the the problem sufficiently well already, but the point is that often defining th...
61,400,155
Stylus code: ``` Sprite($positiveXCoordinate, $positiveYCoordinate, $width, $height) width {$width}px height {$height}px background-position -{$positiveXCoordinate}px -{$positiveYCoordinate}px ``` Error: ``` 157| Sprite($positiveXCoordinate, $positiveYCoordinate, $width, $height) 158| width {$width}px...
2020/04/24
[ "https://Stackoverflow.com/questions/61400155", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4818123/" ]
You could use the following regular expression. ``` \bhttps:\/\/[\da-z._~-]+(?:\/[\da-z._~-]+)*(\/[\da-z._~-]+) ``` If there is a match capture group 1 will contain the last forward slash followed by the remainder of the URL, provided at least one character of the URL follows the last forward slash. [Demo](https://...
Match the initial part of the URL, then *capture* non-slashes followed by a slash. If there's a match, extract the first capture group: ```js `https://www.example.com/no-match/match-this-part/ https://www.example.com/no-match/match-this-part-too https://www.example.com https://www.example.com/` .split('\n') ....
230,708
I am new to sc2. Practising Macro using Terran. I have no problem for minerals but gas always ran out. This is the major problem iam facing. I even built 3 bases but still facing 'ran out of gas' problem. Because of this issue, I am unable to bring out cost military like Thor etc. What you suggest me on this? Any tri...
2015/08/04
[ "https://gaming.stackexchange.com/questions/230708", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/118810/" ]
There's no 'tricks' to not run out of gas. **Efficiency** First of all to make sure you're making the most of your gas, at each fully saturated base there should be 3 workers at each refinery. With three workers there's a small delay before the next worker can go into the refinery so putting any more workers will not...
Yep terran units like Thor and Battlecrusisers are very expensive in their gas requirements. But 2-3 bases with mining operations are suffice for heavy demands. There can be maximum 3 SCVs harvesting per gas assimilator. You should check are you utilizing it to its full. Other than that you'll have to adjust your g...
23,660,259
Ok, so I'm pretty sure I totally hosed this up, but I'm hoping someone can tell me what I did wrong and the proper way to do this moving forward. Basically, I made some changes and then realized I was in the wrong "branch". So, I thought I could simply copy the folder with my changes to another location, then discard ...
2014/05/14
[ "https://Stackoverflow.com/questions/23660259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/114566/" ]
You can use the latest one: 3.0.1 This version has support for mongodb 2.6
watch out! mongo 3.0.1 uses updated version of gorm/hibernate libs, which are incompatible with the ones delivered with `hibernate:3.6.10.13` (the most recent version is 3.6.10.14, but when I try getting it, the dependency couldn't be resolved). That means, that the libs in the older versions of hibernate plugin can ...
23,660,259
Ok, so I'm pretty sure I totally hosed this up, but I'm hoping someone can tell me what I did wrong and the proper way to do this moving forward. Basically, I made some changes and then realized I was in the wrong "branch". So, I thought I could simply copy the folder with my changes to another location, then discard ...
2014/05/14
[ "https://Stackoverflow.com/questions/23660259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/114566/" ]
After a few tests, the last version of the mongodb Grails plugin compatible with Grails 2.2.x (2.2.4 in my case) seems to be 1.3.3. Trying to use the version after (2.0.0) gives the following: `Plugin mongodb-2.0.0 requires version [2.3.2 > *] of Grails which your current Grails installation does not meet`
You can use the latest one: 3.0.1 This version has support for mongodb 2.6
23,660,259
Ok, so I'm pretty sure I totally hosed this up, but I'm hoping someone can tell me what I did wrong and the proper way to do this moving forward. Basically, I made some changes and then realized I was in the wrong "branch". So, I thought I could simply copy the folder with my changes to another location, then discard ...
2014/05/14
[ "https://Stackoverflow.com/questions/23660259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/114566/" ]
After experimenting with various combinations. I have found that it's the 1.3.3 version of mongodb that worked for my grails version 2.2.3. additional notes: I also had to use the 1.1.9 versions grails-datastore-core and grails-datastore-simple as the 1.1.8 versions were causing a class def not found for StatelessD...
You can use the latest one: 3.0.1 This version has support for mongodb 2.6
23,660,259
Ok, so I'm pretty sure I totally hosed this up, but I'm hoping someone can tell me what I did wrong and the proper way to do this moving forward. Basically, I made some changes and then realized I was in the wrong "branch". So, I thought I could simply copy the folder with my changes to another location, then discard ...
2014/05/14
[ "https://Stackoverflow.com/questions/23660259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/114566/" ]
After a few tests, the last version of the mongodb Grails plugin compatible with Grails 2.2.x (2.2.4 in my case) seems to be 1.3.3. Trying to use the version after (2.0.0) gives the following: `Plugin mongodb-2.0.0 requires version [2.3.2 > *] of Grails which your current Grails installation does not meet`
watch out! mongo 3.0.1 uses updated version of gorm/hibernate libs, which are incompatible with the ones delivered with `hibernate:3.6.10.13` (the most recent version is 3.6.10.14, but when I try getting it, the dependency couldn't be resolved). That means, that the libs in the older versions of hibernate plugin can ...
23,660,259
Ok, so I'm pretty sure I totally hosed this up, but I'm hoping someone can tell me what I did wrong and the proper way to do this moving forward. Basically, I made some changes and then realized I was in the wrong "branch". So, I thought I could simply copy the folder with my changes to another location, then discard ...
2014/05/14
[ "https://Stackoverflow.com/questions/23660259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/114566/" ]
After experimenting with various combinations. I have found that it's the 1.3.3 version of mongodb that worked for my grails version 2.2.3. additional notes: I also had to use the 1.1.9 versions grails-datastore-core and grails-datastore-simple as the 1.1.8 versions were causing a class def not found for StatelessD...
watch out! mongo 3.0.1 uses updated version of gorm/hibernate libs, which are incompatible with the ones delivered with `hibernate:3.6.10.13` (the most recent version is 3.6.10.14, but when I try getting it, the dependency couldn't be resolved). That means, that the libs in the older versions of hibernate plugin can ...
42,262,332
My problem is similar to this one but I'm asking here because no real answer was provided there. ([meta viewport has no effect in Chrome Device Mode](https://stackoverflow.com/questions/40185620/meta-viewport-has-no-effect-in-chrome-device-mode)) I'm trying to understand how the viewport meta tag affects webpages and ...
2017/02/15
[ "https://Stackoverflow.com/questions/42262332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4671257/" ]
I have added a class ``` <style> .visible-mobile {display: none !important;} .hidden-mobile{display:none !important;} /* new class added*/ @media screen and (max-width:489px){ .visible-mobile { display: block !important; /* change inline to block */ } .hidden-mobile { display: none !important; } } ...
Your code works. The problem is that you're attempting to call media queries in Outlook, which doesn't support them. Right now, very few email clients support this kind of HTML (Apple Mail, Outlook for Mac, and iOS Mail to name almost all of them). For email, you need to write almost all CSS inline.
42,262,332
My problem is similar to this one but I'm asking here because no real answer was provided there. ([meta viewport has no effect in Chrome Device Mode](https://stackoverflow.com/questions/40185620/meta-viewport-has-no-effect-in-chrome-device-mode)) I'm trying to understand how the viewport meta tag affects webpages and ...
2017/02/15
[ "https://Stackoverflow.com/questions/42262332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4671257/" ]
I have added a class ``` <style> .visible-mobile {display: none !important;} .hidden-mobile{display:none !important;} /* new class added*/ @media screen and (max-width:489px){ .visible-mobile { display: block !important; /* change inline to block */ } .hidden-mobile { display: none !important; } } ...
You can use the `<!--[if gte mso 9]>` wrappers around elements in conjunction with adding these elements to effectively add CSS support for Outlook. it's not perfect, and Outlook 2010 and 2013 are still problematic. Also there's a tutorial [here](https://litmus.com/community/discussions/191-style-display-none-not-work...
22,880,876
I am using [Passport-Facebook](https://github.com/jaredhanson/passport-facebook) authentication. ``` passport.use(new FacebookStrategy({ clientID: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET', callbackURL: "http://www.example.com/auth/facebook/callback" }, function ...
2014/04/05
[ "https://Stackoverflow.com/questions/22880876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2063691/" ]
When passport doesn't return the `profile.emails, profile.name.givenName, profile.name.familyName` fields, or if they are missing, you can try to parse the `https://graph.facebook.com/v3.2/` url, although you still need a token. You access the url, with of course a valid token, like: <https://graph.facebook.com/v3.2/m...
``` passport.use(new FacebookStrategy({ clientID: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET', callbackURL: "http://www.example.com/auth/facebook/callback" }, function (accessToken, refreshToken, profile, done) { process.nextTick(function () { ...
22,880,876
I am using [Passport-Facebook](https://github.com/jaredhanson/passport-facebook) authentication. ``` passport.use(new FacebookStrategy({ clientID: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET', callbackURL: "http://www.example.com/auth/facebook/callback" }, function ...
2014/04/05
[ "https://Stackoverflow.com/questions/22880876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2063691/" ]
When you are authenticating use something similar to this. You need to use add 'email' in the scope when you authenticate. ``` app.get('/auth/facebook', passport.authenticate('facebook', { scope: ['email']}), function(req, res){ }); ``` That has worked for me. Here were a few links that helped me out. <https:/...
``` passport.use(new FacebookStrategy({ clientID: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET', callbackURL: "http://www.example.com/auth/facebook/callback" }, function (accessToken, refreshToken, profile, done) { process.nextTick(function () { ...
22,880,876
I am using [Passport-Facebook](https://github.com/jaredhanson/passport-facebook) authentication. ``` passport.use(new FacebookStrategy({ clientID: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET', callbackURL: "http://www.example.com/auth/facebook/callback" }, function ...
2014/04/05
[ "https://Stackoverflow.com/questions/22880876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2063691/" ]
Make sure these two things are in your code: ``` passport.use(new FacebookStrategy({ clientID: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET', callbackURL: "http://www.example.com/auth/facebook/callback" passReqToCallback : true, profileFields: ['id', 'emails',...
I would like to add more information here. While adding `profileFields: ['emails']` while creating FacebookStrategy and `passport.authorize('facebook', { scope : ['email'] })` solves issue for most of the users. There are other possible reasons where you will not get user's email after authentication. * No e-mail a...
22,880,876
I am using [Passport-Facebook](https://github.com/jaredhanson/passport-facebook) authentication. ``` passport.use(new FacebookStrategy({ clientID: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET', callbackURL: "http://www.example.com/auth/facebook/callback" }, function ...
2014/04/05
[ "https://Stackoverflow.com/questions/22880876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2063691/" ]
I would like to add more information here. While adding `profileFields: ['emails']` while creating FacebookStrategy and `passport.authorize('facebook', { scope : ['email'] })` solves issue for most of the users. There are other possible reasons where you will not get user's email after authentication. * No e-mail a...
``` passport.use(new FacebookStrategy({ clientID: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET', callbackURL: "http://www.example.com/auth/facebook/callback" }, function (accessToken, refreshToken, profile, done) { process.nextTick(function () { ...
22,880,876
I am using [Passport-Facebook](https://github.com/jaredhanson/passport-facebook) authentication. ``` passport.use(new FacebookStrategy({ clientID: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET', callbackURL: "http://www.example.com/auth/facebook/callback" }, function ...
2014/04/05
[ "https://Stackoverflow.com/questions/22880876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2063691/" ]
I would like to add more information here. While adding `profileFields: ['emails']` while creating FacebookStrategy and `passport.authorize('facebook', { scope : ['email'] })` solves issue for most of the users. There are other possible reasons where you will not get user's email after authentication. * No e-mail a...
You can use the [code provided as an example in the `passport-facebook` site](https://github.com/passport/express-4.x-facebook-example) as a starting point. Then, to get access to email, make sure to check [@Forivin's answer](https://stackoverflow.com/a/32370813/1814970).
22,880,876
I am using [Passport-Facebook](https://github.com/jaredhanson/passport-facebook) authentication. ``` passport.use(new FacebookStrategy({ clientID: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET', callbackURL: "http://www.example.com/auth/facebook/callback" }, function ...
2014/04/05
[ "https://Stackoverflow.com/questions/22880876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2063691/" ]
I would like to add more information here. While adding `profileFields: ['emails']` while creating FacebookStrategy and `passport.authorize('facebook', { scope : ['email'] })` solves issue for most of the users. There are other possible reasons where you will not get user's email after authentication. * No e-mail a...
When passport doesn't return the `profile.emails, profile.name.givenName, profile.name.familyName` fields, or if they are missing, you can try to parse the `https://graph.facebook.com/v3.2/` url, although you still need a token. You access the url, with of course a valid token, like: <https://graph.facebook.com/v3.2/m...
22,880,876
I am using [Passport-Facebook](https://github.com/jaredhanson/passport-facebook) authentication. ``` passport.use(new FacebookStrategy({ clientID: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET', callbackURL: "http://www.example.com/auth/facebook/callback" }, function ...
2014/04/05
[ "https://Stackoverflow.com/questions/22880876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2063691/" ]
When you are authenticating use something similar to this. You need to use add 'email' in the scope when you authenticate. ``` app.get('/auth/facebook', passport.authenticate('facebook', { scope: ['email']}), function(req, res){ }); ``` That has worked for me. Here were a few links that helped me out. <https:/...
Make sure you're providing the scope parameter into the first .authenticate() call, not the callback. Like this: ``` router.get("/auth/facebook", passport.authenticate("facebook", { scope: [ "email" ], // scope goes here, not below })); router.get("/auth/facebook/callback", passport.authenticate("facebook",...
22,880,876
I am using [Passport-Facebook](https://github.com/jaredhanson/passport-facebook) authentication. ``` passport.use(new FacebookStrategy({ clientID: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET', callbackURL: "http://www.example.com/auth/facebook/callback" }, function ...
2014/04/05
[ "https://Stackoverflow.com/questions/22880876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2063691/" ]
Make sure you're providing the scope parameter into the first .authenticate() call, not the callback. Like this: ``` router.get("/auth/facebook", passport.authenticate("facebook", { scope: [ "email" ], // scope goes here, not below })); router.get("/auth/facebook/callback", passport.authenticate("facebook",...
``` passport.use(new FacebookStrategy({ clientID: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET', callbackURL: "http://www.example.com/auth/facebook/callback" }, function (accessToken, refreshToken, profile, done) { process.nextTick(function () { ...