text
stringlengths
3
1.74M
label
class label
2 classes
source
stringclasses
3 values
Build Your Own Blockchain — Writing Nodes that Mine and Talk.
0non-cybersec
Reddit
Compare graphs by using different slopes. <p>I have two equations</p> <p>First one is $\beta q_1 x_1 + q_2 x_2 =I-\gamma$</p> <p>Second one is $q_1x_1+q_2 x_2=I$</p> <p>where $\beta q_1\lt q_1$ and $I-\gamma\lt I$ and all are positive. </p> <p>The slope of the first model is =-$q_2\over\beta q_1$</p> <p>And the slope of the second model is =-$q_2\over q_1$</p> <p>I think the first slope is greater than the second slope. Right? I am not sure. Please check the comparison again.</p> <p>Then, how are their graphs? I posted below. First figure or second figure represents the equations ? </p> <p>Which graph is true?</p> <p>The second one seems more correct to me. Am I right?</p> <p><a href="https://i.stack.imgur.com/KG7r7.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KG7r7.jpg" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
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
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
Equivalent formulation of $\sum_{A \subseteq X} \sum_{x\neq y, x,y \in A} f(x)f(y)$?. <p>For any finite set $X$, for all $f: X \longrightarrow \mathbb R$, $$ \sum_{A \subseteq X} \sum_{x \neq y x,y \in A} f(x)\cdot f(y) = \sum_{A \subseteq X} \sum_{x \in A, y \not \in A} f(x) \cdot f(y).$$</p> <p>I can show this equality by taking a bit of a detour, as follows. </p> <p>Let $N = |X|$. Fix an enumeration $\{A_i\}$ of all subsets of $X$ so that for each $i,j$, $|i - j| = 2^{N-1}$ iff $A_j = X \setminus A_i$. For each $i \leq 2^{N}$, let $i^*$ be the unique $j$ such that $|i - j| = 2^{N-1}$. For each $i \leq 2^N$ and each $y \in A_i$, let $i_y$ be the unique $j$ such that $A_j = A_i \setminus \{y\}$.</p> <p>Now, we can think of each term in the sum on the left hand side as an element of $${\cal A}:= \bigcup_i \{ ((x,i),(y,i)) : x \neq y, x,y \in A_i \}.$$ And we can think of each term in the sum on the right hand side as an element of $${\cal B}:= \bigcup_{i} \{ ((x,i),(y,i^*)) : x \in A_i, y \in A_{i^*} \}.$$</p> <p>Note now that the following function is a bijection from $\cal A$ to $ \cal B$: $$\phi(((x,i),(y,i))) = ((x,i_y),(y,i_y^*)).$$</p> <p>And this, I take it, establishes the desired result. But I'm hoping for a more straightforward proof. </p>
0non-cybersec
Stackexchange
How I feel my Pokémon GO event will go....
0non-cybersec
Reddit
🔥 Lava flow 🔥.
0non-cybersec
Reddit
How to know if a bastion or vpn is the right solution?. <p>How do you choose between using a bastion or VPN when providing access to a vlan? I have seen many different setups, but don't have a good idea on how to make a less subjective selection. Is there a known list to help select? I know there are many factors including price, vendor, technical experience, preference, etc., that aside, I hope there is a more standard way to pick.</p>
0non-cybersec
Stackexchange
Problem on finding approximation in C[0,1]. <p>Let $X=C[0,1]$ with the inner product $\langle x,y\rangle=\int_0^1 x(t)\overline y(t)\,dt$ $\forall$ $x(t),y(t)\in C[0,1]$ </p> <p>$X_0 =\{x(t) \in X :\int_0^1 t^2x(t)\,dt=0\}$and $X_0^\bot$ be the orthogonal complement of $X_0$.</p> <p>let $y(t)=t^3$, $t\in [0,1]$ and $x_0\in X_0^\bot$ be the approximate of $y$. Then $x_0(t)$,t$\in$[0,1] is </p> <p>(1)$\frac{4t^2}{5}$</p> <p>(2)$\frac{5t^2}{6}$</p> <p>(3)$\frac{6t^2}{7}$</p> <p>(4)$\frac{7t^2}{8}$</p> <p>answer i am obtaining is (5/6)$t^2$ but given ans is (4/5)$t^2$</p> <p>i have done it as:</p> <p>$X_0 =[span(t^2)]^\bot$ </p> <p>$X_0^\bot =[span(t^2)]^{\bot\bot}$ = span($t^2$)</p> <p>now using othogonality,</p> <p>&lt;$t^3-at^2,t^2$>=0 which gives a=5/6</p> <p>&amp; therefore,$x_0(t)$=(5/6)$t^2$</p> <p>is this correct or am i wrong somewhere</p> <p>thanks in advance...</p>
0non-cybersec
Stackexchange
Poblano Pork Stew over Tomatillo Rice | Hostess At Heart.
0non-cybersec
Reddit
Why does adding two decimals in Javascript produce a wrong result?. <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/588004/is-javascripts-math-broken">Is JavaScript&rsquo;s Math broken?</a> </p> </blockquote> <p>Why does JS screw up this simple math?</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>console.log(.1 + .2) // 0.3000000000000004 console.log(.3 + .6) // 0.8999999999999999</code></pre> </div> </div> </p> <p>The first example is greater than the correct result, while the second is less. ???!! How do you fix this? Do you have to always convert decimals into integers before performing operations? Do I only have to worry about adding (* and / don't appear to have the same problem in my tests)?</p> <p>I've looked in a lot of places for answers. Some tutorials (like shopping cart forms) pretend the problem doesn't exist and just add values together. Gurus provide complex routines for various math functions or mention JS "does a poor job" in passing, but I have yet to see an explanation.</p>
0non-cybersec
Stackexchange
Keep Mocha tests alongside source files. <p>I currently have my NodeJS source files in <code>src</code> and test suites in <code>test</code>, e.g.:</p> <pre><code>/src/bar/baz/foo.js /test/bar/baz/foo.spec.js </code></pre> <p>This leads to awkward require statements like <code>var foo = require('../../../src/bar/baz/foo')</code>. And it's hard to see at a glance which source files are missing tests. I would like to instead keep my test suites in the same directory as the relevant source files:</p> <pre><code>/src/bar/baz/foo.js /src/bar/baz/foo.spec.js </code></pre> <p>But now running <code>mocha --recursive src</code> causes errors as Mocha tries to run my source files as tests.</p> <p>I've seen suggestions of using <code>find</code> or <code>gulp</code> to filter the file list but I find it surprising that this can't be done with plain Mocha. What's the recommended way of organising files this way?</p>
0non-cybersec
Stackexchange
Dell Vostro screen flickering with pink color. <p>My laptop's screen started flickering, and I don't have a clue as to why this is happening. This Dell Vostro 2520 laptop came with Ubuntu 12.04 pre-installed. </p> <p><a href="https://i.imgur.com/rru8xdg.gifv" rel="nofollow noreferrer">http://i.imgur.com/rru8xdg.gifv</a></p>
0non-cybersec
Stackexchange
TIL the Q in Q-Tip stands for Quality, and they were originally called Baby Gays..
0non-cybersec
Reddit
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
The Culture.
0non-cybersec
Reddit
Is there a function with this property?. <p>Is there a real function over the real numbers with this property $\ \sqrt{|x-y|} \leq |f(x)-f(y)|$ ? My guess is no but can anyone tell me why? This came up as a question of one of my collegues and i cant give an answer.</p>
0non-cybersec
Stackexchange
Towards Vulnerability Discovery Using Staged Program Analysis Bhargava Shastry1, Fabian Yamaguchi2, Konrad Rieck2, and Jean-Pierre Seifert1 1 Security in Telecommunications, TU Berlin, Germany 2 Institute of System Security, TU Braunschweig, Germany Abstract. Eliminating vulnerabilities from low-level code is vital for securing software. Static analysis is a promising approach for discov- ering vulnerabilities since it can provide developers early feedback on the code they write. But, it presents multiple challenges not the least of which is understanding what makes a bug exploitable and conveying this information to the developer. In this paper, we present the design and implementation of a practical vulnerability assessment framework, called Mélange. Mélange performs data and control flow analysis to di- agnose potential security bugs, and outputs well-formatted bug reports that help developers understand and fix security bugs. Based on the intu- ition that real-world vulnerabilities manifest themselves across multiple parts of a program, Mélange performs both local and global analyses. To scale up to large programs, global analysis is demand-driven. Our proto- type detects multiple vulnerability classes in C and C++ code including type confusion, and garbage memory reads. We have evaluated Mélange extensively. Our case studies show that Mélange scales up to large code- bases such as Chromium, is easy-to-use, and most importantly, capable of discovering vulnerabilities in real-world code. Our findings indicate that static analysis is a viable reinforcement to the software testing tool set. Keywords: Program Analysis, Vulnerability Assessment, LLVM 1 Introduction Vulnerabilities in popularly used software are not only detrimental to end-user security but can also be hard to identify and fix. Today’s highly inter-connected systems have escalated the damage inflicted upon users due to security com- promises as well as the cost of fixing vulnerabilities. To address the threat landscape, software vendors have established mechanisms for software quality assurance and testing. A prevailing thought is that security bugs identified and fixed early impose lower costs than those identified during the testing phase or in the wild. Thus, vulnerability re-mediation—the process of identifying and fixing vulnerabilities—is being seen as part of the software development process rather than in isolation [28]. ar X iv :1 50 8. 04 62 7v 2 [ cs .C R ] 6 A pr 2 01 6 2 Program analysis provides a practical means to discover security bugs during software development. Prior approaches to vulnerability discovery using static code analysis have ranged from simple pattern-matching to context and path- sensitive data-flow analysis. For instance, ITS4 [42]—a vulnerability scanner for C/C++ programs—parses source code and looks up lexical tokens of in- terest against an existing vulnerability database. In our initial experiments, the pattern-matching approach employed by ITS4 produced a large number of warn- ings against modern C, and C++ codebases. On the contrary, security vulnera- bilities are most often, subtle corner cases, and thus rare. The approach taken by ITS4 is well-suited for extremely fast analysis, but the high amount of manual effort required to validate warnings undermines the value of the tool itself. On the other end of the spectrum, the Clang Static Analyzer [4] presents an analytically superior approach for defect discovery. Precise—context and path sensitive—analysis enables Clang SA to warn only when there is evidence of a bug in a feasible program path. While precise warnings reduce the burden of manual validation, we find that Clang SA’s local inter-procedural analysis misses security bugs that span file boundaries. The omission of bugs that span file boundaries is significant especially for object-oriented code3, where object implementation and object use are typically in different source files. A natural solution is to make analysis global. However, global analysis does not scale up to large programs. In this paper, we find a middle ground. We present the design and implemen- tation of Mélange, a vulnerability assessment tool for C and C++ programs, that performs both local and global analysis in stages to discover potential vulner- abilities spanning source files. Mélange has been implemented as an extension to the LLVM compiler infrastructure [32]. To keep analysis scalable, Mélange performs computationally expensive analyses locally (within a source file), while performing cheaper analyses globally (across the whole program). In addition, global analysis is demand-driven: It is performed to validate the outcome of local analyses. To provide good diagnostics, Mélange primarily analyzes source code. It outputs developer-friendly bug reports that point out the exact position in source code where potential vulnerabilities exist, why they are problematic, and how they can be remedied. Results from our case studies validate our design decisions. We find that Mélange is capable of highlighting a handful of problematic corner cases, while scaling up to large programs like Chromium, and Firefox. Since Mélange is im- plemented as an extension to a widely used compiler toolchain (Clang/LLVM), it can be invoked as part of the build process. Moreover, our current implementa- tion is fast enough to be incorporated into nightly builds4 of two large codebases (MySQL, Chromium), and with further optimizations on the third (Firefox). In summary, we make the following contributions. 3All the major browsers including Chromium and Firefox are implemented in ob- ject-oriented code. 4Regular builds automatically initiated overnight on virtual machine clusters 3 1. We present the design and implementation of Mélange, an extensible pro- gram analysis framework. 2. We demonstrate the utility of Mélange by employing it to detect multiple classes of vulnerabilities, including garbage reads and incorrectly typed data, that are known to be a common source of exploitable vulnerabilities. 3. We evaluate Mélange extensively. We benchmark Mélange against NIST’s Juliet benchmark [36] for program analysis tools. Mélange has thus far de- tected multiple known vulnerabilities in the PHP interpreter, and Chromium codebases, and discovered a new defect in Firefox. 2 Background: Clang and LLVM Mélange is anchored in the Clang/LLVM open-source compiler toolchain [13], an outcome of pioneering work by Lattner et al. [32]. In this section, we re- view components of this toolchain that are at the core of Mélange’s design. While Clang/LLVM is a compiler at heart, it’s utility is not limited to code generation/optimization. Different parts of the compiler front-end (Clang) and back-end (LLVM) are encapsulated into libraries that can be selectively used by client systems depending on their needs. Thus, the LLVM project lends itself well to multiple compiler-technology-driven use-cases, program analysis being one of them. We build Mélange on top of the analysis infrastructure available within the LLVM project. This infrastructure mainly comprises the Clang Static Analyzer— a source code analyzer for C, C++, and Objective-C programs—and the LLVM analyzer/optimizer framework which permits analysis of LLVM Bitcode. In the following paragraphs, we describe each of these components briefly. 2.1 Clang Static Analyzer The Clang Static Analyzer (Clang SA) is similar in spirit to Metal/xgcc, which its authors classify as a “Meta-level Compilation” (MC) framework [21,24]. The goal of an MC framework is to allow for modular extensions to the compiler that enable checking of domain-specific program properties. Abstractly viewed, an MC framework comprises a set of checkers (domain-specific analysis procedures) and a compilation system. The division of labor envisioned by Hallem et al. [24] is that checkers only encode the property to check, leaving the mechanics of the actual checking to the compilation system. The compilation system facilitates checking by providing the necessary analysis infrastructure. Figure 1 shows how an MC framework is realized in Clang SA. Source files are parsed and subsequently passed on to the Data-Flow Analysis engine (DFA engine), which provides the analysis infrastructure required by checkers. Checkers encode the program property to be checked and produce bug reports if a violation is found. Bug reports are then reviewed by a human analyst. 4 Source File Bug Reports Clang Static Analyzer Checkers Graph Reachability Engine Symbolic Execution Engine DFA Engine Fig. 1: Clang Static Analyzer overview Data-flow Analysis Engine Clang SA performs Context and Path sensitive in- ter-procedural data-flow analysis. Context sensitivity means that the analysis preserves the calling context of function calls; path sensitivity means that the analysis explores paths forked by branch statements independently. Context sen- sitivity is realized in the Graph Reachability Engine which implements a name- sake algorithm proposed by Reps et al. [37]. Path sensitivity is implemented in the Symbolic Execution Engine. The symbolic execution engine uses static Forward Symbolic Execution (FSE) [38] to explore program paths in a source file. Checkers Checkers implement domain-specific checks and issue bug reports. Clang SA contains a default suite of checkers that implement a variety of checks including unsafe API usage, and memory access errors. More importantly, the checker framework in Clang SA can be used by programmers to add custom checks. To facilitate customized checks, Clang SA exposes callbacks (as APIs) that hook into the DFA engine at pre-defined program locations. Clang SA and its checkers seen together, demonstrate the utility of meta-level compilation. 2.2 LLVM Pass Infrastructure The LLVM pass infrastructure [13] provides a modular means to perform anal- yses and optimizations on an LLVM Intermediate Representation (IR) of a pro- gram. LLVM IR is a typed, yet source-language independent representation of a program that facilitates uniform analysis of whole-programs or whole-libraries. Simply put, an LLVM Pass is an operation (procedure invocation) on a unit of LLVM IR code. The granularity of code operated on can vary from a Function to an entire program (Module in LLVM parlance). Passes may be run in sequence, allowing a successive pass to reuse information from (or work on a transformation carried out by) preceding passes. The LLVM pass framework provides APIs to tap into source-level meta-data in LLVM IR. This provides a means to bridge the syntactic gap between source-level and IR-level analyses. Source literals may be matched against LLVM IR meta-data programmatically. Mélange takes this approach to teach the LLVM pass what a source-level bug report means. 5 LLVM Builder WP Analyzer Mélange Extended Diagnostics B u i l d I n t e r c e p t o r Native Compiler Source Analyzer Library or Executable Bitcode Analysis Codebase Candidate Bug Reports Native Library or Executable Fig. 2: Mélange overview 3 Mélange Our primary goal is to develop an early warning system for security-critical software defects. We envision Mélange as a tool that assists a developer in iden- tifying, and fixing potential security bugs during software development. Figure 2 provides an overview of our approach. Mélange comprises four high-level com- ponents: the build interceptor, the LLVM builder, the source analyzer, and the Whole-Program (WP) analyzer. We summarize the role of each component in analyzing a program. Subsequently, we describe them in greater detail. 1. Build Interceptor. The build interceptor is a program that interposes be- tween the build program (e.g., GNU-Make) and the compilation system (e.g., Clang/LLVM). In Mélange, the build interceptor is responsible for correctly and independently invoking the program builders and the source analyzer. (§3.1) 2. LLVM Builder. The LLVM builder is a utility program that assists in gen- erating LLVM Bitcode for C, C++, and Objective-C programs. It mirrors steps taken during native compilation onto LLVM Bitcode generation. (§3.1) 3. Source Analyzer. The source analyzer executes domain-specific checks on a source file and outputs candidate bug reports that diagnose a potential secu- rity bug. The source analyzer is invoked during the first stage of Mélange’s analysis. We have implemented the source analyzer as a library of checkers that plug into a patched version of Clang SA. (§3.2) 4. Whole-Program Analyzer. The WP analyzer examines candidate bug reports (from Step 3), and either provides extended diagnostics for the report or classifies it as a false positive. The developer is shown only those reports that have extended diagnostics i.e., those not classified as a false positive by the WP analyzer. We have implemented the WP analyzer in multiple LLVM passes. (§3.3) 6 3.1 Analysis Utilities Ease-of-deployment is one of the design goals of Mélange. We want software de- velopers to use our analysis framework in their build environments seamlessly. The build interceptor and the LLVM builder are analysis utilities that help us achieve this goal. The build interceptor and the LLVM builder facilitate trans- parent analysis of codebases by plugging in Mélange’s analyses to an existing build system. We describe them briefly in the following paragraphs. Build Interceptor Our approach to transparently analyze large software projects hinges on triggering analysis via the build command. We use an existing build interceptor, scan-build [12], from the Clang project. scan-build is a command-line utility that intercepts build commands and invokes the source analyzer in tandem with the compiler. Since Mélange’s WP analysis is targeted at program (LLVM) Bitcode, we instrument scan-build to not only invoke the source analyzer, but also the LLVM builder. LLVM Builder Generating LLVM Bitcode for program libraries and executables without modifying source code and/or build configuration is a daunting task. Fortunately, the Whole-program LLVM (WLLVM) [14], an existing open-source LLVM builder, solves this problem. WLLVM is a python-based utility that lever- ages a compiler for generating whole-program or whole-library LLVM Bitcode. It can be used as a drop-in replacement for a compiler i.e., pointing the builder (e.g., GNU-Make) to WLLVM is sufficient. 3.2 Source Analyzer The source analyzer assists Mélange in searching for potential bugs in source code. We build an event collection system to aid this search. Our event collection system is flexible enough to cater to multiple use-cases. It can be employed to detect both traditional taint-style vulnerabilities as well as semantic defects. The event collection system is implemented as a system of taints on C and C++ language constructs (Declarations). We call the underlying mechanism Declaration Tainting because taints in the proposed event collection system are associated with AST Declaration identifiers of C and C++ objects. We write checkers to flag defects. Checkers have been developed as clients of the proposed event collection system. The division of labor between checkers and the event collection system mirrors the Meta-level Compilation concept: Checkers encode the policy for flagging defects, while the event collection system maintains the state required to perform checks. We have prototyped this system for flagging garbage (uninitialized) reads5 of C++ objects, incorrect type casts in PHP interpreter codebase, and other Common Weakness Enumerations (see §4). 5The algorithm for flagging garbage reads is based on a variation of gen-kill sets [30]. 7 We demonstrate the utility of the proposed system by using the code snippet shown in Listing 1.1 as a running example. Our aim is to detect uninitialized reads of class members in the example. The listing encompasses two source files, foo.cpp and main.cpp, and a header file foo.h. We maintain two sets in the event collection system: the Def set containing declaration identifiers for class members that have at least one definition, and the UseWithoutDef set containing identifiers for class members that are used (at least once) without a preceding definition. We maintain an instance of both sets for each function that we analyze in a translation unit i.e., for function F , ∆F denotes the analysis summary of F that contains both sets. The checker decides how the event collection sets are populated. The logic for populating the Def and UseWithoutDef sets is simple. If a program statement in a given function defines a class member for the very first time, we add the class member identifier to the Def set of that function’s analysis summary. If a program statement in a given function uses a class member that is absent from the Def set, we add the class member identifier to the UseWithoutDef set of that function’s analysis summary. 1 // foo.h 2 class foo { 3 public: 4 int x; 5 foo() {} 6 bool isZero (); 7 }; 8 9 // foo.cpp 10 #include "foo.h" 11 12 bool foo:: isZero () { 13 if (!x) 14 return true; 15 } 16 17 // main.cpp 18 #include "foo.h" 19 20 int main() { 21 foo f; 22 if (f.isZero ()) 23 return 0; 24 return 1; 25 } Listing 1.1: Running example–The foo object does not initialize its class member foo::x. The call to isZero on Line 22 leads to a garbage read on Line 13. 8 In Listing 1.1, when function foo::isZero in file foo.cpp is being analyzed, the checker adds class member foo::x to the UseWithoutDef set of ∆foo::isZero after analyzing the branch condition on Line 13. This is because the checker has not encountered a definition for foo::x in the present analysis context. Subsequently, analysis of the constructor function foo::foo does not yield any additions to either the Def or UseWithoutDef sets. So ∆foo::foo is empty. Finally, the checker compares set memberships across analysis contexts. Since foo::x is marked as a use without a valid definition in ∆foo::isZero and foo::x is not a member of the Def set in the constructor function’s analysis summary (∆foo::foo), the checker classifies the use of Line 13 as a candidate bug. The checker encodes the proof for the bug in the candidate bug report. Listing 1.2 shows how candi- date bug reports are encoded. The bug report encodes the location and analysis stack corresponding to the potential garbage (uninitialized) read. The proposed event collection approach has several benefits. First, by retrofitting simple declaration-based object tainting into Clang SA, we enable Checkers to perform analysis based on the proposed taint abstraction. Due to its general-purpose nature, the taint abstraction is useful for discovering other defect types such as null pointer dereferences. Second, the tainting APIs we expose are opt-in. They may be used by existing and/or new checkers. Third, our additions leverage high-precision analysis infrastructure already available in Clang SA. We have implemented the event collection system as a patch to the mainline version of Clang Static Analyzer. In the next paragraph, we describe how candidate bug reports are analyzed by our whole-program analyzer. 3.3 Whole-Program Analyzer Whole-program analysis is demand-driven. Only candidate bug reports are analyzed. The analysis target is an LLVM Bitcode file of a library or executable. There are two aspects to WP analysis: Parsing of candidate bug reports to construct a query, and the analysis itself. We have written a simple python- based parser to parse candidate bug reports and construct queries. The analysis itself is implemented as a set of LLVM passes. The bug report parser encodes queries as preprocessor directives in a pass header file. A driver script is used to recompile, and run the pass against all candidate bug reports. Our whole-program analysis routine is composed of a CallGraph analysis pass. We leverage an existing LLVM pass called the Basic CallGraph pass to build a whole-program call graph. Since the basic pass misses control flow at indirect call sites, we have implemented additional analyses to improve upon the precision of the basic callgraph. Foremost among our analyses is Class Hi- erarchy Analysis (CHA) [20]. CHA enables us to devirtualize those dynamically dispatched call sites where we are sure no delegation is possible. Unfortunately, CHA can only be undertaken in scenarios where no new class hierarchies are introduced. In scenarios where CHA is not applicable, we examine call instruc- tions to resolve as many forms of indirect call sites as possible. Our prototype resolves aliases of global functions, function casts etc. 9 Once program call graph has been obtained, we perform a domain-specific WP analysis. For instance, to validate garbage reads, the pass inspects loads and store to the buggy program variable or object. In our running example (Listing 1.1), loads and stores to the foo::x class member indicated in candidate bug report (Listing 1.2) are tracked by the WP garbage read pass. To this end, the program call graph is traversed to check if a load of foo::x does not have a matching store. If all loads have a matching store, the candidate bug report is classified as a false positive. Otherwise, program call-chains in which a load from foo::x does not have a matching store are displayed to the analyst in the whole-program bug report (Listing 1.2). // Source -level bug report // report -e6ed9c.html ... Local Path to Bug: foo::x->_ZN3foo6isZeroEv Annotated Source Code foo.cpp :4:6: warning: Potentially uninitialized object field if (!x) ^ 1 warning generated. // Whole -program bug report ---------- report -e6ed9c.html --------- [+] Parsing bug report report -e6ed9c.html [+] Writing queries into LLVM pass header file [+] Recompiling LLVM pass [+] Running LLVM BugReportAnalyzer pass against main --------------------------------------- Candidate callchain is: foo:: isZero () main ----------------------- Listing 1.2: Candidate bug report (top) and whole-program bug report (bottom) for garbage read in the running example shown in Listing 1.1. 4 Evaluation We have evaluated Mélange against both static analysis benchmarks and real- world code. To gauge Mélange’s utility, we have also tested it against known defects and vulnerabilities. Our evaluation seeks to answer the following ques- tions: 10 – What is the effort required to use Mélange in an existing build system? (§4.1) – How does Mélange perform against static analysis benchmarks? (§4.2) – How does Mélange fare against known security vulnerabilities? (§4.3) – What is the analysis run-time and effectiveness of Mélange against large well-tested codebases? (§4.4) 4.1 Deployability Ease-of-deployment is one of the design goals of Mélange. Build interposition al- lows us to analyze codebases as is, without modifying build configuration and/or source code. We have deployed Mélange in an Amazon compute instance where codebases with different build systems have been analyzed (see §4.4). Another benefit of build system integration is incremental analysis. Only the very first build of a codebase incurs the cost of end-to-end analysis; subsequent analyses are incremental. While incremental analysis can be used in conjunction with daily builds, full analysis can be coupled with nightly builds and initiated on virtual machine clusters. 4.2 NIST Benchmarks We used static analysis benchmarks released under NIST’s SAMATE project [35] for benchmarking Mélange’s detection rates. In particular, the Juliet C/C++ test suite (version 1.2) [36] was used to measure true and false positive detection rates for defects spread across multiple categories. The Juliet suite comprises test sets for multiple defect types. Each test set contains test cases for a specific Com- mon Weakness Enumeration (CWE) [41]. The CWE system assigns identifiers for common classes of software weaknesses that are known to lead to exploitable vulnerabilities. We implemented Mélange checkers and passes for the following CWE categories: CWE457 (Garbage or uninitialized read), CWE843 (Type con- fusion), CWE194 (Unexpected Sign Extension), and CWE195 (Signed to Un- signed Conversion Error). With the exception of CWE457, the listed CWEs have received scant attention from static analysis tools. For instance, type confusion (CWE843) is an emerging attack vector [33] for exploiting popular applications. Figure 3 summarizes the True/False Positive Rates (TPRs/FPRs) for Clang SA and Mélange for the chosen CWE benchmarks. Currently, Clang SA only sup- ports CWE457. Comparing reports from Clang SA and Mélange for the CWE457 test set, we find that the former errs on the side of precision (fewer false posi- tives), while the latter errs on the side of caution (fewer false negatives). For the chosen CWE benchmarks, Mélange attains a true-positive rate between 57–88 %, and thus, it is capable of spotting over half of the bugs in the test suite. Mélange’s staggered analysis approach allows it to present both source file wide and program wide diagnostics (see Figure 4). In contrast, Clang SA’s di- agnostics are restricted to a single source file. Often, the call stack information presented in Mélange’s extended diagnostics has speeded up manual validation of bug reports. 11 0 20 40 60 80 100 TPR FPR 34.27 15 59.33 29.66 57.5 0 88 52.5 88 52.5 Percentage ClangSA-CWE457 Melange-CWE457 Melange-CWE843 Melange-CWE195 Melange-CWE194 Fig. 3: Juliet test suite: True Positive Rate (TPR) and False Positive Rate (FPR) for Mélange, and Clang Static Analyzer. Clang SA supports CWE457 only. 4.3 Detection of Known Vulnerabilities We tested five known type-confusion vulnerabilities in the PHP interpreter with Mélange. All of the tested flaws are taint-style vulnerabilities: An attacker-con- trolled input is passed to a security-sensitive function call that wrongly interprets the input’s type. Ultimately all these vulnerabilities result in invalid memory accesses that can be leveraged by an attacker for arbitrary code execution or information disclosure. We wrote a checker for detecting multiple instances of this vulnerability type in the PHP interpreter codebase. For patched vulnera- bilities, testing was carried out on unpatched versions of the codebase. Mélange successfully flagged all known vulnerabilities. The first five entries of Table 1 summarize Mélange’s findings. Three of the five vulnerabilities have been as- signed Common Vulnerabilities and Exposures (CVE) identifiers by the MITRE Corporation. Reporters of CVE-2014-3515, CVE-2015-4147, and PHP report ID 73245 have received bug bounties totaling $5500 by the Internet Bug Bounty Panel [7]. In addition, we ran our checker against a recent PHP release candidate (PHP 7.0 RC7) released on 12th November, 2015. Thus far, Mélange has drawn atten- tion to PHP sub-systems where a similar vulnerability may exist. While we haven’t been able to verify if these are exploitable, this exercise demonstrates Mélange’s utility in bringing attention to multiple instances of a software flaw in a large codebase that is under active development. 4.4 Case Studies To further investigate the practical utility of Mélange, we conducted case stud- ies with three popular open-source projects, namely, Chromium, Firefox, and 12 Codebase CVE ID (Rating) Bug ID Vulnerability Known/New PHP CVE-2015-4147 69085 [9] Type-confusion Known PHP CVE-2015-4148 69085 [9] Type-confusion Known PHP CVE-2014-3515 67492 [8] Type-confusion Known PHP Unassigned 73245 [11] Type-confusion Known PHP Unassigned 69152 [10] Type-confusion Known Chromium (Medium-Severity) 411177 [2] Garbage read Known Chromium None 436035 [3] Garbage read Known Firefox None 1168091 [1] Garbage read New Table 1: Detection summary of Mélange against production codebases. Mélange has confirmed known vulnerabilities and flagged a new defect in Firefox. Listed Chromium and Firefox bugs are not known to be exploitable. Chromium bug 411177 is classified as a Medium-Severity bug in Google’s internal bug tracker. MySQL. We focused on detecting garbage reads only. In the following para- graphs, we present results from our case studies emphasizing analysis effective- ness, and analysis run-time. Software Versions: Evaluation was carried out for Chromium version 38 (dated August 2014), for Firefox revision 244208 (May 2015), and for MySQL version 5.7.7 (April 2015). Evaluation Setup: Analysis was performed in an Amazon compute instance running Ubuntu 14.04 and provisioned with 36 virtual (Intel Xeon E5-2666 v3) CPUs clocked at 2.6 GHz, 60 GB of RAM, and 100 GB of SSD-based storage. Effectiveness True Positives Our prototype flagged 3 confirmed defects in Chromium, and Firefox, including a new defect in the latter (see bottom three entries of Table 1). Defects found by our prototype in MySQL codebase have been reported upstream and are being triaged. Figure 4 shows Mélange’s bug report for a garbage read in the pdf library shipped with Chromium v38. The source-level bug report (Figure 4a) shows the line of code that was buggy. WP analyzer’s bug report (Figure 4b) shows candidate call chains in the libpdf library in which the uninitialized read may manifest. We have manually validated the veracity of all bug reports generated by Mélange through source code audits. For each bug report, we verified if the data-flow and control-flow information conveyed in the report tallied with pro- gram semantics. We classified only those defects that passed our audit as true positives. Additionally, for the Chromium true positives, we matched Mélange’s findings with reports [2, 3] generated by MemorySanitizer [40], a dynamic pro- gram analysis tool from Google. The new defect discovered in Firefox was re- ported upstream [1]. Our evaluation demonstrates that Mélange can complement dynamic program analysis tools in use today. 13 Bug Summary File: out_analyze/Debug/../../pdf/page_indicator.cc Location: line 94, column 19 Description: Potentially uninitialized object field Local Path to Bug: chrome_pdf::PageIndicator::fade_out_timer_id_→_ Annotated Source Code 1 // Copyright (c) 2012 The Chromium Authors. All rights reserv 2 // Use of this source code is governed by a BSD-style license 3 // found in the LICENSE file. 4 5 #include "pdf/page_indicator.h" 6 7 #include "base/logging.h" 8 #include "base/strings/string_util.h" 9 #include "pdf/draw_utils.h" 10 #include "pdf/number_image_generator.h" 11 #include "pdf/resource_consts.h" 12 13 namespace chrome_pdf { 14 15 16 PageIndicator::PageIndicator() 17 : current_page_(0), 18 // fade_out_timer_id_(0), 19 splash_timeout_(kPageIndicatorSplashTimeoutMs), 20 fade_timeout_(kPageIndicatorScrollFadeTimeoutMs), 21 always_visible_(false) { 22 } 23 24 PageIndicator::~PageIndicator() { 25 } f/page_indicator.cc ect field r::fade_out_timer_id_→_ZN10chrome_pdf13PageIndicator12OnTimerFiredEj rs. All rights reserved. y a BSD-style license that can be shTimeoutMs), FadeTimeoutMs), Bug Summary File: out_analyze/Debug/../../pdf/page_indicator.cc Location: line 94, column 19 Description: Potentially uninitialized object field Local Path to Bug: chrome_pdf::PageIndicator::fade_out_timer_id_→_ Annotated Source Code 1 // Copyright (c) 2012 The Chromium Authors. All rights reserv 2 // Use of this source code is governed by a BSD-style license 3 // found in the LICENSE file. 4 5 #include "pdf/page_indicator.h" 6 7 #include "base/logging.h" 8 #include "base/strings/string_util.h" 9 #include "pdf/draw_utils.h" 10 #include "pdf/number_image_generator.h" 11 #include "pdf/resource_consts.h" 12 13 namespace chrome_pdf { 14 15 16 PageIndicator::PageIndicator() 17 : current_page_(0), 18 // fade_out_timer_id_(0), 19 splash_timeout_(kPageIndicatorSplashTimeoutMs), 20 fade_timeout_(kPageIndicatorScrollFadeTimeoutMs), 21 always_visible_(false) { 22 } 23 24 PageIndicator::~PageIndicator() { ---------- page_indicator.cc.pass.html ---------- [+] Parsing bug report page_indicator.cc.pass.html [+] Writing queries into LLVM pass header file [+] Recompiling LLVM pass [+] Selecting LLVM BC for analysis [+] Target Found: libpdf.a [+] Running LLVM BugReportAnalyzer pass ----------------------- Candidate callchain is: chrome_pdf::PageIndicator::OnTimerFired(unsigned int) chrome_pdf::Instance::OnControlTimerFired(int, unsigned int const&, unsigned int) (b) Whole-program Bug Report (a) Source-level Bug Report Potentially uninitialized object field 81 &buffer, 82 pp::Rect(origin2, page_number_image.size()), 83 false); 84 } 85 86 // Drawing the buffer. 87 pp::Point origin = draw_rc.point(); 88 draw_rc.Offset(-rect().x(), -rect().y()); 89 AlphaBlend(buffer, draw_rc, image_data, origin, transparency 90 } 91 92 void PageIndicator::OnTimerFired(uint32 timer_id) { 93 FadingControl::OnTimerFired(timer_id); 94 if (timer_id == fade_out_timer_id_) { 95 Fade(false, fade_timeout_); 96 } 97 } 98 Fig. 4: Mélange bug report for Chromium bug 411177. False Positives Broadly, we encounter two kinds of false positives; those that are due to imprecision in Mélange’s data-flow analysis, and those due to imprecision in its control-flow analysis. In the following paragraphs, we describe one example of each kind of false positive. Data-flow imprecision: Mélange’s analyses for flagging garbage reads lack sophisticated alias analysis. For instance, initialization of C++ objects passed- by-reference is missed. Listing 1.3 shows a code snippet borrowed from the Fire- fox codebase that illustrates this category of false positives. When AltSvcMapping object is constructed (see Line 2 of Listing 1.3), one of its class members mHttps is passed by reference to the callee function SchemeIsHTTPS. The callee function SchemeIsHTTPS initializes mHttps via its alias (outIsHTTPS). Mélange’s garbage read checker misses the aliased store and incorrectly flags the use of class member mHttps on Line 8 as a candidate bug. Mélange’s garbage read pass, on its part, tries to taint all functions that store to mHttps. Since the store to mHttps happens via an alias, the pass also misses the store and outputs a legitimate control-flow sequence in its WP bug report. Control-flow imprecision: Mélange’s WP analyzer misses control-flow in- formation at indirect call sites e.g., virtual function invocations. Thus, class 14 Codebase Build Time Analysis Run-time∗ Bug Reports Nt SAx WPAx TAx WPAvgt Total True Positives Chromium 18m20s 29.09 15.49 44.58 7.5s 12 2 Firefox 41m25s 3.38 39.31 42.69 13m35s 16 1 MySQL 8m15s 9.26 21.24 30.50 2m26s 32 - ∗ All terms except WPAvg are normalized to native compilation time Table 2: Mélange: Analysis summary for large open-source projects. True posi- tives for MySQL have been left out since we are awaiting confirmation from its developers. members that are initialized in a call sequence comprising an indirect func- tion call are not registered by Mélange’s garbage read pass. While resolving all indirect call sites in large programs is impossible, we employ best-effort devir- tualization techniques such as Rapid Type Analysis [16] to improve Mélange’s control-flow precision. 1 AltSvcMapping :: AltSvcMapping (...) { 2 if (NS FAILED(SchemeIsHTTPS(originScheme, mHttps))) { 3 ... 4 } 5 } 6 void AltSvcMapping :: GetConnectionInfo (...) { 7 // ci is an object on the stack 8 ci->SetInsecureScheme(!mHttps); 9 ... 10 } 11 static nsresult SchemeIsHTTPS(const nsACString & originScheme , bool &outIsHTTPS) 12 { 13 outIsHTTPS = originScheme.Equals(NS LITERAL CSTRING("https")); 14 ... 15 } Listing 1.3: Code snippet involving an aliased definition that caused a false positive in Mélange. The last two columns of Table 2 present a summary of Mélange’s bug re- ports for Chromium, Firefox, and MySQL projects once both stages of analy- sis have been completed. We find that Mélange’s two-stage analysis pipeline is very effective at filtering through a handful of bug reports that merit attention. For instance, Mélange’s analyses output only twelve bug reports for Chromium, a codebase that spans over 14 million lines of code. Although Mélange’s true positive rate is low in our case studies, the corner cases it has pointed out, notwithstanding the confirmed bugs it has flagged, is encouraging. Given that 15 0 20 40 60 80 100 Chromium Firefox MySQL Fraction of Total Analysis Run-time (%) SAx WPAx Fig. 5: For each codebase, its source and whole-program analysis run-times are shown as fractions (in %) of Mélange’s total analysis run-time. we evaluated Mélange against well-tested production code, the fact that it could point out three confirmed defects in the Chromium and Firefox codebases is a promising result. We plan to make our tool production-ready by incorporat- ing insights gained from our case studies. Next, we discuss Mélange’s analysis run-time. Analysis Run-Time We completed end-to-analysis of Chromium, Firefox, and MySQL codebases—all of which have millions of lines of code—in under 48 hours. Of these, MySQL, and Chromium were analyzed in a little over 4 hours, and 13 hours respectively. Table 2 summarizes Mélange’s run-time for our case studies. We have presented the analysis run-time of a codebase relative (normalized) to its build time, Nt. For instance, a normalized analysis run-time of 30 for a codebase indicates that the time taken to analyze the codebase is 30x longer than its build time. All normalized run-times are denoted with the x subscript. Normalized source analysis time, WP analysis time, and total analysis time of Mélange are denoted as SAx, WPAx, and TAx respectively. The term WPAvgt denotes the average time (not normalized) taken by Mélange’s WP analyzer to analyze a single candidate bug report. Figure 5 shows source and WP analysis run-times for a codebase as a fraction (in percentage terms) of Mélange’s total analysis run-time. Owing to Chromium’s modular build system, we could localize a source defect to a small-sized library. The average size of program analyzed for Chromium (1.8MB) was much lower compared to MySQL (150MB), and Firefox (1.1GB). As a consequence, the WP analysis run-times for Firefox, and MySQL are relatively high. While our foremost priority while prototyping Mélange has been functional effectiveness, our implementation leaves significant room for optimizations that will help bring down Mélange’s end-to-end analysis run-time. 4.5 Limitations Approach Limitations By design, Mélange requires two analysis procedures at different code abstractions for a given defect type. We depend on programmer- written analysis routines to scale out to multiple defect types. Two actualities 16 lend credence to our approach: First, analysis infrastructure required to carry out extended analyses is already available and its use is well-documented. This has assisted us in prototyping Mélange for four different CWEs. Second, the complexity of analysis routines is many times lower than the program under analysis. Our analysis procedures span 2, 598 lines of code in total, while our largest analysis target (Chromium) has over 14 million lines of C++ code. While Mélange provides precise diagnostics for security bugs it has discov- ered, manual validation of bug reports is still required. Given that software routinely undergoes manual review during development, our tool does not intro- duce an additional requirement. Rather, Mélange’s diagnostics bring attention to problematic corner cases in source code. The manual validation process of Mélange’s bug reports may be streamlined by subsuming our tool under existing software development processes (e.g., nightly builds, continuous integration). Implementation Limitations Mélange’s WP analysis is path and context insen- sitive. This makes Mélange’s whole-program analyzer imprecise and prone to issuing false warnings. To counter imprecision, we can augment our WP ana- lyzer with additional analyses. Specifically, more powerful alias analysis and ag- gressive devirtualization algorithms will help prune false positives further. One approach to counter existing imprecision is to employ a ranking mechanism for bug reports (e.g., Z-Ranking [31]). 5 Related Work Program analysis research has garnered attention since the late 70s. Lint [29], a C program checker developed at Bell Labs in 1977, was one of the first program analysis tools to be developed. Lint’s primary goal was to check “portability, style, and efficiency” of programs. Ever since, the demands from a program checker have grown as new programming paradigms have been invented and programs have increased in complexity. This has contributed to the development of many commercial [5, 23, 27], closed-source [19], free [6], and open source [4, 15, 17, 18, 22, 26, 39, 40, 43, 44] tools. Broadly, these tools are based on Model Checking [17, 26], Theorem Proving [6], Static Program Analysis [4, 5, 19, 23, 27, 44], Dynamic Analysis [18, 34, 39, 40], or are hybrid systems such as AEG [15]. In the following paragraphs, we comment on related work that is close in spirit to Mélange. Program Instrumentation Traditionally, memory access bugs have been found by fuzz testing (or fuzzing) instrumented programs. The instrumentation takes care of tracking the state of program memory and adds run-time checks before memory accesses are made. Instrumentation is done either during run time (as in Valgrind [34]), or at compile time (as in AddressSanitizer or ASan [39]). Compile- time instrumentation has been preferred lately due to the poor performance of tools that employ run-time instrumentation. 17 While sanitizer tools such as ASan, and MemorySanitizer (MSan) are ex- pected to have a zero false positive rate, practical difficulties, such as uninstru- mented code in an external library, lead to false positives in practice. Thus, even run-time tools do not eliminate the need for manual validation of bug reports. To guarantee absence of uninitialized memory, MSan needs to monitor each and ev- ery load from/store to memory. This all-or-nothing philosophy poses yet another problem. Uninstrumented code in pre-compiled libraries (such as the C++ stan- dard library) used by the program will invariably lead to false program crashes. Until these false crashes are rectified—either by instrumenting the code where the crash happens or by asking the tool to suppress the warning—the sanitizer tool is rendered unusable. Thus, use of MSan impinges on instrumentation of each and every line of code that is directly or indirectly executed by the pro- gram or maintenance of a blacklist file that records known false positives. Unlike MSan, not having access to library source code only lowers Mélange’s analysis accuracy, but does not impede analysis itself. Having said that, Mélange will benefit from a mechanism to suppress known false positives. Overall, we believe that dynamic tools are invaluable for vulnerability assessment, and that a tool such as ours can complement them well. Symbolic Execution Symbolic execution has been used to find bugs in programs, or to generate test cases with improved code coverage. KLEE [18], Clang SA [4], and AEG [15] use different flavors of forward symbolic execution for their own end. As the program (symbolically) executes, constraints on program paths (path predicates) are maintained. Satisfiability queries on path predicates are used to prune infeasible program paths. Unlike KLEE and AEG, symbolic execution in Clang SA is done locally and hences scales up to large codebases. Anecdotal evidence suggests that KLEE and AEG don’t scale up to large programs [25]. To the best of our knowledge, KLEE has not been evaluated against even medium- sized codebases let alone large codebases such as Firefox and Chromium. Static Analysis Parfait [19] employs an analysis strategy that is similar in spirit to ours. It employs multiple stages of analysis, where each successive stage is more precise than the preceding stage. Parfait has been used for finding buffer overflows in C programs. In contrast, we have evaluated Mélange against mul- tiple vulnerability classes. Mélange’s effectiveness in detecting multiple CWEs validates the generality of its design. In addition, Mélange has fared well against multiple code paradigms: both legacy C programs and modern object-oriented code. Like Yamaguchi et al. [44], our goal is to empower developers in finding mul- tiple instances of a known defect. However, the approach we take is different. Yamaguchi et al. [44], use structural traits in a program’s AST representation to drive a Machine Learning (ML) phase. The ML phase extrapolates traits of known vulnerabilities in a codebase, obtaining matches that are similar in struc- ture to the vulnerability. CQUAL [22], and CQual++ [43], are flow-insensitive data-flow analysis frameworks for C and C++ languages respectively. Oink per- forms whole-program data-flow analysis on the back of Elsa, a C++ parser, and 18 Cqual++. Data-flow analysis is based on type qualifiers. Our approach has two advantages over Cqual++. We use a production compiler for parsing C++ code that has a much better success rate at parsing advanced C++ code than a cus- tom parser such as Elsa. Second, our source-level analysis is both flow and path sensitive while, in CQual++, it is not. Finally, Clang Static Analyzer borrows ideas from several publications in- cluding (but not limited to) [24, 37]. Inter-procedural context-sensitive analysis in Clang SA is based on the graph reachability algorithm proposed by Reps et al. [37]. Clang SA is also similar in spirit to Metal/xgcc [24]. 6 Conclusion We have developed Mélange, a static analysis tool for helping fix security-critical defects in open-source software. Our tool is premised on the intuition that vul- nerability search necessitates multi-pronged analysis. We anchor Mélange in the Clang/LLVM compiler toolchain, leveraging source analysis to build a corpus of defects, and whole-program analysis to filter the corpus. We have shown that our approach is capable of identifying defects and vulnerabilities in open-source projects, the largest of which—Chromium—spans over 14 million lines of code. We have also demonstrated that Mélange’s analyses are viable by empirically evaluating its run-time in an EC2 instance. Since Mélange is easy to deploy in existing software development environ- ments, programmers can receive early feedback on the code they write. Fur- thermore, our analysis framework is extensible via compiler plug-ins. This en- ables programmers to use Mélange to implement domain-specific security checks. Thus, Mélange complements traditional software testing tools such as fuzzers. Ultimately, our aim is to use the proposed system to help fix vulnerabilities in open-source software at an early stage. Acknowledgments This work was supported by the following grants: 317888 (project NEMESYS), 10043385 (project Enzevalos), and RI 2468/1-1 (project DEVIL). Authors would like to thank colleagues at SecT and Daniel Defreez for valuable feedback on a draft of this paper, and Janis Danisevskis for discussions on the C++ standard and occasional code reviews. References 1. Bugzilla@Mozilla, Bug 1168091. https://bugzilla.mozilla.org/show_bug.cgi? id=1168091 2. Chromium Issue Tracker, Issue 411177. https://code.google.com/p/chromium/ issues/detail?id=411177 3. Chromium Issue Tracker, Issue 436035. https://code.google.com/p/chromium/ issues/detail?id=436035 4. Clang Static Analyzer. http://clang-analyzer.llvm.org/, accessed: 2015-03-25 5. Coverity inc. http://www.coverity.com/ https://bugzilla.mozilla.org/show_bug.cgi?id=1168091 https://bugzilla.mozilla.org/show_bug.cgi?id=1168091 https://code.google.com/p/chromium/issues/detail?id=411177 https://code.google.com/p/chromium/issues/detail?id=411177 https://code.google.com/p/chromium/issues/detail?id=436035 https://code.google.com/p/chromium/issues/detail?id=436035 http://clang-analyzer.llvm.org/ http://www.coverity.com/ 19 6. HAVOC. http://research.microsoft.com/en-us/projects/havoc/ 7. PHP Bug Bounty Program. https://hackerone.com/php 8. PHP::Sec Bug, 67492. https://bugs.php.net/bug.php?id=67492 9. PHP::Sec Bug, 69085. https://bugs.php.net/bug.php?id=69085 10. PHP::Sec Bug, 69152. https://bugs.php.net/bug.php?id=69152 11. Report 73245: Type-confusion Vulnerability in SoapClient. https://hackerone. com/reports/73245 12. Scan-build. http://clang-analyzer.llvm.org/scan-build.html 13. The LLVM Compiler Infrastructure. http://llvm.org/ 14. WLLVM: Whole-program LLVM. https://github.com/travitch/ whole-program-llvm 15. Avgerinos, T., Cha, S.K., Hao, B.L.T., Brumley, D.: Aeg: Automatic exploit gen- eration. In: NDSS. vol. 11, pp. 59–66 (2011) 16. Bacon, D.F., Sweeney, P.F.: Fast static analysis of c++ virtual function calls. In: Proceedings of the 11th ACM SIGPLAN Conference on Object-oriented Program- ming, Systems, Languages, and Applications. pp. 324–341. OOPSLA ’96, ACM, New York, NY, USA (1996), http://doi.acm.org/10.1145/236337.236371 17. Ball, T., Rajamani, S.K.: The s lam project: debugging system software via static analysis. In: ACM SIGPLAN Notices. vol. 37, pp. 1–3. ACM (2002) 18. Cadar, C., Dunbar, D., Engler, D.R.: Klee: Unassisted and automatic generation of high-coverage tests for complex systems programs. In: OSDI. vol. 8, pp. 209–224 (2008) 19. Cifuentes, C., Scholz, B.: Parfait: designing a scalable bug checker. In: Proceedings of the 2008 workshop on Static analysis. pp. 4–11. ACM (2008) 20. Dean, J., Grove, D., Chambers, C.: Optimization of object-oriented programs using static class hierarchy analysis. In: ECOOP’95—Object-Oriented Programming, 9th European Conference, Åarhus, Denmark, August 7–11, 1995. pp. 77–101. Springer (1995) 21. Engler, D., Chelf, B., Chou, A., Hallem, S.: Checking system rules using system- specific, programmer-written compiler extensions. In: Proceedings of the 4th con- ference on Symposium on Operating System Design & Implementation-Volume 4. pp. 1–1. USENIX Association (2000) 22. Foster, J.S., Johnson, R., Kodumal, J., Terauchi, T., Shankar, U., Talwar, K., Wagner, D., Aiken, A., Elsman, M., Harrelson, C.: CQUAL: A tool for adding type qualifiers to C (2003), https://www.cs.umd.edu/~jfoster/cqual/, accessed: 2015-03-26 23. GrammaTech: CodeSonar. http://www.grammatech.com/codesonar 24. Hallem, S., Chelf, B., Xie, Y., Engler, D.: A system and language for building system-specific, static analyses. In: Proceedings of the ACM SIGPLAN 2002 Con- ference on Programming Language Design and Implementation. pp. 69–82. PLDI ’02, ACM, New York, NY, USA (2002), http://doi.acm.org/10.1145/512529. 512539 25. Heelan, S.: Vulnerability detection systems: Think cyborg, not robot. Security Pri- vacy, IEEE 9(3), 74–77 (May 2011) 26. Henzinger, T.A., Jhala, R., Majumdar, R., Sutre, G.: Software verification with blast. In: Model Checking Software, pp. 235–239. Springer (2003) 27. Hewlett Packard: Fortify Static Code Analyzer. http://www8.hp.com/us/en/ software-solutions/static-code-analysis-sast/ 28. Howard, M., Lipner, S.: The security development lifecycle. O’Reilly Media, Incor- porated (2009) http://research.microsoft.com/en-us/projects/havoc/ https://hackerone.com/php https://bugs.php.net/bug.php?id=67492 https://bugs.php.net/bug.php?id=69085 https://bugs.php.net/bug.php?id=69152 https://hackerone.com/reports/73245 https://hackerone.com/reports/73245 http://clang-analyzer.llvm.org/scan-build.html http://llvm.org/ https://github.com/travitch/whole-program-llvm https://github.com/travitch/whole-program-llvm http://doi.acm.org/10.1145/236337.236371 https://www.cs.umd.edu/~jfoster/cqual/ http://www.grammatech.com/codesonar http://doi.acm.org/10.1145/512529.512539 http://doi.acm.org/10.1145/512529.512539 http://www8.hp.com/us/en/software-solutions/static-code-analysis-sast/ http://www8.hp.com/us/en/software-solutions/static-code-analysis-sast/ 20 29. Johnson, S.: Lint, a C program checker. Bell Telephone Laboratories (1977) 30. Knoop, J., Steffen, B.: Efficient and optimal bit vector data flow analyses: a uniform interprocedural framework. Inst. für Informatik und Praktische Mathematik (1993) 31. Kremenek, T., Engler, D.: Z-ranking: Using statistical analysis to counter the im- pact of static analysis approximations. In: Proceedings of the 10th International Conference on Static Analysis. pp. 295–315. SAS’03, Springer-Verlag, Berlin, Hei- delberg (2003), http://dl.acm.org/citation.cfm?id=1760267.1760289 32. Lattner, C., Adve, V.: Llvm: A compilation framework for lifelong program anal- ysis & transformation. In: Code Generation and Optimization, 2004. CGO 2004. International Symposium on. pp. 75–86. IEEE (2004) 33. Lee, B., Song, C., Kim, T., Lee, W.: Type casting verification: Stop- ping an emerging attack vector. In: 24th USENIX Security Sympo- sium (USENIX Security 15). pp. 81–96. USENIX Association, Washing- ton, D.C. (Aug 2015), https://www.usenix.org/conference/usenixsecurity15/ technical-sessions/presentation/lee 34. Nethercote, N., Seward, J.: Valgrind: a framework for heavyweight dynamic binary instrumentation. In: ACM Sigplan notices. vol. 42, pp. 89–100. ACM (2007) 35. NIST: SAMATE - Software Assurance Metrics And Tool Evaluation. http:// samate.nist.gov/Main_Page.html 36. NIST: Test Suites, Software Assurance Reference Dataset. http://samate.nist. gov/SRD/testsuite.php 37. Reps, T., Horwitz, S., Sagiv, M.: Precise interprocedural dataflow analysis via graph reachability. In: Proceedings of the 22nd ACM SIGPLAN-SIGACT sympo- sium on Principles of programming languages. pp. 49–61. ACM (1995) 38. Schwartz, E.J., Avgerinos, T., Brumley, D.: All you ever wanted to know about dynamic taint analysis and forward symbolic execution (but might have been afraid to ask). In: Security and Privacy (SP), 2010 IEEE Symposium on. pp. 317–331. IEEE (2010) 39. Serebryany, K., Bruening, D., Potapenko, A., Vyukov, D.: Addresssanitizer: A fast address sanity checker. In: Proceedings of the 2012 USENIX Conference on Annual Technical Conference. pp. 28–28. USENIX ATC’12, USENIX Association, Berke- ley, CA, USA (2012), http://dl.acm.org/citation.cfm?id=2342821.2342849 40. Stepanov, E., Serebryany, K.: Memorysanitizer: fast detector of uninitialized mem- ory use in c++. In: Code Generation and Optimization (CGO), 2015 IEEE/ACM International Symposium on. pp. 46–55. IEEE (2015) 41. Tsipenyuk, K., Chess, B., McGraw, G.: Seven pernicious kingdoms: A taxonomy of software security errors. Security & Privacy, IEEE 3(6), 81–84 (2005) 42. Viega, J., Bloch, J., Kohno, Y., McGraw, G.: Its4: a static vulnerability scanner for c and c++ code. In: Computer Security Applications, 2000. ACSAC ’00. 16th Annual Conference. pp. 257–267 (Dec 2000) 43. Wilkerson, Daniel: CQUAL++. https://daniel-wilkerson.appspot.com/oink/ qual.html, accessed: 2015-03-26 44. Yamaguchi, F., Lottmann, M., Rieck, K.: Generalized vulnerability extrapolation using abstract syntax trees. In: Proceedings of the 28th Annual Computer Security Applications Conference. pp. 359–368. ACM (2012) http://dl.acm.org/citation.cfm?id=1760267.1760289 https://www.usenix.org/conference/usenixsecurity15/technical-sessions/presentation/lee https://www.usenix.org/conference/usenixsecurity15/technical-sessions/presentation/lee http://samate.nist.gov/Main_Page.html http://samate.nist.gov/Main_Page.html http://samate.nist.gov/SRD/testsuite.php http://samate.nist.gov/SRD/testsuite.php http://dl.acm.org/citation.cfm?id=2342821.2342849 https://daniel-wilkerson.appspot.com/oink/qual.html https://daniel-wilkerson.appspot.com/oink/qual.html Towards Vulnerability Discovery Using Staged Program Analysis
1cybersec
arXiv
How to force STARTTLS in Exim?. <p>I am learning to set up a mailserver. I got it working with postfix, now trying the same configuration with Exim. How can I force a client to take up only STARTTLS connection for SMTP outgoing connection? I followed the instructions in this question.</p> <p><a href="https://serverfault.com/questions/476097/require-starttls-for-sending-email-in-exim">Require STARTTLS for sending email in exim</a></p> <p>My config looks now as following </p> <pre><code>MAIN_TLS_ENABLE = yes MAIN_TLS_CERTIFICATE = /etc/ssl/certs/ssl-cert-snakeoil.pem MAIN_TLS_PRIVATEKEY = /etc/ssl/private/ssl-cert-snakeoil.key .ifdef MAIN_TLS_ENABLE # Defines what hosts to 'advertise' STARTTLS functionality to. The # default, *, will advertise to all hosts that connect with EHLO. .ifndef MAIN_TLS_ADVERTISE_HOSTS MAIN_TLS_ADVERTISE_HOSTS = * .endif tls_advertise_hosts = MAIN_TLS_ADVERTISE_HOSTS auth_advertise_hosts = ${if eq{$tls_in_cipher}{}{}{*}} </code></pre> <p>Restarted Exim, no errors. Then I ran some tests in <a href="http://checktls.com/" rel="nofollow noreferrer">http://checktls.com/</a></p> <p>The TestSender passed, I could send email under secure communication. But TestSenderAssureTLS failed, the website could negotiate an unencrypted communication. </p> <p>What am I missing?</p> <p>When I create an account with Thunderbird, it autodetects an unsecure SMTP channel, not one with STARTTLS. Setting up the account and sending email succeeds. However, when I make an SMTP conversation from the shell of a computer in the network, no authentication is advertised. It looks as follows:</p> <pre><code>EHLO &lt;subdomain&gt;.&lt;domain&gt; 250-betelgeuse Hello &lt;subdomain&gt;.&lt;domain&gt; [10.0.14.34] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-STARTTLS 250 HELP AUTH LOGIN 503 AUTH command used when not advertised </code></pre> <p>Could somebody point me to what I am missing, how I can make better tests? On a related topic, how I can advertise the configuration I wish to the clients doing autdetect? Thank you.</p>
0non-cybersec
Stackexchange
Is this worth 450 euro?. O/S : Windows 7 Professional 64-bit SP1 CPU : AMD Phenom II X4 B93 RAM : 8.00GB DDR3 Motherboard : MICRO-STAR LTD 770-C45 Graphics : NVIDIA GeForce GTX 460 1GB DDR5 (MSI) Storage : Seagate 1TB (SATA) Optical Drives : ATAPI iHAS124 DVD+/-RW DL SATA Audio :Realtek High Definition Audio PSU : Alpine 750W Blue Fan Controller
0non-cybersec
Reddit
A statue made of paper.
0non-cybersec
Reddit
Mt. St. Helens May 1980.
0non-cybersec
Reddit
Who Do Online Advertisers Think You Are? The extreme microcategorization of consumers means advertisers can bid for the chance to show you exactly what you might be interested in. The trouble is, that’s all you’ll see..
0non-cybersec
Reddit
Rye bread Sourdough recipe + Special Bonus.
0non-cybersec
Reddit
I Can't Sleep (Part Two). [Part One](http://www.reddit.com/r/nosleep/comments/2b4nfd/i_cant_sleep/) [Part Two](http://www.reddit.com/r/nosleep/comments/2b8csq/i_cant_sleep_part_two/) [Part Three](http://www.reddit.com/r/nosleep/comments/2bbu1y/i_cant_sleep_part_three/) [Part Four](http://www.reddit.com/r/nosleep/comments/2bmo7a/i_cant_sleep_part_four/) [Part Five](http://www.reddit.com/r/nosleep/comments/2bq4fj/i_cant_sleep_part_five/) [Part Six](http://www.reddit.com/r/nosleep/comments/2bwg0i/i_cant_sleep_part_six_the_silent_circle/) I went to bed but my mind was racing. The Cap stayed overnight with another officer but he wanted me “rested and ready for duty” at 9am – I could have asked Sylvia to stay with Christina but it’s not an emergency so I’d feel bad for asking. I don’t like leaving Christina alone, especially at night. Although she’s never posed a clear suicide risk, I won’t keep guns, pills, or any sharp knives in the house. I have my gun in the safe, and I change the code weekly. I won’t even tell Sylvia, and we make sure all the non screen doors and windows are kept shut so we don’t attract any wild animals to the house or yard. I’d wanted to get up early to check the newspaper for a story on the disappearance, I’d advised the Cap we keep it quiet for now but it being a small town, everyone pretty much knew anyway. I was sincerely hoping no national media picked up on the case – last thing we want is copycatting, especially with the total lack of evidence, I don’t want to spook the perpetrator. I also know that with every passing hour, the chances of child being alive were getting slimmer. Sometimes I hate the finality of this job, at least for every patient Christina wasn’t able to treat, she was sending at least two more home with their families. I just clean up the mess afterwards and piece together the puzzle. I lay there next to my peacefully sleeping wife, hot and restless until I gave in and got up around 3am. I thanked god this was a restful night for Christina, back in the city she stopped sleeping during the night for a while, it appears Sylvia’s activities soothe her mind somewhat. The internet here is shockingly slow, but I decided it was a good place to start before questioning the locals and searching the database down at the station for the previous missing children cases. I’d made some notes earlier before posting my story, trying to empty my mind, but it didn’t work. There are three other neighbouring towns, spread thinly across a large expanse of nowhere. Again, I don’t want to give out too much actual detail on an open case, I won’t name them. After a few fruitless Google searches on my own town, I wandered over to the Googlemaps sidebar, more out of curiosity – I often find when researching cold cases or those of which I have no leads, you can find information in the strangest of places. My tired mind wandering, I notice a town’s name I hadn’t heard before. I shake myself from the cloud of sleep gathering over me and check again. No, I’d definitely missed this, which doesn’t make a huge amount of sense, considering at the back of the station, almost the entire wall is covered with the exact same map I’m looking at now. I make coffee, hoping to clear my brain with caffeine, but I’m definitely wide awake now. I type the town’s name into Google, it comes up with a Wiki Page but it just brings me to “Wikipedia does not have an article with this exact name.” no help. I try the town name with the state, nothing. I try searching again on Google Maps, and try “Explore” but it only takes me to outside the town, and then nothing. I can’t go towards the speck in the distance, just away from it, towards the nearest neighbouring town. I get a feeling, like there’s someone at the window, staring me down. I know this is ridiculous, but I turned around. Nothing except the grey dawn light filtering through the blinds. Sunrise wasn’t far off. I’d like to say I slept, but as soon as Sylvia arrived at 8, I made her a pot of fresh coffee, asked her to keep the local radio off and intercept the newspaper just in case, I’m trying to hard to keep the case away from Christina. I dressed, took my gun from the safe and kissed my still sleeping wife goodbye and went to work. The Cap was clearly grateful of the morning shift release, he looked dog tired. There was no news overnight, no breakthrough or ransom note. On the day shift, it’s me, Sandy and David. They’re all pushing retirement on the local force, although we do have a baby faced, nervous guy we call Curly (I have no idea why, he’s balder than a plucked eagle. Cop humour?) who’s a Junior officer, he’s around twenty four or so, at a guess. He’s not on today and the Cap goes home, as does Davis, who’s been on the night shift with him. Davis looks less haggard, which makes me think he’s probably slept at his desk. We’ve all done it. Generally we don’t even need a night shift, but we agreed to be on standby in case of contact from the perpetrator or the family. It’s odd, because even with such a community shaking case, it felt like a normal day, Sandy making coffee and going out for some pastries from across the road, David working front desk and me at mine, searching the database for potentially connected cases. By my logic, the lack of evidence makes me think the guy – and it is usually a guy- has done this kind of thing before. It doesn’t take me long to come across three very similar disappearances from the town furthest away; about three times the size of this one – all from the last two years, all handled by the same cop, Detective Katz. I immediately put in a call to him; unsurprisingly he’s away from his desk, but I leave a message. I can’t shake this feeling about the map; a lot of homicide detectives tell you they run on instinct, and for me that’s true. I swivel round in my chair and face the map wall, there’s definitely nothing there. I think to myself, maybe it’s just old – Sandy returns with today’s pastry selection and I swear I’ll be 300lbs before I hit forty – and I ask him “Hey, Sandy – how old is this map?” Now Sandy is our storyteller, a bespectacled old small town Cop with a few Grandchildren and an extra 30lbs or so. “Gee Jackie, I don’t know… we had Curly put that up, what… during the last storm I think so maybe two years ago?” “Nah!” pipes up David from the front desk, “It’s just under a year, Sandy you’re gettin’ senile.” Sandy takes off his hat and mops his brow; it’s a little after ten a.m and it’s already getting hot. “Sure thing, Davis.” And he goes and sits down at his desk, David pulls a face as if to say ‘He called me Davis again’ and goes back to writing up his report on lost kittens or whatever it is he’s doing. I absent-mindedly pick apart a donut whilst studying the map. There’s definitely nothing there, and I doubt new towns just spring up around here. “David… what’s here?” I point to the empty space on the map by a lake. I swear, in all my years of being a Detective, I have never met a worse liar than David. “Nuh-nothin’, Jack.” Before I can call him out on his blatant BS or obtuse answer, Sandy cuts in – “Jackie, don’t ask David shit.” He gets his albeit large frame out of his chair and ambles over, knowing there’s a story involved. “There was a town there about, oooh, fifty years or so ago. Long before you were born anyhow.” Although I don’t want to listen to one of Sandy’s meandering tales, I am curious about this town. “So it’s not there anymore?” before Sandy can answer, David straightens up and mumbles “Bathroom break, watch the desk.” And disappears down the corridor. Unperturbed, I motion for Sandy to carry on. “It’s still there, there just ain’t nobody living there no more. As you know, I was born in Arizona, so I ain’t a local, I just sound like one, ha ha, but I ain’t as superstitious as David. People round here don’t like talkin’ about that place, there’s the usual bullshit rumours of Indian burial groun’s and witchcraft. It’s all horseshit if you ask me.” Sandy dips his hand into the pastry box, his stomach nudging my admittedly empty in tray. “So the usual small town superstitions then… but surely everyone’s educated enough to realise what’s real and what isn’t? Anyway, I can’t find anything on the internet about it, and usually these things attract cult status, look at Centralia.” I don’t believe in all that superstitious stuff, usually all it takes is one weirdo to start believing in Slenderman and look what happens. “Look Jackie, I don’t know quite why, no-one will talk about it round here, but it’s a ghost town. We don’t have it on the map ‘cause it ain’t a town with a population, it may as well be empty space.” David returns from the bathroom, giving me what my Mom would describe as “the evil eye.” Sandy finishes his third pastry and returns to his desk. Frustrated, I decide to look at the evidence for the previous cases – except there isn’t really anything to go on, a partial footprint for a popular tennis shoe here, a hair that doesn’t qualify as a viable DNA source there. In the case of Cathy Robbins, the last girl to go missing in my town, almost ten years ago, there was a dark scrape on her white windowsill, evidence was collected and the case notes determine it as “rust”, no further notes. The detective work in this backwater doesn’t really amount to much, and to be honest, most of the case files from neighbouring towns isn’t of much better quality. They lack the resources and the experience from dealing with these cases – and in some ways I’m thankful for that, but that doesn’t help Cathy Robbins or the little boy who vanished yesterday. I stare at a picture of Cathy, her little face lit up with happiness, her hair tied in two pigtails with yellow ribbons. For a moment I imagine who tied those ribbons, and I picture my wife doing the same for our phantom daughter, the little girl who never existed. When they say someone has a heavy heart, they’re wrong. The weight rests in the dead centre of my torso and on my shoulders. I close my eyes for a moment and take a deep breath, trying to ignore the life I could have had back in the city. Thankfully, my desk phone rings and brings me round from the world inside my head. The caller introduces himself as Danny Katz, the Detective working the child disappearances from the large town. He sounds about my age, and also not local – as in not from the country at all. For some reason, this lifts my heart somewhat as almost instantly I feel a connection to him, in the last six months I’ve felt like I’m playing myself in a contrite cop movie. Katz tells me he’s done some serious work on the case over the last two years and he has some potential leads. Then he says “There’s not a lot happening ‘round here, how about I get in the car and some meet you? We can talk better in person, I’ll bring my case notes.” Finally, it feels like real detective work is being done. Katz is about four hours out, so he’ll need to stay the night. I tell him to by all means come over, I’ll book him a room at the local B&B. Katz finishes the call with a joking “Peace out” and hangs up. I decide rather than rotting away in the station, I’ll walk over to the B&B myself and make the reservation. On the way, I stop at the general store as I recall Sylvia telling me Christina is getting low on watercolours. It’s strange, Sylvia acts almost as a go between for us, telling me what my wife needs because she won’t ask herself. I remember her being far more assertive, but her conversation is rather limited these days – that said, it’s not like she has a lot to talk about, painting or doing cross stitch with Sylvia. They often talk about Sylvia’s family back in Jamaica, or old movies that they both share a passion for. Christina’s favourite movie is The Wizard of Oz, she always used to tell people it was something more cerebral, but I think that somehow she leaned towards it because Dorothy was able to click her heels and return home, and everything was alright in the end. But hey, that’s just my humble opinion. Marty, the general store owner is another Grandfather in town, he looks about a hundred and unlike Sandy, is practically a bag of bones topped off with a pair of thick glasses and false teeth. He’s a kindly but slightly doddery old guy – you’d expect to see him in a cartoon about an old prospector, that’s the vibe he gives off. He greets me with a “Oh Hello, Detective Harper” no matter how many times I ask him to call me Jack, he always, without fail calls me Det. Harper. Sandy calls me Jackie, Cap calls me Harper most of the time, except when he’s being serious, then he calls me Jack. Sylvia calls me Mr Jack, a joke from the Family Guy housekeeping character – Sylvia may be pushing sixty but she’s worked in the city and is pretty down with pop culture. My wife calls me honey. It started as a corny joke that stuck. I figure Marty is about eighty, at least, and he has at least nine children of his own and about twenty grandchildren. If anybody knows anything in this town, it’s Marty. It’s risky, but as a Detective, you don’t get anywhere without asking controversial questions – “Marty, what do you know about (ghost town)?” Marty looks at me over his thick spectacles, his brow rising almost up onto his liver-spotted head. “Are you tryin’ to give an old man a heart attack, Det. Harper?” I sigh and think I’ve figured Marty for a no-BS guy, when he speaks again, his voice slightly shaky “Don’t be askin’ my wife about this, she believes in all that mumbo-jumbo. I was about your age or thereabouts when people started leavin’ the town, there were rumours of some of that Native magic stuff, talks of curses and nonsense, but I reckon resources just dried up and people moved on out, that’s what happens. Why you askin’, you think the bogeyman upped and took that little boy?” Marty stares at me, his eyes a little milky, but still a stare that reminds me he’s seen a lot. Almost ashamed, I reply “Sorry Marty, no. I’m just have a curious mind.” Marty shrugs as if to say ‘It’s nothing’ and finds my paints and sends me on my way, telling me to say hello to Sylvia for him. The rest of the day passes without incident and I try and put all the ghost town stuff out of my mind whilst I wait for Detective Katz to arrive, but with no leads and no lost cats, I have to admit I was getting bored. I call home and check on Christina, Sylvia puts her on the line and I tell her I’ve got paints for her and she tells me she loves me and asks me to bring home something nice for dinner, which isn’t completely out of the ordinary but surprising as it’s been a while since she’s been bothered about what she eats. Clearly they’ve had a good day so far. I tell her I’ll be home a little later but Sylvia will stay with her as I’ve got to meet a Detective from out of town. I tell my wife it’s just a courtesy visit, giving her some crap about small town relations or something. She seems content enough and says “Ok honey, I’ll see you later, have fun.” The jokey tone, knowing I hate small talk, for a moment, I feel like I have my wife back and everything is okay again, like I’ve just clicked my heels and landed back in Kansas. Several cups of coffee and what feels like an eternity of stories from Sandy later, Detective Katz arrives, apologetic as he almost got into an accident on the drive over – he almost hit a deer, thankfully he’s here an in one piece. David can’t stop staring as Detective Danny Katz is about 6”4 and sports a decent sized neat Afro hairstyle. Unfortunately, small towns can have a racist undertone, although I’ve never heard or seen it here, with Sylvia being as she puts it “the first black resident who didn’t get chased out of town” - Katz does stand out a bit. It’s getting late in the day and Davis returns to man the phone tonight, just in case, I suggest to Katz we go to the local bar to talk, he agrees and we find a discrete corner to talk in, especially as some of the locals are curiously peering at Katz and whispering – they did the same to me when I moved here, so it’s to be expected. I learn that Katz – I mean, Danny, has been on the force a similar amount of time as me and worked in NYC, originally on Vice and then moved into Homicide. Like me, Danny moved to a small town operation to be nearer to his adoptive mother, who was undergoing cancer treatment. She beat cancer but Danny stayed when the missing children case came up – and strangely, he’s heard of me. “You worked the Bachmann case, right?” I confirm, a series of murders within one family back in the city that got some minor press coverage. Danny is extraordinarily easy to get along with, and we both feel like city outsiders in small towns with old-fashioned locals. Danny has a little more evidence than we have here – but still not a huge amount to go on; the perpetrator (I refuse to say or type “perp”, it’s so hard boiled detective in a cheap thriller novel.) left some blood evidence at a scene – “But – Danny says – don’t get too excited. I’ve run the DNA through every damn database I have, and nothing.” This is pretty standard, especially out in the sticks, it appears – a perpetrator slips up but they’re not in the system. “It looks like the perpetrator caught a limb on a protruding nail or something, there’s some soil on the window sill, but no local soil samples match; it’s quite metal heavy though, I mean, the soil in this area can be light and sandy, heavy with clay… this has some trace metal in it but nothing conclusive really.” Danny sighs and takes a mouthful of beer, “I thought this case was cold until I heard from you.” I sit back, processing the evidence, or lack thereof – “There was a rust sample on the sill of the Cathy Robbins scene… I feel like we’re clutching at straws here, where have your searches been?” Danny sits forward with his arms on his legs, hands clasped together – “Just the local area really, there’s nothing. A few guys on the register, but nothing that ties to these cases. I have a strong feeling that the cases are all connected and it sounds like the perpetrator has been operating in this area as well… I wish I could offer you something more conclusive, Jack.” I look at Danny, and perhaps if he was less like me, or was harder to talk to, I wouldn’t have mentioned it at all, but I swill the last of my beer round and round in the bottom of my glass, and I have to ask him, because somehow, I feel this is all connected somehow – “Danny, have you heard of (town name)?” “Sorry, no.” I believe him, there’s no reason why he would have. “I have to ask, Jack, you’ve piqued my interest now…” I sigh, realising how tired I am and that I want to go home and have dinner with my wife, but I owe Danny an explanation, as sad as it sounds, he’s the closest thing I’ve had to a friend for a long time. “There’s this apparent ghost town, just east of here… I don’t know, it’s a bit of a local legend it appears, I don’t know too much, but I guess if I was going to hide a body, I’d hide it somewhere most people would be too afraid to look.” Danny’s eyes light up “So have any searches been done?” “I need to talk to my Cap, he’s back tomorrow, but it appears most people are a bit odd about it… I’ve been reluctant to push too hard as an outsider, the only people I’ve asked have been some guys at my station and the old guy at the store, one of my colleagues got a bit jumpy about it, and he’s not a nervous guy.” Katz clicks his neck, clearly tired from his drive – “Okay, I’ll stay in town for a few days, I’ll do what I can to help you, but I think we should check out that ghost town, even if its just to rule it out, but those kids had to go somewhere and I doubt it’s a trafficking ring… more likely to be some local weirdo, it’s interesting shit, this.” I’m sitting here, maybe an hour or so later and I’m wondering if I’ve inadvertently stumbled upon a serial killer; Danny’s interest has compounded what’s been bothering me since last night – it might have nothing to do with the ghost town but… I can’t explain it, I’m getting a gut feeling, like I did back on the Bachmann case. I feel like for the first time in a year, I’m actually working again, especially with Danny’s involvement, I have a feeling things were supposed to happen this way. I don’t believe in fate, or destiny, but I don’t know. I believe we’re going to get some answers; I’ll talk to the Cap in the morning and we’ll see what the plan of action is. I’ll keep you updated on what I can.
0non-cybersec
Reddit
How to get apps using significant energy programatically like battery icon from MacBook. <p>I am trying to get a significant energy consuming app list like it shows in battery icon in MacBook programmatically.</p> <p><img src="https://i.stack.imgur.com/bapoI.png" alt="enter image description here"></p> <p>Like Below... Any Help would be appreciated.</p> <p>I tried used following top command in a code but it's not working.</p> <p>top -stats -l 1 -O pid,command,cpu,idlew,power -o power -d</p>
0non-cybersec
Stackexchange
Layers - Logical seperation vs physical. <p>Some programmers recommend logical seperation of layers over physical. For example, given a DL, this means we create a DL namespace not a DL assembly. </p> <p>Benefits include:</p> <ol> <li>faster compilation time</li> <li>simpler deployment</li> <li>Faster startup time for your program</li> <li>Less assemblies to reference</li> </ol> <p>Im on a small team of 5 devs. We have over 50 assemblies to maintain. IMO this ratio is far from ideal. I prefer an extreme programming approach. Where if 100 assemblies are easier to maintain than 10,000...then 1 assembly must be easier than 100. Given technical limits, we should strive for &lt; 5 assemblies. New assemblies are created out of technical need not layer requirements.</p> <p>Developers are worried for a few reasons. </p> <p>A. People like to work in their own environment so they dont step on eachothers toes. </p> <p>B. Microsoft tends to create new assemblies. E.G. Asp.net has its own DLL, so does winforms. Etc. </p> <p>C. Devs view this drive for a common assembly as a threat. Some team members Have a tendency to change the common layer without regard for how it will impact dependencies.</p> <p>My personal view:</p> <p>I view <strong>A.</strong> as silos, aka cowboy programming and suggest we implement branching to create isolation. <strong>C.</strong> First, that is a human problem and we shouldnt create technical work arounds for human behavior. Second, my goal is not to put everything in common. Rather, I want partitions to be made in namespaces not assemblies. Having a shared assembly doesnt make everything common. </p> <p>I want the community to chime in and tell me if Ive gone off my rocker. Is a drive for a single assembly or my viewpoint illogical or otherwise a bad idea? </p>
0non-cybersec
Stackexchange
Главная | Viible Investment Company.
0non-cybersec
Reddit
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
Function keys since upgrading to Yosemite. <p><kbd>Option</kbd> + <kbd>F1</kbd> takes me to Display preferences, instead of using the current app binding, as it did in Mavericks. Is there any way to override this behavior?</p> <p>I can't find the binding in Preferences -> Keyboard -> Shortcuts.</p> <p>I see the binding on the Apple <a href="http://support.apple.com/kb/ht1343" rel="nofollow">shortcut page</a>, and I think it's always been there, but previously applications could overrule the setting.</p> <p>If it's relevant, the app in question is <a href="https://www.jetbrains.com/idea/" rel="nofollow">IntelliJ Idea</a>.</p>
0non-cybersec
Stackexchange
Determination.
0non-cybersec
Reddit
Technically the truth.
0non-cybersec
Reddit
[Homemade] Picnic Pasta Salad.
0non-cybersec
Reddit
listplot and postscript. <p>Is there a possibility with listplot to make lines from a point which is defined?</p> <p>Example...</p> <p>Fileinput:</p> <pre><code>-0.013,0.471 0.044,-0.294 -0.069,0.446 0.025,-0.385 0.038,-0.448 0.073,-0.365 0.375,0.045 .... </code></pre> <p>I want to find code wich does the following....</p> <pre><code>\psline(1,1)(-0.013,0.471) \psline(1,1)(0.044,-0.294) ...... </code></pre> <p>Is there a way to do this easyly?</p> <p>Update Code:</p> <pre><code>\documentclass{scrreprt} \usepackage{scrpage2} \usepackage[ansinew]{inputenc} %\usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[full]{textcomp} % Euro-Zeichen etc... \usepackage{datatool} \usepackage{graphicx} \usepackage{rotating} \usepackage{array} \usepackage{ragged2e} \newcolumntype{C}[1]{&gt;{\centering\arraybackslash}p{#1}} \usepackage{pstricks} \usepackage{pst-plot} %27.07.2012 testweise \usepackage{etoolbox} \makeatletter \def\ifinstr#1#2{% \def\@ifinstr##1#2##2\@nil{% \ifstrempty{##2}{\@secondoftwo}{\@firstoftwo}}% \@ifinstr#1\@@nil#2\@nil } \def\popleft#1#2{% \edef\@tmpa{#1}% \expandafter\@popleft\expandafter{\@tmpa}{#1}{#2}} \def\@popleft#1#2#3{% \ifinstr{#1}{|} {\@@popleft{#2}{#3}\q@nil#1\q@stop} {\@@popleft{#2}{#3}\q@nil#1|\q@stop}} \def\@@popleft#1#2\q@nil#3|#4\q@stop{\edef#1{#4}\edef#2{#3}} \newcommand*\assignvalues[2]{\@assignvalues{#1}{#2}} \def\@assignvalues#1#2{% \edef\@tmpb{#1}\edef\@tmpc{#2}% \popleft\@tmpb\currentvalueA \popleft\@tmpc\currentvalueB \csedef{\currentvalueA}{\currentvalueB}% \ifdefempty\@tmpb{}{\assignvalues\@tmpb\@tmpc}% } \makeatother \FPset\tsize{0.75} % Schriftgröße \FPset\schriftgr{0.75} \FPset\schriftgrad{0.4} % Anderson Darling Schriftgröße \FPset\digitz{5} \begin{document} \assignvalues{xstart|xend|ystart|yend|yistart|nhlines|nvlines|nvunit|hilfsgitternetzlinien|alternativskalierung|inputf|altscale|rgg}{0|9|-0.8|4.6|0|14|10|2|5|0.35|Messdaten/statistik/rohstoffextruder.dat|1|0} \assignvalues{dart}{loading} \assignvalues{mbstartx|mbstepx|mbstarty|mbstepy}{1|1|1|1} \assignvalues{bottomdesc|leftdesc|topdesc|rightdesc|lab|bcaption}{Unten|Links|Oben|Rechts|label|Bezeichnung} \assignvalues{nvlines|nhlines|lab|mbstartx|mbstepx|hilfsgitterlinien|mbstarty|mbstepy|bcaption|bottomdesc|leftdesc}{5|4|fig:LoadingPlot|-0.1|0.1|15|-0.50|0.25|Loading Plot Rohstoff Extruder|Erste Komponente|Zweite Komponente} \assignvalues{scalex|scaley|scaler}{1|1|1} \assignvalues{dummyj|dummyba|dummyh|xendn|dummyq|altscale|miny|dummyu|dummybb|dummyr|dummyl|dummym|dummyb|minstarty|dummyu|dummyt|schriftgrad|gesamthl|messb|dummyd|nhlinesn|minstart|dummyr|dummybb|distmove} {-0.600000000000000000|-0.069|-0.1|9|0.5|1|-0.448|-0.50|4.6|1.15000|1.80000|0.12000|1.8|0.25|-0.50|0|0.4|75|1|6|5|0.1|1.15000|4.6|1.000000000000000000} \readdata{\dataA}{Messdaten/statistik/rohstoffextruder.dat} \ifthenelse{\equal{\messb}{1}}{\message{^^JLade Datenquelle(n) für Diagramm \bcaption\space^^J}}{} \DTLsetseparator{,} \DTLifdbexists{table4441}{\DTLdeletedb{table4441}}{ } \DTLloaddb[noheader,keys={wertx,werty}]{table4441}{\inputf} \readdata{\dataA}{\inputf} \ifthenelse{\equal{\messb}{1}}{\message{^^JEinige FP rechnungen, die durch Assignvalues ersetz worden sind..... \bcaption\space^^J}}{} \begin{figure}[htbp] %\begin{center} \centering \psset{xunit=\scalex cm,yunit=\scaley cm, runit=\scaler cm} \pstScalePoints(1,1){\dummyba\space \dummyh\space neg \dummyba\space sub add add \xendn\space mul \dummyq\space\altscale\space mul \space div}{\miny\space neg \dummyu\space neg \miny\space neg sub add add \dummybb\space mul} % \ifthenelse{\equal{\messb}{1}}{\message{^^JZeichne Bildbereich}}{} % \begin{pspicture}(\xstart,\ystart)(\xend,\yend) % \ifthenelse{\equal{\messb}{1}}{\message{Zeichne die Gitternetzlinien für Diagramm \bcaption\space ^^J}}{} % \multiput(\xstart,\dummyr)(\xstart,\dummyr){\nhlines}{\psline[linecolor=black,linestyle=dashed,linewidth=0.4pt](\xstart,\yistart)(\xend,\yistart)} \multiput(\xstart,\dummyr)(\xstart,\dummyr){\nhlines}{\psline[linecolor=black,linewidth=0.8pt](-0.1,0)(0,0.0)} % \multiput(\dummyl,\yistart)(\dummyl,\yistart){\nvlines}{\psline[linecolor=black,linestyle=dashed,linewidth=0.4pt](\xstart,\yistart)(\xstart,\yend)} \multiput(\dummym,\yistart)(\dummym,\yistart){\gesamthl}{\psline[linecolor=black,linestyle=dotted,linewidth=0.4pt](\xstart,\yistart)(\xstart,\yend)} \multiput(\dummyl,\yistart)(\dummyl,\yistart){\nvlines}{\psline[linecolor=black,linewidth=0.8pt](0,-0.1)(0,0.0)} % \ifthenelse{\equal{\messb}{1}}{\message{Die Gitternetzlinien für Diagramm \bcaption\space wurden fertiggestellt^^J}}{} \ifthenelse{\equal{\messb}{1}}{\message{Beginne die Beschriftung für Diagramm \bcaption\space ^^J}}{} % \multido{\na=\dummyh+\minstart,\nb=0+\dummyb}{\dummyd}{\rput{0}(\nb,-0.3){\FPclip\na\na \scalebox{\schriftgrad}{\na}}} \multido{\na=\dummyt+\dummyr,\nb=\dummyu+\minstarty}{\nhlinesn}{\rput{0}(-0.5,\na){\FPclip\nb\nb \scalebox{\schriftgrad}{\nb}}} \uput[0](\dummyj,-0.7){% \scalebox{\scalex}{ \begin{tabular}{C{\xend cm}} \scalebox{\tsize}{\bottomdesc} \\ \end{tabular} }} % \uput[90](-1.3,-0.7){\rotateleft {% \scalebox{\scaley}{ \begin{tabular}{C{\yend cm}} \scalebox{\tsize}{\leftdesc} \\ \end{tabular} }}} % Achsenbeschriftung y \ifthenelse{\equal{\messb}{1}}{\message{Die Beschriftung für Diagramm \bcaption\space wurde fertig gestellt^^J}}{} \ifthenelse{\equal{\messb}{1}}{\message{^^JZeichne die Daten von \bcaption\space ^^J}}{} % Alter Code.... %\ifthenelse{\equal{\dart}{loading}}{ % \DTLforeach{table4441}{% % \wertx=wertx,\werty=werty}{ % \FPupn{X}{\wertx} % \FPupn{X}{X \dummyba\space \dummyh\space neg \dummyba\space sub add add \xendn\space mul \dummyq\space\altscale\space mul \space div} % \FPround\X\X\digitz % \FPupn{Y}{\werty} % \FPupn{Y}{Y \miny\space neg \dummyu\space neg \miny\space neg sub add add \dummybb\space mul} % \FPupn{Xs}{\minstart\space \distmove\space mul \xendn\space mul \dummyq\space\altscale\space mul \space div} % \FPupn{Ys}{\dummyu\space neg \dummybb\space mul} \psline[linecolor=blued,linestyle=dashed,linewidth=0.4pt](\Xs,\Ys)(\X,\Y) % } %}{} % % ersetzt durch Herberts neuen Code \FPupn{Xs}{\minstart\space \distmove\space mul \xendn\space mul \dummyq\space\altscale\space mul \space div} \FPupn{Ys}{\dummyu\space neg \dummybb\space mul} \makeatletter \pslistplot[linecolor=red!50]{ /startpoint { \Xs\space \Ys\space \tx@ScreenCoor\space moveto } def mark \dataA \space counttomark 2 div cvi /nData exch def nData { startpoint \tx@ScreenCoor\space lineto } repeat } \pslistplot[plotstyle=dots]{\dataA} % Herberts neuer Code \ifthenelse{\equal{\dart}{screen}}{ \listplot[plotstyle=line, linewidth=1.73pt, linecolor=black,showpoints=false,dotstyle=*,dotsize=4pt]{\dataA} % Punkte Blau 200 Grad \listplot[plotstyle=dots, linewidth=1.73pt, linecolor=white,showpoints=true,dotstyle=*,dotsize=6pt]{\dataA} % Punkte Blau 200 Grad \listplot[plotstyle=dots, linewidth=1.73pt, linecolor=black,showpoints=true,dotstyle=*,dotsize=4pt]{\dataA} % Punkte Blau 200 Grad }{} \ifthenelse{\equal{\dart}{loading}}{ \listplot[plotstyle=dots, linewidth=1.73pt, linecolor=black,showpoints=true,dotstyle=*,dotsize=6pt]{\dataA} % Punkte Blau 200 Grad \listplot[plotstyle=dots, linewidth=1.73pt, linecolor=black,showpoints=true,dotstyle=*,dotsize=4pt]{\dataA} % Punkte Blau 200 Grad }{} \psline(\xstart,\yistart)(\xend,\yistart) \psline(\xstart,\yistart)(\xstart,\yend) \psline(\xend,\yistart)(\xend,\yend) \psline(\xstart,\yend)(\xend,\yend) \end{pspicture} \caption[\bcaption]{\bcaption} \label{\lab} \end{figure} \end{document} </code></pre> <p>Code, nearly reached the goal....</p> <pre><code>\assignvalues{xstart|xend|ystart|yend|yistart|nhlines|nvlines|nvunit|hilfsgitternetzlinien|alternativskalierung|inputf|altscale|rgg}{0|9|-0.8|4.6|0|14|10|2|5|0.35|Messdaten/statistik/rohstoffextruder.dat|1|0} \assignvalues{dart}{loading} \assignvalues{mbstartx|mbstepx|mbstarty|mbstepy}{1|1|1|1} \assignvalues{bottomdesc|leftdesc|topdesc|rightdesc|lab|bcaption}{Unten|Links|Oben|Rechts|label|Bezeichnung} \assignvalues{nvlines|nhlines|lab|mbstartx|mbstepx|hilfsgitterlinien|mbstarty|mbstepy|bcaption|bottomdesc|leftdesc}{5|4|fig:LoadingPlot|-0.1|0.1|15|-0.50|0.25|Loading Plot Rohstoff Extruder|Erste Komponente|Zweite Komponente} \assignvalues{scalex|scaley|scaler}{1|1|1} \assignvalues{dummyj|dummyba|dummyh|xendn|dummyq|altscale|miny|dummyu|dummybb|dummyr|dummyl|dummym|dummyb|minstarty|dummyu|dummyt|schriftgrad|gesamthl|messb|dummyd|nhlinesn|minstart|dummyr|dummybb|distmove}{-0.600000000000000000|-0.069|-0.1|9|0.5|1|-0.448|-0.50|4.6|1.15000|1.80000|0.12000|1.8|0.25|-0.50|0|0.4|75|1|6|5|0.1|1.15000|4.6|1.000000000000000000} \FPupn{Xs}{\minstart\space \distmove\space mul \xendn\space mul \dummyq\space\altscale\space mul \space div} \FPupn{Ys}{\dummyu\space neg \dummybb\space mul} \makeatletter \pslistplot[linecolor=red!50]{ /startpoint { \Xs\space \Ys\space \tx@ScreenCoor\space moveto } def mark \dataA \space counttomark 2 div cvi /nData exch def nData { \tx@ScreenCoor\space \miny\space neg \dummyu\space neg \miny\space neg sub add add \dummybb\space mul exch \tx@ScreenCoor\space \dummyba\space \dummyh\space neg \dummyba\space sub add add \xendn\space mul \dummyq\space\altscale\space mul \space div exch startpoint \tx@ScreenCoor\space lineto } repeat } %\makeatother \pslistplot[plotstyle=dots]{\dataA} </code></pre>
0non-cybersec
Stackexchange
How do I go about creating this SQL query?. <p>I'm attending the free DB course at Stanford Online, and frankly one of the exercises gave me some trouble. I have a feeling that this should be horribly simple, so for a DBA, I'm obviously not very good with SQL. </p> <p>We're working with a simplified scenario for rating movies.</p> <blockquote> <p>For all cases where the same reviewer rated the same movie twice and gave it a higher rating the second time, return the reviewer's name and the title of the movie.</p> </blockquote> <p>Here's the schema:</p> <pre><code>Movie ( mID, title, year, director ) Reviewer ( rID, name ) Rating ( rID, mID, stars, ratingDate ) </code></pre> <p>How should I go about this?</p>
0non-cybersec
Stackexchange
Ideal is graded iff it is generated by homogeneous elements. <p>Consider the polynomial ring $\mathbb{F}[x_{1},...,x_{n}]$ in $n$ variables and let $I \subset \mathbb{F}[x_{1},...,x_{n}]$ be an ideal. We call $I$ <em>graded</em> if we can decompose it into it's homogeneous components, i.e.</p> <p>$$ I = \bigoplus\limits_{i \geq 0}(I \cap R_{i}), $$ where $R_{i} = \text{span}\{x^{a} : a \in \mathbb{N}^{n}, \sum_{j=1}^{n}a_{j} = i\}$, i.e. $R_{i}$ is the set of all homogeneous polynomials of degree $i$. </p> <p>Now in a book it says that $I$ is graded if and only if $I$ is generated by homogeneous elements. There was no proof. Anyone can help? For the if part we can consider $\bigcup_{i\geq 0}(I\cap R_{i})$ as generating set of homogeneous elements for $I$. But now $\mathbb{F}[x_{1},...,x_{n}]$ is a noetherian ring so every ideal is finitely generated. How can I found a finite generating set of homogeneous elements?</p>
0non-cybersec
Stackexchange
YSK that this website (http://www.fafsa.com/) is a complete rip off. Go to: www.fafsa.ed.gov for all your financial aid application. 1stEdit: You guys are very much welcomed. I just hope this helps.
0non-cybersec
Reddit
Rewrite $ \int_{\mathcal{S}}dP_X=1 $ as conditions on boxes in $\mathbb{R}^d$. <p>Take <span class="math-container">$r\in \mathbb{N}$</span> and let <span class="math-container">$d\equiv r+\binom{r}{2}$</span>.</p> <p>Consider a d-dimensional random vector <span class="math-container">$X\equiv (X_1,...,X_d)$</span>. Let <span class="math-container">$P_X$</span> be the probability distribution of <span class="math-container">$X$</span>. Assume that <span class="math-container">$$ \int_{\mathcal{S}}dP_X=1 $$</span> where <span class="math-container">$$ \begin{aligned} \mathcal{S}\equiv \{(b_1,b_2,..., b_d)\in \mathbb{R}^{d}: \text{ } &amp; b_{r+1}=b_1-b_2, b_{r+2}=b_1-b_3, ...,b_{2r-1}=b_1-b_r, \\ &amp;b_{2r}=b_2-b_3, ..., b_{3r-3}=b_2-b_r,\\ &amp;...,\\ &amp; b_d=b_{r-1}-b_r\} \end{aligned} $$</span> For example, when <span class="math-container">$r=2$</span> (<span class="math-container">$d=3$</span>) we have the surface <span class="math-container">$$ \begin{aligned} \mathcal{S}\equiv \{(b_1,b_2,b_3)\in \mathbb{R}^{3}: \text{ } &amp; b_3=b_1-b_2\}=\{(b_1,b_2,b_3)\in \mathbb{R}^{3}: \text{ } &amp; b_1=b_2+b_3\} \end{aligned} $$</span> When <span class="math-container">$r=3$</span> (<span class="math-container">$d=6$</span>) we have <span class="math-container">$$ \begin{aligned} \mathcal{S}\equiv \{(b_1,..., b_6)\in \mathbb{R}^{6}: \text{ } &amp; b_4=b_1-b_2, b_5=b_1-b_3, b_6=b_2-b_3\} \end{aligned} $$</span></p> <p><strong>My final goal:</strong> I'm interested in rewriting the condition <span class="math-container">$\int_{\mathcal{S}}dP_X=1$</span> as a collection of zero probability measure conditions on <strong>d-dimensional "boxes"</strong> in <span class="math-container">$\mathbb{R}^d$</span>. The idea is that any box in <span class="math-container">$\mathbb{R}^d$</span> not intersecting <span class="math-container">$\mathcal{S}$</span> should have probability measure equal to zero. Therefore, if we consider enough of these boxes, we should be able to equivalently rewrite <span class="math-container">$\int_{\mathcal{S}}dP_X=1$</span>. </p> <hr> <p>When <span class="math-container">$r=2$</span> (<span class="math-container">$d=3$</span>), my goal is achieved by the following claim</p> <p><strong>Claim:</strong> For any two real numbers <span class="math-container">$(b,c)\in \mathbb{R}^2$</span>, define the boxes <span class="math-container">$$B(b,c)\equiv \{(x,y,z)\text{ s.t. } x&gt; b+c, y\leq b, z\leq c\}$$</span> and <span class="math-container">$$Q(b,c)\equiv \{(x,y,z)\text{ s.t. } x\leq b+c, y&gt;b, z&gt;c\}$$</span></p> <p>If <span class="math-container">$P_{X}(B(b,c))=0$</span> and <span class="math-container">$P_{X}(Q(b,c))=0$</span> <span class="math-container">$\forall(b,c)\in \mathbb{Q}^2$</span>, then <span class="math-container">$\int_{\mathcal{S}}dP_{X}=1$</span>.</p> <p>The proof of the claim is provided <a href="https://math.stackexchange.com/questions/3075884/rewrite-int-a-b-c-in-mathbbr3-text-s-t-a-bc-dp-x-y-z-1-as">here</a></p> <hr> <p>I would like your help to <strong>generalise the claim (and possibly the proof)</strong> to any <span class="math-container">$r$</span>. <strong>What I find challenging is defining the relevant boxes for any <span class="math-container">$r&gt;2$</span></strong>. I really can't see how to generalise the box definitions from <span class="math-container">$r=2$</span> to any <span class="math-container">$r$</span>.</p>
0non-cybersec
Stackexchange
Is there a way to create your own HTML element?. <p>Is there a way to create your own HTML element? I want to make a specially designed check box.</p> <p>I imagine such a thing would be done in JavaScript. Something akin to <code>document.createHTMLElement</code> but the ability to design your own element (and tag).</p>
0non-cybersec
Stackexchange
Kids synchronising their jumps..
0non-cybersec
Reddit
[NO SPOILERS] My version of Daenerys (Digital Painting).
0non-cybersec
Reddit
Play 2.5 with Akka - could not find implicit value for parameter timeout: akka.util.Timeout. <p>I'm attempting to test out Akka with Play 2.5 and I'm running into a compile error I can't seem to get around.</p> <p>I'm following this page from the Play docs: <a href="https://playframework.com/documentation/2.5.x/ScalaAkka" rel="noreferrer">https://playframework.com/documentation/2.5.x/ScalaAkka</a></p> <p>Here is the full code:</p> <pre><code>package controllers import javax.inject.{Inject, Singleton} import akka.actor.ActorSystem import controllers.HelloActor.SayHello import play.api.mvc._ import play.api.libs.concurrent.Execution.Implicits.defaultContext import scala.concurrent.duration._ import akka.pattern.ask @Singleton class Application @Inject()(system: ActorSystem) extends Controller { implicit val timeout = 5.seconds val helloActor = system.actorOf(HelloActor.props, "hello-actor") def sayHello(name: String) = Action.async { (helloActor ? SayHello(name)).mapTo[String].map { message =&gt; Ok(message) } } } import akka.actor._ object HelloActor { def props = Props[HelloActor] case class SayHello(name: String) } class HelloActor extends Actor { import HelloActor._ def receive = { case SayHello(name: String) =&gt; sender() ! "Hello, " + name } } </code></pre> <p>My route looks like:</p> <pre><code>GET /:name controllers.Application.sayHello(name: String) </code></pre> <p>And, finally, my build.sbt:</p> <pre><code>name := "AkkaTest" version := "1.0" lazy val `akkatest` = (project in file(".")).enablePlugins(PlayScala) scalaVersion := "2.11.7" libraryDependencies ++= Seq( jdbc , cache , ws , specs2 % Test ) unmanagedResourceDirectories in Test &lt;+= baseDirectory ( _ /"target/web/public/test" ) resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases" routesGenerator := InjectedRoutesGenerator </code></pre> <p>When I attempt to run this, I get the following compilation error:</p> <pre><code>could not find implicit value for parameter timeout: akka.util.Timeout </code></pre> <p>I've tried moving around the timeout to no avail. Does anyone have an idea what might cause this compilation error?</p>
0non-cybersec
Stackexchange
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
I feel bad for this child.. most of the comments were supporting her smoking through pregnancy as well.
0non-cybersec
Reddit
Me [20F] with my mother [61 F], I think she has Münchausen by Proxy - with her cat.. Okay, so, I am currently in my junior year of university so I obviously don’t live with my Mom. She’s lonely since she and my Dad divorced in my freshman year. I visit a couple times a month but my time is very limited, especially as a chem. major. She got really crazy and needy, calling me up and crying, so I suggested that she get a pet so she wouldn’t be lonely. At my suggestion, she got a little orange cat, Apricot. I’m thinking it was in early April last year, so she has had Apricot for a little under a year. In the first week of May (I remember because finals were just ramping up), she calls me up and says that Apricot jumped out a second story window and hurt herself. I was concerned but couldn’t come visit and see for myself. Mom said that Apricot broke her hind leg and needed a cast, and that the vet thought she might have internal bleeding? It didn’t turn out that she had internal bleeding but she did have to wear her sad little cast for two months. No incidents until almost a month after the cast was off. Mom calls me in a panic, screaming that Apricot is throwing up and all wobbly. She immediately went to antifreeze, saying she was certain that the neighbor’s car was leaking antifreeze everywhere and Apricot must have drank it. She was adamant that it was antifreeze and not just the flu or whatever. I believed her and I told her to take Apricot to the vet. Sure enough, antifreeze poisoning. I don’t know what the treatment is for antifreeze poisoning in cats but I guess she was reached early enough and she was fine. At that point I was a bit suspicious that this dumb cat had gotten sick twice. I recommended to Mom that she keep Apricot inside to avoid these sorts of incidents. I think my Mom was fine for a while because she took on a part time job at the library and started doing some classes (cooking, etc) at this learning center. But just recently, I got approved for study abroad over the summer in Germany. I was ecstatic but realized that would mean I wouldn’t be able to visit my Mom over the summer. So I called her up and told her. She was crying, of course, it was just the waterworks. She doesn’t want me to go, she wants her favorite daughter, etc, etc. She always does this ever since the divorce – she wants to feel like she’s getting all possible attention. Friday morning, I get another panicky phone call. She says that Apricot has fallen down the stairs and broken 3 ribs. What??? I’ve never heard of a cat falling down stairs my whole life. She is upset, saying that she can’t take care of a cat, can’t take care of her pets, yada yada yada. I was furious but I didn’t accuse her of anything. There are no signs of abuse in Apricot besides the obvious. She’s friendly, openly loving, etc. But I’m seriously worried that my Mom might have Münchausen by Proxy. Am I overreacting? Are these just individual incidents that I’m linking up for no reason, or is there something to this? I can’t help feeling that this is all my fault for suggesting she get a pet in the first place. tl;dr: I think my Mom might be hurting her new cat, Apricot, on purpose. Apricot has broken a leg, drunk antifreeze, and fell down the stairs all in the past year. Am I just being paranoid?
0non-cybersec
Reddit
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
Made me laugh.
0non-cybersec
Reddit
PsBattle: Homeless Man Holding A Sign.
0non-cybersec
Reddit
Why does my isp advice against using an IP as MX?. <p>I'm wondering why I've heard a couple of times that it's bad to enter an IP directly as MX record. Most ISP's advise us to create an A record with the mailserver IP and use that A-record as MX record.</p> <p>I've entered an IP as MX before and it worked most of the time but there were cases that it didn't work. Can't seem to find why.</p> <p>Is there a reasonable explanation for this?</p>
0non-cybersec
Stackexchange
How to emit SocketIO event on the serverside. <p>I'm running a gevent-socketio Django application.</p> <p>I have something similar to this class</p> <pre><code>@namespace('/connect') class ConnectNamespace(BaseNamespace): def on_send(self, data): # ... </code></pre> <p>However, if I receive the events from the javascript client, everything works and for instance <code>send</code> event is processed correctly</p> <p>I'm a little bit lost if I want to <code>emit</code> some event on the server side. I can do it inside the class with <code>socket.send_packet</code></p> <p>But now I want to link some event to <code>post_save</code> signal, so I'd like to <code>send_packet</code> from outside this namespace class, one way of doing this would be </p> <pre><code>ConnectNamespaceInstance.on_third_event('someeventname') </code></pre> <p>I just can't figure out how can I get the instance of ConnectNamespaceInstance</p> <p>To sum it up, I just want to send an event to javascript client after I receive <code>post_save</code> signal</p>
0non-cybersec
Stackexchange
[NSV] Non keto husband. Been doing keto for 2 weeks, and as my husband is in pretty good shape and fairly healthy, I told him he didn't have to do it (but he is still a huge support to me!!). I have been craving sugar soo bad and he asked for cinnamon rolls this morning for breakfast. So I made them for him and didn't eat any. Thats kind of huge for me since I have been known to eat an entire batch on my own. Yay for progress!
0non-cybersec
Reddit
Lagrange Multipliers where no solutions(s) satisfy the constraints. <p>$f(x) = x-y$ subject to constraint $x^2-y^2=2$<br> Using the method of Lagrange Multipliers, we get: </p> <p>$(1, -1) = \lambda(2x, -2y)$ which gives $x=y$ but this does not satisfy $x^2-y^2=2$</p> <p>Is this because the Lagrange method is not applicable here? Or is it valid for the Lagrange method to not produce any solutions?</p>
0non-cybersec
Stackexchange
Louie (Season 2) starring Louis CK.
0non-cybersec
Reddit
Using lambda expression as Compare for std::set, when it&#39;s inside a vector. <p>I want to use a lambda expression as custom Compare for a std::set of integers. There are many answers on this site explaining how to do this, for example <a href="https://stackoverflow.com/a/46128321/10774939">https://stackoverflow.com/a/46128321/10774939</a>. And indeed,</p> <pre><code>#include &lt;vector&gt; #include &lt;set&gt; #include &lt;iostream&gt; int main() { auto different_cmp = [](int i, int j) -&gt; bool { return j &lt; i; }; std::set&lt;int, decltype(different_cmp)&gt; integers(different_cmp); integers.insert(3); integers.insert(4); integers.insert(1); for (int integer : integers) { std::cout &lt;&lt; integer &lt;&lt; " "; } return 0; } </code></pre> <p>compiles and outputs</p> <blockquote> <p>4 3 1</p> </blockquote> <p>as expected. However, when I try to put this set in a vector with</p> <pre><code> std::vector&lt;std::set&lt;int, decltype(different_cmp)&gt;&gt; vec_of_integers; vec_of_integers.push_back(integers); </code></pre> <p>the compiler complains. I'm using Visual Studio 2017 and I get different compiler errors depending on the surrounding code. In the above example, it's</p> <pre><code>1&gt;c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\utility(77): error C2664: 'void std::swap(std::exception_ptr &amp;,std::exception_ptr &amp;) noexcept': cannot convert argument 1 from '_Ty' to 'std::exception_ptr &amp;' 1&gt; with 1&gt; [ 1&gt; _Ty=main::&lt;lambda_48847b4f831139ed92f5310c6e06eea1&gt; 1&gt; ] </code></pre> <p>Most of the errors I've seen so far with this seem to have to do with copying the set.</p> <p>So my question is: </p> <blockquote> <p>Why does the above code not work and how can I make it work, while still using a locally defined lambda?</p> </blockquote>
0non-cybersec
Stackexchange
Toy story 2 never changes.
0non-cybersec
Reddit
How to split a string into tokens in C?. <p>How to split a string into tokens by <code>'&amp;'</code> in C? </p>
0non-cybersec
Stackexchange
Reasons Guys Want to Lose Weight.
0non-cybersec
Reddit
After surfing Reddit the last few days and seeing all these Bio Shock post.
0non-cybersec
Reddit
Dimensions of the pages. <p>I have used the simple dimensions <code>top</code>, <code>bottom</code>, <code>left</code> and <code>right</code> to scale all pages of my document with the <code>geometry</code> package.</p> <p>Suppose I want a few pages with different scaling and a few pages with different scaling in the same article. How do I do that?</p>
0non-cybersec
Stackexchange
vServer Debian Linux virtual host issue. <p>I am having an issue with my virtual host setup for days. My server is a vserver with debain linux and I am trying to add two new domains which will be redirected to their own subfolders.</p> <p>Domain1.com --> /var/www/domain1</p> <p>Domain2.com --> /var/www/domain2</p> <p>The setup is working fine, but the domains are not redirecting to the subfolders but the server root directory. So if I open "domain1.com" I get redirected to "domain1.com/mail" which is the roundcube installation.</p> <p>Here is how I did the setup:</p> <p><strong>/etc/apache2/sites-available/domain1</strong></p> <pre><code>&lt;VirtualHost domain1.com&gt; ServerAdmin webmaster@localhost ServerAlias domain1.com *.domain1.com DocumentRoot /var/www/domain1 &lt;/VirtualHost&gt; </code></pre> <p><strong>/etc/hosts</strong></p> <pre><code>127.0.0.1 localhost.localdomain localhost domain1.com www.domain1.com </code></pre> <p>I just don't get it why it's not redirected to the subfolder... Can someone please tell me what I am doing wrong?</p>
0non-cybersec
Stackexchange
Axiomatizing a &quot;bounded&quot; companion to PA. <p><em>There's nothing special about PA here, I'm just focusing on it since it's strong enough to ignore lots of minor technical issues around foundations. If switching to some other theory would yield a better response, feel free to do so.</em></p> <p>Let <span class="math-container">$$PA_{bd}=\{\varphi: PA\vdash\forall^\infty n([n]\models\varphi)\},$$</span> where <span class="math-container">$[n]=\{0,1,...,n\}$</span> <em>(with <span class="math-container">$+$</span> and <span class="math-container">$\times$</span> interpreted as <span class="math-container">$$a+^{[n]}b=\min\{a+b, n\},\quad a\times^{[n]}b=\min\{a\times b, n\}$$</span> so that this actually makes sense - we could also switch to the relational version of PA)</em>. Note that (for fixed <span class="math-container">$\varphi$</span>) the statement "<span class="math-container">$\forall^\infty n([n]\models\varphi)$</span>" can in fact be expressed in the language of arithmetic (Skolem functions over finite objects are themselves finite objects), so the definition of PA<span class="math-container">$_{bd}$</span> does actually make sense.</p> <p>Clearly PA<span class="math-container">$_{bd}$</span> is recursively axiomatizable; however, this only gives an axiomatization which "goes through PA" in some sense. My question is:</p> <blockquote> <p>Is there a reasonably-simple axiomatization of PA<span class="math-container">$_{bd}$</span> which doesn't reference PA itself?</p> </blockquote> <hr> <p>One natural guess would be [some basic algebra stuff] together with the full induction scheme. But in fact this is too <em>weak</em> - already this theory is contained in the analogous theory (I<span class="math-container">$\Sigma_1)_{bd}$</span> <em>(since saying that a finite structure satisfies a complicated formula is still a very simple formula!)</em>.</p> <p>Further evidencing some structure here, it's easy to show (e.g. I<span class="math-container">$\Sigma_1$</span> can prove) that PA and PA<span class="math-container">$_{bd}$</span> are equiconsistent:</p> <ul> <li><p>If PA is inconsistent then PA proves everything, and in particular PA proves <span class="math-container">$\forall^\infty n([n]\models\perp)$</span> which gives <span class="math-container">$\perp\in$</span> PA<span class="math-container">$_{bd}$</span>.</p></li> <li><p>If PA<span class="math-container">$_{bd}$</span> is inconsistent, that means that for some <span class="math-container">$\varphi$</span> we have PA<span class="math-container">$\vdash \forall^{\infty}n([n]\models\perp)$</span>. But PA can prove enough about the semantics of finite structures to prove that no <span class="math-container">$[n]$</span> satisfies <span class="math-container">$\perp$</span>, and so we get a contradiction in PA.</p></li> </ul> <p>(As an aside, the usual proof of Tennenbaum's theorem also shows that PA<span class="math-container">$_{bd}$</span> has no computable models either. Which isn't surprising, since any of its models are clearly proper end extensions of <span class="math-container">$\mathbb{N}$</span>.)</p>
0non-cybersec
Stackexchange
Results of Star Swarm Stress Test.
0non-cybersec
Reddit
A square of a rational between two positive real numbers ?!. <p>Let $ a,b \in \mathbb{R}^+ ,(a&lt;b) $. Prove that there is a rational number $ q $ such that $ a&lt;q^2&lt;b $, without using square root function.</p> <p>Can anyone help me ?</p>
0non-cybersec
Stackexchange
.Net core startup base class. <p>Wishing to use .Net core to create a suite of micro services, I was thinking of creating a base class for the Startup class which would be responsible for configuring common features such as logging, authentication, endpoint health checks therefore standardizing all our services. </p> <p>I was surprised however that such a pattern does not seem to be mentioned. Is the preferred pattern to use custom middleware for common functionality instead? Any thoughts or experience in relation to this dilemma would be appreciated. </p>
0non-cybersec
Stackexchange
Expectation and Variance of Poisson Process. <blockquote> <p>Suppose that in a store, customers arrive as a Poisson process with rate $1/\mathrm{min}$ between time $0$ and $10$ minutes. Suppose there are ten kinds of items in the store (each kind has infinite supply) and each customer independently chooses one item uniformly at random and buy it. Let $M$ be the number of distinct kinds of items that are purchased up to time $10$. What is the expectation and variance of $M$?</p> </blockquote> <p>n.b.: This is not homework; just review.</p> <p>For the expectation, I let $N$ (which follows $\mathrm{Pois}(10)$) be the number of customers arriving in the first ten minutes, and I found that $\mathbb{E}(M|N=k)=10(1-(9/10)^k)$ so then $\mathbb{E}M=\sum_k \frac{e^{-10}10^k}{k!}(10(1-(9/10)^k)$. But I'm not sure that this yields the correct answer.</p> <p>Any help would be appreciated. Thanks.</p>
0non-cybersec
Stackexchange
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
Gesture Recognition In Android. <p>I'm new to Android and I'm working on <code>Gestures</code>. I have a problem regarding how to recognise the text. When a user draws a letter or number that has to be recognised and has to be printed on the top of the screen. I came to know that it can be done through <code>GestureOverlayView</code>but dont know how to implement it.</p> <p>Can anyone please help me with some sample code.</p>
0non-cybersec
Stackexchange
When does SQL Server determine to use a new index?. <p>I have been performing some maintenance on a server that runs some software the company bought, so I can't really change how the queries have been written. I have used some tools to determine some of the missing indexes on the server. Using my tools, though, I didn't see which queries were indicating these. I do, however, monitor how much the indexes are being written and read.</p> <p>So, my question is, when adding new indexes that have been determined as missing, when does SQL Server notice the new indexes and determines whether they actually help the query? Is it immediately after the index is created and the query is ran again, or is it more complicated?</p>
0non-cybersec
Stackexchange
If you were limited to one outfit, what would it be?. If you were limited to one outfit you wore nearly every day like Steve Jobs or Mark Zuckerberg, what would it be? grey tees, denim jeans, and sneakers? black turtle necks, jeans? etc
0non-cybersec
Reddit
Cannibals capture three men. The men are told that they will be skinned and eaten and then their skin will be used to make canoes. Then they are each given a final request. The first man asks to be killed as quickly and painlessly as possible. His request is granted, and they poison him. The second man asks for paper and pen so that he can write a farewell letter to his family. This request is granted, and after he writes his letter, they kill him saving his skin for their canoes. Now it's the third man's turn. He asks for a fork. The cannibals are confused, but it is his final request, so they give him a fork. As soon as he has the fork he begins stabbing himself all over and shouts, "To hell with your canoes!"
0non-cybersec
Reddit
Proof: Every irreducible diagonaldominant matrix is $A$ is invertible.. <blockquote> <p><strong>Definition:</strong> A matrix <span class="math-container">$A\in\mathbb{K}^{N,N}$</span> is irreducible diagonaldominant if it is irreducible and row or column diagonaldominant, where at least in one row/ column strict inequality has to hold.</p> <p>Let <span class="math-container">$A$</span> be irreducible diagonaldominant (row-diagonaldominant). Then there exists <span class="math-container">$m\in{1,...,N}$</span> for which</p> <p><span class="math-container">$\hspace{4cm} |a_{mm}|&gt;\sum\limits_{j\neq m}|a_mj|\hspace{1cm} (1)$</span></p> <p>Assume that <span class="math-container">$A$</span> isn't invertible. Then <span class="math-container">$Ax=0$</span> has a solution <span class="math-container">$x\neq 0$</span>. Because of <span class="math-container">$(1)$</span> not all components of <span class="math-container">$x$</span> can have the same absolute value. Let</p> <p><span class="math-container">$\hspace{4cm} I:=\{k\in\{1,...,N\}:|x_k|\geq x_j \forall j = 1,...,N\}$</span></p> <p>Since not all indices <span class="math-container">$x_k$</span> have the same absolute value not all <span class="math-container">$N$</span> indices are a member of <span class="math-container">$I$</span>. Now let <span class="math-container">$k\in I$</span></p> <p><span class="math-container">$\hspace{4cm} a_{kk}x_k = -\sum\limits_{j\neq k}a_{kj}x_j,$</span></p> <p><span class="math-container">$\hspace{4cm} |a_{kk}|\leq\sum\limits_{j\neq k}|a_{kj}|\dfrac{|x_j|}{|x_k|}$</span></p> <p>because of <span class="math-container">$\dfrac{|x_j|}{|x_k|}\leq 1$</span> (while for <span class="math-container">$j\notin I$</span> we have strict inequality) and the diagonaldominance of <span class="math-container">$A$</span> we get <span class="math-container">$a_{kj}=0\forall j\notin I$</span>. However this means that <span class="math-container">$A$</span> is reducible which is a contradiction to our prequisites.</p> </blockquote> <p>So I can follow this proof right up to the last paragraph of which I don't understand why we get <span class="math-container">$a_{kj}=0\forall j\notin I$</span> and furthermore why this would imply reducibility. </p> <p>I'm aware of the fact that a matrix <span class="math-container">$A$</span> is irreducible iff its digraph is strongly connected, but I don't see how one could apply this theorem here.</p> <p><strong>Edit</strong> the answer of @user1551 made things clearer for me but I think I can elaborate on two more steps in the proof that I didn't understand before. First of all why <span class="math-container">$\dfrac{|x_j|}{|x_k|}&lt;1$</span> for <span class="math-container">$j\notin I$</span>.</p> <blockquote> <p>Let <span class="math-container">$j\notin I$</span> therefore there is <span class="math-container">$ m=1,...,N:x_m&gt;|x_j|$</span>. Now we assume that <span class="math-container">$|x_j|=|x_k|$</span> this though implies <span class="math-container">$x_m&gt;|x_k|$</span> which is a contradiction to the fact that <span class="math-container">$k\in I$</span> hence <span class="math-container">$|x_j|&lt;|x_k|$</span>.</p> </blockquote> <p>In the end this leads to the conclusion that indeed <span class="math-container">$A$</span> is reducible because since <span class="math-container">$k$</span> was an arbitrary element from <span class="math-container">$I$</span> we have</p> <blockquote> <p><span class="math-container">$\forall k\in I:\forall j\notin I: a_{kj} = 0$</span>.</p> </blockquote> <p>One could've tought about taking a path that passes trough other nodes before but by remarking that <span class="math-container">$I\cup I^C=N$</span> we can see that this isn't possible because there are no connections between <span class="math-container">$I$</span> and <span class="math-container">$I^C$</span> at all.</p>
0non-cybersec
Stackexchange
Convert 8-digit hex colors to rgba colors?. <p>Everything I've found on this subject simply converts the hex to rgb and then adds an alpha of 1. I want to get the intended alpha from the hex digits as well.</p> <p>A color such as <code>#949494E8</code> or <code>#DCDCDC8F</code> clearly has an alpha value that's not 0 or 1.</p>
0non-cybersec
Stackexchange
How secure is BitLocker without TPM?. <p>My laptop doesn't have TPM. If I enable BL PIN and someone steals my laptop and remove the drive, will they be able to read it's content on another computer? How am I vulnerable without TPM?</p>
0non-cybersec
Stackexchange
Border of mirror made from spoons.
0non-cybersec
Reddit
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
Swift - Impossible to use &quot;registerNib&quot; on my tableView to add a custom cell. <p>I'm just figuring out how to add custom cells to a tableView in Swift. I watched a lot of tutorials and they all say at some point to use something like <code>tableView.registerNib</code> which is not working for me !</p> <p>This is the code I'm using in my tableViewController class :</p> <pre><code>var nib = UINib(nibName: "ViewExerciceCell", bundle: nil) tableView.registerNib(nib, forCellReuseIdentifier: "ExerciceCell") </code></pre> <p>When I try to build, I have an error on the second line which says : </p> <blockquote> <p>Cannot invoke 'registerNib' with an argument list of type '(UINib, forCellReuseIdentifier: String)'.</p> </blockquote> <p>What can I do ? All the tutorials and other answers about custom cells are using this code.</p> <p>Thanks in advance </p>
0non-cybersec
Stackexchange
What is the best strategy to find 2 circles whose total area is maximum in a triangle?. <p>I am looking for the best strategy to find 2 circles whose total area are maximum in a triangle. I tried it on an example as seen Figures below. </p> <p>Strategy $1$:</p> <p>If I draw a big circle that touchs to 3 sides and then to draw 3 circles next to the big circle. Then select the biggest one in three of them. As seen in Figure 1 that I found Max Area of 2 circles: 14.18+4.56=18.74</p> <p>Strategy $2$:</p> <p>To drew 2 circles that each one touched to 2 sides of triangles and also touching each other as seen in Figure-2. I tried to extend total area that what I got in Strategy 1 but I could not. </p> <p>Of course I know my example is not proof that Strategy 1 is general solution of the problem. I just tried to show what I did till now to solve the optimum problem.</p> <p>Could you please help me to find the best strategy and to proof it for that optimum problem? Note:If there is a general strategy proof for total max area for n circles in a triangle, It can be wonderful. Thanks for your answers and your time.</p> <p><img src="https://i.stack.imgur.com/hyq9b.png" alt="enter image description here"> <img src="https://i.stack.imgur.com/O5gvz.png" alt="enter image description here"></p>
0non-cybersec
Stackexchange
How do I permanently disable the APM (advanced power management) of my Hitachi hard drives?. <p>I'm using <a href="https://sites.google.com/site/quiethdd/" rel="nofollow noreferrer">quietHDD</a> and/or <a href="http://disablehddapm.blogspot.com/" rel="nofollow noreferrer">hdparm</a> to disable <a href="https://en.wikipedia.org/wiki/Advanced_Power_Management" rel="nofollow noreferrer">APM</a> on my very clicky Hitachi hard drives (to stop the disk heads from parking).</p> <p>The program supposedly only needs to be run at boot time and after power cycles such as standby/sleep. However, in my case it seems to only work for short periods at a time before the clicking returns and I have to run quietHDD or hdparm again.</p> <p>Is there a way to <em>permanently</em> edit the drives' settings so APM is completedly disabled for the life of the drive?</p>
0non-cybersec
Stackexchange
TL-WN821N Wifi not working correctly. <p>I have a TL-WN821N wifi USB device which worked fine (gave me a connection) when I was installing Ubuntu on my PC. It downloaded all the updates and what not and got the OS installed.</p> <p>I even opened terminal after installation to see if I have a working connection by using ping command. And I did.</p> <p>Now when I open up Firefox and go to a webpage, it will load the webpage and after that the connection is gone, it still show like I am connected to the internet in the WIFI status indicator but no futher pages can be opened and the ping command does not work anymore too.</p> <p>What might be the case here?</p> <p>I want to say that I have now used to help from the web. Used ndisgtk and added some files to /etc/modprobe</p> <p>My Ubuntu installation now does not even see that I have this USB device connected to my computer. I reverted all changes and it still will not even see the device. I used lusb or whatever the command was ans lshw also to see it. Nothing showed up.</p> <p>So what can I do now at this point? How can I make my computer atleast detect the device.</p> <p>Info with the wifi script:</p> <pre><code>########## wireless info START ########## ##### release ##### Distributor ID: Ubuntu Description: Ubuntu 13.10 Release: 13.10 Codename: saucy ##### kernel ##### Linux kaspar-All-Series 3.11.0-19-generic #33-Ubuntu SMP Tue Mar 11 18:48:34 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux ##### lspci ##### 03:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0c) Subsystem: ASUSTeK Computer Inc. Device [1043:8554] Kernel driver in use: r8169 ##### lsusb ##### Bus 002 Device 002: ID 8087:8000 Intel Corp. Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 002: ID 8087:8008 Intel Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 004: ID 0bda:8178 Realtek Semiconductor Corp. RTL8192CU 802.11n WLAN Adapter Bus 003 Device 003: ID 1532:000d Razer USA, Ltd Bus 003 Device 002: ID 046d:c326 Logitech, Inc. Bus 003 Device 005: ID 0781:5406 SanDisk Corp. Cruzer Micro U3 Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub ##### PCMCIA Card Info ##### ##### rfkill ##### ##### iw reg get ##### country 00: (2402 - 2472 @ 40), (6, 20) (2457 - 2482 @ 40), (6, 20), PASSIVE-SCAN, NO-IBSS (2474 - 2494 @ 20), (6, 20), NO-OFDM, PASSIVE-SCAN, NO-IBSS (5170 - 5250 @ 80), (6, 20), PASSIVE-SCAN, NO-IBSS (5735 - 5835 @ 80), (6, 20), PASSIVE-SCAN, NO-IBSS (57240 - 63720 @ 2160), (N/A, 0) ##### interfaces ##### # interfaces(5) file used by ifup(8) and ifdown(8) auto lo iface lo inet loopback ##### iwconfig ##### ##### route ##### Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface ##### resolv.conf ##### ##### nm-tool ##### NetworkManager Tool State: disconnected - Device: eth0 ----------------------------------------------------------------- Type: Wired Driver: r8169 State: unavailable Default: no HW Address: &lt;MAC address removed&gt; Capabilities: Carrier Detect: yes Wired Properties Carrier: off ##### NetworkManager.state ##### [main] NetworkingEnabled=true WirelessEnabled=true WWANEnabled=true WimaxEnabled=true ##### NetworkManager.conf ##### [main] plugins=ifupdown,keyfile,ofono dns=dnsmasq [ifupdown] managed=false ##### iwlist ##### ##### iwlist channel ##### ##### lsmod ##### ##### modinfo ##### ##### modules ##### lp rtc ##### blacklist ##### [/etc/modprobe.d/blacklist-ath_pci.conf] blacklist ath_pci [/etc/modprobe.d/blacklist.conf] blacklist evbug blacklist usbmouse blacklist usbkbd blacklist eepro100 blacklist de4x5 blacklist eth1394 blacklist snd_intel8x0m blacklist snd_aw2 blacklist i2c_i801 blacklist prism54 blacklist bcm43xx blacklist garmin_gps blacklist asus_acpi blacklist snd_pcsp blacklist pcspkr blacklist amd76x_edac [/etc/modprobe.d/bumblebee.conf] blacklist nouveau blacklist nvidia blacklist nvidia-current blacklist nvidia-current-updates blacklist nvidia-304 blacklist nvidia-304-updates blacklist nvidia-experimental-304 blacklist nvidia-310 blacklist nvidia-310-updates blacklist nvidia-experimental-310 blacklist nvidia-313 blacklist nvidia-313-updates blacklist nvidia-experimental-313 blacklist nvidia-319 blacklist nvidia-319-updates blacklist nvidia-experimental-319 blacklist nvidia-325 blacklist nvidia-325-updates blacklist nvidia-experimental-325 blacklist nvidia-331 blacklist nvidia-331-updates blacklist nvidia-experimental-331 ##### udev rules ##### # PCI device 0x10ec:0x8168 (r8169) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="&lt;MAC address removed&gt;", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" # USB device 0x:0x (rtl8192cu) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="&lt;MAC address removed&gt;", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0" ##### dmesg ##### ########## wireless info END ############ May 20 13:01:59 kaspar-All-Series anacron[847]: Job `cron.daily' terminated May 20 13:02:00 kaspar-All-Series dbus[618]: [system] Activating service name='com.ubuntu.ScreenResolution.Mechanism' (using servicehelper) May 20 13:02:00 kaspar-All-Series dbus[618]: [system] Successfully activated service 'com.ubuntu.ScreenResolution.Mechanism' May 20 13:04:27 kaspar-All-Series dbus[618]: [system] Activating service name='org.freedesktop.hostname1' (using servicehelper) May 20 13:04:27 kaspar-All-Series dbus[618]: [system] Successfully activated service 'org.freedesktop.hostname1' May 20 13:04:42 kaspar-All-Series AptDaemon: INFO: UpdateCache() was called May 20 13:04:42 kaspar-All-Series AptDaemon.Trans: INFO: Queuing transaction /org/debian/apt/transaction/653acc3280a44adbbb0fb39b503c017c May 20 13:04:42 kaspar-All-Series AptDaemon.Worker: INFO: Simulating trans: /org/debian/apt/transaction/653acc3280a44adbbb0fb39b503c017c May 20 13:04:42 kaspar-All-Series AptDaemon.Worker: INFO: Processing transaction /org/debian/apt/transaction/653acc3280a44adbbb0fb39b503c017c May 20 13:04:43 kaspar-All-Series AptDaemon.Worker: INFO: Updating cache May 20 13:05:02 kaspar-All-Series AptDaemon.Worker: INFO: Finished transaction /org/debian/apt/transaction/653acc3280a44adbbb0fb39b503c017c May 20 13:05:32 kaspar-All-Series anacron[847]: Job `cron.weekly' started May 20 13:05:32 kaspar-All-Series anacron[3813]: Updated timestamp for job `cron.weekly' to 2014-05-20 May 20 13:05:45 kaspar-All-Series AptDaemon: INFO: CommitPackages() was called: dbus.Array([dbus.String('')], signature=dbus.Signature('s')), dbus.Array([dbus.String('')], signature=dbus.Signature('s')), dbus.Array([dbus.String('')], signature=dbus.Signature('s')), dbus.Array([dbus.String('')], signature=dbus.Signature('s')), dbus.Array([dbus.String('account-plugin-aim'), dbus.String('account-plugin-jabber'), dbus.String('account-plugin-salut'), dbus.String('account-plugin-yahoo'), dbus.String('app-install-data'), dbus.String('bash'), dbus.String('cups-browsed'), dbus.String('cups-filters'), dbus.String('cups-filters-core-drivers'), dbus.String('dpkg'), dbus.String('empathy'), dbus.String('empathy-common'), dbus.String('firefox'), dbus.String('firefox-locale-en'), dbus.String('firefox-locale-et'), dbus.String('flashplugin-installer'), dbus.String('gdb'), dbus.String('gettext'), dbus.String('gettext-base'), dbus.String('ghostscript'), dbus.String('ghostscript-x'), dbus.String('gir1.2-freedesktop'), dbus.String('gir1.2-glib-2.0'), dbus.String('gir1.2-gudev-1.0'), dbus.String('gir1.2-rb-3.0'), dbus.String('gnome-calculator'), dbus.String('gnome-control-center-shared-data'), dbus.String('icedtea-7-jre-jamvm'), dbus.String('ifupdown'), dbus.String('initramfs-tools'), dbus.String('initramfs-tools-bin'), dbus.String('iputils-arping'), dbus.String('iputils-ping'), dbus.String('iputils-tracepath'), dbus.String('libasprintf-dev'), dbus.String('libasprintf0c2'), dbus.String('libavcodec54'), dbus.String('libavformat54'), dbus.String('libavutil52'), dbus.String('libcupsfilters1'), dbus.String('libdpkg-perl'), dbus.String('libdrm-intel1'), dbus.String('libdrm-intel1:i386'), dbus.String('libdrm-nouveau2'), dbus.String('libdrm-nouveau2:i386'), dbus.String('libdrm-radeon1'), dbus.String('libdrm-radeon1:i386'), dbus.String('libdrm2'), dbus.String('libdrm2:i386'), dbus.String('libegl1-mesa'), dbus.String('libegl1-mesa-drivers'), dbus.String('libelf1'), dbus.String('libelf1:i386'), dbus.String('libfontembed1'), dbus.String('libfreetype6'), dbus.String('libfreetype6:i386'), dbus.String('libgail-common'), dbus.String('libgail18'), dbus.String('libgbm1'), dbus.String('libgettextpo-dev'), dbus.String('libgettextpo0'), dbus.String('libgexiv2-2'), dbus.String('libgirepository-1.0-1'), dbus.String('libgl1-mesa-dri'), dbus.String('libgl1-mesa-dri:i386'), dbus.String('libgl1-mesa-glx'), dbus.String('libgl1-mesa-glx:i386'), dbus.String('libglamor0'), dbus.String('libglapi-mesa'), dbus.String('libglapi-mesa:i386'), dbus.String('libgles2-mesa'), dbus.String('libgnome-control-center1'), dbus.String('libgs9'), dbus.String('libgs9-common'), dbus.String('libgtk2.0-0'), dbus.String('libgtk2.0-bin'), dbus.String('libgtk2.0-common'), dbus.String('libgudev-1.0-0'), dbus.String('libido3-0.1-0'), dbus.String('libjbig0'), dbus.String('libjbig0:i386'), dbus.String('liblightdm-gobject-1-0'), dbus.String('libmysqlclient18:i386'), dbus.String('libopenvg1-mesa'), dbus.String('libpam-systemd'), dbus.String('librhythmbox-core8'), dbus.String('libsdl1.2debian'), dbus.String('libselinux1'), dbus.String('libselinux1:i386'), dbus.String('libsmbclient'), dbus.String('libssl1.0.0'), dbus.String('libssl1.0.0:i386'), dbus.String('libswscale2'), dbus.String('libsystemd-daemon0'), dbus.String('libsystemd-journal0'), dbus.String('libsystemd-login0'), dbus.String('libtiff5'), dbus.String('libtiff5:i386'), dbus.String('libudev1'), dbus.String('libudev1:i386'), dbus.String('libunity-core-6.0-9'), dbus.String('libvlc5'), dbus.String('libvlccore7'), dbus.String('libwayland-egl1-mesa'), dbus.String('libwbclient0'), dbus.String('libxatracker2'), dbus.String('libxfont1'), dbus.String('libxml2'), dbus.String('libxml2:i386'), dbus.String('lightdm'), dbus.String('linux-firmware'), dbus.String('linux-generic'), dbus.String('linux-headers-3.13.0-24'), dbus.String('linux-headers-3.13.0-24-generic'), dbus.String('linux-headers-generic'), dbus.String('linux-image-3.13.0-24-generic'), dbus.String('linux-image-extra-3.13.0-24-generic'), dbus.String('linux-image-generic'), dbus.String('linux-libc-dev'), dbus.String('ltrace'), dbus.String('mcp-account-manager-uoa'), dbus.String('mysql-common'), dbus.String('nautilus-sendto-empathy'), dbus.String('nvidia-337'), dbus.String('nvidia-settings'), dbus.String('openjdk-7-jre'), dbus.String('openjdk-7-jre-headless'), dbus.String('openssl'), dbus.String('patch'), dbus.String('python-cupshelpers'), dbus.String('python-libxml2'), dbus.String('python-samba'), dbus.String('python3-software-properties'), dbus.String('python3-update-manager'), dbus.String('rhythmbox'), dbus.String('rhythmbox-data'), dbus.String('rhythmbox-mozilla'), dbus.String('rhythmbox-plugin-cdrecorder'), dbus.String('rhythmbox-plugin-magnatune'), dbus.String('rhythmbox-plugin-zeitgeist'), dbus.String('rhythmbox-plugins'), dbus.String('rsync'), dbus.String('samba-common'), dbus.String('samba-common-bin'), dbus.String('samba-libs'), dbus.String('smbclient'), dbus.String('software-center'), dbus.String('software-properties-common'), dbus.String('software-properties-gtk'), dbus.String('steam-launcher'), dbus.String('system-config-printer-common'), dbus.String('system-config-printer-gnome'), dbus.String('system-config-printer-udev'), dbus.String('systemd-services'), dbus.String('thunderbird'), dbus.String('thunderbird-gnome-support'), dbus.String('thunderbird-locale-en'), dbus.String('thunderbird-locale-en-gb'), dbus.String('thunderbird-locale-en-us'), dbus.String('thunderbird-locale-et'), dbus.String('tzdata'), dbus.String('tzdata-java'), dbus.String('udev'), dbus.String('unity'), dbus.String('unity-greeter'), dbus.String('unity-services'), dbus.String('update-manager'), dbus.String('update-manager-core'), dbus.String('vlc'), dbus.String('vlc-data'), dbus.String('vlc-nox'), dbus.String('vlc-plugin-notify'), dbus.String('vlc-plugin-pulse'), dbus.String('xserver-xorg-video-ati'), dbus.String('xserver-xorg-video-glamoregl'), dbus.String('xserver-xorg-video-intel'), dbus.String('xserver-xorg-video-nouveau'), dbus.String('xserver-xorg-video-radeon')], signature=dbus.Signature('s')), dbus.Array([dbus.String('')], signature=dbus.Signature('s')) May 20 13:05:45 kaspar-All-Series AptDaemon.Trans: INFO: Queuing transaction /org/debian/apt/transaction/cc1925d70e1446e787796b1de148b4f5 May 20 13:05:45 kaspar-All-Series AptDaemon.Worker: INFO: Simulating trans: /org/debian/apt/transaction/cc1925d70e1446e787796b1de148b4f5 May 20 13:05:45 kaspar-All-Series AptDaemon.Worker: INFO: Committing packages: dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([dbus.String('account-plugin-aim'), dbus.String('account-plugin-jabber'), dbus.String('account-plugin-salut'), dbus.String('account-plugin-yahoo'), dbus.String('app-install-data'), dbus.String('bash'), dbus.String('cups-browsed'), dbus.String('cups-filters'), dbus.String('cups-filters-core-drivers'), dbus.String('dpkg'), dbus.String('empathy'), dbus.String('empathy-common'), dbus.String('firefox'), dbus.String('firefox-locale-en'), dbus.String('firefox-locale-et'), dbus.String('flashplugin-installer'), dbus.String('gdb'), dbus.String('gettext'), dbus.String('gettext-base'), dbus.String('ghostscript'), dbus.String('ghostscript-x'), dbus.String('gir1.2-freedesktop'), dbus.String('gir1.2-glib-2.0'), dbus.String('gir1.2-gudev-1.0'), dbus.String('gir1.2-rb-3.0'), dbus.String('gnome-calculator'), dbus.String('gnome-control-center-shared-data'), dbus.String('icedtea-7-jre-jamvm'), dbus.String('ifupdown'), dbus.String('initramfs-tools'), dbus.String('initramfs-tools-bin'), dbus.String('iputils-arping'), dbus.String('iputils-ping'), dbus.String('iputils-tracepath'), dbus.String('libasprintf-dev'), dbus.String('libasprintf0c2'), dbus.String('libavcodec54'), dbus.String('libavformat54'), dbus.String('libavutil52'), dbus.String('libcupsfilters1'), dbus.String('libdpkg-perl'), dbus.String('libdrm-intel1'), dbus.String('libdrm-intel1:i386'), dbus.String('libdrm-nouveau2'), dbus.String('libdrm-nouveau2:i386'), dbus.String('libdrm-radeon1'), dbus.String('libdrm-radeon1:i386'), dbus.String('libdrm2'), dbus.String('libdrm2:i386'), dbus.String('libegl1-mesa'), dbus.String('libegl1-mesa-drivers'), dbus.String('libelf1'), dbus.String('libelf1:i386'), dbus.String('libfontembed1'), dbus.String('libfreetype6'), dbus.String('libfreetype6:i386'), dbus.String('libgail-common'), dbus.String('libgail18'), dbus.String('libgbm1'), dbus.String('libgettextpo-dev'), dbus.String('libgettextpo0'), dbus.String('libgexiv2-2'), dbus.String('libgirepository-1.0-1'), dbus.String('libgl1-mesa-dri'), dbus.String('libgl1-mesa-dri:i386'), dbus.String('libgl1-mesa-glx'), dbus.String('libgl1-mesa-glx:i386'), dbus.String('libglamor0'), dbus.String('libglapi-mesa'), dbus.String('libglapi-mesa:i386'), dbus.String('libgles2-mesa'), dbus.String('libgnome-control-center1'), dbus.String('libgs9'), dbus.String('libgs9-common'), dbus.String('libgtk2.0-0'), dbus.String('libgtk2.0-bin'), dbus.String('libgtk2.0-common'), dbus.String('libgudev-1.0-0'), dbus.String('libido3-0.1-0'), dbus.String('libjbig0'), dbus.String('libjbig0:i386'), dbus.String('liblightdm-gobject-1-0'), dbus.String('libmysqlclient18:i386'), dbus.String('libopenvg1-mesa'), dbus.String('libpam-systemd'), dbus.String('librhythmbox-core8'), dbus.String('libsdl1.2debian'), dbus.String('libselinux1'), dbus.String('libselinux1:i386'), dbus.String('libsmbclient'), dbus.String('libssl1.0.0'), dbus.String('libssl1.0.0:i386'), dbus.String('libswscale2'), dbus.String('libsystemd-daemon0'), dbus.String('libsystemd-journal0'), dbus.String('libsystemd-login0'), dbus.String('libtiff5'), dbus.String('libtiff5:i386'), dbus.String('libudev1'), dbus.String('libudev1:i386'), dbus.String('libunity-core-6.0-9'), dbus.String('libvlc5'), dbus.String('libvlccore7'), dbus.String('libwayland-egl1-mesa'), dbus.String('libwbclient0'), dbus.String('libxatracker2'), dbus.String('libxfont1'), dbus.String('libxml2'), dbus.String('libxml2:i386'), dbus.String('lightdm'), dbus.String('linux-firmware'), dbus.String('linux-generic'), dbus.String('linux-headers-3.13.0-24'), dbus.String('linux-headers-3.13.0-24-generic'), dbus.String('linux-headers-generic'), dbus.String('linux-image-3.13.0-24-generic'), dbus.String('linux-image-extra-3.13.0-24-generic'), dbus.String('linux-image-generic'), dbus.String('linux-libc-dev'), dbus.String('ltrace'), dbus.String('mcp-account-manager-uoa'), dbus.String('mysql-common'), dbus.String('nautilus-sendto-empathy'), dbus.String('nvidia-337'), dbus.String('nvidia-settings'), dbus.String('openjdk-7-jre'), dbus.String('openjdk-7-jre-headless'), dbus.String('openssl'), dbus.String('patch'), dbus.String('python-cupshelpers'), dbus.String('python-libxml2'), dbus.String('python-samba'), dbus.String('python3-software-properties'), dbus.String('python3-update-manager'), dbus.String('rhythmbox'), dbus.String('rhythmbox-data'), dbus.String('rhythmbox-mozilla'), dbus.String('rhythmbox-plugin-cdrecorder'), dbus.String('rhythmbox-plugin-magnatune'), dbus.String('rhythmbox-plugin-zeitgeist'), dbus.String('rhythmbox-plugins'), dbus.String('rsync'), dbus.String('samba-common'), dbus.String('samba-common-bin'), dbus.String('samba-libs'), dbus.String('smbclient'), dbus.String('software-center'), dbus.String('software-properties-common'), dbus.String('software-properties-gtk'), dbus.String('steam-launcher'), dbus.String('system-config-printer-common'), dbus.String('system-config-printer-gnome'), dbus.String('system-config-printer-udev'), dbus.String('systemd-services'), dbus.String('thunderbird'), dbus.String('thunderbird-gnome-support'), dbus.String('thunderbird-locale-en'), dbus.String('thunderbird-locale-en-gb'), dbus.String('thunderbird-locale-en-us'), dbus.String('thunderbird-locale-et'), dbus.String('tzdata'), dbus.String('tzdata-java'), dbus.String('udev'), dbus.String('unity'), dbus.String('unity-greeter'), dbus.String('unity-services'), dbus.String('update-manager'), dbus.String('update-manager-core'), dbus.String('vlc'), dbus.String('vlc-data'), dbus.String('vlc-nox'), dbus.String('vlc-plugin-notify'), dbus.String('vlc-plugin-pulse'), dbus.String('xserver-xorg-video-ati'), dbus.String('xserver-xorg-video-glamoregl'), dbus.String('xserver-xorg-video-intel'), dbus.String('xserver-xorg-video-nouveau'), dbus.String('xserver-xorg-video-radeon')], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')) May 20 13:05:46 kaspar-All-Series AptDaemon.Worker: INFO: Processing transaction /org/debian/apt/transaction/cc1925d70e1446e787796b1de148b4f5 May 20 13:06:17 kaspar-All-Series anacron[847]: Job `cron.weekly' terminated May 20 13:06:41 kaspar-All-Series AptDaemon.Trans: INFO: Cancelling transaction /org/debian/apt/transaction/cc1925d70e1446e787796b1de148b4f5 May 20 13:06:42 kaspar-All-Series AptDaemon.Worker: INFO: Finished transaction /org/debian/apt/transaction/cc1925d70e1446e787796b1de148b4f5 May 20 13:06:51 kaspar-All-Series NetworkManager[932]: &lt;info&gt; (wlan0): device state change: activated -&gt; unavailable (reason 'none') [100 20 0] May 20 13:06:51 kaspar-All-Series NetworkManager[932]: &lt;info&gt; (wlan0): deactivating device (reason 'none') [0] May 20 13:06:51 kaspar-All-Series NetworkManager[932]: &lt;info&gt; (wlan0): canceled DHCP transaction, DHCP client pid 1172 May 20 13:06:51 kaspar-All-Series avahi-daemon[733]: Withdrawing address record for fe80::a2f3:c1ff:fe1c:a4a8 on wlan0. May 20 13:06:51 kaspar-All-Series avahi-daemon[733]: Leaving mDNS multicast group on interface wlan0.IPv6 with address fe80::a2f3:c1ff:fe1c:a4a8. May 20 13:06:51 kaspar-All-Series avahi-daemon[733]: Interface wlan0.IPv6 no longer relevant for mDNS. May 20 13:06:51 kaspar-All-Series kernel: [ 691.260807] wlan0: deauthenticating from 00:0e:2e:6e:f4:ca by local choice (reason=3) May 20 13:06:50 kaspar-All-Series wpa_supplicant[1051]: message repeated 7 times: [ wlan0: CTRL-EVENT-SCAN-STARTED ] May 20 13:06:51 kaspar-All-Series wpa_supplicant[1051]: wlan0: CTRL-EVENT-DISCONNECTED bssid=00:0e:2e:6e:f4:ca reason=3 locally_generated=1 May 20 13:06:51 kaspar-All-Series avahi-daemon[733]: Withdrawing address record for 192.168.2.103 on wlan0. May 20 13:06:51 kaspar-All-Series avahi-daemon[733]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 192.168.2.103. May 20 13:06:51 kaspar-All-Series NetworkManager[932]: &lt;warn&gt; DNS: plugin dnsmasq update failed May 20 13:06:51 kaspar-All-Series NetworkManager[932]: &lt;info&gt; Removing DNS information from /sbin/resolvconf May 20 13:06:51 kaspar-All-Series dnsmasq[1490]: setting upstream servers from DBus May 20 13:06:51 kaspar-All-Series kernel: [ 691.274986] cfg80211: Calling CRDA to update world regulatory domain May 20 13:06:51 kaspar-All-Series avahi-daemon[733]: Interface wlan0.IPv4 no longer relevant for mDNS. May 20 13:06:51 kaspar-All-Series whoopsie[1041]: offline May 20 13:06:51 kaspar-All-Series kernel: [ 691.280262] cfg80211: World regulatory domain updated: May 20 13:06:51 kaspar-All-Series kernel: [ 691.280266] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) May 20 13:06:51 kaspar-All-Series kernel: [ 691.280268] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) May 20 13:06:51 kaspar-All-Series kernel: [ 691.280270] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) May 20 13:06:51 kaspar-All-Series kernel: [ 691.280272] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm) May 20 13:06:51 kaspar-All-Series kernel: [ 691.280273] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) May 20 13:06:51 kaspar-All-Series kernel: [ 691.280275] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) May 20 13:06:51 kaspar-All-Series NetworkManager[932]: &lt;info&gt; NetworkManager state is now DISCONNECTED May 20 13:06:51 kaspar-All-Series NetworkManager[932]: &lt;info&gt; (wlan0): taking down device. May 20 13:06:51 kaspar-All-Series dbus[618]: [system] Activating service name='org.freedesktop.nm_dispatcher' (using servicehelper) May 20 13:06:51 kaspar-All-Series dbus[618]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher' May 20 13:06:51 kaspar-All-Series NetworkManager[932]: &lt;info&gt; WiFi hardware radio set disabled May 20 13:06:51 kaspar-All-Series NetworkManager[932]: &lt;info&gt; WiFi now disabled by radio killswitch May 20 13:06:52 kaspar-All-Series NetworkManager[932]: &lt;info&gt; (wlan0): bringing up device. May 20 13:06:52 kaspar-All-Series NetworkManager[932]: &lt;info&gt; WiFi hardware radio set enabled May 20 13:06:52 kaspar-All-Series NetworkManager[932]: &lt;info&gt; WiFi now enabled by radio killswitch May 20 13:06:52 kaspar-All-Series NetworkManager[932]: &lt;info&gt; (wlan0): bringing up device. May 20 13:06:52 kaspar-All-Series kernel: [ 692.773533] rtl8192cu: MAC auto ON okay! May 20 13:06:52 kaspar-All-Series kernel: [ 692.784108] rtl8192cu: Tx queue select: 0x05 May 20 13:06:53 kaspar-All-Series kernel: [ 693.140284] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready May 20 13:06:53 kaspar-All-Series NetworkManager[932]: &lt;info&gt; (wlan0) supports 4 scan SSIDs May 20 13:06:53 kaspar-All-Series NetworkManager[932]: &lt;info&gt; (wlan0): supplicant interface state: starting -&gt; ready May 20 13:06:53 kaspar-All-Series NetworkManager[932]: &lt;info&gt; (wlan0): device state change: unavailable -&gt; disconnected (reason 'supplicant-available') [20 30 42] May 20 13:06:53 kaspar-All-Series NetworkManager[932]: &lt;warn&gt; Trying to remove a non-existant call id. May 20 13:06:53 kaspar-All-Series wpa_supplicant[1051]: wlan0: CTRL-EVENT-SCAN-STARTED May 20 13:06:53 kaspar-All-Series NetworkManager[932]: &lt;info&gt; (wlan0): supplicant interface state: ready -&gt; disconnected May 20 13:06:53 kaspar-All-Series NetworkManager[932]: &lt;info&gt; (wlan0) supports 4 scan SSIDs May 20 13:06:53 kaspar-All-Series NetworkManager[932]: &lt;info&gt; Auto-activating connection 'Seened'. </code></pre>
0non-cybersec
Stackexchange
I'm [26/M] my Girlfriend [20/F] of a nearly 4 year relationship makes everything a personal attack even when its nothing to do with her. Forces me to apologize or she starts threating to kill her self.. Edit: She is 22! Not 20. Don't know how I botched that. I've been with her for nearly 4 years now and this is a new thing. A year ago I would have said this wasn't the case. I was talking about politics, and regardless of your politicking, I was arguing for a meritocracy. Showing/Demonstrating the differences between a real meritocracy and the society we live in.(In this case I'm citing actual studies and referencing books, and experts in their field. Its not something I have a degree in, but it is a subject of huge interest to me as is all of philosophy.) Here is what she takes from the argument I made about greater society: A. Free will doesn't exist. B. God doesn't exist. (These are common themes anytime we talk about anything. Shes religious and I'm not, it should be noted I'm not an atheist. Somehow she makes everything out to be about that.) This last time I was blamed for the following things despite not having done them: C. I have accused her of being lucky and not hard working. (You can be both you know.) D. I have accused her family of being stupid or implied she thinks her family is stupid. A few more facts: E. She has had statistics and knows that they can't be correlated to individual cases. F. She will, if insulted by something I think, make the argument personal. "What about me? What about my case? I'm no exception to the statistics but I beat them." (Something she actually said once.) Universally she takes something I say as a personal attack that objectively isn't. This example being the following: "Good point, and your Father isn't a stupid man." Her screaming "***I DIDN'T FUCKING SAY HE WAS STUPID***" I looked her dead in the face and said "Did I say that?" "YES YOU FUCKING DID DON'T DENY IT!" I didn't. I didn't even imply it in context. (Context being that her Dad is a hard worker. Me saying "Yeah good point, and hes not stupid either.") This time led to her being in tears and I really don't know what to say or do about it. About half way through any given argument if anything I say even mildly is something she disagrees with she will give this openly disgruntled look, and assume I'm insulting her. Its like she can't abstract that I can agree with her even if for differing reasons. Letter C comes directly from the fact that Intelligence (and having intelligence) is purely luck based. And spoiler: It fucking is. Oh well. I have seen her melt down over this fact twice now. Going so far as to call me stupid and a piece of shit (in lightly veiled terms) to try and piss me off. When I take the bait she then lies about trying to insult me, and makes her self to be the victim "You said this and this and this about my dad, and me." Mostly putting words in my mouth. By the end of it if I'm not saying that shes the victim and its totally my fault, and I did everything wrong under the sun she begins screaming about how she should just kill herself when I pointed out that everything she is claiming I said is very clearly not something I actually said, and at best something she took as implied from it. "Well if I just mistook you I should just go fucking kill myself." I looked at her stunned like "What? Over this?" "I didn't do anything wrong and I should just end it because you hate me!" Here is the kicker: I'm not even yelling during most of this. I only yell when she directly insults me. The thing is a year ago she woudn't have acted like this. Slowly shes becoming someone I can't talk to, and when I say that she screams something like "NO ITS ME WHO CAN'T TALK TO YOU!" Something that I think is of importance is her belief in god: Shes not a YEC, shes not ultra religious herself, but anything that could even be potentially 'questioning' of god (And these are all like traps I don't see coming considering she went to a religious school that basically lied to her about a lot of shit.) causes her to immediately break down and freak out over religion and starts an instant screaming match, mostly against her and science than myself. I don't honestly think she can be a scientist in her field (biology/health) and maintain her stances on religion as they are so counter to the field: Evolution doesn't exist, Free will is real, God heals people, ect. Seriously prior to her getting through her medical program and having time to stop and think about these things has really fucked with her personality. She now goes on tangents about how people need to 'just accept god is real and evolution is false.' Despite knowing the evidence herself of evolutions existence. When I argue for it (As I know evolution exists) she freaks out on that too. I love her but I just don't know what to fucking think. Its like in the last 6-8 months shes become a different person.
0non-cybersec
Reddit
The Beatles hit Spotify.
0non-cybersec
Reddit
I think there should be a way to tell, from a distance, when people are at a raid.. Like how gyms spark and stuff when they're being attacked. Just a shower thought. Edit: Where're the Devs at? Let's get this ball rolling! :)
0non-cybersec
Reddit
Is .NET 4.0 Compatible with Windows XP SP2 or below?. <p>I have read here <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5765d7a8-7722-4888-a970-ac39b33fd8ab" rel="noreferrer">http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5765d7a8-7722-4888-a970-ac39b33fd8ab</a> that to instal .NET 4.0 CP (client profile) you must have WinXP SP3 or above. This is somewhat worrying to me as there are many people on SP2 or below.</p> <p>Is there any way I can run a .NET 4.0 app on any version of Windows xp and above? (without worrying about which service packs they have)?</p> <p>If not, what about .NET 3.5, 3.0 or 2.0?</p> <p>My questions are the following:</p> <ol> <li><p>How low do I need to go in my .NET Framework version choice to ensure compatibility for WinXP SP2 or above?</p></li> <li><p>How low do I need to go in my .NET Framework version choice to ensure compatibility for WinXP (no service packs) or above? </p></li> </ol>
0non-cybersec
Stackexchange
DIY Masterbath revamp for cheap.
0non-cybersec
Reddit
If there are an infinite number of alternate realities I wonder how many alternate versions of me are in the shower thinking about how many of us are thinking about alternate realities while taking a shower..
0non-cybersec
Reddit
how to prove $\left(\frac{n}{3}\right)^n\leq\frac{1}{3}n!$. <p>i am asked to prove this statement:</p> <blockquote> <p>$$\left(\frac{n}{3}\right)^n\leq\frac{1}{3}n!$$ </p> </blockquote> <p>Now after several attempts, i am lost not knowing where and how to start. if I use induction, i am stuck on the way. how can i solve this in an easy way? i have huge difficulties when i have to find something which is bigger than the latter term or so, because i lack some important source of maths in my brain. i am very likely to give up on the way if it becomes tough. for any guidance how to overcome this phase i will be very very thankful. i am trying for proficiency in math. Thanks</p>
0non-cybersec
Stackexchange
feeling unmotivated. F18, 5’3, SW:137.6, CW: 124.1, GW: 110 hiya, so I’ve been on my weight loss journey for 3 months now and for whatever reason this week I’ve been feeling super unmotivated to do well. Maybe it’s bc I’m not losing the weight as quickly as I thought? I’m not too sure For the past few days I’ve just had the most intense urges to eat and snack on all the the food in my pantry. I used to consume 1000 calories everyday for about 2 months before I realized how little this actually was. I’m now slowly trying to eat up to 1400 calories, increasing my calories by 100 each week. Right now, I am eating 1300. Not only do I have issues with the that urge, I also just feel super duper lazy. I’ve started going on walks and bike rides last week to add to my current routine of 1 hr on the stationary bike. Everything just feels sooooo slow and that it’s never going to happen. I could use some motivation right about now :/
0non-cybersec
Reddit
how to get orthogonal rank 1 approximations?. <p>The situation: I have $k$ matrices $A_i$, which are all real and of size $m\times n$. Now I would like to find the matrices $\tilde{A}_i$ of $A_i$ so that</p> <p>1) $\tilde{A}_i$ is of rank 1 (thus a rank 1 approximation of $A_i$)</p> <p>2) trace zero orthogonal to all matrices $\tilde{A}_j$ with $ i &gt; j$, thus $\operatorname{Tr} \bigl( \tilde{A}_i \tilde{A}_j^\top \bigr) = 0$</p> <p>For $k=2$ this is not a problem, but does anybody have an idea how to proceed when e.g. $k=8$? Thanks in advance for each help.</p>
0non-cybersec
Stackexchange
Powershell Append text to object description in Active Directory. <p>How can I append or prepend the description in AD I want to leave the current description and put some text infront of it</p> <p>for example a computer has the description as "Accounting Dept" (without quotes)</p> <p>I tried this:</p> <pre><code>set-QADComputer -Identity computername -Description {Disabled 8/17/2012, Termrpt "$($_.description)"} </code></pre> <p>I get this for the description</p> <blockquote> <p>Disabled 8/17/2012, "$($_.description)"</p> </blockquote> <p>but I want the orginal description prepended by the text like the following</p> <blockquote> <p>Disabled 8/17/2012, Accounting dept</p> </blockquote> <p>any ideas?</p> <p>I tried parentheses instead but then it just puts the prepended text and wipes out the original altogether. </p>
0non-cybersec
Stackexchange
A seventh ceiling lamp was added for no reason..
0non-cybersec
Reddit
kNN with big sparse matrices in Python. <p>I have two large sparse matrices:</p> <pre><code>In [3]: trainX Out[3]: &lt;6034195x755258 sparse matrix of type '&lt;type 'numpy.float64'&gt;' with 286674296 stored elements in Compressed Sparse Row format&gt; In [4]: testX Out[4]: &lt;2013337x755258 sparse matrix of type '&lt;type 'numpy.float64'&gt;' with 95423596 stored elements in Compressed Sparse Row format&gt; </code></pre> <p>About 5 GB RAM in total to load. Note these matrices are HIGHLY sparse (0.0062% occupied).</p> <p>For each row in <code>testX</code>, I want to find <strong><em>the</em></strong> Nearest Neighbor in <code>trainX</code> and return its corresponding label, found in <code>trainY</code>. <code>trainY</code> is a list with the same length as <code>trainX</code> and has many many classes. (A class is made up of 1-5 separate labels, each label is one of 20,000, but the number of classes is not relevant to what I am trying to do right now.)</p> <p>I am using <code>sklearn</code>'s KNN algorithm to do this:</p> <pre><code>from sklearn import neighbors clf = neighbors.KNeighborsClassifier(n_neighbors=1) clf.fit(trainX, trainY) clf.predict(testX[0]) </code></pre> <p>Even predicting for 1 item of <code>testX</code> takes a while (i.e. something like 30-60 secs, but if you multiply by 2 million, it becomes pretty much impossible). My laptop with 16GB of RAM starts to swap a bit, but does manage to complete for 1 item in <code>testX</code>.</p> <p>My questions is, how can I do this so it will finish in reasonable time? Say one night on a large EC2 instance? Would just having more RAM and preventing the swapping speed it up enough (my guess is no). Maybe I can somehow make use of the sparsity to speed up the calculation?</p> <p>Thank you.</p>
0non-cybersec
Stackexchange
How to use AVAudioSessionCategoryMultiRoute with a bluetooth device?. <p>I'm developing an app that plays and records, I wonder if it is possible to use a <code>Bluetooth</code> device with the <code>AVAudioSessionCategoryMultiRoute</code>, and if the answer is Yes, How to record from two devices like the iPhone built-in microphone and a <code>Bluetooth</code> microphone? because I couldn't find any tutorial or example to do this.</p>
0non-cybersec
Stackexchange
MRW the smart guy in my class said "shit" when he looked at our test..
0non-cybersec
Reddit
Lock OSX with keyboard. <p>OSX machines have a keyboard shortcut to put the machine to sleep, which suspends processing, downloads, and other operations.</p> <p>OSX machines also have a Lock function which can be triggered via a menu option. It can also be triggered by running a specific command: <code>/System/Library/CoreServices/"Menu Extras"/User.menu/Contents/Resources/CGSession -suspend</code></p> <p>How can I lock my OSX machine with a keyboard shortcut?</p>
0non-cybersec
Stackexchange
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
Modifying a non managed table partition. <p>I ran across a partition that was initially setup (sql 2012) beginning of 2014 to break by month but wasn't updated for 2015. The main issue is that the last partition was setup as Jan 2015 so Feb data is loading into it and I'd like to add future months to the partition and break out the Feb data out of the Jan 2015 partition. My first thought was to load the data to another table and truncate the existing table then drop and recreate the partition as necessary but the table has over a billion records so storage and time are a consideration. What other options would have I have separate the Feb data from the Jan 2015 partition as well as add future months with the least impact to the system?</p> <p>Here's the existing partitioning function being used.</p> <pre><code>CREATE PARTITION FUNCTION [YearMonthPartFunction](date) AS RANGE RIGHT FOR VALUES (N'2014-01-01T00:00:00.000', N'2014-02-01T00:00:00.000', N'2014-03-01T00:00:00.000', N'2014-04-01T00:00:00.000', N'2014-05-01T00:00:00.000', N'2014-06-01T00:00:00.000', N'2014-07-01T00:00:00.000', N'2014-08-01T00:00:00.000', N'2014-09-01T00:00:00.000', N'2014-10-01T00:00:00.000', N'2014-11-01T00:00:00.000', N'2014-12-01T00:00:00.000', N'2015-01-01T00:00:00.000') </code></pre>
0non-cybersec
Stackexchange
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
How to search HTML documentation generated by javadoc?. <p>I'm a Java beginner and I see a lot of documentation for Java APIs in similar HTML format, e.g. <a href="http://docs.oracle.com/javase/8/docs/api/index.html" rel="noreferrer">Java™ Platform, Standard Edition 8 API Specification</a>. I don't see a search option in any of these documents, so when I need to find for example <code>random()</code>, I go to <strong>index</strong>, select <strong>R</strong> and use browser to search for <strong>random</strong>. Is there a faster way, e.g. global search?</p>
0non-cybersec
Stackexchange
ITAP of my reflection in a puddle in the rain..
0non-cybersec
Reddit
[NSV] Ate Keto at Korean Restaurant without BBQ. **The Great Glucose Test:** Korean food for Lunch My wife has Gestational Diabetes. She gets it every time she is pregnant. She is Pregnant with our #2 Child. Anyway, She was craving Korean food so we went for lunch. I tried to help guide her to something low carb, but she had cravings, so she got what she wanted. So we did a test 1 hour later with a glucometer to see how we did. **Wife:** Cold noodle and Bulgogi **Me:** Spicy Tofu soup with Ham, sausage, Cheese, and Eggs **1 Hour Later Glucose test:** * **Wife:** 220 * **Me:** 89 I was pretty shocked... Just wanted to share :)
0non-cybersec
Reddit