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
458,721
I find long sequences of standard includes annoying: ``` #include <vector> #include <string> #include <sstream> #include <iostream> ``` Considering these header files change only very rarely, is there a reason why I should not make a "std.h" file #including all std headers and just use that everywhere?
2009/01/19
[ "https://Stackoverflow.com/questions/458721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Including unnecessary header files will increase compile times.
I hate to create a new answer for this, but I basically want to put both Brian Ensink and ChrisW's answer together: First off, as Brian mentioned, your compile times will skyrocket as it's including tonnes of files every time it compiles. Luckily it looks like it's standard includes, so they shouldn't be changing all ...
458,721
I find long sequences of standard includes annoying: ``` #include <vector> #include <string> #include <sstream> #include <iostream> ``` Considering these header files change only very rarely, is there a reason why I should not make a "std.h" file #including all std headers and just use that everywhere?
2009/01/19
[ "https://Stackoverflow.com/questions/458721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
If you're not actually using it, it should not be included.
This would also increase the size of your object files, which probably isn't a big deal these days. *Edited per comments that the binary would not actually be larger*
458,721
I find long sequences of standard includes annoying: ``` #include <vector> #include <string> #include <sstream> #include <iostream> ``` Considering these header files change only very rarely, is there a reason why I should not make a "std.h" file #including all std headers and just use that everywhere?
2009/01/19
[ "https://Stackoverflow.com/questions/458721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I hate to create a new answer for this, but I basically want to put both Brian Ensink and ChrisW's answer together: First off, as Brian mentioned, your compile times will skyrocket as it's including tonnes of files every time it compiles. Luckily it looks like it's standard includes, so they shouldn't be changing all ...
If you're not actually using it, it should not be included.
458,721
I find long sequences of standard includes annoying: ``` #include <vector> #include <string> #include <sstream> #include <iostream> ``` Considering these header files change only very rarely, is there a reason why I should not make a "std.h" file #including all std headers and just use that everywhere?
2009/01/19
[ "https://Stackoverflow.com/questions/458721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Including unnecessary header files will increase compile times.
You might like to add these to your project's standard, precompiled header file: if your project has a standard, precompiled header file, and if your files aren't supposed to be reusuable in other projects which might have a different standard header file.
458,721
I find long sequences of standard includes annoying: ``` #include <vector> #include <string> #include <sstream> #include <iostream> ``` Considering these header files change only very rarely, is there a reason why I should not make a "std.h" file #including all std headers and just use that everywhere?
2009/01/19
[ "https://Stackoverflow.com/questions/458721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You might like to add these to your project's standard, precompiled header file: if your project has a standard, precompiled header file, and if your files aren't supposed to be reusuable in other projects which might have a different standard header file.
It reduces your code readability (oddly enough :)). By including them all in one header file, you can no longer tell just by looking at the top of a file what translation units are including iostreams (and therefore doing IO), fstream (and doing file access) etc. I'd suggest using an IDE that allows folding of include...
458,721
I find long sequences of standard includes annoying: ``` #include <vector> #include <string> #include <sstream> #include <iostream> ``` Considering these header files change only very rarely, is there a reason why I should not make a "std.h" file #including all std headers and just use that everywhere?
2009/01/19
[ "https://Stackoverflow.com/questions/458721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You might like to add these to your project's standard, precompiled header file: if your project has a standard, precompiled header file, and if your files aren't supposed to be reusuable in other projects which might have a different standard header file.
If you're not actually using it, it should not be included.
6,523
When I create a grid in Gimp (a 32x32px grid with 0x0px offset), the distance between the top edge of the image, and the first grid line, is 31 pixels, almost like the grid starts one pixel above the canvas. The same goes for the left edge. However, after enabling Snap to Grid, pasted images (with sizes that are multi...
2012/03/14
[ "https://graphicdesign.stackexchange.com/questions/6523", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/4014/" ]
Gimp starts to count the pixel from 0, not 1, so 32px are from 0 to 31, 32 to 63, etc...[Coordinate Example](https://i.stack.imgur.com/OhHc5.jpg "Coordinate Example") About the grid snap, it works well for me so i'm not able to reproduce it, I have the same version on Windows 7 x64.
I had this issue. Removing/renaming the .gimp-2.8 folder in my home directory fixed it.
6,523
When I create a grid in Gimp (a 32x32px grid with 0x0px offset), the distance between the top edge of the image, and the first grid line, is 31 pixels, almost like the grid starts one pixel above the canvas. The same goes for the left edge. However, after enabling Snap to Grid, pasted images (with sizes that are multi...
2012/03/14
[ "https://graphicdesign.stackexchange.com/questions/6523", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/4014/" ]
Gimp starts to count the pixel from 0, not 1, so 32px are from 0 to 31, 32 to 63, etc...[Coordinate Example](https://i.stack.imgur.com/OhHc5.jpg "Coordinate Example") About the grid snap, it works well for me so i'm not able to reproduce it, I have the same version on Windows 7 x64.
This bug appears to be active in 2.8.10. The problem seems to be an off-by-one error in the first row, and column of each grid. The solution seems to be to offset your grid by a negative amount one less than your grid-size. So, for a grid of 32x32, offset by -31x and -31y. This pushes the broken row and column out of...
6,523
When I create a grid in Gimp (a 32x32px grid with 0x0px offset), the distance between the top edge of the image, and the first grid line, is 31 pixels, almost like the grid starts one pixel above the canvas. The same goes for the left edge. However, after enabling Snap to Grid, pasted images (with sizes that are multi...
2012/03/14
[ "https://graphicdesign.stackexchange.com/questions/6523", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/4014/" ]
Gimp starts to count the pixel from 0, not 1, so 32px are from 0 to 31, 32 to 63, etc...[Coordinate Example](https://i.stack.imgur.com/OhHc5.jpg "Coordinate Example") About the grid snap, it works well for me so i'm not able to reproduce it, I have the same version on Windows 7 x64.
I'm pretty sure this was the following bug: <https://bugzilla.gnome.org/show_bug.cgi?id=588512> Fixed recently - to be precise, Wed May 21 20:43:05 2014 +0200. The fix is available in releases 2.8.12 and newer.
6,523
When I create a grid in Gimp (a 32x32px grid with 0x0px offset), the distance between the top edge of the image, and the first grid line, is 31 pixels, almost like the grid starts one pixel above the canvas. The same goes for the left edge. However, after enabling Snap to Grid, pasted images (with sizes that are multi...
2012/03/14
[ "https://graphicdesign.stackexchange.com/questions/6523", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/4014/" ]
I had this issue. Removing/renaming the .gimp-2.8 folder in my home directory fixed it.
This bug appears to be active in 2.8.10. The problem seems to be an off-by-one error in the first row, and column of each grid. The solution seems to be to offset your grid by a negative amount one less than your grid-size. So, for a grid of 32x32, offset by -31x and -31y. This pushes the broken row and column out of...
6,523
When I create a grid in Gimp (a 32x32px grid with 0x0px offset), the distance between the top edge of the image, and the first grid line, is 31 pixels, almost like the grid starts one pixel above the canvas. The same goes for the left edge. However, after enabling Snap to Grid, pasted images (with sizes that are multi...
2012/03/14
[ "https://graphicdesign.stackexchange.com/questions/6523", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/4014/" ]
I'm pretty sure this was the following bug: <https://bugzilla.gnome.org/show_bug.cgi?id=588512> Fixed recently - to be precise, Wed May 21 20:43:05 2014 +0200. The fix is available in releases 2.8.12 and newer.
This bug appears to be active in 2.8.10. The problem seems to be an off-by-one error in the first row, and column of each grid. The solution seems to be to offset your grid by a negative amount one less than your grid-size. So, for a grid of 32x32, offset by -31x and -31y. This pushes the broken row and column out of...
400,500
So I would like to use \pause in its normal way, but it is revealing stuff backwards and I don't know why!!!! ``` \documentclass[usenames, dvipsnames]{beamer} \usepackage{amsmath, amssymb, amsthm, mathtools, commath, array, tcolorbox, cancel, caption, subcaption, graphicx, multicol,beamerthemesplit,stmaryrd,comment, c...
2017/11/09
[ "https://tex.stackexchange.com/questions/400500", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/147808/" ]
`align` gets executed twice and you need to make `\pause` keep out of the way of the first run: ``` \documentclass[usenames, dvipsnames]{beamer} \usepackage{amsmath, amssymb, amsthm, mathtools, commath, array, tcolorbox, cancel, caption, subcaption, graphicx, multicol,beamerthemesplit,stmaryrd,comment, color,movie15,a...
As a workaround: ``` \documentclass[usenames, dvipsnames]{beamer} \usepackage{amsmath, amssymb, amsthm, mathtools, commath, array, tcolorbox, cancel, caption, subcaption, stmaryrd,comment, media9,animate} \usepackage[utf8]{inputenc} \useoutertheme{split} \usetheme{Madrid} \begin{document} %6 slide \begin{frame}{Int...
23,798,675
I am very sorry for the long explanation, but it is required for proper understanding. I am working on computer vision algorithms for industrial tasks. Computer vision algorithms tend to be very complicate. Usually they involve calls for dozens (at the very least) of simpler algorithms (that are not simple either). Th...
2014/05/22
[ "https://Stackoverflow.com/questions/23798675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2889431/" ]
I'd just use some tried and true design patterns. Use a [strategy pattern](http://en.wikipedia.org/wiki/Strategy_pattern) to represent an algorithm that you may wish to swap out for alternatives. Use a [factory](http://en.wikipedia.org/wiki/Factory_%28object-oriented_programming%29) to instantiate different algorithm...
I'm going to assume that you are a competent OO programmer with good domain knowledge, and your problem is more about a higher level of organisation of software components (implementing algorithms) than OO generally provides. The patterns mentioned by @orpheist make perfect sense. Consider them. They will not solve al...
512,349
I am using Ubuntu 10.04 Server and trying to set up sudoers to respect a user's EDITOR choice (within limits) In my sudoers I have: ``` Defaults editor=/usr/bin/nano:/usr/bin/vim Defaults env_reset ``` And in the user .bashrc: ``` export EDITOR=/usr/bin/vim ``` $EDITOR is set: ``` $ echo $EDITOR /...
2012/11/29
[ "https://superuser.com/questions/512349", "https://superuser.com", "https://superuser.com/users/176858/" ]
You are right that setting the `EDITOR` variable should change the editor used for `sudo`. However, there are two other variables with precedence over the `EDITOR`: `SUDO_EDITOR` and `VISUAL`. Make sure none of them point to some other editor like `nano`.
env\_reset does not keep a user from setting variables on the command line: ``` $ sudo EDITOR=vim -- env |grep EDIT EDITOR=vim ``` I find your findings about the `editor` option mildly shocking but unfortunately I don't know the answers to your secondary questions. One would think that the Ubuntu camp would have pl...
512,349
I am using Ubuntu 10.04 Server and trying to set up sudoers to respect a user's EDITOR choice (within limits) In my sudoers I have: ``` Defaults editor=/usr/bin/nano:/usr/bin/vim Defaults env_reset ``` And in the user .bashrc: ``` export EDITOR=/usr/bin/vim ``` $EDITOR is set: ``` $ echo $EDITOR /...
2012/11/29
[ "https://superuser.com/questions/512349", "https://superuser.com", "https://superuser.com/users/176858/" ]
There's another solution as described **[here](http://www.handsomeplanet.com/archives/60)**: ``` sudo update-alternatives --config editor ``` But it's not so friendly on a multi-user system as it only updates a symlink in `/usr/bin/`: ``` $ ls -l `which editor` lrwxrwxrwx 1 root root 24 lip 4 19:37 /usr/bin/editor...
env\_reset does not keep a user from setting variables on the command line: ``` $ sudo EDITOR=vim -- env |grep EDIT EDITOR=vim ``` I find your findings about the `editor` option mildly shocking but unfortunately I don't know the answers to your secondary questions. One would think that the Ubuntu camp would have pl...
512,349
I am using Ubuntu 10.04 Server and trying to set up sudoers to respect a user's EDITOR choice (within limits) In my sudoers I have: ``` Defaults editor=/usr/bin/nano:/usr/bin/vim Defaults env_reset ``` And in the user .bashrc: ``` export EDITOR=/usr/bin/vim ``` $EDITOR is set: ``` $ echo $EDITOR /...
2012/11/29
[ "https://superuser.com/questions/512349", "https://superuser.com", "https://superuser.com/users/176858/" ]
You are right that setting the `EDITOR` variable should change the editor used for `sudo`. However, there are two other variables with precedence over the `EDITOR`: `SUDO_EDITOR` and `VISUAL`. Make sure none of them point to some other editor like `nano`.
In Debian 7, setting EDITOR in the environment didn't work. To use Nano, I ended up adding the following line to `/etc/sudoers` ``` Defaults editor="/usr/bin/nano" ```
512,349
I am using Ubuntu 10.04 Server and trying to set up sudoers to respect a user's EDITOR choice (within limits) In my sudoers I have: ``` Defaults editor=/usr/bin/nano:/usr/bin/vim Defaults env_reset ``` And in the user .bashrc: ``` export EDITOR=/usr/bin/vim ``` $EDITOR is set: ``` $ echo $EDITOR /...
2012/11/29
[ "https://superuser.com/questions/512349", "https://superuser.com", "https://superuser.com/users/176858/" ]
There's another solution as described **[here](http://www.handsomeplanet.com/archives/60)**: ``` sudo update-alternatives --config editor ``` But it's not so friendly on a multi-user system as it only updates a symlink in `/usr/bin/`: ``` $ ls -l `which editor` lrwxrwxrwx 1 root root 24 lip 4 19:37 /usr/bin/editor...
In Debian 7, setting EDITOR in the environment didn't work. To use Nano, I ended up adding the following line to `/etc/sudoers` ``` Defaults editor="/usr/bin/nano" ```
2,719,592
I am calling a soap function that returns the following array: `Array ( [FastAddressResult] => Array ( [IsError] => false [ErrorNumber] => 0 [ErrorMessage] => [Results] => Array ( [Address] => Array ( [Id] => 13872147.00 [OrganisationName] => [DepartmentName] => [Line1] => Methley Grove [Line2] => [Line3] => [Line4] ...
2010/04/27
[ "https://Stackoverflow.com/questions/2719592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/326669/" ]
Try: ``` $this->adressline1 = $result[ "FastAddressResult" ][ "Results" ][ "Address" ][ "Line1" ]; ``` You'd want to use $result->fastAddressResult->etc if $result was an object. Check [this page](http://www.php.net/manual/en/language.types.array.php) for more info about PHP arrays. Also, such complex array has cer...
Obviously someone didn't pay attention in programming class when they covered Arrays... ``` $this->adressline1 = $result['FastAddressResult']['Results']['Address']['Line1']; ``` or convert the array to an stdClass first: ``` $data = (object) $myarray; ``` but you'd have to do that for all the arrays in that too, ...
2,719,592
I am calling a soap function that returns the following array: `Array ( [FastAddressResult] => Array ( [IsError] => false [ErrorNumber] => 0 [ErrorMessage] => [Results] => Array ( [Address] => Array ( [Id] => 13872147.00 [OrganisationName] => [DepartmentName] => [Line1] => Methley Grove [Line2] => [Line3] => [Line4] ...
2010/04/27
[ "https://Stackoverflow.com/questions/2719592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/326669/" ]
Try: ``` $this->adressline1 = $result[ "FastAddressResult" ][ "Results" ][ "Address" ][ "Line1" ]; ``` You'd want to use $result->fastAddressResult->etc if $result was an object. Check [this page](http://www.php.net/manual/en/language.types.array.php) for more info about PHP arrays. Also, such complex array has cer...
Use like this, array stored in some variable called as $res ``` echo $res[ "FastAddressResult" ][ "Results" ][ "Address" ][ "Line1" ]; ```
43,454,920
How to make a css hover transition for both layers. I wrote the whole page so that you can (copy/paste) try it from your computer desktop. What I have works, but can it be done without javascript/jQuery with pure CSS? I tried with CSS pointer-events and was able to transition either the top layer (#circleOuter) or the ...
2017/04/17
[ "https://Stackoverflow.com/questions/43454920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1618415/" ]
Based on your actual example I don't see the need to trigger the event on **hover** the `#circleOuter:hover` if both elements are the size of the container and trigger at the same time just use the parent to trigger it: ```css #circleWrap { background: #ff0; width: 200px; height: 200px; position: relative;...
this worked for me. check the plunkr out . done using pure css ---> <https://plnkr.co/edit/FQkBWUNJ79q43eknO7p9?p=preview> ``` #circleWrap:hover>#circleInner{ transform: rotate(180deg); } #circleWrap:hover>#circleOuter{ transform: rotate(-180deg); } ```
43,454,920
How to make a css hover transition for both layers. I wrote the whole page so that you can (copy/paste) try it from your computer desktop. What I have works, but can it be done without javascript/jQuery with pure CSS? I tried with CSS pointer-events and was able to transition either the top layer (#circleOuter) or the ...
2017/04/17
[ "https://Stackoverflow.com/questions/43454920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1618415/" ]
this worked for me. check the plunkr out . done using pure css ---> <https://plnkr.co/edit/FQkBWUNJ79q43eknO7p9?p=preview> ``` #circleWrap:hover>#circleInner{ transform: rotate(180deg); } #circleWrap:hover>#circleOuter{ transform: rotate(-180deg); } ```
just add below css and remove jquery. ``` #circleWrap:hover>#circleInner { transform: rotate(180deg); transition: 500ms ease all; } #circleWrap:hover>#circleOuter { transform: rotate(-180deg); transition: 500ms ease all; } ```
43,454,920
How to make a css hover transition for both layers. I wrote the whole page so that you can (copy/paste) try it from your computer desktop. What I have works, but can it be done without javascript/jQuery with pure CSS? I tried with CSS pointer-events and was able to transition either the top layer (#circleOuter) or the ...
2017/04/17
[ "https://Stackoverflow.com/questions/43454920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1618415/" ]
Based on your actual example I don't see the need to trigger the event on **hover** the `#circleOuter:hover` if both elements are the size of the container and trigger at the same time just use the parent to trigger it: ```css #circleWrap { background: #ff0; width: 200px; height: 200px; position: relative;...
just add below css and remove jquery. ``` #circleWrap:hover>#circleInner { transform: rotate(180deg); transition: 500ms ease all; } #circleWrap:hover>#circleOuter { transform: rotate(-180deg); transition: 500ms ease all; } ```
32,888,513
I am looking for a very simple starter C# application for using StackExchange.Redis I have search over the web and found [StackExchange.Redis](https://github.com/StackExchange/StackExchange.Redis/tree/master/StackExchange.Redis/StackExchange/Redis) But this doesn't seems like a quick startup example. I have setup red...
2015/10/01
[ "https://Stackoverflow.com/questions/32888513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3040682/" ]
You can find C# examples in the [readme](https://stackexchange.github.io/StackExchange.Redis/Basics) file. ``` using StackExchange.Redis; ... ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("localhost"); // ^^^ store and re-use this!!! IDatabase db = redis.GetDatabase(); string value = "abcdefg"; db.Stri...
See the following code from their [github sample](https://github.com/StackExchange/StackExchange.Redis/blob/master/StackExchange.Redis.Tests/BasicOps.cs): ``` using (var muxer = ConnectionMultiplexer.Connect("localhost,resolvedns=1")) { muxer.PreserveAsyncOrder = preserveOrder; RedisKe...
32,888,513
I am looking for a very simple starter C# application for using StackExchange.Redis I have search over the web and found [StackExchange.Redis](https://github.com/StackExchange/StackExchange.Redis/tree/master/StackExchange.Redis/StackExchange/Redis) But this doesn't seems like a quick startup example. I have setup red...
2015/10/01
[ "https://Stackoverflow.com/questions/32888513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3040682/" ]
You can find C# examples in the [readme](https://stackexchange.github.io/StackExchange.Redis/Basics) file. ``` using StackExchange.Redis; ... ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("localhost"); // ^^^ store and re-use this!!! IDatabase db = redis.GetDatabase(); string value = "abcdefg"; db.Stri...
* //-- Install-Package StackExchange.Redis -Version 1.2.6 * In this simple example: set new string key/value to redis with expiry time, get redis string value by key from redis: * Code: ``` public string GetRedisValue() { var cachedKey = "key"; string value; using (var redis = ConnectionMultiplexer.Connec...
32,888,513
I am looking for a very simple starter C# application for using StackExchange.Redis I have search over the web and found [StackExchange.Redis](https://github.com/StackExchange/StackExchange.Redis/tree/master/StackExchange.Redis/StackExchange/Redis) But this doesn't seems like a quick startup example. I have setup red...
2015/10/01
[ "https://Stackoverflow.com/questions/32888513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3040682/" ]
See the following code from their [github sample](https://github.com/StackExchange/StackExchange.Redis/blob/master/StackExchange.Redis.Tests/BasicOps.cs): ``` using (var muxer = ConnectionMultiplexer.Connect("localhost,resolvedns=1")) { muxer.PreserveAsyncOrder = preserveOrder; RedisKe...
* //-- Install-Package StackExchange.Redis -Version 1.2.6 * In this simple example: set new string key/value to redis with expiry time, get redis string value by key from redis: * Code: ``` public string GetRedisValue() { var cachedKey = "key"; string value; using (var redis = ConnectionMultiplexer.Connec...
7,233,951
Im using GPG to encrypt a file in ASP.NET, C#. My code executes the command using ProcessStartInfo, and gpg.exe executes, but I have an issue. GPG asks me to authorize always-trust with "y" as the option. I tried using "YES" as well (As suggested in GPG help, to assume "yes" for all questions), but that didn't work eit...
2011/08/29
[ "https://Stackoverflow.com/questions/7233951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/858040/" ]
You can use `SendKeys.SendWait` <http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.sendwait.aspx>
Pipe a "y" to your command: ``` echo "y" | <your command> ```
7,233,951
Im using GPG to encrypt a file in ASP.NET, C#. My code executes the command using ProcessStartInfo, and gpg.exe executes, but I have an issue. GPG asks me to authorize always-trust with "y" as the option. I tried using "YES" as well (As suggested in GPG help, to assume "yes" for all questions), but that didn't work eit...
2011/08/29
[ "https://Stackoverflow.com/questions/7233951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/858040/" ]
You need only to specify the trust model "always" by using the "--trust-model" option. For Example: ``` gpg --trust-model always --armor --output fileOutput.gpg --recipient secure@site.com --encrypt fileInput.xml ```
Pipe a "y" to your command: ``` echo "y" | <your command> ```
7,233,951
Im using GPG to encrypt a file in ASP.NET, C#. My code executes the command using ProcessStartInfo, and gpg.exe executes, but I have an issue. GPG asks me to authorize always-trust with "y" as the option. I tried using "YES" as well (As suggested in GPG help, to assume "yes" for all questions), but that didn't work eit...
2011/08/29
[ "https://Stackoverflow.com/questions/7233951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/858040/" ]
add `--always-trust` as a command line argument to gpg to take the prompt away.
Pipe a "y" to your command: ``` echo "y" | <your command> ```
7,233,951
Im using GPG to encrypt a file in ASP.NET, C#. My code executes the command using ProcessStartInfo, and gpg.exe executes, but I have an issue. GPG asks me to authorize always-trust with "y" as the option. I tried using "YES" as well (As suggested in GPG help, to assume "yes" for all questions), but that didn't work eit...
2011/08/29
[ "https://Stackoverflow.com/questions/7233951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/858040/" ]
add `--always-trust` as a command line argument to gpg to take the prompt away.
You can use `SendKeys.SendWait` <http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.sendwait.aspx>
7,233,951
Im using GPG to encrypt a file in ASP.NET, C#. My code executes the command using ProcessStartInfo, and gpg.exe executes, but I have an issue. GPG asks me to authorize always-trust with "y" as the option. I tried using "YES" as well (As suggested in GPG help, to assume "yes" for all questions), but that didn't work eit...
2011/08/29
[ "https://Stackoverflow.com/questions/7233951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/858040/" ]
add `--always-trust` as a command line argument to gpg to take the prompt away.
You need only to specify the trust model "always" by using the "--trust-model" option. For Example: ``` gpg --trust-model always --armor --output fileOutput.gpg --recipient secure@site.com --encrypt fileInput.xml ```
52,130,515
``` import React from "react"; import ReactDOM from "react-dom"; class NestedComponent extends React.Component { constructor(props) { super(props); this.childMethod = this.childMethod.bind(this); } childMethod() { alert("Child method one ran"); } render() { return <di...
2018/09/01
[ "https://Stackoverflow.com/questions/52130515", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4592593/" ]
@Dakito try this... make an Array as `values` and then ``` <div> <p (click)="Click(value)" *ngFor="let value of values" value="value">{{value}} element</p> </div> ```
TypeScript Class ``` items = [{ number: 1 }, { number: 2 }, { number: 3 }]; ``` Template: ``` <div> <p *ngFor="let item of items" (click)="Click(item.number)" [value]="item.number"> {{item.number}} element </p> </div> ```
17,306,358
I've created an API in Go that, upon being called, performs a query, creates an instance of a struct, and then encodes that struct as JSON before sending back to the caller. I'd now like to allow the caller to be able to select the specific fields they would like returned by passing in a "fields" GET parameter. This m...
2013/06/25
[ "https://Stackoverflow.com/questions/17306358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/387049/" ]
You can use tagging attribute "omitifempty" or make optional fields pointers and leave those you want skipped uninitialized.
The question is now a bit old, but I came across the same issue a little while ago, and as I found no easy way to do this, I built a library fulfilling this purpose. It allows to easily generate a `map[string]interface{}` from a static struct. <https://github.com/tuvistavie/structomap>
17,306,358
I've created an API in Go that, upon being called, performs a query, creates an instance of a struct, and then encodes that struct as JSON before sending back to the caller. I'd now like to allow the caller to be able to select the specific fields they would like returned by passing in a "fields" GET parameter. This m...
2013/06/25
[ "https://Stackoverflow.com/questions/17306358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/387049/" ]
Take three ingredients: 1. The `reflect` package to loop over all the fields of a struct. 2. An `if` statement to pick up the fields you want to `Marshal`, and 3. The `encoding/json` package to `Marshal` the fields of your liking. Preparation: 1. Blend them in a good proportion. Use `reflect.TypeOf(your_struct).Fiel...
I didn't have the same problem but similar. Below code solves your problem too, of course if you don't mind performance issue. Before implement that kind of solution to your system I recommend you to redesign your structure if you can. Sending variable structure response is over-engineering. I believe a response struct...
17,306,358
I've created an API in Go that, upon being called, performs a query, creates an instance of a struct, and then encodes that struct as JSON before sending back to the caller. I'd now like to allow the caller to be able to select the specific fields they would like returned by passing in a "fields" GET parameter. This m...
2013/06/25
[ "https://Stackoverflow.com/questions/17306358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/387049/" ]
Take three ingredients: 1. The `reflect` package to loop over all the fields of a struct. 2. An `if` statement to pick up the fields you want to `Marshal`, and 3. The `encoding/json` package to `Marshal` the fields of your liking. Preparation: 1. Blend them in a good proportion. Use `reflect.TypeOf(your_struct).Fiel...
I also faced this problem, at first I just wanted to specialize the responses in my http handler. My first approach was creating a package that copies the information of a struct to another struct and then marshal that second struct. I did that package using reflection, so, never liked that approach and also I wasn't d...
17,306,358
I've created an API in Go that, upon being called, performs a query, creates an instance of a struct, and then encodes that struct as JSON before sending back to the caller. I'd now like to allow the caller to be able to select the specific fields they would like returned by passing in a "fields" GET parameter. This m...
2013/06/25
[ "https://Stackoverflow.com/questions/17306358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/387049/" ]
The question is asking for fields to be **dynamically** selected based on the caller-provided list of fields. This isn't possible to be done with the statically-defined json struct tag. If what you want is to **always** skip a field to json-encode, then of course use `json:"-"` to ignore the field. (Note also that thi...
You can use the `reflect` package to select the fields that you want by reflecting on the field tags and selecting the `json` tag values. Define a method on your SearchResults type that selects the fields you want and returns them as a `map[string]interface{}`, and then marshal *that* instead of the SearchResults struc...
17,306,358
I've created an API in Go that, upon being called, performs a query, creates an instance of a struct, and then encodes that struct as JSON before sending back to the caller. I'd now like to allow the caller to be able to select the specific fields they would like returned by passing in a "fields" GET parameter. This m...
2013/06/25
[ "https://Stackoverflow.com/questions/17306358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/387049/" ]
You can use tagging attribute "omitifempty" or make optional fields pointers and leave those you want skipped uninitialized.
Here is how I defined my structure. ``` type User struct { Username string `json:"username" bson:"username"` Email string `json:"email" bson:"email"` Password *string `json:"password,omitempty" bson:"password"` FullName string `json:"fullname" bson:"fullname"` } ``` And inside my function set `...
17,306,358
I've created an API in Go that, upon being called, performs a query, creates an instance of a struct, and then encodes that struct as JSON before sending back to the caller. I'd now like to allow the caller to be able to select the specific fields they would like returned by passing in a "fields" GET parameter. This m...
2013/06/25
[ "https://Stackoverflow.com/questions/17306358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/387049/" ]
You can use the `reflect` package to select the fields that you want by reflecting on the field tags and selecting the `json` tag values. Define a method on your SearchResults type that selects the fields you want and returns them as a `map[string]interface{}`, and then marshal *that* instead of the SearchResults struc...
I didn't have the same problem but similar. Below code solves your problem too, of course if you don't mind performance issue. Before implement that kind of solution to your system I recommend you to redesign your structure if you can. Sending variable structure response is over-engineering. I believe a response struct...
17,306,358
I've created an API in Go that, upon being called, performs a query, creates an instance of a struct, and then encodes that struct as JSON before sending back to the caller. I'd now like to allow the caller to be able to select the specific fields they would like returned by passing in a "fields" GET parameter. This m...
2013/06/25
[ "https://Stackoverflow.com/questions/17306358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/387049/" ]
The question is asking for fields to be **dynamically** selected based on the caller-provided list of fields. This isn't possible to be done with the statically-defined json struct tag. If what you want is to **always** skip a field to json-encode, then of course use `json:"-"` to ignore the field. (Note also that thi...
Another way to do this is to have a struct of **pointers** with the `,omitempty` tag. If the pointers are **nil**, the fields won't be Marshalled. This method will not require additional reflection or inefficient use of maps. Same example as jorelli using this method: <http://play.golang.org/p/JJNa0m2_nw>
17,306,358
I've created an API in Go that, upon being called, performs a query, creates an instance of a struct, and then encodes that struct as JSON before sending back to the caller. I'd now like to allow the caller to be able to select the specific fields they would like returned by passing in a "fields" GET parameter. This m...
2013/06/25
[ "https://Stackoverflow.com/questions/17306358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/387049/" ]
The question is asking for fields to be **dynamically** selected based on the caller-provided list of fields. This isn't possible to be done with the statically-defined json struct tag. If what you want is to **always** skip a field to json-encode, then of course use `json:"-"` to ignore the field. (Note also that thi...
I didn't have the same problem but similar. Below code solves your problem too, of course if you don't mind performance issue. Before implement that kind of solution to your system I recommend you to redesign your structure if you can. Sending variable structure response is over-engineering. I believe a response struct...
17,306,358
I've created an API in Go that, upon being called, performs a query, creates an instance of a struct, and then encodes that struct as JSON before sending back to the caller. I'd now like to allow the caller to be able to select the specific fields they would like returned by passing in a "fields" GET parameter. This m...
2013/06/25
[ "https://Stackoverflow.com/questions/17306358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/387049/" ]
The question is asking for fields to be **dynamically** selected based on the caller-provided list of fields. This isn't possible to be done with the statically-defined json struct tag. If what you want is to **always** skip a field to json-encode, then of course use `json:"-"` to ignore the field. (Note also that thi...
I just published [sheriff](https://github.com/liip/sheriff), which transforms structs to a map based on tags annotated on the struct fields. You can then marshal (JSON or others) the generated map. It probably doesn't allow you to only serialize the set of fields the caller requested, but I imagine using a set of group...
17,306,358
I've created an API in Go that, upon being called, performs a query, creates an instance of a struct, and then encodes that struct as JSON before sending back to the caller. I'd now like to allow the caller to be able to select the specific fields they would like returned by passing in a "fields" GET parameter. This m...
2013/06/25
[ "https://Stackoverflow.com/questions/17306358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/387049/" ]
The question is asking for fields to be **dynamically** selected based on the caller-provided list of fields. This isn't possible to be done with the statically-defined json struct tag. If what you want is to **always** skip a field to json-encode, then of course use `json:"-"` to ignore the field. (Note also that thi...
use `json:"-"` ``` // Field is ignored by this package. Field int `json:"-"` // Field appears in JSON as key "myName". Field int `json:"myName"` // Field appears in JSON as key "myName" and // the field is omitted from the object if its value is empty, // as defined above. Field int `json:"myName,omitempty"` // Fie...
1,629,356
Here is my problem that I have to solve: An agent will send a secret code made up of 12 different symbols across a secure wire. In addition to the 12 symbols, the agent will also send a total of 45 blank spaces between the symbols, with at least three spaces between each pair of consecutive symbols. How many ways are ...
2016/01/27
[ "https://math.stackexchange.com/questions/1629356", "https://math.stackexchange.com", "https://math.stackexchange.com/users/134290/" ]
You have $12$ symbols, so there are $11$ gaps between them. Each gap has to have at least $3$ spaces, so we have accounted for $33$ spaces. Your question is then the number of ways to distribute the remaining $12$ spaces between the gaps. This is the number of [weak compositions](https://en.wikipedia.org/wiki/Compositi...
Make $12$ boxes, $11$ of a symbol followed by $3$ blanks, $\fbox{S---}$, and a last just $\fbox{S}$ There are $12$ blanks left. Exclude the first and the last symbols to get a total of $22$ *entities*. Place the boxes in this string of $22$ in $\binom{22}{12}$ ways. If the symbols of the secret code are in a fixed o...
1,629,356
Here is my problem that I have to solve: An agent will send a secret code made up of 12 different symbols across a secure wire. In addition to the 12 symbols, the agent will also send a total of 45 blank spaces between the symbols, with at least three spaces between each pair of consecutive symbols. How many ways are ...
2016/01/27
[ "https://math.stackexchange.com/questions/1629356", "https://math.stackexchange.com", "https://math.stackexchange.com/users/134290/" ]
Make $12$ boxes, $11$ of a symbol followed by $3$ blanks, $\fbox{S---}$, and a last just $\fbox{S}$ There are $12$ blanks left. Exclude the first and the last symbols to get a total of $22$ *entities*. Place the boxes in this string of $22$ in $\binom{22}{12}$ ways. If the symbols of the secret code are in a fixed o...
First of all, if the agent used all 12 symbols, wouldn't the minimum amount of spaces be 33 instead of 36? Even so, this shouldn't be relevant, since the total is 45 spaces anyways, so they'd all end up being used. Also, I'm a little confused about what the word "consecutive" is supposed to mean in this problem, but I'...
1,629,356
Here is my problem that I have to solve: An agent will send a secret code made up of 12 different symbols across a secure wire. In addition to the 12 symbols, the agent will also send a total of 45 blank spaces between the symbols, with at least three spaces between each pair of consecutive symbols. How many ways are ...
2016/01/27
[ "https://math.stackexchange.com/questions/1629356", "https://math.stackexchange.com", "https://math.stackexchange.com/users/134290/" ]
You'll use up $33$ spaces fulfilling the "at least 3 spaces between a pair of consecutive symbols" condition. We'll add these in last. This leaves us with $12$ spaces to place. One approach is to place these spaces down first and then add the unique symbols in one-by-one: $$\\_B\\_B\\_B\\_B\\_B\\_B\\_B\\_B\\_B\\_B\\_B...
Make $12$ boxes, $11$ of a symbol followed by $3$ blanks, $\fbox{S---}$, and a last just $\fbox{S}$ There are $12$ blanks left. Exclude the first and the last symbols to get a total of $22$ *entities*. Place the boxes in this string of $22$ in $\binom{22}{12}$ ways. If the symbols of the secret code are in a fixed o...
1,629,356
Here is my problem that I have to solve: An agent will send a secret code made up of 12 different symbols across a secure wire. In addition to the 12 symbols, the agent will also send a total of 45 blank spaces between the symbols, with at least three spaces between each pair of consecutive symbols. How many ways are ...
2016/01/27
[ "https://math.stackexchange.com/questions/1629356", "https://math.stackexchange.com", "https://math.stackexchange.com/users/134290/" ]
You have $12$ symbols, so there are $11$ gaps between them. Each gap has to have at least $3$ spaces, so we have accounted for $33$ spaces. Your question is then the number of ways to distribute the remaining $12$ spaces between the gaps. This is the number of [weak compositions](https://en.wikipedia.org/wiki/Compositi...
First of all, if the agent used all 12 symbols, wouldn't the minimum amount of spaces be 33 instead of 36? Even so, this shouldn't be relevant, since the total is 45 spaces anyways, so they'd all end up being used. Also, I'm a little confused about what the word "consecutive" is supposed to mean in this problem, but I'...
1,629,356
Here is my problem that I have to solve: An agent will send a secret code made up of 12 different symbols across a secure wire. In addition to the 12 symbols, the agent will also send a total of 45 blank spaces between the symbols, with at least three spaces between each pair of consecutive symbols. How many ways are ...
2016/01/27
[ "https://math.stackexchange.com/questions/1629356", "https://math.stackexchange.com", "https://math.stackexchange.com/users/134290/" ]
You'll use up $33$ spaces fulfilling the "at least 3 spaces between a pair of consecutive symbols" condition. We'll add these in last. This leaves us with $12$ spaces to place. One approach is to place these spaces down first and then add the unique symbols in one-by-one: $$\\_B\\_B\\_B\\_B\\_B\\_B\\_B\\_B\\_B\\_B\\_B...
First of all, if the agent used all 12 symbols, wouldn't the minimum amount of spaces be 33 instead of 36? Even so, this shouldn't be relevant, since the total is 45 spaces anyways, so they'd all end up being used. Also, I'm a little confused about what the word "consecutive" is supposed to mean in this problem, but I'...
74,306,160
I have a table where i put a button on the final column of some rows. This button is supposed to open a bootstrap modal using jquery through the onclick attribute. It calls a js function which has the jquery method that shows the modal, but is not working. When I put an alert on the function and comment the jquery met...
2022/11/03
[ "https://Stackoverflow.com/questions/74306160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13617839/" ]
We can try using `str.replace` here. Assuming data in the column would always have the format `2022Q1`: ```py df["quarter"] = df["quarter"].str.replace(r'(?=Q\d$)', '_', regex=True) ```
You can try this : ``` df['quarter'] = df.quarter.apply(lambda x: x[:4] + '_' + x[-2:]) ```
47,692,194
I added 3 items to cxImageComboBox1. Assigned ImageList1 for the images. Looks like this : [![enter image description here](https://i.stack.imgur.com/rZTwE.png)](https://i.stack.imgur.com/rZTwE.png) At runtime it displays images correctly. However only the first image (1) can be selected. I can not select the '2' or...
2017/12/07
[ "https://Stackoverflow.com/questions/47692194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/763539/" ]
You only set the **descriptions**. Try also setting the **values**.
You must make unique value for every Items (Set Value 1,2,3)
70,805,061
When I have to make a series of pull requests that stack on top of each other (i.e., each subsequent commit is independent on the previous one), I just work on each one in serial and then push the commits. I also often work with situations where the commits are non-related, and in this situation, I wonder what the pro...
2022/01/21
[ "https://Stackoverflow.com/questions/70805061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5965026/" ]
You most likely want to reverse the order of your *Keys* and *Values* on your Hash Table: ``` $ProjectType = @{ 'FAE04EC0-301F-11D3-BF4B-00C04F79EFBC' = 'CSharp' '349C5851-65DF-11DA-9384-00065B846F21' = 'Web_Application' '3D9AD99F-2412-4246-B90B-4EAA41C64699' = 'Windows_Communication_Foundation' '60DC8...
Flip the keys and values around so that the reference GUIDs are the keys: ``` $ProjectType = @{ 'FAE04EC0-301F-11D3-BF4B-00C04F79EFBC' = 'CSharp' '349C5851-65DF-11DA-9384-00065B846F21' = 'Web_Application' '3D9AD99F-2412-4246-B90B-4EAA41C64699' = 'Windows_Communication_Foundation' '60DC8134-EBA5-43B8-BCC9-BB4BC...
39,409,998
I have updated my drupal into latest version which is 8.1.9, i have succeded the updates, everything is seems fine except the Uninstalled theme section under **appearance** menu it seems lots of unknown Uninstalled themes there which are not before, please refer screenshot [![enter image description here](https://i.st...
2016/09/09
[ "https://Stackoverflow.com/questions/39409998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2053516/" ]
I don't know about a way to adjust automatically but you could look at this example which add points to the chart dynamically : <http://doc.qt.io/qt-5/qtcharts-dynamicspline-example.html> Although in this example the range has been limited when adding points so to go further it would require to re-adjust the range whe...
About the first parameter in m\_series->append(). Use "qint64 QDateTime::toMSecsSincPoch()" is better.... like: ``` ... m_series->append(QDateTime::currentDateTime().toMSecsSincPoch(), result); ```
39,409,998
I have updated my drupal into latest version which is 8.1.9, i have succeded the updates, everything is seems fine except the Uninstalled theme section under **appearance** menu it seems lots of unknown Uninstalled themes there which are not before, please refer screenshot [![enter image description here](https://i.st...
2016/09/09
[ "https://Stackoverflow.com/questions/39409998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2053516/" ]
I don't know about a way to adjust automatically but you could look at this example which add points to the chart dynamically : <http://doc.qt.io/qt-5/qtcharts-dynamicspline-example.html> Although in this example the range has been limited when adding points so to go further it would require to re-adjust the range whe...
QLineSeries inherits from QXYSeries, which implements certain signals that you can exploit as follow : ``` connect(m_series, &QXYSeries::pointAdded, this, &MyForm::autoScaleChart); ``` in your form or model, better define chart and series as members, so that you can acces them from a member method called aut...
70,474,570
Assume ``` thread_sold = ['white', 'white&blue', 'white&blue', 'white', 'white&yellow', 'purple', 'purple&yellow', 'purple&yellow'] ``` I need all items from that list, sometimes separated by & sometimes not. The below function works, but I'd like to know how to do this with list comprehension. ``` def cant_list_co...
2021/12/24
[ "https://Stackoverflow.com/questions/70474570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9938653/" ]
```py thread_sold_split_bad = [ [x for x in y.split("&")] if "&" in y else y for y in thread_sold ] ``` Your attempt above does not work because you are doing nested list comprehensions instead of a plain comprehension (notice the brackets inside the main brackets). Here is the corrected version: ``` >>> thread_...
You could use `functools.reduce`: ``` from functools import reduce reduce(lambda x, y: x + y, [x.split("&") for x in thread_sold]) ``` or ``` import itertools list(itertools.chain.from_iterable(x.split("&") for x in thread_sold)) ``` **OUTPUT** ``` ['white', 'white', 'blue', 'white', 'blue', 'white', 'white', ...
38,321,056
i have some nexus 7's (2013) that are *not* rooted and have api 6.0.1 with may security patches. i have stay awake on in developer options. i have everything off under the display settings except for sleep (which can not be turned off and is set to 30 minutes). despite this, the tablet dims after about 30 minutes. i ...
2016/07/12
[ "https://Stackoverflow.com/questions/38321056", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51292/" ]
I know is late to comment a solution, but in case someone need it like me minutes ago.. In python3 try install readability-lxml with ``` $ pip3 install readability-lxml ``` It works form me
It's trying to import your file. Simply rename it. > > File "**readability.py**", line 1, in from > > readability.readability import Document > > ImportError: No module named readability > > >
17,841
Before installing Lion, I could use the "double finger left/right swipe" gesture to go back and forward in the history in Google Chrome. After installing Lion, I can't find any mouse gesture that implements this. The new version of Safari uses a single finger swipe to go back and forward in history. Is there any way ...
2011/07/20
[ "https://apple.stackexchange.com/questions/17841", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/120/" ]
### IDK about the Magic Mouse but three finger swiping works on the Magic Trackpad By default swiping between pages is set to two fingers in Lion. However chrome **doesn't currently recognize two finger** swiping but it does recognize **three finger swiping**. **To enable three finger back and forward swiping** simpl...
You can go back and forward with one finger swipe left/right in the new Chrome Dev Channel as you do in Safari. It's not quite polished as Safari, but i think they will fix it ASAP.
17,841
Before installing Lion, I could use the "double finger left/right swipe" gesture to go back and forward in the history in Google Chrome. After installing Lion, I can't find any mouse gesture that implements this. The new version of Safari uses a single finger swipe to go back and forward in history. Is there any way ...
2011/07/20
[ "https://apple.stackexchange.com/questions/17841", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/120/" ]
As of a late v16 version of the browser, Chrome now honors the preference of single-finger swipe to navigate back and forth. I am unsure of exact version numbers, however, in the v16 series after this feature was implemented, it was shortly followed up by an arrow that will float over the page and drift left or right, ...
I found this whole thing quite frustrating too. I have used magic prefs for some time, and it seems that under OSX Lion, they have actually removed the system wide forward and back buttons, however: ⌘+[ and ⌘+] will do forward and back respectively in my experience pretty much system wide. I set the following: OSX: D...
17,841
Before installing Lion, I could use the "double finger left/right swipe" gesture to go back and forward in the history in Google Chrome. After installing Lion, I can't find any mouse gesture that implements this. The new version of Safari uses a single finger swipe to go back and forward in history. Is there any way ...
2011/07/20
[ "https://apple.stackexchange.com/questions/17841", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/120/" ]
There is a setting for this and it can be turned off / on: [![enter image description here](https://i.stack.imgur.com/oHd26.png)](https://i.stack.imgur.com/oHd26.png) To get there, go to Settings -> Mouse -> More Gestures
As of a late v16 version of the browser, Chrome now honors the preference of single-finger swipe to navigate back and forth. I am unsure of exact version numbers, however, in the v16 series after this feature was implemented, it was shortly followed up by an arrow that will float over the page and drift left or right, ...
17,841
Before installing Lion, I could use the "double finger left/right swipe" gesture to go back and forward in the history in Google Chrome. After installing Lion, I can't find any mouse gesture that implements this. The new version of Safari uses a single finger swipe to go back and forward in history. Is there any way ...
2011/07/20
[ "https://apple.stackexchange.com/questions/17841", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/120/" ]
Holding `⌥ Option` while swiping with two fingers will do back and forth in Chrome, Firefox, Finder etc. if you have set OS X to change space with two finger swipe (the default setting). Conversely, if you have set OS X to go back/forth with a two finger swipe, holding the `⌥ Option` key while swiping will then switch...
You can go back and forward with one finger swipe left/right in the new Chrome Dev Channel as you do in Safari. It's not quite polished as Safari, but i think they will fix it ASAP.
17,841
Before installing Lion, I could use the "double finger left/right swipe" gesture to go back and forward in the history in Google Chrome. After installing Lion, I can't find any mouse gesture that implements this. The new version of Safari uses a single finger swipe to go back and forward in history. Is there any way ...
2011/07/20
[ "https://apple.stackexchange.com/questions/17841", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/120/" ]
Holding `⌥ Option` while swiping with two fingers will do back and forth in Chrome, Firefox, Finder etc. if you have set OS X to change space with two finger swipe (the default setting). Conversely, if you have set OS X to go back/forth with a two finger swipe, holding the `⌥ Option` key while swiping will then switch...
I found this whole thing quite frustrating too. I have used magic prefs for some time, and it seems that under OSX Lion, they have actually removed the system wide forward and back buttons, however: ⌘+[ and ⌘+] will do forward and back respectively in my experience pretty much system wide. I set the following: OSX: D...
17,841
Before installing Lion, I could use the "double finger left/right swipe" gesture to go back and forward in the history in Google Chrome. After installing Lion, I can't find any mouse gesture that implements this. The new version of Safari uses a single finger swipe to go back and forward in history. Is there any way ...
2011/07/20
[ "https://apple.stackexchange.com/questions/17841", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/120/" ]
As of a late v16 version of the browser, Chrome now honors the preference of single-finger swipe to navigate back and forth. I am unsure of exact version numbers, however, in the v16 series after this feature was implemented, it was shortly followed up by an arrow that will float over the page and drift left or right, ...
Felt your pain! I have Magic Mouse. Took me a few days to figure out what I think power users feel is right balance: * change mouse prefs to "swipe with one or two fingers" (to restore system-wide back/forward gesture metaphor to Chrome, Finder, etc) * you lose system-wide Spaces back/forward when you do this, but jus...
17,841
Before installing Lion, I could use the "double finger left/right swipe" gesture to go back and forward in the history in Google Chrome. After installing Lion, I can't find any mouse gesture that implements this. The new version of Safari uses a single finger swipe to go back and forward in history. Is there any way ...
2011/07/20
[ "https://apple.stackexchange.com/questions/17841", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/120/" ]
I could not find a way to make it work with core utilities but I found a way to make it work with [BetterTouchTool](http://www.boastr.de/). First of all, disable three finger scrolling in the system preferences and then download and install BetterTouchTool, open its preferences and add the following settings for the [M...
You can go back and forward with one finger swipe left/right in the new Chrome Dev Channel as you do in Safari. It's not quite polished as Safari, but i think they will fix it ASAP.
17,841
Before installing Lion, I could use the "double finger left/right swipe" gesture to go back and forward in the history in Google Chrome. After installing Lion, I can't find any mouse gesture that implements this. The new version of Safari uses a single finger swipe to go back and forward in history. Is there any way ...
2011/07/20
[ "https://apple.stackexchange.com/questions/17841", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/120/" ]
As of a late v16 version of the browser, Chrome now honors the preference of single-finger swipe to navigate back and forth. I am unsure of exact version numbers, however, in the v16 series after this feature was implemented, it was shortly followed up by an arrow that will float over the page and drift left or right, ...
Three finger swipe works, and this what happened to Chrome: <http://groups.google.com/a/chromium.org/group/chromium-bugs/browse_thread/thread/be8a86eb6bf98f1c?fwc=1&pli=1>
17,841
Before installing Lion, I could use the "double finger left/right swipe" gesture to go back and forward in the history in Google Chrome. After installing Lion, I can't find any mouse gesture that implements this. The new version of Safari uses a single finger swipe to go back and forward in history. Is there any way ...
2011/07/20
[ "https://apple.stackexchange.com/questions/17841", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/120/" ]
There is a setting for this and it can be turned off / on: [![enter image description here](https://i.stack.imgur.com/oHd26.png)](https://i.stack.imgur.com/oHd26.png) To get there, go to Settings -> Mouse -> More Gestures
In system preference, in trackpad set swipe between pages to "swipe with two or three fingers" This lets you use three fingers for apps that don't support two fingers but also use two fingers on apps that support it (currently on safari supports two fingers I think) Note: to go back you swipe from right to left with ...
17,841
Before installing Lion, I could use the "double finger left/right swipe" gesture to go back and forward in the history in Google Chrome. After installing Lion, I can't find any mouse gesture that implements this. The new version of Safari uses a single finger swipe to go back and forward in history. Is there any way ...
2011/07/20
[ "https://apple.stackexchange.com/questions/17841", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/120/" ]
As of a late v16 version of the browser, Chrome now honors the preference of single-finger swipe to navigate back and forth. I am unsure of exact version numbers, however, in the v16 series after this feature was implemented, it was shortly followed up by an arrow that will float over the page and drift left or right, ...
You can easily get the single finger forward/back in Chrome just like Safari by using the free [BetterTouchTool](http://bettertouchtool.net/) Add a Chrome specific gesture to bind the gestures. For a magic mouse: * Single finger swipe left => cmd+] * Single finger swipe right => cmd+[ For a trackpad: * Three finge...
606,073
I am trying to determine if $(0,0)$ a solution to $x^y-y^x=0$. My hunch is that it is undefined since $0^0$ is an indeterminate form. To attempt to prove this, I have tried the usual "different paths give different limits" trick with $(x,ax^n)\rightarrow(0,0)$ $(x,\sin(x))\rightarrow(0,0)$ $(x,e^x-1)\rightarrow(0,0)...
2013/12/14
[ "https://math.stackexchange.com/questions/606073", "https://math.stackexchange.com", "https://math.stackexchange.com/users/22276/" ]
First of all, this function may not be well-defined if $x<0$ or $y<0$ (for example, if $x=-1$ and $y=1/2$, then $x^y=i$, which is not real). Therefore, I suggest you do the following: * Define the function only on $\mathbb R\_{++}^2\equiv\{(x,y)\in\mathbb R^2\,|\,x>0,\, y>0\}$ * Show that for *any* sequence $(x\_n,y\_...
The short answer is "no". The reason is that there is no universal, always-agreed-upon definition of what $0^0$ is supposed to equal. And if $0^0$ is undefined, so is $0^0-0^0$, and $(0,0)$ is not a solution of $x^y-y^x=0$. Having said that, there are many situations in which it is convenient to allow $0^0$ to take a ...
606,073
I am trying to determine if $(0,0)$ a solution to $x^y-y^x=0$. My hunch is that it is undefined since $0^0$ is an indeterminate form. To attempt to prove this, I have tried the usual "different paths give different limits" trick with $(x,ax^n)\rightarrow(0,0)$ $(x,\sin(x))\rightarrow(0,0)$ $(x,e^x-1)\rightarrow(0,0)...
2013/12/14
[ "https://math.stackexchange.com/questions/606073", "https://math.stackexchange.com", "https://math.stackexchange.com/users/22276/" ]
This might sound unsatisfying, but if you define $0^0$ to be any finite number, then $(0,0)$ is a solution, otherwise it isn't. I personally like $0^0=1$, but some people disagree. This site has a lot to say about the issue of $0^0$, and you can search for that. It is ultimately a matter of definition.
First of all, this function may not be well-defined if $x<0$ or $y<0$ (for example, if $x=-1$ and $y=1/2$, then $x^y=i$, which is not real). Therefore, I suggest you do the following: * Define the function only on $\mathbb R\_{++}^2\equiv\{(x,y)\in\mathbb R^2\,|\,x>0,\, y>0\}$ * Show that for *any* sequence $(x\_n,y\_...
606,073
I am trying to determine if $(0,0)$ a solution to $x^y-y^x=0$. My hunch is that it is undefined since $0^0$ is an indeterminate form. To attempt to prove this, I have tried the usual "different paths give different limits" trick with $(x,ax^n)\rightarrow(0,0)$ $(x,\sin(x))\rightarrow(0,0)$ $(x,e^x-1)\rightarrow(0,0)...
2013/12/14
[ "https://math.stackexchange.com/questions/606073", "https://math.stackexchange.com", "https://math.stackexchange.com/users/22276/" ]
This might sound unsatisfying, but if you define $0^0$ to be any finite number, then $(0,0)$ is a solution, otherwise it isn't. I personally like $0^0=1$, but some people disagree. This site has a lot to say about the issue of $0^0$, and you can search for that. It is ultimately a matter of definition.
The short answer is "no". The reason is that there is no universal, always-agreed-upon definition of what $0^0$ is supposed to equal. And if $0^0$ is undefined, so is $0^0-0^0$, and $(0,0)$ is not a solution of $x^y-y^x=0$. Having said that, there are many situations in which it is convenient to allow $0^0$ to take a ...
25,157,610
I want to draw some themes parts to several TImages. In my code below, `GetElementDetails` expects a certain enum value. I have the `PTypeInfo` for the enum type, but I don't know how to type-cast `i` to the enum type. ``` procedure TForm1.Button1Click(Sender: TObject); procedure drawType(c: tcanvas; ti: ptypeinfo);...
2014/08/06
[ "https://Stackoverflow.com/questions/25157610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/434749/" ]
You cannot do this easily. The `GetElementDetails` method is overloaded heavily on its first parameters. Overload resolution is static, performed at compile time. You wish to bind to the method at runtime, based on the run time type of the enum. That's not possible for normal method calls. The only way to do this is ...
try this one: ``` type TAbstractStyleServicesFunction = reference to function(const styleServices: TAbstractStyleServices; const I: Integer) : TThemedElementDetails; procedure TForm1.drawType(c: TCanvas; ti: PTypeInfo; const styleServicesFunction: TAbstractStyleServicesFunction); var r: trect; I: Integ...
56,563,681
I want to remove the rows from the pandas dataframe, that contains the strings from a particular column whose length is greater than the desired length. For example: Input frame: ``` X Y 0 Hi how are you. 1 An apple 2 glass of water 3 I like to watch movie ``` Now, say I want to remove the rows whic...
2019/06/12
[ "https://Stackoverflow.com/questions/56563681", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8893595/" ]
First split values by whitespace, get number of rows by [`Series.str.len`](http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.len.html) and check by inverted condition `>=` to `<` with [`Series.lt`](http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.lt.html) for [`boolean i...
You can count the spaces: ``` df[df.Y.str.count('\s+').lt(3)] X Y 1 1 An apple 2 2 glass of water ```
49,930
I've encountered a strange problem with the snap during transform setting, where it seems to be being ignored. I've tried toggling it on/off, using the different snap modes (to vertex, edge, face, etc), snap targets, but the behavior that I previously had (being able to drag a vertex towards another and have it snap) ...
2016/04/01
[ "https://blender.stackexchange.com/questions/49930", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/23272/" ]
The reason why it does not seem to work is that the mouse cursor is not hovering exactly over the vertex which is to snap. --- 1. Enable *Snap during transform* by clicking on the red Magnet symbol or by pressing `Shift` + `Tab`. 2. Choose *Vertex* as Snap Element 3. Enable *Snap onto itself* [![enter image descrip...
I came here with the same problem and found my solution in the comments so I will add it as an answer. "Do you have Snap to itself option activated which is just to the right of snap buttons ? It's not seen on your gif. – Mr Zak Apr 1 at 15:05" I did have Snap to itself deactivated. After activating it snap started w...
49,930
I've encountered a strange problem with the snap during transform setting, where it seems to be being ignored. I've tried toggling it on/off, using the different snap modes (to vertex, edge, face, etc), snap targets, but the behavior that I previously had (being able to drag a vertex towards another and have it snap) ...
2016/04/01
[ "https://blender.stackexchange.com/questions/49930", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/23272/" ]
The reason why it does not seem to work is that the mouse cursor is not hovering exactly over the vertex which is to snap. --- 1. Enable *Snap during transform* by clicking on the red Magnet symbol or by pressing `Shift` + `Tab`. 2. Choose *Vertex* as Snap Element 3. Enable *Snap onto itself* [![enter image descrip...
One importante thing about the snap transform. It doesn't work if you display a Subdivision Surface Modifier. Maybe here is the only reason why you encountered this issue.
49,930
I've encountered a strange problem with the snap during transform setting, where it seems to be being ignored. I've tried toggling it on/off, using the different snap modes (to vertex, edge, face, etc), snap targets, but the behavior that I previously had (being able to drag a vertex towards another and have it snap) ...
2016/04/01
[ "https://blender.stackexchange.com/questions/49930", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/23272/" ]
The reason why it does not seem to work is that the mouse cursor is not hovering exactly over the vertex which is to snap. --- 1. Enable *Snap during transform* by clicking on the red Magnet symbol or by pressing `Shift` + `Tab`. 2. Choose *Vertex* as Snap Element 3. Enable *Snap onto itself* [![enter image descrip...
And check Proportional Editing mode is Disabled. Snapping doesnt work with it :) [![enter image description here](https://i.stack.imgur.com/iVO8A.png)](https://i.stack.imgur.com/iVO8A.png)
49,930
I've encountered a strange problem with the snap during transform setting, where it seems to be being ignored. I've tried toggling it on/off, using the different snap modes (to vertex, edge, face, etc), snap targets, but the behavior that I previously had (being able to drag a vertex towards another and have it snap) ...
2016/04/01
[ "https://blender.stackexchange.com/questions/49930", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/23272/" ]
And check Proportional Editing mode is Disabled. Snapping doesnt work with it :) [![enter image description here](https://i.stack.imgur.com/iVO8A.png)](https://i.stack.imgur.com/iVO8A.png)
I came here with the same problem and found my solution in the comments so I will add it as an answer. "Do you have Snap to itself option activated which is just to the right of snap buttons ? It's not seen on your gif. – Mr Zak Apr 1 at 15:05" I did have Snap to itself deactivated. After activating it snap started w...
49,930
I've encountered a strange problem with the snap during transform setting, where it seems to be being ignored. I've tried toggling it on/off, using the different snap modes (to vertex, edge, face, etc), snap targets, but the behavior that I previously had (being able to drag a vertex towards another and have it snap) ...
2016/04/01
[ "https://blender.stackexchange.com/questions/49930", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/23272/" ]
And check Proportional Editing mode is Disabled. Snapping doesnt work with it :) [![enter image description here](https://i.stack.imgur.com/iVO8A.png)](https://i.stack.imgur.com/iVO8A.png)
One importante thing about the snap transform. It doesn't work if you display a Subdivision Surface Modifier. Maybe here is the only reason why you encountered this issue.
44,893
I have read many times that sensitive data should never be stored in a transaction, but, specifically, how would the value of a state variable be read if marked `private`?
2018/04/05
[ "https://ethereum.stackexchange.com/questions/44893", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/8771/" ]
For the example contract you gave, it looks like there's a `bytes32` state variable at slot 1 with the value "A very strong secret password :)". I found this by just calling `getStorageAt` a couple times: ``` > web3.eth.getStorageAt('0x6260319bcbcbf33f84397ae0000e49b0f50ee075', 0, (e, v) => console.log(v)) 0x00000000...
Any contract code deployed to the blockchain can be read/viewed by anyone. This includes variables/functions declared `private` The only thing `private` does is restrict access of that variable/function to the contract it is declared within. From the docs:[![enter image description here](https://i.stack.imgur.com/RFN8...
38,863,567
In a makefile, there is a command line: ``` COUNT=`grep -e "->" < "$(SOME_DIR)/count.log" | wc -l` ; ``` Here I want to know, if the < occur in this command represent output redirect,and if the count.log file is empty, should it report a error info. Thanks,
2016/08/10
[ "https://Stackoverflow.com/questions/38863567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6498328/" ]
With **`Intent.getStringExtra()`** we get the Bundled string data directly from the intent object. To be precise, we can get the string data from intent with **`Bundle`** object like this: ``` // Call from received activity or component. Bundle extras = getIntent().getExtras(); String value1 = extras.getString("OUR_...
The main difference is that by using the Intent, you'll prevent a NullPointerException from `getIntent().getExtras()` possibly returning null when there is no extras to get. And `intent.getStringExtra()` will simply return null as the default value. Otherwise, the Intent method is simply a shortcut to getting the Bun...
38,863,567
In a makefile, there is a command line: ``` COUNT=`grep -e "->" < "$(SOME_DIR)/count.log" | wc -l` ; ``` Here I want to know, if the < occur in this command represent output redirect,and if the count.log file is empty, should it report a error info. Thanks,
2016/08/10
[ "https://Stackoverflow.com/questions/38863567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6498328/" ]
With **`Intent.getStringExtra()`** we get the Bundled string data directly from the intent object. To be precise, we can get the string data from intent with **`Bundle`** object like this: ``` // Call from received activity or component. Bundle extras = getIntent().getExtras(); String value1 = extras.getString("OUR_...
You can set `Extra` or `Extras` by the following methods : Method 1 : ``` Bundle bundle = new Bundle(); bundle.putString("userName", "Noor"); bundle.putString("id", "123"); Intent intent = new Intent(this, Admin.class); intent.putExtras(bundle); startActivity(intent); ``` Met...
38,863,567
In a makefile, there is a command line: ``` COUNT=`grep -e "->" < "$(SOME_DIR)/count.log" | wc -l` ; ``` Here I want to know, if the < occur in this command represent output redirect,and if the count.log file is empty, should it report a error info. Thanks,
2016/08/10
[ "https://Stackoverflow.com/questions/38863567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6498328/" ]
The main difference is that by using the Intent, you'll prevent a NullPointerException from `getIntent().getExtras()` possibly returning null when there is no extras to get. And `intent.getStringExtra()` will simply return null as the default value. Otherwise, the Intent method is simply a shortcut to getting the Bun...
You can set `Extra` or `Extras` by the following methods : Method 1 : ``` Bundle bundle = new Bundle(); bundle.putString("userName", "Noor"); bundle.putString("id", "123"); Intent intent = new Intent(this, Admin.class); intent.putExtras(bundle); startActivity(intent); ``` Met...
7,378,532
I use gdb-many-windows in emacs as normal user. But the program need to run as root. Can i change to root in emacs before run gdb-many-windows? Is there other way to solve this problem? Update: Thanks all.
2011/09/11
[ "https://Stackoverflow.com/questions/7378532", "https://Stackoverflow.com", "https://Stackoverflow.com/users/407284/" ]
When you do `Meta-X gdb`, `emacs` allows you to change the `gdb` command it will invoke. Just change it to `sudo gdb --annotate=3 ...` Update: as matt comments, this is still quite insecure. Better make it ``` sudo /usr/bin/gdb -ex 'set auto-load-scripts no' --annotate=3 ... ``` An even better approach might be to...
One possible solution is to run emacs as root, which will cause gdb (and any other process you spawn) to run as root.
7,378,532
I use gdb-many-windows in emacs as normal user. But the program need to run as root. Can i change to root in emacs before run gdb-many-windows? Is there other way to solve this problem? Update: Thanks all.
2011/09/11
[ "https://Stackoverflow.com/questions/7378532", "https://Stackoverflow.com", "https://Stackoverflow.com/users/407284/" ]
A solution not mentioned here is to have your build script set the setuid bit on your binary and set the ownership to root ``` chmod u+s binaryname chmod g+s binaryname chown root:root binaryname ``` that's probably more secure then either of the two answers (although it'll let anybody that has execute permission ru...
One possible solution is to run emacs as root, which will cause gdb (and any other process you spawn) to run as root.
7,378,532
I use gdb-many-windows in emacs as normal user. But the program need to run as root. Can i change to root in emacs before run gdb-many-windows? Is there other way to solve this problem? Update: Thanks all.
2011/09/11
[ "https://Stackoverflow.com/questions/7378532", "https://Stackoverflow.com", "https://Stackoverflow.com/users/407284/" ]
When you do `Meta-X gdb`, `emacs` allows you to change the `gdb` command it will invoke. Just change it to `sudo gdb --annotate=3 ...` Update: as matt comments, this is still quite insecure. Better make it ``` sudo /usr/bin/gdb -ex 'set auto-load-scripts no' --annotate=3 ... ``` An even better approach might be to...
A solution not mentioned here is to have your build script set the setuid bit on your binary and set the ownership to root ``` chmod u+s binaryname chmod g+s binaryname chown root:root binaryname ``` that's probably more secure then either of the two answers (although it'll let anybody that has execute permission ru...
7,378,532
I use gdb-many-windows in emacs as normal user. But the program need to run as root. Can i change to root in emacs before run gdb-many-windows? Is there other way to solve this problem? Update: Thanks all.
2011/09/11
[ "https://Stackoverflow.com/questions/7378532", "https://Stackoverflow.com", "https://Stackoverflow.com/users/407284/" ]
When you do `Meta-X gdb`, `emacs` allows you to change the `gdb` command it will invoke. Just change it to `sudo gdb --annotate=3 ...` Update: as matt comments, this is still quite insecure. Better make it ``` sudo /usr/bin/gdb -ex 'set auto-load-scripts no' --annotate=3 ... ``` An even better approach might be to...
It seems there is a way to do this with emacs 25 without tinkering with sudoers. You need to got to any buffer in emacs (I usually use a file from my project), do 'M-x cd', select '/sudo::/' - this changes the default directory. Then, when you run 'M-x gdb', gdb will run under sudo (you will be prompted for your passwo...
7,378,532
I use gdb-many-windows in emacs as normal user. But the program need to run as root. Can i change to root in emacs before run gdb-many-windows? Is there other way to solve this problem? Update: Thanks all.
2011/09/11
[ "https://Stackoverflow.com/questions/7378532", "https://Stackoverflow.com", "https://Stackoverflow.com/users/407284/" ]
A solution not mentioned here is to have your build script set the setuid bit on your binary and set the ownership to root ``` chmod u+s binaryname chmod g+s binaryname chown root:root binaryname ``` that's probably more secure then either of the two answers (although it'll let anybody that has execute permission ru...
It seems there is a way to do this with emacs 25 without tinkering with sudoers. You need to got to any buffer in emacs (I usually use a file from my project), do 'M-x cd', select '/sudo::/' - this changes the default directory. Then, when you run 'M-x gdb', gdb will run under sudo (you will be prompted for your passwo...
15,839,190
I realize this sounds simple, and probably is... Say this the code within main(), which is inside of a loop: ``` System.out.println(num[i]+"\t "+qty[i]+"\t "+money.format(price[i])+"\t"+money.format(value[i])+"\t"+reorder[i]); ``` with the total captured here: <http://maradastudios.ucoz.com/school/Capture.p...
2013/04/05
[ "https://Stackoverflow.com/questions/15839190", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2249886/" ]
Something like ``` String.format("%10.2f", yourFloat) // or System.out.format("%10.2f", yourFloat) ``` Will print a 10-character wide (including decimal) string, with two numeric characters after the decimal. ([Docs](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#format%28java.lang.String,%20java.la...
``` Formatter formatter = new Formatter(); System.out.println(formatter.format("%20s %20s %20s %20s %20s", "Title*", "Title*", "Title*", "Title*", "Title*")); for (int i = 0; i < 10; i++) { formatter = new Formatter(); System.out.println(formatter.format("%20s %20s %20s %20s %20s", num[i],qty[...
47,697,893
I'm building a LibGDX game and need to zoom the camera in and out. But when I do `camera.zoom = 1.2f;`, it just 'jumps' to that value. Instead, I want to have a smooth zoom. **My question:** What's the best way to smoothly zoom? I want to zoom like this graph below. `y=0` is the start `cam.zoom`, `y=100` is the desir...
2017/12/07
[ "https://Stackoverflow.com/questions/47697893", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9043543/" ]
Simplest way I know is use a countdown with an Interpolation. ``` // member variables: float timeToCameraZoomTarget, cameraZoomTarget, cameraZoomOrigin, cameraZoomDuration; private float zoomTo (float newZoom, float duration){ cameraZoomOrigin = camera.zoom; cameraZoomTarget = newZoom; timeToCameraZoomTar...
You can use the MathUtils.[lerp](https://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/math/MathUtils.html#lerp-float-float-float-) method. **Example:** ``` MathUtils.lerp(currentZoom,targetZoom,progress); ``` Increase the progress value to change faster or lower to slow down speed the value changes.
38,546,956
I have written some code that asks the user how many numbers they want to input. The program then prints that number of statements asking for a number in each new line and then prints out the array at the end. How would I print the largest number and then on new line print the array sequence with that number at the end...
2016/07/23
[ "https://Stackoverflow.com/questions/38546956", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6630188/" ]
Don't remove items from a list while iterating over it; iteration will [skip items](https://stackoverflow.com/questions/17299581/loop-forgets-to-remove-some-items) as the iteration index is not updated to account for elements removed. Instead, *rebuild* the list minus the items you want removed, with a [list comprehen...
Use a `while` loop and change the iterator as you need it: ``` obj = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] # remove all items that are smaller than 5 index = 0 # while index in range(len(obj)): improved according to comment while index < len(obj): if obj[index] < 5: obj.pop(index) # do not increase the ...
4,715,978
I created an RTF file using Word 2007. I want to insert merge fields that can be parsed and merged with database info at a later stage. The document contained the phrase 'Dear [salutation] [surname] How are you?'. I then edited the [surname] part to say [lastname]. If I now view the rtf source it contains loads of unwa...
2011/01/17
[ "https://Stackoverflow.com/questions/4715978", "https://Stackoverflow.com", "https://Stackoverflow.com/users/187182/" ]
In the end I used the System.Windows.Forms.RichTextBox to solve the problem, as below: ``` public class RTF { /// <summary> /// Merge the merge data with the target RTF document /// </summary> /// <param name="byteStream">Original RTF document</param> /// <param name="mergeD...
You can use Regular expression expressions to complete this merge process. I have created a blog post about how this can be done. [Using regular expression to merge database content into Rich Text format template documents](http://tech.humlesite.eu/2017/01/13/using-regular-expression-to-merge-database-content-into-ri...
54,175,990
I have created Pipeline in GitLabs and I am using docker as gitlab-runner. I want to push Jekyll website on s3 website. And to do so, I am using s3\_website gem. I have 4 stages defined in my pipeline. Where I am building Jekyll, creating Artifacts using Gulp, executing test on my jekyll site and then deploying. All s...
2019/01/14
[ "https://Stackoverflow.com/questions/54175990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1567877/" ]
We ran into this same error on CircleCI. If I understand correctly, the s3\_website gem wraps a Java .jar that's using JRuby 1.7, and something must have changed in one of the Docker images or Ruby gems that causes it to start inheriting the system's Ruby 2+ path. As a result, its JRuby 1.7 tries to load Ruby gems that...
Same error message but different solution. The root of my problem was that the `S3_ACCESS_KEY_ID` wasn't set properly. I source'd my `.env` file ``` source .env ``` And that loaded the access key variable and the deploy worked.
2,104,523
> > > > > > Known that > > $$a + b + c = 0$$ > > $$a^3 + b^3 + c^3 = 27$$ > > What is the value of $abc?$ > > > > > > A.) 1 > > > > > > B.) 0 > > > > > > C.) 7 > > > > > > D.) 8 > > > > > > E.) 10 > > > > > > > > > --- **My Work:** $$a + b = -c$$ $$a + c = -b$$ $$b + c = -a$$ Then $$(a + b + c)(...
2017/01/19
[ "https://math.stackexchange.com/questions/2104523", "https://math.stackexchange.com", "https://math.stackexchange.com/users/406858/" ]
No, the question is wrong, and your answer is right. However, it might be easier by recalling the identity $$a^3+b^3+c^3-3abc=(a+b+c)(a^2+b^2+c^2-ab-bc-ca)$$ From $a+b+c=0$, we have $abc=9$.
Your solution is correct. $(a+b+c)^3=(a^3+b^3+c^3)+3a(b^2+c^2)+3b(a^2+c^2)+3c(a^2+b^2)+6abc$ $\implies 0=27+3ab^2+3ac^2+3ba^2+3bc^2+3ca^2+3cb^2+6abc$ $\implies 0 = 27+3b^2(a+c)+3a^2(b+c)+3c^2(a+b)+6abc$ $\implies 0 = 27+3b^2(-b)+3a^2(-a)+3c^2(-c)+6abc$ $\implies 0 = 27 - 3(a^3+b^3+c^3) +6abc$ $\implies 0 = 27 - 8...
2,104,523
> > > > > > Known that > > $$a + b + c = 0$$ > > $$a^3 + b^3 + c^3 = 27$$ > > What is the value of $abc?$ > > > > > > A.) 1 > > > > > > B.) 0 > > > > > > C.) 7 > > > > > > D.) 8 > > > > > > E.) 10 > > > > > > > > > --- **My Work:** $$a + b = -c$$ $$a + c = -b$$ $$b + c = -a$$ Then $$(a + b + c)(...
2017/01/19
[ "https://math.stackexchange.com/questions/2104523", "https://math.stackexchange.com", "https://math.stackexchange.com/users/406858/" ]
No, the question is wrong, and your answer is right. However, it might be easier by recalling the identity $$a^3+b^3+c^3-3abc=(a+b+c)(a^2+b^2+c^2-ab-bc-ca)$$ From $a+b+c=0$, we have $abc=9$.
if $a+b+c=0$ then , $a^3+b^3+c^3=3abc $ and $ a^3+b^3+c^3=27$ equating both equations $3abc=27$ therefore $abc=9$
2,104,523
> > > > > > Known that > > $$a + b + c = 0$$ > > $$a^3 + b^3 + c^3 = 27$$ > > What is the value of $abc?$ > > > > > > A.) 1 > > > > > > B.) 0 > > > > > > C.) 7 > > > > > > D.) 8 > > > > > > E.) 10 > > > > > > > > > --- **My Work:** $$a + b = -c$$ $$a + c = -b$$ $$b + c = -a$$ Then $$(a + b + c)(...
2017/01/19
[ "https://math.stackexchange.com/questions/2104523", "https://math.stackexchange.com", "https://math.stackexchange.com/users/406858/" ]
Your solution is correct. $(a+b+c)^3=(a^3+b^3+c^3)+3a(b^2+c^2)+3b(a^2+c^2)+3c(a^2+b^2)+6abc$ $\implies 0=27+3ab^2+3ac^2+3ba^2+3bc^2+3ca^2+3cb^2+6abc$ $\implies 0 = 27+3b^2(a+c)+3a^2(b+c)+3c^2(a+b)+6abc$ $\implies 0 = 27+3b^2(-b)+3a^2(-a)+3c^2(-c)+6abc$ $\implies 0 = 27 - 3(a^3+b^3+c^3) +6abc$ $\implies 0 = 27 - 8...
if $a+b+c=0$ then , $a^3+b^3+c^3=3abc $ and $ a^3+b^3+c^3=27$ equating both equations $3abc=27$ therefore $abc=9$
5,825,932
I know where to change the preferences for the Formatter and change the options there. I'm unable to figure out how to get it to format the way I want it to, and would like some assistance, if possible, to format this 'my' way. :) It is currently set to "Wrap where necessary", and this seems like the closest to what I...
2011/04/28
[ "https://Stackoverflow.com/questions/5825932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/156708/" ]
Not a full answer to the question, but: an easy way to force the Eclipse formatter to break the line is to pretend to insert a comment. From time to time I add `//` before a line break, and Eclipse won't revert it, while indenting the next line as expected. So I'd try this: ``` LOG.error(String.format( // "Cr...
You need to edit the Indentation to have a Tab size: 4 On the Line Wrapping tab * set the default indentation for wrapped lines to 1 * Under Function Calls It should be + Wrap where necessary (5 of 5) + Indent on column (5 of 5) I started with the Java Conventions [built-in] and made only those changes and it tur...
5,825,932
I know where to change the preferences for the Formatter and change the options there. I'm unable to figure out how to get it to format the way I want it to, and would like some assistance, if possible, to format this 'my' way. :) It is currently set to "Wrap where necessary", and this seems like the closest to what I...
2011/04/28
[ "https://Stackoverflow.com/questions/5825932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/156708/" ]
Thanks for the input. It doesn't seem that I'll be able to get it exactly how I want. The flexibility just doesn't seem to be there. I have a few other lines which helped guide how the settings I've settled on. For *Arguments* I have *Wrap where necessary* and *Indent on column*. For *Qualified invocations* I set...
Not a full answer to the question, but: an easy way to force the Eclipse formatter to break the line is to pretend to insert a comment. From time to time I add `//` before a line break, and Eclipse won't revert it, while indenting the next line as expected. So I'd try this: ``` LOG.error(String.format( // "Cr...
5,825,932
I know where to change the preferences for the Formatter and change the options there. I'm unable to figure out how to get it to format the way I want it to, and would like some assistance, if possible, to format this 'my' way. :) It is currently set to "Wrap where necessary", and this seems like the closest to what I...
2011/04/28
[ "https://Stackoverflow.com/questions/5825932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/156708/" ]
Thanks for the input. It doesn't seem that I'll be able to get it exactly how I want. The flexibility just doesn't seem to be there. I have a few other lines which helped guide how the settings I've settled on. For *Arguments* I have *Wrap where necessary* and *Indent on column*. For *Qualified invocations* I set...
You need to edit the Indentation to have a Tab size: 4 On the Line Wrapping tab * set the default indentation for wrapped lines to 1 * Under Function Calls It should be + Wrap where necessary (5 of 5) + Indent on column (5 of 5) I started with the Java Conventions [built-in] and made only those changes and it tur...
53,748,118
I am trying to get a modal on my page to get and update its value based on the state of the component, and the update function called onChange. Currently it looks like this: ``` constructor() { this.state = { name: '', } } updatedName = e => { this.setState({ name: e.target.value }) } render() { ...
2018/12/12
[ "https://Stackoverflow.com/questions/53748118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9693462/" ]
One thing that is missing from your repro is the queue description. It's important to note such details as the problem you're experiencing has nothing to do with the client and is most likely either related to the broker or the underlying AMQP library. For non-partitioned queues this setup works fine. It doesn't for p...
You need to `Complete` the message before the `Lock Token` gets expired. Once the Lock Token is expired, you will receive `MessageLockLostException` during the complete operation. I can see that you are delaying the thread execution by 10 seconds for each message. But the messages seems to be fetched at the same point...
31,513,748
I want to add HTML elements before some other HTML elements via a form using jQuery: HTML Code: ``` <div class="main-content"> <h2 class="main-content-header">Projekte</h2> <div class="project-content"> <h3 class="project-header"><img class="collapse toggleBtn" src="icons/arrow_up_bl.png"><img class="...
2015/07/20
[ "https://Stackoverflow.com/questions/31513748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3840611/" ]
Change your js code as follow and it should work just fine. ```js $(document).ready(function() { $('#savebtn').click(function() { var project = $('<div class="project-content">\ <h3 class="project-header"><img class="collapse toggleBtn"\ src="icons/arrow_up_bl.png"><img class="expand toggleBtn"\ src="ic...
You have mistake in your jQuery code; Working code is ```js $(document).ready(function() { $('#savebtn').click(function() { var project = $('<div class="project-content"> <h3 class="project-header"><img class="collapse toggleBtn" src="icons/arrow_up_bl.png"><img class="expand toggleBtn" src="icons/arrow_...
31,513,748
I want to add HTML elements before some other HTML elements via a form using jQuery: HTML Code: ``` <div class="main-content"> <h2 class="main-content-header">Projekte</h2> <div class="project-content"> <h3 class="project-header"><img class="collapse toggleBtn" src="icons/arrow_up_bl.png"><img class="...
2015/07/20
[ "https://Stackoverflow.com/questions/31513748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3840611/" ]
Change your js code as follow and it should work just fine. ```js $(document).ready(function() { $('#savebtn').click(function() { var project = $('<div class="project-content">\ <h3 class="project-header"><img class="collapse toggleBtn"\ src="icons/arrow_up_bl.png"><img class="expand toggleBtn"\ src="ic...
``` $(document).ready(function() { $('#savebtn').click(function() { var project = $('<div class="project-content"> <h3 class="project-header"><img class="collapse toggleBtn" src="icons/arrow_up_bl.png"><img class="expand toggleBtn" src="icons/arrow_down_bl.png">Test</h3> <div class="project-wrapper"> ...
311,597
At the moment, I am trying to work on a simple integral, involving an absolute value function. However, I am not just trying to merely solve it; I am undertaking to write, in detail, of everything I am doing. --- So, the function is $f(x) = |x^2 + 3x - 4|$. I know that this isn't an algebraic-like function, so we can...
2013/02/22
[ "https://math.stackexchange.com/questions/311597", "https://math.stackexchange.com", "https://math.stackexchange.com/users/43741/" ]
Let us use your example to illustrate. If $x<-4$, then $x+4<0$ and $x-1<0$ so their product is positive. If $-4<x<1$, then $x+4>0$ and $x-1<0$ so their product is negative. If $x>1$, then $x+4>0$ and $x-1>0$ so their product is positive. The zeros help us split up the real line into these intervals where the individual...
Since polynomials and absolute value of continuous functions are continuous , the zeros are the points for possible sign change. Then you can write piecewisely your function and integrate..
311,597
At the moment, I am trying to work on a simple integral, involving an absolute value function. However, I am not just trying to merely solve it; I am undertaking to write, in detail, of everything I am doing. --- So, the function is $f(x) = |x^2 + 3x - 4|$. I know that this isn't an algebraic-like function, so we can...
2013/02/22
[ "https://math.stackexchange.com/questions/311597", "https://math.stackexchange.com", "https://math.stackexchange.com/users/43741/" ]
Let us use your example to illustrate. If $x<-4$, then $x+4<0$ and $x-1<0$ so their product is positive. If $-4<x<1$, then $x+4>0$ and $x-1<0$ so their product is negative. If $x>1$, then $x+4>0$ and $x-1>0$ so their product is positive. The zeros help us split up the real line into these intervals where the individual...
Continuous function does not change sign between two consecutive zeroes.
72,342,581
I am trying to authenticate a username and password in my API controller. ```cs private User? Authenticate(UserLogin userLogin) { string username = userLogin.Username; string password = userLogin.Password; var currentUser = _db.User.FirstOrDefault(a => a.Username.ToLower() == username.ToLower() &&...
2022/05/23
[ "https://Stackoverflow.com/questions/72342581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12783054/" ]
Because you have a hard-coded activityCost and activityDeposit (or obtained from elsewhere), there's no need to send them to the database at all. Just get the SUM() of the payments, then in your single-row-per-group output, do the math there, like: #activityCost - activityDeposit - expense.balance# And expense query's...
Your queries are more complicated than necessary. This will get your data: ``` select fname, lname, sum(buspayamount) as AmountPaid from name join bustrip on name.foiid = bustrip.busfoiid where whatever, maybe a date range group by fname, lname ``` This will display it: ``` <table> <tr> table headers go here </tr> ...
63,099
I can't find Web Analytics service. It isn't in Services on Server. In Site Actions there is " Site Collection Web Analytics reports, Site Web Analytics reports " And it keeps saying > > "A web analytics report is not available for this site. Usage > processing may be disabled on this server or the usage data fo...
2013/03/26
[ "https://sharepoint.stackexchange.com/questions/63099", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/11153/" ]
The Web Analytics report takes sometime to build as the usage data propagates itself after the service is enabled and configured. In 2013, this does not show in the manage services on server page in central admin unlike SharePoint 2010. Additionally, check your timer jobs section for the timer job "Microsoft SharePoin...
Techincally, SharePoint 2013 has web analytics reports...but they're a trimmed-down version of the reports available in SP 2010. Here's the location of the reports: <http://blogs.msdn.com/b/chandru/archive/2013/08/31/sharepoint-2013-web-analytics-report-where-is-it.aspx> We use Angelfish Software for web analytics wi...