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 |
|---|---|---|---|---|---|
153,880 | How can I modify a Unity game (Windows) binary to skip the 5-second Unity logo splash screen?
I know how to mod game code using dnspy to modify `Assembly-CSharp.dll`. I'm able to find [isShowingSplashScreen](https://docs.unity3d.com/ScriptReference/Application-isShowingSplashScreen.html) but that appears to be irrelev... | 2018/02/02 | [
"https://gamedev.stackexchange.com/questions/153880",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/112180/"
] | It is possible to skip the Unity splash screen without manipulating any of the game files using a tool that accelerates the execution of a process.
[Cheat Engine](http://www.cheatengine.org/) (be weary of bloatware during download **and** installation) provides this functionality and even automation through Lua script... | You can not do this unless you have access to the engine environment that they use and have to hope that they have the enterprise edition and have selected to remove it |
153,880 | How can I modify a Unity game (Windows) binary to skip the 5-second Unity logo splash screen?
I know how to mod game code using dnspy to modify `Assembly-CSharp.dll`. I'm able to find [isShowingSplashScreen](https://docs.unity3d.com/ScriptReference/Application-isShowingSplashScreen.html) but that appears to be irrelev... | 2018/02/02 | [
"https://gamedev.stackexchange.com/questions/153880",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/112180/"
] | A morally and legally sound way that can be openly discussed on a public forum like this one is to **contact the original developer**.
If you meet with such circumstances, chances are the game is one of these 2:
1. The game is new/early access, reasonably successful (otherwise there's rarely a modding community) and ... | You can not do this unless you have access to the engine environment that they use and have to hope that they have the enterprise edition and have selected to remove it |
153,880 | How can I modify a Unity game (Windows) binary to skip the 5-second Unity logo splash screen?
I know how to mod game code using dnspy to modify `Assembly-CSharp.dll`. I'm able to find [isShowingSplashScreen](https://docs.unity3d.com/ScriptReference/Application-isShowingSplashScreen.html) but that appears to be irrelev... | 2018/02/02 | [
"https://gamedev.stackexchange.com/questions/153880",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/112180/"
] | It is possible to disable the unity splash screen on build game files.
I used unity pro to determine what files change when you switch splash screen on and off and it's the globalgamemanager file if you manually edit a specific part in it using a hex editor you can disable the splash screen
I made a tutorial on how t... | You can not do this unless you have access to the engine environment that they use and have to hope that they have the enterprise edition and have selected to remove it |
153,880 | How can I modify a Unity game (Windows) binary to skip the 5-second Unity logo splash screen?
I know how to mod game code using dnspy to modify `Assembly-CSharp.dll`. I'm able to find [isShowingSplashScreen](https://docs.unity3d.com/ScriptReference/Application-isShowingSplashScreen.html) but that appears to be irrelev... | 2018/02/02 | [
"https://gamedev.stackexchange.com/questions/153880",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/112180/"
] | It is possible to skip the Unity splash screen without manipulating any of the game files using a tool that accelerates the execution of a process.
[Cheat Engine](http://www.cheatengine.org/) (be weary of bloatware during download **and** installation) provides this functionality and even automation through Lua script... | It is possible to disable the unity splash screen on build game files.
I used unity pro to determine what files change when you switch splash screen on and off and it's the globalgamemanager file if you manually edit a specific part in it using a hex editor you can disable the splash screen
I made a tutorial on how t... |
153,880 | How can I modify a Unity game (Windows) binary to skip the 5-second Unity logo splash screen?
I know how to mod game code using dnspy to modify `Assembly-CSharp.dll`. I'm able to find [isShowingSplashScreen](https://docs.unity3d.com/ScriptReference/Application-isShowingSplashScreen.html) but that appears to be irrelev... | 2018/02/02 | [
"https://gamedev.stackexchange.com/questions/153880",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/112180/"
] | A morally and legally sound way that can be openly discussed on a public forum like this one is to **contact the original developer**.
If you meet with such circumstances, chances are the game is one of these 2:
1. The game is new/early access, reasonably successful (otherwise there's rarely a modding community) and ... | It is possible to disable the unity splash screen on build game files.
I used unity pro to determine what files change when you switch splash screen on and off and it's the globalgamemanager file if you manually edit a specific part in it using a hex editor you can disable the splash screen
I made a tutorial on how t... |
30,932,717 | I wish to check if all the checkbox is not checked, it will prevent the form being submited. For example, I have 7 checkboxs(days) in the form and if user click submit button without check one of the checkboxs, it will display an error message and prevent the form being submited. If the user check the one of the check ... | 2015/06/19 | [
"https://Stackoverflow.com/questions/30932717",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4221389/"
] | You can use [`event.preventDefault()`](http://api.jquery.com/event.preventdefault/) to prevent form from submitting;
Based on assumptions of your `HTML` structure:
```
// When form is submitted
$('form').on('submit', function(e) {
// Get the number of checked checkboxes
if ($('input[name="days[]"]:checked').... | ```
$("form").submit(function(){
$(":input[type ^= checkbox]").each(function(){
if(!$(this).is(":checked"))
{
alert("Message");
return false;
}
});
})
``` |
30,932,717 | I wish to check if all the checkbox is not checked, it will prevent the form being submited. For example, I have 7 checkboxs(days) in the form and if user click submit button without check one of the checkboxs, it will display an error message and prevent the form being submited. If the user check the one of the check ... | 2015/06/19 | [
"https://Stackoverflow.com/questions/30932717",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4221389/"
] | You can use [`event.preventDefault()`](http://api.jquery.com/event.preventdefault/) to prevent form from submitting;
Based on assumptions of your `HTML` structure:
```
// When form is submitted
$('form').on('submit', function(e) {
// Get the number of checked checkboxes
if ($('input[name="days[]"]:checked').... | Hi if you are trying to prevent the form from being submitted you try this one.
```js
$(function(){
$("#formid").submit(function(event){
var slot = 7;
$(".day").each(function(){
if($(this).is(":checked")){
var num = $('.day').index(this);
if($("[name='sd_input_dosage_value[]']... |
1,053,023 | 443 candidates enter the exam hall. There are 20 rows of seats I'm the hall. Each row has 25 seats. At least how many rows have an equal number of candidates.
My attempt
Seat 25 in the first row 24 in the second and so on...but I cannot find the worst case scenario. | 2014/12/05 | [
"https://math.stackexchange.com/questions/1053023",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/197818/"
] | A hint: Try to imagine how fast $f$ can grow from the ends towards the center of the interval.
By the way, you can replace $\leq$ by $<$ in the claim. | Hint: Let $g(x)=x-a$ where $a=\frac{3 + \sqrt{6}}{6}$. Using the Cauchy Inequality
$$ \left(\int\_0^1f'(x)g(x)dx\right)^2\le\int\_0^1(f'(x))^2dx\int\_0^1(g(x))^2dx $$
I think you will get the desired inequality. Note that
$$ \int\_0^1(x-a)^2dx=\frac{1}{4}, \int\_0^1(x-a)f'(x)dx=-\int\_0^1f(x)dx. $$ |
1,053,023 | 443 candidates enter the exam hall. There are 20 rows of seats I'm the hall. Each row has 25 seats. At least how many rows have an equal number of candidates.
My attempt
Seat 25 in the first row 24 in the second and so on...but I cannot find the worst case scenario. | 2014/12/05 | [
"https://math.stackexchange.com/questions/1053023",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/197818/"
] | Since $f(x)$ is differentiable on $I=(0,1/2]$ and $f(0)=0$,
$$g(x)\triangleq \frac{f(x)}{x}=\frac{f(x)-f(0)}{x-0}$$
is a continuous function on $I$, bounded by $M$ by Lagrange's theorem. This gives:
$$ \int\_{0}^{1/2} f(x)\,dx = \int\_{0}^{1/2}x\,g(x)\,dx \leq \int\_{0}^{1/2} Mx\,dx = \frac{M}{8}, $$
hence the claim. | Hint: Let $g(x)=x-a$ where $a=\frac{3 + \sqrt{6}}{6}$. Using the Cauchy Inequality
$$ \left(\int\_0^1f'(x)g(x)dx\right)^2\le\int\_0^1(f'(x))^2dx\int\_0^1(g(x))^2dx $$
I think you will get the desired inequality. Note that
$$ \int\_0^1(x-a)^2dx=\frac{1}{4}, \int\_0^1(x-a)f'(x)dx=-\int\_0^1f(x)dx. $$ |
7,501,718 | >
> **Possible Duplicate:**
>
> [Understanding Model-View-Controller](https://stackoverflow.com/questions/5413879/understanding-model-view-controller)
>
>
>
I have a general programming question about how to divide up my code, usually (and I'm trying to get away from this) I just write it all in the viewContro... | 2011/09/21 | [
"https://Stackoverflow.com/questions/7501718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/360481/"
] | I would use Java's built-in Javascript parser for your calculator. | You are only storing two values (value1 and value2), thus you can only do math with the two. Think of ways how you could store more values. |
7,501,718 | >
> **Possible Duplicate:**
>
> [Understanding Model-View-Controller](https://stackoverflow.com/questions/5413879/understanding-model-view-controller)
>
>
>
I have a general programming question about how to divide up my code, usually (and I'm trying to get away from this) I just write it all in the viewContro... | 2011/09/21 | [
"https://Stackoverflow.com/questions/7501718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/360481/"
] | I would use Java's built-in Javascript parser for your calculator. | why not use a tool like [jep](http://sourceforge.net/projects/jep/) to parse the expression, unless this is something you have to hand code (like a school/college project)..
either ways it doesn't hurt to see the solution which exists. |
7,501,718 | >
> **Possible Duplicate:**
>
> [Understanding Model-View-Controller](https://stackoverflow.com/questions/5413879/understanding-model-view-controller)
>
>
>
I have a general programming question about how to divide up my code, usually (and I'm trying to get away from this) I just write it all in the viewContro... | 2011/09/21 | [
"https://Stackoverflow.com/questions/7501718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/360481/"
] | I would use Java's built-in Javascript parser for your calculator. | How about you display the result of the first 2 numbers (i.e. result, which works), and then when they hit another operand, you put `value1 = result` and `value2` be the next number. Then, once they hit equals again, you get `1+2+3`. You can then implement a clear button to set `result = 0`. |
350,600 | How do you add a new variable to be inserted into a Java code template. How do I add a variable to the list in Window->Preferences->Java->Code Style->Code Templates->Code->New Java Files->Edit->Insert Variable... ?
Currently my new files get created with:
```
${filecomment}
${package_declaration}
${typecomment}
${typ... | 2008/12/08 | [
"https://Stackoverflow.com/questions/350600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18995/"
] | To contribute a new variable, you need to create a plugin and implement the org.eclipse.ui.editors.templates extension-point.
You have to contribute a sub-class of org.eclipse.jface.text.templates.TemplateVariableResolver that will implement the various resolve methods to resolve the placeholder to your desired value(... | I didn't try it, but maybe you could edit the template files in the JDT jar:
```
eclipse\plugins\org.eclipse.jdt.ui_*.jar\templates\
``` |
350,600 | How do you add a new variable to be inserted into a Java code template. How do I add a variable to the list in Window->Preferences->Java->Code Style->Code Templates->Code->New Java Files->Edit->Insert Variable... ?
Currently my new files get created with:
```
${filecomment}
${package_declaration}
${typecomment}
${typ... | 2008/12/08 | [
"https://Stackoverflow.com/questions/350600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18995/"
] | I didn't try it, but maybe you could edit the template files in the JDT jar:
```
eclipse\plugins\org.eclipse.jdt.ui_*.jar\templates\
``` | To add on to the conversation, I also wanted to insert a custom variable into a template. My issue was that I wanted to insert a variable from jsp/jstl definition inside the template.
(I.E. `<c:set var="myVariable" value="${requestScope.variableName}" />`)
This apparently caused some issues because templates already ... |
350,600 | How do you add a new variable to be inserted into a Java code template. How do I add a variable to the list in Window->Preferences->Java->Code Style->Code Templates->Code->New Java Files->Edit->Insert Variable... ?
Currently my new files get created with:
```
${filecomment}
${package_declaration}
${typecomment}
${typ... | 2008/12/08 | [
"https://Stackoverflow.com/questions/350600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18995/"
] | and see <http://ahoehma.wordpress.com/2009/08/24/use-maven-artifact-version-in-eclipse-templates/> | This is my note.
I hope it helps you.
My Eclipse Version: 2020-09 (4.17.0)
* Add GlobalTemplateVariables
Jar : org.eclipse.text.jar
1. org.eclipse.jface.text.templates.GlobalTemplateVariables
```
public static class MyID extends SimpleTemplateVariableResolver {
private static String value = System.getPrope... |
350,600 | How do you add a new variable to be inserted into a Java code template. How do I add a variable to the list in Window->Preferences->Java->Code Style->Code Templates->Code->New Java Files->Edit->Insert Variable... ?
Currently my new files get created with:
```
${filecomment}
${package_declaration}
${typecomment}
${typ... | 2008/12/08 | [
"https://Stackoverflow.com/questions/350600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18995/"
] | Yes, you can indeed add a variable to this list. See the extension point called
org.eclipse.ui.editors.templates
and you'll find out how. | To add on to the conversation, I also wanted to insert a custom variable into a template. My issue was that I wanted to insert a variable from jsp/jstl definition inside the template.
(I.E. `<c:set var="myVariable" value="${requestScope.variableName}" />`)
This apparently caused some issues because templates already ... |
350,600 | How do you add a new variable to be inserted into a Java code template. How do I add a variable to the list in Window->Preferences->Java->Code Style->Code Templates->Code->New Java Files->Edit->Insert Variable... ?
Currently my new files get created with:
```
${filecomment}
${package_declaration}
${typecomment}
${typ... | 2008/12/08 | [
"https://Stackoverflow.com/questions/350600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18995/"
] | and see <http://ahoehma.wordpress.com/2009/08/24/use-maven-artifact-version-in-eclipse-templates/> | To add on to the conversation, I also wanted to insert a custom variable into a template. My issue was that I wanted to insert a variable from jsp/jstl definition inside the template.
(I.E. `<c:set var="myVariable" value="${requestScope.variableName}" />`)
This apparently caused some issues because templates already ... |
350,600 | How do you add a new variable to be inserted into a Java code template. How do I add a variable to the list in Window->Preferences->Java->Code Style->Code Templates->Code->New Java Files->Edit->Insert Variable... ?
Currently my new files get created with:
```
${filecomment}
${package_declaration}
${typecomment}
${typ... | 2008/12/08 | [
"https://Stackoverflow.com/questions/350600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18995/"
] | I'm pretty sure that the list of "variables" is generated by Eclipse and there is no way to add a new template variable.
What do you want `${begin_filecomment}` and `${end_filecomment}` to be? Just type the content into the Edit box - there is nothing that says you cannot put static content in there. | To contribute a new variable, you need to create a plugin and implement the org.eclipse.ui.editors.templates extension-point.
You have to contribute a sub-class of org.eclipse.jface.text.templates.TemplateVariableResolver that will implement the various resolve methods to resolve the placeholder to your desired value(... |
350,600 | How do you add a new variable to be inserted into a Java code template. How do I add a variable to the list in Window->Preferences->Java->Code Style->Code Templates->Code->New Java Files->Edit->Insert Variable... ?
Currently my new files get created with:
```
${filecomment}
${package_declaration}
${typecomment}
${typ... | 2008/12/08 | [
"https://Stackoverflow.com/questions/350600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18995/"
] | I'm pretty sure that the list of "variables" is generated by Eclipse and there is no way to add a new template variable.
What do you want `${begin_filecomment}` and `${end_filecomment}` to be? Just type the content into the Edit box - there is nothing that says you cannot put static content in there. | and see <http://ahoehma.wordpress.com/2009/08/24/use-maven-artifact-version-in-eclipse-templates/> |
350,600 | How do you add a new variable to be inserted into a Java code template. How do I add a variable to the list in Window->Preferences->Java->Code Style->Code Templates->Code->New Java Files->Edit->Insert Variable... ?
Currently my new files get created with:
```
${filecomment}
${package_declaration}
${typecomment}
${typ... | 2008/12/08 | [
"https://Stackoverflow.com/questions/350600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18995/"
] | See
<http://thomaswabner.wordpress.com/2009/08/21/use-your-own-variable-in-eclipse-code-templates/> | To add on to the conversation, I also wanted to insert a custom variable into a template. My issue was that I wanted to insert a variable from jsp/jstl definition inside the template.
(I.E. `<c:set var="myVariable" value="${requestScope.variableName}" />`)
This apparently caused some issues because templates already ... |
350,600 | How do you add a new variable to be inserted into a Java code template. How do I add a variable to the list in Window->Preferences->Java->Code Style->Code Templates->Code->New Java Files->Edit->Insert Variable... ?
Currently my new files get created with:
```
${filecomment}
${package_declaration}
${typecomment}
${typ... | 2008/12/08 | [
"https://Stackoverflow.com/questions/350600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18995/"
] | To contribute a new variable, you need to create a plugin and implement the org.eclipse.ui.editors.templates extension-point.
You have to contribute a sub-class of org.eclipse.jface.text.templates.TemplateVariableResolver that will implement the various resolve methods to resolve the placeholder to your desired value(... | This is my note.
I hope it helps you.
My Eclipse Version: 2020-09 (4.17.0)
* Add GlobalTemplateVariables
Jar : org.eclipse.text.jar
1. org.eclipse.jface.text.templates.GlobalTemplateVariables
```
public static class MyID extends SimpleTemplateVariableResolver {
private static String value = System.getPrope... |
350,600 | How do you add a new variable to be inserted into a Java code template. How do I add a variable to the list in Window->Preferences->Java->Code Style->Code Templates->Code->New Java Files->Edit->Insert Variable... ?
Currently my new files get created with:
```
${filecomment}
${package_declaration}
${typecomment}
${typ... | 2008/12/08 | [
"https://Stackoverflow.com/questions/350600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18995/"
] | I'm pretty sure that the list of "variables" is generated by Eclipse and there is no way to add a new template variable.
What do you want `${begin_filecomment}` and `${end_filecomment}` to be? Just type the content into the Edit box - there is nothing that says you cannot put static content in there. | I didn't try it, but maybe you could edit the template files in the JDT jar:
```
eclipse\plugins\org.eclipse.jdt.ui_*.jar\templates\
``` |
64,009,117 | How can I change bootstrap columns depending on the state of some expression?
What I've tried:
```
<div class="@Installation.Fleet.Type.Equals("Vessel") ? col-lg-9 col-md-9 col-sm-12 : col-lg-12 col-md-12 col-sm-12">
</div>
```
However in this case, even when @Installation.Fleet.Type.Equals("Vessel") is true, the ... | 2020/09/22 | [
"https://Stackoverflow.com/questions/64009117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13678760/"
] | You should return your classes as string:
```
<div class="@Installation.Fleet.Type.Equals("Vessel") ? "col-lg-9 col-md-9 col-sm-12" : "col-lg-12 col-md-12 col-sm-12""></div>
```
I tend to always use @() instead of just @ when using ternary operators in razor views, like this:
```
<div class="@(Installation.Fleet.Ty... | You can also make a variable with name of classes like:
```
@{
var classes=@Installation.Fleet.Type.Equals("Vessel") ? "col-lg-9 col-md-9 col-sm-12" : "col-lg-12 col-md-12 col-sm-12";
}
```
and then:
```
<div class="@classes">
</div>
``` |
34,803,841 | I have a pandas series like this.
```
cluster_grtr_6
Out[100]:
Clusters
Cluster 1 7
Cluster 4 7
Cluster 5 8
Name: quant_bought, dtype: int64
```
And after applying some condition I get a variable `a`.
```
a
Out[101]:
3 Cluster 5
Name: Clusters, dtype: object
```
I want to subtract 6 from every ele... | 2016/01/15 | [
"https://Stackoverflow.com/questions/34803841",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2927983/"
] | You can use a boolean mask. First find the index labels in `a`
```
In [64]: s.index.isin(a)
Out[64]: array([False, False, True], dtype=bool)
```
Then use the fact that True is treated as 1 and False as 0 in numeric operations
```
In [65]: result = s - 6 * ~s.index.isin(a)
In [66]: result
Out[66]:
cluster 1 1
c... | Alternatively you could use following (if you have only one value in `a`):
```
s = pd.Series([7,7,8], index=['Cluster 1', 'Cluster 4', 'Cluster 5'])
a = pd.Series(['Cluster 5'], index = [3])
In [42]: 6*(s.index != a.iloc[0])
Out[42]: array([6, 6, 0])
In [43]: s - 6*(s.index != a.iloc[0])
Out[43]:
Cluster 1 1
Clus... |
5,573,438 | There is a term for this that I just cannot think of, and I'm sure if I knew that word I wouldn't be asking this question as I'd have found the answer on Google ... but I just cannot find the right terms for this.
I have a standard WinForms application (.NET 4.0) that I'm working with. I have a main form with three bu... | 2011/04/06 | [
"https://Stackoverflow.com/questions/5573438",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/138148/"
] | That would be called a modal dialog. | In WinForm, call ShowDialog to display the modal window. |
5,573,438 | There is a term for this that I just cannot think of, and I'm sure if I knew that word I wouldn't be asking this question as I'd have found the answer on Google ... but I just cannot find the right terms for this.
I have a standard WinForms application (.NET 4.0) that I'm working with. I have a main form with three bu... | 2011/04/06 | [
"https://Stackoverflow.com/questions/5573438",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/138148/"
] | That would be called a modal dialog. | And you can use ProgressBar to inform the user how long it left (or use Continuous style) if you dont know how long it will take |
5,573,438 | There is a term for this that I just cannot think of, and I'm sure if I knew that word I wouldn't be asking this question as I'd have found the answer on Google ... but I just cannot find the right terms for this.
I have a standard WinForms application (.NET 4.0) that I'm working with. I have a main form with three bu... | 2011/04/06 | [
"https://Stackoverflow.com/questions/5573438",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/138148/"
] | In WinForm, call ShowDialog to display the modal window. | And you can use ProgressBar to inform the user how long it left (or use Continuous style) if you dont know how long it will take |
263,149 | I am using the SimpleLightbox plugin (<https://wordpress.org/plugins/simplelightbox/>) on a test site: <http://joshrodg.com/theiveys/about>.
If you click on one of the pictures, SimpleLightbox opens a larger version in a Lightbox. You'll notice that to close the Lightbox you need to click the white "X" in the upper-ri... | 2017/04/10 | [
"https://wordpress.stackexchange.com/questions/263149",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/9820/"
] | You don't need any plugins to accomplish this. In fact, this is not really a use case for a masonry layout since the heights of the images are all the same. Masonry.js is for varying post heights. You just need a counter to keep track of alternating rows, and each alternating row put the small column first instead of s... | I will too suggest you to use Masonry javascript
[Here is the link to masonry project](http://masonry.desandro.com/)
```
<div class="grid" data-masonry='{ "itemSelector": ".grid-item", "columnWidth": 200 }'>
```
Run the `<div class="grid-item"></div>` inside the loop |
43,235,229 | I'm trying to get angulartics set up in a component that is being used to display errors/important info to users in a banner. However, I'm running into an issue where it seems like the values inside of the controller aren't updating or running when expected despite the banners functioning as expected.
What is happeni... | 2017/04/05 | [
"https://Stackoverflow.com/questions/43235229",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2925985/"
] | You need to specify `navbar-light` or `navbar-inverse` for the toggler icon, and active links to appear..
`<nav class="navbar navbar-light navbar-toggleable-md">`
***or***
`<nav class="navbar navbar-inverse navbar-toggleable-md">`
<http://www.codeply.com/go/HZBegMbGii>
Also, `ml-auto` would be used to [push the `... | "Glyphicons" have been removed from Bootstap 4.
>
> Dropped the Glyphicons icon font. If you need icons, some options are:
> the upstream version of Glyphicons
> Octicons
> Font Awesome
>
>
>
Via: <https://v4-alpha.getbootstrap.com/migration/#components>
The fix is to manually include Glyphicons css file. |
49,929,498 | ```
x = 0
y = 0
tx = 0
ty = 0
def setup():
size(600, 600)
noStroke()
def draw():
background(0)
textAlign(LEFT,TOP)
# text("Hello World",x,y)
tx=mouseX
ty=mouseY
f=0.01
#The error: "UnboundLocalError: local variable 'x' referenced before assignment"
x=lerp(x,tx,f)
y=lerp(y,t... | 2018/04/19 | [
"https://Stackoverflow.com/questions/49929498",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9609025/"
] | To modify global variables from within a function, you need to use the `global` statement, like so:
```
def draw():
global x, y, tx, ty
background(0)
...
```
If you were using a class, your code would look like this:
```
class Drawer(object):
def __init__(self):
self.x = 0
self.y = 0... | Should work ? I'm not into python, this is from someone else
```
x = 0
y = 0
tx = 0
ty = 0
def setup():
size(600, 600)
noStroke()
def draw():
global x, y, tx, ty
background(0)
textAlign(LEFT,TOP)
# text("Hello World",x,y)
tx=mouseX
ty=mouseY
f=0.01
x=lerp(x,tx,f)
y=lerp(y,... |
8,459,431 | I need to write a program to compress/decompress txt files using Huffman algotrithm
I have writen it, and it works good for files that have less charachters than the buffer size, but it doesnt work for files with greater number of characters.
My problem is to interface compression buffer with decompression buffer.
S... | 2011/12/10 | [
"https://Stackoverflow.com/questions/8459431",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1079443/"
] | A common way to "track" the end of stream is to add an N+1 "EOF" symbol specifically for this usage. This way, you don't need to maintain any "size" counter. | I did't use any buffers. In header of my file I write down code length, and code itself. So when I want to decompress my file, first I read code lengths and codes from my header (you can also put few bytes in header to check correctness of file: for example XXY, so if file does not start with these bytes, its corrupted... |
10,960,363 | How do i enforce lazy loading strategy just for a given NamedQuery.
for eg. Consider the below pseudo code (just to explain the case)
I have an entity
```
@Entity
class Xyz {
int a;
int b;
@Fetch = EAGER
Set<ABC> listOfItems;
}
```
In this case, we have declared listOfItems to be EAGERLY fetched.
Now suppose ... | 2012/06/09 | [
"https://Stackoverflow.com/questions/10960363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1446058/"
] | If you don't want to fetch the `Set` eagerly you have to define it as lazy. However note that the implementation is permitted to fetch eagerly when you specify lazy.
Quoting the specification:
>
> public enum FetchType
> extends java.lang.Enum
>
>
> Defines strategies for fetching data from the database. The EAGE... | If you are using EclipseLink, you can use fetch groups,
<http://wiki.eclipse.org/EclipseLink/Examples/JPA/AttributeGroup> |
915,725 | I'm used to installing ubuntu core updates from apt, and then rebooting to get to the latest kernel. However, this process doesn't seem to be working right on one of my servers. Kernel 4.10.0-21 is installed but the machine only seems to use 4.10.0-20 when it reboots.
During the [apt update process to grub2](https://h... | 2017/05/16 | [
"https://askubuntu.com/questions/915725",
"https://askubuntu.com",
"https://askubuntu.com/users/53750/"
] | In first look, everything seems fine, your `grub.cfg`, `/etc/default/grub`, Kernel installation status, everything is as it should be.
However if we check `cat /proc/version` as your output says grub is loading a wrong Kernel:
```
Linux version 4.10.0-20-generic ...
```
And as you mentioned you've got GRUB Legacy o... | I'm not running server, but desktop. I did notice something strange during my updating to 4.10.0-21.23...
At the end of the update process there was output in the terminal that said:
```
The link /vmlinuz.old is a damaged link
Removing symbolic link vmlinuz.old
you may need to re-run your boot loader[grub]
```
I r... |
34,356,160 | I'm having an issue getting nodemailer to work with AuthSMTP (<https://www.authsmtp.com/>).
```
var nodemailer = require('nodemailer');
var transOptions = {
host: 'mail.authsmtp.com',
port: 25,
secure: false,
auth: {
user: '...',
pass: '...'
}
};
var transporter = nodemailer.createT... | 2015/12/18 | [
"https://Stackoverflow.com/questions/34356160",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1003183/"
] | you may try this
```
var transOptions = {
host: 'mail.authsmtp.com',
port: 25,
secure: false,
ignoreTLS: true
auth: {
user: '...',
pass: '...',
}
``` | >
> secure – if true the connection will use TLS when connecting to
> server. If false (the default) then TLS is used if server supports the
> STARTTLS extension.
>
>
>
In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false.
>
> ignoreTLS – if this is true and ... |
34,356,160 | I'm having an issue getting nodemailer to work with AuthSMTP (<https://www.authsmtp.com/>).
```
var nodemailer = require('nodemailer');
var transOptions = {
host: 'mail.authsmtp.com',
port: 25,
secure: false,
auth: {
user: '...',
pass: '...'
}
};
var transporter = nodemailer.createT... | 2015/12/18 | [
"https://Stackoverflow.com/questions/34356160",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1003183/"
] | you may try this
```
var transOptions = {
host: 'mail.authsmtp.com',
port: 25,
secure: false,
ignoreTLS: true
auth: {
user: '...',
pass: '...',
}
``` | If you want to be safe, I think just to set you email, start IMAP/SMTP and POP/SMTP service as below:

and add your pass on your email settings:
 |
72,815,405 | I am reading the [async book](https://rust-lang.github.io/async-book/01_getting_started/01_chapter.html). In [section `async lifetimes`](https://rust-lang.github.io/async-book/03_async_await/01_chapter.html#async-lifetimes) there is a code snippet whose grammar I am not familiar with:
```rust
fn foo_expanded<'a>(x: &'... | 2022/06/30 | [
"https://Stackoverflow.com/questions/72815405",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14092446/"
] | >
> what is `impl Trait + 'lifetime` here?
>
>
>
It is an [Impl trait](https://doc.rust-lang.org/reference/types/impl-trait.html), here particularly used as an abstract return type
>
> ### Impl trait
>
>
> **Syntax**
>
>
>
> ```
> ImplTraitType : impl TypeParamBounds
> ImplTraitTypeOneBound : impl TraitBoun... | Not entirely familiar, but logically it makes sense:
The function returns a Future that, when completed returns a byte. *When* the async fn is actually executed, it moves `x`, which is a reference with a lifetime. Technically `x` could be dropped before the Future is completed. To prevent this the lifetime trait guara... |
6,939,663 | Why assign a function to a variable? What's the point in assigning int x, y to ReadNumber() ? Is it for storing return value of function in a variable? Or is this just a way to pass arguments?
```
#include <iostream>
int ReadNumber()
{
using namespace std;
cout << "Enter a number: ";
int x;
cin >> x;
... | 2011/08/04 | [
"https://Stackoverflow.com/questions/6939663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/878362/"
] | Yes, it is storing the return value of the function.
The code calls the ReadNumber function twice first. ReadNumber reads a string from the console then returns it as an int. The code stores the two function returns. It then adds these two numbers together and passes it as an argument to the WriteAnswer function. The ... | * "why does he assign a function to a variable?"
He doesn't. This(note the brackets):
```
// vv
int x = ReadNumber();
```
assigns the returned value to `x`. The brackets mean, that the function is actually called - or the body is executed. That function has `return x;` at the end, so it returns the v... |
6,939,663 | Why assign a function to a variable? What's the point in assigning int x, y to ReadNumber() ? Is it for storing return value of function in a variable? Or is this just a way to pass arguments?
```
#include <iostream>
int ReadNumber()
{
using namespace std;
cout << "Enter a number: ";
int x;
cin >> x;
... | 2011/08/04 | [
"https://Stackoverflow.com/questions/6939663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/878362/"
] | * "why does he assign a function to a variable?"
He doesn't. This(note the brackets):
```
// vv
int x = ReadNumber();
```
assigns the returned value to `x`. The brackets mean, that the function is actually called - or the body is executed. That function has `return x;` at the end, so it returns the v... | He doesn't assign the function/method itself but the results...
He's assigning the results of two successive calls of method: ReadNumber() to the variables x and y respectively.
So the returned value of ReadNumber() is what is assigned.
See the return type of ReadNumber() is int - the same type as the variables bei... |
6,939,663 | Why assign a function to a variable? What's the point in assigning int x, y to ReadNumber() ? Is it for storing return value of function in a variable? Or is this just a way to pass arguments?
```
#include <iostream>
int ReadNumber()
{
using namespace std;
cout << "Enter a number: ";
int x;
cin >> x;
... | 2011/08/04 | [
"https://Stackoverflow.com/questions/6939663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/878362/"
] | Yes, it is storing the return value of the function.
The code calls the ReadNumber function twice first. ReadNumber reads a string from the console then returns it as an int. The code stores the two function returns. It then adds these two numbers together and passes it as an argument to the WriteAnswer function. The ... | Actually the function is not assigned to variable
What happened is each time `ReadNumber()` is called, it returns a number of type `int`. that number can be used anywhere, like putting in a variable like `x`, and we can call it one more time and assign the next value returned to another variable like `y` |
6,939,663 | Why assign a function to a variable? What's the point in assigning int x, y to ReadNumber() ? Is it for storing return value of function in a variable? Or is this just a way to pass arguments?
```
#include <iostream>
int ReadNumber()
{
using namespace std;
cout << "Enter a number: ";
int x;
cin >> x;
... | 2011/08/04 | [
"https://Stackoverflow.com/questions/6939663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/878362/"
] | Yes, it is storing the return value of the function.
The code calls the ReadNumber function twice first. ReadNumber reads a string from the console then returns it as an int. The code stores the two function returns. It then adds these two numbers together and passes it as an argument to the WriteAnswer function. The ... | `ReadNumber()` reads a number from the standard input and returns it.
```
int x = ReadNumber();
```
stores that value into `x`. |
6,939,663 | Why assign a function to a variable? What's the point in assigning int x, y to ReadNumber() ? Is it for storing return value of function in a variable? Or is this just a way to pass arguments?
```
#include <iostream>
int ReadNumber()
{
using namespace std;
cout << "Enter a number: ";
int x;
cin >> x;
... | 2011/08/04 | [
"https://Stackoverflow.com/questions/6939663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/878362/"
] | Yes, it is storing the return value of the function.
The code calls the ReadNumber function twice first. ReadNumber reads a string from the console then returns it as an int. The code stores the two function returns. It then adds these two numbers together and passes it as an argument to the WriteAnswer function. The ... | ```
int x = ReadNumber();
```
By this statement, the programmer wants to assign the return value of that function to the variable. If you check the function signature, you can see that it returns a value of type `int` . |
6,939,663 | Why assign a function to a variable? What's the point in assigning int x, y to ReadNumber() ? Is it for storing return value of function in a variable? Or is this just a way to pass arguments?
```
#include <iostream>
int ReadNumber()
{
using namespace std;
cout << "Enter a number: ";
int x;
cin >> x;
... | 2011/08/04 | [
"https://Stackoverflow.com/questions/6939663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/878362/"
] | * "why does he assign a function to a variable?"
He doesn't. This(note the brackets):
```
// vv
int x = ReadNumber();
```
assigns the returned value to `x`. The brackets mean, that the function is actually called - or the body is executed. That function has `return x;` at the end, so it returns the v... | The result of ReadNumber() is assigned to x - not the other way around. ReadNumber() asks the user for a number and assigns it to x, then for another number and assigns it to y. Then main() adds them together and shows the user using WriteAnswer(). |
6,939,663 | Why assign a function to a variable? What's the point in assigning int x, y to ReadNumber() ? Is it for storing return value of function in a variable? Or is this just a way to pass arguments?
```
#include <iostream>
int ReadNumber()
{
using namespace std;
cout << "Enter a number: ";
int x;
cin >> x;
... | 2011/08/04 | [
"https://Stackoverflow.com/questions/6939663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/878362/"
] | * "why does he assign a function to a variable?"
He doesn't. This(note the brackets):
```
// vv
int x = ReadNumber();
```
assigns the returned value to `x`. The brackets mean, that the function is actually called - or the body is executed. That function has `return x;` at the end, so it returns the v... | `ReadNumber()` reads a number from the standard input and returns it.
```
int x = ReadNumber();
```
stores that value into `x`. |
6,939,663 | Why assign a function to a variable? What's the point in assigning int x, y to ReadNumber() ? Is it for storing return value of function in a variable? Or is this just a way to pass arguments?
```
#include <iostream>
int ReadNumber()
{
using namespace std;
cout << "Enter a number: ";
int x;
cin >> x;
... | 2011/08/04 | [
"https://Stackoverflow.com/questions/6939663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/878362/"
] | * "why does he assign a function to a variable?"
He doesn't. This(note the brackets):
```
// vv
int x = ReadNumber();
```
assigns the returned value to `x`. The brackets mean, that the function is actually called - or the body is executed. That function has `return x;` at the end, so it returns the v... | ```
int x = ReadNumber();
```
By this statement, the programmer wants to assign the return value of that function to the variable. If you check the function signature, you can see that it returns a value of type `int` . |
6,939,663 | Why assign a function to a variable? What's the point in assigning int x, y to ReadNumber() ? Is it for storing return value of function in a variable? Or is this just a way to pass arguments?
```
#include <iostream>
int ReadNumber()
{
using namespace std;
cout << "Enter a number: ";
int x;
cin >> x;
... | 2011/08/04 | [
"https://Stackoverflow.com/questions/6939663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/878362/"
] | Yes, it is storing the return value of the function.
The code calls the ReadNumber function twice first. ReadNumber reads a string from the console then returns it as an int. The code stores the two function returns. It then adds these two numbers together and passes it as an argument to the WriteAnswer function. The ... | The result of ReadNumber() is assigned to x - not the other way around. ReadNumber() asks the user for a number and assigns it to x, then for another number and assigns it to y. Then main() adds them together and shows the user using WriteAnswer(). |
6,939,663 | Why assign a function to a variable? What's the point in assigning int x, y to ReadNumber() ? Is it for storing return value of function in a variable? Or is this just a way to pass arguments?
```
#include <iostream>
int ReadNumber()
{
using namespace std;
cout << "Enter a number: ";
int x;
cin >> x;
... | 2011/08/04 | [
"https://Stackoverflow.com/questions/6939663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/878362/"
] | * "why does he assign a function to a variable?"
He doesn't. This(note the brackets):
```
// vv
int x = ReadNumber();
```
assigns the returned value to `x`. The brackets mean, that the function is actually called - or the body is executed. That function has `return x;` at the end, so it returns the v... | Actually the function is not assigned to variable
What happened is each time `ReadNumber()` is called, it returns a number of type `int`. that number can be used anywhere, like putting in a variable like `x`, and we can call it one more time and assign the next value returned to another variable like `y` |
19,341,634 | I'm using `window.open` to create an empty window and then populating it using jquery DOM manipulation methods. One thing I'd like to do is make sure the new window has all the same scripts available in it that are in the parent window. I'm also duplicating all the style sheets, plus any other data that's in the parent... | 2013/10/13 | [
"https://Stackoverflow.com/questions/19341634",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/441899/"
] | Select Use Asset Catalog (I opted for just doing it for the App Icons and not the Launch Images because my No image found errors were all related to App Icons, as yours seem to be), then drag and drop the appropriate icons into their correct spots.
The first time I did this it was a bit messed up, I believe because I ... | One possible solution to this problem is to delete references to image assets in your plist if you are using the asset catalog, or fix the paths if you're not. |
19,341,634 | I'm using `window.open` to create an empty window and then populating it using jquery DOM manipulation methods. One thing I'd like to do is make sure the new window has all the same scripts available in it that are in the parent window. I'm also duplicating all the style sheets, plus any other data that's in the parent... | 2013/10/13 | [
"https://Stackoverflow.com/questions/19341634",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/441899/"
] | Select Use Asset Catalog (I opted for just doing it for the App Icons and not the Launch Images because my No image found errors were all related to App Icons, as yours seem to be), then drag and drop the appropriate icons into their correct spots.
The first time I did this it was a bit messed up, I believe because I ... | I have Solved this Issue , Just Remove references to all the icons , and open the PLIST and also Delete the icons from there , add the icons again in your Project , to fix these problem |
19,341,634 | I'm using `window.open` to create an empty window and then populating it using jquery DOM manipulation methods. One thing I'd like to do is make sure the new window has all the same scripts available in it that are in the parent window. I'm also duplicating all the style sheets, plus any other data that's in the parent... | 2013/10/13 | [
"https://Stackoverflow.com/questions/19341634",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/441899/"
] | One possible solution to this problem is to delete references to image assets in your plist if you are using the asset catalog, or fix the paths if you're not. | I have Solved this Issue , Just Remove references to all the icons , and open the PLIST and also Delete the icons from there , add the icons again in your Project , to fix these problem |
5,583,095 | I'm using this to sort a list view: <http://support.microsoft.com/kb/319401>
It's working great, except when I try to sort a date column, it things 2AM comes after 10PM (since 2 is greater than 1).
```
4/7/2011 10:00:00 PM
4/7/2011 2:00:00 AM
```
This is the code I'm using:
```
var lvcs = new ListViewColumnSorter()... | 2011/04/07 | [
"https://Stackoverflow.com/questions/5583095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/281671/"
] | The above example is the way to go but I thought I'd add this for the situation of multiple date columns. Holding the indices for the date column[s] also saves the overhead of DateTime.Parse().
In the ListViewColumnSorter class, create a private array of column indices matching your DateTime columns, eg:
```
int[] R... | The answer marked as correct here did not help me. My app seemed to go in to an infinite loop of thrown exceptions. To avoid using a try/catch and catching thrown exeptions, I used the following and it works perfectly:
```
DateTime dateX;
DateTime dateY;
if (
DateTime.TryParse(listviewX.SubItems[ColumnToSort].Text... |
5,583,095 | I'm using this to sort a list view: <http://support.microsoft.com/kb/319401>
It's working great, except when I try to sort a date column, it things 2AM comes after 10PM (since 2 is greater than 1).
```
4/7/2011 10:00:00 PM
4/7/2011 2:00:00 AM
```
This is the code I'm using:
```
var lvcs = new ListViewColumnSorter()... | 2011/04/07 | [
"https://Stackoverflow.com/questions/5583095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/281671/"
] | I have done this for years, but just ran across the post.. I noticed Gary did something like it, but I never had a problem with it comparing date so never had to use the DateTime compare object. Guess this is another option for people to chose from.
```
public int Compare(object x, object y)
{
int compareResult;
... | You should get your items from your listview and convert the date/time strings to DateTime objects and then call sort on those objects (having put them in a collection) and then put them back into your ListView.
Hopefully that solves your issue. |
5,583,095 | I'm using this to sort a list view: <http://support.microsoft.com/kb/319401>
It's working great, except when I try to sort a date column, it things 2AM comes after 10PM (since 2 is greater than 1).
```
4/7/2011 10:00:00 PM
4/7/2011 2:00:00 AM
```
This is the code I'm using:
```
var lvcs = new ListViewColumnSorter()... | 2011/04/07 | [
"https://Stackoverflow.com/questions/5583095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/281671/"
] | Look at the "Sorting Dates" section in [this article](http://msdn.microsoft.com/en-us/library/ms996467.aspx) - you replace the Compare method.
Example Code:
```
try {
DateTime dateX = Convert.ToDateTime(listviewX.SubItems[ColumnToSort].Text);
DateTime dateY = Convert.ToDateTime(listviewY.SubItems[ColumnToSor... | above is correct because you are doing string comparison of list.
try to convert to DateTime and Create `List<DateTime>` and sort it then,
You can use `DateTime.TryParse` or ParseExact to specify you own parsing format |
5,583,095 | I'm using this to sort a list view: <http://support.microsoft.com/kb/319401>
It's working great, except when I try to sort a date column, it things 2AM comes after 10PM (since 2 is greater than 1).
```
4/7/2011 10:00:00 PM
4/7/2011 2:00:00 AM
```
This is the code I'm using:
```
var lvcs = new ListViewColumnSorter()... | 2011/04/07 | [
"https://Stackoverflow.com/questions/5583095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/281671/"
] | The above example is the way to go but I thought I'd add this for the situation of multiple date columns. Holding the indices for the date column[s] also saves the overhead of DateTime.Parse().
In the ListViewColumnSorter class, create a private array of column indices matching your DateTime columns, eg:
```
int[] R... | You should get your items from your listview and convert the date/time strings to DateTime objects and then call sort on those objects (having put them in a collection) and then put them back into your ListView.
Hopefully that solves your issue. |
5,583,095 | I'm using this to sort a list view: <http://support.microsoft.com/kb/319401>
It's working great, except when I try to sort a date column, it things 2AM comes after 10PM (since 2 is greater than 1).
```
4/7/2011 10:00:00 PM
4/7/2011 2:00:00 AM
```
This is the code I'm using:
```
var lvcs = new ListViewColumnSorter()... | 2011/04/07 | [
"https://Stackoverflow.com/questions/5583095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/281671/"
] | Look at the "Sorting Dates" section in [this article](http://msdn.microsoft.com/en-us/library/ms996467.aspx) - you replace the Compare method.
Example Code:
```
try {
DateTime dateX = Convert.ToDateTime(listviewX.SubItems[ColumnToSort].Text);
DateTime dateY = Convert.ToDateTime(listviewY.SubItems[ColumnToSor... | You should get your items from your listview and convert the date/time strings to DateTime objects and then call sort on those objects (having put them in a collection) and then put them back into your ListView.
Hopefully that solves your issue. |
5,583,095 | I'm using this to sort a list view: <http://support.microsoft.com/kb/319401>
It's working great, except when I try to sort a date column, it things 2AM comes after 10PM (since 2 is greater than 1).
```
4/7/2011 10:00:00 PM
4/7/2011 2:00:00 AM
```
This is the code I'm using:
```
var lvcs = new ListViewColumnSorter()... | 2011/04/07 | [
"https://Stackoverflow.com/questions/5583095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/281671/"
] | I have done this for years, but just ran across the post.. I noticed Gary did something like it, but I never had a problem with it comparing date so never had to use the DateTime compare object. Guess this is another option for people to chose from.
```
public int Compare(object x, object y)
{
int compareResult;
... | above is correct because you are doing string comparison of list.
try to convert to DateTime and Create `List<DateTime>` and sort it then,
You can use `DateTime.TryParse` or ParseExact to specify you own parsing format |
5,583,095 | I'm using this to sort a list view: <http://support.microsoft.com/kb/319401>
It's working great, except when I try to sort a date column, it things 2AM comes after 10PM (since 2 is greater than 1).
```
4/7/2011 10:00:00 PM
4/7/2011 2:00:00 AM
```
This is the code I'm using:
```
var lvcs = new ListViewColumnSorter()... | 2011/04/07 | [
"https://Stackoverflow.com/questions/5583095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/281671/"
] | I have done this for years, but just ran across the post.. I noticed Gary did something like it, but I never had a problem with it comparing date so never had to use the DateTime compare object. Guess this is another option for people to chose from.
```
public int Compare(object x, object y)
{
int compareResult;
... | The answer marked as correct here did not help me. My app seemed to go in to an infinite loop of thrown exceptions. To avoid using a try/catch and catching thrown exeptions, I used the following and it works perfectly:
```
DateTime dateX;
DateTime dateY;
if (
DateTime.TryParse(listviewX.SubItems[ColumnToSort].Text... |
5,583,095 | I'm using this to sort a list view: <http://support.microsoft.com/kb/319401>
It's working great, except when I try to sort a date column, it things 2AM comes after 10PM (since 2 is greater than 1).
```
4/7/2011 10:00:00 PM
4/7/2011 2:00:00 AM
```
This is the code I'm using:
```
var lvcs = new ListViewColumnSorter()... | 2011/04/07 | [
"https://Stackoverflow.com/questions/5583095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/281671/"
] | Look at the "Sorting Dates" section in [this article](http://msdn.microsoft.com/en-us/library/ms996467.aspx) - you replace the Compare method.
Example Code:
```
try {
DateTime dateX = Convert.ToDateTime(listviewX.SubItems[ColumnToSort].Text);
DateTime dateY = Convert.ToDateTime(listviewY.SubItems[ColumnToSor... | The answer marked as correct here did not help me. My app seemed to go in to an infinite loop of thrown exceptions. To avoid using a try/catch and catching thrown exeptions, I used the following and it works perfectly:
```
DateTime dateX;
DateTime dateY;
if (
DateTime.TryParse(listviewX.SubItems[ColumnToSort].Text... |
5,583,095 | I'm using this to sort a list view: <http://support.microsoft.com/kb/319401>
It's working great, except when I try to sort a date column, it things 2AM comes after 10PM (since 2 is greater than 1).
```
4/7/2011 10:00:00 PM
4/7/2011 2:00:00 AM
```
This is the code I'm using:
```
var lvcs = new ListViewColumnSorter()... | 2011/04/07 | [
"https://Stackoverflow.com/questions/5583095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/281671/"
] | Look at the "Sorting Dates" section in [this article](http://msdn.microsoft.com/en-us/library/ms996467.aspx) - you replace the Compare method.
Example Code:
```
try {
DateTime dateX = Convert.ToDateTime(listviewX.SubItems[ColumnToSort].Text);
DateTime dateY = Convert.ToDateTime(listviewY.SubItems[ColumnToSor... | The above example is the way to go but I thought I'd add this for the situation of multiple date columns. Holding the indices for the date column[s] also saves the overhead of DateTime.Parse().
In the ListViewColumnSorter class, create a private array of column indices matching your DateTime columns, eg:
```
int[] R... |
5,583,095 | I'm using this to sort a list view: <http://support.microsoft.com/kb/319401>
It's working great, except when I try to sort a date column, it things 2AM comes after 10PM (since 2 is greater than 1).
```
4/7/2011 10:00:00 PM
4/7/2011 2:00:00 AM
```
This is the code I'm using:
```
var lvcs = new ListViewColumnSorter()... | 2011/04/07 | [
"https://Stackoverflow.com/questions/5583095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/281671/"
] | The above example is the way to go but I thought I'd add this for the situation of multiple date columns. Holding the indices for the date column[s] also saves the overhead of DateTime.Parse().
In the ListViewColumnSorter class, create a private array of column indices matching your DateTime columns, eg:
```
int[] R... | above is correct because you are doing string comparison of list.
try to convert to DateTime and Create `List<DateTime>` and sort it then,
You can use `DateTime.TryParse` or ParseExact to specify you own parsing format |
1,013 | (Background - a previous answer to this question--not sure how to link it--tells us City of Chicago publishes building violations.)
We've developed a free mobile app (Vancouver RentalDog, currently in iTunes) that allows people to identify licensed rental buildings in Vancouver, which have outstanding bylaw infraction... | 2013/08/14 | [
"https://opendata.stackexchange.com/questions/1013",
"https://opendata.stackexchange.com",
"https://opendata.stackexchange.com/users/1071/"
] | A growing number of city open data sets is federated to <http://Cities.Data.gov>. There are quite a few rental building violation datasets accessible: <http://www.data.gov/cities/Community/Cities/Datasets> You can find some additional information at <http://Counties.Data.gov> and <http://States.Data.gov>. These include... | You might find some on Edmonton in [this dataset](https://data.edmonton.ca/Community-Services/Bylaw-Infractions/xgwu-c37w?), but I haven't managed to find any others. You might try contacting portal administrators or submitting FOI requests.
Contacting the portals
----------------------
Socrata data portals have a [p... |
1,013 | (Background - a previous answer to this question--not sure how to link it--tells us City of Chicago publishes building violations.)
We've developed a free mobile app (Vancouver RentalDog, currently in iTunes) that allows people to identify licensed rental buildings in Vancouver, which have outstanding bylaw infraction... | 2013/08/14 | [
"https://opendata.stackexchange.com/questions/1013",
"https://opendata.stackexchange.com",
"https://opendata.stackexchange.com/users/1071/"
] | A growing number of city open data sets is federated to <http://Cities.Data.gov>. There are quite a few rental building violation datasets accessible: <http://www.data.gov/cities/Community/Cities/Datasets> You can find some additional information at <http://Counties.Data.gov> and <http://States.Data.gov>. These include... | Thomas Levine did an amazing job collating data sets found on socrata data portals. You should definitely check out his [blog post](http://thomaslevine.com/!/socrata-summary/) about the project. In doing his project, he created a csv [(here)](https://github.com/tlevine/socrata-analysis/blob/master/socrata.csv), with de... |
1,013 | (Background - a previous answer to this question--not sure how to link it--tells us City of Chicago publishes building violations.)
We've developed a free mobile app (Vancouver RentalDog, currently in iTunes) that allows people to identify licensed rental buildings in Vancouver, which have outstanding bylaw infraction... | 2013/08/14 | [
"https://opendata.stackexchange.com/questions/1013",
"https://opendata.stackexchange.com",
"https://opendata.stackexchange.com/users/1071/"
] | A growing number of city open data sets is federated to <http://Cities.Data.gov>. There are quite a few rental building violation datasets accessible: <http://www.data.gov/cities/Community/Cities/Datasets> You can find some additional information at <http://Counties.Data.gov> and <http://States.Data.gov>. These include... | I googled the following and search 4 pages. All I could find were NYC and DC.
NYC: <http://www.nyc.gov/html/hpd/html/pr/HPD-Open-Data.shtml>
DC: <http://data.dc.gov/Metadata.aspx?id=7> |
13,680,459 | I am saving some data in the keychain, but after each application update that data are lost. The same problem I have when I save something in the user defaults. This is important because I use it to store created a unique identifier. What can be wrong?
Thanks for any tips. | 2012/12/03 | [
"https://Stackoverflow.com/questions/13680459",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/444301/"
] | I had the same issue with our latest app. What we found out is that Apple apparently is wiping the data from Keychain for pre iOS 8 apps if the newer app has minimum supported version of 8.0.
However if the minimum supported version is set to iOS 7.0, the Keychain data is not wiped off.
So apparently all apps using ... | I am facing the same issue. And my deployment target is iOS 10.
I am storing JWT token in keychain using -
```
A0SimpleKeychain().setString(token, forKey:"user-jwt")
```
And using the following to retrieve it back -
```
A0SimpleKeychain().string(forKey: key)
```
I am seeing in production logs that for some users... |
13,680,459 | I am saving some data in the keychain, but after each application update that data are lost. The same problem I have when I save something in the user defaults. This is important because I use it to store created a unique identifier. What can be wrong?
Thanks for any tips. | 2012/12/03 | [
"https://Stackoverflow.com/questions/13680459",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/444301/"
] | I had the same issue with our latest app. What we found out is that Apple apparently is wiping the data from Keychain for pre iOS 8 apps if the newer app has minimum supported version of 8.0.
However if the minimum supported version is set to iOS 7.0, the Keychain data is not wiped off.
So apparently all apps using ... | Loss in keychain data may be due to change in the `keychain-access-groups` entitlement.
Keeping the same value for this key in old and new apps will solve the issue. |
13,680,459 | I am saving some data in the keychain, but after each application update that data are lost. The same problem I have when I save something in the user defaults. This is important because I use it to store created a unique identifier. What can be wrong?
Thanks for any tips. | 2012/12/03 | [
"https://Stackoverflow.com/questions/13680459",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/444301/"
] | Loss in keychain data may be due to change in the `keychain-access-groups` entitlement.
Keeping the same value for this key in old and new apps will solve the issue. | I am facing the same issue. And my deployment target is iOS 10.
I am storing JWT token in keychain using -
```
A0SimpleKeychain().setString(token, forKey:"user-jwt")
```
And using the following to retrieve it back -
```
A0SimpleKeychain().string(forKey: key)
```
I am seeing in production logs that for some users... |
20,366,252 | ```
I know ths D status processes is uninterruptable sleep processes.
```
Many people say to kill D status processes is to reboot the system.
But how does reboot operation can kill the D status processes?
I find "init 0" will "kill -9 " all of the processes at last. But "kill -9 " can not kill D status process.
S... | 2013/12/04 | [
"https://Stackoverflow.com/questions/20366252",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3064136/"
] | It does not kill them at all. Those processes in D state will not respond to any signal. kill generates signals -- they cannot be delivered to these processes. So, no kill.
The loss of process context when the kernel stops running allows nothing to persist, processes are kernel objects. The state D processes become hi... | I use the `yum update` command to kill the D state process. |
97,706 | I'm looking for a wordpress rewrite that will let me pass a query var. I have a custom post type that produces urls like this:
example.com/custom-post-slug/custom-post-title/
my goal is to have
example.com/custom-post-slug/custom-post-title/cid/10/
Pass the value 10 into cid
Any suggestions? | 2013/04/29 | [
"https://wordpress.stackexchange.com/questions/97706",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/28619/"
] | You can use [`add_rewrite_endpoint`](http://codex.wordpress.org/Rewrite_API/add_rewrite_endpoint), which will add a query var and generate the necessary rewrite rules:
```
function wpd_cid_endpoint() {
add_rewrite_endpoint( 'cid', EP_PERMALINK );
}
add_action( 'init', 'wpd_cid_endpoint' );
```
Don't forget to [f... | You would need to create a custom rewrite rule that maps not just the post slug but also the cid value, see this article:
<http://www.prodeveloper.org/create-your-own-rewrite-rules-in-wordpress.html>
And the relevant Codex documentation:
<http://codex.wordpress.org/Rewrite_API>
<http://codex.wordpress.org/Rewrite_AP... |
97,706 | I'm looking for a wordpress rewrite that will let me pass a query var. I have a custom post type that produces urls like this:
example.com/custom-post-slug/custom-post-title/
my goal is to have
example.com/custom-post-slug/custom-post-title/cid/10/
Pass the value 10 into cid
Any suggestions? | 2013/04/29 | [
"https://wordpress.stackexchange.com/questions/97706",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/28619/"
] | You can use [`add_rewrite_endpoint`](http://codex.wordpress.org/Rewrite_API/add_rewrite_endpoint), which will add a query var and generate the necessary rewrite rules:
```
function wpd_cid_endpoint() {
add_rewrite_endpoint( 'cid', EP_PERMALINK );
}
add_action( 'init', 'wpd_cid_endpoint' );
```
Don't forget to [f... | Try this in your **init callback**:
```
add_rewrite_rule(
'^custom-post-type-slug/([^/]*)/cid/([^/]*)/?',
'index.php?custom-post-type-slug=$matches[1]&cid=$matches[2]',
'top'
);
add_rewrite_tag('%cid%', '([^&]+)');
```
You can then use the following to get your cid variable value:
```
global $wp_query;... |
56,239,554 | I'm trying to change the color of the text in table row with the class '24hrs'. I used jquery to find the text, but i just can't figure it out.
This is the table i'm working with
```
<table class="table" id="characters-table">
<thead>
<tr>
<th>Logo</th>
... | 2019/05/21 | [
"https://Stackoverflow.com/questions/56239554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10618734/"
] | CSS classnames cannot start with a number.
See: [Which characters are valid in CSS class names/selectors?](https://stackoverflow.com/questions/448981/which-characters-are-valid-in-css-class-names-selectors)
<https://www.w3.org/TR/CSS21/grammar.html#scanner> | As already commented you try to use the id of your template engine, not of your rendered html element. So try this instead:
```
$('#characters-table tbody .24hrs').css('color', 'red');
``` |
4,870,790 | Came from [Declare namespaces within XPath expression](https://stackoverflow.com/questions/4861262/declare-namespaces-within-xpath-expression)
Simplified task:
* There is a lot of XML files of different structure with namespaces
* User defines several expressions in a text form
* The expressions are applied to each X... | 2011/02/02 | [
"https://Stackoverflow.com/questions/4870790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/126650/"
] | The constraint "without using third-party libraries" seems an odd one: most people these days are trying to maximize code reuse.
Without that constraints, I would say Schematron is the answer. It does exactly what you are looking for.
It's also possible to achieve the same effect using an XSLT stylesheet to define th... | >
> Simplified task:
>
>
> •There is a lot of XML files of
> different structure with namespaces
>
>
> •User defines several predicates in a
> text form
>
>
> •The predicates are applied
> to each XML file giving the result:
> yes or no
>
>
>
**It is not clear what the word "predicates" is intended to mean i... |
4,870,790 | Came from [Declare namespaces within XPath expression](https://stackoverflow.com/questions/4861262/declare-namespaces-within-xpath-expression)
Simplified task:
* There is a lot of XML files of different structure with namespaces
* User defines several expressions in a text form
* The expressions are applied to each X... | 2011/02/02 | [
"https://Stackoverflow.com/questions/4870790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/126650/"
] | >
> Simplified task:
>
>
> •There is a lot of XML files of
> different structure with namespaces
>
>
> •User defines several predicates in a
> text form
>
>
> •The predicates are applied
> to each XML file giving the result:
> yes or no
>
>
>
**It is not clear what the word "predicates" is intended to mean i... | If the namespaces are an "issue", you could always:
1. Pre-process the XML files using a modified identity transform to generate an XML file with nodes that are not bound to a particular namespace
2. Then evaluate the user provided XPATH against the modified XML
3. Return the result
**Do note** that while this makes ... |
4,870,790 | Came from [Declare namespaces within XPath expression](https://stackoverflow.com/questions/4861262/declare-namespaces-within-xpath-expression)
Simplified task:
* There is a lot of XML files of different structure with namespaces
* User defines several expressions in a text form
* The expressions are applied to each X... | 2011/02/02 | [
"https://Stackoverflow.com/questions/4870790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/126650/"
] | The constraint "without using third-party libraries" seems an odd one: most people these days are trying to maximize code reuse.
Without that constraints, I would say Schematron is the answer. It does exactly what you are looking for.
It's also possible to achieve the same effect using an XSLT stylesheet to define th... | If the namespaces are an "issue", you could always:
1. Pre-process the XML files using a modified identity transform to generate an XML file with nodes that are not bound to a particular namespace
2. Then evaluate the user provided XPATH against the modified XML
3. Return the result
**Do note** that while this makes ... |
690,705 | A uniform rod BC of length $L$ and weight $W\_1$ is hinged to a fixed point at $B$. A particle of weight $W\_2$ is attached to the rod at $C$. The system is in equilibrium by a light elastic string in the same vertical plane as the rod. One end of the elastic string is attached to the rod at $C$ and the other end is at... | 2022/01/25 | [
"https://physics.stackexchange.com/questions/690705",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/326319/"
] | >
> Why is the first method of resolving forces at C incorrect?
>
>
>
Resolving the horizontal components at C is correct as only the tensions have horizontal components acting on both C and the bar BC of which point C is a part.
But you can't only consider the vertical force acting directly on C because C is a p... | From your first two equations: $T\_2 = T\_1$ but $T\_1$ = $(W\_1)/(2 sin(30^o))$. The reason this does not work is that because of the weight $W\_2$, the rod also exerts a force at (C) which is perpendicular to $T\_2$. |
43,892 | I have a *Samsung Galaxy S3* and have it updated to 4.1.2 from ICS.
If I restore my phone to factory settings (either by going to settings or by rooting), will I lose my updates?
If so, is there any other way to restore without having the above setbacks? | 2013/04/18 | [
"https://android.stackexchange.com/questions/43892",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/32459/"
] | Yes, you'll lose your updates, along with any other installed app that didn't come with stock. But you will be able to re-update the apps via Google Play, and you won't lose any purchases you made (they are stored forever on the Google cloud).
I'm not sure why you're concerned about it, though. I can understand not wa... | Performing a factory reset on an Android device does not remove OS upgrades, it simply removes all user data. This includes the following:
* Apps downloaded from Google Play Store, or otherwise side-loaded onto the device (even if you moved them to external storage.)
* Preferences and data for all apps, downloaded or ... |
43,892 | I have a *Samsung Galaxy S3* and have it updated to 4.1.2 from ICS.
If I restore my phone to factory settings (either by going to settings or by rooting), will I lose my updates?
If so, is there any other way to restore without having the above setbacks? | 2013/04/18 | [
"https://android.stackexchange.com/questions/43892",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/32459/"
] | Yes, you'll lose your updates, along with any other installed app that didn't come with stock. But you will be able to re-update the apps via Google Play, and you won't lose any purchases you made (they are stored forever on the Google cloud).
I'm not sure why you're concerned about it, though. I can understand not wa... | Not only did a factory reset delete my note 4 from 6.0.1 back to 4.4.4 it also took it from an un-locked phone and relocked it......o/o not sure HTF that happened but I can guarantee you that the answer isn't always a definite no. |
43,892 | I have a *Samsung Galaxy S3* and have it updated to 4.1.2 from ICS.
If I restore my phone to factory settings (either by going to settings or by rooting), will I lose my updates?
If so, is there any other way to restore without having the above setbacks? | 2013/04/18 | [
"https://android.stackexchange.com/questions/43892",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/32459/"
] | Yes, you'll lose your updates, along with any other installed app that didn't come with stock. But you will be able to re-update the apps via Google Play, and you won't lose any purchases you made (they are stored forever on the Google cloud).
I'm not sure why you're concerned about it, though. I can understand not wa... | Definitely, you'll lose all your data but OS upgrades will still remain.
All the installed apps except system apps and their data including contacts, SMS etc. will be temoved, so you will lose your security pin, contacts, browser history and so on but not the system updates.
Your external SD card will not be erased s... |
43,892 | I have a *Samsung Galaxy S3* and have it updated to 4.1.2 from ICS.
If I restore my phone to factory settings (either by going to settings or by rooting), will I lose my updates?
If so, is there any other way to restore without having the above setbacks? | 2013/04/18 | [
"https://android.stackexchange.com/questions/43892",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/32459/"
] | Performing a factory reset on an Android device does not remove OS upgrades, it simply removes all user data. This includes the following:
* Apps downloaded from Google Play Store, or otherwise side-loaded onto the device (even if you moved them to external storage.)
* Preferences and data for all apps, downloaded or ... | Not only did a factory reset delete my note 4 from 6.0.1 back to 4.4.4 it also took it from an un-locked phone and relocked it......o/o not sure HTF that happened but I can guarantee you that the answer isn't always a definite no. |
43,892 | I have a *Samsung Galaxy S3* and have it updated to 4.1.2 from ICS.
If I restore my phone to factory settings (either by going to settings or by rooting), will I lose my updates?
If so, is there any other way to restore without having the above setbacks? | 2013/04/18 | [
"https://android.stackexchange.com/questions/43892",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/32459/"
] | Performing a factory reset on an Android device does not remove OS upgrades, it simply removes all user data. This includes the following:
* Apps downloaded from Google Play Store, or otherwise side-loaded onto the device (even if you moved them to external storage.)
* Preferences and data for all apps, downloaded or ... | Definitely, you'll lose all your data but OS upgrades will still remain.
All the installed apps except system apps and their data including contacts, SMS etc. will be temoved, so you will lose your security pin, contacts, browser history and so on but not the system updates.
Your external SD card will not be erased s... |
52,254,707 | I have an application that displays documents in a `UICollectionView`. Each `UICollectionViewCell` has a button (distinct from that carried out by `didSelectItemAt`). This button brings up a custom popup which I have created using a `UIViewController`. It is presented `Over Current Context`. This popup presents a list ... | 2018/09/10 | [
"https://Stackoverflow.com/questions/52254707",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10291973/"
] | It is exactly what your error says. You seem to be presenting the view controller `vc` instead of the `alert` from `vc`
```
private static func showBasicAlert(on vc: UIViewController, with title: String, message: String, action: @escaping (() -> ())){
let alert = UIAlertController.init(title: title, message: mes... | You are presenting wrong. You need to present alert not vc.
Replace below with your code.
```
struct Alerts {
private static func showBasicAlert(on vc: UIViewController, with title: String, message: String, action: @escaping (() -> ())){
let alert = UIAlertController.init(title: title, message: message, preferr... |
52,254,707 | I have an application that displays documents in a `UICollectionView`. Each `UICollectionViewCell` has a button (distinct from that carried out by `didSelectItemAt`). This button brings up a custom popup which I have created using a `UIViewController`. It is presented `Over Current Context`. This popup presents a list ... | 2018/09/10 | [
"https://Stackoverflow.com/questions/52254707",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10291973/"
] | It is exactly what your error says. You seem to be presenting the view controller `vc` instead of the `alert` from `vc`
```
private static func showBasicAlert(on vc: UIViewController, with title: String, message: String, action: @escaping (() -> ())){
let alert = UIAlertController.init(title: title, message: mes... | Replace below line
`vc.present(vc, animated: true, completion: nil)`
to
`vc.present(alert, animated: true, completion: nil)` |
44,670,056 | I'm trying to scan my local network to find a device with a specifi opened port.
When i do the scan 6-7 times i take an out of memory.
```
WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(WIFI_SERVICE);
int ipAddress = wifiManager.getConnectionInfo().getIpAddress();
@SuppressL... | 2017/06/21 | [
"https://Stackoverflow.com/questions/44670056",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2108535/"
] | You're creating a new thread pool for each IP.
You should call `Executors.newCachedThreadPool()` outside of the for loop and store its result in a variable. Then call `Execute` on that variable inside the loop. | i just add : executorService.shutdownNow(); and it's resolved |
40,636,899 | I've a list of csv-files and would like to use a for loop to edit the content for each file. I'd like to do that with sed. I have this sed commands which works fine when testing it on one file:
```
sed 's/[ "-]//g'
```
So now I want to execute this command for each file in a folder. I've tried this but so far no luc... | 2016/11/16 | [
"https://Stackoverflow.com/questions/40636899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4869373/"
] | Small changes,
```
for i in *.csv
do
sed -i 's/[ "-]//g' "$i"
done
```
**Changes**
* when you iterate through the `for` you get the filenames in `$i` as example `one.csv`, `two.csv` etc. You can directly use these as input to the `sed` command.
* `-i` Is for inline changes, the sed will do the substitution and... | In my case i want to replace every first occurrence of a particular string in each line for several text files, i've use the following:
```
//want to replace 16 with 1 in each files only for the first occurance
sed -i 's/16/1/' *.txt
```
In your case, In terminal you can try this
```
sed 's/[ "-]//g' *.csv
``` |
40,636,899 | I've a list of csv-files and would like to use a for loop to edit the content for each file. I'd like to do that with sed. I have this sed commands which works fine when testing it on one file:
```
sed 's/[ "-]//g'
```
So now I want to execute this command for each file in a folder. I've tried this but so far no luc... | 2016/11/16 | [
"https://Stackoverflow.com/questions/40636899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4869373/"
] | Small changes,
```
for i in *.csv
do
sed -i 's/[ "-]//g' "$i"
done
```
**Changes**
* when you iterate through the `for` you get the filenames in `$i` as example `one.csv`, `two.csv` etc. You can directly use these as input to the `sed` command.
* `-i` Is for inline changes, the sed will do the substitution and... | In certain scenarios it might be worth considering `find`ing the files and executing a command on them like explained in [this answer](https://unix.stackexchange.com/a/25923) (as stated there, make sure `echo $PATH` doesn't contain `.`)
```
find /path/to/csv/ -type f '*.csv' -execdir sed -i 's/[ "-]//g' {} \;
```
he... |
13,120,670 | ```
#include <stdio.h>
int main(void)
{
clrscr();
FILE *fin;
fin=fopen("data.txt","r");
if(fin==NULL)
{
printf("can not open input fil");
return 0;
}
long data[2];
while(!feof(fin))
{
fscanf(fin,"%ld %ld",&data[0],&data[1]);
printf("\n%ld %ld",data[0],data[1]);
}
... | 2012/10/29 | [
"https://Stackoverflow.com/questions/13120670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1776857/"
] | >
> above is my c code for reading a table from a file.In that ..last value is printing 2 times !!!
>
>
>
The last value is printing two times due to the structure of the file reading loop. The `eof()` flag is not set until an attempt is made to read past the end of the file. When `fscanf()` reads the last two `lo... | ```
while(!feof(fin))
{
fscanf(fin,"%ld %ld",&data[0],&data[1]);
printf("\n%ld %ld",data[0],data[1]);
}
```
`feof` doesn't return `true` until after you attempt to read past the end of the file, so the loop will execute once too often. It's better to check the return value of `fscanf` and if it doesn't match wh... |
93,458 | I have made this small text-based dice rolling game in C++. How could I improve it? Be as picky as you'd like.
```
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
void mainGame(int &numDice);
int main()
{
srand (time(NULL));
int gameRunning = true;
int numDice;
whil... | 2015/06/12 | [
"https://codereview.stackexchange.com/questions/93458",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/57781/"
] | [`using namespace std;` is considered a bad practice.](https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice)
---
Don't do this:
>
>
> ```
> int gameRunning = true;
>
> ```
>
>
If you want to use a boolean variable, use a `bool` instead of `int`.
---
You can use boole... | Nice job. If you were looking to add a little more complexity to it as a learning experiment I'd recommend using dynamic memory for your dice function, rather than limiting the user to 5 dice. |
93,458 | I have made this small text-based dice rolling game in C++. How could I improve it? Be as picky as you'd like.
```
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
void mainGame(int &numDice);
int main()
{
srand (time(NULL));
int gameRunning = true;
int numDice;
whil... | 2015/06/12 | [
"https://codereview.stackexchange.com/questions/93458",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/57781/"
] | [`using namespace std;` is considered a bad practice.](https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice)
---
Don't do this:
>
>
> ```
> int gameRunning = true;
>
> ```
>
>
If you want to use a boolean variable, use a `bool` instead of `int`.
---
You can use boole... | This loop
```
while (goAgain == true)
{
//...
switch (input)
{
case 1:
break;
case 2:
goAgain = false;
}
}
```
can be written as
```
for (;;) //Infinite loop
{
//...
if(input == 2)
break;
}
```
thereby, shortening your code and also elimin... |
93,458 | I have made this small text-based dice rolling game in C++. How could I improve it? Be as picky as you'd like.
```
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
void mainGame(int &numDice);
int main()
{
srand (time(NULL));
int gameRunning = true;
int numDice;
whil... | 2015/06/12 | [
"https://codereview.stackexchange.com/questions/93458",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/57781/"
] | [`using namespace std;` is considered a bad practice.](https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice)
---
Don't do this:
>
>
> ```
> int gameRunning = true;
>
> ```
>
>
If you want to use a boolean variable, use a `bool` instead of `int`.
---
You can use boole... | Check out this link on the using directive <[using namespace std](https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice/%22using%20namespace%20std%22)> Placing a using directive in the global namespace (which you have done) contradicts the value of namespaces. Consider placing u... |
93,458 | I have made this small text-based dice rolling game in C++. How could I improve it? Be as picky as you'd like.
```
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
void mainGame(int &numDice);
int main()
{
srand (time(NULL));
int gameRunning = true;
int numDice;
whil... | 2015/06/12 | [
"https://codereview.stackexchange.com/questions/93458",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/57781/"
] | [`using namespace std;` is considered a bad practice.](https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice)
---
Don't do this:
>
>
> ```
> int gameRunning = true;
>
> ```
>
>
If you want to use a boolean variable, use a `bool` instead of `int`.
---
You can use boole... | I see others have warned you about `using namespace std;`.
Use of platform-dependent calls
-------------------------------
In general they're not a good idea. If you have to port your code to another platform that doesn't support `cls` and/or `pause` you'd have to go through and change all instances. I'd prefer to us... |
93,458 | I have made this small text-based dice rolling game in C++. How could I improve it? Be as picky as you'd like.
```
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
void mainGame(int &numDice);
int main()
{
srand (time(NULL));
int gameRunning = true;
int numDice;
whil... | 2015/06/12 | [
"https://codereview.stackexchange.com/questions/93458",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/57781/"
] | This is pretty good code for a first draft. Everything you've written is easy to understand. I didn't have to guess what anything was doing, which is awesome!
Most of my suggestions are nitpicky and may seem a bit grandiose for a small program like this, but it's worth getting into the habit of doing these things beca... | Nice job. If you were looking to add a little more complexity to it as a learning experiment I'd recommend using dynamic memory for your dice function, rather than limiting the user to 5 dice. |
93,458 | I have made this small text-based dice rolling game in C++. How could I improve it? Be as picky as you'd like.
```
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
void mainGame(int &numDice);
int main()
{
srand (time(NULL));
int gameRunning = true;
int numDice;
whil... | 2015/06/12 | [
"https://codereview.stackexchange.com/questions/93458",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/57781/"
] | This is pretty good code for a first draft. Everything you've written is easy to understand. I didn't have to guess what anything was doing, which is awesome!
Most of my suggestions are nitpicky and may seem a bit grandiose for a small program like this, but it's worth getting into the habit of doing these things beca... | This loop
```
while (goAgain == true)
{
//...
switch (input)
{
case 1:
break;
case 2:
goAgain = false;
}
}
```
can be written as
```
for (;;) //Infinite loop
{
//...
if(input == 2)
break;
}
```
thereby, shortening your code and also elimin... |
93,458 | I have made this small text-based dice rolling game in C++. How could I improve it? Be as picky as you'd like.
```
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
void mainGame(int &numDice);
int main()
{
srand (time(NULL));
int gameRunning = true;
int numDice;
whil... | 2015/06/12 | [
"https://codereview.stackexchange.com/questions/93458",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/57781/"
] | This is pretty good code for a first draft. Everything you've written is easy to understand. I didn't have to guess what anything was doing, which is awesome!
Most of my suggestions are nitpicky and may seem a bit grandiose for a small program like this, but it's worth getting into the habit of doing these things beca... | Check out this link on the using directive <[using namespace std](https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice/%22using%20namespace%20std%22)> Placing a using directive in the global namespace (which you have done) contradicts the value of namespaces. Consider placing u... |
93,458 | I have made this small text-based dice rolling game in C++. How could I improve it? Be as picky as you'd like.
```
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
void mainGame(int &numDice);
int main()
{
srand (time(NULL));
int gameRunning = true;
int numDice;
whil... | 2015/06/12 | [
"https://codereview.stackexchange.com/questions/93458",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/57781/"
] | This is pretty good code for a first draft. Everything you've written is easy to understand. I didn't have to guess what anything was doing, which is awesome!
Most of my suggestions are nitpicky and may seem a bit grandiose for a small program like this, but it's worth getting into the habit of doing these things beca... | I see others have warned you about `using namespace std;`.
Use of platform-dependent calls
-------------------------------
In general they're not a good idea. If you have to port your code to another platform that doesn't support `cls` and/or `pause` you'd have to go through and change all instances. I'd prefer to us... |
15,335,156 | I have defined my mutable object as
```
NSMutableArray *scribbles;
```
Then in `viewDidLoad` I initialize it
```
scribbles = [[NSMutableArray alloc] init];
```
After fetching my first JSON page, I add the data into it
```
scribbles = JSON[@"scribbles"];
```
Then later I load the second page and I try adding m... | 2013/03/11 | [
"https://Stackoverflow.com/questions/15335156",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1726243/"
] | You should do:
```
scribbles = [JSON[@"scribbles"] mutableCopy];
```
You don't need to make mutable copy of the second page, so then just do this:
```
[scribbles addObjectsFromArray:JSON[@"scribbles"]];
```
---
To explain:
```
scribbles = [[NSMutableArray alloc] init]; // mutable, OK
scribbles = JSON[@"scribble... | ```
scribbles = JSON[@"scribbles"];
```
This line makes your scribbles object immutable. You need to add object instead assigning. If you have more objects you can create mutable array from immutable array like following
```
scribbles = [NSMutableArray arrayWithArray:JSON[@"scribbles"]];
``` |
15,335,156 | I have defined my mutable object as
```
NSMutableArray *scribbles;
```
Then in `viewDidLoad` I initialize it
```
scribbles = [[NSMutableArray alloc] init];
```
After fetching my first JSON page, I add the data into it
```
scribbles = JSON[@"scribbles"];
```
Then later I load the second page and I try adding m... | 2013/03/11 | [
"https://Stackoverflow.com/questions/15335156",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1726243/"
] | ```
scribbles = JSON[@"scribbles"];
```
This line makes your scribbles object immutable. You need to add object instead assigning. If you have more objects you can create mutable array from immutable array like following
```
scribbles = [NSMutableArray arrayWithArray:JSON[@"scribbles"]];
``` | Instead of this:
```
[scribbles addObjectsFromArray:mutableJson];
```
do this:
```
scribbles = [NSMutableArray arrayWithArray:JSON[@"scribbles"]];
``` |
15,335,156 | I have defined my mutable object as
```
NSMutableArray *scribbles;
```
Then in `viewDidLoad` I initialize it
```
scribbles = [[NSMutableArray alloc] init];
```
After fetching my first JSON page, I add the data into it
```
scribbles = JSON[@"scribbles"];
```
Then later I load the second page and I try adding m... | 2013/03/11 | [
"https://Stackoverflow.com/questions/15335156",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1726243/"
] | You should do:
```
scribbles = [JSON[@"scribbles"] mutableCopy];
```
You don't need to make mutable copy of the second page, so then just do this:
```
[scribbles addObjectsFromArray:JSON[@"scribbles"]];
```
---
To explain:
```
scribbles = [[NSMutableArray alloc] init]; // mutable, OK
scribbles = JSON[@"scribble... | Instead of this:
```
[scribbles addObjectsFromArray:mutableJson];
```
do this:
```
scribbles = [NSMutableArray arrayWithArray:JSON[@"scribbles"]];
``` |
30,295 | If an iPhone app is in the middle of a network operation (e.g., downloading email in Mail, loading a web page in Safari, posting a photo in Path, upgrading apps via the App store) and I tap the lock button to blank the screen, will the network operation complete? Or will it suspend the operation and only resume it when... | 2011/11/05 | [
"https://apple.stackexchange.com/questions/30295",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/1058/"
] | The button on top is not a power button. It's a lock button which informs the OS to turn off the display to save power and to prevent accidental touch input, but the rest of the device keeps running. Apps continue to run for a short while after the display and touchscreen is powered off, from a few seconds for most app... | Generally applications used to keep running normally even if you locked the screen. There were some exceptions, Safari I believe stopped its network operations, as did some others, but most apps would just ignore it.
Since iOS 5 however, applications get suspended (just as if you hit the home button) when the screen l... |
9,571,403 | I have developed a asp.net web service and deployed on IIS 7.5 and windows 2008 R2 64 bit.
All requests comes from Biztalk to this web services. This web service working good if Biztalk sends couple of requests at time. But if BizTalk sends thousands of records in seconds my web service is not handling and send `Reques... | 2012/03/05 | [
"https://Stackoverflow.com/questions/9571403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/158008/"
] | There are three areas you need to figure out.
The first is how to increase the throughput of your webservice itself. Profile it and see what you can trim out. Is it making multiple database calls when a single one will do? Is it writing stuff to a slow harddrive (fix: replace drive with faster mechansim)?.. Essentiall... | There are also configuration settings in machine.config to allow you to speed up the asp web service with additional threads. There's several articles you can fund on what the optimum setting should be based on the number of CPUs on your server. If you need to throttle BizTalk that is in the btssvc.config I believe. |
27,859,822 | Is there an equivalent of `alloca` to create variable length arrays in Rust?
I'm looking for the equivalent of the following C99 code:
```c
void go(int n) {
int array[n];
// ...
}
``` | 2015/01/09 | [
"https://Stackoverflow.com/questions/27859822",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/320615/"
] | It is not possible *directly*, as in there is not direct syntax in the language supporting it.
That being said, this particular feature of C99 is debatable, it has certain advantages (cache locality & bypassing `malloc`) but it also has disadvantages (easy to blow-up the stack, stumps a number of optimizations, may tu... | No.
Doing that in Rust would entail the ability to store Dynamically Sized Types (DSTs) like `[i32]` on the stack, which the language doesn't support.
A deeper reason is that LLVM, to my knowledge, doesn't really support this. I'm given to believe that you *can* do it, but it *significantly* interferes with optimisat... |
34,886,592 | I would like to place to DIVS (grey & red) inside a DIV (black) under the first DIV (black) when you resize the window and the screen is less than 1024 px. Take a look at the example under. You can also see the image attached.
I would really like som advice here, im totally lost here at the moment.
This is how I want... | 2016/01/19 | [
"https://Stackoverflow.com/questions/34886592",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5812566/"
] | Sorry, but that is not possible as written.
You cannot move items outside their containing structures using CSS. You can only reformat them within their present structure.
Optionally, you can duplicate the existing black div and show/hide one or the other based on media queries (screen size).
Or, you can use jQuery/... | Using just CSS (with media queries) and two container `<div>`s to separate logic:
```css
@media (max-width: 1024px) {
.large { display: none; }
.small { display: block; }
.black { height: 100px; }
}
@media (min-width: 1025px) {
.large { display: block; }
.small { display: none; }
.red, .grey { flo... |
34,886,592 | I would like to place to DIVS (grey & red) inside a DIV (black) under the first DIV (black) when you resize the window and the screen is less than 1024 px. Take a look at the example under. You can also see the image attached.
I would really like som advice here, im totally lost here at the moment.
This is how I want... | 2016/01/19 | [
"https://Stackoverflow.com/questions/34886592",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5812566/"
] | There is no need to duplicate the content.
```css
#black{background:black;overflow:hidden;}
#grey, #red{
min-height:100px;
margin:2%;
float:left;
width:47%;
}
#grey{background:gray;margin-right:1%}
#red{background:red;margin-left:1%}
@media (min-width:1024px){
#black{padding-top:100px;}
#grey... | Using just CSS (with media queries) and two container `<div>`s to separate logic:
```css
@media (max-width: 1024px) {
.large { display: none; }
.small { display: block; }
.black { height: 100px; }
}
@media (min-width: 1025px) {
.large { display: block; }
.small { display: none; }
.red, .grey { flo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.