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 |
|---|---|---|---|---|---|
17,020,758 | How to add animation moving effect to up and down sort movement.
**You can check the movement by clicking on the UP and DOWN text links.**
Here is my code
```
$(document).ready(function(){
$('.move-up').click(function(){
if ($(this).prev())
$(this).parent().insertBefore($(this).parent().prev(... | 2013/06/10 | [
"https://Stackoverflow.com/questions/17020758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1033200/"
] | I met the same demand here, to add move animation for item list. I first want to use jquery `animate` to do this. But I'm using `table` and `tr` as list and list item, and I find animations are not supported on table rows after some search (You can check [this link](https://stackoverflow.com/questions/467336/how-to-use... | I hope this is what you are looking for -> **[DEMO](http://jsfiddle.net/eJk3R/39/)**
```
if ($(this).prev())
$(this).parent().insertBefore($(this).parent().prev());
$(this).parent().animate({
opacity: 0.1
}, 1500 );
``` |
17,020,758 | How to add animation moving effect to up and down sort movement.
**You can check the movement by clicking on the UP and DOWN text links.**
Here is my code
```
$(document).ready(function(){
$('.move-up').click(function(){
if ($(this).prev())
$(this).parent().insertBefore($(this).parent().prev(... | 2013/06/10 | [
"https://Stackoverflow.com/questions/17020758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1033200/"
] | Maybe something like this could help you : <http://jsfiddle.net/eJk3R/38/>
```
$(document).ready(function(){
$('.move-up').click(function(){
if ($(this).prev()){
var t = $(this);
t.parent().animate({top: '-20px'}, 500, function(){
t.parent().prev().animate({top: '20p... | This code was work for me 100%.
The code pen url here <https://codepen.io/dineshnisshanka/pen/KKPzXJB>
```
<html>
<heade>
<style>
body {
margin: 0;
padding: 0;
}
.main_sec
{
display:inline-block;
width:100%;
max-width: 500px;
position: relative;
}
.main_sec .sec... |
17,020,758 | How to add animation moving effect to up and down sort movement.
**You can check the movement by clicking on the UP and DOWN text links.**
Here is my code
```
$(document).ready(function(){
$('.move-up').click(function(){
if ($(this).prev())
$(this).parent().insertBefore($(this).parent().prev(... | 2013/06/10 | [
"https://Stackoverflow.com/questions/17020758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1033200/"
] | just add the a sequence of hide and show, easy!
```
jQuery(html_usr).insertBefore( "#log_row" ).hide().show('slow');
``` | This code was work for me 100%.
The code pen url here <https://codepen.io/dineshnisshanka/pen/KKPzXJB>
```
<html>
<heade>
<style>
body {
margin: 0;
padding: 0;
}
.main_sec
{
display:inline-block;
width:100%;
max-width: 500px;
position: relative;
}
.main_sec .sec... |
17,020,758 | How to add animation moving effect to up and down sort movement.
**You can check the movement by clicking on the UP and DOWN text links.**
Here is my code
```
$(document).ready(function(){
$('.move-up').click(function(){
if ($(this).prev())
$(this).parent().insertBefore($(this).parent().prev(... | 2013/06/10 | [
"https://Stackoverflow.com/questions/17020758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1033200/"
] | just add the a sequence of hide and show, easy!
```
jQuery(html_usr).insertBefore( "#log_row" ).hide().show('slow');
``` | Use `.animate` to generate the animation.
**For instance,**
```
$(this).parent().insertBefore($(this).parent().prev()).animate({..});
$(this).parent().insertBefore($(this).parent().next()).animate({..});
``` |
17,020,758 | How to add animation moving effect to up and down sort movement.
**You can check the movement by clicking on the UP and DOWN text links.**
Here is my code
```
$(document).ready(function(){
$('.move-up').click(function(){
if ($(this).prev())
$(this).parent().insertBefore($(this).parent().prev(... | 2013/06/10 | [
"https://Stackoverflow.com/questions/17020758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1033200/"
] | just add the a sequence of hide and show, easy!
```
jQuery(html_usr).insertBefore( "#log_row" ).hide().show('slow');
``` | I met the same demand here, to add move animation for item list. I first want to use jquery `animate` to do this. But I'm using `table` and `tr` as list and list item, and I find animations are not supported on table rows after some search (You can check [this link](https://stackoverflow.com/questions/467336/how-to-use... |
17,020,758 | How to add animation moving effect to up and down sort movement.
**You can check the movement by clicking on the UP and DOWN text links.**
Here is my code
```
$(document).ready(function(){
$('.move-up').click(function(){
if ($(this).prev())
$(this).parent().insertBefore($(this).parent().prev(... | 2013/06/10 | [
"https://Stackoverflow.com/questions/17020758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1033200/"
] | Maybe something like this could help you : <http://jsfiddle.net/eJk3R/38/>
```
$(document).ready(function(){
$('.move-up').click(function(){
if ($(this).prev()){
var t = $(this);
t.parent().animate({top: '-20px'}, 500, function(){
t.parent().prev().animate({top: '20p... | I met the same demand here, to add move animation for item list. I first want to use jquery `animate` to do this. But I'm using `table` and `tr` as list and list item, and I find animations are not supported on table rows after some search (You can check [this link](https://stackoverflow.com/questions/467336/how-to-use... |
17,020,758 | How to add animation moving effect to up and down sort movement.
**You can check the movement by clicking on the UP and DOWN text links.**
Here is my code
```
$(document).ready(function(){
$('.move-up').click(function(){
if ($(this).prev())
$(this).parent().insertBefore($(this).parent().prev(... | 2013/06/10 | [
"https://Stackoverflow.com/questions/17020758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1033200/"
] | just add the a sequence of hide and show, easy!
```
jQuery(html_usr).insertBefore( "#log_row" ).hide().show('slow');
``` | I hope this is what you are looking for -> **[DEMO](http://jsfiddle.net/eJk3R/39/)**
```
if ($(this).prev())
$(this).parent().insertBefore($(this).parent().prev());
$(this).parent().animate({
opacity: 0.1
}, 1500 );
``` |
17,020,758 | How to add animation moving effect to up and down sort movement.
**You can check the movement by clicking on the UP and DOWN text links.**
Here is my code
```
$(document).ready(function(){
$('.move-up').click(function(){
if ($(this).prev())
$(this).parent().insertBefore($(this).parent().prev(... | 2013/06/10 | [
"https://Stackoverflow.com/questions/17020758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1033200/"
] | Maybe something like this could help you : <http://jsfiddle.net/eJk3R/38/>
```
$(document).ready(function(){
$('.move-up').click(function(){
if ($(this).prev()){
var t = $(this);
t.parent().animate({top: '-20px'}, 500, function(){
t.parent().prev().animate({top: '20p... | Use `.animate` to generate the animation.
**For instance,**
```
$(this).parent().insertBefore($(this).parent().prev()).animate({..});
$(this).parent().insertBefore($(this).parent().next()).animate({..});
``` |
17,020,758 | How to add animation moving effect to up and down sort movement.
**You can check the movement by clicking on the UP and DOWN text links.**
Here is my code
```
$(document).ready(function(){
$('.move-up').click(function(){
if ($(this).prev())
$(this).parent().insertBefore($(this).parent().prev(... | 2013/06/10 | [
"https://Stackoverflow.com/questions/17020758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1033200/"
] | Use `.animate` to generate the animation.
**For instance,**
```
$(this).parent().insertBefore($(this).parent().prev()).animate({..});
$(this).parent().insertBefore($(this).parent().next()).animate({..});
``` | I hope this is what you are looking for -> **[DEMO](http://jsfiddle.net/eJk3R/39/)**
```
if ($(this).prev())
$(this).parent().insertBefore($(this).parent().prev());
$(this).parent().animate({
opacity: 0.1
}, 1500 );
``` |
17,020,758 | How to add animation moving effect to up and down sort movement.
**You can check the movement by clicking on the UP and DOWN text links.**
Here is my code
```
$(document).ready(function(){
$('.move-up').click(function(){
if ($(this).prev())
$(this).parent().insertBefore($(this).parent().prev(... | 2013/06/10 | [
"https://Stackoverflow.com/questions/17020758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1033200/"
] | Use `.animate` to generate the animation.
**For instance,**
```
$(this).parent().insertBefore($(this).parent().prev()).animate({..});
$(this).parent().insertBefore($(this).parent().next()).animate({..});
``` | This code was work for me 100%.
The code pen url here <https://codepen.io/dineshnisshanka/pen/KKPzXJB>
```
<html>
<heade>
<style>
body {
margin: 0;
padding: 0;
}
.main_sec
{
display:inline-block;
width:100%;
max-width: 500px;
position: relative;
}
.main_sec .sec... |
16,913,392 | Is there any means by which you can redirect a user to the login page once the session expires in `drupal 6`.Now when the session expires I get a message `"Access denied.You are not authorized to access this page."`.I really don't want this message to be shown ,rather it would be much better if i could redirect them to... | 2013/06/04 | [
"https://Stackoverflow.com/questions/16913392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2281770/"
] | Here is a quick trick:
Add following code to the very top of your page template file (page.tpl.php):
```
global $user;
if (!$user->uid && $title == 'Access denied') {
header('Location: /user?destination=' . substr($_SERVER['REQUEST_URI'],1));
exit;
}
``` | [There is a module for that.](https://drupal.org/project/r4032login)
Just install this module. It will replace the classic Access Denies page with the login form. |
16,913,392 | Is there any means by which you can redirect a user to the login page once the session expires in `drupal 6`.Now when the session expires I get a message `"Access denied.You are not authorized to access this page."`.I really don't want this message to be shown ,rather it would be much better if i could redirect them to... | 2013/06/04 | [
"https://Stackoverflow.com/questions/16913392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2281770/"
] | I think you can overwrite function:**template\_process\_page()** in your theme **template.php**.
here you can check global $user,to check is **$user->uid**,if it is equal 0,use function **drupal\_goto()**,to the page you want | [There is a module for that.](https://drupal.org/project/r4032login)
Just install this module. It will replace the classic Access Denies page with the login form. |
16,913,392 | Is there any means by which you can redirect a user to the login page once the session expires in `drupal 6`.Now when the session expires I get a message `"Access denied.You are not authorized to access this page."`.I really don't want this message to be shown ,rather it would be much better if i could redirect them to... | 2013/06/04 | [
"https://Stackoverflow.com/questions/16913392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2281770/"
] | Here is a quick trick:
Add following code to the very top of your page template file (page.tpl.php):
```
global $user;
if (!$user->uid && $title == 'Access denied') {
header('Location: /user?destination=' . substr($_SERVER['REQUEST_URI'],1));
exit;
}
``` | I think you can overwrite function:**template\_process\_page()** in your theme **template.php**.
here you can check global $user,to check is **$user->uid**,if it is equal 0,use function **drupal\_goto()**,to the page you want |
6,150,255 | I want to collect all output from my script in a log file and must use write-output instaed of write-host.
`Write-Output "Server:" $a` looks like
`Server:
foo`.
Do I really have to write to write
`write-output $("sfdghk:" + $a)` to get `Server:Foo`
Thanks
-jt | 2011/05/27 | [
"https://Stackoverflow.com/questions/6150255",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/772786/"
] | Found somewhere on the Internet:
```
Write-Output "Server: $($a)"
```
Works great in my code. | 9 hours ... I start an answer.
In Powershell everything you manipulate is an object.
so "Server:" is an object, $a is an object
```
PS> "server :".gettype()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True Stri... |
6,150,255 | I want to collect all output from my script in a log file and must use write-output instaed of write-host.
`Write-Output "Server:" $a` looks like
`Server:
foo`.
Do I really have to write to write
`write-output $("sfdghk:" + $a)` to get `Server:Foo`
Thanks
-jt | 2011/05/27 | [
"https://Stackoverflow.com/questions/6150255",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/772786/"
] | Found somewhere on the Internet:
```
Write-Output "Server: $($a)"
```
Works great in my code. | ```
Write-Output "Server: $a"
Write-Output ("Server: {0}" -f $a)
Write-Output ("Server: " + $a)
```
If you want to collect the output from a script into a log file, consider using `Start-Transcript`. It logs every command and all PowerShell output to a file. It doesn't log anything sent to stdout, however, so if you'... |
6,150,255 | I want to collect all output from my script in a log file and must use write-output instaed of write-host.
`Write-Output "Server:" $a` looks like
`Server:
foo`.
Do I really have to write to write
`write-output $("sfdghk:" + $a)` to get `Server:Foo`
Thanks
-jt | 2011/05/27 | [
"https://Stackoverflow.com/questions/6150255",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/772786/"
] | Found somewhere on the Internet:
```
Write-Output "Server: $($a)"
```
Works great in my code. | There's good information in the existing answers, but let me attempt a pragmatic summary:
* When printing to the *console* or *redirecting to a file*, **`Write-Output` separates *multiple* arguments by a newline each**.
* Therefore, **in order to produce *single-line* output, you must "pre-assemble" the parts to outpu... |
1,090,288 | I am attempting to deploy my first development iPhone app, and am running into some problems. I have successfully went though the online Provisioning Assistant, but now I am stuck. No matter what I do, I always get the following error.
>
> /usr/bin/codesign failed with exit code 1
>
>
>
Anyone have any ideas why ... | 2009/07/07 | [
"https://Stackoverflow.com/questions/1090288",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123441/"
] | There could be a lot of reason when you get this kind of error:
1. Check whether you have selected a provisioning profile which includes the valid **Code Signing Identity** and a valid **Bundle Identifier** in Settings. (Goto Build Settings->Signing->Provisioning Profile).
2. Open **Keychain Access** and click on lock... | I just came across this error and it was because I was trying to write the build file to a network drive that was not working. Tried again from my desktop and it worked just fine. (You may have to "Clean" the build after you move it. Just choose "Clean all Targets" from the "Build" drop-down menu).
Tobias is correct t... |
1,090,288 | I am attempting to deploy my first development iPhone app, and am running into some problems. I have successfully went though the online Provisioning Assistant, but now I am stuck. No matter what I do, I always get the following error.
>
> /usr/bin/codesign failed with exit code 1
>
>
>
Anyone have any ideas why ... | 2009/07/07 | [
"https://Stackoverflow.com/questions/1090288",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123441/"
] | In my case error was due to the fact that I had two keys on the keychain with the same name. I deleted the old one and that solved the issue.
Going to the detail message show the real problem to me. | I think the issue is with the Keychain Access and certificate trust.
Try adding the following certificate `Apple Worldwide Developer Relations Certification Authority` from <https://www.apple.com/certificateauthority/> (Expiry validity 2030)
The trust warning indicated in certificate will be fixed and then try buildi... |
1,090,288 | I am attempting to deploy my first development iPhone app, and am running into some problems. I have successfully went though the online Provisioning Assistant, but now I am stuck. No matter what I do, I always get the following error.
>
> /usr/bin/codesign failed with exit code 1
>
>
>
Anyone have any ideas why ... | 2009/07/07 | [
"https://Stackoverflow.com/questions/1090288",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123441/"
] | Sometimes your build folder simply needs cleaning - it certainly worked for me. Thanks to [loafer-project](http://loafer-project.com/usrbincodesign-failed-with-exit-code-1/) for the solution. | I had the same unknown error from codesigning that you mentioned. Similar to the answer provided (but a little different), I just locked my keychain access and unlocked it, and I was able to build and run to my device again. If anyone has the same issue, perhaps try that first before going through the trouble of modify... |
1,090,288 | I am attempting to deploy my first development iPhone app, and am running into some problems. I have successfully went though the online Provisioning Assistant, but now I am stuck. No matter what I do, I always get the following error.
>
> /usr/bin/codesign failed with exit code 1
>
>
>
Anyone have any ideas why ... | 2009/07/07 | [
"https://Stackoverflow.com/questions/1090288",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123441/"
] | There could be a lot of reason when you get this kind of error:
1. Check whether you have selected a provisioning profile which includes the valid **Code Signing Identity** and a valid **Bundle Identifier** in Settings. (Goto Build Settings->Signing->Provisioning Profile).
2. Open **Keychain Access** and click on lock... | I had the same problem but also listed in the error log was this: CSSMERR\_TP\_CERT\_NOT\_VALID\_YET
Looking at the certificate in KeyChain showed a similar message. The problem was due to my Mac's system clock being set incorrectly. As soon as I set the correct region/time, the certificate was marked as valid and I c... |
1,090,288 | I am attempting to deploy my first development iPhone app, and am running into some problems. I have successfully went though the online Provisioning Assistant, but now I am stuck. No matter what I do, I always get the following error.
>
> /usr/bin/codesign failed with exit code 1
>
>
>
Anyone have any ideas why ... | 2009/07/07 | [
"https://Stackoverflow.com/questions/1090288",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123441/"
] | I had the same problem the distribution build. It just happened all of sudden. In fact I did not have this problem a few days ago and I had my Ad-Hoc version compile right. This issue came up because my certificate just expired today. So I went create a new provisional following Apple's guidance: (http://developer.appl... | I had the same unknown error from codesigning that you mentioned. Similar to the answer provided (but a little different), I just locked my keychain access and unlocked it, and I was able to build and run to my device again. If anyone has the same issue, perhaps try that first before going through the trouble of modify... |
1,090,288 | I am attempting to deploy my first development iPhone app, and am running into some problems. I have successfully went though the online Provisioning Assistant, but now I am stuck. No matter what I do, I always get the following error.
>
> /usr/bin/codesign failed with exit code 1
>
>
>
Anyone have any ideas why ... | 2009/07/07 | [
"https://Stackoverflow.com/questions/1090288",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123441/"
] | It might be strange answer for codesign issue in Xcode 9.0. I was receiving this error too and did not know what to be done, because everything was correct.
I went to the keychain, I had the login option "unlocked". I locked it and compiled my build again. Xcode itself asked me to open access keychain. I gave access a... | When I got this error I wasn't even trying to sign the app. I was writing a test app and didn't care about signing.
In order to get rid of this message I had to select "Don't Code Sign" from Build Settings under Code Signing.
 |
1,090,288 | I am attempting to deploy my first development iPhone app, and am running into some problems. I have successfully went though the online Provisioning Assistant, but now I am stuck. No matter what I do, I always get the following error.
>
> /usr/bin/codesign failed with exit code 1
>
>
>
Anyone have any ideas why ... | 2009/07/07 | [
"https://Stackoverflow.com/questions/1090288",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123441/"
] | I just came across this error, and here's what I found out in case this helps anyone: I discovered that you can right click the error message in Xcode and choose expand to get more details, including a description of the problem.
In my case, I had two copies of my developer certificate with the same name in different ... | I use Xamarin and for me this is what worked after trying everything else.
In Visual Studio for Mac I've opened a .xib file so it opens the project in Xcode.
Went to the project settings > Signing and Capabilities, selected the team and then fixed the Signing Certificate. |
1,090,288 | I am attempting to deploy my first development iPhone app, and am running into some problems. I have successfully went though the online Provisioning Assistant, but now I am stuck. No matter what I do, I always get the following error.
>
> /usr/bin/codesign failed with exit code 1
>
>
>
Anyone have any ideas why ... | 2009/07/07 | [
"https://Stackoverflow.com/questions/1090288",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123441/"
] | I was also getting this error ("/usr/bin/codesign failed with exit code 1"), and when I looked in Keychain Access my developer certificates were marked as "This certificate was signed by an unknown authority". I had recently upgraded to Mac OS 10.8 and have had a couple of other XCode (4.5.2) issues since then. It turn... | Open the project path in terminal and enter the below commands in terminal
1) **find . | xargs -0 xattr -c**
2) **xattr -rc .**
This works for me. |
1,090,288 | I am attempting to deploy my first development iPhone app, and am running into some problems. I have successfully went though the online Provisioning Assistant, but now I am stuck. No matter what I do, I always get the following error.
>
> /usr/bin/codesign failed with exit code 1
>
>
>
Anyone have any ideas why ... | 2009/07/07 | [
"https://Stackoverflow.com/questions/1090288",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123441/"
] | I had the same problem the distribution build. It just happened all of sudden. In fact I did not have this problem a few days ago and I had my Ad-Hoc version compile right. This issue came up because my certificate just expired today. So I went create a new provisional following Apple's guidance: (http://developer.appl... | I had the same problem. In the end it turned out that my private key did not allow codesign to access it. One can see this in the info dialog in keychain application. |
1,090,288 | I am attempting to deploy my first development iPhone app, and am running into some problems. I have successfully went though the online Provisioning Assistant, but now I am stuck. No matter what I do, I always get the following error.
>
> /usr/bin/codesign failed with exit code 1
>
>
>
Anyone have any ideas why ... | 2009/07/07 | [
"https://Stackoverflow.com/questions/1090288",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123441/"
] | What worked for me was adding `--deep` to **Other Code Signing Flags** in Build Settings.
More information here: [Codesign of Dropbox API fails in Xcode 4.6.3: "code object is not signed at all"](https://stackoverflow.com/q/17263967/264970)
Unfortunate that this ambiguous error condition has 400 different solutions, b... | I was also getting this error ("/usr/bin/codesign failed with exit code 1"), and when I looked in Keychain Access my developer certificates were marked as "This certificate was signed by an unknown authority". I had recently upgraded to Mac OS 10.8 and have had a couple of other XCode (4.5.2) issues since then. It turn... |
61,525,181 | Okay, so I'm making a dynamic website in javascript, and I have producers that I have added to an sql table. Each producer has their id, name and product which they are producing. The problem I am having is, I am unsure on how to add multiple products in the "product" column for each producer and how to get that inform... | 2020/04/30 | [
"https://Stackoverflow.com/questions/61525181",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13441369/"
] | For iteration
<https://stackblitz.com/edit/ionic-shrsj2>
in `OptionsPage.html`
```
<span *ngFor="let page of pages; index as i" >
<button ion-button
(click)="ViewSet(i)">
Broadcast OptionsChanged to View{{i+1}}
</button>
</span>
```
in `OptionsPage.ts`
```
pages = [
View1Page,
View2Pag... | <https://stackblitz.com/edit/ionic-tgcblm>
You can try like this,
```
.View2Page
import { Component } from "@angular/core";
import { NavController } from "ionic-angular";
import { View1Page } from "./View1Page";
import { ViewService } from "./ViewService";
@Component({
selector: "View2Page",
templateUrl: "Vie... |
60,169,845 | I need to use nullable type.
I found `std::optional` which perfectly meets my expectations.
But this feature is available from C++ 17, experimental branch from C++ 14. It means the compiler (different computer) has to be updated.
It is just allocated space for data and bool which indicates if variable exists or not.... | 2020/02/11 | [
"https://Stackoverflow.com/questions/60169845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12879004/"
] | After realizing your point on the question, i want to answer with a quote.
>
> P.13: Use support libraries as appropriate.
>
>
> **Reason** Using a
> well-designed, well-documented, and well-supported library saves time
> and effort; its quality and documentation are likely to be greater
> than what you could do... | In the end of the day, you are stuck with a dilemma. You have a standardized, well-supported feature, which is not available in your toolset. The toolset can be upgraded, but it's a hassle for different reasons.
At the same time, you have a homebrew solution, which is not standard, likely lacks features (since you wer... |
60,169,845 | I need to use nullable type.
I found `std::optional` which perfectly meets my expectations.
But this feature is available from C++ 17, experimental branch from C++ 14. It means the compiler (different computer) has to be updated.
It is just allocated space for data and bool which indicates if variable exists or not.... | 2020/02/11 | [
"https://Stackoverflow.com/questions/60169845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12879004/"
] | After realizing your point on the question, i want to answer with a quote.
>
> P.13: Use support libraries as appropriate.
>
>
> **Reason** Using a
> well-designed, well-documented, and well-supported library saves time
> and effort; its quality and documentation are likely to be greater
> than what you could do... | >
> Are there some benefits for using std::optional?
>
>
>
To my knowledge the purpose of `std::optional` and one main difference to alternatives is to have the value on the stack (from [cppreference](https://en.cppreference.com/w/cpp/utility/optional)):
>
> If an optional contains a value, the value is guarante... |
60,169,845 | I need to use nullable type.
I found `std::optional` which perfectly meets my expectations.
But this feature is available from C++ 17, experimental branch from C++ 14. It means the compiler (different computer) has to be updated.
It is just allocated space for data and bool which indicates if variable exists or not.... | 2020/02/11 | [
"https://Stackoverflow.com/questions/60169845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12879004/"
] | After realizing your point on the question, i want to answer with a quote.
>
> P.13: Use support libraries as appropriate.
>
>
> **Reason** Using a
> well-designed, well-documented, and well-supported library saves time
> and effort; its quality and documentation are likely to be greater
> than what you could do... | >
> But this feature is available from C++ 17, experimental branch from C++ 14. It means the compiler (different computer) has to be updated.
>
>
>
Firstly, updating your compiler should not, ideally, be a big deal.
If it *is* a big deal, the best thing to do is improve your processes until it is no longer a big ... |
60,169,845 | I need to use nullable type.
I found `std::optional` which perfectly meets my expectations.
But this feature is available from C++ 17, experimental branch from C++ 14. It means the compiler (different computer) has to be updated.
It is just allocated space for data and bool which indicates if variable exists or not.... | 2020/02/11 | [
"https://Stackoverflow.com/questions/60169845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12879004/"
] | In the end of the day, you are stuck with a dilemma. You have a standardized, well-supported feature, which is not available in your toolset. The toolset can be upgraded, but it's a hassle for different reasons.
At the same time, you have a homebrew solution, which is not standard, likely lacks features (since you wer... | >
> Are there some benefits for using std::optional?
>
>
>
To my knowledge the purpose of `std::optional` and one main difference to alternatives is to have the value on the stack (from [cppreference](https://en.cppreference.com/w/cpp/utility/optional)):
>
> If an optional contains a value, the value is guarante... |
60,169,845 | I need to use nullable type.
I found `std::optional` which perfectly meets my expectations.
But this feature is available from C++ 17, experimental branch from C++ 14. It means the compiler (different computer) has to be updated.
It is just allocated space for data and bool which indicates if variable exists or not.... | 2020/02/11 | [
"https://Stackoverflow.com/questions/60169845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12879004/"
] | >
> But this feature is available from C++ 17, experimental branch from C++ 14. It means the compiler (different computer) has to be updated.
>
>
>
Firstly, updating your compiler should not, ideally, be a big deal.
If it *is* a big deal, the best thing to do is improve your processes until it is no longer a big ... | >
> Are there some benefits for using std::optional?
>
>
>
To my knowledge the purpose of `std::optional` and one main difference to alternatives is to have the value on the stack (from [cppreference](https://en.cppreference.com/w/cpp/utility/optional)):
>
> If an optional contains a value, the value is guarante... |
34,502,965 | `pip install <package>` command is working for me, I tried installing `selenium` package it is working in my setup but when I try to install `pyautogui`, it does not work. Screenshots below. What could be wrong here:
**WORKS**:
[](https://i.stack.imgu... | 2015/12/29 | [
"https://Stackoverflow.com/questions/34502965",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1406716/"
] | The error message is just as it reads. You need the `Pillow` port of the `PIL` library as a dependency:
```
pip install Pillow # a popular port of the Python Imaging Library, which is needed here
``` | I resolved the problem by using the command `pip3 install pyautogui` from the console terminal window of the workstation. The cause of the error is that before doing that I was trying to use an SSH terminal window to install the software remotely. The SSH terminal window environment does not support a window system. |
29,064,349 | I have a variable `param` which has to be initialized at runtime.
Then, I have a part of the code which implements the following:
```
if (param has been initialized)
...do something...
else
print error and exit
```
What is the most idiomatic way to do this in Scala?
So far I have used `Option[X]` in this... | 2015/03/15 | [
"https://Stackoverflow.com/questions/29064349",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/724395/"
] | Simply `map` or `foreach` over it:
```
param.foreach { param_value =>
// Do everything you need to do with `param_value` here
} getOrElse sys.exit(3) # Param was empty, kill the program
```
You can also use the `for` comprehension style:
```
for {
param_value <- param
} yield yourOperation(param_value)
```
T... | I might me wrong but it seems to me that the use of [Future](http://docs.scala-lang.org/overviews/core/futures.html) would fit with your problem: Instead of explicitly checking whether your required `param_value` has been initialized and finish the program if not, you could make your resource dependent code to execute ... |
24,116,598 | I have a number of arrays stored in Strings.xml file in my android project. I want to populate a list from these `Arrays` based upon a button click. depends upon which button clicked, i need to populate different lists. So the code is very messy by adding a nested `if else` structure. Is there any way to get the `Strin... | 2014/06/09 | [
"https://Stackoverflow.com/questions/24116598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3714733/"
] | ```
<string-array name="myarray">
<item>value1</item>
<item>value2</item>
<item>value3</item>
<item>value4</item>
</string-array>
```
And in your java code,
```
String[] MyArray = getResources().getStringArray(R.array.myarray);
```
I hope this is what you need, If not please let me know. | You use this code;
**For string:**
```
public static int getImageResourceIDFromName(String tag,
Context context) {
int identifier = context.getResources().getIdentifier (tag,"string",context.getPackageName());
return identifier;
}
```
**For Array:**
```
public static int getImage... |
24,116,598 | I have a number of arrays stored in Strings.xml file in my android project. I want to populate a list from these `Arrays` based upon a button click. depends upon which button clicked, i need to populate different lists. So the code is very messy by adding a nested `if else` structure. Is there any way to get the `Strin... | 2014/06/09 | [
"https://Stackoverflow.com/questions/24116598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3714733/"
] | ```
<string-array name="myarray">
<item>value1</item>
<item>value2</item>
<item>value3</item>
<item>value4</item>
</string-array>
```
And in your java code,
```
String[] MyArray = getResources().getStringArray(R.array.myarray);
```
I hope this is what you need, If not please let me know. | use this method to get the array id from array name..
```
private int getArrayId(String arranameString) {
int id = this.getResources().getIdentifier(arranameString, "array", this.getPackageName());
return id;
}
```
This will return the id of your string array |
24,116,598 | I have a number of arrays stored in Strings.xml file in my android project. I want to populate a list from these `Arrays` based upon a button click. depends upon which button clicked, i need to populate different lists. So the code is very messy by adding a nested `if else` structure. Is there any way to get the `Strin... | 2014/06/09 | [
"https://Stackoverflow.com/questions/24116598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3714733/"
] | use this method to get the array id from array name..
```
private int getArrayId(String arranameString) {
int id = this.getResources().getIdentifier(arranameString, "array", this.getPackageName());
return id;
}
```
This will return the id of your string array | You use this code;
**For string:**
```
public static int getImageResourceIDFromName(String tag,
Context context) {
int identifier = context.getResources().getIdentifier (tag,"string",context.getPackageName());
return identifier;
}
```
**For Array:**
```
public static int getImage... |
58,126,004 | I am unit testing controller logic. I have a controller action which takes a string parameter like so:
```
public async Task<IActionResult> Get(string searchCriterion)
{
if (string.IsNullOrEmpty(searchCriterion))
{
// Log modelstate errors
return BadRequest("Hello");
}
// etc...
}
```... | 2019/09/26 | [
"https://Stackoverflow.com/questions/58126004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11870865/"
] | `It.IsAny<string>()` is meant to be used ***only*** as part of the setup for mocks.
```
mock.Setup(_ => _.SomeMember(It.IsAny<string>()).Returns(SomeValue);
```
It is not meant to be used outside of the `Setup` expression and will return the default value for the provided generic argument.
ie
```
It.IsAny<string>... | What are you trying to test? If the test is not checking the guard then pass an expected string value
```
[Fact]
public async Task GetSearchNetworkAsync_WithValidString_ReturnsOkWithNetworkListViewModelCollection_Rn()
{
...
// Act
var result = await controller.GetSearchNetworkAsync("some value");
```
You... |
16,880,730 | I am just using simple lock to manage some shared data.
Is there a way to know which thread took the lock?
Basically someone already acquired lock and didn't release it. So, all the subsequent operations are simply struck at taking lock and timing out.
I am kind of stuck as from debugger it is simply stuck at lock ... | 2013/06/02 | [
"https://Stackoverflow.com/questions/16880730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/997661/"
] | Just add some diagnostic print messages using `Debug.WriteLine` to see whch thread has entered critical section.
<http://msdn.microsoft.com/en-us/library/system.diagnostics.debug.writeline.aspx> | This is a quite old question... But I found that in VS 2022 the Parallel Stacks window will show this:
[](https://i.stack.imgur.com/Osd1o.png)
Very convenient. Thanks VS-Team! |
16,880,730 | I am just using simple lock to manage some shared data.
Is there a way to know which thread took the lock?
Basically someone already acquired lock and didn't release it. So, all the subsequent operations are simply struck at taking lock and timing out.
I am kind of stuck as from debugger it is simply stuck at lock ... | 2013/06/02 | [
"https://Stackoverflow.com/questions/16880730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/997661/"
] | Perhaps this would help:
1. Enable unmanaged debugging (Project Properties > Debug > check "Enable unmanaged code debugging"
2. Set a breakpoint somewhere
3. When the execution breaks, in the Immediate window, type: `.load sos` and then type `!SyncBlk -a` | This is a quite old question... But I found that in VS 2022 the Parallel Stacks window will show this:
[](https://i.stack.imgur.com/Osd1o.png)
Very convenient. Thanks VS-Team! |
63,299,030 | I need to make an array of string where I can store either 3 or 5 words like {"banana, peach, pear"}, or {"orange", "pear", "silantro", "ginger", "mandarine"}.
I'm confused if I should make an array of string pointer(to dynamically allocate the memory depending on the size of the array-3 or 5), or just have an array o... | 2020/08/07 | [
"https://Stackoverflow.com/questions/63299030",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14008120/"
] | You could use a correlated subquery to populate the last active date column:
```
SELECT
CampaignID,
Date,
Status,
CASE WHEN Status <> 'Active' THEN
(SELECT t2.Date FROM yourTable t2
WHERE t2.CampaignID = t1.CampaignID AND t2.Date > t1.Date AND t2.Status = 'Active'
ORDER BY ... | I would recommend using window functions:
```
select t.*,
(case when status <> 'Active'
then min(case when status = 'Active' then Date end) over (partition by CampaignId order by date desc)
end) as next_active
from t
order by CampaignID, Date desc;
```
[Here](https://dbfiddle.uk/?rdbms=my... |
156,287 | I wish to align a table and a diagram vertically on a line. Here is my code:
```
\begin{flushleft}
\begin{tabular}{l||c|r}
& a & b \\
\hline
$q_0 & q_1 & q_0$ \\
$q_1 & q_1 & q_2$ \\
$q_2 & q_2 & q_2$
\end{tabular}
\end{flushleft}
\begin{flushright}
\begin{tikzpicture}[short... | 2014/01/28 | [
"https://tex.stackexchange.com/questions/156287",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/19229/"
] | The following example uses package `kvsetkeys` to get a parser for lists with comma separated entries:
```
\input kvsetkeys.sty % parser for comma separated lists
\input ltxcmds.sty % helper macros
\catcode`\@=11 % \makeatletter
\newif\ifkey@found
% \testkeywordinlist{keyword}{keyword list}{true}{false}
\def\testkey... | You can use functional-style programming to build a fully-expandable version of [`map`](https://en.wikipedia.org/wiki/Map_(higher-order_function)) and string comparison. This however requires e-TeX support. Here I am using `\pdfstrcmp` to compare strings, so this solution is specific to pdfTeX.
```
\def\map#1#2{%
\d... |
13,984,447 | Do you know about Australian Banker's Association (.aba) file format ? It is used for batch transactions which is quite similar to csv files. However, what I don't understand is, how is the columns separated from each other. For example, in csv files, we use like (,;) etc. Also I don't find a sample files. Here is one ... | 2012/12/21 | [
"https://Stackoverflow.com/questions/13984447",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/671059/"
] | >
> However, what I don't understand is, how is the columns separated from each other. For example, in csv files, we use like (,;) etc
>
>
>
It is similar to CSV but it is a plan text file consisting of strings and lines...
Here are some ready solutions
Symfony 2 bundle -> <https://github.com/latysh/aba-bundle>
... | It looks like a simple file format. Instead of thinking of it as a CSV file, which is delimited using some symbol, think of it as a string of characters.
So, if you have an ABA file then you can parse it using `fopen()` and `fread()`.
```
<?php
$fh = fopen('example.aba', 'rb');
$block1 = fread($fh, 1);
$block2 = frea... |
13,984,447 | Do you know about Australian Banker's Association (.aba) file format ? It is used for batch transactions which is quite similar to csv files. However, what I don't understand is, how is the columns separated from each other. For example, in csv files, we use like (,;) etc. Also I don't find a sample files. Here is one ... | 2012/12/21 | [
"https://Stackoverflow.com/questions/13984447",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/671059/"
] | >
> However, what I don't understand is, how is the columns separated from each other. For example, in csv files, we use like (,;) etc
>
>
>
It is similar to CSV but it is a plan text file consisting of strings and lines...
Here are some ready solutions
Symfony 2 bundle -> <https://github.com/latysh/aba-bundle>
... | I know this is a late reply, but for other people coding for ABA file format,
<http://www.cemtexaba.com/aba-format/> has a sample file format.
And this site has a great explanation on each of the fields
<https://github.com/mjec/aba/blob/master/sample-with-comments.aba> but don't refer to it as your single source of t... |
60,856,039 | I am working on a word frequency app, where the user can find the most used word in the text and alter that word and display an altered version of the whole text in HTML.
I created a function where you create a `span` tag around the altered word, so I can give a class to add some CSS to highlight it.
```
const up... | 2020/03/25 | [
"https://Stackoverflow.com/questions/60856039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11936984/"
] | If this is for the purpose of learning or analysis, why don't you just use a debugger? I am going to show you an example in IntelliJ IDEA:
**Given** this code somewhere in your `main` method or test:
```java
final ByteBuffer real = ByteBuffer.wrap("abc".getBytes());
LOG.info("Real........: {} {}", real, real.array()... | Well, I managed to hack my way to a solution.
Firstly, JMockit doesn't work very well with JDK13, so I backported the JDK13 Http Client to JDK8. Its an evil hack, but sufficient for my test-case.
Then I used a slightly older Version (1.46) of JMockit because some comedian decided that no one should be allowed to Fake... |
99,003 | [This proposal](http://area51.stackexchange.com/proposals/33760/locales) had announcements deleted with the following comment:
>
> Announcements are not for comments: Please ask questions in the discussion section.
>
>
>
But the stuff that was deleted was not a question (for example, "This site is a duplicate of ... | 2011/07/19 | [
"https://meta.stackexchange.com/questions/99003",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/151681/"
] | It depends, what exactly is the nature of your "statement"? For example, if it was "This is not a duplicate", you would [create a discussion](https://area51.meta.stackexchange.com/questions/ask?post-text=Proposal%3a+%5b**Locales**%5d%5b1%5d%0a%0a++%5b1%5d%3ahttp%3a%2f%2farea51.stackexchange.com%2fproposals%2f33760%2flo... | That's what the [Area 51 Discussion Zone](https://area51.meta.stackexchange.com/questions) is for.
Area 51 participants were using comments to ask about the proposals. Even a statement as simple as "This is a duplicate," elicited a response which, more often than not, launched into an all-out discussion. Comments do n... |
4,589,562 | Is there a way to install my own self-signed SSL certificate on my iPad? Presumably I can get the .crt via Dropbox or email, but then what do I do with it? Is there an easier way to get the .crt than that (from a PC)? | 2011/01/04 | [
"https://Stackoverflow.com/questions/4589562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/73253/"
] | This might help found this Apple Support post:
>
> I would import the cert on a desktop system through Firefox, then export with private key in `.p12` form. Email the resulting cert and you should be all set.
>
>
>
<http://discussions.apple.com/thread.jspa?threadID=2652502&tstart=0> | This is very easy . You can just put your certificate in your server where it can be accessed via a browser. Than just visit the location in your browser Eg. Safari in ipad just click on the certificate. |
69,141,449 | I want to create a login page where an error message is displayed when fields are empty. I use function components, state and props to keep the UI separated from the logic. So I have a `UserSignInController` which returns a `UserSignInView` which gets displayed on screen.
When I set a `onPress` callback for the login ... | 2021/09/11 | [
"https://Stackoverflow.com/questions/69141449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8690031/"
] | Try to use `timestamps` in your schema after defining you fields.
```
const itemSchema = mongoose.Schema({
person_name: String,
person_position: String,
person_level: String,
},{timestamps:true});
var RecordItem = mongoose.model("recorditem", itemSchema);
``` | There are several ways to safe createdAt
1. timestamp : true in options
2. `createdAt: { type: Date, default: Date.now },`
3. itemSchema.pre('save', function(next) {
if (!this.createdAt) {
this.createdAt = new Date();
}
next();
}); |
37,268,833 | I want only responseText from object so I can use the data to fill the fields.Here is my jquery Ajax code
```
var request = $.ajax({
url: "http://jsonplaceholder.typicode.com/posts/1",
type: "GET",
dataType: "application/json"
});
console.log(request);
```
In request there is responseText ... | 2016/05/17 | [
"https://Stackoverflow.com/questions/37268833",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6171764/"
] | Try this:
```
$.ajax({
url: "http://jsonplaceholder.typicode.com/posts/1",
type: 'GET',
dataType: "application/json",
error: function() {
},
success: function(response) {
console.log(response)
}
});
``` | You need to add a success/error function.
This is your call:
```
$.ajax({
url: "http://jsonplaceholder.typicode.com/posts/1",
type: "GET",
dataType: "application/json",
// function goes here
});
```
That function will look like this:
```
success:function(details){
// details is return da... |
37,268,833 | I want only responseText from object so I can use the data to fill the fields.Here is my jquery Ajax code
```
var request = $.ajax({
url: "http://jsonplaceholder.typicode.com/posts/1",
type: "GET",
dataType: "application/json"
});
console.log(request);
```
In request there is responseText ... | 2016/05/17 | [
"https://Stackoverflow.com/questions/37268833",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6171764/"
] | Try this. This will satisfy your req
```
$.ajax({
url: "http://jsonplaceholder.typicode.com/posts/1",
type: "GET",
dataType: "jsonp",
success: function (response) {
console.log(response);
}
});
``` | You need to add a success/error function.
This is your call:
```
$.ajax({
url: "http://jsonplaceholder.typicode.com/posts/1",
type: "GET",
dataType: "application/json",
// function goes here
});
```
That function will look like this:
```
success:function(details){
// details is return da... |
11,467,292 | I tried pointers and reference(&) but when I try to get the info(I am only reading from memory) computer "beeps" and program terminates.
NO problem when assigning a pointer to a byte (char \*). But when I read that computer beeps. ( x=\*p;)
Windows xp, 1GB + 128 MB RAM. I don't know about my eproom + eeproms.
Can I u... | 2012/07/13 | [
"https://Stackoverflow.com/questions/11467292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1470092/"
] | You can't. Modern OSes use virtual mode and memory protection which don't permit this. To access all physical RAM, you'll most likely need to write your own OS or a kernel driver for an existing OS. | You can not do this, because you have not privilege to do, when you run your code, it creates a process to run your program, and each process can only access to its address space, access to others process address space make a trap to os, and your kernel suspends works and checks your stack and your process, then it fin... |
11,467,292 | I tried pointers and reference(&) but when I try to get the info(I am only reading from memory) computer "beeps" and program terminates.
NO problem when assigning a pointer to a byte (char \*). But when I read that computer beeps. ( x=\*p;)
Windows xp, 1GB + 128 MB RAM. I don't know about my eproom + eeproms.
Can I u... | 2012/07/13 | [
"https://Stackoverflow.com/questions/11467292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1470092/"
] | You can't. Modern OSes use virtual mode and memory protection which don't permit this. To access all physical RAM, you'll most likely need to write your own OS or a kernel driver for an existing OS. | This should help me:
```
typedef struct _MEMORY_BASIC_INFORMATION {
PVOID BaseAddress;
PVOID AllocationBase;
DWORD AllocationProtect;
DWORD RegionSize;
DWORD State;
DWORD Protect;
DWORD Type;
} MEMORY_BASIC_INFORMATION, *PMEMORY_BASIC_INFORMATION;
```
and this:
```
VirtualQueryEx(
HANDLE hProcess,
LPCVOID lpAddress... |
11,467,292 | I tried pointers and reference(&) but when I try to get the info(I am only reading from memory) computer "beeps" and program terminates.
NO problem when assigning a pointer to a byte (char \*). But when I read that computer beeps. ( x=\*p;)
Windows xp, 1GB + 128 MB RAM. I don't know about my eproom + eeproms.
Can I u... | 2012/07/13 | [
"https://Stackoverflow.com/questions/11467292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1470092/"
] | You can not do this, because you have not privilege to do, when you run your code, it creates a process to run your program, and each process can only access to its address space, access to others process address space make a trap to os, and your kernel suspends works and checks your stack and your process, then it fin... | This should help me:
```
typedef struct _MEMORY_BASIC_INFORMATION {
PVOID BaseAddress;
PVOID AllocationBase;
DWORD AllocationProtect;
DWORD RegionSize;
DWORD State;
DWORD Protect;
DWORD Type;
} MEMORY_BASIC_INFORMATION, *PMEMORY_BASIC_INFORMATION;
```
and this:
```
VirtualQueryEx(
HANDLE hProcess,
LPCVOID lpAddress... |
71,810,767 | I have a 2D array that needs it's values to be changed based on user input.
```
private static double nursesArray[][] = {
{2020, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{2021, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{2022, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{2023, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{2024, 0, 0, 0, 0... | 2022/04/09 | [
"https://Stackoverflow.com/questions/71810767",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14121107/"
] | >
> Does casting to a char pointer to increment a pointer by a certain amount and then accessing as a different type violate strict aliasing?
>
>
>
Not inherently so.
>
> Normally, accessing an `int *` casted from a `char *` violates strict aliasing rules
>
>
>
Not necessarily. Strict aliasing is about the (... | Operations which displace a structure pointer by an amount which is not a multiple of the structure's size and then make use of the resulting pointer had unambiguously defined semantics in the language defined by the 1974 C Reference Manual. The language would be useless for many purposes if such operations could not b... |
8,571 | I am new at mining. My first experience is with monero with using xmr-stak on supportxmr pool. My problem is that when I mine with 4 cpu I get about 150 H/s. This is the default configs by the way, I mean when I compile the code, in the cpu file there is this:
```
"cpu_threads_conf" :
[
{ "low_power_mode" : false, "no... | 2018/06/15 | [
"https://monero.stackexchange.com/questions/8571",
"https://monero.stackexchange.com",
"https://monero.stackexchange.com/users/7814/"
] | Whilst your CPU may have the *ability* to run 8 threads, it may not have enough *cache* for mining with 8 threads. With Monero, you need 2MB CPU cache per thread. So for 8 threads you'd need a CPU cache of 16MB available.
If you run more threads than you have cache for, it will slow down the hashing. | You can log out of window manager,`ssh` or ALT + F7 into console and run `xmr-stak` from CLI ... Shave a few percent off your CPU load |
22,830,662 | How can I revert back to PHP from HHVM.
I know that moving from php to hhvm you only need to:
```
$ sudo /usr/bin/update-alternatives --install /usr/bin/php php /usr/bin/hhvm 60
```
How about if I wanted to revert back to php?
```
$ php -v
HipHop VM 3.0.0 (rel)
Compiler: tags/HHVM-3.0.0-0-g59a8db46e4ebf5cfd205fadc... | 2014/04/03 | [
"https://Stackoverflow.com/questions/22830662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3134069/"
] | According to the [manual](http://man7.org/linux/man-pages/man8/update-alternatives.8.html "manual")
```
sudo /usr/bin/update-alternatives --config php
```
Will ask you which version to use. | For a non-interactive command to set the original php binary as the default, here exemplified with PHP 5:
```
sudo /usr/bin/update-alternatives --install /usr/bin/php php /usr/bin/php5 61
```
Note the priority (61) is higher than the priority given to hhvm in your original command. |
22,830,662 | How can I revert back to PHP from HHVM.
I know that moving from php to hhvm you only need to:
```
$ sudo /usr/bin/update-alternatives --install /usr/bin/php php /usr/bin/hhvm 60
```
How about if I wanted to revert back to php?
```
$ php -v
HipHop VM 3.0.0 (rel)
Compiler: tags/HHVM-3.0.0-0-g59a8db46e4ebf5cfd205fadc... | 2014/04/03 | [
"https://Stackoverflow.com/questions/22830662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3134069/"
] | According to the [manual](http://man7.org/linux/man-pages/man8/update-alternatives.8.html "manual")
```
sudo /usr/bin/update-alternatives --config php
```
Will ask you which version to use. | simply run this command to revert to normal php
```
sudo /usr/share/hhvm/uninstall_fastcgi.sh
``` |
28,543,003 | I have a Java application that connects to a remote websocket server. As a client, I'm using the standard Java EE JSR356 [WebSocket API](http://docs.oracle.com/javaee/7/api/javax/websocket/WebSocketContainer.html "link"):
```
javax.websocket.WebSocketContainer.connectToServer(...)
```
However, I haven't found a way ... | 2015/02/16 | [
"https://Stackoverflow.com/questions/28543003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2198835/"
] | Unfortunately, this is not exposed by [JSR 356 - WebSocket API for Java](https://jcp.org/en/jsr/detail?id=356). You will need to use implementation feature, such as [HANDSHAKE\_TIMEOUT](https://tyrus.java.net/apidocs/1.10/org/glassfish/tyrus/client/ClientProperties.html#HANDSHAKE_TIMEOUT) in [Tyrus](https://tyrus.java.... | Just got this working myself. If you call connectToServer through a Future construct you can use the timeout in the get() method.
You'll need a ThreadPool:
```
private final ExecutorService pool = Executors.newFixedThreadPool(10);
```
Here's the function:
```
private Future<Session> asyncConnectToServer(Object ann... |
28,543,003 | I have a Java application that connects to a remote websocket server. As a client, I'm using the standard Java EE JSR356 [WebSocket API](http://docs.oracle.com/javaee/7/api/javax/websocket/WebSocketContainer.html "link"):
```
javax.websocket.WebSocketContainer.connectToServer(...)
```
However, I haven't found a way ... | 2015/02/16 | [
"https://Stackoverflow.com/questions/28543003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2198835/"
] | Unfortunately, this is not exposed by [JSR 356 - WebSocket API for Java](https://jcp.org/en/jsr/detail?id=356). You will need to use implementation feature, such as [HANDSHAKE\_TIMEOUT](https://tyrus.java.net/apidocs/1.10/org/glassfish/tyrus/client/ClientProperties.html#HANDSHAKE_TIMEOUT) in [Tyrus](https://tyrus.java.... | You can simply override the method connectToServer in WsWebSocketContainer
```
public class WsWebSocketContainer2 extends WsWebSocketContainer {
@Override
public Session connectToServer(Object pojo, URI path) throws DeploymentException {
ClientEndpoint annotation = pojo.getClass().getAnnotation(Clien... |
28,543,003 | I have a Java application that connects to a remote websocket server. As a client, I'm using the standard Java EE JSR356 [WebSocket API](http://docs.oracle.com/javaee/7/api/javax/websocket/WebSocketContainer.html "link"):
```
javax.websocket.WebSocketContainer.connectToServer(...)
```
However, I haven't found a way ... | 2015/02/16 | [
"https://Stackoverflow.com/questions/28543003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2198835/"
] | You can simply override the method connectToServer in WsWebSocketContainer
```
public class WsWebSocketContainer2 extends WsWebSocketContainer {
@Override
public Session connectToServer(Object pojo, URI path) throws DeploymentException {
ClientEndpoint annotation = pojo.getClass().getAnnotation(Clien... | Just got this working myself. If you call connectToServer through a Future construct you can use the timeout in the get() method.
You'll need a ThreadPool:
```
private final ExecutorService pool = Executors.newFixedThreadPool(10);
```
Here's the function:
```
private Future<Session> asyncConnectToServer(Object ann... |
58,228,061 | Can someone tell me please if is a good idea to use TFS as ticket manager for end users and in the same time as backlog for team developpers? | 2019/10/03 | [
"https://Stackoverflow.com/questions/58228061",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12161806/"
] | Not totally sure which kind of ticket manage system you are referring. For tickets, if you mean the ones raised by the end users of an organization whenever they encounter an event that interrupts their workflow.
Then seems you are looking for a helpdesk ticketing system, acts as a documentation of a particular proble... | If you want to use the TFS for the ticketing system. you need create task as a bug /Task in the child link for that particular backlog item or feature. Each task / Bug has to be tracked based on the sprint. |
42,816 | I've been trying to install AWN trunk in Natty Ubuntu Classic Desktop,but after add the PPA: `sudo add-apt-repository ppa:awn-testing/ppa`.
Update the sources: `sudo apt-get update`.
And install the files:
`sudo apt-get install avant-window-navigator-trunk avant-window-navigator-data-trunk python-awn-trunk awn-sett... | 2011/05/14 | [
"https://askubuntu.com/questions/42816",
"https://askubuntu.com",
"https://askubuntu.com/users/15731/"
] | try just
```
sudo apt-get install avant-window-navigator-trunk
```
that did the trick for me on natty just 5 secs ago. I think yours is just a typo problem :) | First, Install [**Ubuntu Tweak**](http://ubuntu-tweak.com/)
Then you can install the necessary software, cleaning your system and configuring the many settings of Ubuntu.
Screenshot for Avant Window Navigator (Lang : Turkish)
[http://i.stack.imgur.com/98axm.jpg](https://i.stack.imgur.com/98axm.jpg) |
266,444 | Today suddenly my admin dashboard chart is not visible.
Live and Test websites are on different server and suddenly today it's broken.
I have check in log file and found that
>
> [2019-03-19 05:51:17] main.CRITICAL: Unable to read response, or
> response is empty {"exception":"[object]
> (Zend\_Http\_Client\_Excep... | 2019/03/19 | [
"https://magento.stackexchange.com/questions/266444",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/46416/"
] | The google api called by magento2 is turned off on March 14, 2019 <https://developers.google.com/chart/image/docs/making_charts> | We're experiencing the same issue. It looks like the Google Charts API that powers the chart has recently been turned off, though Magento seem to be aware:
<https://github.com/magento/magento2/issues/21599>
It may be worth navigating to Configuration > Advanced and setting 'Enable Charts' to 'No'. This will at least p... |
34,707 | I'm trying to get this to display a the total results of a count just once. So if there are 120 results, have it output "120". Instead it shows each line 1,2,3,etc. and count == "1" displays nothing.
```
{if count == 0}
{exp:channel:entries channel="people" search:people_alpha="={segment_3}" orderby="people_lname" sor... | 2015/11/12 | [
"https://expressionengine.stackexchange.com/questions/34707",
"https://expressionengine.stackexchange.com",
"https://expressionengine.stackexchange.com/users/1654/"
] | The variable which returns the total amount of entries is [`{absolute_results}`](https://ellislab.com/expressionengine/user-guide/channel/channel_entries.html#absolute-results), not `{absolute_count}`.
```
{exp:channel:entries channel="people" search:people_alpha="={segment_3}"}
{if count == 1}
<h3>{absolute_r... | I can't tell because you didn't post enough code, but it looks like you have a `{exp:channel:entries}` loop inside of another loop, possible another channel loop. This isn't going to fly; the parse order of the templating engine won't render the output you want properly. You need to extract that inner loop and put it i... |
25,248,916 | I'm trying to have my program work by inputting an integer between 10-50 and if they didn't input within the acceptable range the loop will go back by making them input again. But I can't seem to understand why my program doesn't work. I know the logic behind but I think the codes is the problem. Here is my code
```
C... | 2014/08/11 | [
"https://Stackoverflow.com/questions/25248916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3806140/"
] | **The `if` condition is wrong, and the `while` condition is wronger!**
Try this instead:
```
Console.WriteLine("Enter a digit between 10 and 50 ");
do
{
xx = Console.ReadLine();
x = int.Parse(xx);
if (10 <= x && x <= 50)
break;
Console.WriteLine("Pleae input again: ");
}
while (true);
``` | You need to ask for the input each time or you wont come out of the loop.
```
do
{
xx = Console.ReadLine();
x = int.Parse(xx);
if (x > 10 && x < 50)
Console.WriteLine("Pleae input again: ");
}
while (x <= 10 && x >= 50);
Console.WriteLine("The number is in between!"... |
25,248,916 | I'm trying to have my program work by inputting an integer between 10-50 and if they didn't input within the acceptable range the loop will go back by making them input again. But I can't seem to understand why my program doesn't work. I know the logic behind but I think the codes is the problem. Here is my code
```
C... | 2014/08/11 | [
"https://Stackoverflow.com/questions/25248916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3806140/"
] | **The `if` condition is wrong, and the `while` condition is wronger!**
Try this instead:
```
Console.WriteLine("Enter a digit between 10 and 50 ");
do
{
xx = Console.ReadLine();
x = int.Parse(xx);
if (10 <= x && x <= 50)
break;
Console.WriteLine("Pleae input again: ");
}
while (true);
``` | How about this:
```
string xx;
int x;
Console.WriteLine("Enter a digit between 10 and 50 ");
bool cont = true;
do
{
xx = Console.ReadLine();
if (int.TryParse(xx, out x) && 10 <= x && x <= 50)
cont = false;
else
Console.WriteLine("Pleae input agai... |
25,248,916 | I'm trying to have my program work by inputting an integer between 10-50 and if they didn't input within the acceptable range the loop will go back by making them input again. But I can't seem to understand why my program doesn't work. I know the logic behind but I think the codes is the problem. Here is my code
```
C... | 2014/08/11 | [
"https://Stackoverflow.com/questions/25248916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3806140/"
] | **The `if` condition is wrong, and the `while` condition is wronger!**
Try this instead:
```
Console.WriteLine("Enter a digit between 10 and 50 ");
do
{
xx = Console.ReadLine();
x = int.Parse(xx);
if (10 <= x && x <= 50)
break;
Console.WriteLine("Pleae input again: ");
}
while (true);
``` | Check your IF and WHILE conditions.. Try this:
```
Console.WriteLine("Enter a digit between 10 and 50 ");
do
{
xx = Console.ReadLine();
x = int.Parse(xx);
if (x <= 10 || x >= 50)
Console.WriteLine("Pleae input again: ");
}
while (x <= 10 || x >= 50);
Console.WriteLine("The number is in between!");... |
25,248,916 | I'm trying to have my program work by inputting an integer between 10-50 and if they didn't input within the acceptable range the loop will go back by making them input again. But I can't seem to understand why my program doesn't work. I know the logic behind but I think the codes is the problem. Here is my code
```
C... | 2014/08/11 | [
"https://Stackoverflow.com/questions/25248916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3806140/"
] | How about this:
```
string xx;
int x;
Console.WriteLine("Enter a digit between 10 and 50 ");
bool cont = true;
do
{
xx = Console.ReadLine();
if (int.TryParse(xx, out x) && 10 <= x && x <= 50)
cont = false;
else
Console.WriteLine("Pleae input agai... | You need to ask for the input each time or you wont come out of the loop.
```
do
{
xx = Console.ReadLine();
x = int.Parse(xx);
if (x > 10 && x < 50)
Console.WriteLine("Pleae input again: ");
}
while (x <= 10 && x >= 50);
Console.WriteLine("The number is in between!"... |
25,248,916 | I'm trying to have my program work by inputting an integer between 10-50 and if they didn't input within the acceptable range the loop will go back by making them input again. But I can't seem to understand why my program doesn't work. I know the logic behind but I think the codes is the problem. Here is my code
```
C... | 2014/08/11 | [
"https://Stackoverflow.com/questions/25248916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3806140/"
] | Check your IF and WHILE conditions.. Try this:
```
Console.WriteLine("Enter a digit between 10 and 50 ");
do
{
xx = Console.ReadLine();
x = int.Parse(xx);
if (x <= 10 || x >= 50)
Console.WriteLine("Pleae input again: ");
}
while (x <= 10 || x >= 50);
Console.WriteLine("The number is in between!");... | You need to ask for the input each time or you wont come out of the loop.
```
do
{
xx = Console.ReadLine();
x = int.Parse(xx);
if (x > 10 && x < 50)
Console.WriteLine("Pleae input again: ");
}
while (x <= 10 && x >= 50);
Console.WriteLine("The number is in between!"... |
25,248,916 | I'm trying to have my program work by inputting an integer between 10-50 and if they didn't input within the acceptable range the loop will go back by making them input again. But I can't seem to understand why my program doesn't work. I know the logic behind but I think the codes is the problem. Here is my code
```
C... | 2014/08/11 | [
"https://Stackoverflow.com/questions/25248916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3806140/"
] | How about this:
```
string xx;
int x;
Console.WriteLine("Enter a digit between 10 and 50 ");
bool cont = true;
do
{
xx = Console.ReadLine();
if (int.TryParse(xx, out x) && 10 <= x && x <= 50)
cont = false;
else
Console.WriteLine("Pleae input agai... | Check your IF and WHILE conditions.. Try this:
```
Console.WriteLine("Enter a digit between 10 and 50 ");
do
{
xx = Console.ReadLine();
x = int.Parse(xx);
if (x <= 10 || x >= 50)
Console.WriteLine("Pleae input again: ");
}
while (x <= 10 || x >= 50);
Console.WriteLine("The number is in between!");... |
7,255 | Do we have any statistics that show where users find questions to view (index page, RSS, subscriptions, searching, et cetera). Bonus points if there are statistics that show how users arrive at questions that they answer and/or act on in some manner (voting, flagging, commenting, adding to favorites).
The reason I'm a... | 2013/05/28 | [
"https://gaming.meta.stackexchange.com/questions/7255",
"https://gaming.meta.stackexchange.com",
"https://gaming.meta.stackexchange.com/users/19827/"
] | Our [Lazers](http://chat.stackexchange.com/users/-23/grumpy-lazers) feed bot is meant to be a way to present questions to chat regulars (who are definitely potential answerers). Of course, a sudden flood in questions also becomes a flood in posts advertised by Lazers, making the bot [a nuisance rather than an asset.](h... | ### For now, we don't know.
In order to answer this question, we'd need access to the site analytics for hits (including different homepage views like "active"), and currently we only have that for questions. |
7,255 | Do we have any statistics that show where users find questions to view (index page, RSS, subscriptions, searching, et cetera). Bonus points if there are statistics that show how users arrive at questions that they answer and/or act on in some manner (voting, flagging, commenting, adding to favorites).
The reason I'm a... | 2013/05/28 | [
"https://gaming.meta.stackexchange.com/questions/7255",
"https://gaming.meta.stackexchange.com",
"https://gaming.meta.stackexchange.com/users/19827/"
] | As [commented by jmfsg](https://gaming.meta.stackexchange.com/questions/7255/how-do-people-find-questions#comment20040_7255), the bulk of visitors arrive from search engines and other sites. There are, however, no publicly visible statistics that show what actions these users take. It's fair to state from my own observ... | ### For now, we don't know.
In order to answer this question, we'd need access to the site analytics for hits (including different homepage views like "active"), and currently we only have that for questions. |
68,838,096 | I have a class like this:
```
# in bar.py
class Bar:
...
@staticmethod
def foo():
...
```
Is there a way to import `Bar.foo` in another python file, but rename it to be called as just `foo`? I have tried `import bar`, `from bar import Bar` but none of those work. | 2021/08/18 | [
"https://Stackoverflow.com/questions/68838096",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1260682/"
] | You could just do
```
from bar import Bar
foo = Bar.foo
``` | >
> from bar.Bar import foo as bar\_Bar\_foo
>
>
>
especially useful when you need both `requests` the module and `Flask.requests` in the same file, so to avoid a collision:
```
from Flask import requests as f_requests
import requests
``` |
38,292 | How can one draw "just the arrow tip" from one of the arrows in the arrow tip library in TikZ?
The problem is that if you try a brute-force solution, eg.
```
\tikz \draw[-triangle 90] (0,0) -- +(.1,0);
```
you run into trouble because this produces a small line, the (0,0) to (.1, 0) part, which cannot be removed (a... | 2011/12/14 | [
"https://tex.stackexchange.com/questions/38292",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/5550/"
] | ```
\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\fbox{ \begin{tikzpicture}
\node[inner sep=0pt] {\tikz\draw[-triangle 90](0,0) ;};
\end{tikzpicture}}
\fbox{ \begin{tikzpicture}
\node[rotate=90,inner sep=0pt] {\tikz\draw[-triangle 90](0,0) ;};
\end{tikzpicture} }
\fbox{ \... | You can use the markings decoration library like so:
```
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{arrows}
\begin{document}
\tikz\path[decoration={markings,mark=at position 1 with \arrow{triangle 90}}, decorate] (0,0);
\end{document}
```
That won't draw the line,... |
59,553,712 | I want to define a new custom exception class in a package. What should the modifier be?
Should it be public (in case another class outside the package throws it) or should it be package-protected? What is the right practice?
Thanks. | 2020/01/01 | [
"https://Stackoverflow.com/questions/59553712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11911264/"
] | It depends on how are you going to use it.
Some people create separate packages only for their custom exception classes and in that case those exceptions must be declared as `public`.
Also if you are going to use your exception in `throws` clause for `public` method in a `public` class you also need to make exception ... | If you want to throw and catch it only in your package, you could make it package-protected. But I would advise to make it public, so everybody can catch your specific exception. |
59,553,712 | I want to define a new custom exception class in a package. What should the modifier be?
Should it be public (in case another class outside the package throws it) or should it be package-protected? What is the right practice?
Thanks. | 2020/01/01 | [
"https://Stackoverflow.com/questions/59553712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11911264/"
] | It depends on how are you going to use it.
Some people create separate packages only for their custom exception classes and in that case those exceptions must be declared as `public`.
Also if you are going to use your exception in `throws` clause for `public` method in a `public` class you also need to make exception ... | Another way is make Exception class public, so can be catched by other packages, and to allow throws Exception by owner package you sets constructors in package level. |
44,959,892 | position:fixed doesn't work on mobile safari browser. I've tried two devices, iPhone7 and 5s with latest Safari versions. I'm losing my mind. No internet trick I've already found could help me. I found one site where my iPhone actually showed me fixed navigation bar. But when I copied that site's source code into my co... | 2017/07/06 | [
"https://Stackoverflow.com/questions/44959892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7788435/"
] | Try adding the following CSS
```
nav{
-ms-transform: translate3d(0,0,0);
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}
```
If that doesn't work, try this instead
```
nav{
-ms-transform: translateZ(0);
-webkit-transform: translateZ(0);
transform: translateZ(0);
}
```
Please le... | The problem with `position:fixed` happened because my code was run in Codepen. Everything works fine |
38,883,134 | I am making a text based simple operation/trig calculator. I am getting the error: "Expression must be a modifiable lvalue" when I attempt to sqrt the squared variables. Here is my current code: (the error highlights the sqrt)
```
double a, b, result;
cout << "Please enter your two side lengths (ex:12 5)";
cin >> a, ... | 2016/08/10 | [
"https://Stackoverflow.com/questions/38883134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5635293/"
] | You've switched around your assignment. You're trying to assign the sqrt function the value of result; you want to assign the result to the value of the sqrt output:
```
double a, b, result;
cout << "Please enter your two side lengths (ex:12 5)";
cin >> a, b;
result = sqrt(pow(a, 2) + pow(b, 2));
cout << result << e... | The main problem is the line number `4` and `5` of your piece of code.
`cin >> a,b;` is wrong. You can take multiple input in a line like this `cin >> a >> b;`
And in the line number 5 you are doing assignment in wrong order. You should just reverse it `result` this way `result = sqrt(pow(a, 2) + pow(b, 2)) ;` |
38,883,134 | I am making a text based simple operation/trig calculator. I am getting the error: "Expression must be a modifiable lvalue" when I attempt to sqrt the squared variables. Here is my current code: (the error highlights the sqrt)
```
double a, b, result;
cout << "Please enter your two side lengths (ex:12 5)";
cin >> a, ... | 2016/08/10 | [
"https://Stackoverflow.com/questions/38883134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5635293/"
] | Modify your `cin` statement to `cin >> a >> b;`, this reads multiple values at once, since the comma operator doesn't exist for `cin`. Also, switch the order of the result variable on the right side of the assignment to left side. The two operands to the `=` on the assignment are l-values, standing for left-values, sup... | The main problem is the line number `4` and `5` of your piece of code.
`cin >> a,b;` is wrong. You can take multiple input in a line like this `cin >> a >> b;`
And in the line number 5 you are doing assignment in wrong order. You should just reverse it `result` this way `result = sqrt(pow(a, 2) + pow(b, 2)) ;` |
38,883,134 | I am making a text based simple operation/trig calculator. I am getting the error: "Expression must be a modifiable lvalue" when I attempt to sqrt the squared variables. Here is my current code: (the error highlights the sqrt)
```
double a, b, result;
cout << "Please enter your two side lengths (ex:12 5)";
cin >> a, ... | 2016/08/10 | [
"https://Stackoverflow.com/questions/38883134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5635293/"
] | First, `cin >> a, b` [does not do what you think it's doing](https://stackoverflow.com/q/7425318/4354477). You'd better write `cin >> a >> b`.
Then, you assign *data* to variables, not *variables* to data. So do `result = sqrt(...)`. | The main problem is the line number `4` and `5` of your piece of code.
`cin >> a,b;` is wrong. You can take multiple input in a line like this `cin >> a >> b;`
And in the line number 5 you are doing assignment in wrong order. You should just reverse it `result` this way `result = sqrt(pow(a, 2) + pow(b, 2)) ;` |
31,892,630 | I get a Failure object Object notice. I have looked at multiple examples and still can't figure out the error. I believe my AJAX is not set up properly. The PHP should be good to go, I have a local database and use jQuery with AJAX to handle the request and the response. The page should redirect to the dashboard.php wh... | 2015/08/08 | [
"https://Stackoverflow.com/questions/31892630",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5205045/"
] | server.js is intended to be run as a node server for websocket signaling. Run it with `node server.js`. You shouldn't need Tomcat at all.
From the project readme:
>
> The signaling server uses Node.js and ws and can be started as such:
>
>
>
```
$ npm install ws
$ node server/server.js
```
>
> With the clien... | This is the ultimate simple code can do the job. No need to install Node.js. Why need to install `Node.js`?
AND put that code into `index.html` file and start your webhost, then you done!
```
<!DOCTYPE html>
<html>
<head>
<script src="//simplewebrtc.com/latest.js"></script>
</head>
<body>
<div id="localVideo" ... |
31,892,630 | I get a Failure object Object notice. I have looked at multiple examples and still can't figure out the error. I believe my AJAX is not set up properly. The PHP should be good to go, I have a local database and use jQuery with AJAX to handle the request and the response. The page should redirect to the dashboard.php wh... | 2015/08/08 | [
"https://Stackoverflow.com/questions/31892630",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5205045/"
] | server.js is intended to be run as a node server for websocket signaling. Run it with `node server.js`. You shouldn't need Tomcat at all.
From the project readme:
>
> The signaling server uses Node.js and ws and can be started as such:
>
>
>
```
$ npm install ws
$ node server/server.js
```
>
> With the clien... | I changed HTTPS\_PORT = 8443 to HTTP\_PORT = 8443. Do same with all the https; change it to http. Next, have only const serverConfig = { }; as the serverConfig and delete serverConfig in const httpServer = http.createServer(handleRequest); After these changes, u can now run your server with npm start. |
31,892,630 | I get a Failure object Object notice. I have looked at multiple examples and still can't figure out the error. I believe my AJAX is not set up properly. The PHP should be good to go, I have a local database and use jQuery with AJAX to handle the request and the response. The page should redirect to the dashboard.php wh... | 2015/08/08 | [
"https://Stackoverflow.com/questions/31892630",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5205045/"
] | I changed HTTPS\_PORT = 8443 to HTTP\_PORT = 8443. Do same with all the https; change it to http. Next, have only const serverConfig = { }; as the serverConfig and delete serverConfig in const httpServer = http.createServer(handleRequest); After these changes, u can now run your server with npm start. | This is the ultimate simple code can do the job. No need to install Node.js. Why need to install `Node.js`?
AND put that code into `index.html` file and start your webhost, then you done!
```
<!DOCTYPE html>
<html>
<head>
<script src="//simplewebrtc.com/latest.js"></script>
</head>
<body>
<div id="localVideo" ... |
74,061,331 | I do simulation research and create different datasets for different CFA models. During a series of simulations, I would like to handle errors resulting from e.g. randomization. Specifically - I would like to be able to repeat the sampling procedure in the case of lavaan::cfa errors, but in the case of just warnings, I... | 2022/10/13 | [
"https://Stackoverflow.com/questions/74061331",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7751099/"
] | You can amend your pipe to order it by the mean variable you created and set the ordered factor levels based on that:
```r
library(dplyr)
test_data <- mtcars |>
mutate(
mpg_cat = case_when(
mpg > 20 ~ "More than 20",
mpg <= 20 & mpg >= 15 ~ "15-20",
mpg < 15 ~ "Less tha... | Just `ungroup` after `mutate` and then use `fct_reorder`. Using your code:
```
test_data <- mtcars %>%
mutate(mpg_cat=case_when(mpg>20 ~ "More than 20",
mpg<=20 & mpg>=15 ~ "15-20",
mpg<15 ~ "Less than 15")) %>%
group_by(mpg_cat) %>%
mutate(avg_mpg=mean(mp... |
74,061,331 | I do simulation research and create different datasets for different CFA models. During a series of simulations, I would like to handle errors resulting from e.g. randomization. Specifically - I would like to be able to repeat the sampling procedure in the case of lavaan::cfa errors, but in the case of just warnings, I... | 2022/10/13 | [
"https://Stackoverflow.com/questions/74061331",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7751099/"
] | There is a `.fun` argument in `fct_recode` which by default is `median`. So, we can directly modify the levels without grouping
```
library(dplyr)
library(forcats)
out <- mtcars %>%
mutate(mpg_cat=fct_reorder(case_when(mpg>20 ~ "More than 20",
mpg<=20 & mpg>=15 ~ "15-20",
... | Just `ungroup` after `mutate` and then use `fct_reorder`. Using your code:
```
test_data <- mtcars %>%
mutate(mpg_cat=case_when(mpg>20 ~ "More than 20",
mpg<=20 & mpg>=15 ~ "15-20",
mpg<15 ~ "Less than 15")) %>%
group_by(mpg_cat) %>%
mutate(avg_mpg=mean(mp... |
1,322,414 | I frequently code numerous experiments to test various algorithms, libraries, or hardware. All code, dependencies, and output of these experiments need to be annotated and saved, so that I can return to them later. Are there good common approaches to this problem? What do you do with your experiments after running them... | 2009/08/24 | [
"https://Stackoverflow.com/questions/1322414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49329/"
] | When I do these, they are usually project specific, so they go in a subdirectory of the project (usually named "Investigations" in my case). This gets checked into the version control system with everything else.
Results (where appropriate) go into the same subdirectory of "Investigations" as the code used to produce ... | <http://subversion.tigris.org/> |
1,322,414 | I frequently code numerous experiments to test various algorithms, libraries, or hardware. All code, dependencies, and output of these experiments need to be annotated and saved, so that I can return to them later. Are there good common approaches to this problem? What do you do with your experiments after running them... | 2009/08/24 | [
"https://Stackoverflow.com/questions/1322414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49329/"
] | At a prior job we had a project in SVN called Area51 where people would write test code. The rules were
1. create a package namespace
2. start via a public static void main
3. add comments via javadocs
4. leave the project in a compilable state
5. the project can never be a dependancy of other code
On a three person ... | <http://subversion.tigris.org/> |
1,322,414 | I frequently code numerous experiments to test various algorithms, libraries, or hardware. All code, dependencies, and output of these experiments need to be annotated and saved, so that I can return to them later. Are there good common approaches to this problem? What do you do with your experiments after running them... | 2009/08/24 | [
"https://Stackoverflow.com/questions/1322414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49329/"
] | When I do these, they are usually project specific, so they go in a subdirectory of the project (usually named "Investigations" in my case). This gets checked into the version control system with everything else.
Results (where appropriate) go into the same subdirectory of "Investigations" as the code used to produce ... | I just have a folder which I call OneOffCode
This is a folder of just code I have written either learning a new technology trying to prove a concept etc. . . This is non production code.
I usually back it up to a jump drive and move it with me from Job to job, or computer to computer. |
1,322,414 | I frequently code numerous experiments to test various algorithms, libraries, or hardware. All code, dependencies, and output of these experiments need to be annotated and saved, so that I can return to them later. Are there good common approaches to this problem? What do you do with your experiments after running them... | 2009/08/24 | [
"https://Stackoverflow.com/questions/1322414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49329/"
] | At a prior job we had a project in SVN called Area51 where people would write test code. The rules were
1. create a package namespace
2. start via a public static void main
3. add comments via javadocs
4. leave the project in a compilable state
5. the project can never be a dependancy of other code
On a three person ... | I just have a folder which I call OneOffCode
This is a folder of just code I have written either learning a new technology trying to prove a concept etc. . . This is non production code.
I usually back it up to a jump drive and move it with me from Job to job, or computer to computer. |
1,322,414 | I frequently code numerous experiments to test various algorithms, libraries, or hardware. All code, dependencies, and output of these experiments need to be annotated and saved, so that I can return to them later. Are there good common approaches to this problem? What do you do with your experiments after running them... | 2009/08/24 | [
"https://Stackoverflow.com/questions/1322414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49329/"
] | When I do these, they are usually project specific, so they go in a subdirectory of the project (usually named "Investigations" in my case). This gets checked into the version control system with everything else.
Results (where appropriate) go into the same subdirectory of "Investigations" as the code used to produce ... | I'm usually switching between C# and C++. So, I have a Test console application for C# and C++ in a "Sandbox" location, under source control. The console applications are both setup the same way where there is a Main which calls the test that I'm trying at that time. When I'm done I keep the old methods and comments an... |
1,322,414 | I frequently code numerous experiments to test various algorithms, libraries, or hardware. All code, dependencies, and output of these experiments need to be annotated and saved, so that I can return to them later. Are there good common approaches to this problem? What do you do with your experiments after running them... | 2009/08/24 | [
"https://Stackoverflow.com/questions/1322414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49329/"
] | At a prior job we had a project in SVN called Area51 where people would write test code. The rules were
1. create a package namespace
2. start via a public static void main
3. add comments via javadocs
4. leave the project in a compilable state
5. the project can never be a dependancy of other code
On a three person ... | When I do these, they are usually project specific, so they go in a subdirectory of the project (usually named "Investigations" in my case). This gets checked into the version control system with everything else.
Results (where appropriate) go into the same subdirectory of "Investigations" as the code used to produce ... |
1,322,414 | I frequently code numerous experiments to test various algorithms, libraries, or hardware. All code, dependencies, and output of these experiments need to be annotated and saved, so that I can return to them later. Are there good common approaches to this problem? What do you do with your experiments after running them... | 2009/08/24 | [
"https://Stackoverflow.com/questions/1322414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49329/"
] | At a prior job we had a project in SVN called Area51 where people would write test code. The rules were
1. create a package namespace
2. start via a public static void main
3. add comments via javadocs
4. leave the project in a compilable state
5. the project can never be a dependancy of other code
On a three person ... | I'm usually switching between C# and C++. So, I have a Test console application for C# and C++ in a "Sandbox" location, under source control. The console applications are both setup the same way where there is a Main which calls the test that I'm trying at that time. When I'm done I keep the old methods and comments an... |
7,312,597 | Say I want to implement a software that uses hardware performance counters such as those for counting retired stores. Note that alternative solutions without the performance counters are possible but might be relatively a little inefficient. However, I can sacrifice performance a bit for portability and power efficienc... | 2011/09/05 | [
"https://Stackoverflow.com/questions/7312597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/760807/"
] | When I understand you right, then you want your `Double[]` as `List<Double>`.
```
Double[] weightArray = {200d, 215d, 220d, 215d, 200d};
List<Double> values = Arrays.asList(weightArray);
``` | What I think you are trying to do is this:
```
private double[] weightArray =new double[] {200,215,220,215,200};
List<double> values = new ArrayList<double>();
for (int i = 0; i < weightArray.length; i++) { // i indexes each element successively.
values.add(weightArray[i]);
}
``` |
7,312,597 | Say I want to implement a software that uses hardware performance counters such as those for counting retired stores. Note that alternative solutions without the performance counters are possible but might be relatively a little inefficient. However, I can sacrifice performance a bit for portability and power efficienc... | 2011/09/05 | [
"https://Stackoverflow.com/questions/7312597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/760807/"
] | My solution :
```
Double[] weightArray = {200d, 215d, 220d, 215d, 200d};
List<Double> values = new ArrayList<Double>();
for(Double d : weightArray) values.add(d);
```
Best, | What I think you are trying to do is this:
```
private double[] weightArray =new double[] {200,215,220,215,200};
List<double> values = new ArrayList<double>();
for (int i = 0; i < weightArray.length; i++) { // i indexes each element successively.
values.add(weightArray[i]);
}
``` |
68,824 | I have a Sharepoint 2010 installation and I have troubles getting this works: I have a list with some columns:
* Place
* Assigned to
* Date and time
* Comments
I want Sharepoint sends an email when a new list item is created. The email must be send to "Assigned to" person, who can be any on the Active Directory.
Aft... | 2013/05/22 | [
"https://sharepoint.stackexchange.com/questions/68824",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/-1/"
] | you have to create sharepoint workflow (using sharepoint designer) which starts when item is created in this list , this workflow will send an e-mail to the "Assigned to" user
check this link to find more info. about sending email in a workflow
<http://office.microsoft.com/en-001/sharepoint-designer-help/send-e-mai... | Maybe I'm thinking too much like a dev and not enough like someone looking for the simplest solution available, but it seems to me that you want to create an event receiver that operates on the list when the ItemAdded trigger is pulled. Here is a guide on how to set up an event receiver for a specific list instance:
<... |
68,824 | I have a Sharepoint 2010 installation and I have troubles getting this works: I have a list with some columns:
* Place
* Assigned to
* Date and time
* Comments
I want Sharepoint sends an email when a new list item is created. The email must be send to "Assigned to" person, who can be any on the Active Directory.
Aft... | 2013/05/22 | [
"https://sharepoint.stackexchange.com/questions/68824",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/-1/"
] | you have to create sharepoint workflow (using sharepoint designer) which starts when item is created in this list , this workflow will send an e-mail to the "Assigned to" user
check this link to find more info. about sending email in a workflow
<http://office.microsoft.com/en-001/sharepoint-designer-help/send-e-mai... | Creating via workflow and event receiver are both the possible options .
Creating a workflow with Sharepoint Designer might be the quickest and easiest way as it can provide u with email UI template to fill in easily.
If u need a little more customization apart from just sending the mail then you can go for event re... |
68,824 | I have a Sharepoint 2010 installation and I have troubles getting this works: I have a list with some columns:
* Place
* Assigned to
* Date and time
* Comments
I want Sharepoint sends an email when a new list item is created. The email must be send to "Assigned to" person, who can be any on the Active Directory.
Aft... | 2013/05/22 | [
"https://sharepoint.stackexchange.com/questions/68824",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/-1/"
] | you have to create sharepoint workflow (using sharepoint designer) which starts when item is created in this list , this workflow will send an e-mail to the "Assigned to" user
check this link to find more info. about sending email in a workflow
<http://office.microsoft.com/en-001/sharepoint-designer-help/send-e-mai... | Thanks JohnWCraven, that sound great!
I have followed your link, creating a breakpoint in the *base.ItemAdding()* line, and the breakpoint is hit when I add a new element to the list.
However when I add a few more lines of code, either above or below of *base.ItemAdding()*, **no** breakpoint hit, my code isn't execu... |
68,824 | I have a Sharepoint 2010 installation and I have troubles getting this works: I have a list with some columns:
* Place
* Assigned to
* Date and time
* Comments
I want Sharepoint sends an email when a new list item is created. The email must be send to "Assigned to" person, who can be any on the Active Directory.
Aft... | 2013/05/22 | [
"https://sharepoint.stackexchange.com/questions/68824",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/-1/"
] | you have to create sharepoint workflow (using sharepoint designer) which starts when item is created in this list , this workflow will send an e-mail to the "Assigned to" user
check this link to find more info. about sending email in a workflow
<http://office.microsoft.com/en-001/sharepoint-designer-help/send-e-mai... | Sharepoint designer workflow is simplest solution. It will not create any task. On creation of a list item, mail will be triggered to assigned to person and workflow ends. You have to use only "Send an Email" action for this.
You can use event handler or receiver too for that , but it will be itemAdded() event.
I will ... |
68,824 | I have a Sharepoint 2010 installation and I have troubles getting this works: I have a list with some columns:
* Place
* Assigned to
* Date and time
* Comments
I want Sharepoint sends an email when a new list item is created. The email must be send to "Assigned to" person, who can be any on the Active Directory.
Aft... | 2013/05/22 | [
"https://sharepoint.stackexchange.com/questions/68824",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/-1/"
] | Maybe I'm thinking too much like a dev and not enough like someone looking for the simplest solution available, but it seems to me that you want to create an event receiver that operates on the list when the ItemAdded trigger is pulled. Here is a guide on how to set up an event receiver for a specific list instance:
<... | Creating via workflow and event receiver are both the possible options .
Creating a workflow with Sharepoint Designer might be the quickest and easiest way as it can provide u with email UI template to fill in easily.
If u need a little more customization apart from just sending the mail then you can go for event re... |
68,824 | I have a Sharepoint 2010 installation and I have troubles getting this works: I have a list with some columns:
* Place
* Assigned to
* Date and time
* Comments
I want Sharepoint sends an email when a new list item is created. The email must be send to "Assigned to" person, who can be any on the Active Directory.
Aft... | 2013/05/22 | [
"https://sharepoint.stackexchange.com/questions/68824",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/-1/"
] | Maybe I'm thinking too much like a dev and not enough like someone looking for the simplest solution available, but it seems to me that you want to create an event receiver that operates on the list when the ItemAdded trigger is pulled. Here is a guide on how to set up an event receiver for a specific list instance:
<... | Thanks JohnWCraven, that sound great!
I have followed your link, creating a breakpoint in the *base.ItemAdding()* line, and the breakpoint is hit when I add a new element to the list.
However when I add a few more lines of code, either above or below of *base.ItemAdding()*, **no** breakpoint hit, my code isn't execu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.