text
stringlengths 36
35k
| label
class label 2
classes | source
stringclasses 3
values | tokens_length
int64 128
4.1k
| text_length
int64 36
35k
|
---|---|---|---|---|
IF function for currency exchange. <p>I need to use an IF function in excel that calculates how much an item would cost in a different country. Image 1 has the cost price of two different countries and also where the new cost needs to go. In image two (which is also in a different sheet) the first row in the third column says AD now that is the exchange rate that needs to go into image one where it says cost price (AU). Now if I change that AD to SV it is suppose to change the cost price (AU) in image 1. The IF function includes rounding to 2 decimal places into each calculation of the IF function and error checking.</p>
<p><a href="https://i.stack.imgur.com/UDs7c.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UDs7c.png" alt="image 1"></a></p>
<p><a href="https://i.stack.imgur.com/9aI7D.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9aI7D.png" alt="image 2"></a></p>
<p>I hope this makes sense and any help would be much appreciated! </p>
| 0non-cybersec
| Stackexchange | 290 | 994 |
How do I find the mouse button properties tab when Windows 8 defaults to the "Mouse and Keyboard Center"?. <p>I am trying to switch my primary and secondary buttons on my mouse. This used to not be a problem for me. I would go to "change mouse settings" and click the "button" tab.</p>
<p>Now, however, I see a new dialog window that doesn't make sense to me that asks for the "Mouse and Keyboard Center." Clicking on this opens to a new window that says that my mouse is not supported.</p>
<p>Does anyone know how to get to this old button tab to fix this problem?</p>
<p><img src="https://i.stack.imgur.com/3RJfJ.png" alt="Screenshot"></p>
| 0non-cybersec
| Stackexchange | 188 | 655 |
Problems getting VMware Server to work on Ubuntu 9.10. <p>I'm trying to get VMware Server 2.0.2 (64-bit version) to work on my Ubuntu workstation. </p>
<p>However, the install script (<code>$ sudo ./vmware-install.pl</code>) runs into problems with the kernel modules:</p>
<pre><code>[...]
What is the location of the directory of C header files that match your running
kernel? [/lib/modules/2.6.31-14-generic/build/include]
Extracting the sources of the vmmon module.
Building the vmmon module.
Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config4/vmmon-only'
make -C /lib/modules/2.6.31-14-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.31-14-generic'
CC [M] /tmp/vmware-config4/vmmon-only/linux/driver.o
In file included from /tmp/vmware-config4/vmmon-only/linux/driver.c:31:
/tmp/vmware-config4/vmmon-only/./include/compat_wait.h:78: error: conflicting types for ‘poll_initwait’
include/linux/poll.h:70: note: previous declaration of ‘poll_initwait’ was here
In file included from /tmp/vmware-config4/vmmon-only/./include/vmware.h:38,
from /tmp/vmware-config4/vmmon-only/linux/driver.c:99:
/tmp/vmware-config4/vmmon-only/./include/vm_basic_types.h:108:7: warning: "__FreeBSD__" is not defined
In file included from /tmp/vmware-config4/vmmon-only/./include/vcpuset.h:103,
from /tmp/vmware-config4/vmmon-only/./include/modulecall.h:37,
from /tmp/vmware-config4/vmmon-only/./common/vmx86.h:33,
from /tmp/vmware-config4/vmmon-only/linux/driver.h:29,
from /tmp/vmware-config4/vmmon-only/linux/driver.c:101:
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:329:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:333:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:401:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:407:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:460:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:506:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:551:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:595:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:640:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:684:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:729:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:945:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config4/vmmon-only/./include/vm_atomic.h:947:7: warning: "_MSC_VER" is not defined
[...]
/tmp/vmware-config4/vmmon-only/./include/vm_asm_x86.h:922:7: warning: "_MSC_VER" is not defined
In file included from /tmp/vmware-config4/vmmon-only/./include/vm_asm.h:41,
from /tmp/vmware-config4/vmmon-only/linux/driver.c:103:
/tmp/vmware-config4/vmmon-only/./include/vm_asm_x86_64.h:56:7: warning: "_MSC_VER" is not defined
In file included from /tmp/vmware-config4/vmmon-only/linux/driver.c:119:
/tmp/vmware-config4/vmmon-only/./common/hostif.h:53:7: warning: "WINNT_DDK" is not defined
/tmp/vmware-config4/vmmon-only/linux/driver.c: In function ‘LinuxDriverSyncCallOnEachCPU’:
/tmp/vmware-config4/vmmon-only/linux/driver.c:1423: error: too many arguments to function ‘smp_call_function’
/tmp/vmware-config4/vmmon-only/linux/driver.c: In function ‘LinuxDriver_Ioctl’:
/tmp/vmware-config4/vmmon-only/linux/driver.c:1987: error: ‘struct task_struct’ has no member named ‘euid’
/tmp/vmware-config4/vmmon-only/linux/driver.c:1987: error: ‘struct task_struct’ has no member named ‘uid’
/tmp/vmware-config4/vmmon-only/linux/driver.c:1988: error: ‘struct task_struct’ has no member named ‘fsuid’
/tmp/vmware-config4/vmmon-only/linux/driver.c:1988: error: ‘struct task_struct’ has no member named ‘uid’
/tmp/vmware-config4/vmmon-only/linux/driver.c:1989: error: ‘struct task_struct’ has no member named ‘egid’
/tmp/vmware-config4/vmmon-only/linux/driver.c:1989: error: ‘struct task_struct’ has no member named ‘gid’
/tmp/vmware-config4/vmmon-only/linux/driver.c:2007: error: too many arguments to function ‘smp_call_function’
make[2]: *** [/tmp/vmware-config4/vmmon-only/linux/driver.o] Error 1
make[1]: *** [_module_/tmp/vmware-config4/vmmon-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.31-14-generic'
make: *** [vmmon.ko] Error 2
make: Leaving directory `/tmp/vmware-config4/vmmon-only'
Unable to build the vmmon module.
Execution aborted.
</code></pre>
<p>Am I missing some required packages? Any other ideas?</p>
<p>This is 64-bit Ubuntu 9.10 (Karmic Koala). <code>uname -a</code> returns <code>Linux hostname 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:05:01 UTC 2009 x86_64 GNU/Linux</code>.</p>
<p><strong>Edit</strong>: <a href="https://superuser.com/questions/97276/problems-getting-vmware-server-2-0-to-work-on-ubuntu-9-10/97285#97285">Got VMware Server 2.0.2 working</a>. However, if you have some tips on getting <strong>VMware Server 1.0.x</strong> to work with latest Ubuntu <em>easily</em> (without having to compile the whole kernel, for instance), please share those too! My first impression is that I don't like 2.0 at all, and would much rather use 1.0.x if only I got it working.</p>
| 0non-cybersec
| Stackexchange | 2,066 | 5,587 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
Inter vlan routing not working. <p>Apologies if any details not clear as I'm not a network expert.</p>
<p>I have a Procurve 3500yl layer-3 switch. I am trying to make two VLANs and get a PC in one VLAN to connect to the other VLAN.</p>
<p>Below is the running configuration from the switch:</p>
<pre><code>Running configuration:
; J8692A Configuration Editor; Created on release #K.14.41
hostname "ProCurve Switch 3500yl-24G"
module 1 type J86xxA
ip routing
vlan 1
name "DEFAULT_VLAN"
untagged 9-24
no untagged 1-8
no ip address
exit
vlan 20
name "local"
untagged 5-8
ip address 192.168.1.1 255.255.255.0
exit
vlan 10
name "operator"
untagged 2-4
ip address 10.11.156.31 255.255.255.0
tagged 1
exit
ip route 10.11.156.0 255.255.255.0 vlan 10
ip route 192.168.1.0 255.255.255.0 vlan 20
snmp-server community "public" unrestricted
</code></pre>
<p>I am trying to get PC (IP address: <code>192.168.1.2</code>) to ping IP address <code>10.11.156.1</code> which is another router connected to VLAN 10.</p>
<p>I can ping <code>10.11.156.31</code> which is the VLAN address, but I can't ping <code>10.11.156.1</code>. Do you have any idea what is the problem here?</p>
| 0non-cybersec
| Stackexchange | 442 | 1,217 |
As an experienced OO developer, I'm trying to select a language for a web project that'll be fun, educational, but also enhance my resume. I have an idea for a website that I'd like to get started on, and I'd love some thoughts/advice! I'm in a predicament because the languages I think I'd enjoy the most have little demand in industry.
I have years of OO experience. I'm well versed in Ruby, Java, PHP, .NET, and Javascript. I have decent experience with Python and C, and dipped my toes in Haskell a few years ago (forgot most of it). I'd love to learn new language and more so, new development techniques and practices. Unfortunately, it seems most job posting around here request J2EE or .NET experience. I've narrowed my options to:
* **Ruby**: I can get something up and running quickly due to my experience, and I know several frameworks/libraries/APIs. I enjoy the language, but there's only so much more I can learn and I may get bored after a while.
* **C#**: I'd consider it because it's similar to Java, I have experience with VB.NET (current job), and potential employment opportunities. Cons are that I prefer *nix development and I'd have to spend $$$ to get started (Visual Studio, and setup a Windows box for development--I work on a Mac/Linux from home).
* **Java**: I know the language well, but haven't done web development on it yet. I'd likely go with Spring MVC and Hibernate. Pros are that a lot of corporations need experienced J2EE developers. There's also great community support, mature libraries, and great performance. Great IDE support, mature libraries, and static typing are also huge pluses.
* **Python**: Looks to be the favorite of the dynamic languages (excluding PHP) in industry. It's also a fun language. The learning curve won't be too high due to my experience with Ruby. Like Ruby, I'll miss good IDE support and compile-time checking.
* **Scala**: An OO language with a functional emphasis. I'm a big fan of the functional way of programming (immutability, no side effects). The fact is runs on the JVM is a huge plus. I hear there is decent IDE support for it as well. The con is the learning curve (I hear the type system is very complex, and some native Scala libraries do not implement Java interfaces). I know nothing about this language, and I don't know how easy is it to learn. The Lift framework looks very interesting as well, a change from MVC that I'm used to. I hear several people suggesting it will be the "new Java".
* **Haskell**: I briefly taught myself this language a few years back using a couple popular tutorials and loved it. However, I'll have to relearn the language and learn how to build a website using it. I don't know how mature the frameworks are for Haskell web-development. This is likely the least used language in industry that I've listed and it probably won't be a significant addition to my resume for potential employers. On the other side, I love the idea of a pure functional language and had a blast learning it a couple years back. Compile-time type checking was awesome as well.
* **Clojure**: I've read some documentation on this, and wrote a few trivial scripts. Like Haskell, I think I'll enjoy learning this language a lot. This would be my first LISP. Another plus is that it runs on the JVM. However, I've seen reports that performance can be as much as 10x slower than Java, and I think i'll miss compile-time checking that I'd get from Haskell, Java, and Scala (?).
Some criteria when selecting a language:
* Job opportunities: Java/J2EE or C# seem to be the best choices here.
* Education & enjoyment: Clojure, Haskell, or Scala seem to be the most enjoyable and ones I'd learn the most from. Although, I think I'd lean more toward Clojure or Haskell because they are real functional languages.
* PaaS: It'd be nice if the language/framework can be easily deployed to something like GAE, Heroku, etc.
* Web frameworks and libraries: Needs to be mature, well documented, and enjoyable to work with.
* Performance: Java seems to have the upper hand here. I hear GHC is getting really good too and can produce some fast Haskell binaries. Ruby/Python have the disadvantage here. I expect my webapp to use a lot of AJAX so I need response times to be fast.
Thanks guys, I look forward to hearing your thoughts and suggestions!
**TL;DR**: I'm trying to select a language for a new project. I want it to be fun and educational (Clojure, Haskell, Scala), but I also want it to be appealing to potential employers (Java, .NET). Having a hard time selecting one because the criteria seems to be mutually exclusive.
[Edit: formatting] | 0non-cybersec
| Reddit | 1,122 | 4,663 |
Member functions that are sometimes const. <p>I have a class design similar to the following:</p>
<pre><code>class MyClass {
public:
bool IsValid() const;
void MakeValid();
private:
bool CheckValidity(bool fix);
};
bool MyClass::IsValid() const {
// Check validity, but don't fix any problems found. Doesn't work.
return CheckValidity(false);
}
void MyClass::MakeValid() {
// Check validity and fix problems found.
CheckValidity(true);
}
</code></pre>
<p><code>IsValid</code> should be <code>const</code>, because it doesn't make changes. <code>MakeValid</code> should be non-const, because it does make changes. They share the same implementation, <code>CheckValidity</code>, but because <code>CheckValidity</code> may or may not make changes, it can't be marked <code>const</code>.</p>
<p>What's the best way to handle this? The simplest approach is to just use <code>const_cast</code>, but casting away const feels a bit dirty:</p>
<pre><code>bool MyClass::IsValid() const {
// Check validity, but don't fix any problems found.
return const_cast<MyClass*>(this)->CheckValidity(false);
}
</code></pre>
<p>Is this a legitimate use of <code>const_cast</code>? Is there a better approach?</p>
| 0non-cybersec
| Stackexchange | 378 | 1,245 |
Get last date from a column on a different sheet. <p>I'm looking for help on the following:</p>
<p>How do I get the last date from a column in sheet1 returned in a cell of sheet2</p>
<p>I tried it with:</p>
<pre><code>=FILTER(Sheet1!A:A ; ROW(A:A) =MAX( FILTER(ROW(A:A) ; NOT(ISBLANK(A:A)))))
</code></pre>
<p>but this results in an error</p>
<p>Any suggestions?</p>
| 0non-cybersec
| Stackexchange | 146 | 372 |
LDAP queries for local users. <p>Recently, in the company where I work, we have had a general system crash and we are figuring out the causes. Our machines are configured for LDAP authentication plus some local users in some of them. LDAP authentication works fine but we have found, from the log, that also <strong>for local users there are some LDAP queries</strong> and we think that this could be related to the crash.
I am working on this problem, changing nsswitch.conf, pam modules and so on, but I can't get rid of this LDAP call for local users.
Does anyone have any idea on how to stop LDAP queries for local users?</p>
<p>Thank you very much in advance.</p>
<p>In our machine is installed SuSE Linux 11 SP2 and OpenLDAP 2.4.
This is nsswitch.conf</p>
<pre><code>passwd: compat
group: files ldap
hosts: files dns
networks: files dns
passwd_compat: ldap
group_compat: ldap
</code></pre>
<p><strong>UPDATE</strong></p>
<p>This is the log taken <strong>from the LDAP server</strong> after a login attempt <strong>on another machine</strong> from a user called <strong>guest</strong> which is local to that machine</p>
<pre><code>Jul 29 11:00:45 vmtemplate slapd[2465]: conn=1627 op=1 SRCH base="dc=test,dc=com" scope=2 deref=0 filter="(&(objectClass=posixAccount)(uid=guest))"
Jul 29 11:00:45 vmtemplate slapd[2465]: conn=1627 op=2 SRCH base="dc=test,dc=com" scope=2 deref=0 filter="(&(objectClass=posixGroup)(memberUid=guest))"
Jul 29 11:00:47 vmtemplate slapd[2465]: conn=1008 op=407 SRCH base="dc=test,dc=com"
</code></pre>
| 0non-cybersec
| Stackexchange | 501 | 1,585 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
Complex numbers and proof. <p>I'm having trouble learning and understanding questions relating to complex numbers and was wondering if I can get any help. Thanks in advance for any help I can get! </p>
<p>Given $x$ is a complex number (not $0$), we also have a new complex number $x^{-1}$, called inverse of $x$, so we have the property that $x\cdot x^{-1} = 1$.</p>
<p>a) Prove that this inverse is unique.</p>
<p>b) $x^{-1} = \bar{x}/\lvert x\rvert^2$</p>
<p>c) Prove if $\lvert a\rvert = \lvert b\rvert = \lvert c\rvert = 1$, then $\bar{a} + \bar{b} + \bar{c} = 1/a + 1/b + 1/c$.</p>
| 0non-cybersec
| Stackexchange | 211 | 591 |
oop model Base class design : static and non-static data access. <p>I am trying to make a base class ... tiny framework if you will just for practice </p>
<p>So I start with example of child class because it has less code !! </p>
<pre><code>class User extends Base {
public $id ;
public $username ;
public $email ;
public $password ;
function __construct(){
$this->table_name = 'users';
$this->set_cols(get_class_vars('User'));
}
}
$u = new User;
$u->username = 'jason';
$u->email = '[email protected]';
$u->insert();
</code></pre>
<p>Here is my Base class</p>
<pre><code>class Base {
protected $table_name ;
protected $table_columns ;
protected function set_cols($cols){
unset($cols['table_name']);
unset($cols['table_columns']);
$this->table_columns = array_keys($cols);
}
public function insert(){
$colums = $values = array();
foreach($this->table_columns as $col )
{
if(!$this->$col) continue ;
$values[] = $this->$col ;
$colums[] = $col ;
}
$values = implode(',' , $values);
$colums = implode(',' , $colums);
echo $sql = "INSTER INTO ".$this->table_name ." ($colums)
VALUES ($values) ";
}
}
</code></pre>
<p>Here is the problem , I want to make <code>filter</code> or <code>get</code> method (basically reading from database) static and then return an array of objects from database data </p>
<pre><code> class Base{
static function filter($conditions =array()){
$query_condition = $conditions ; // some function to convert array to sql string
$query_result = "SELECT * FROM ".$this->table_name ." WHERE $query_condition ";
$export = array();
$class = get_called_class();
foreach($query_result as $q )
{
$obj = new $class;
foreach($this->table_columns as $col )
$obj->$col = $q[$col];
$export[] = $obj;
}
return $export;
}
}
$users = User::filter(['username'=>'jason' , 'email'=>'[email protected]']);
</code></pre>
<p>Here is the problem , with <code>filter</code> as static function <code>__construct</code> in <code>User</code> class will not get called and <code>table_columns</code>, <code>table_name</code> will be empty </p>
<p>also in the <code>filter</code> method I can't access them anyway because they are not static ... I can make a dummy <code>User</code> object in the <code>filter</code> method and solve this problems but somehow it doesn't feel right </p>
<p>Basically I have a design problem any suggestion is welcomed </p>
| 0non-cybersec
| Stackexchange | 859 | 2,719 |
How can I concatenate the values from multiple rows in Excel in a single row?. <p>I have an Excel table which displays 2 entities. Because <code>Entity A</code> contains multiple <code>Entity B</code>, I have one row for each combination of A and B, in a <strong>cartesian product</strong>.</p>
<p>What I need is to transform this table in such a way that the columns from <code>Entity A</code> will be distinct, and I need to concatenate the values of <code>Entity B</code>.</p>
<h2>Example</h2>
<p>Here we got 2 tables, the first one is <strong>my original</strong>. On the second one, the first few rows are grouped/concatenated exactly like I need it.</p>
<p><img src="https://i.imgur.com/j2iDGG3.png" alt="image"></p>
<p>What is the best way to achieve this grouping/concatenation?</p>
| 0non-cybersec
| Stackexchange | 241 | 796 |
biblatex: adding entries outside of main .bib file; possibly a 'multiple bibliographies' problem with filecontents package. <p>Is there a way to include additional entries outside of the <code>.bib</code> file in the a bibliography for <code>biblatex</code>? For instance, I have a few web references (http) which I don't want to add in my general <code>.bib</code> file, but only within a particular document (<code>.tex</code> file). Is this possible? I am imagining something which might use the filecontents package like <a href="https://tex.stackexchange.com/questions/60649/using-bibtex-entries-directly-in-tex-file">this</a>, but not sure how this can be done with <code>biblatex</code>.</p>
| 0non-cybersec
| Stackexchange | 195 | 707 |
Insert multiple values in a text field using a "delimiter"?. <p>Let's say I have a <strong>Text</strong> field called "description" inside "products" table.</p>
<p>Inside this field I will store 3 values. I will separate them with two pipes ( <strong>||</strong> ):</p>
<pre><code>requirements:
- bla bla.. (a text)
||
info:
- bla bla.. (a text)
||
specifications:
- bla bla.. (a text)
</code></pre>
<p>I am doing this because it looks better than having 3 <em>different</em> Text fields to do the job (which will increase the table's size).</p>
<p>Is this a bad idea? Should I use 3 different fields? Does 3 text fields really affect database performance?</p>
| 0non-cybersec
| Stackexchange | 214 | 675 |
What is the internal working of an unordered set in C++? What algorithm does it use?. <p>The average case time complexity for search in an unordered set in C++ O(1) but for worst case it is O(n). The same goes for insertion and deletion.</p>
<p>How does that work? The worst case time complexity for search should be when the element is not present in the map. If that takes O(n) time, it means that it tranverses the whole unordered set once. But if that's the case, shouldn't the average case complexity be O(n) as follows:</p>
<pre><code>(1 + 2 + ... + n) / n = (n + 1) / 2
</code></pre>
<p>This means that there must be some other algorithm implemented to search. What's the algorithm?</p>
| 0non-cybersec
| Stackexchange | 194 | 694 |
Call Web API From Application. <p>I have called Web API from ASP.NET page on a button click as below.
This is perfectly working fine though I have read somewhere it will create deadlock as it is not <code>async</code> (due to use of <code>.Result</code> in line <code>client.PostAsJsonAsync(url, sd).Result;</code>)</p>
<p>Please suggest best way to update this code.</p>
<pre><code>private void CallApi(SurveyData sd)
{
using (var client = new HttpClient())
{
string url = ConfigurationManager.AppSettings.Get("url");
client.DefaultRequestHeaders.Accept.Clear();
var response = client.PostAsJsonAsync(url, sd).Result;
if (response.IsSuccessStatusCode)
{
Response.Write("Success");
}
else
{
Response.Write(response.StatusCode + " : Message - " + response.ReasonPhrase);
}
}
}
</code></pre>
| 0non-cybersec
| Stackexchange | 255 | 923 |
Replace the SSN as a means of confidentially identifying a US citizen.. The SSN wasn't originally intended to be a confidential identification number for US citizens, it was just a normal identifier and records keeping mechanism. With so many data breaches at large firms like Target, Anthem, eBay, etc. I've likely had my SSN and personal information stolen multiple times. However unlike a password exploit I can't generate a new SSN and go on living.
**If you were asked as a security professional to design a system to replace the SSN as a means of national identity verification, what would that system look like?** Keep in mind it should be resettable like a password, secure on a national level, and relatively inexpensive to implement over the course of a decade or so. | 1cybersec
| Reddit | 162 | 778 |
For any elliptic curve $E/\mathbb{Q}$, there are infinitely many primes $p$ such that $E$ is ordinary.. <p>Let $E$ be an elliptic curve defined over $\mathbb{Q}$, and fix a Weierstrass equation for $E$ having coefficients in $\mathbb{Z}$. How do I see that there are infinitely many primes $p \in \mathbb{Z}$ such that the reduced curve $E/\mathbb{F}_p$ has Hasse invariant $1$?</p>
<p><a href="https://math.stackexchange.com/users/317822/joe-silverman">Joe Silverman</a> writes the following <a href="https://mathoverflow.net/a/254520/97565">here</a>.</p>
<blockquote>
<p>Elkies and Serre have independent proofs that for every $\epsilon>0$ there is a constant $C_\epsilon>0$ such that
$$
{\#\{p\le X : E/\mathbb{F}_p \text{ is ordinary}\}} \ge C_\epsilon
X^{3/4-\epsilon}.
$$</p>
</blockquote>
<p>However, I just want to know that there are infinitely many ordinary primes, which should be much easier to see.</p>
| 0non-cybersec
| Stackexchange | 307 | 930 |
Turning off other monitors on lock screen in Windows 8.1. <p>In Windows 7, when the PC got locked, the lock screen appeared on the primary monitor and all other monitors connected to the PC got turned off.</p>
<p>(With "turning off", I don't mean turning off per se, just the state when the monitor stops recieving any signal and goes to a sleep mode or something.)</p>
<p>Now, on Windows 8.1 (and possibly on Windows 8 too), when the PC gets locked, the lock screen appears on the primary monitor, but the other monitors are kept running too and they show the background from the lock screen (in my case a solid color). That is a bit annoying and consumes unnecessary power.</p>
<p>Is there a way to make Windows 8.1 turn the other (non-primary) monitors off when the lock screen appears?</p>
<p>Thank you.</p>
| 0non-cybersec
| Stackexchange | 213 | 816 |
Torn as to whether I should buy a preowned phone or wait. Hi everyone,
Apologies if this is in the wrong place, I did find an iPhone help subreddit however it seemed kinda dead :s I figured the guys on this sub should be able to help me though!
So at the moment I am a not-so-proud owner of a Samsung Galaxy Ace. To put it shortly, it's awful. Freezing as I'm currently writing this, no front camera, shuts down by itself 5+ times a day, I could go on. So I've decided I want a new phone. I was looking to buy Android (as it's regarded by most of my friends to be superior to Apple) however an offer came up that I'm now seriously considering. My friend recently bought a OnePlusOne and so is offering me his 64gb iPhone 4S for $250AUD, with box, headphones, charger, everything. Considering my budget for phones is around the $300 mark, and new 8gb 4S's are ~$450, this is a really good offer. He claims there's nothing wrong with it however after fidgeting with his old phone for a bit I found two major issues with the phone.
1. A small crack on the back of the phone. Hidden by a hard case, I fear this crack may either interfere with hardware in the phone or develop into a larger, uglier crack. Is there any possibility of these things happening?
2. A small amount of lag when the phone is woken up (about 1.5 seconds). I'm unsure if this is due to the copious amounts of files and games on the phone currently or if it's a hardware problem. My friend has owned the phone for about 1.5 years if that has anything to do with it.
So as of now, I have a few options. I could keep my crappy phone and save my dosh (ew), buy my friends iPhone, accepting it's flaws in exchange for a cheaper price, and finally, I could just save more money and buy a completely new phone. Any thoughts on what I should do?
| 0non-cybersec
| Reddit | 453 | 1,815 |
Numerical Stability of Halley's Recurrence for Integer $n^{\mathrm{th}}$-Root. <p>tl;dr? See last paragraph.</p>
<p>If I use the initial value $2^{\left(\big\lfloor\lfloor\log_2 x \rfloor/n\big\rfloor + 1\right)}$ with Halley's recurrence in the compact form</p>
<p>$ x_{k+1} = \frac{x_k\Big[A\left(n+1\right) + x_k^n\left(n-1\right) \Big] }{A\left(n-1\right) + x_k^n\left(n+1\right)} $</p>
<p>to evaluate $\lfloor x^{1/n}\rfloor$ with $x,n \in \mathbb{N}$, $x \gg 1$ and $n > 2$ it seems (empirical tests only!) to work. Slowly.</p>
<p>As is the case with all of these methods: the closer the initial value $x_0$ to the actual root, the smaller the amount of iterations needed. Many papers have been written about it, although not many for the integer versions, but a simple refinement can be implemented by observing that the root lies between $2^{\lfloor \lfloor\log_2 x \rfloor / n \rfloor + 1}$ and $2^{\lfloor \lfloor\log_2 x \rfloor / n \rfloor}$ so a simpel arithmetic average of these limits should give a significant decrease in the number of iterations needed and, lo! and behold, it does. Small problem: the algorithm is unstable with that seed. Visible in the following pretty picture with a highly abused y-axis (#iterations, bitsize of root, and absolute error) and the index along the x-axis. The radicand used was $5987^{797}$.</p>
<p><a href="https://i.stack.imgur.com/YEzxc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YEzxc.png" alt="Numebr of Iterations and Error"></a></p>
<p>The range of indices where the error occurs is outside the range where I would use Halley's recurrence and change to bisection. The cut-off point I have choosen is the intersection between the bisection which is linear $ax^{-1}$ and the approximately linear part of the Halley iterations at the beginning $bx$ which puts the intersection at $\sqrt{a/b}$. Some runs with up to $3\,321\,960$ bits (ca. one million decimal digits) showed $\Big\lfloor\sqrt{A_b\left(\left\lfloor\log_2\left(\left\lfloor\log_2 \left(A_b\right) \right\rfloor\right) \right\rfloor + 1\right)}\Big\rfloor$ with $A_b = \left\lfloor\log_2 \left(A\right) \right\rfloor$ to be a good estimate for the big-integer library in use.</p>
<p>Hence my question: is Halley's recurrence, implemented as described above, numerically stable in the range $(3,\Big\lfloor\sqrt{A_b\left(\left\lfloor\log_2\left(\left\lfloor\log_2 \left(A_b\right) \right\rfloor\right) \right\rfloor + 1\right)}\Big\rfloor)$ with the initial value the arithmetic average of $2^{\lfloor \lfloor\log_2 x \rfloor / n \rfloor + 1}$ and $2^{\lfloor \lfloor\log_2 x \rfloor / n \rfloor}$ or not and, much more interesting, why?</p>
| 0non-cybersec
| Stackexchange | 853 | 2,700 |
Is there a clean way to avoid calling a method on nil in a nested params hash?. <p>I'm interested in getting the nested 'name' parameter of a params hash. Calling something like</p>
<pre><code>params[:subject][:name]
</code></pre>
<p>throws an error when params[:subject] is empty. To avoid this error I usually write something like this:</p>
<pre><code>if params[:subject] && params[:subject][:name]
</code></pre>
<p>Is there a cleaner way to implement this?</p>
| 0non-cybersec
| Stackexchange | 143 | 476 |
How to generate a NOT random sample to be sure to preserve distribution properties. <p>Assuming a normal probability density function with mean = $\mu$ and standard deviation = $\sigma$, I know that if I generate randomly many times a number from this pdf, the sample that I will obtain will represent accurately the pdf. Consequently, the quantiles of my sample will describe accurately my true pdf distribution and I will be able to find back $\mu$ and $\sigma$. </p>
<p>However, if i decide to generate only few random numbers (let say $10$ or $20$ times), it is likely to be misleading. </p>
<p>Is there a way to generate NOT random numbers to be sure to create a sample that preserves the distribution specificities? How to sample the pdf to preserve the quantiles with a very small sample? </p>
<p>Thank you !</p>
<p>(I apologize, I'm far from being a mathematician, the vocabulary I use may not be appropriate)</p>
| 0non-cybersec
| Stackexchange | 225 | 927 |
Bigfoot changes hyphenchar for compound words. <p>Bigfoot changes the “hyphen” char for compound words:</p>
<pre><code>\documentclass{article}
\usepackage{bigfoot}
\listfiles
\DeclareNewFootnote[para]{foo}
\begin{document}
\footnotefoo{\rule{9.4cm}{1mm} xx compound-word}
\footnote{\rule{9.4cm}{1mm} xx compound-word}
\end{document}
</code></pre>
<p><img src="https://i.stack.imgur.com/OyMkX.png" alt="enter image description here"></p>
<p>The regular hyphen character (dash) is unchanged. How can I get my dash when using bigfoot/<code>\footnotefoo</code> with an explicit dash on compound words? What causes the problem?</p>
<pre><code>*File List*
article.cls 2007/10/19 v1.4h Standard LaTeX document class
size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
bigfoot.sty 2006/07/15 1.25 makes footnotes work
etex.sty 1998/03/26 v2.0 eTeX basic definition package (PEB)
manyfoot.sty 2005/09/11 v1.10 Many Footnote Levels Package (NCC)
nccfoots.sty 2005/02/03 v1.2 NCC Footnotes Package (NCC)
suffix.sty 2006/07/15 1.5 Variant command support
perpage.sty 2006/07/15 1.12 Reset/sort counters per page
***********
</code></pre>
| 0non-cybersec
| Stackexchange | 409 | 1,176 |
Comprehensive conditional probability question. <p>Bob owns a bakery. It is located on a busy road with a lots of individuals walking by the bakery each day. On average, $\lambda$ individuals go into the bakery per day, the number of individuals entering the bakery follow a Poisson distribution, $N\sim P(\lambda)$. Each person who enters the bakery has a probability $p$ of demanding a loaf of bread. The quantity of loaves demanded, given the number of customers, $N$, follows a Binomial distribution, $X|N \sim Bin(N;\pi)$. Bob sells loaves at a common price of $p$. At dawn, Bob bakes $k$ loaves at a marginal cost of $c$ per loaf and has overhead costs of $F$ per day. At the end of the day, all loaves not sold are thrown away.</p>
<p><strong>(a) Show that the marginal distribution of the demand for loaves, $X$, is a Poisson distribution, $X\sim P(\theta )$, where $\theta =\pi\lambda$.</strong></p>
<p>I was able to show this. I included this part for completeness, in case one requires it to solve subsequent parts.</p>
<p><strong>(b) Sales, $Y$ , are related to demand, $X$, and the daily supply of loaves, $k$, by the relationship $Y = \text{min{$X,k$}}$. Derive the p.m.f. for $Y$ .</strong></p>
<p>This implies that sales equal demand if demand is less than the quantity of loaves available, i.e. $Y=X$ when $X\le k-1$ (noting that $k$ is integer valued). But for demand greater than $k$, demand cannot be met, hence sales then equal the total supply of loaves, $k$, i.e. $Y = k$ for $X\ge k$.</p>
<p>I don't know how to use this to find a pmf for $Y$.</p>
<p><strong>(c) Obtain an expression for the profit random variable, $\Pi (Y|\theta,k)$, as a function of sales, $ Y$, when Bob bakes $k$ loaves, $k$ is a non-negative integer. Hence derive an expression for expected profit when Bob bakes k loaves.</strong></p>
<p>I believe having the answer to (b) is necessary for solving this part of the question, and all subsequent parts.</p>
<p><strong>(d) Bob hires you to figure out the number of loaves he should bake at dawn? Provide your answer to Bob's question, indicating what his expected profit will be, and write a short report explaining your answer.</strong></p>
<p><strong>To answer the question, assume that Bob is risk neutral and wishes to choose the quantity of loaves to bake to maximise his expected profit, and that $\lambda= 20; \pi= 0.7; p=5; c=2 \text{ and } F =10$.</strong></p>
<p><strong>(e) If Bob adopts your solution for the quantity of loaves to bake, $k$, what is the probability that Bob will sell all his loaves on any given day? What is the probability that Bob will suffer a loss on any given day?</strong></p>
| 0non-cybersec
| Stackexchange | 765 | 2,672 |
Algorithm to "de-rasterize" a voxel image of a polyhedron. <p>Rasterizing a polygon in this question consists of creating an array of binary pixels that "represent" the polygon. The reverse of this process is easy to approximate in linear time to the perimeter in pixels. It uses a "detail threshold" D to define how complex the polygon will be. As D decreases, the polygon becomes more detailed.</p>
<p>Keep in mind this is just for polygons and 2D images, not 3D, yet.</p>
<ol>
<li>Remove the inside of the image if there is one, so we have a 1-pixel thick perimeter</li>
<li>Assign an arbitrary "first" pixel as our active pixel, and the first point on our polygon</li>
<li>Iterate in one direction around the image, using each pixel as a "test pixel"</li>
<li>For each test pixel, keep track of the minimum and maximum angle between the active pixel and our test pixels</li>
<li>If the difference between these two angles becomes greater than D*2, create points on the polygon for these two minimum and maximum points</li>
<li>Set the active pixel to whichever of the min/max was second (that is, the furthest clockwise)</li>
<li>From now on, iterate around the image and add another vertex whenever |(angle of previous line segment) - (angle between active/test pixel)| > D. The active pixel becomes the most recently added vertex.</li>
</ol>
<p>This doesn't produce an optimal polygon, but it works. It's the best I could think of, anyway. If you rasterize the result, it would produce something similar to the original image. It could be potentially improved by setting a minimum distance between vertexes.</p>
<p>However, <strong>how could an algorithm like this be extended to 3D</strong>, where the rasterized "image" is 3D/has volume, and we are producing a polyhedron? I'm at a loss as to how to figure this out.</p>
<p>Thanks in advance for the help.</p>
| 0non-cybersec
| Stackexchange | 496 | 1,891 |
Adding pictures to a table. <p>I would like to add pictures to that table. How could I do that? </p>
<pre><code>\documentclass[a4paper, 12pt]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage [french]{babel}
\usepackage{mathptmx}
\begin{document}
\begin{tabular}{|c|c|c|c|c|}
\hline
Titre & Type & Composition & Dimensions & Prix \\
\hline
Title & Peinture & 80 x 120 cm & Acrylique, feutre, fusain & 80 \\
\hline
Title & Sculpture & 80 x 100 cm & 2.3 & 150 \\
\hline
Title & Sculpture & 80 x 100 cm & 2.3 & 150 \\
\hline
\end{tabular}
\end{document}
</code></pre>
| 0non-cybersec
| Stackexchange | 263 | 679 |
Second monitor doesn't wake after kernel update in Fedora Core 20. <p>I have an odd problem with my dual monitor setup. The base system is a Dell 6005 desktop with an ATI Radeon card. My primary monitor is an HP 23", while the second monitor is an HP 20". The primary is connected via VGA, while the second is connected via a DisplayPort-to-VGA adaptor.</p>
<p>With kernel 3.14.9-200.fc20.x86_64, everything works fine.</p>
<p>After updating to kernel 3.15.8-200.fc20.x86_64, the second monitor is no longer taken out of standby (sleep) mode.</p>
<p>xrandr reports two monitors and the output is identical for both kernels.</p>
<p>The only difference I see is that I see the following errors in dmesg when running the 3.15 kernel...</p>
<pre><code>[ 1.914501] [drm:radeon_dp_link_train_cr] *ERROR* clock recovery reached max voltage
[ 1.914502] [drm:radeon_dp_link_train_cr] *ERROR* clock recovery failed
</code></pre>
<p>I found one other post that was similar to this, but there was no solution.</p>
<p>Has anyone else seen and solved this, or can anyone give me a place to look further as far as logs/configs are concerned?</p>
| 0non-cybersec
| Stackexchange | 352 | 1,148 |
A search path is not honored in macOS 10.14.6 (Mojave). <p>I am running macOS 10.14.6 (Mojave, 18G87)</p>
<p>My default shell is Zsh and $<code>PATH</code> is set in <code>.zshrc</code> as follows;</p>
<pre><code>/usr/local/Caskroom/miniconda/base/bin:/usr/local/Caskroom/miniconda/base/condabin:/usr/local/opt/gcc/bin:/usr/local/opt/llvm/bin:/usr/local/bin:/usr/X11/bin:/usr/bin:/bin:/usr/sbin:/sbin
</code></pre>
<p>I use Homebrew to manage packages and as you can see brewed gcc and <code>llvm</code> is a front of <code>/usr/bin</code> where Apple's gcc is. However, for some reasons I don't understand, Mojave sees Appple's gcc in <code>/usr/bi</code>, </p>
<pre><code>which gcc
/usr/bin/gcc
</code></pre>
<p>I'd really appreciate any pointers to address this issue. </p>
| 0non-cybersec
| Stackexchange | 295 | 784 |
Echo GDI Object Count to Command Line or File. <p>I'm ultimately looking for a way to set up an automated alert that will warn me if a process's GDI Object count is approaching the default 10,000 limit. I have a known issue with some software our company uses that causes explorer.exe to have the count build up until it crashes without warning - there's apparently a fix for this in a later version of the software, but we cannot upgrade for reasons beyond my control. My idea is to create a background program/script that will pop up an alert when it sees a GDI count approaching the 10,000 limit. However, the only ways I can seem to view the GDI count is through a GUI either in task manager or Process Explorer - if I could somehow just dump that to a text file automatically I'd be set, but I don't know if that's possible. </p>
<p>I've tried the GDIView software, but our company Antivirus flags it and that is outside my control. </p>
<p>I've downloaded sysinterals, but I can't figure out any way to get one of the command line tools to echo the GDI count I can get in Process Explorer. I've also tried tasklist, but similarly can't find a way to get GDI count out of it. </p>
<p>For reference, I'm on a Windows 10 machine here. I also have the linux subsystem enabled and have the ability to run Ubuntu through that. I am open to doing something in batch or python if that's of any use - though it seems powershell is blocked from running scripts (I might be able to get around that though). </p>
| 0non-cybersec
| Stackexchange | 364 | 1,510 |
Which sections of $T^*M\odot T^*M$ have reproducing kernel "primitives"?. <p>Given a smooth reproducing kernel $\kappa:M\times M\rightarrow \mathbb{R}$ on a manifold $M$, we can construct a section, $\alpha_{\kappa}$, of the symmetric tensor product $T^*M\odot T^*M$ by taking the exterior derivative of $\kappa$ in each of its arguments and then restricting to the diagonal. More precisely, we first construct a section, $\alpha_{M\times M}$, of $T^*M\boxtimes T^*M$ using the formula
\begin{align}
\alpha_{M\times M}(v_1,v_2)=\frac{d}{d\epsilon_1}\bigg|_0\frac{d}{d\epsilon_2}\bigg|_0\kappa(c_1(\epsilon_1),c_2(\epsilon_2)),
\end{align}
where $v_j\in T_{m_j}M$ and $c_j$ is a smooth curve that passes through $m_j$ at $\epsilon_j=0$ with velocity $v_j$. $\alpha_{\kappa}$ is then given by
\begin{align}
\alpha_{\kappa}(v_m,w_m)=\alpha_{M\times M}(v_m,w_m),
\end{align}
where $v_m,w_m\in T_mM$. When a section of $T^*M\odot T^*M$ arises in this manner, I'd like to say that the section has a reproducing kernel primitive.</p>
<p>How can we chracterize the space of sections of $T^*M\odot T^*M$ with reproducing kernel primitives? That is, given an $\alpha\in \Gamma(T^*M\odot T^*M)$, how can we determine if there is some kernel $\kappa$ such that $\alpha=\alpha_{\kappa}$?</p>
<p>One straightforward consequence of the positive-semidefinite property of $\kappa$ is that $\alpha_{\kappa}|_m\in T_m^*M\odot T_m^*M$ must be a positive semi-definite bilinear form for each $m\in M$. Are there any other special properties $\alpha_{\kappa}$ must have? I want to somehow use the fact that $\mathbf{d}^2=0$, but I'm having trouble seeing where I can usefully apply it.</p>
<p>update 4/28: I think that when $M=\mathbb{R}$ every positive semi-definite $\alpha$ has a reproducing kernel primitive. The argument is based on the fact that each $\alpha$ must be of the form $\alpha=a\, dx\,dx$ for some non-negative smooth scalar function $a:M\rightarrow\mathbb{R}$. We can write $\sqrt{a}\,dx=d\phi$, where $\phi(x)=\int_0^x\sqrt{a}(s)\,ds$. A reproducing kernel primitive for $\alpha$ is therefore $\kappa(x,y)=\phi(x)\phi(y)$. Things are easy on $\mathbb{R}$ because, there, all $1$-forms are exact.</p>
| 0non-cybersec
| Stackexchange | 713 | 2,210 |
analysis sequence induction series. <p>Let $k$ be a positive real number with $k < 1$, and let $f$ be a $k$-contraction. Let
$c\in \mathbb{R}$ be given, and define a sequence $(x_n)n≥1$ by $x_1 = c$ and $x_{n+1} = f(x_n)$.
Set $C = |x_1-x_2 |$. By induction on $n$ prove that $|x_n-x_{n+1}|\leq k^{n-1}C$ for every $n\geq 1$.
Then use the comparison test to show that the series $\sum_{i=1}^∞(x_{i+1}-x_i)$
converges absolutely.</p>
<p>can someone give me a hint or a guide...</p>
| 0non-cybersec
| Stackexchange | 200 | 487 |
mp3 quality bad when running on virtualbox. <p>Mp3 files do not sound good when I use mplayer in ubuntu 12.04. I am running ubuntu on a imac in virtualbox. The bigger mp3 files have a lower sound quality than the smaller mp3 files I listen to. I've noticed that it seems like the number of tabs in firefox that are open seems to have an affect but not all the time. The mp3 will sound fine for a while then for a couple of seconds it will sound scratchy and then a couple of seconds later it sounds fine.</p>
<p>Has anyone else had a problem like this or have any ideas how to stop the audio quality from dropping in and out.</p>
| 0non-cybersec
| Stackexchange | 158 | 631 |
[Scala] Fibonacci Sequence and Phi. New to Scala, this is my issue;
http://i.imgur.com/Oms9IhK.png
I have no idea how to proceed with this.
I'm assuming for golden it calculates n to a point then calculate phi using the two most recent F values?
I'm at a complete loss as to what I need to do, how I can get it, and how to make it happen.
Any advice appreciated.
edit; found the problem, scala can't do basic division
http://i.imgur.com/GBWmfk0.png
turns out i need to use .toDouble | 0non-cybersec
| Reddit | 158 | 490 |
Given $a + \sqrt{b}$ with positive integer $a,b$, find $a$ and $b$?. <p>Suppose I had $n = a + \sqrt{b}$ as a decimal of arbitrary precision, but didn't know $a$ or $b$, except that they are positive integers. </p>
<p>If I had just $\sqrt{b}$, I could just square it and end up with something very close to an integer, so I'd have $b$.</p>
<p>If I take $n^2 - 2an$, I get $(a^2 + b + 2a\sqrt{b}) - (2a^2 + 2a\sqrt{b}) = b - a^2$ which will be an integer, but I don't have $a$...</p>
<p>Is there some way to take the sum of the integral and decimal portion of $n$ and do some integer voodoo there?</p>
<p>Thanks for any ideas.</p>
| 0non-cybersec
| Stackexchange | 231 | 634 |
Expectation, concave function. <p>Let $X$ be a random variable such that $E[X]<+\infty$, and $Y$ be a random variable independent of $X$ such that $E[Y]=0$.
Define $Z=X+Y$. Let $g:\mathbb{R}\to\mathbb{R}$ be a concave function.</p>
<p>Show that $E[g(X)]\geq E[g(Z)]$.</p>
<p>I don't see how to use the concavity of $g$ since $Z$ is not a convex combination of $X$ and $Y$. I don't think Jensen's inequality can be used here...</p>
| 0non-cybersec
| Stackexchange | 163 | 436 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
unable to install the asp.net core development certificate tool (dev-certs). <p>Im new in ASP.NET core.</p>
<p>Im using: asp.net core 2.1 web api, visual studio community 2017 v15.8.9, windows 10, docker for windows community edition 18.06.1-ce-win73</p>
<p>So i developed web api with the above system, then try to run it with docker.</p>
<p>I have got this pop up error message from visual studio when i hit F5 from visual studio: </p>
<p>"unable to install the asp.net core development certificate tool (dev-certs)"</p>
<p><a href="https://i.stack.imgur.com/tnsIB.png" rel="noreferrer">See Error pop up image</a></p>
<p>I tried to google it and also referred to this link below which asks us to update the VS to the latest version. I have done that but still got the error:</p>
<p><a href="https://developercommunity.visualstudio.com/content/problem/229417/mvp-unable-to-install-cert-tool-dev-certs.html" rel="noreferrer">https://developercommunity.visualstudio.com/content/problem/229417/mvp-unable-to-install-cert-tool-dev-certs.html</a></p>
<p>Could somebody help? Thanks. </p>
| 0non-cybersec
| Stackexchange | 356 | 1,092 |
Modify url of a symfony form using parameters. <p>I wanted to modify the url of a submitted symfony form using the parameters. Tried many solutions from this platfrom and none of solution helped!</p>
<p>Current url is as follows:<code>http://localhost:8000/search?app_bundle_search_form%5Bsearch%5D=qui&app_bundle_search_form%5Bbrand%5D=&app_bundle_search_form%5Bprice%5D=500%2C100000&app_bundle_search_form%5B_token%5D=BtA5bZb9HErUXzXFzGFbpEhlD6nD33zr7tKiPLxjpy4</code></p>
<p>I want it like `<a href="http://localhost:8000/search?search=qui?brand=?minprice=500?maxprice=100000" rel="nofollow noreferrer">http://localhost:8000/search?search=qui?brand=?minprice=500?maxprice=100000</a></p>
<p>Here is my Controller:</p>
<pre><code> public function searchAction($searchTerm=null,Request $request)
{
if ($request->getMethod() == 'GET') {
$searchTerm = $request->query->get('app_bundle_search_form')['search'];
$searchBrand = $request->query->get('app_bundle_search_form')['brand'];
$price = $request->query->get('app_bundle_search_form')['price'];
$price = explode(",", $price);
$minPrice = $price[0];
$maxPrice = $price[1];
$em = $this->getDoctrine()->getManager();
$search = $em->getRepository('AppBundle:Classified')->searchClassifieds($searchTerm, $searchBrand, $minPrice, $maxPrice);
}
return $this->render('search-result.html.twig', [
'searchTerm' => $searchTerm,
'results' => $search
]);
}
</code></pre>
<p>Form:</p>
<pre><code> public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->setMethod('GET')
->add('search', TextType::class,array(
'required'=> false
))
->add('brand',EntityType::class,[
'class'=>Brand::class,
'placeholder'=>'Choose a brand',
'required'=>false,
'query_builder'=>function(BrandRepository $repo){
return $repo->DistinctBrandValue();
}
])
->add('price', TextType::class, array(
'required' => true,
'label' => 'Price',
'attr' => [
'data-slider-min' => '500',
'data-slider-max' => '100000',
'data-slider-step' => '2',
'data-slider-value' => "[500,100000]",
]))
;
}
</code></pre>
<p>Routing</p>
<pre><code>search:
path: /search
defaults:
_controller: AppBundle:Search:search
requirements:
methods: GET
</code></pre>
<p>Twig:</p>
<pre><code> {{ form_start(search, { action: path('search')}) }}
{{ form_widget(search) }}
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">{% trans %}Search{% endtrans %}</button>
<a href="{{ path('search') }}" class="btn btn-primary">{% trans %}Cancel{% endtrans %}</a>
{{ form_end(search) }}
</code></pre>
<p>Thanks in advance!</p>
<p><strong>EDIT:</strong>
So what I done is I had to make the form name to null.</p>
<pre><code>public function getBlockPrefix()
{
return '';
}
</code></pre>
<p>And set the csrf protection to false.</p>
<pre><code>public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'csrf_protection' => false,
]);
}
</code></pre>
<p>And also changed the form name to null in the controller. Now the url looks a little better!</p>
| 0non-cybersec
| Stackexchange | 1,216 | 3,538 |
In $\triangle ABC$ let $AB \neq BC$. Prove that the bisector of $\angle B$ and the perpendicular bisector of $AC$ meet in exactly one point.. <p>This is in the context of Euclidean Geometry. So here's my attempt:</p>
<hr>
<p><em>Proof.</em> </p>
<p>Let line <span class="math-container">$m$</span> bisect <span class="math-container">$\angle B$</span>. </p>
<p>Let line <span class="math-container">$l$</span> be a perpendicular bisector to <span class="math-container">$AC$</span>. </p>
<p>Suppose <span class="math-container">$l$</span> and <span class="math-container">$m$</span> intersect in two points <span class="math-container">$B,D$</span>.</p>
<p>There exists only one unique line that passes through points <span class="math-container">$B$</span> and <span class="math-container">$D$</span>, and so <span class="math-container">$m=l$</span>.</p>
<p>Since <span class="math-container">$m=l$</span>, line <span class="math-container">$m$</span> bisects <span class="math-container">$\angle B$</span> <em>and</em> is a perpendicular bisector to <span class="math-container">$AC$</span> which implies <span class="math-container">$AB = BC$</span>, contradicting our hypothesis that <span class="math-container">$AB \neq BC$</span>. </p>
<p>Therefore <span class="math-container">$l$</span> and <span class="math-container">$m$</span> intersect in exactly one point. </p>
<hr>
<p>Is this a valid proof? Is there a better one? </p>
| 0non-cybersec
| Stackexchange | 482 | 1,447 |
Real Analysis, Folland problem 5.5.55 Hilbert Spaces. <blockquote>
<p>problem 3.5.55 - Let <span class="math-container">$\mathcal{H}$</span> be a Hilbert space.</p>
<p>a.) (The polarization identity) For any <span class="math-container">$x,y\in\mathcal{H}$</span> <span class="math-container">$$<x,y> = \frac{1}{4}(\lVert x + y \rVert^2 - \lVert x - y\rVert^2 + i\lVert x + iy\rVert^2 - i\lVert x - iy\rVert^2)$$</span>
b.) If <span class="math-container">$\mathcal{H}'$</span> is another Hilbert space, a linear map from <span class="math-container">$\mathcal{H}$</span> to <span class="math-container">$\mathcal{H}'$</span> is unitary if and only if it is isometric and surjective.</p>
</blockquote>
<p>Attempted proof a.)<span class="math-container">$$\lVert x + y \rVert^2 = \lVert x \rVert^2 + \lVert y \rVert^2 + <x,y> + <y,x> $$</span>
<span class="math-container">$$-\lVert x - y \rVert^2 = -\lVert x \rVert^2 - \lVert y \rVert^2 + <x,y> + <y,x> $$</span>
<span class="math-container">$$i\lVert x + iy\rVert^2 = i\lVert x \rVert^2 + i\lVert y \rVert^2 + <x,y> - <y,x> $$</span>
<span class="math-container">$$-i\lVert x - iy\rVert^2 = -i\lVert x \rVert^2 - i\lVert y \rVert^2 + <x,y> - <y,x> $$</span>
Adding the above gives the result</p>
<p>Attempted proof b.): Suppose, <span class="math-container">$f$</span> is a unitary linear map from <span class="math-container">$\mathcal{H}$</span> to <span class="math-container">$\mathcal{H}'$</span>. We need to show that <span class="math-container">$f$</span> is isometric and surjective. Since <span class="math-container">$f$</span> is a unitary linear map we know from Folland that <span class="math-container">$f$</span> is also an invertible linear map that preserves inner products: <span class="math-container">$$\langle fx,fy\rangle_{2} = \langle x,y\rangle _{1} \ \ \forall \ x,y\in\mathcal{H}$$</span>
Set <span class="math-container">$y = x$</span>, then we have <span class="math-container">$\lVert fx\rVert_{2} = \lVert x\rVert_{1}$</span> thus an isometry.</p>
<p>I am not sure how to proceed further or if this approach is incorrect somehow. Any suggestions is greatly appreciated, I will update more as I keep thinking about it.</p>
| 0non-cybersec
| Stackexchange | 799 | 2,261 |
Should I synchronize on a ReferenceQueue?. <p>I was taking a look at the source code for <code>WeakHashMap</code> and stumbled across this:</p>
<pre><code>private final ReferenceQueue<Object> queue = new ReferenceQueue<>();
private void expungeStaleEntries() {
for (Object x; (x = queue.poll()) != null; ) {
synchronized (queue) {
/* snip */
}
}
}
</code></pre>
<p>Why does this method synchronize on the <code>ReferenceQueue</code>? <a href="http://docs.oracle.com/javase/7/docs/api/java/util/WeakHashMap.html" rel="noreferrer"><code>WeakHashMap</code></a> itself does not make claims to be thread safe:</p>
<blockquote>
<p>Like most collection classes, this class is not synchronized. A
synchronized WeakHashMap may be constructed using the
Collections.synchronizedMap method.</p>
</blockquote>
<p>Which led me to believe that this implementation detail is to, somehow, ensure the thread safety of the <code>ReferenceQueue</code> itself (since the GC will be modifying it from its own <code>Thread</code>). However, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/ref/ReferenceQueue.html" rel="noreferrer">the documentation for <code>ReferenceQueue</code></a> does not mention anything about any concurrency concerns, and taking a look at the source code for <code>ReferenceQueue</code> reveals that it doesn't even synchronize on itself (it uses an internal lock). </p>
<p>Why is <code>WeakHashMap</code> synchronizing on its <code>ReferenceQueue</code>? Should I synchronize on a <code>ReferenceQueue</code> every time I use it?</p>
| 0non-cybersec
| Stackexchange | 465 | 1,608 |
How to find out the arguments passed into a process and where the arguments are taken from?. <p>I'm trying to configure OpenShift (regardless whatever the application is), it starts the Kubelet with Hyperkube. It has a bunch of arguments passed into it, I can see that with the help of <code>ps -ef | grep hyperkube</code>.</p>
<p><code>/usr/bin/hyperkube kubelet --v=2 --address=0.0.0.0 --allow-privileged=true --anonymous-auth=true --authentication-token-webhook=true --authentication-token-webhook-cache-ttl=5m --authorization-mode=Webhook --authorization-webhook-cache-authorized-ttl=5m --authorization-webhook-cache-unauthorized-ttl=5m so-on-and-on-and-on</code>.</p>
<p>Now how do I know where the arguments are taken from? I checked the environment variables, I don't see them. It is reading it from some config file, is it possible to find out what that file is?</p>
| 0non-cybersec
| Stackexchange | 267 | 877 |
In-process cache vs distributed cache on consistency with mutable/immutable objects. <p>I heard my colleague saying an in-process cache would be a better option when caching <strong>immutable</strong> objects, where consistency is not a big issue (eventually consistency). Whereas an external distributed cache is more suitable for <strong>mutable</strong> objects that you always want your reads to be consistent (strong).</p>
<p>Is this always the truth? I don't really see how mutability is related to consistency. Can someone help me understand this?</p>
| 0non-cybersec
| Stackexchange | 131 | 560 |
Basis in Linear Transformations. <p>I'm pretty dim when it comes to basis and span, please take that into account :)</p>
<p>Help me prove this theorem:</p>
<p>Let $V$, $W$ be vector spaces, also $T:V \rightarrow W$ is a linear transformation. </p>
<p>If $\beta = \{v_1, v_2, ..., v_n\}$ is a basis for $V$ then $R(T) = span(\{T(\beta)\}) = span (\{T(v_1), T(v_2), ..., T(v_n)\})$</p>
| 0non-cybersec
| Stackexchange | 152 | 387 |
How to click on date in zebra datepicker in html?. <p>After taking suggestions from people here, I think I reached somewhere. I again got stuck. I have to scrape data from a website using datepicker. html says that the website is using Zebra datapicker. I have to click on date and then scrape the data. I am struggling to click on date. Can someone help me? </p>
<p>I have to click on 1/06/19. I am not able to figure out a way to do this. For reference: <a href="http://apsdps.ap.gov.in/des_rainfall.html" rel="nofollow noreferrer">http://apsdps.ap.gov.in/des_rainfall.html</a> This is the website.</p>
<pre class="lang-py prettyprint-override"><code>link = "http://apsdps.ap.gov.in/des_rainfall.html"
webdriver.Chrome(executable_path=r"chromedriver.exe")
driver = webdriver.Chrome()
driver.get(link)
#driver.switch_to_frame(driver.find_element_by_xpath("//iframe"))
input_date = driver.find_element_by_name("date1")
input_date.click()
</code></pre>
<p>HTML:</p>
<pre class="lang-html prettyprint-override"><code><div class="Zebra_DatePicker" style="left: 222.375px; display: none; top: 0px;">
<table class="dp_header" style="width: 218px;">
<tbody>
<tr>
<td class="dp_previous">«</td>
<td class="dp_caption">June, 2019</td>
<td class="dp_next">»</td>
</tr>
</tbody>
</table>
<table class="dp_daypicker">
<tbody>
<tr>
<th>Mo</th>
<th>Tu</th>
<th>We</th>
<th>Th</th>
<th>Fr</th>
<th>Sa</th>
<th>Su</th>
</tr>
<tr>
<td class="dp_not_in_month">27</td>
<td class="dp_not_in_month">28</td>
<td class="dp_not_in_month">29</td>
<td class="dp_not_in_month">30</td>
<td class="dp_not_in_month">31</td>
<td class="dp_weekend dp_selected">1</td>
<td class="dp_weekend">2</td>
</tr>
<tr>
<td>3</td>
<td class="">4</td>
<td>5</td>
<td>6</td>
<td>7</td>
<td class="dp_weekend">8</td>
<td class="dp_weekend">9</td>
</tr>
<tr>
<td>10</td>
<td>11</td>
<td class="">12</td>
<td>13</td>
<td>14</td>
<td class="dp_weekend">15</td>
<td class="dp_weekend">16</td>
</tr>
<tr>
<td>17</td>
<td>18</td>
<td class="">19</td>
<td>20</td>
<td>21</td>
<td class="dp_weekend">22</td>
<td class="dp_weekend">23</td>
</tr>
<tr>
<td>24</td>
<td>25</td>
<td class="">26</td>
<td>27</td>
<td>28</td>
<td class="dp_weekend">29</td>
<td class="dp_weekend">30</td>
</tr>
<tr>
<td class="dp_not_in_month">1</td>
<td class="dp_not_in_month">2</td>
<td class="dp_not_in_month">3</td>
<td class="dp_not_in_month">4</td>
<td class="dp_not_in_month">5</td>
<td class="dp_not_in_month">6</td>
<td class="dp_not_in_month">7</td>
</tr>
</tbody>
</table>
<table class="dp_monthpicker" style="width: 218px; height: 190px; display: none;"></table>
<table class="dp_yearpicker" style="width: 218px; height: 190px; display: none;"></table>
<table class="dp_footer" style="width: 218px;">
<tbody>
<tr>
<td class="dp_today" style="width: 50%;">Today</td>
<td class="dp_clear" style="width: 50%; display: table-cell;">Clear date</td>
</tr>
</tbody>
</table>
</div>
</code></pre>
| 0non-cybersec
| Stackexchange | 1,933 | 4,664 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
Hunger Games simulator thread all contestants. Here are all the people that are gonna be in it
dottyboi
-Hoshii-
McLight123
bladehider
emlikeowl
Jevon
beautiful_cosmos
personalBureaucrat
koolaidjammerz
oisin007
b33
halsalmonella
fire_snek
SuckMyWeenieHoudini
Mr_Megaman_X
Davie
Harvman
azarion12
garbageisme
Viperry
Viivizzu
ohmisbeliever
Cellsaremadeoforganelles
All apologies if you didn't make it. Place your bets now, the first round results will be here shortly. | 0non-cybersec
| Reddit | 188 | 491 |
Environment definition separates matching braces. <p>Suppose I want to define an environment which is essentially a modification of an existing one. I tried something like that:</p>
<pre><code>\newenvironment{newenv}{%
\formatcommand{\begin{oldenv}%
}{%
\end{oldenv}}%
}
</code></pre>
<p>I would expect </p>
<pre><code>\begin{newenv}Foo\end{newenv}
</code></pre>
<p>to result in the same output as</p>
<pre><code>\formatcommand{\begin{oldenv}Foo\end{oldenv}}
</code></pre>
<p>But whenever I use <code>\begin{newenv}</code>, <code>pdflatex</code> says</p>
<pre><code>Missing } inserted
</code></pre>
<p>and skrews up everything afterwards, of course. Without <code>\formatcommand</code> everything is fine, so apparently the orphan <code>{</code> form <code>\formatcommand</code> is the culprit.</p>
<p>My guess is that <code>pdflatex</code> tries to treat stuff inside environment definition parts as something syntactically correct---which what I do clearly is not---instead of "just" to replace text and parse afterwards.</p>
<p>Is there a way to get around this, i.e. have a command span from a new environments beginning to end?</p>
<p><strong>Use case:</strong></p>
<pre><code>\newenvironment{card}{%
\resizebox{55mm}{85mm}{\begin{tabular*}{55mm}{| p{50.5mm} |}%
\hline%
}{%
\hline\end{tabular*}}%
}
</code></pre>
<p>If I put the <em>same</em> <code>resizebox</code> around the usage site of <code>card</code>, it compiles and resizes (even though not the way I intended, but that's for another day).</p>
| 0non-cybersec
| Stackexchange | 500 | 1,533 |
Netgear smart switches - how view MAC address of devices connected to each port?. <p>Im setting a VLAN on a remote site i do not easy have access to. </p>
<p>There are 3 switches daisy chained (Netgear GS716Tv3, Netgear GS105Ev2, Netgear GS108PEv3, and a router (Draytek 2860) forming the LAN. </p>
<p>Im familiar with the network typology in terms of which switch daisy chains into the router and into each other, but i don't know which ports are used, so i don't know which ports to make Trunk ports. </p>
<p>I have the MAC addresses of all the switches and the router, but i couldn't find a way to view all the ports on the switch and see their connected devices MAC. </p>
<p>Is that possible on the Netgear switches ? </p>
<p>I tried to go to <code>System > Device View</code> on the web GUI but it says i need a Java browser plugin to be installed and <a href="https://java.com/en/download/help/enable_browser.xml" rel="nofollow noreferrer">Chrome on OSX dosn't allow Java plugins, nor dose Firefox or Safari.</a></p>
<p>Im on Mac OSX so i cant install the Netgear Plus Configuration utility.</p>
| 0non-cybersec
| Stackexchange | 332 | 1,111 |
Using grub to properly boot from an external backup drive. <p><strong>edit</strong>: I think I solved my own problem -- see bottom of question for details</p>
<p>I have a copy of all the files under <code>/</code> on an external usb-connected harddrive. To test whether this backup works, i'm trying to boot from it. However, this is proving a bit more difficult than I expected.</p>
<ol>
<li><p>In what I assume is the BIOS, I select my external HD as the boot device. However, whether I select this device or my usual drive as the boot device, I am shown the same GRUB menu. This happens whether I manually went and installed GRUB on my external HD or not. So my question is, is GRUB being loaded from my normal boot drive or from the external drive, and does it matter? </p>
<ul>
<li>I found that when using GRUB command line without GRUB installed on my external drive, the external drive was shown as <code>(hd2,gpt1)</code>, however after I installed GRUB on the external drive, it came up as <code>(hd0,gpt2)</code>. </li>
</ul></li>
<li><p>Perhaps the difficulties I'm having are related to just my first question, but when I boot after specifying <code>linux /boot/vmlinuz-linux root=/dev/sda2</code>, I always get some failure relating to the drive specified as <code>root</code> not being found. This happens even when I specify root by device uuid. My question is, do I need to worry about </p>
<ul>
<li><p><code>/etc/fstab</code>? Is this something I need to change in order to make sure that root is found? And does it matter whether I change the <code>/etc/fstab</code> file on my internal drive or on the external one. (I did modify <code>/etc/fstab</code> on the external drive so that the drive with the UUID of the root partition should be mounted to <code>/</code>, but to no avail)</p></li>
<li><p>Perhaps because it is a usb connected external HD, do I need to do anything special? I noticed seeing the error <code>usb 2-4: device descriptor read/64, error -71</code> while booting normally, but since this has no apparent effect on the functionality of the drive, I ignored it. This error also appeared on two separate external HD docks, so I assume it is not a hardware issue.</p></li>
</ul></li>
</ol>
<hr>
<p>Clarifications: </p>
<p>I created my external backup using <a href="https://borgbackup.readthedocs.io/en/stable/" rel="nofollow noreferrer">Borg</a>, which creates a copy of all the files. It doesn't copy the entire disk over like <code>dd</code>, so for example while installing grub I still need to manually create a partition with the <code>bios_grub</code> flag.</p>
<p>The exact command I use in grub while attempting to boot is</p>
<pre><code>set root=(hd0,gpt2)
linux vmlinuz-linux root=/dev/sda2
initrd initramfs-linux.img
boot
</code></pre>
<hr>
<p>I've managed to boot.</p>
<p>I had tried both <code>linux /boot/vmlinuz-linux root=/dev/sda2</code> and <code>linux /boot/vmlinuz-linux root=/dev/sdc2</code> to no avail -- the first because the drive was showing up as <code>(hd0,gpt2)</code> in grub, and the second because the partition gets labeled as <code>/dev/sdc2</code> when I boot normally. However, neither of these worked, and both dropped me into a strange command line. I discovered that the partition with the correct UUID was actually mounted to <code>/dev/sdb2</code> for some reason! Using <code>root=/dev/sdb2</code> I booted the system just fine. I think my previous attempts to boot by specifying UUID failed for one of various reasons (GRUB not being installed, typos in the UUID, etc).</p>
<p>This is pretty anticlimactic. I am still curious about the original questions I had -- namely, <strong>1.</strong> how it is decided which GRUB is used when there are multiple drives with GRUB installed? <strong>2.</strong> does <code>/etc/fstab</code> play a role in the booting process, or is it irrelevant? -- and I'll award the bounty for answers to those questions.</p>
| 0non-cybersec
| Stackexchange | 1,116 | 3,947 |
\int does not work on my LyX. <p>Just starting to use LaTeX to type up my homework. I am doing differential equations right now and I have to type in an integral symbol. </p>
<p>However when I do that, and try to make a DVI, LyX gives me an error (both when producing pdf and dvi). The error is following:</p>
<pre><code>MiKTeX Problem Report
Message: Not all fonts could be loaded. See 'File->Document Properties', for details.
Data:
Source: Programs\MiKTeX\Yap\MFC\DviDoc.cpp
Line: 636
MiKTeX: 2.9
OS: Microsoft Windows 7 Home Premium Edition, 64-bit (build 7600)
SystemAdmin: no
PowerUser: no
Root0: C:\Users\\AppData\Roaming\MiKTeX\2.9
Root1: C:\Users\\AppData\Local\MiKTeX\2.9
Root2: C:\ProgramData\MiKTeX\2.9
Root3: C:\Program Files (x86)\MiKTeX 2.9
UserInstall: C:\Users\\AppData\Roaming\MiKTeX\2.9
UserConfig: C:\Users\\AppData\Roaming\MiKTeX\2.9
UserData: C:\Users\\AppData\Local\MiKTeX\2.9
CommonInstall: C:\Program Files (x86)\MiKTeX 2.9
CommonConfig: C:\ProgramData\MiKTeX\2.9
CommonData: C:\ProgramData\MiKTeX\2.9
</code></pre>
<p>Also a very similar error occurs when I try to change text into bold. I am assuming I am missing some sort of font files (since that's what the error refers to). Anyways, let me know how I can fix this.</p>
| 0non-cybersec
| Stackexchange | 436 | 1,258 |
Heat molding for hiking boots?. So my basic explanation, for those that don't know what it is, of heat molding is you heat up the insert of your boot or shoe and then because of the heat it softens up, thus allowing it to immediately take the shape of your foot. Once the insert cools down, it would become ridged again, but remain in the shape of your foot. This could cut lots of miles off of break in time. I'm curious if anyone would be interested in this kind of product. And yes I am aware of the enjoyment and attachment that is built after breaking in your boots. I was just curious if the community would be interested in a faster method.
| 0non-cybersec
| Reddit | 144 | 648 |
What is the correct find -exec syntax. <p>I wanted to delete files that were greater than 2MB within a specific folder. So I ran:</p>
<p><code>find . -size +2M</code></p>
<p>And I got a list of two files</p>
<blockquote>
<p>./a/b/c/file1 </p>
<p>./a/f/g/file2</p>
</blockquote>
<p>So I then run:</p>
<p><code>find . -size +2M -exec rm ;</code></p>
<p>and I get the error message <code>Find: missing argument to -exec</code></p>
<p>I check the syntax in the man page and it says <code>-exec command ;</code></p>
<p>So instead I try</p>
<p><code>find . -size +2M -exec rm {} +</code></p>
<p>And it works. I understand that the {} make it execute the command like <code>rm file1 file2</code> instead of <code>rm file1; rm file2;</code>.</p>
<p>So why didn't the first one work?</p>
<p><strong>ANSWER:</strong></p>
<p>I guess I just had to RTFM a couple of times to finally understand what it was saying. Even though the first example doesn't show {}, the braces are required in all cases. And then either add \; or + depending on the desired method. Don't just read the heading. Read the description as well. Got it. </p>
| 0non-cybersec
| Stackexchange | 399 | 1,139 |
Crypto/security and programming languages. Could someone help me with this? I'm looking for resources on the use of programming languages in the field of cryptology, system security, etc.
Wikipedia says E was created for this purpose? I've seen that C is good for it somewhere, but then I just recently saw in a university paper that C is a bad language for security. I've also seen a link that was posted on reddit (maybe in this very subreddit) about Javascript and browser languages in general.
Is there a good, trustworthy place where I can get this information? Basically I'm looking for the role of programming languages in security, and which languages are more appropriate or classically used for it. Thank you for your time. | 1cybersec
| Reddit | 159 | 737 |
Pass variable to puppet on commandline. <p>I'm trying to get TeamCity to trigger a deployment with puppet via the commandline using puppet.bat on Windows.</p>
<p>In Teamcity I'm calling this using a Command Line runner, with
Command executable: C:\Program Files (x86)\Puppet Labs\Puppet\bin\puppet.bat
Command parameters: apply myexample.pp</p>
<p>What I would like to do is also pass the build number from TeamCity as well so I can use this within myexample.pp</p>
<p>Is this possible?</p>
<p>UPDATE: Code used for Custom Fact which was the accepted answer below.</p>
<pre><code>require 'open-uri'
$uri = URI.parse("http://teamcity/guestAuth/app/rest/buildTypes/id: <BUILDID>/builds/status:SUCCESS/number")
$version = $uri.read
Facter.add("latestbuildversion") do
setcode do
$version
end
end
</code></pre>
| 0non-cybersec
| Stackexchange | 266 | 835 |
Is it possible to merge two separate ecto queries?. <p>I am wondering if it is possible to combine two queries together in ecto.</p>
<p>I would like to create a function which takes an ecto query and modifies it depending on the case.</p>
<p>For example, let's imagine we have a <code>users</code> table that allows duplicate <code>usernames</code> to be entered and a user creates the following query...</p>
<pre><code>query = from(u in "users", select: u)
select_all_unique_users(query)
</code></pre>
<p>I would like the <code>select_all_unique_users</code> function to take <code>query</code> and add to it, so that it only selects the distinct usernames. </p>
<blockquote>
<p><em>this is only an example, I know that I could create a <code>unique_index</code> on the table to avoid this in reality =D</em></p>
</blockquote>
<p>As <code>query</code> is a struct under the hood, I figured I could update the <code>distinct</code> key do this. This seems to work, however the downside is that it doesn't seem very flexible and looks like it will be hard to implement if I ever want to add a more complicated logic.</p>
<p>Simply put, what I would like to do is create a function that takes a query and adds some more logic to it...</p>
<pre><code>iex()> query = from(u in "users", select: u)
#Ecto.Query<from u0 in "users", select: u0>
iex()> select_all_unique_users(query)
#Ecto.Query<from u0 in "users", distinct: [asc: u0.username], select: u0>
</code></pre>
| 0non-cybersec
| Stackexchange | 473 | 1,492 |
trace $0$ complex matrix is similar to a diagonal matrix having $0$'s in main diagonal. <p>Let $A$ be an $n\times n$ complex matrix with $trace(A)=0$. We need to Show that $A$ is similar to a matrix with all $0'$ s along the main diagonal.</p>
<p>What I thought: $A$ is not zero matrix, also $A\ne cI$ for any $c\in\mathbb{C}^*$</p>
<p>so $\exists v\in \mathbb{C}^n$ which is not an eigen vector of $A$, then I thought of taking a basis whose first two vectors are $v,Av$ and then with respect to this basis what will be the matrix $A$?</p>
<p>Thanks for helping.</p>
| 0non-cybersec
| Stackexchange | 193 | 575 |
Is it possible to make PoW ASIC-resistant through dynamically generated hash chains?. <p>Bitcoin's static proof-of-work function SHA256(SHA256(data)) was apparently easy enough to be implement as ASIC which lead to the re-centralization we see today.</p>
<p>But what if the PoW function changes for every new block based on the hash of the last block mined? One could generate a new hash chain by seeding a commonly known PRNG with the hash of the last block and use it to generate a chain of hash functions from a (large) pool of commonly known hash functions.</p>
<p>Steps:</p>
<ol>
<li>RIPEMD(SHA2(SHA3(MD5(RIPEMD(SHA2(data)))))) => digest (i.e. old block header hash)</li>
<li>PRNG(digest) => SHA2(MD5(SHA3(SHA3(RIPEMD(RIPEMD(data))))))</li>
<li>digest (i.e. new block header hash)</li>
</ol>
<p>This way every miner would know how to generate the new chain of hash functions which has to be used to generate a digest with certain criteria (leading zeros) for the next block but nobody could calculate the subsequently hash chains and nobody could implement static hash chain circuits but has to use FPGAs which have to be reprogrammed every block and have to be able to host every possible hash chain constellation. If the hash chains are complex enough it might even lead to a decrease in FPGA efficiency which would favour general computing hardware and reinstate the "one-CPU-one-vote" principle.</p>
<p>What do you think of this approach? Why might it be flawed?</p>
| 0non-cybersec
| Stackexchange | 406 | 1,481 |
Why isn't SQL used as a shader / GPGPU language?. Maybe I've just been spending too much time out in the sun, but it seems to me that since SQL is primarily used for working with sets, it would be a logical language to use to describe what's happening inside a shader.
As an example, say you wanted to do sepia tone on a frame buffer. some fragment shader code would look something like this.
update buffer a set
a.r = (b.r * .393) + (b.g *.769) + (b.b * .189) ,
a.g = (b.r * .349) + (b.g *.686) + (b.b * .168),
a.b = (b.r *.272) + (b.g *.534) + (b.b * .131)
inner join
buffer b on
a.X = b.X and a.Y = b.Y
where
b.a >= 0.75
Now I know the flow isn't perfect, there would need to be some other considerations, but I think since SQL works primarily with set data, just like vertex and fragment shaders are supposed to, it would be an interesting experiment. | 0non-cybersec
| Reddit | 279 | 920 |
Just wanted to say THANK YOU ANDROID!. So I purchased an iPad after my laptop died. Part of my job requires me check the integrity of music files which i download in .zip files from my job. I figured I would have no issues doing something as simple as downloading an .mp3 and playing it, right? Boy was I wrong.
First I found out that I had to have an app to even download the file, then another to unzip it, then i found that the native music app wont even play an mp3! I tried to get some help over at r/ipad which turned out to be a giant joke.
Well in expressing my frustration to a co-worker he mentioned that with Android you can simply download a .zip file and play the mp3s like a normal computer. Thanks to him I am return this iCrap and getting a nexus 9! While I do wish I knew this last week I am just relieved to be over this nightmare.
Thanks, Android!
edit: holy mother of... never imagined the response I am getting. Took down my previous post as some folks were getting a little overzealous here. Thanks to all for the solid advice!
edit 2: So lots of you are recommending using file sharing apps like dropbox, or google drive. I did find that you can play an mp3 from those, however you're stuck using those apps as your music player. While I appreciate the effort, sadly in my opinion if I am going to pay $500 for a tablet I'd at least like to be able to set up a playlist, or not have to click each track individually to play. Just not worth the money, IMO.
edit 3: okay okay, fine. To all you saying "OP should have researched if you were going to spend...." You're 100% correct. I should have researched into it first. I wrongly assumed a $500 piece of internet connected tech would be able to do something as simple as download a file and play an mp3 without a lot of hassle. I'll admit when I'm wrong.
edit 4: Yes, I am aware that a replacement laptop for a simple task like mine is cheaper and the most obvious solution. But let's put it this way. If you had a buddy who bought a motorcycle for himself, would you then say "You know a mini-van is a lot more practical, right?" Don't be that guy. No one likes him. | 0non-cybersec
| Reddit | 520 | 2,151 |
Paying off my credit card tomorrow! Woohoo!. I wouldn't have been able to do this without having a budget. It's an old fashioned paper, pencil, and calculator budget. I kept thinking I needed to buy budgeting software, but then I realized I get a nice sense of accomplishment when I write it all out. (Also, its kinda an eff-you to all the awful math teachers I had.) Thanks /r/personalfinance and /r/frugal. I've grown and learned a lot here. Next up (and last) is to pay off my car before it falls apart around me. Seriously, I'm a little afraid to wash it, the dirt might be holding something important together. | 0non-cybersec
| Reddit | 152 | 615 |
Vertical blinds issue :(. Hello DIY!
So I'm having a random technical issue with the vertical blinds hanging in front of the sliding glass door that goes to the backyard. On one side of the blinds at the end is a wand/stick/whatever the proper term is, that normally when twisted, will open or close the blinds.
Now, however, nothing happens! It's like it's stuck, but I can't figure out why. It won't really turn one way or the other, and I can't really even scoot the blinds over to one side (like all the way to the left, so that you can get in and out of the door), though that may be purely because I can't rotate the blinds so that they'd sit nicely within one another.
Any help would be greatly appreciated (mainly because I'm moving out of this apartment at the end of the month and I want to have everything in working order when the person comes to check it out). Thanks, and if pictures would help let me know and I'll throw some up :) | 0non-cybersec
| Reddit | 229 | 953 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
Am i eating too much sugar?. Hey guys!!! So about my diet. I try to eat about 3,000 calories a day. I understand how diet works and how everything is fine but in moderation.
So my question is, am i having too much sugar. It is hard for me to eat a lot, so i have a lot of snacks. My breakfast is either a protein shake with vanilla whey, milk, half a banana, a spoon of peanut butter, and ice; or my other breakfast is 4-ish or 5ish spoons of peanut butter with milk. Throughout the day, i will eat 3 of the chocolate Quaker Chewy Bars because they are small and a easy 100 calories each, and a clif bar. For lunch, i have 3 peanut butter and jelly sandwiches. The rest of the day is whatever my mom makes.
Is all of that too much sugar or will i be fine? Btw i am 15 and weigh 155 if that changes anything. Thanks!!! | 0non-cybersec
| Reddit | 208 | 821 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
What is a trustworthy 2x4GB RAM for MacBook Pro 15" 2.4Mhz Core i5?. <p>I'm looking to upgrade memory from 4GB to 8GB on my MacBook Pro 15" 2.4Mhz Core i5.</p>
<p>I've been looking at <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16820226015&Tpk=976644A" rel="nofollow">Mushkin 8GB RAM on NewEgg</a>, but it's been getting bad reviews lately for not working properly with MacBook Pro Core i7. I'm not sure if it still works OK with Core i5...</p>
<p>Is there a trusted 8GB(2x4) RAM upgrade for MacBook Pro 15" 2.4Mhz Core i5?</p>
| 0non-cybersec
| Stackexchange | 207 | 556 |
Global state of games(or other). Example : Waiting,Betting,Battling in gambling game. <p>So I'm making a IRC betting bot. Basically the game/bot has three states of taking-in chat. </p>
<p><strong>State 1 : Betting</strong>
If anyone says "!bet team money" parse it and record.</p>
<p><strong>State 2 : Battling</strong>
Take nothing in, no more !bet etc. Just watch.</p>
<p><strong>State 3 : Waiting/Bank</strong>
Don't take bets. But take-in "!bank" and print out the users money count.</p>
<p>Right now for each of my bot message parsers I have a big fat IF. </p>
<pre><code>if (global_state == BETTING):
blah blah bah
</code></pre>
<p>AND I'm starting to need to have my bot do stuff when the state <strong><em>changes</em></strong>. So now I'm starting to do this (which hurts my soul a little every time I read it)</p>
<pre><code>if (global_state == BETTING && past_state == WAITING):
do blah stuff like reset the bet money
</code></pre>
<p>As some of you might have noticed I'm using Python, but this problem definitely is not python-only. What should I do instead?</p>
| 0non-cybersec
| Stackexchange | 348 | 1,103 |
Pc can only boot for 4 hrs before dying each time must do cmos reset. Tldr: Most likely motherboard issue and now my psu has also died, will do more testing. If u guys have any advice it will be much appreciated, cheers.
My computer had suddenly powered off and would not boot but
After trying many things, doing a cmos reset seems to have worked(at first) i was greeted with a bios and everything was normal again.
Next following day while using my computer(non gaming) it happened again
Doing another cmos reset bought me 4 hours of computer usage before yet another power off
The board seems to be able to get power but unable to boot nor give power to the other components unless i do a cmos reset. I can tell by the led indicators for power,boot,dram,cpu built onto the motherboard
I Replaced cmos battery with a new one no changes
System info
Cpu: i3 8100
Motherboard: tuf b360 pro gaming (wifi)
Psu: seasonic 650w gold plus
Ram: 2 x 4gb crucial ram
Ssd: kingston 240gb
Gpu: nividia titan black | 0non-cybersec
| Reddit | 272 | 1,013 |
JSON - Generating a json in a loop in python. <p>I have some difficulties generating a specific JSON object in python.</p>
<p>I need it to be in this format:</p>
<pre><code>[
{"id":0 , "attributeName_1":"value" , "attributeName_2":"value" , .... },
{"id":1 , "attributeName_2":"value" , "attributeName_3":"value" , .... },
.
.
.
]
</code></pre>
<p>In python, im getting the ids, attributeNames and values from 2 objects. Im trying to generate the json like this:</p>
<pre><code> data=[]
for feature in features_selected:
data.append({"id":feature.pk})
for attribute in attributes_selected:
if attribute.feature == feature:
data.append({attribute.attribute.name : attribute.value})
jsonData=json.dumps(data)
</code></pre>
<p>but I got this result which is not exactly what I need:</p>
<pre><code>[
{"id":0} , {"attributeName_1":"value"} , {"attributeName_2":"value"} ,
{"id":1} , {"attributeName_2":"value"} , {"attributeName_3":"value"} , .... },
.
.
.
]
</code></pre>
| 0non-cybersec
| Stackexchange | 341 | 1,064 |
How does the use of `static` affect the speed of my code?. <p>I was solving an exercise online, and at one point i needed to delete the "" from a the beginning and end of a string. This was my code:</p>
<pre class="lang-cpp prettyprint-override"><code>void static inline process_value(std::string &value) {
if (value.back() !='>') {
value = value.substr(1, value.size()-2);
}
}
</code></pre>
<p>Called from this benchmark loop:</p>
<pre><code>static void UsingStatic(benchmark::State& state) {
// Code inside this loop is measured repeatedly
for (auto _ : state) {
std::string valor("\"Hola\"");
process_valueS(valor);
// Make sure the variable is not optimized away by compiler
benchmark::DoNotOptimize(valor);
}
}
</code></pre>
<p>Just because of curiosity I <a href="http://quick-bench.com/hl6PasrCbXw49VajkknRL0R9Mzk" rel="noreferrer">did a benchmark</a>.</p>
<ul>
<li><strong>Compiler:</strong> Clang-9.0</li>
<li><strong>std:</strong> c++20</li>
<li><strong>optim:</strong> O3</li>
<li><strong>STL:</strong> libstdc++(GNU)</li>
</ul>
<p>While I was at it I decided to remove <code>static</code> from <code>process_value</code>, making <code>void inline process_value</code> that was otherwise the same. To my surprise it was slower.</p>
<p>I thought that static only meant that the function was just for a file. But <a href="https://www.researchgate.net/post/What_is_the_role_of_static_function_and_this_pointer_in_C" rel="noreferrer">here</a> it says that " 'static' means that the function should be inlined by the compiler if possible". But in that case when i removed static I think that the result should not have changed. Now I'm am confused, what other things does static do other than delimiting the function to a single <code>.cpp</code>, how does that affect performance?</p>
<p>The disassembly on QuickBench shows that the <code>NoUsingStatic</code> loop actually calls <code>process_value</code> instead of inlining it, despite the <code>inline</code> keyword making it legal for the compiler to do so. But <code>UsingStatic</code> <em>does</em> inline the call to <code>process_valueS</code>. That difference in compiler decision-making presumably explains the difference in performance, but <strong>why would clang choose not to inline a simple function declared <code>void inline process_value(std::string &value){ ... }</code>?</strong></p>
<hr>
<p>EDIT: Beacuse the question was closed because it was not clear enough, i deleted parts that where not related to the question. But if im missing some information please tell me in the comments </p>
| 0non-cybersec
| Stackexchange | 790 | 2,639 |
Characterization of $\tau \in S_n$ such that $\sigma:=(1 \space 2)\tau$ commutes with two distinct transpositions. <p>Possibly ancillary to another problem, I want to characterize the permutations <span class="math-container">$\tau \in S_n$</span> such that <span class="math-container">$\sigma:=(1 \space 2)\tau$</span> commutes with two distinct transpositions. If relevant, we can use the constraint that <span class="math-container">$\tau$</span> mustn't be an <span class="math-container">$n$</span>-cycle.</p>
| 0non-cybersec
| Stackexchange | 149 | 516 |
The Xbox One keyboard seriously needs to be revamped to feature quicker cursor movement and text prediction. I was always disappointed with the 360 keyboard and thought that the Xbox One would finally get it right but unfortunately, it's still really lacking, even with the NXE update.
I really liked the PlayStation 3 keyboard. It was extremely quick and responsive, plus the text prediction made typing incredibly easy.
As you were typing out words it would have a column on the side with suggestions for the rest of the word that would adapt as you continued entering letters. It would also keep track of words and phrases you commonly used and put those in the column as well for easy access.
Also, when I say it was fast, I mean seriously fast. You were able to move the cursor across the keyboard at least twice as fast as the current Xbox One keyboard.
I'm not trying to say that the Xbox One should attempt to mimic the PlayStation 3's keyboard. In this age of keyboard innovation on smartphones there's no reason for the Xbox One keyboard to be so slow and clunky, and there's definitely no excuse for it to be outclassed by a keyboard on a console from the previous generation.
**Edit: A Uservoice topic has now been created. If you agree, please go vote!**
https://xbox.uservoice.com/forums/251646-apps/suggestions/10065144-the-xbox-one-keyboard-seriously-needs-to-be-revamp
Second edit: I notice a lot of people taking about the NXE keyboard. It may be better than the previous Xbox One keyboard, but it still doesn't come close to the precision, quickness and fluidity of the PlayStation 3 keyboard. It especially stands out to me as I often jump back and forth between the two consoles. | 0non-cybersec
| Reddit | 404 | 1,716 |
Ubuntu 11.04 server hanging due to landscape-sysinfo CPU overconsumption. <p>I'm running something of a bare-bones server (based on Ubuntu 11.04) on an Amazon EC2 micro instance, whose purpose is simply to coordinate the activities of a few webservers. The machine ran well for a few weeks, but now is hanging frequently with its CPU redlined at 100%.</p>
<p>I logged into the machine over SSH and ran a <code>top</code>, which revealed that the <code>landscape-sysinfo</code> process was the perpetrator consuming all of the system resources. A <code>pstree</code> revealed where it was situated:</p>
<pre>
init─┬─atd
├─cron
├─dhclient3
├─dovecot─┬─2*[dovecot-auth]
│ ├─3*[imap-login]
│ └─3*[pop3-login]
├─6*[getty]
├─master─┬─pickup
│ └─qmgr
├─mountall
├─mysqld───11*[{mysqld}]
├─rsyslogd───3*[{rsyslogd}]
├─sshd─┬─sshd───sshd───bash
│ ├─sshd───sshd───bash───top
│ ├─sshd───sshd───bash───pstree
│ └─sshd───sh───run-parts───50-landscape-sy───landscape-sys+
├─udevd───2*[udevd]
├─upstart-socket-
├─upstart-udev-br
└─vsftpd
</pre>
<p>The offending process is listed here as the last child of <code>sshd</code>. If I manually kill <code>landscape-sysinfo</code>, the machine returns to normal - until the process spontaneously respawns, usually a few moments later. (I can "vouch for" the other <code>sshd</code> processes in the above tree. They were legitimate.)</p>
<p>I have no idea why <code>landscape-sysinfo</code> is spawning itself randomly. I doubly have no idea why it's the child of <code>sshd</code>.</p>
<p>I'm obviously none too thrilled about having an SSH processes running on my machine that I can't account for. Initially I feared a breach/trojan/backdoor, so I ran <code>chkrootkit</code> and <code>rkhunter</code>, but they both came up clean.</p>
<p>Does anybody have any idea what could be causing this process to run wild? Any thoughts on how to stop it from respawning?</p>
| 0non-cybersec
| Stackexchange | 705 | 2,037 |
Vertical align of a node. <p>I have the following problem.</p>
<p><img src="https://i.stack.imgur.com/fANQh.png" alt="enter image description here"></p>
<p>As you see, the last nodes have a height that shrink the arrows. I want to fix the size of the arrows moving the nodes down. How can I do that?</p>
<p>This is a example of my code.</p>
<pre><code>%% LyX 2.1.0 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[14pt,spanish]{extarticle}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{Ubuntu}
\usepackage{geometry}
\geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{tikz}
\usepackage{textgreek}
\usepackage{mhchem}
\usepackage{gensymb}
\usetikzlibrary{shapes.geometric, arrows}
\tikzstyle{inicio} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=yellow]
\tikzstyle{nodo} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black]
\tikzstyle{arrow} = [thick,->,>=stealth]
\tikzstyle{centerzero} = [trim left=0pt,trim right=0pt]
\makeatother
\usepackage{babel}
\addto\shorthandsspanish{\spanishdeactivate{~<>}}
\usepackage{xunicode}
\begin{document}
\begin{center}
\begin{tikzpicture}[node distance=2cm, centerzero]
\node (crecimiento) [inicio] {Crecimiento de la biomasa};
\node (luz) [nodo, below of=crecimiento, xshift=-3cm] {Luz}; \draw [arrow] (crecimiento) -- (luz);
\node (oscuridad) [nodo, below of=crecimiento, xshift=3cm] {Oscuridad}; \draw [arrow] (crecimiento) -- (oscuridad);
\node (alto) [nodo, below of=luz] {Alto crecimiento}; \draw [arrow] (luz) -- (alto);
\node (bajo) [nodo, below of=oscuridad] {Bajo crecimiento}; \draw [arrow] (oscuridad) -- (bajo);
\node (bc1-alto) [nodo, below of=alto, xshift=-2cm, text width=2cm] {BC1: 150 a 470 mg SSl\textsuperscript{-1}}; \draw [arrow] (alto) -- (bc1-alto);
\node (bc2-alto) [nodo, below of=alto, xshift=2cm, text width=2cm] {BC2: 1500 a 1620 mg SSl\textsuperscript{-1}}; \draw [arrow] (alto) -- (bc2-alto);
\end{tikzpicture}
\par\end{center}
\end{document}
</code></pre>
| 0non-cybersec
| Stackexchange | 842 | 2,274 |
You have $10$ gold coins and the price today is $\$10,000$ and it appreciates $10\%$ a year. You sell $\$1000$ every month.. <ul>
<li><p>You start out with $10$ gold coins</p></li>
<li><p>The price is $\$10,000$ for the entire year.</p></li>
<li><p>Gold coins appreciate $10\%$ at the start of each year.</p></li>
<li>You cash out $\$1,000$ every month.</li>
</ul>
<blockquote>
<p>How many months/years will this last before you reach $0$ gold coins?</p>
</blockquote>
<p>Is there a special math formula to calculate this easily? Or excel formula? What is this called?</p>
| 0non-cybersec
| Stackexchange | 196 | 577 |
How to get smart tabs ("indent with tabs, align with spaces") behavior in Xcode?. <p>I used to use tabs for indentation and spaces for alignment.
Like so (arrows show tabs and dots show spaces).</p>
<p><img src="https://i.stack.imgur.com/3VG2q.png" alt="enter image description here"></p>
<p>In QtCreator you can set such coding style in standard preferences.
I can't find the way to achieve the same goal in Xcode. Could you please tell me if it is possible?
May be there is a plugin for that?</p>
<p><strong>UPDATE:</strong>
Here is how it can be achieved in QtCreator:
<img src="https://i.stack.imgur.com/v2zj2.png" alt="enter image description here"></p>
<p>P.S. Please, don't try to persuade me that using spaces only/tabs only is better, otherwise this question will turn into another holywar :)</p>
<p>Once more about what I'm trying to achieve: <a href="http://vim.wikia.com/wiki/Indent_with_tabs,_align_with_spaces" rel="noreferrer">Indent with tabs, align with spaces. Vim Tips Wiki</a>.</p>
<p><strong>UPDATE 2:</strong> I've just submitted an Apple Radar bug-report (enhancement) rdar://22285639. Here it is on the <a href="https://openradar.appspot.com/radar?id=5625019916877824" rel="noreferrer">open radar</a>.</p>
<p><strong>UPDATE 3:</strong> I received an answer from Apple. My bug is a duplicate of rdar://8165023. </p>
| 0non-cybersec
| Stackexchange | 433 | 1,357 |
Determinant of symmetric p-diagonal matrices. <p>Is there a simple method to compute the determinant of the following matrix</p>
<p>$A =\begin{bmatrix} d_1 & a & 0 & b & 0 &c &0 &0\\
a & d_2 & a & 0 & b & 0 & c & 0\\
0 & a & d_3 & a & 0 & b & 0 & c\\
b & 0 & a & d_4 & a & 0 & b & 0\\
0 & b & 0 & a & d_5 & a & 0 & b\\
c & 0 & b & 0 & a & d_6 & a & 0\\
0 & c & 0 & b & 0 & a & d_7 & a\\
0 & 0 & c & 0 & b & 0 & a &d_8
\end{bmatrix}$</p>
| 0non-cybersec
| Stackexchange | 314 | 662 |
Sync Android Memo with Evolution Memo. <p>The title sums it up. Right now I know I can sync my Android memos with a Gmail account. It puts them in a Notes folder (aka a label) on Gmail. But now Im unsure how to go from gmail to Evolution.</p>
<p>Evolution gives me two options in the Memo list creation. I can either do "CalDAV" and input a server, user, path or do "On The Web" with a URL and a username.</p>
<p>Any easy way to do this? Im thinking to find a static URL to my notes folder in gmail as something I can use for creating a Memo list in Evolution.</p>
<p>Thanks for any help!</p>
| 0non-cybersec
| Stackexchange | 175 | 596 |
Checking my answer on if this is a linear tranformation or not.. <p>Is the following function linear?</p>
<p><span class="math-container">$T: R^2 \Rightarrow R$</span> such that <span class="math-container">$T(v_1,v_2) = v_1 -v_2 + 5$</span></p>
<p><strong>My solution:</strong></p>
<p>Let <span class="math-container">$v_1 = (x_1,y_1)$</span> and let <span class="math-container">$v_2 = (x_2,y_2)$</span></p>
<p><span class="math-container">$T(\alpha v_1) = T(\alpha(x_1,y_1))$</span> = <span class="math-container">$T(\alpha x_1, \alpha y_1)$</span> = <span class="math-container">$\alpha(x_1-y_1) + 5$</span></p>
<p><span class="math-container">$\alpha(T(v_1)) = \alpha (x_1-y_1+5)$</span></p>
<p>Therefore, <span class="math-container">$T(\alpha v_1) \neq \alpha(T(v_1)$</span> and thus nonlinear.</p>
<p>Not sure if I did this correctly, could you please advise if not..thank you!
And if I did do it correctly, is there a simpler, more intuitive way of solving?</p>
| 0non-cybersec
| Stackexchange | 385 | 978 |
How to avoid variable scope issues within a map function?. <p>I have a working solution of this problem but I'm trying to make a cleaner and neat version of it as much as possible. I came up with another solution that uses a function within a map function. Unfortunately, this version has a few issues and I want to just know why the second solution is not working. I'm guessing it's a variable scope issue here. I'm looking forward to know your opinion about it.</p>
<p>I have a simple function that prints calendar days in an array!</p>
<p>So a question is why the first version of my code get the expected results while the second version prints unexpected results.</p>
<p>I tried to change <code>let</code> to <code>var</code> and I also made the <code>counter</code> and <code>startedIndexing</code> outside the function scope.</p>
<p><strong>Solution 1 (works):</strong></p>
<pre><code>const currentFullMonth = {
days_length: 31,
first_day: "Thu",
first_day_index: 4,
last_day: "Sat",
last_day_index: 6,
month: "Aug",
year: 2019
}
const testMonth = [
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0]
];
function printMonthCalender(month) {
let counter = 0;
let startedIdxing = false;
return month.map(week => {
return week.map((day, index) => {
if (index === currentFullMonth.first_day_index && !startedIdxing) {
counter++;
startedIdxing = true;
return counter;
} else if (startedIdxing) {
if (currentFullMonth.days_length === counter) {
counter = 0;
}
counter++;
return counter;
} else {
return 0;
}
});
});
} // end of Solution #1 <-- this works :)
</code></pre>
<p><strong>Solution 2 (doesn't work):</strong></p>
<pre><code>// start of Solution #2 <-- does not work :(
// im using two functions to make it look more cleaner
//
function printMonthCalender2(month) {
let counter = 0;
let startedIdxing = false;
return month.map(week => {
return week.map((day, index) =>
indexingMonth(counter, startedIdxing, index)
);
});
}
function indexingMonth(counter, startedIdxing, index) {
if (index === currentFullMonth.first_day_index && !startedIdxing) {
counter++;
startedIdxing = true;
return counter;
} else if (startedIdxing) {
if (currentFullMonth.days_length === counter) {
counter = 0;
}
counter++;
return counter;
} else {
return 0;
}
}// end of Solution #2
console.log(printMonthCalender(testMonth));
console.log(printMonthCalender2(testMonth));
</code></pre>
<p>expected result as follows (first version):</p>
<pre><code>[0, 0, 0, 0, 1, 2, 3]
[4, 5, 6, 7, 8, 9, 10]
[11, 12, 13, 14, 15, 16, 17]
[18, 19, 20, 21, 22, 23, 24]
[25, 26, 27, 28, 29, 30, 31]
[1, 2, 3, 4, 5, 6, 7]
</code></pre>
<p>unexpected result as follows (second version):</p>
<pre><code>[0, 0, 0, 0, 1, 0, 0]
[0, 0, 0, 0, 1, 0, 0]
[0, 0, 0, 0, 1, 0, 0]
[0, 0, 0, 0, 1, 0, 0]
[0, 0, 0, 0, 1, 0, 0]
[0, 0, 0, 0, 1, 0, 0]
</code></pre>
| 0non-cybersec
| Stackexchange | 1,123 | 3,359 |
Reference for a bilinear form lemma. <p>I encountered the result below in a paper that I am reading, and it does not have a reference. If anyone could provide me a reference, it would be very helpful.</p>
<p>Lemma: Let <span class="math-container">$Q^t$</span> be a family of <span class="math-container">$C^1$</span> bilinear forms defined in a Hilbert space. Let <span class="math-container">$Q^t$</span> be nondegenerate for <span class="math-container">$t\neq 0$</span> and <span class="math-container">$Q^t = U_t + C_t$</span>, where <span class="math-container">$U_t$</span> is positive definite with continuous inverse and <span class="math-container">$C_t$</span> is compact.
If <span class="math-container">$\left.\frac{d}{dt}Q^t\right|_{t=0}$</span> when restrict to <span class="math-container">$\ker(Q^0)$</span> has signature <span class="math-container">$\sigma$</span> and nullity <span class="math-container">$\mu$</span> we have
<span class="math-container">\begin{equation}
\sigma - \mu \leq index(Q^{-1}) - index(Q^{+1}) \leq \sigma + \mu.
\end{equation}</span></p>
<p>Thank you very much!</p>
| 0non-cybersec
| Stackexchange | 362 | 1,113 |
Parents of Reddit: Tonight I saved my daughter's life. LEARN FIRST AID.. So my infant daughter choked on puréed sweet potato tonight, and I successfully performed the baby heimlich maneuver.
Given that I have first aid training, I didn't panick, I just did what I knew to do. My wife on the other hand, did panick, and I should point out that she does not have training.
I could describe the technique i used here or link to a video, but I don't want to provide inaccurate information. Check your local area; oftentimes training is provided by the paramedics in your city, or the Red Cross. Some resources may even be free, otherwise the course is usually a nominal cost (around $20-$50).
Worst case scenario, check out YouTube. If you don't plan on taking a course, some knowledge from the internet is better than nothing.
Also, puréed sweet potato is thick. Stick to other fruits/veggies in the beginning. | 0non-cybersec
| Reddit | 222 | 919 |
Is this result on the bound of regularity of an ideal true?. <p>I am solving a problem in which i need to use the following result but i am not sure whether the result is true on not:</p>
<blockquote>
<p>If the ideals $I_0,...,I_n$ are generated by linear polynomials in $k[x_0,...,x_n]$ then $\mathrm{reg}(I_0+\cap_{i=1}^n I_i) \leq n$.</p>
</blockquote>
<p>Any counterexample or ideas to prove the above result? </p>
| 0non-cybersec
| Stackexchange | 142 | 423 |
Cauchy sequence in valued fields. <p>I can't understand this property, left unproved by my textbook as a trivial fact: let $K$ be a valued field, with valuation $\left|\phantom{x}\right|:K\longrightarrow\mathbb{R}$, let $\{a_n\}$ be a Cauchy sequence in $K$. Then $\{\left|a_n\right|\}$ is a Cauchy sequence in $\mathbb{R}$.</p>
<p>I think it suffices to prove that $\left| \left|a_n\right|-\left|a_m\right|\right|\leq\left|a_n-a_m\right|$, but I have no ideas.</p>
| 0non-cybersec
| Stackexchange | 156 | 467 |
limit proof at a point. Spivak, Chapter 5 problem 36b.. <p>Prove that $\lim_{x\to0^-} f(\frac{1}{x})=L$ iff $\lim_{x\to-\infty} f(x)=L$</p>
<p>Proof</p>
<p>$(\leftarrow)$</p>
<p>Suppose that $\lim_{x\to-\infty} f(x)=L$ Let $\epsilon>0$ then there exists a real number $N<0$ such that if $x<N$ then $|f(x)-L|<\epsilon$. If $0<-x<\frac{-1}{N}$ then $\frac{-1}{x}>-N\implies \frac{1}{x}<N\implies |f(1/x)-L|<\epsilon$. Thus $\lim_{x\to0^-} f(\frac{1}{x})=L$</p>
<p>$(\rightarrow)$</p>
<p>Suppose $\lim_{x\to0^-} f(\frac{1}{x})=L$. Let $\epsilon>0$ then there exists a $\delta>0$ and $0<0-x<\delta$ then $|f(\frac{1}{x})-L|<\epsilon$. Let $x>\frac{1}{\delta}\implies \frac{1}{x}<\delta \implies |f(\frac{1}{{\frac{1}{x}}})-L|=|f(x)-L|<\epsilon$. THus $\lim_{x\to-\infty} f(x)=L$.</p>
<p>Would this proof be correct?</p>
| 0non-cybersec
| Stackexchange | 408 | 875 |
New Overwatch Tournament Idea - winner take all $12K?. Hi Everyone - I don't post much but I wanted to get a "reddit gauge" on this idea. I have always been a fan of short tournaments in general. In college we had an ongoing beer pong/beirut tournament s(double elimination, winner take all) that garnered a nice crowd and a lot of fun/laughs. Also in sports, a 2/3 days tournament is always super fun and super energetic. You name it, old school Madden tournaments with buds, etc.
​
Do we think something like this would work? Also if I fronted the cash money, marketing expenses, etc. I wonder if I can get a sort of return on capital invested. It would be super fun to coordinate and discuss rules/format of the tournament. I would imagine with prize money involved we would get attention. Maybe pay a couple of twitch streamers to endorse us and stream the gameplay? But im weary that these tournaments already exist and we might need to find a niche.
​
Food for thought - I cant offer much besides this puny idea (and bankroll).
High Plat Flex player BTW - MrBrewFace#1861 | 0non-cybersec
| Reddit | 271 | 1,099 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
Can $f''(x)$ exist if $f'(x)$ is undefined?. <p>For example, the piecewise function</p>
<p><span class="math-container">$
f(x) =
\begin{cases}
\sqrt{1 - (x + 1)^2} &-2 \leq x \leq 0 \\
-\sqrt{1 - (x - 1)^2} &0 \leq x \leq 2
\end{cases}
$</span></p>
<p>will, at <span class="math-container">$f(0)$</span>, give <span class="math-container">$f'(0) = $</span> undefined (vertical tangent). Once deriving I can prove this algebraically, there is a zero in the denominator. It looked like an inflection point, so I wondered if <span class="math-container">$f''(x)$</span> would equal zero or undefined. After taking the (painstakingly ugly) second derivative, I ran into another zero in the denominator error, so <span class="math-container">$f''(0)$</span> is also undefined. Is this a general rule that if <span class="math-container">$f'(x)$</span> is undefined <span class="math-container">$f''(x)$</span> will also be undefined? </p>
<p>Thanks :)</p>
| 0non-cybersec
| Stackexchange | 336 | 982 |
Question about Distributional Derivative of Monotonically Non-decreasing function. <p>Suppose $f \geq 0$ on $\mathbb{R}$ be monotonically non-decreasing. Let $T_f$ be the distribution given by $f$. Then, $T_f \geq 0$ for all $\psi \in C^{\infty}_c(\mathbb{R})$ with $\psi(x) \geq 0$ on its support.</p>
<p>Is it then true that $T'_f$ is also a positive distribution? </p>
<p>As a side question, how does one prove that a function has distributional derivative given by a measure if $T_f$ is not positive? Is it possible for $T'_f$ to be given by a measure if $T'_f$ is not positive? </p>
| 0non-cybersec
| Stackexchange | 188 | 591 |
Getting black screen when connected with x11vnc. <p>I'm trying to run an x11vnc server so that someone can connect remotely to my computer, but I'm having trouble getting it to work. I'm using Ubuntu 14.04 and testing the VNC server by using Vinagre to connect on localhost. I get a login prompt and it accepts the password, but then I just get a black screen. This doesn't seem to be an uncommon problem but I've tried tons of solutions I've found through Google and none of them have worked for me. The x11vnc log doesn't give any indication of errors so I don't know where to begin to figure out what is wrong.</p>
<p>My x11vnc command:</p>
<pre><code>x11vnc -xkb -noxrecord -noxfixes -noxdamage -display :1 -auth /var/run/lightdm/root/:1 -usepw -forever -o /var/log/x11vnc.log
</code></pre>
<p>The x11vnc log:</p>
<pre><code>11/08/2015 15:14:43 Got connection from client 127.0.0.1
11/08/2015 15:14:43 other clients:
11/08/2015 15:14:43 Normal socket connection
11/08/2015 15:14:43 Disabled X server key autorepeat.
11/08/2015 15:14:43 to force back on run: 'xset r on' (3 times)
11/08/2015 15:14:43 incr accepted_client=5 for 127.0.0.1:48227 sock=7
11/08/2015 15:14:43 Client Protocol Version 3.8
11/08/2015 15:14:43 Protocol version sent 3.8, using 3.8
11/08/2015 15:14:43 rfbProcessClientSecurityType: executing handler for type 2
11/08/2015 15:14:46 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0xFFFFFEFE)
11/08/2015 15:14:46 Enabling NewFBSize protocol extension for client 127.0.0.1
11/08/2015 15:14:46 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x574D5669)
11/08/2015 15:14:46 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0xFFFFFEFD)
11/08/2015 15:14:46 Enabling full-color cursor updates for client 127.0.0.1
11/08/2015 15:14:46 Enabling X-style cursor updates for client 127.0.0.1
11/08/2015 15:14:46 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0xFFFFFEFF)
11/08/2015 15:14:46 Using tight encoding for client 127.0.0.1
11/08/2015 15:14:48 client useCopyRect: 127.0.0.1 -1
11/08/2015 15:14:48 client_set_net: 127.0.0.1 0.0001
</code></pre>
<p>My current ~/.vnc/xstartup (I've tried a bunch of variations):</p>
<pre><code>#!/bin/sh
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &
</code></pre>
| 0non-cybersec
| Stackexchange | 919 | 2,618 |
How to deal with temporal coupling?. <p>I'm struggling because of this:</p>
<p>My classes have some methods that have temporal coupling. This is, some method <strong>MethodA</strong> has to be invoked first to "initialize" the data that <strong>MethodB</strong> needs to work properly.</p>
<p>I usually make the temporal coupling explicit by passing the offending dependency to <strong>"MethodB"</strong> <strong>as argument</strong>, like in this snippet:</p>
<pre><code>private class SomeClass
{
private string field;
private int count;
public SomeClass()
{
MethodA();
MethodB(field);
}
private void MethodA()
{
field = "Something";
}
private void MethodB(string str)
{
count = str.Length;
}
}
</code></pre>
<p>Although it makes things explicit I feel I'm doing something wrong. I end up having method that don't use fields at all (static methods!), so the class starts to seem less cohesive.</p>
<p>Is this the best way to do it? (losing cohesion by passing arguments)</p>
<p>EDIT: Regarding some answers that suggest using field as a parameter in the constructor or using the Builder Pattern to avoid invalid states: <strong>I cannot do that, because in my case I'm building a Parser</strong>. MethodA reads the input and sets the state depending on it (reading characters from a file) and then, MethodB is invoked. They have to be invoked in the correct order. That is the real problem: one should be invoked before the other.</p>
| 0non-cybersec
| Stackexchange | 394 | 1,521 |
Is it possible for a valid block to be added to an invalid one, and have it accepted by another client?. <p>This wiki page says <a href="https://en.bitcoin.it/wiki/Invalid_block" rel="nofollow">invalid blocks aren't counted towards determining chain length</a> and that make me want understand how invalid blocks are treated.</p>
<ul>
<li>Can an valid block be added to an invalid one.. and have it accepted by one or more clients?</li>
</ul>
<p><em><strong>If so...</em></strong></p>
<ul>
<li>Do miners of invalid blocks receive a reward for the block? Are the Tx's valid? Are there any examples?</li>
</ul>
<p>Suppose an invalid block is created and valid block is added to that invalid one. Both blocks are added to the primary chain. ( assume the attacker has 25% compute and has a custom client that pushes both transactions to all peers)</p>
<ul>
<li><p>Since every block has a reward, is the reward in the invalid block counted?</p></li>
<li><p>Are the transactions within an invalid block still considered valid?</p></li>
</ul>
<p>I'm interested in tracing the transactions the occur from these "broken" blocks and to see if my hand-coded client processes the transactions correctly. </p>
| 0non-cybersec
| Stackexchange | 330 | 1,205 |
Assigning IP addresses to multiple VMs that are regularly powered off and on. <p>I have a newbie networking question. In my office there are about 200 machines on 192.168.0.x IPs. At home I have a similar setup but with far fewer IPs. I run 5 virtual machines on my local machine and I have given them all 192.168.0.x IPs too but this seems wasteful because they only ever need to talk to one another. The default gateway is 192.168.0.1. Should I give my VMs IPs of 192.168.100.x ? 192.168.122.x ? What's so special about having VMs on 192.168.<strong>100</strong>.x / 192.168.<strong>122</strong>.x IPs ? If this is the right thing to do, what should the default gateway be set to ? I assume that if I have a VM with a 192.168.100.x address when it won't be able to use the 192.168.0.1 gateway ? Many thanks.</p>
| 0non-cybersec
| Stackexchange | 245 | 824 |
Pokemon Let's Go to feature "Master Trainers" that provide a tough challenge. [https://twitter.com/PLDHnet/status/1051855823993860096](https://twitter.com/PLDHnet/status/1051855823993860096)
Masuda from an interview over at Polygon.
"A good portion of the more difficult stuff is in the post-game. There's ways to strengthen your Pokemon and the reason you wanna do that is, you take on these master trainers, these really powerful trainers that you encounter after the main story." | 0non-cybersec
| Reddit | 130 | 487 |
Find the cardinality of the set of all obtuse triangles on Cartesian plane. <blockquote>
<p>Find the cardinality of the set of all obtuse triangles on Cartesian plane</p>
</blockquote>
<p>I have attempted this problem, but I am not sure whether or not my solution is correct. <br> <br></p>
<p>Let's represent an obtuse triangle as $(x,y,z) \in (R^2) \times (R^2) \times (R^2)$ where $x, y, z$ are the vertices of the triangle. Now, since this triangle is obtuse, we have that $(d(x,y))^2 + (d(y,z))^2 < (d(x,z))^2$. Now, let's fix $x = (0,0)$ and $y = (1,1)$. Let $z = (0, z_1)$. By doing this, we get this inequality:
$$2 + z^2 < 1 + (z-1)^2 \iff 0 < z < 1$$
Now, consider these two sets: <br>
$$\{x\} \times \{y \} \times (0,1)$$ (The set of all obtuse triangles with two vertices fixed at $(0,0)$ and $(1,1)$ and the third one fixed on the x - axis, on the segment $(0,1)$. The cardinality of this set is continuum. Thus, the cardinality of the set in question is bounded form below by continuum. It's also bounded from above by the cardinality of $(\mathbb R^2)^3$ Thus, it's cardinality is continuum.</p>
| 0non-cybersec
| Stackexchange | 376 | 1,127 |
Googlecast SSDP and MDNS queries on network despite not having any chromecast applications installed in main computer. <p>As title states,</p>
<p>Ive detected some MDNS queries from a googlecast address, which is strange since i don't have any googlecast apps or similar installed.</p>
<p>Additionally My PC is sending SSDP packets to 239.255.255.250 (subnet?) regarding 'M-Search: HTTP/1.1' strings to Chrome OS machine.</p>
<p>MDNS Packet : 192.168.1.65 224.0.0.251 MDNS 119 Standard query 0x000b PTR _674A0243._sub._googlecast._tcp.local, "QM" question PTR _8E6C866D._sub._googlecast._tcp.local, "QM" question PTR _googlecast._tcp.local, "QM" question</p>
<p>SSDP Packet: 192.168.1.67 239.255.255.250 SSDP 216 M-SEARCH * HTTP/1.1 </p>
<p>Perhaps its good to mention that i noticed the specified 'User-agent' for these SSDP packets are stated as either 'Google Chrome' or 'Chrome OS'. Is this just a default function of Google chrome to include their DIAL tech. </p>
| 1cybersec
| Stackexchange | 315 | 987 |
Prove the Sequence of Inequalities. <blockquote>
<p>Let <span class="math-container">$\text{gpd} (n)$</span> denotes the <em>greatest prime divisor of <span class="math-container">$n$</span></em>. Then examine there exist infinitely many <span class="math-container">$n$</span> for which we have <span class="math-container">$\text{gpd} (n)$</span> <span class="math-container">$>$</span> <span class="math-container">$\text{gpd} (n+1)$</span> <span class="math-container">$>$</span> <span class="math-container">$\text{gpd} (n+2)$</span>.</p>
<p>More generally find the values of <span class="math-container">$k$</span> such that <span class="math-container">$\text{gpd} (n)$</span> <span class="math-container">$>$</span> <span class="math-container">$\text{gpd} (n+1)$</span> <span class="math-container">$>$</span> <span class="math-container">$\text{gpd} (n+2)$</span> <span class="math-container">$>$</span> <span class="math-container">$\cdots$</span> <span class="math-container">$>$</span> <span class="math-container">$\text{gpd} (n+k)$</span>.</p>
</blockquote>
<p>I cannot find the trick to tackle this problem. It can be shown that for infinitely many <span class="math-container">$n$</span> we have <span class="math-container">$\text{gpd} (n)$</span> <span class="math-container">$>$</span> <span class="math-container">$\text{gpd} (n+1)$</span>. This is trivial but after this I am unable to make any progress.</p>
| 0non-cybersec
| Stackexchange | 500 | 1,452 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.