text
stringlengths
36
35k
label
class label
2 classes
source
stringclasses
3 values
tokens_length
int64
128
4.1k
text_length
int64
36
35k
How to delete a record using GQL?. <p>I need to iterate and delete all records of my datastore. I am using Google App engine Launcher to test it on local host. How to do it?</p> <p>When I am trying to delete all recors in Person model that way:</p> <pre><code> qObj = Person.all() db.delete(qObj) </code></pre> <p>I am getting error <code>BadValueError: Property y must be a str or unicode instance, not a long</code> I guess there is conflict in Model data types.</p> <pre><code>class Person(db.Model): name = db.StringProperty() x = db.StringProperty() y = db.StringProperty() group = db.StringProperty() </code></pre> <p>The field <code>y = db.StringProperty()</code> previously was <code>y = db.IntegerProperty()</code>. At this moment I need to flush all db records. How can I do that?</p> <p>Is there is an opportunity to delete local file which stores all db records?</p>
0non-cybersec
Stackexchange
280
902
How to show $7^{th}$ degree polynomial is non-positive in $[0,1]$. <blockquote> <p>Let <span class="math-container">$0\le x\le 1$</span>, show that inequality <span class="math-container">$$99x^7-381x^6+225x^5-415x^4+157x^3-3x^2-x-1\le 0$$</span></p> </blockquote> <p>This problem comes from the fact that I solved a different inequality.I tried to solve it by factorizing it to see if I could get symbols.but I failed.</p> <p>this inequality is hold by <a href="https://www.wolframalpha.com/input/?i=99x%5E7-381x%5E6%2B225x%5E5-415x%5E4%2B157x%5E3-3x%5E2-x-1" rel="nofollow noreferrer">wolfapha</a> Test it.</p>
0non-cybersec
Stackexchange
258
620
linux server constantly kicking me out. <p>I have a linux server that has started acting a little funny...</p> <p>First of all the box is way under utilized. It's a database server, with a very low load. I'll put vmstat below and top...</p> <ol> <li>I'm running centos 5.4</li> <li>This server has been running fine for weeks</li> <li>It's firewalled, it's unlikely it's been hacked (chkrootkit agrees).</li> <li>Load is really low.</li> <li>I'm on a Gigabit switch with the server.</li> <li>I'm not having this problem with any other server.</li> <li>I have remote syslog set up on another box and it's not indicating any corresponding errors.</li> </ol> <p>So, when I ssh(putty) to the box, if I haven't gotten on it in a while, putty immediatly throws a 'network connection reset' error.</p> <p>Randomly it just kicks me out (or network drops)</p> <p>a steady stream of pings shows now interruption.</p> <pre><code>--- vdbsrv1 ping statistics --- 80620 packets transmitted, 80619 received, 0% packet loss, time 23838ms rtt min/avg/max/mdev = 0.234/0.273/1.741/0.043 ms, ipg/ewma 0.295/0.297 ms </code></pre> <p>SQL queries ("Select 1") to the box take about 5 seconds, even though SQL is reporting something like a .04 second execution time, so the other 4.96 seconds is a mystery </p> <p>Anyone have any ideas?</p> <pre><code>top - 11:49:28 up 12 days, 17:05, 4 users, load average: 0.00, 0.03, 0.01 Tasks: 150 total, 1 running, 149 sleeping, 0 stopped, 0 zombie Cpu(s): 0.2%us, 0.0%sy, 0.0%ni, 99.3%id, 0.5%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 8174028k total, 8074924k used, 99104k free, 4558300k buffers Swap: 19464184k total, 4k used, 19464180k free, 2306952k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1 root 15 0 10348 692 576 S 0.0 0.0 0:02.13 init root@dbsrv1# vmstat procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------ r b swpd free buff cache si so bi bo in cs us sy id wa st 0 0 4 98980 4558300 2306992 0 0 1 13 3 2 0 0 99 0 0 </code></pre>
0non-cybersec
Stackexchange
766
2,127
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Flutter - Fix Drawer Header. <p>Following this link <a href="https://flutter.io/docs/cookbook/design/drawer" rel="noreferrer">Add a Drawer to a screen</a> I have created a drawer. </p> <p>Following is my piece of code:</p> <pre><code>// FUNCTION CONTAINING LEFT SIDE MENU ITEMS _drawerList() { return Drawer( child: ListView( padding: EdgeInsets.zero, children: &lt;Widget&gt;[ DrawerHeader( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: &lt;Widget&gt;[ Text( 'John Doe', ), ], ), decoration: BoxDecoration( image: DecorationImage( image: AssetImage('assets/images/menu_bg.png'), fit: BoxFit.cover, ), ), ), ListTile( // Some Code ), ], ), ); } @override Widget build(BuildContext context) { return Scaffold( // Some Code drawer: Drawer( child: _drawerList(), ), // Some Code } } </code></pre> <p>Is there any way I can fix "DrawerHeader" so that it doesn't move with the drawer and list view.</p> <p>P.S. I don't want to hold ListView. I just want to hold or fix "DrawerHeader".</p>
0non-cybersec
Stackexchange
400
1,366
Foods that will harm your dog.. Earlier this evening I read a post about a dog that passed away due to consuming onions. After reading a lot of comments with people seeming unsure of what foods could harm their animals and posting info that was not validated even to them I wanted to contribute a real list of foods that will harm your dog if consumed. Some not immediately(such as grapes or onions). * Toxic foods for your dog: * Alcoholic beverages * Apple seeds * Apricot pits * Avocados * Cherry pits * Candy (particularly chocolate—which is toxic to dogs, cats, and ferrets—and any candy containing the toxic sweetener Xylitol) * Coffee (grounds, beans, and chocolate-covered espresso beans) * Garlic * Grapes * Gum (can cause blockages and sugar free gums may contain the toxic sweetener Xylitol) * Hops (used in home beer brewing) * Macadamia nuts * Moldy foods * Mushroom plants * Mustard seeds * Onions and onion powder * Peach pits * Potato leaves and stems (green parts) * Raisins * Rhubarb leaves * Salt * Tea (because it contains caffeine) * Tomato leaves and stems (green parts) * Walnuts * Xylitol (artificial sweetener that is toxic to pets) * Yeast dough A couple other foods to consider that are not toxic but ARE harmful are large quantities of fat and cooked bones. Large amounts of fat(like a few spare ribs is all) can cause pancreatic failure. It's a huge issue for dogs come BBQ time. Cooked bones are brittle and splinter. This can cause lacerations or blockages in their intestines. Be a responsible pet owner and know your animal and what is best for their well being! It is your only obligation to them(their well being). Take that to heart when taking them into your home. You owe them that.
0non-cybersec
Reddit
460
1,743
AttributeError: &#39;SequenceGenerator&#39; object has no attribute &#39;shape&#39; Custom Sequence Generator Keras 2.2.4. <p>I am trying to use <code>fit_generator</code> with a custom <code>train_sequence_generator</code> and custom <code>test_sequence_generator</code> I got the error below. please advise where shall I change my code.</p> <p><strong>1. The Custom Sequence class:</strong> </p> <pre><code>import os import numpy as np from keras.utils import Sequence from batchGenerator import BatchGenerator from settings import batch_size, train_folder, test_folder class SequenceGenerator(Sequence): def __init__(self, batches_folder): self.batch_generator = BatchGenerator(folder_name=batches_folder) self.names = [f for f in os.listdir(batches_folder) if f.lower().endswith('.jpg')] def __len__(self): return int(np.ceil(len(self.names) / float(batch_size))) def __getitem__(self, idx): print('Getting a bacth{0}'.format(idx)) [X_batch, Y_batch] = self.batch_generator.load_batch_from_disk(idx) return X_batch, Y_batch def train_seq_genenrator(): return SequenceGenerator(train_folder) def test_seq_generator(): return SequenceGenerator(test_folder) </code></pre> <p><strong>2. Fit_generator in CoLab</strong></p> <pre><code>from sequenceGenerator import train_seq_genenrator, test_seq_generator history = new_model.fit_generator(train_seq_genenrator() , steps_per_epoch=num_train_samples // batch_size , validation_data=test_seq_generator() , validation_steps=num_test_samples // batch_size , epochs=epochs , shuffle=False) </code></pre> <h2><strong>3. Error</strong></h2> <pre><code>----------------- AttributeError Traceback (most recent call last) &lt;ipython-input-22-ad1d08859faf&gt; in &lt;module&gt;() 4 , validation_steps=num_test_samples // batch_size 5 , epochs=epochs ----&gt; 6 , shuffle=False) /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py in fit_generator(self, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch) 1424 use_multiprocessing=use_multiprocessing, 1425 shuffle=shuffle, -&gt; 1426 initial_epoch=initial_epoch) 1427 1428 def evaluate_generator(self, /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training_generator.py in model_iteration(model, data, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch, mode, batch_size, **kwargs) 113 batch_size=batch_size, 114 epochs=epochs - initial_epoch, --&gt; 115 shuffle=shuffle) 116 117 do_validation = validation_data is not None /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training_generator.py in convert_to_generator_like(data, batch_size, steps_per_epoch, epochs, shuffle) 375 376 # Create generator from NumPy or EagerTensor Input. --&gt; 377 num_samples = int(nest.flatten(data)[0].shape[0]) 378 if batch_size is None: 379 raise ValueError('You must specify `batch_size`') AttributeError: 'SequenceGenerator' object has no attribute 'shape' </code></pre>
0non-cybersec
Stackexchange
1,088
3,613
Factoring polynomials modulus p. <p>Mathematica can factor easily polynomials over $\mathbb{Z}/p\mathbb{Z}$ (p prime), but I'm having a hard time trying to factor the polynomial over $\mathbb{Z}/m\mathbb{Z}$ where m is a composite number. Is there any easy way to use its factorization modulus p to obtain its factorization over m?</p> <p>Thanks.</p> <p>For example, $1+x+x^2+x^4$ is $(x^2+7x+10)(x^2+12x+2)$ over $\mathbb{Z}/19\mathbb{Z}$</p> <p>How can I factor it over $\mathbb{Z}/779\mathbb{Z}$?</p>
0non-cybersec
Stackexchange
178
507
Asset Catalog Compiler Error. <p>I'm not sure what I did to get this error in Xcode 5: </p> <p>"None of the input catalogs contained a matching app icon set named "AppIcon"".</p> <p>My app was building fine - then my machine locked up tighter than the arctic - don't know why - and now I get this error.</p> <p>(There was an existing answer to this same question - but I couldn't quite understand it. Sorry)</p> <p>Thanks for any help.</p>
0non-cybersec
Stackexchange
134
446
Only print every other enum value in for loop. <p>I'm trying to make it so only every other colour is being printed off in my for loop statement but because of the type difference I'm unable to incorporate it in an <code>if</code> statement.</p> <pre><code>public enum Example{Red, Blue, Green, Yellow, Orange, Purple, Brown} public class Test { public static void main(String[] args) { for (Example colour: Example.values()) { if (????) { System.out.println(colour); } } } } </code></pre> <p>Desired output:</p> <pre><code>Red Green Orange Brown </code></pre>
0non-cybersec
Stackexchange
178
629
How does the Mean Value Theorem translate to higher dimensions?. <p>For <span class="math-container">$f:\mathbb{R}^2 \rightarrow \mathbb{R}$</span> such that for all <span class="math-container">$(x,y) \in (\mathbb{R}^2)^2$</span> we have:</p> <p><span class="math-container">$|f(x)-f(y)| \leq ||x-y||^2$</span></p> <p>I'm trying to prove that <span class="math-container">$f$</span> has to be a constant function. My instinct would be to divide one of the <span class="math-container">$|x-y|$</span>'s to the other side and use the mean value theorem to argue that the derivative has to be zero at every point. However, I'm unclear on whether the mean value theorem would work here, since <span class="math-container">$f$</span> is a function from <span class="math-container">$\mathbb{R}^2$</span>. Would it still work as normal, or do I need to change my approach?</p>
0non-cybersec
Stackexchange
273
877
Object Has been collected cannot evaluate ContentValues.values.tostring(). <p>Can anyone tell me what this is about. Im getting this error when i am adding data in database. its Happening only for a particular row. I tried finding answer or reason over the internet. but in vain. The screenshot <a href="https://i.stack.imgur.com/oIKof.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/oIKof.jpg" alt="Screenshot while debugging"></a></p> <pre><code>public void FunSetVisitorDetails(String strResult) { Log.d(TAG, "Get Visitor Details started."); if (!strResult.equalsIgnoreCase("NA") &amp;&amp; !strResult.equalsIgnoreCase("NI")) { SQLiteDatabase database = getWritableDatabase(); database.delete("TBL_VISITOR_MASTER", null, null); String[] strResultData = strResult.split("#"); for (int index = 0; index &lt; strResultData.length; index++) { String[] strRowData = strResultData[index].split(","); ContentValues values = new ContentValues(); values.put("VISITORID", strRowData[0]); values.put("MEMBERID", strRowData[1]); values.put("TEAMID", strRowData[2]); values.put("CATEGORY", strRowData[3]); values.put("NAME", strRowData[4]); values.put("COMPNAME", strRowData[5]); values.put("SPECIALIZED1", strRowData[6]); values.put("SPECIALIZED2", strRowData[7]); values.put("SPECIALIZED3", strRowData[8]); values.put("SPECIALIZED4", strRowData[9]); values.put("SPECIALIZED5", strRowData[10]); values.put("CLIENT1", strRowData[11]); values.put("CLIENT2", strRowData[12]); values.put("CLIENT3", strRowData[13]); values.put("CLIENT4", strRowData[14]); values.put("CLIENT5", strRowData[15]); values.put("ASK", strRowData[16]); values.put("GIVE", strRowData[17]); values.put("TAGLINE", strRowData[18]); values.put("EMAIL", strRowData[19]); values.put("MOBILE", strRowData[20]); values.put("WEBSITE", strRowData[21]); values.put("LOCATION", strRowData[22]); try{ values.put("COMP_LOGO", strRowData[23]);// it is happening when adding the logo and image below. there is no exception thrown as well. values.put("PERSON_IMAGE", strRowData[24]); } catch (Exception e){ e.printStackTrace(); } database.insert("TBL_VISITOR_MASTER", null, values); } </code></pre>
0non-cybersec
Stackexchange
759
2,741
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
JavaScript sleep/wait before continuing. <p>I have a JavaScript code that I need to add a sleep/wait function to. The code I am running is already in a function, eg:</p> <pre><code>function myFunction(time) { alert('time starts now'); //code to make the program wait before continuing alert('time is up') } </code></pre> <p>I have heard that a possible solution might include</p> <pre><code>setTimeout </code></pre> <p>but I am not sure how to use it in this case.</p> <p>I can't use PHP, as my server does not support it, although using jQuery would be fine.</p>
0non-cybersec
Stackexchange
175
581
Save complex object to session ASP .NET CORE 2.0. <p>I am quite new to ASP .NET core, so please help. I would like to avoid database round trip for ASP .NET core application. I have functionality to dynamically add columns in datagrid. Columns settings (visibility, enable, width, caption) are stored in DB.</p> <p>So I would like to store <strong>List&lt;,PersonColumns></strong> <strong>on server</strong> only for actual session. But I am not able to do this. I already use JsonConvert methods to serialize and deserialize objects to/from session. This works for <strong>List&lt;,Int32></strong> or objects with simple properties, but not for complex object with nested properties. </p> <p>My object I want to store to session looks like this:</p> <pre><code>[Serializable] public class PersonColumns { public Int64 PersonId { get; set; } List&lt;ViewPersonColumns&gt; PersonCols { get; set; } public PersonColumns(Int64 personId) { this.PersonId = personId; } public void LoadPersonColumns(dbContext dbContext) { LoadPersonColumns(dbContext, null); } public void LoadPersonColumns(dbContext dbContext, string code) { PersonCols = ViewPersonColumns.GetPersonColumns(dbContext, code, PersonId); } public static List&lt;ViewPersonColumns&gt; GetFormViewColumns(SatisDbContext dbContext, string code, Int64 formId, string viewName, Int64 personId) { var columns = ViewPersonColumns.GetPersonColumns(dbContext, code, personId); return columns.Where(p =&gt; p.FormId == formId &amp;&amp; p.ObjectName == viewName).ToList(); } } </code></pre> <p>I would like to ask also if my approach is not bad to save the list of 600 records to session? Is it better to access DB and load columns each time user wants to display the grid? </p> <p>Any advice appreciated</p> <p>Thanks </p> <p><strong>EDIT</strong>: I have tested to store in session <strong>List&lt;,ViewPersonColumns></strong> and it is correctly saved. When I save object where the <strong>List&lt;,ViewPersonColumns></strong> is property, then only <strong>built-in types</strong> are saved, List property is null.</p> <p><strong>The object I want to save in session</strong></p> <pre><code>[Serializable] public class UserManagement { public String PersonUserName { get; set; } public Int64 PersonId { get; set; } public List&lt;ViewPersonColumns&gt; PersonColumns { get; set; } //not saved to session?? public UserManagement() { } public UserManagement(DbContext dbContext, string userName) { var person = dbContext.Person.Single(p =&gt; p.UserName == userName); PersonUserName = person.UserName; PersonId = person.Id; } /*public void PrepareUserData(DbContext dbContext) { LoadPersonColumns(dbContext); }*/ public void LoadPersonColumns(DbContext dbContext) { LoadPersonColumns(dbContext, null); } public void LoadPersonColumns(DbContext dbContext, string code) { PersonColumns = ViewPersonColumns.GetPersonColumns(dbContext, code, PersonId); } public List&lt;ViewPersonColumns&gt; GetFormViewColumns(Int64 formId, string viewName) { if (PersonColumns == null) return null; return PersonColumns.Where(p =&gt; p.FormId == formId &amp;&amp; p.ObjectName == viewName).ToList(); } } </code></pre> <p><strong>Save columns to the session</strong></p> <pre><code>UserManagement userManagement = new UserManagement(_context, user.UserName); userManagement.LoadPersonColumns(_context); HttpContext.Session.SetObject("ActualPersonContext", userManagement); HttpContext.Session.SetObject("ActualPersonColumns", userManagement.PersonColumns); </code></pre> <p><strong>Load columns from the session</strong></p> <pre><code>//userManagement build-in types are set. The PersonColumns is null - not correct UserManagement userManagement = session.GetObject&lt;UserManagement&gt;("ActualPersonContext"); //The cols is filled from session with 600 records - correct List&lt;ViewPersonColumns&gt; cols = session.GetObject&lt;List&lt;ViewPersonColumns&gt;&gt;("ActualPersonColumns"); </code></pre>
0non-cybersec
Stackexchange
1,191
4,196
Every closed subset of $\mathbb R^n$ has a point that minimizes the distance to a given point $p\in\mathbb R^n$. <blockquote> <p>Let $p\in\mathbb R^n$ and $\|\cdot \|$ the Euclidian norm. Show that if $K\subset \mathbb R^n$ is a close set, then $$\exists a\in K: \forall x\in K, \|a-p\|\leq \|x-p\|.$$</p> </blockquote> <p>Since $\|x-p\|\geq 0$, there is a $m\geq 0$ such that $$m=\inf_{x\in K}\|x-p\|.$$</p> <p>Now, I have to show that there is a $a\in K$ such that $m=\|a-p\|$. My idea is to take a sequence $(x_n)_{n\in\mathbb N}\subset K$ such that $\lim_{n\to \infty }\|x_n-p\|=m$. My problem is to show that $(x_n)_{n\in\mathbb N}$ converge or that $(x_n)$ has a subsequence that converge.</p>
0non-cybersec
Stackexchange
271
704
What is the difference between exploitable security measures and security theater?. <p>As an example, the US no-fly list is commonly referred to as a security theater given that it is <a href="https://www.schneier.com/blog/archives/2008/09/my_la_times_op.html" rel="nofollow noreferrer">easy to work around</a>. However <a href="https://security.stackexchange.com/questions/207492/why-do-people-hide-their-license-plates-in-the-eu">blurring license plates when posting a picture online</a> is not considered a security theater, even though license plates are open for everyone to see when the car is driving. </p> <p>So where is the exact line between security measures that are merely exploitable and security measures that can be referred to as "security theater"?</p>
1cybersec
Stackexchange
206
772
Calling a free() wrapper: dereferencing type-punned pointer will break strict-aliasing rules. <p>I've tried to read up on the other questions here on SO with similar titles, but they are all a tiny bit too complex for me to be able to apply the solution (or even explanation) to my own issue, which seems to be of a simpler nature.</p> <p>In my case, I have a wrapper around <code>free()</code> which sets the pointer to <code>NULL</code> after freeing it:</p> <pre><code>void myfree(void **ptr) { free(*ptr); *ptr = NULL; } </code></pre> <p>In the project I'm working on, it is called like this:</p> <pre><code>myfree((void **)&amp;a); </code></pre> <p>This makes <code>gcc</code> (4.2.1 on OpenBSD) emit the warning "dereferencing type-punned pointer will break strict-aliasing rules" if I crank up the optimization level to <code>-O3</code> and add <code>-Wall</code> (not otherwise).</p> <p>Calling <code>myfree()</code> the following way does not make the compiler emit that warning:</p> <pre><code>myfree((void *)&amp;a); </code></pre> <p>And so I wonder if we ought to change the way we call <code>myfree()</code> to this instead.</p> <p>I believe that I'm invoking undefined behaviour with the first way of calling <code>myfree()</code>, but I haven't been able to wrap my head around why. Also, on all compilers that I have access to (<code>clang</code> and <code>gcc</code>), on all systems (OpenBSD, Mac OS X and Linux), this is the only compiler and system that actually gives me that warning (and I know emitting warnings is a nice optional).</p> <p>Printing the value of the pointer before, inside and after the call to <code>myfree()</code>, with both ways of calling it, gives me identical results (but that may not mean anything if it's undefined behaviour):</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; void myfree(void **ptr) { printf("(in myfree) ptr = %p\n", *ptr); free(*ptr); *ptr = NULL; } int main(void) { int *a, *b; a = malloc(100 * sizeof *a); b = malloc(100 * sizeof *b); printf("(before myfree) a = %p\n", (void *)a); printf("(before myfree) b = %p\n", (void *)b); myfree((void **)&amp;a); /* line 21 */ myfree((void *)&amp;b); printf("(after myfree) a = %p\n", (void *)a); printf("(after myfree) b = %p\n", (void *)b); return EXIT_SUCCESS; } </code></pre> <p>Compiling and running it:</p> <pre><code>$ cc -O3 -Wall free-test.c free-test.c: In function 'main': free-test.c:21: warning: dereferencing type-punned pointer will break strict-aliasing rules $ ./a.out (before myfree) a = 0x15f8fcf1d600 (before myfree) b = 0x15f876b27200 (in myfree) ptr = 0x15f8fcf1d600 (in myfree) ptr = 0x15f876b27200 (after myfree) a = 0x0 (after myfree) b = 0x0 </code></pre> <p>I'd like to understand what is wrong with the first call to <code>myfree()</code> and I'd like to know if the second call is correct. Thanks.</p>
0non-cybersec
Stackexchange
989
2,942
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
intersymbol interference (ISI), channels, and frequencies. <p>When describing 802.11b/g and the <a href="http://en.wikipedia.org/wiki/IEEE_802.11b#Channels_and_Frequencies" rel="nofollow">2.4 GHz channel</a>s, or 802.11a/n with <a href="http://www.ni.com/white-paper/3740/en" rel="nofollow">5 GHz channels</a>, textbooks (<a href="https://play.google.com/store/books/details/David_D_Coleman_CWNA_Certified_Wireless_Network_Ad?id=T4bXd18QlEYC&amp;feature=nav_result#" rel="nofollow">CWNA Official Study Guide</a>) often show some figure with channels spaced such that certain channels cannot overlap and therefore <a href="http://en.wikipedia.org/wiki/Intersymbol_interference" rel="nofollow">ISI</a> is avoided. The explanation is that <a href="http://en.wikipedia.org/wiki/Intersymbol_interference" rel="nofollow">ISI</a> occurs in cases of multipath, where the signals of the same frequency interfere. This does make sense to me, i.e. that signals of the same frequency can interfere, and so non-overlapping channels would avoid ISI. </p> <p>My understanding is that the 802.11 design assigns 1 signal per constant width of "frequency space" in a channel, for example</p> <ul> <li>1 signal per 2 MHz in a DSSS channel</li> <li>1 signal per subcarrier in OFDM channel</li> </ul> <p>If we look at the figures in the URLs, the spacing of the channels and frequencies show a sequential order by Hz. What's not clear to me, is whether the same exact sequence must also hold for the <em>timing</em> of each signal's arrival. For example, consider 2.4 GHz channel 1: does the 2.410 GHz signal always arrive at the receiver before the 2.414 GHz signal? After the first 1 cycle, I would guess that the signals within a single channel arrive in order of lowest to highest Hz. But does this precise order hold after <em>any</em> length of time? What would prevent signals at different Hz from arriving at exactly the same instant? Or if simultaneous arrival of different-frequency signals is already expected to occur, then how does the radio discern which is the correct signal to receive? </p>
0non-cybersec
Stackexchange
590
2,092
Prove that the nth prime number $p_n$ satisfies $p_n\leq 2^{2n-1}$. <blockquote> <p>Prove that the <em>nth</em> prime number $p_n$ (with $p_1 = 2, p_2 = 3, p_3 = 5$, etc.) satisfies $p_n \leq 2^{2n-1}$ </p> </blockquote> <p>So far I have figured out that $p_n$ = the nth prime and that I have to use mathematical induction to prove $p_n \leq 2^{2n-1}$. This is similar to the proof of infinitely many primes such that<br> $m = 1 + p_1 p_2 p_3\cdots p_n$ so there exists a prime $p | m$. </p> <p>With this information I have concluded that $p_{n+1} \leq p \leq m = 1 + p_1 p_2 p_3\cdots p_n$</p> <p>I need to figure out how to produce the right side of this inequality with induction. I'm not sure how to do this. </p> <p>Thank you for any and all help. </p>
0non-cybersec
Stackexchange
295
766
Renaming and Hiding an Exported Rcpp function in an R Package. <p>Writing an R package, I have a R function that calls a specific Rcpp function. The Rcpp function just serves as a helper function and I do not want to creat a .Rd file for it. My solution so far is to export both functions in the Namespace file which causes the warning to create an .Rd file for the Rcpp function as soon as I run the check command. If I remove the helper function in the Namespace file, I get rid of this warning causing now the problem that the R function is not able to find it anymore. </p> <p>Is there a way to solve this problem. That means to make the Rcpp function still visible for the R function and at the same time to get rid of the warning that there exists no .Rd file for the Rcpp function? </p> <p>Thanks a lot :-) </p>
0non-cybersec
Stackexchange
211
822
Why my idea is not right on this classical probability problem. <p>Sorry for my poor math, here is a classical probability problem</p> <blockquote> <p>Suppose there are $n \ge 2$ books, all books are randomly allocated to John and Jack, what is the probability of both John and Jack get at least one book?</p> </blockquote> <p>My solution is since both John and Jack can get at least one book, suppose John gets a book, and then Jack gets another book to make sure at least both of them can get one book, and the rest $n-2$ book will be randomly allocated to John and Jack, so there are $n \times (n-1) \times 2^{n-2}$ possible events, and the probability is </p> <p>$$P=\frac{n \times (n-1) \times 2^{n-2}}{2^n}$$</p> <p>But apparently, my solution is not right, the right solution is </p> <p>$$P=\frac{2^n-2}{2^n}$$</p> <p>What is the right solution to directly solve this problem?</p>
0non-cybersec
Stackexchange
277
896
Linux Live USB Drive Created with dd Corrupt Partition Table and Reliability Issues. <p>I am trying to create a Linux Live USB drive from an isohybrid (<code>.iso</code>) image.</p> <p>To accomplish this task, I have taken these steps in the past:</p> <ol> <li><p>Securely wipe the flash drive using the command:</p> <p><code>sudo dd bs=4M if=/dev/zero of=/dev/sdx</code></p> </li> <li><p>Create an <code>msdos</code> partition table on the flash drive with <code>gparted</code></p> </li> <li><p>Create a new partition (<code>/dev/sdx1</code>) that is the entire size of the flash drive with a <code>fat32</code> filesystem (for cross-platform compatibility) <strong>aligned to cylinder</strong> with <code>gparted</code></p> </li> <li><p>Set the <code>bootable</code> flag on the newly created partition (<code>/dev/sdx1</code>) using <code>gparted</code></p> </li> <li><p>Check the filesystem on the newly created partition (<code>/dev/sdx1</code>) to make sure all of the disk formatting operations were carried out properly using <code>gparted</code></p> </li> <li><p>Write the <code>.iso</code> image to the flash drive using the command:</p> <p><code>sudo dd bs=4M if=&lt;distro&gt;.iso of=/dev/sdx</code></p> </li> </ol> <p>However, after completing the last step, <strong>when I inspect the disk again with gparted, it reports that all of the space on the flash drive is unallocated and that there is no partition table on the disk</strong>. I suspect that this may have something to do with the Master Boot Record (MBR) being overwritten or corrupted when I write the <code>.iso</code> to the flash drive using the <code>dd</code> command.</p> <p>When I mount the flash drive all of the files that were contained within the <code>.iso</code> appear to be properly extracted from the <code>.iso</code>, and I am sometimes able to boot the live USB. However, I have had various reliability issues using this method during boot up and also when trying to install a distro on a hard drive using the live USB. Like I mentioned before, I suspect that this may have something to do with the partition table being corrupted and the fat32 filesystem not being properly detected after the <code>.iso</code> is written to the flash drive, which may be leading to some reading and writing issues with the disk when booting and installing.</p> <p>Is there a way to prevent these reliability issues from occurring and the partition table from being corrupted, while still using only <code>gparted</code> and <code>dd</code>?</p>
0non-cybersec
Stackexchange
710
2,524
Efficient way to map data to legend text color in ggplot2. <p>I'm wondering if there's an efficient way to map data onto legend text color in ggplot2, just like we can do with axis text. Reproducible example follows.</p> <p>First, let's make a plot:</p> <pre><code>library(ggplot2) library(dplyr) drv_counts &lt;- mutate(mpg, drv = case_when(drv == "r" ~ "rear wheel drive", drv == "4" ~ "4 wheel drive", drv == "f" ~ "front wheel drive"), model_drv = interaction(model, drv)) %&gt;% group_by(model_drv) %&gt;% summarize(model = model[1], drv = drv[1], count = n()) %&gt;% arrange(drv, count) %&gt;% mutate(model = factor(model, levels = model)) p &lt;- ggplot(drv_counts, aes(x=model, y=count, fill=drv)) + geom_col() + coord_flip() + guides(fill = guide_legend(reverse=T)) + theme_minimal() p </code></pre> <p><a href="https://i.stack.imgur.com/IGrX6.png" rel="noreferrer"><img src="https://i.stack.imgur.com/IGrX6.png" alt="enter image description here"></a></p> <p>Now let's color the axis labels by drive train. This is very easy:</p> <pre><code># ggplot2 colors cols &lt;- c("4 wheel drive" = "#F8766D", "front wheel drive" = "#00BA38", "rear wheel drive" = "#619CFF") p2 &lt;- p + theme(axis.text.y = element_text(color = cols[drv_counts$drv])) p2 </code></pre> <p><a href="https://i.stack.imgur.com/lJBWA.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lJBWA.png" alt="enter image description here"></a></p> <p>Now let's try the same trick on the legend. It doesn't work:</p> <pre><code>p2 + theme(legend.text = element_text(color = cols)) </code></pre> <p><a href="https://i.stack.imgur.com/hJeaC.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hJeaC.png" alt="enter image description here"></a></p> <p>The reason this doesn't work for legend text but does work for axis text is that all the axis labels are drawn in one grob, and hence we can give that grob a vector of colors, but the legend labels are drawn in separate grobs.</p> <p>We can go in and color all the grobs manually, but that's super ugly and cumbersome:</p> <pre><code>g &lt;- ggplotGrob(p2) g$grobs[[15]]$grobs[[1]]$grobs[[9]]$children[[1]]$gp$col &lt;- cols[g$grobs[[15]]$grobs[[1]]$grobs[[9]]$children[[1]]$label] g$grobs[[15]]$grobs[[1]]$grobs[[10]]$children[[1]]$gp$col &lt;- cols[g$grobs[[15]]$grobs[[1]]$grobs[[10]]$children[[1]]$label] g$grobs[[15]]$grobs[[1]]$grobs[[11]]$children[[1]]$gp$col &lt;- cols[g$grobs[[15]]$grobs[[1]]$grobs[[11]]$children[[1]]$label] grid::grid.newpage() grid::grid.draw(g) </code></pre> <p><a href="https://i.stack.imgur.com/8VNpy.png" rel="noreferrer"><img src="https://i.stack.imgur.com/8VNpy.png" alt="enter image description here"></a></p> <p>My question is: Can somebody think of a way of getting this effect without having to dig down into the grob tree? I'm Ok with a patch to ggplot2 if it's only a few modified lines. Alternatively, can the digging down into the grob tree be automated so I don't have to access child grobs by manually setting list indices that will change the moment I make a minor change to the figure?</p> <p><strong>Update:</strong> A related question can be found <a href="https://stackoverflow.com/q/23588127/4975218">here.</a> To make my question distinct, let's add the requirement that colors aren't copied over from the symbols but rather can be set to any arbitrary values. This added requirement has real-world relevance because I usually use a darker color for text than for symbols.</p>
0non-cybersec
Stackexchange
1,254
3,608
[C#] [HOMEWORK] Rock Paper Scissors. For class, I am to develop a program to play Rock Paper Scissors with a computer opponent and loop until the user decided to not play. The instructions given to me are as follows: Begin by asking users if they are ready to play. If they answer "yes" (accept ANY combination of capital and lowercase letters with the new string manipulation methods you learned in the chapter), then have the computer randomly select rock, paper, or scissors and display this in the console window. This is cheating... giving us psychic powers to know what player 1 is going to select, but for purposes of this exercise, it will help you to ensure your code is working right. Next, prompt the user for their selection – rock, paper, or scissors. Then use the "judging" section of the code exactly as you did last week to evaluate inputs and display the result. Finally, ask the user if they want to play again. Exit the program, if the user elects not to play again. I'm trying to use a version I've made using two inputs as a base and I can't seam to convert, for lack of better word, the player one input to the computer properly nor get the loop to go back to the beginning. The problem I'm having with the computer choice, is that it's always picking rock, and not another option. using System; class RPS { public static void Main(string[] args){ /* THe variable string allows characters to be grouped together to make typing the program easier*/ string string1 = "Player One <Computer> Selection - "; string string2 = "Player Two Selection - "; string string3 = "Type 1 for rock, 2 for paper, or 3 for sisscors. "; string playRPS = "Do you want to play Rock, Paper, Scissors?"; string yesOrNo; string player2choice; Random computer = new Random(); int number = computer.Next(1,4); string cpuchoice = number.ToString(); Console.Write(playRPS); yesOrNo = Console.ReadLine(); yesOrNo = yesOrNo.ToUpper(); while (yesOrNo == "YES"){ Console.WriteLine(string1); Console.WriteLine(string2 + string3); player2choice = Console.ReadLine(); switch (int.Parse(cpuchoice)) { case 1: Console.WriteLine("It is a draw."); break; case 2: Console.WriteLine("Player 1 wins."); break; case 3: Console.WriteLine("Player 2 wins."); break; default: Console.WriteLine("Oops, you entered a number not in the range 1 to 3"); break; } } //Swtich Ends } } } The switch in the program works fine, so I left that part out. At the moment I'm more focused on getting the loop and computer choices to line up. Appreciate the help. EDIT: Took out the switch to help with readability.
0non-cybersec
Reddit
715
2,709
Your butt isn't as fluffy!. Yesterday, I went to the grocery store to stock up on my veggies for this weekend and ran into an old friend of mine and her son that used to live around the corner from us. As we were standing in line he said to me, rather loudly "your butt isn't as fluffy as it used to be. Where did it go?" I thought his mother was going to faint from embarrassment after he said that. I couldn't help but laugh. I love how honest kids are! That was the first time anyone had said anything about my weight loss. I'll take it!
0non-cybersec
Reddit
130
540
Problems trying to create gradle build. <p>We have recently migrated to Android Studio (from Intellij). I am currently trying to migrate our project to use gradle for builds. I have tried fitting it around our current folder structure, and I have tried to migrate our files to match the gradle file structure. </p> <p>I have had errors each way, I have been looking for an answer, but can't find anything that quite matches what we are getting.</p> <p>The error I get when trying to migrate to the gradle file structure is:</p> <ul> <li><p>What went wrong:</p> <p>A problem occurred configuring project ':'.</p> <blockquote> <p>Failed to notify project evaluation listener. Configuration with name 'default' not found</p> </blockquote></li> </ul> <p>The error I get using our old file structure is:</p> <pre><code>:&lt;project&gt;:processDebugResources /Users/kbrown/dev/AndroidClient/&lt;project&gt;/build/res/all/debug/values/values.xml:311: error: Error retrieving parent for item: No resource found that matches the given name '@style/Widget.Sherlock.ActionBar.Solid'. /Users/kbrown/dev/AndroidClient/&lt;project&gt;/build/res/all/debug/values/values.xml:312: error: Error: No resource found that matches the given name: attr 'background'. /Users/kbrown/dev/AndroidClient/&lt;project&gt;/build/res/all/debug/values/values.xml:314: error: Error: No resource found that matches the given name: attr 'backgroundSplit'. </code></pre> <p>Any ideas on where to look. We do have a couple references to libraries like ActionBarSherlock.</p> <p>build.gradle</p> <pre><code>buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.4' } } apply plugin: 'android' dependencies { compile files('libs/android-support-v4.jar') compile files('libs/retrofit-1.0.0-SNAPSHOT.jar') compile project(':ThirdParty:ActionBarSherlock') compile project(':ThirdParty:drag-sort-listview') compile project(':ThirdParty:SlidingMenu') compile project(':ThirdParty:Android-ViewPagerIndicator') } android { compileSdkVersion 17 buildToolsVersion "17.0.0" defaultConfig { minSdkVersion 8 targetSdkVersion 17 } sourceSets { main { manifest.srcFile 'AndroidManifest.xml' resources.srcDirs = ['src'] res.srcDirs = ['res'] } instrumentTest.setRoot('../UnitTests/src') } } </code></pre> <p>settings.gradle</p> <pre><code>include ':library:Android-ViewPagerIndicator',':library:SlidingMenu',':library:drag-sort-listview',':library:ActionBarSherlock',':&lt;project&gt;' </code></pre> <p>Any ideas would be appreciated.</p>
0non-cybersec
Stackexchange
825
2,717
A bound for the minimum vertex cover of scale-free graphs. <p>For a complete graph, the size of minimum vertex cover is $n-1$.</p> <p>I was wondering whether there exist an upper bound (or an expected value or upper bound) for the size of minimum vertex cover for <a href="http://en.wikipedia.org/wiki/Scale-free_network" rel="nofollow">scale-free graphs</a>, i.e. such whose degree distribution follows a <a href="https://en.wikipedia.org/wiki/Power_law" rel="nofollow">power law</a>.</p> <p>I searched and didn't find anything, is anybody aware of any bounds?</p>
0non-cybersec
Stackexchange
168
568
How to deduce the return type of a function object from parameters list?. <p>I'm trying to write a projection function that could transform a <code>vector&lt;T&gt;</code> into a <code>vector&lt;R&gt;</code>. Here is an example:</p> <pre><code>auto v = std::vector&lt;int&gt; {1, 2, 3, 4}; auto r1 = select(v, [](int e){return e*e; }); // {1, 4, 9, 16} auto r2 = select(v, [](int e){return std::to_string(e); }); // {"1", "2", "3", "4"} </code></pre> <p>First attempt:</p> <pre><code>template&lt;typename T, typename R&gt; std::vector&lt;R&gt; select(std::vector&lt;T&gt; const &amp; c, std::function&lt;R(T)&gt; s) { std::vector&lt;R&gt; v; std::transform(std::begin(c), std::end(c), std::back_inserter(v), s); return v; } </code></pre> <p>But for </p> <pre><code>auto r1 = select(v, [](int e){return e*e; }); </code></pre> <p>I get:</p> <blockquote> <p>error C2660: 'select' : function does not take 2 arguments</p> </blockquote> <p>I have to explicitly call <code>select&lt;int,int&gt;</code> to work. I don't like this because the types are redundant.</p> <pre><code>auto r1 = select&lt;int, int&gt;(v, [](int e){return e*e; }); // OK </code></pre> <p>Second attempt:</p> <pre><code>template&lt;typename T, typename R, typename Selector&gt; std::vector&lt;R&gt; select(std::vector&lt;T&gt; const &amp; c, Selector s) { std::vector&lt;R&gt; v; std::transform(std::begin(c), std::end(c), std::back_inserter(v), s); return v; } </code></pre> <p>The result is same error, function does not take 2 arguments. In this case I actually have to supply a 3rd type argument:</p> <pre><code>auto r1 = select&lt;int, int, std::function&lt;int(int)&gt;&gt;(v, [](int e){return e*e; }); </code></pre> <p>Third attempt: </p> <pre><code>template&lt;typename T, typename R, template&lt;typename, typename&gt; class Selector&gt; std::vector&lt;R&gt; select(std::vector&lt;T&gt; const &amp; c, Selector&lt;T,R&gt; s) { std::vector&lt;R&gt; v; std::transform(std::begin(c), std::end(c), std::back_inserter(v), s); return v; } </code></pre> <p>For </p> <pre><code>auto r1 = select&lt;int, int, std::function&lt;int(int)&gt;&gt;(v, [](int e){return e*e; }); </code></pre> <p>the error is:</p> <blockquote> <p>'select' : invalid template argument for 'Selector', class template expected</p> </blockquote> <p>For </p> <pre><code>auto r1 = select(v, [](int e){return e*e; }); </code></pre> <blockquote> <p>error C2660: 'select' : function does not take 2 arguments</p> </blockquote> <p>(I know the last two attempts are not particularly great.)</p> <p>How can I write this <code>select()</code> template function to work for the sample code I put in the beginning?</p>
0non-cybersec
Stackexchange
1,060
2,703
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
An example of short-term relative arbitrage Robert Fernholz1 July 4, 2018 Abstract Long-term relative arbitrage exists in markets where the excess growth rate of the market portfolio is bounded away from zero. Here it is shown that under a time-homogeneity hypothesis this condition will also imply the existence of relative arbitrage over arbitrarily short intervals. Suppose we have a market of stocks X1, . . . , Xn represented by positive continuous semimartingales that satisfy d logXi(t) = γi(t) dt+ d∑ ν=1 ξiν(t) dWν(t), for i = 1, . . . , n, where d ≥ n ≥ 2, (W1, . . . ,Wd) is a d-dimensional Brownian motion, and the processes γi and ξiν are progressively measurable with respect to the underlying filtration with γi locally integrable and ξiν locally square-integrable. The process Xi represents the total capitalization of the ith company, so the total capitalization of the market is X(t) = X1(t) + · · ·+Xn(t) and the market weight processes µi are defined by µi(t) = Xi(t)/X(t), for i = 1, . . . , n. The ijth covariance process σij is defined by σij(t) , d∑ ν=1 ξiν(t)ξjν(t), for i, j = 1, . . . , n. A portfolio π is defined by its weights π1, . . . , πn, which are bounded processes that are progressively measurable with respect to the Brownian filtration and add up to one. The portfolio value process Zπ for π satisfies d logZπ(t) = n∑ i=1 πi(t) d logXi(t) + γ ∗ π(t) dt, a.s., where the process γ∗π defined by γ∗π(t) , 1 2 ( n∑ i=1 πi(t)σii(t)− n∑ i,j=1 πi(t)πj(t)σij(t) ) is called the excess growth rate process for π. It can be shown that if πi(t) ≥ 0, for i = 1, . . . , n, then γ∗π(t) ≥ 0, a.s. The market weights µi define the market portfolio µ, and if the market portfolio value process Zµ is initialized so that Zµ(0) = X(0), then Zµ(t) = X(t) for all t ≥ 0, a.s. Since the market weights are all positive, γ∗µ(t) ≥ 0, a.s. This introductory material can be found in Fernholz (2002). Let S be the entropy function defined by S(x) = − n∑ i=1 xi log xi, for x ∈ ∆n, the unit simplex in Rn. We see that 0 ≤ S(x) ≤ log n, where the minimum value occurs only at the corners of the simplex, and the maximum value occurs only at the point where xi = 1/n for all i. For a constant c ≥ 0, the generalized entropy function Sc is defined by Sc(x) = S(x) + c, 1INTECH, One Palmer Square, Princeton, NJ 08542. [email protected]. The author thanks Christa Cuchiero, Ioannis Karatzas, Constantinos Kardaras, Johannes Ruf, and Walter Schachermayer for their invaluable comments and suggestions regarding this research. 1 ar X iv :1 51 0. 02 29 2v 1 [ q- fi n. M F ] 8 O ct 2 01 5 for x ∈ ∆n. It can be shown that Sc generates a portfolio π with weights πi(t) = c− logµi(t) Sc(µ(t)) µi(t), for i = 1, . . . , n, and the portfolio value process Zπ will satisfy d log ( Zπ(t)/Zµ(t) ) = d log Sc(µ(t)) + γ∗µ(t) Sc(µ(t)) dt, a.s. (1) (see Fernholz (1999), Fernholz (2002), and Fernholz and Karatzas (2005)). Definition 1. For T > 0, there is relative arbitrage versus the market on [0, T ] if there exists a portfolio π such that P [ Zπ(T )/Zµ(T ) ≥ Zπ(0)/Zµ(0) ] = 1, P [ Zπ(T )/Zµ(T ) > Zπ(0)/Zµ(0) ] > 0. If P [ Zπ(T )/Zµ(T ) > Zπ(0)/Zµ(0) ] = 1, then this relative arbitrage is strong. Proposition 1. For T > 0, suppose that for the market X1, . . . , Xn there exists a constant ε > 0 such that γ∗µ(t) > ε, a.s., for all t ∈ [0, T ], and for the entropy function S ess inf { S(µ(t)) : t ∈ [0, T/2] } ≤ ess inf { S(µ(t)) : t ∈ [T/2, T ] } . (2) Then there is relative arbitrage versus the market on [0, T ]. Proof. Let A = ess inf { S(µ(t)) : t ∈ [0, T/2] } . (3) Since γ∗µ(t) ≥ ε > 0 on [0, T ], a.s., not all the µi can be constantly equal to 1/n, so 0 ≤ A < log n. Hence, we can choose δ > 0 such that A+ 2δ < log n and P [ inf t∈[0,T/2] S(µ(t)) < A+ δ ] > 0, so if we define the stopping time τ1 = inf { t ∈ [0, T/2] : S(µ(t)) ≤ A+ δ } ∧ T, then P [ τ1 ≤ T/2 ] > 0. We can now define a second stopping time τ2 = inf { t ∈ [τ1, T ] : S(µ(t)) = A+ 2δ } ∧ T, and we have τ1 ≤ τ2, a.s. Now consider the generalized entropy function Sδ(x) , S(x) + δ, for the same δ > 0 as we chose above, so Sδ(x) ≥ δ. It follows from (1) that log ( Zπ(τ2)/Zµ(τ2) ) − log ( Zπ(τ1)/Zµ(τ1) ) = log Sδ(µ(τ2))− log Sδ(µ(τ1)) + ∫ τ2 τ1 γ∗µ(t) Sδ(µ(t)) dt, a.s., (4) for the times τ1 and τ2. Suppose we are on the set where τ1 ≤ T/2, so τ1 < τ2, a.s., and consider two cases: 2 1. If τ2 < T , then log Sδ(µ(τ2))− log Sδ(µ(τ1)) ≥ log(A+ 3δ)− log(A+ 2δ) > 0, a.s., and since the integral in (4) is positive, a.s., we have log ( Zπ(τ2)/Zµ(τ2) ) − log ( Zπ(τ1)/Zµ(τ1) ) > 0, a.s. (5) 2. If τ2 = T , then A+ δ ≤ Sδ(µ(t)) < A+ 3δ for t ∈ [τ1, T ], a.s., so log Sδ(µ(τ2))− log Sδ(µ(τ1)) + ∫ τ2 τ1 γ∗µ(t) Sδ(µ(t)) dt > log A+ δ A+ 2δ + εT 2(A+ 3δ) , a.s. (6) Again there are two cases: (a) If A = 0, let δ = εT 6 log 2 , (7) so the left-hand side of the inequality in (6) will be positive, a.s., and (4) implies that log ( Zπ(τ2)/Zµ(τ2) ) − log ( Zπ(τ1)/Zµ(τ1) ) > 0, a.s. (8) (b) If A > 0, then lim δ↓0 [ log A+ δ A+ 2δ + εT 2(A+ 3δ) ] = εT 2A > 0, (9) so for small enough δ > 0, (6) will be positive, and (8) will be valid. Now consider the portfolio η defined by: 1. For t ∈ [0, τ1), η(t) = µ(t), the market portfolio. 2. For t ∈ [τ1, τ2), η(t) = π(t), the portfolio generated by Sδ with δ chosen according to (7) or (9), as the case may be. 3. For t ∈ [τ2, T ], η(t) = µ(t). If τ1 = T , then η(t) = µ(t) for all t ∈ [0, T ], so log ( Zη(T )/Zµ(T ) ) = log ( Zη(0)/Zµ(0) ) , a.s. If τ1 6= T , then τ1 ≤ T/2 and τ1 < τ2, a.s. By the construction of η, we have log ( Zη(T )/Zµ(T ) ) − log ( Zη(0)/Zµ(0) ) = log ( Zπ(τ2)/Zµ(τ2) ) − log ( Zπ(τ1)/Zµ(τ1) ) > 0, a.s., with the inequality following from (5) or (8), as the case may be. Since P[τ1 6= T ] > 0, P [ log ( Zη(T )/Zµ(T ) ) ≥ log ( Zη(0)/Zµ(0) )] = 1, P [ log ( Zη(T )/Zµ(T ) ) > log ( Zη(0)/Zµ(0) )] > 0, so there is relative arbitrage versus the market on [0, T ]. Let us recall that the market is diverse over the interval [0, T ] if there exists a δ > 0 such that µi(t) < 1− δ, a.s., 3 for i = 1, . . . , n and all t ∈ [0, T ] (see, e.g., Fernholz (2002)). Corollary 1. Let T > 0 and suppose that the market is not diverse over [0, T/2] and that γ∗µ(t) > ε > 0 for t ∈ [0, T ]. Then there is relative arbitrage versus the market on [0, T ]. Proof. In this case A = 0 in (3). Remark 1. Corollary 1 can be applied to volatility-stabilized markets, for which Banner and Fernholz (2008) have previously shown the existence of short-term strong relative arbitrage. Remark 2. The condition (2) can be generalized to a function A defined on [0, T ] by A(t) = ess inf { S(µ(t)) } . If A increases over any subinterval of [0, T ], then an argument similar to that of case 1 in Proposition 1 will establish relative arbitrage. Moreover, Johannes Ruf has pointed out that the proof of Proposition 1 can be extended to establish relative arbitrage in the case where A is slowly (enough) decreasing on [0, T ]. By means of a remarkable construction, Karatzas and Ruf (2015) have shown that short-term relative arbitrage does not exist for arbitrary A. References Banner, A. and D. Fernholz (2008). Short-term arbitrage in volatility-stabilized markets. Annals of Fi- nance 4, 445–454. Fernholz, R. (1999). Portfolio generating functions. In M. Avellaneda (Ed.), Quantitative Analysis in Financial Markets, River Edge, NJ. World Scientific. Fernholz, R. (2002). Stochastic Portfolio Theory. New York: Springer-Verlag. Fernholz, R. and I. Karatzas (2005). Relative arbitrage in volatility-stabilized markets. Annals of Fi- nance 1, 149–177. Karatzas, I. and J. Ruf (2015). Lyapunov functions as portfolio generators. Technical report, Columbia University and University College London. 4
0non-cybersec
arXiv
3,383
7,976
Reddit, as a High School senior coming from a low-income family, should I attend a Community College first, or go straight into a 4-year University?. If you have any questions that help, please ask. What helps you, will ultimately help me. I come from a low-income family. Only my dad works. But, my brothers and I are all very hard working students and I will be the first of my family to attend college. I maintain an above average gpa, and have been recognized as a part of the top ten percent in my district (Fontana Unified School District of California), so my grades aren't an issue. My main concern is that I will be put into serious debt if I attend a UC school straight out of high school. My parents support everything I do, but we've just never had the money for a college fund; I'm relying solely on scholarships and grants. Also, I am still unsure of what I want my major/career to be. I have taken a liking to Statistics and Environmental Science, but I'm still not positive. I like the money that Statistics has to offer, but am dreadfully afraid of taking Calculus as I struggled in Pre-Calculus. Is there any career with Statistics that doesn't need Calc? Please help a student out Reddit. EDIT: I'm getting tons if replies. I'm doing my very best to reply to everyone but it may not happen, sorry! EDIT 2: I'm going to be guys. Thanks for SO many helpful responses, it's REALLY helping me out. I appreciate it. I have school tomorrow, and I most likely won't be able to answer again until about 2 pm PST. But I DO read every response. Night guys!
0non-cybersec
Reddit
373
1,571
Life-changingly easy and effective way to clean out a stainless steel coffee carafe.. I was cleaning out my coffee machine, did the whole vinegar routine, and the inside of my stainless steel carafe was still all brown. We tend to just rinse it out and refill every time and it's been a while since it'd been really scrubbed. So, after running several rounds of water through it to rinse the vinegar out, I took the last carafe which was full of hot water, added about a tablespoon of Oxi Clean, popped the lid back on and let it sit. It foamed for a few minutes and eventually stopped. I dumped it out; the water was as brown as coffee and the inside of the pot is GLEAMING. Like new. (This next part is probably a bad idea and you probably shouldn't do it. I'm sure it voids all kinds of warranties and stuff.) I unplugged the machine, added a little, maybe a half teaspoon, of Oxiclean in the reservoir with some hot water, and swished that around with a bottle brush. OMG THE CRUD. The thing is made of black plastic and I had no idea how filthy it was. It seems like it would be a Very Bad Thing to run the oxi mixture through the machine itself, so I dumped it out, rinsed and dumped a few times, then ran a few batches of water through the machine normally to be sure there's no soap left. I dipped a cloth in oxi/water solution and used that to detail the outside of the machine. It looks like new now. I avoided Oxi Clean for ages because of those stupid ads, but I'm damn near ready to start a religion based on the stuff now. This not an ad. I'm sure the generic version from the supermarket would do the same thing. Seriously, try it. TL/DR; Oxi Clean.
0non-cybersec
Reddit
413
1,676
To make it available on the App Store, accept the terms of the latest agreement in Agreements, Tax, and Banking. <p>This is a question relating to releasing software on the Apple iTunesConnect interface. This past month (March 2015). Apple's software is very finicky and new problems come up often and are short lived.</p> <p>I have received this message when attempting to "Submit for Review" my app:</p> <blockquote> <p>Your app can't be made available on the App Store. To make it available on the App Store, accept the terms of the latest agreement in Agreements, Tax, and Banking.</p> </blockquote> <p><img src="https://i.stack.imgur.com/KfrF3.png" alt="enter image description here"></p> <p>Clicking on that link produces this page, and none of the links there lead to something related to "[accepting] the terms of the latest agreement". Also, I am the sole user with access to this system, and I have the "legal admin" permissions.</p> <p><img src="https://i.stack.imgur.com/NHQw3.png" alt="enter image description here"></p> <p>How do I get past this?</p>
0non-cybersec
Stackexchange
298
1,073
Gulp: run task without a destination. <p>I'm trying to make a simple task to show the file size for each file in an array of paths using the <code>gulp-size</code> package, like so:</p> <pre><code>var gulp = require('gulp') var size = require('gulp-size') gulp.task('size', function() { gulp.src(bigArrayOfFilePathsFromAnotherModule) .pipe(size({ showFiles: true })) }) </code></pre> <p>When this runs, it gets part of the way through, but then the task finishes before all of the files are processed. It works just fine if I pipe them to a destination, but I'd rather not copy the files anywhere. Is there a way to pipe these files into a black hole so the task completes?</p> <p>I've tried <code>.pipe(gulp.dest('/dev/null'))</code> but it errors out trying to <code>mkdir /dev/null</code> which already exists.</p> <p>Is there a good way to pipe a stream to nowhere?</p>
0non-cybersec
Stackexchange
271
885
Counting Repetitions in a tree. <p>Imagine a descendants tree where all nodes are either 1, 2 or 3. Each node has two descendants, all numbers except itself. Given a row $n$ how many nodes are the same as our original (first) node?</p> <p>Example:</p> <p><a href="https://i.stack.imgur.com/a0BUA.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a0BUA.gif" alt=""></a></p> <p>Since for each node different from 1 in row $i$, row $i+1$ has exactly one node equal to $1$ we can work out that $S(n+1)=2^n - S(n)$ and that $S(0)=1$ where S is the number of nodes equal to our original.</p>
0non-cybersec
Stackexchange
210
606
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Measure Theory Question Involving an $f: \mathbb{R}^2 \rightarrow \mathbb{R}$. <p>I'm having trouble parsing the meaning of the following question and am curious if somebody could confirm that the way I am interpreting the prompt is correct:</p> <blockquote> <p>Let $f(x,t)$ be a real valued function on $\mathbb{R}^2$ such that for each fixed $x$ it is continuous in $t$ and for each $t$ it is Lebesgue integrable in $x$. In addition suppose that $|f(x,t)| \le g(x)$ for $t$ in some open interval $(a,b)$ and some $g$ integrable in $x$. Prove that the function $F(t) = \int_R f(x,t)dx$ is continuous at any point $t_0 \in (a,b)$.</p> </blockquote> <p><strong>(i) "Let $f(x,t)$ be a real valued function on $\mathbb{R}^2$ such that for each fixed $x$ it is continuous in $t$"</strong></p> <p>Here I take it that $f:\mathbb{R}^2 \rightarrow \mathbb{R}$ whereby if we fix $x$ and let $p = (x,y)$ that $\forall \epsilon &gt; 0, \exists \delta &gt; 0$ s.t. for any $q = (x,y_1)$ we have $0 &lt; |p - q| &lt; \delta \implies |f(p) - f(q)| &lt; \epsilon$.</p> <p><strong>(ii) "and for each $t$ it is Lebesgue integrable in $x$"</strong></p> <p>Here I assume this means that if we fix $t$ and consider $E = \{(x,t) : x \in \mathbb{R} \}$ that $-\infty &lt; \int_E f &lt; +\infty$.</p> <p><strong>(iii) "In addition suppose that $|f(x,t)| \le g(x)$ for $t$ in some open interval $(a,b)$ and some $g$ integrable in $x$."</strong></p> <p>Here I assume this means that we fix $(a,b)$ and consider that $\forall t \in (a,b)$, we have that $\forall x \in \mathbb{R}$, $|f(x,t)| \le g(x)$ (implying immediately that $0 \le g$) with $\int g &lt; + \infty$.</p> <p><strong>(iv) Prove that the function $F(t) = \int_R f(x,t)dx$ is continuous at any point $t_0 \in (a,b)$.</strong></p> <p>Here I assume that $R \ne \mathbb{R}$ but rather $R = \{(x,t) : x \in \mathbb{R}$ for fixed $t \in \mathbb{R} \}$. Then we aim to show that if $t_0 \in (a,b)$, then $\forall \epsilon &gt; 0$, $\exists \delta &gt; 0$ s.t. $\forall r \in \mathbb{R}$ we have</p> <p>$0 &lt; |t_0 - r| &lt; \delta \implies |F(t_0) - F(r)| &lt; \epsilon$</p> <p>or equivalently if $\{t_n\}$ is a sequence of reals which converges to $t_0$, we have that</p> <p>$$\lim_{t_n\to t_0} F(t_n) = F(t_0)\text{ or }\lim_{t_n\to t_0} \int f(x,t_n)dx = \int f(x,t_0)dx$$</p>
0non-cybersec
Stackexchange
918
2,330
Let S be an arbitrary set and let $f_n : S \to \mathbb{R}$ be a sequence of functions. <blockquote> <p>Let S be an arbitrary set and let <span class="math-container">$f_n : S \to \mathbb{R}$</span> be a sequence of functions. If <span class="math-container">$f_n$</span> is increasing for all x <span class="math-container">$\in$</span> S and <span class="math-container">$f_n$</span> converges pointwise to <span class="math-container">$f$</span>, then f is increasing.</p> </blockquote> <p>I'm trying to prove this theorem but the hypothesis is not clear for me. I've found this: <a href="https://math.stackexchange.com/questions/1565585/prove-that-if-the-sequence-of-increasing-functions-f-n-converges-to-f-the">Prove that if the sequence of increasing functions $(f_n)$ converges to $f$, then $f$ is increasing</a> But I think that in my case, the hypothesis is saying that <span class="math-container">$f_n \leq f_{n+1}$</span> for all x ∈ S and all n ∈ <span class="math-container">$\mathbb{N}$</span>, which is simmilar to the hypothesis of <em>Dini's Theorem</em>.</p> <p>Can you guys give me an ideia of how to prove this?</p>
0non-cybersec
Stackexchange
380
1,145
Set up SSHFS automated mounting only when user SSH into remote server?. <p>i want to set up SSHFS such that whenever I SSH into remote server, it mounts the file transfer folder. Is it possible to set it up in such way?</p> <hr> <p>making script after @Alex's comment. </p> <p>my script is very simple. </p> <pre><code>#! /bin/bash #login in the server ssh -X [email protected] #establish the automated mounting sshfs [email protected]:/home/usr/data /usr/some/place/mountedfolder/ -ovolname=mounted-folder </code></pre> <p>but now, if i execute this file. first the ssh is established and then only after i exit ssh the folder is mounted with <code>sshfs</code>. </p> <p>What am i doing wrong here?</p> <hr> <p>okay for now, i just did simple fix :-> switched the order of commands. first the <code>sshfs</code> and then <code>ssh</code> so that : first it mounts and second it establishes <code>ssh</code> connection. </p> <pre><code>#! /bin/bash #establish the automated mounting sshfs [email protected]:/home/usr/data /usr/some/place/mountedfolder/ -ovolname=mounted-folder #login in the server ssh -X [email protected] </code></pre> <p>seems like it works for now. </p>
0non-cybersec
Stackexchange
394
1,165
How to remove only symbols from string in dart. <p>I want to remove all special symbols from string and have only words in string I tried this but it gives same output only</p> <pre><code>main() { String s = "Hello, world! i am 'foo'"; print(s.replaceAll(new RegExp('\W+'),'')); } </code></pre> <p>output : <code>Hello, world! i am 'foo'</code><br> expected : <code>Hello world i am foo</code></p>
0non-cybersec
Stackexchange
139
410
Rendering an action with :notice that depends on a URL param. <p>I have an action 'approval' that renders a view which displays some content from a Model (class). Within the view I have a link_to that calls <code>accept</code> with a URL parameter (:id). After the <code>accept</code> action completes (sets approve to true) I would like to render <code>approval</code> again with a message ("Saved!"). However, unlike a static login page, the approval action requires a param the first time it is called. The second time it is rendered, an runtime error occurs (obviously). What is the best way to call <code>approval</code> with the flash notice?</p> <pre><code>def approval @c = Class.find(params[:id]) end def accept @c = Class.find(params[:id]) @c.approve = true @c.save render 'approval', :notice =&gt; "Saved!" end </code></pre>
0non-cybersec
Stackexchange
245
850
Automating Biber in TeXworks. <p>I'm using <code>miktex</code> portable with the included <code>TeXworks</code> editor. I need to compile a document using:</p> <pre><code>pdfLaTex - Biber - pdfLaTex </code></pre> <p>If I run the three commands individually, they work fine. However, when I create a new tool to run all <code>3</code> together, the Biber part seems to get skipped, I cannot find any information about Biber in the console output. </p> <p>Also, I've noticed that when I run <code>pdfLaTex</code> by itself, it creates an aux and bcf file, but when I run all 3 together, those files are not created. I know <code>Biber</code> needs the bcf file to run, so I suspect this may be part of the problem, though I don't know what is causing it.</p> <p>This is the confuguration I have for the tool that I created in <code>TeXworks</code>:</p> <p><a href="https://i.stack.imgur.com/QVrI6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QVrI6.png" alt="enter image description here"></a></p> <p>Running the three programs individually works, but it would be nice if all 3 could run together. Any ideas of what could be wrong here?</p>
0non-cybersec
Stackexchange
361
1,166
Using with vs declare a temporary table: performance / difference?. <p>I have created a sql function in <strong>SQLServer 2008</strong> that declared a temporary table and uses it to compute a moving average on the values inside</p> <pre><code>declare @tempTable table ( GeogType nvarchar(5), GeogValue nvarchar(7), dtAdmission date, timeInterval int, fromTime nvarchar(5), toTime nvarchar(5), EDSyndromeID tinyint, nVisits int ) insert @tempTable select * from aces.dbo.fEDVisitCounts(@geogType, @hospID,DATEADD(DD,-@windowDays + 1,@fromDate), @toDate,@minAge,@maxAge,@gender,@nIntervalsPerDay, @nSyndromeID) INSERT @table (dtAdmission,EDSyndromeID, MovingAvg) SELECT list.dtadmission , @nSyndromeID , AVG(data.nVisits) as MovingAvg from @tempTable as list inner join @tempTable as data ON list.dtAdmission between data.dtAdmission and DATEADD(DD,@windowDays - 1,data.dtAdmission) where list.dtAdmission &gt;= @fromDate GROUP BY list.dtAdmission </code></pre> <p>but I also found out that you can declare the tempTable like this:</p> <pre><code>with tempTable as ( select * from aces.dbo.fEDVisitCounts('ALL', null,DATEADD(DD,-7,'01-09-2010'), '04-09-2010',0,130,null,1, 0) ) </code></pre> <p><strong>Question: Is there a major difference in these two approaches? Is one faster than the other or more common / standard?</strong> I would think the declare is faster since you define what the columns you are looking for are.. Would it also be even faster if I were to omit the columns that were not used in the calculations of moving average?(not sure about this one since it has to get all of the rows anyways, though selecting less columns makes intuitive sense that it would be faster/less to do)</p> <p>I also have found a <code>create temporary table @table</code> from here <a href="https://stackoverflow.com/questions/4680886/how-to-declare-internal-table-in-mysql">How to declare Internal table in MySQL?</a> but I don't want the table to persist outside of the function (I am not sure if the create temporary table does this or not.)</p>
0non-cybersec
Stackexchange
658
2,209
PHP Local File Inclusion from URL; no param. <p>The PHP code has a <code>handleRoute($path)</code> function that is triggered for URLs like <code>server.com/routeme/a</code>. Handle route has the follwing: if <code>file_exists($path)</code> then <code>include $path</code>. </p> <p>The $path argument is <code>/srv/dirs/routeme/a</code>. </p> <p>A Google search leads to a million results where the file name is directly read from a parameter. When instead read from an URL, I can't just say <code>server.com/routeme/a/../../</code>, as nginx will reply with <code>400 Bad Request</code> instead of executing the <code>handleRoute</code> function. </p> <p>I have been attempting to find something that PHP will interpret as a Path outside of <code>routeme/</code> while nginx does not and thus still lead to the execution of the include. </p> <p>I was hoping <code>%2E%2E%2F</code> (encoded <code>../</code>) would do it, but nginx still interprets this as a path. </p> <p>I have a feeling that either I'm missing some obvious method to do this, or that it is a dead end and the code not vulnerable. </p>
0non-cybersec
Stackexchange
335
1,110
How to handle only overlays while printing a latex beamer notes. <p>Using overlays and showing multiple graphs in the same slides and even text is really great but I am really wondering how can we show each piece of overlay while printing the slides or notes ? It seems some of the slide can have multiple pages in order to accurately show all the graphs and text especially when we use overlays such as <code>\only&lt;1-3</code> and <code>\only&lt;4-5&gt;</code>. If it is just a regular text and fills only one page then it should be fine. But often times it is more complex than that. Would anyone clarify what can we do under such circumstances ?</p> <p><strong>EDIT: MINIMAL EXAMPLE ADDED</strong></p> <p>What I mean here is that on the second slide I have three different tikz picture. Here I didn't include the picture on node (0,0). In my slide I am using the pictures. SO, how can I print all these three pictures on the same page ? In other cases also some of the text doesn't fit on the slides. I hope it is more understandable now. </p> <p>A minimal working example </p> <pre><code>%\documentclass[mathserif]{beamer} \documentclass[arial,handout]{beamer} \usepackage{pgf,pgfpages} \usepackage{graphicx} %\usepackage{units} %\usepackage[utf8]{inputenc} \usepackage{mathtools} %\usepackage{amsmath} \usepackage{animate} \usepackage{booktabs} \usepackage{tikz} \usetikzlibrary{arrows,shapes} \tikzset{ invisible/.style={opacity=0}, visible on/.style={alt=#1{}{invisible}}, alt/.code args={&lt;#1&gt;#2#3}{% \alt&lt;#1&gt;{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} % \pgfkeysalso doesn't change the path }, } \mode&lt;presentation&gt; { \usetheme{ift} \setbeamertemplate{items}[square] } \usefonttheme[onlymath]{serif} \setbeamerfont{frametitle}{size=\LARGE,series=\bfseries} \definecolor{uibred}{RGB}{170, 0, 0} \definecolor{uibblue}{RGB}{0, 84, 115} \definecolor{uibgreen}{RGB}{119, 175, 0} %\definecolor{uibgreen}{RGB}{50, 105, 0} \definecolor{uiborange}{RGB}{217, 89, 0} %% Create a new command called redub for underbraces \newcommand\redub[2]{% \colorlet{currentcolor}{.}% \color{red}% \underbrace{\color{currentcolor}#1}_{\color{red}#2}% \color{currentcolor}% } %Beamer block template \setbeamertemplate{blocks}[rounded][shadow=true] \setbeamercolor{block title}{bg=uibblue,fg=white} \setbeamercolor{item projected}{fg=white,bg=green} \beamertemplatenavigationsymbolsempty %\include{macros} %\includeonlyframes{current} \defbeamertemplate{enumerate item}{mycircle} { %\usebeamerfont*{item projected}% %\usebeamercolor[bg]{item projected}% \begin{pgfpicture}{0ex}{0ex}{1.5ex}{0ex} %\pgfcircle[fill]{\pgfpoint{0pt}{.75ex}}{1.25ex} \pgfbox[center,base]{\color{uibblue}\insertenumlabel.} \end{pgfpicture}% } [action] {\setbeamerfont{item projected}{size=\scriptsize}} \setbeamertemplate{enumerate item}[mycircle] \begin{document} %\setbeamertemplate{background} % {\includegraphics[width=\paperwidth,height=\paperheight]{slide_bg1}} %\setbeamertemplate{footline}[ifttheme] \mode&lt;presentation&gt; \begin{frame} \frametitle{Eulerian Salt Flux Decomposition} \only&lt;1-2&gt;{\begin{itemize} \item Subtidal Volume discharge rate $Q_f$: through a cross=section A \\ $Q_f = \langle\int u.dA \rangle$ \item Salt transport rate $F_s$ through a cross-section A \\ $F_s = \langle \int uS.dA \rangle$ \end{itemize}} \onslide&lt;2-&gt;Sub-tidal salt flux decomposed into three parts \onslide&lt;2-&gt;\begin{align*} F &amp; = \langle \int(u_0+u_E+U_T)(s_0+s_E+s_T)dA \rangle \\ &amp; \approx \langle \int(u_0s_0+u_Es_E+u_Ts_T)dA \rangle \\ &amp; = \redub{Q_fs_0}{\mathclap{\text{ River flow }}} + \redub{F_E}{\substack{\text{Exchange}\\\text{shear dispersion}}} + \redub{F_T}{\substack{\text{tidal osciallatory}\\\text{salt transport}}} \end{align*} \onslide&lt;3-&gt;\begin{itemize} \item $u_0$ and $s_0$ tidally and cross-sectionally averaged \item $u_E$ and $s_E$ tidally averaged and cross-sectionally varying \item $u_T$ and $s_T$ tidally and cross-sectionally varying \end{itemize} \end{frame} \begin{frame} \frametitle{Age of Water under dye from all Rivers} \only&lt;1-3&gt;{\begin{tikzpicture} \centering \node [](0,0)(start){ hello2}; % \draw [step=0.5cm,thin,dotted] (-5,-4) grid(5,4); % \node [circle]at (-4.5,0){0}; % \node [circle,radius=0.9cm,fill=red!30,] at (-4.5,0)(a){}; \draw [red,fill=red!30](-4.3,-0.2)circle(0.1cm); \draw [red,fill=red!30](-3.3,0)circle(0.1cm); \draw [red,fill=red!30](-2.5,-0.7)circle(0.1cm); \draw [red,fill=red!30](-4.,-0.8)circle(0.1cm); \draw [red,fill=red!30](-4.,-1.2)circle(0.1cm); \draw [red,fill=red!30](4.3,1.6)circle(0.1cm); \draw [red,fill=red!30](3.3,2.7)circle(0.1cm); \draw [red,fill=red!30](1.6,3.5)circle(0.1cm); \draw [red,fill=red!30](1.3,3.5)circle(0.1cm); \node [rectangle,text width=4cm,red] at (5.5,3) (return) {$Q_2 = 169 A^{0.616}$ \linebreak Mason et. al. 1998}; \node [rectangle,text width=4cm,red,visible on =&lt;2-&gt;] at (5,0) (return) {Smaller near the source \linebreak Increases away from the source}; \draw [red,visible on =&lt;3-&gt;](-3.3,-1.5) circle(0.7cm);%wolf bay small age \end{tikzpicture}} \only&lt;4-5&gt;{\begin{tikzpicture} \node [](0,0)(start){hello1}; % \draw [step=0.5,dotted](-5,-4) grid (5,4); \node [rectangle,text width=4cm,red] at (5,0) (return) {Scale different from \linebreak 2 year inflows}; \node [rectangle, text width =4cm, red,visible on =&lt;5-&gt;] at (5,-2) {Maximum age of 120 days}; \draw [red] (1.5,-1) ellipse(1cm and 0.6cm); \node [rectangle, text width=4cm, red] at (5,3) {Minimum 7 day flow over 10 yr. interval}; \end{tikzpicture}} % \only&lt;6-7&gt;{\begin{tikzpicture} \node [](0,0)(start){hello}; \node [rectangle, text width=4cm, red, visible on =&lt;7-&gt;] at (5,3) {Mean inflows over 10 yr. interval}; \end{tikzpicture}} \end{frame} \end{document} </code></pre>
0non-cybersec
Stackexchange
2,317
6,277
Is Dual-Wielding in 5E actually worth it?. So, my friends and I started a 5E campaign about 2 months ago. I'm a fighter, now lvl 4, and I've been really excited about dual-wielding greatswords further into the game (it would be awesome). However, since we are all terrible at remembering / figuring out combat rules, I didn't realize until this weekend that, no matter what happens, you can only get one offhand attack per turn (since it's a bonus action). So my question is, are there other benefits of dual-wielding that I'm not seeing? Or is it actually as terrible as it seems to be?
0non-cybersec
Reddit
146
587
More Sluggish Lagging Mouse. <p>Just added dual boot to my PC with a fresh Ubuntu 18.04 installation and found the mouse totally unusable but after rebooting it was fine. Today I briefly booted to Windows but when I went back to Ubuntu, it was sluggish again. After a reboot it was fine and the same wireless mouse on the same PC works fine with Windows 10.</p> <p>This is an older system so no USB 3 and I tried a wired USB mouse with no change to the problem. I read everything I could find on the problem which is apparently very common so is there a once-and-for-all fix?</p> <p>Some sources suggest removing and reinstalling half but that is not installed on this system. The keyboard is only slightly affected, missing the occasional keystroke and there are no other USB devices in use but when this starts happening, the mouse is too sluggish to even be usable.</p> <p>Additional info: I reinstalled Ubuntu, tried different desktops and updated everything that is updatable. Still, the problem that often requires multiple hard-boots to get it going. Sometimes the mouse is sluggish on the login screen; other times it’s fine there but becomes sluggish once the desktop appears. </p> <p>When sluggish, it takes several inches of physical mouse movement to move the cursor a small amount. On a second Ubuntu PC that has newer hardware, the symptoms are a bit different in that the mouse becomes jerky at times, clears itself after a while, then becomes jerky again. Clearly a bug. Two other 18.04 Ubuntu PC, each with different chipsets, also suffer similar issues.</p> <p>Can anyone help?</p>
0non-cybersec
Stackexchange
387
1,605
Cannot compile kernel driver on yocto. Hello Not sure this is the most suited subreddit, but I'll give it a try. I have written a very basic driver: https://paste.ubuntu.com/p/WwnSQPDgST/ Corresponding Makefile: https://paste.ubuntu.com/p/pNYk83yqnC/ This works perfectly fine. I am able to compile this **on my laptop** use it and can see my prints in dmesg. Yet when I now try to include that same code in my yocto image I get errors like "undefined reference tio iowrite32" and "undefined reference tio ioread32". This is the Makefile I use for yocto: https://paste.ubuntu.com/p/G2mq5mzTc2/ I don't understand why I am unable to compile. Could somebody explain me why I am having these errors? Some more files below. Recipe: https://paste.ubuntu.com/p/mb77kSv6zz/ complete compilation errors: https://paste.ubuntu.com/p/KrZ9QgKrsy/ Thanks
0non-cybersec
Reddit
274
853
Public DNS on domain-joined PCs. <p>I have a two-controllers AD domain, and all domain-joined PCs have their addresses as primary and secondary DNS servers.</p> <p>I wonder if I should configure a tertiary public DNS. The reasoning is that many PCs are located in smaller remote networks and they reach both domain controllers via a central VPN tunnel. If the VPN tunnel goes down, <em>both</em> DCs would be unavailable and the remote PCs will be unable to resolve <em>any</em> addresses, preventing them for surfing the internet/checking email/etc.</p> <p>Adding a DC in each network is out of question (they are of 5/10 PCs), and the same can be said about creating a direct VPN tunnel from the remote network to the secondary DC site (due to hardware capacity).</p> <p>A tertiary, public DNS server would prevent this, but I wonder if it can cause problems (ie: if it is, for some reason, selected as the preferred DNS, the PC would be "disconnected" from the domain).</p> <p>So: <em>it is ok to use a tertiary public DNS on a domain-joined PC, or it will cause problems? Anything to be aware of?</em></p>
0non-cybersec
Stackexchange
287
1,114
Hardy $Hp$ norm of similar function. <p>Let $f(z)=\sum_{n=0}^{\infty} \frac{c_n}{n+1}z^n$, where sequence $c_n \in S^1=\{z:|z|=1\}.$ We observe $H^p$ norm $\|f\|_{H_p}$, where $H^p$ is Hardy space, $1 \leq p &lt; \infty$.<br> Question: For the fix $p \geq 1$, determine $\min_{c_n \in S^1} \|f\|_{H^p}$ and $\max_{c_n \in S^1}\|f\|_{H^p}$ ?</p>
0non-cybersec
Stackexchange
160
345
Linux VM&#39;s connectivity dies when second network interface is brought up. <p>I'm in the middle of doing some testing on a mobile device, and want to test it from the network. The mobile device will only connect to networks via WiFi, and doesn't support ad-hoc mode, so I've set up an old WiFi router as an AP, which is connected via ethernet to a port on my laptop. The router operates under 192.168.0.0/24.</p> <p>My laptop is also connected to our normal network via another ethernet port. This network operates under 10.0.2.0/24, and provides internet connectivity.</p> <p>My laptop is running a VM which has two NICs, each bridged onto the two respective physical NICs. The 10.0.2.0 network is reachable via eth0, and the 192.168.0.0 network is reachable via eth1.</p> <p>The problem I'm having is that all connectivity drops as soon as I run <code>ifup eth1</code>. I've tried changing routing tables and adapter metrics, but have had no luck.</p> <p>Here's the output from <code>ifconfig -a</code>:</p> <pre><code>eth0 Link encap:Ethernet HWaddr 08:00:27:04:7a:b7 inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:fe04:7ab7/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:18135 errors:0 dropped:0 overruns:0 frame:0 TX packets:11076 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:12226743 (12.2 MB) TX bytes:1047606 (1.0 MB) eth1 Link encap:Ethernet HWaddr 08:00:27:96:cf:1c inet addr:192.168.0.5 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:fe96:cf1c/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1803 errors:0 dropped:0 overruns:0 frame:0 TX packets:1439 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:166923 (166.9 KB) TX bytes:118391 (118.3 KB) </code></pre> <p>Here's my routing table:</p> <pre><code>Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.0.1 0.0.0.0 UG 100 0 0 eth1 0.0.0.0 10.0.2.2 0.0.0.0 UG 100 0 0 eth0 10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 </code></pre> <p>And the output from <code>ip route</code>:</p> <pre><code>default via 192.168.0.1 dev eth1 metric 100 default via 10.0.2.2 dev eth0 metric 100 10.0.2.0/24 dev eth0 proto kernel scope link src 10.0.2.15 192.168.0.0/24 dev eth1 proto kernel scope link src 192.168.0.5 </code></pre> <p>Ideas? I'm not a Linux guy, so I'm stumped by this.</p> <hr> <p>Edit:</p> <pre><code># cat /etc/network/interfaces auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp auto eth1 iface eth1 inet dhcp auto eth2 iface eth2 inet dhcp auto ath0 iface ath0 inet dhcp auto wlan0 iface wlan0 inet dhcp </code></pre> <p>Output from <code>ip route</code> after dropping the <code>eth1</code> default route:</p> <pre><code>default via 10.0.2.2 dev eth0 metric 100 10.0.2.0/24 dev eth0 proto kernel scope link src 10.0.2.15 192.168.0.0/24 dev eth1 proto kernel scope link src 192.168.0.5 </code></pre>
0non-cybersec
Stackexchange
1,245
3,408
Completely clear all output from a Terminal window. <p>I would like to clear <strong>all</strong> output from a Terminal window (including all historical output) to get it back to a clean state as if you had just opened a new Terminal window, or a new Terminal tab.</p> <p>I can use the <code>clear</code> command to clear just the current screenful, but then you can still scroll up to see all the historical output. I'm using the Terminal to trace program output and at the end I would just like to do <KBD>⌘</KBD> + <KBD>A</KBD> to select all the text so I can grab the output from the just last run, without having to scroll up and see where it started. I could also just open a new tab, I was just wondering if this can be done in the same window? </p>
0non-cybersec
Stackexchange
200
759
Mario Kart Switch - What I'd like to see. I love Mario Kart as much as the next guy, but we have to come to terms with the fact that the series needs a bit of an overhaul. Here are a few things I would like to see: 1. A campaign: It doesn't have to be an incredibly lengthy one, just a fun way to unlock the characters/karts. I hated MK8 mechanic of collecting coins in order to unlock characters. All they need to do is throw in a vanilla story, create an over world from which you access the tracks/cups. Since Mario Kart is now introducing different franchises, they can section the overworld according to the characters you will unlock. Say the triforce cup, there you will unlock Toon link, toon zelda and Makar, so that section of the overworld will resemble Hyrule. At the send you have one crazy race which blends sections from each franchise found in the game against whichever villain they decide to put, etc. 2. Doubledash mode: This one speaks for itself 3. Weather mechanic/day & night cycle: Well, this couldn't apply to every track because some are indoors or in odd places, but it would be fun to have a weather mechanic that would affect the way you race. It changes up the formula a bit. 4. More unique characters: Let's stop with the Metal Marios, tanooki marios, etc. Any variation of an existing character should simply be a skin. 5. Outfits: Give us the chance to change up the clothes our characters wear via unlocking them in the campaign mode. 6. New Items: Since they are introducing characters from different franchises, lets bring on items from them. ie: From Zelda, we can bring the hookshot. When used, it latches on the person in front of you and pulls you towards them while bringing them to a complete stop. From Animal Crossing, the pitfall seed, this one would be hilarious as it would leave a little X on the track and if you run over it you get stuck for a few seconds. 7. Battle mode: Make it great again. And there it is! I know a lot of it as long shot, but who knows!
0non-cybersec
Reddit
487
2,018
What do you guys think of my HG team? Any suggestions/criticism?. I'm currently training for the Elite 4. Here's what I have right now: 37 Typhlosion; Charcoal; + Attack, - Spd -Focus Blast -Dig -Lava Plume -Fire Blast 35 Octillery; Mystic Water; Ability Sniper; + Defense, - Spd -Surf -Psybeam -Aurora Beam -Waterfall 34 Tauros; Silk Scarf; Ability Anger Point; neutral nature -Return -Horn Attack -Strength -Zen Headbutt 40 Mamoswine; Ability Snow Cloak; NeverMeltIce; + Attack, - Def -Ice Shard -Avalanche -Take Down -Earthquake 40 Espeon; Amulet Coin (probably switching for TwistedSpoon when i can get it); + Sp. Attack, - Def. -Flash -Shadow Ball - Psybeam -Swift 36 Magneton; Magnet; Ability Magnet Pull; + Sp. Attack, - Sp. Def. -Magnet Bomb -Thunder -Charge Beam -Sonicboom I put the levels in so you can see why I may not have certain moves yet. Obviously none of the movesets are really finalized. I'm least happy with Magneton, but it learns Discharge in a few levels, so that will help. What do you think? Any items, moves, other Pokemon you would recommend?
0non-cybersec
Reddit
384
1,108
How view owner of file on Windows XP with command line tools. <p>I use</p> <pre> cmd# dir uuid.vbs /q /s 15.08.2011 16:52 83 HOST\user uuid.vbs </pre> <p>but this not work for Windows shares which mounted by:</p> <pre> cmd# net use t: \\192.168.1.44\distr </pre> <p>It take output like:</p> <pre> cmd# dir wget.later /q /s 15.08.2011 09:16 66 ... wget.later </pre> <p>Also when in Explorer check Properties ==> Security you can see list of users/groups that have some permition for this file.</p> <p>How can I list owner or users/groups which have permition on file from command line? May be VB/JS-scrips allow this (as come starting from Win2000)?</p>
0non-cybersec
Stackexchange
242
718
edit and comment on a word document in a discernible way for another person. <p>There is a word document sent from a friend who asked me to correct grammar mistakes and vocabulary mistakes in it. I want the end result to be a word document with totally visible and easily discernible fixes, so that the other person can easily notice their mistakes without needing to open each and every comment. Are there any solutions other than choosing a different font color and styling, and other than commenting in word 2016 that could make it possible for me to do so? </p> <p>Consider this mistake: "the bar graph gives information the amount of rainfall in millimeter all throughout the year"</p> <p>I want to fix it like this: "the bar graph gives information <b>about</b> the amount of rainfall in millimeter<b>s</b> all throughout the year"</p> <p>I know that using html tags I can do that here in stackoverflow, but are there any solutions for fixing a document sent from another user, and letting that user notice those fixes done by you in a very straight-forward and easily noticeable way?</p>
0non-cybersec
Stackexchange
255
1,102
The domain of the function. <p>What is the domain of this function: <span class="math-container">$$f(x) = 2x^{5/3} + 5 x^{2/3}$$</span></p> <p>I think that it is <span class="math-container">$\mathbb R$</span>, but gnuplot plots it only as <span class="math-container">$x\ge0$</span>.</p> <p><strong>EDIT</strong> How to compute for negative <span class="math-container">$x$</span></p> <p><span class="math-container">$\frac{10}{3} x^{\frac{2}{3}}+\frac{10}{3}x^{-\frac{1}{3}}&gt;0$</span></p> <p><span class="math-container">$\frac{10}{3} x^{\frac{2}{3}}+\frac{10}{3}x^{-\frac{1}{3}}&lt;0$</span></p> <p><span class="math-container">$&gt;$</span> holds for <span class="math-container">$(-\infty;-1)$</span> and <span class="math-container">$&lt;$</span> holds for <span class="math-container">$(-1;0)$</span></p> <p>but I got the reverse result:</p> <p><span class="math-container">$x^{\frac{2}{3}} &lt; -x^{-\frac{1}{3}}$</span></p> <p><span class="math-container">$x &lt; -1$</span></p>
0non-cybersec
Stackexchange
398
999
Ubuntu 18.04 UI bug?. <pre><code>lsb_release -a Distributor ID: Ubuntu Description: Ubuntu 18.04.3 LTS Release: 18.04 Codename: bionic </code></pre> <p>I am not sure if this is an Ubuntu 18.04 bug because it also happens on my Intellij IDEA when I press <kbd>Ctrl</kbd>+<kbd>Space</kbd> for code auto complete.</p> <p><img src="https://i.stack.imgur.com/CJS97.png" alt="Image with bug"></p> <p>If you look at the image, the bookmark overlay description is now jumbled up with weird tab-like looking characters. These weren't there before for sure and an Ubuntu software update must have caused this. </p> <p>How do I fix this?</p> <p>EDIT 1: This happens in Firefox too.</p>
0non-cybersec
Stackexchange
230
688
How do I emulate a USB stick with an external CDROM drive?. <p>I am working with a Linux-based high-security network appliance (hereon: device) and do not have access to the user space so I can't log in. The only thing I can do is send it commands to upgrade through the USB port. It then reads the USB stick and starts the upgrade. I have been tasked to attempt to upgrade it without a USB stick but an external CDROM drive instead.<br><br>The USB stick must be less than 4GB and formatted with FAT32. Here is an example of a USB stick that the device recognizes:</p> <pre><code>[root@pitfall ~]# fdisk -l /dev/sdc Disk /dev/sdc: 15.6 GB, 15606349824 bytes 64 heads, 32 sectors/track, 14883 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x23ff8244 Device Boot Start End Blocks Id System /dev/sdc1 2 257 262144 b W95 FAT32 </code></pre> <p>I thought I could dd this USB partition and then manipulate the output in some way and burn it to a CD. Here is the file that resulted in that dd:</p> <pre><code>[root@pitfall ~]# file /tmp/dd_output /tmp/dd_output: x86 boot sector, mkdosfs boot message display, code offset 0x3c, OEM-ID " mkdosfs", sectors/cluster 8, root entries 512, Media descriptor 0xf8, sectors/FAT 256, heads 64, sectors 524288 (volumes &gt; 32 MB) , serial number 0xa740f5a9, label: " ", FAT (16 bit) </code></pre> <p>I am not sure how to trick the device into thinking that the external CDROM drive is a USB stick. I imagine it will involve mkisofs in someway, but from what I can tell this command doesn't support vfat.<br><br> Here is the dmesg output for the external CDROM drive:</p> <pre><code>ISO 9660 Extensions: Microsoft Joliet Level 1 ISOFS: changing to secondary root usb 2-2: USB disconnect, address 5 usb 2-2: new high speed USB device using ehci_hcd and address 7 usb 2-2: New USB device found, idVendor=1bcf, idProduct=0c31 usb 2-2: New USB device strings: Mfr=2, Product=3, SerialNumber=1 usb 2-2: Product: USB to Serial-ATA bridge usb 2-2: Manufacturer: Sunplus Innovation Technology. usb 2-2: SerialNumber: FFFFFFFEDF102230086505 usb 2-2: configuration #1 chosen from 1 choice scsi7 : SCSI emulation for USB Mass Storage devices usb-storage: device found at 7 usb-storage: waiting for device to settle before scanning usb-storage: device scan complete scsi 7:0:0:0: CD-ROM Slimtype DVD A DS8A5S WX13 PQ: 0 ANSI: 0 sr1: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray sr 7:0:0:0: Attached scsi CD-ROM sr1 sr 7:0:0:0: Attached scsi generic sg2 type 5 </code></pre>
0non-cybersec
Stackexchange
848
2,734
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Getting this error command /usr/bin/codesign failed with exit code 1 with xcode 9.1?. <p>I am getting this error </p> <pre><code>/Users/macbook/Library/Developer/Xcode/DerivedData/xxxxx-egjyfcyhdfcgftavbtoudbcgthja/Build/Products/Debug-iphoneos/xxxx.app: unknown error -1=ffffffffffffffff command /usr/bin/codesign failed with exit code 1 </code></pre> <p>with xcode 9.1/ios11.1 while building the application, earlier i was able to run my application smoothly. Any idea what could be the issue. I have already tried following steps:</p> <p>Deleting all the Derived Data.</p> <p>update all provisioning profile and certificates.</p> <p>But still no luck.</p>
0non-cybersec
Stackexchange
213
666
Denote $f(x)=\int_x^{x+1}\cos t^2 {\rm d}t.$Prove $\lim\limits_{x \to +\infty}f(x)=0.$. <h3>Problem</h3> <p>Denote <span class="math-container">$$f(x)=\int_x^{x+1}\cos t^2 {\rm d}t.$$</span>Prove <span class="math-container">$\lim\limits_{x \to +\infty}f(x)=0.$</span></p> <h3>Proof</h3> <p>Assume <span class="math-container">$x&gt;0$</span>. Making a substitution <span class="math-container">$t=\sqrt{u}$</span>,we have <span class="math-container">${\rm d}t=\dfrac{1}{2\sqrt{u}}{\rm d}u.$</span> Therefore, <span class="math-container">\begin{align*} f(x)&amp;=\int_x^{x+1}\cos t^2 {\rm d}t\\ &amp;=\int_{x^2}^{(x+1)^2} \frac{\cos u}{2\sqrt{u}}{\rm d}u\\ &amp;=\frac{1}{2\sqrt{\xi}}\int_{x^2}^{(x+1)^2}\cos u{\rm d}u\\ &amp;=\frac{\sin(x+1)^2-\sin x^2}{2\sqrt{\xi}}, \end{align*}</span> where <span class="math-container">$x^2 \leq \xi\leq (x+1)^2$</span>. Further, <span class="math-container">$$0\leq |f(x)|\leq \frac{|\sin(x+1)^2|+|\sin x^2|}{2\sqrt{\xi}}\leq \frac{1}{\sqrt{\xi}}\leq \frac{1}{x}\to 0(x \to +\infty),$$</span> which implies <span class="math-container">$f(x)\to 0(x \to +\infty)$</span>, according to the squeeze theorem.</p>
0non-cybersec
Stackexchange
506
1,150
Ethernet interface automatically re-enables after disabling manually. <p>I am trying to manually disable the eth0 interface, which should persist until the system is either rebooted or by manually enabling it. Unfortunately by either using</p> <pre><code>ip link set dev eth0 down </code></pre> <p>or</p> <pre><code>ifconfig eth0 down </code></pre> <p>the interface is down for a moment, around 2 to 15 seconds and than automatically starts enabling itself, giving the following message:</p> <pre><code>fec 2188000.ethernet eth0: Freescale FEC PHY driver [Atheros 8031 ethernet] (mii_bus:phy_addr=2188000.ethernet:00, irq=-1) [ 727.204693] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready </code></pre> <p>When plugging the ethernet cable out of the machine, the eth0 down does persist.</p> <p>After trying to do it with the commandline method, I also tried to dig into the ethernet driver based on this link: <a href="http://www.6by9.net/using-linux-sys-to-disable-ethernet-hardware-devices/" rel="nofollow noreferrer">http://www.6by9.net/using-linux-sys-to-disable-ethernet-hardware-devices/</a> </p> <p>But unfortunately there appears to be no "remove" file.</p>
0non-cybersec
Stackexchange
376
1,177
How to create horizontal dashline length of page inside description environment. <p>I want to create a horizontal dashline with the length of page margin using the <code>arydshln</code> package. I've read <a href="https://tex.stackexchange.com/questions/19902/drawing-horizontal-line-same-width-as-the-page-width">this</a> but when using <code>\hdashline[1pt/2pt]</code> I get an error. How should I implement <code>\hdashline</code> inside the description environment to get the same result. (It needs to be inside the description environement)</p> <p>My code is:</p> <pre><code>\documentclass{article} \usepackage{lipsum,comment,arydshln} \author{something} \title{something} \begin{document} \maketitle \begin{description} \item[something] \lipsum[20] \noindent\makebox[\linewidth]{\rule{\textwidth}{1pt}} \begin{comment} need a dashline here but I don't know how to implement \hdashline[1pt/2pt] here. Moreover, I need the line to cover the page from margin to margin. This doesn't achieve this \end{comment} \item[something] \lipsum[20] \end{description} \lipsum[20] \end{document} </code></pre> <p>I've realized that I can use <code>\hdashrule[0.5ex][c]{\linewidth}{1pt}{2pt}</code> But this doesn't cover the page from margin to margin.</p>
0non-cybersec
Stackexchange
405
1,319
How do I open an .sd image file. <p>I do support for a dental office and they recently asked me for help accessing their old files. They have dozens of CDs full of these image files.</p> <p>No one seems to know what program created them - it's a bunch of older completely computer illiterate people).</p> <p>The only clues I can find when opening the files in a text editor are: The first line says: Dentofacial Document 2.0 A bit further down it says: Dentofacial Picture Format 2.0</p> <p>I have tried the usual suspects like opening it in Paint, photoshop, illustrator, Acrobat, gimp, zip and iso programs. Anyone have any experience or suggestions? Or can maybe tell me the manufacturer of the software so I can contact them.</p>
0non-cybersec
Stackexchange
195
741
How to handle the repeat until convergence condition in time complexity and summarize the time complexity?. <p><a href="https://i.stack.imgur.com/zFxVt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zFxVt.png" alt="enter image description here" /></a></p> <p>I am a novice in complexity calculation. I need to calculate the overall time complexity.</p> <p>My attempt is given below:</p> <p>Here, N = number of data points (<code>N&gt;300</code>), C = Number of clusters (<code>2&lt;C&lt;30</code>)</p> <ol> <li><p>For line 3 to 10, time complexity, <code>TC1 = O(NC)</code></p> </li> <li><p>For line 11 to 12, time complexity, <code>TC2 = O(C)</code></p> </li> <li><p>For line 18 to 22, time complexity, <code>TC3 = O(N*N)</code></p> </li> <li><p>For line 24 to 26, time complexity, <code>TC4 = (how to handle the repeat until convergence- the highlighted section?) (Here, I think </code>TC4 = O(N*N)<code>)</code></p> </li> <li><p>For line 16 to 29, the overall time complexity, <code>TC5 = C(TC3+ TC4) = O(N*N*C)// not sure about it due to the lacking confidence in the value of TC4.</code></p> </li> <li><p>For line 31 to 35, time complexity, <code>TC6 = O(N*C*C)</code></p> </li> <li><p>For line 38 to 40, time complexity, <code>TC7 = O(NC)</code></p> </li> </ol> <p>So, finally, the overall time complexity <code>TC = TC1 + TC2 + TC5 + TC6 + TC7 = O(NC) + O(C) + O(N*N*C) + O(N*C*C) + O(NC) = O(?)</code> //How can I summarize this time complexity using Big-O.</p> <blockquote> <p>My Questions are:</p> <p>a) How to handle the highlighted portion when calculating the time complexity?</p> <p>b) How to summarize the overall time complexity?</p> </blockquote> <p>Please help.</p>
0non-cybersec
Stackexchange
629
1,704
What is absolute unique visitor in classical analytics?. <p>I have been coming across this term "Absolute Unique user". I can not find this in Google (Classical) Analytics. The closest definition I could find is <a href="http://www.webopedia.com/TERM/A/absolute_unique_visitor.html" rel="nofollow">this</a>.</p> <p>Is this a newly added metric in Universal Analytics? If so how can I find out "Absolute Unique user" via Google Analytics?</p> <p>How is different than "Unique Visitor"?</p> <p>Also I found <a href="http://www.dummies.com/how-to/content/google-analytics-absolute-unique-visitors-report.html" rel="nofollow">this</a> but for the life of me, I can not find this report. Is it a paid thing?</p>
0non-cybersec
Stackexchange
218
711
Kotlin: Method reference not working?. <p>It seems I'm unable to use a method reference of an object in Kotlin. This feature exists in Java.</p> <p>For example in Java if I was looping through a string to append each character to a writer:</p> <p><code>string.forEach(writer::append);</code></p> <p>But in Kotlin using the same syntax does not work because:</p> <p><a href="https://i.imgur.com/RQJy9GO.png" rel="noreferrer"><img src="https://i.imgur.com/RQJy9GO.png" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
167
515
Restore my browser&#39;s middle-click behaviour. <p>Some sites do annoying things with JavaScript, like replace the default behaviour of the browser to open a new tab on middle click, with code such as:</p> <pre><code>&lt;a href="http://stackoverflow.com" onclick="window.location.href='http://stackoverflow.com'; return false;"&gt; Stack Overflow&lt;/a&gt; </code></pre> <p>Is there any way I can give control back to my browser so that I'm the one that decides when a new tab gets opened or not? Right now I have to resort to either right clicking on the link and selecting <em>Open link in new tab</em>, or middle clicking on my browser's <em>Back</em> button after being rudely navigated away.</p>
0non-cybersec
Stackexchange
194
706
Comparisons of two random sums. <p>I now have two random sums $S_{N_1}\equiv\sum_{i=1}^{N_1}X_i$ and $S_{N_2}\equiv\sum_{i=1}^{N_2}Y_j$ where $N_1$ is dependent on $X_i$'s and $N_2$ on $Y_j$'s. In particular, $X_i$'s and $Y_j$'s are i.i.d. exponential random variable given the corresponding states (from a continuous time Markov) are known. And, yes, $X_i$'s and $Y_j$'s are inter-arrival times from two independent Markov-modulated Poisson processes.</p> <p>I want to know the probability that $$ \mathbb{P}\{S_{N_1} &lt; S_{N_2}\} $$ What am I supposed to begin with?</p> <p>A rough idea now I am having goes as follows. I first condition on $N_1$ and $N_2$ to get $$ \mathbb{P}\{S_{N_1} &lt; S_{N_2}\} = \sum_{N_1, N_2}\mathbb{P}\{S_{n_1} &lt; S_{n_2}\}\mathbb{P}\{N_1\}\mathbb{P}\{N_2\} $$ then, since $S_{n_1}$ and $S_{n_2}$ will be some distributions (not gamma since the rates in $X_i$'s or $Y_j$'s are distinct) given the CTMC states, I condition again on the states $$ \mathbb{P}\{S_{N_1} &lt; S_{N_2}\} = \sum_{N_1, N_2}\sum_{\mathcal{S}_{1},\mathcal{S}_{2}}\mathbb{P}\{S_{n_1} &lt; S_{n_2}\}K\mathbb{P}_{N_1}\mathbb{P}_{N_2} $$ where $K$ is some term resulting from the conditioning on the CTMC states. Up here, I have no idea how to proceed with the $\mathbb{P}\{S_{n_1} &lt; S_{n_2}\}$ with $S_{n_1}$ and $S_{n_2}$ are sums of exponentials with distinct rates.</p> <p>Any thoughts will be greatly appreciated</p>
0non-cybersec
Stackexchange
574
1,430
Need help solving a Venn Diagram. <p>I am trying to figure out how to solve this Venn diagram problem for my Discrete Mathematics class. So the problem goes like this:</p> <p>In a school there are 420 students. 300 of them have gone to school by car, 80 of them walking, 120 on a bicycle, 46 in a car and walking, 26 in a car and a bicycle, 36 walking and a bicycle, but 22 of them have neither used a car, bicycle or walked.</p> <p>a) How many students come to school by car, walking and cycling? b) How many students come on a bicycle and walking but not car?</p> <p>I just can't find a way to find the missing x in the middle I need to find</p>
0non-cybersec
Stackexchange
180
651
Xubuntu 20.04 LTS Cant Change Login-Screen Resolution (Thinkpad P50). <p>I recently got a ThinkpadP50 with a fresh Xubuntu 20.04 LTS install</p> <ul> <li>CPU: Intel i7-6820HQ (8) @ 3.600GHz</li> <li>GPU: NVIDIA Quadro M1000M, using nvidia-driver-440</li> </ul> <p>However, I'm having an issue where my lock screen resolution and theme doesn't match or sync to my desktop environment (Xfce). It does this with other distros as well. (ive tried debian and manjaro)</p> <p><strong>Also an important note</strong>: when my computer locks from going idle, the lock screen is perfectly fine and there's no issue. It'll match whatever resolution and themes I have set. The problem only occurs when shutting down, locking, restarting, etc.</p>
0non-cybersec
Stackexchange
220
739
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Inequality involving CDF and PDF of Standard Normal Distribution. <blockquote> <p>For the standard normal density function <span class="math-container">$f$</span>, show that <span class="math-container">$f'(x) + xf(x) = 0$</span>. Hence show that for <span class="math-container">$x&gt;0$</span>, <span class="math-container">$$\frac{1}{x}-\frac{1}{x^3} &lt; \frac{1-F(x)}{f(x)} &lt; \frac{1}{x}-\frac{1}{x^3}+\frac{3}{x^5}.$$</span></p> </blockquote> <p>The first part is fine. The inequality is what's bugging me.</p> <p><span class="math-container">$F(x)$</span> is the CDF of the standard normal distribution where <span class="math-container">$f(x)$</span> is the PDF and <span class="math-container">$F^\prime(x)=f(x)$</span>, so it's given by <span class="math-container">$$F(x) = \frac{1}{\sqrt{2\pi}}\int_{0}^{x}e^{-\frac{x^2}{2}}dx.$$</span></p> <p>This is the integral of a Gaussian function and as far as I know it cannot be computed if there isn't an infinite limit somewhere (correct me if I'm wrong).</p> <p>I have no idea where to start. I tried messing around with limits but to no avail. This probably has something to do with some kind of Analysis theorem, and Analysis is <strong>not</strong> my strong point.</p> <p>Any help would be much appreciated.</p>
0non-cybersec
Stackexchange
426
1,284
$X$ connected in the order topology $\Rightarrow$ every $A\subset X$ that has an upper bound has a supremum. <p>I have to prove</p> <blockquote> <p>$X$ connected in the order topology (w.r.t. a linear order &lt;) $\Rightarrow$ every $A\subset X$ that has an upper bound has a supremum</p> </blockquote> <p>My attempt:</p> <p>Reason by contradiction: take $A\subset X$ with an upper bound but no supremum. It follows that $A$ has no maximal element, and that there are infinite increasing sequences $(x_1,x_2,...)$ in $A$, and an infinite sequence $(y_1,y_2,...)$ of upper bounds on $A$. We then consider $$A_&lt;=\bigcup_{a\in A}\{x\in X|x&lt;a\}$$ $$A_&gt;=\bigcup_{a\text{ an upper bound on $A$}}\{x\in X|a&lt;x\}$$ These are both open in the order topology. It is not hard to verify that these sets partition $X$ and that they are also closed. This way we exhibit $X$ as the union of $2$ separated components, which is a contradiction.$\square$</p> <p>Since I'm self studying and have no answers of the exercises I just want to verify this answer. I'm most interested in the validity of my reasoning related to the upper-bound stuff (the existence of the infinite sequences and such). Thanks.</p>
0non-cybersec
Stackexchange
369
1,208
determining if a tail event. <p>I am to determine if $$\{\sup X_n &lt; \infty \}$$ is a tail event, the solutions are as follows:</p> <p><a href="https://i.stack.imgur.com/N9Rdl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/N9Rdl.png" alt="enter image description here"></a></p> <p>I don't understand how they got the line of equalities, specifically the last one, and why it holds for all $M$ and $n$.</p>
0non-cybersec
Stackexchange
149
430
Why would g++ compiled code write beyond stack pointer?. <p>To better understand assembly, I compiled a simple C++ program using g++ and then used gdbgui to step through the execution. I made a graphic of the state of the stack and registers at several consecutive points in the program to help myself better understand exactly what was going on. It appears that the program writes/reads at memory beyond the stack pointer several times during execution. This surprised me. I was under the impression that a program should never write beyond the stack pointer. I understand how it works, the relative addressing is based off of the base pointer, but I would've expected the program to adjust the stack pointer in some way to encompass the memory it planned on using. Is this method of writing beyond the stack a common technique for compilers?</p> <p>C++:</p> <pre><code>#include &lt;iostream&gt; int square(int i) { i = i * i; return i; } int main() { int i = square(2); } </code></pre> <p>Compiled on Ubuntu 19.10 with:</p> <pre><code>g++ -o square_2 square_2.cpp </code></pre> <p>g++ version:</p> <pre><code>g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:hsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.2.1-9ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 9.2.1 20191008 (Ubuntu 9.2.1-9ubuntu2) </code></pre> <p>Relevant assembly from gdb:</p> <pre><code>0x55555555516d push rbp 0x55555555516e mov rbp,rsp 0x555555555171 mov DWORD PTR [rbp-0x4],edi 0x555555555174 mov eax,DWORD PTR [rbp-0x4] 0x555555555177 imul eax,eax 0x55555555517a mov DWORD PTR [rbp-0x4],eax 0x55555555517d mov eax,DWORD PTR [rbp-0x4] 0x555555555180 pop rbp 0x555555555181 ret </code></pre> <p><a href="https://i.stack.imgur.com/TwUBf.png" rel="noreferrer">Execution Trace</a></p> <p>I used yellow highlighting to indicate when a value was updated, and green highlighting to show which memory contents the stack pointer is currently pointing at.</p> <p><a href="https://i.stack.imgur.com/fx61Q.png" rel="noreferrer">gdbgui screenshot</a></p>
0non-cybersec
Stackexchange
1,097
3,177
For the past six months, I've been going to the gym without paying for a membership. [No regrets] I work an office job and the only time I'm able to work out is right at 5 AM (opening time). During my first three days (guest pass) I noticed there is no one watching the front desk because the one front desk opener is either washing down windows or cleaning. Every day since then, I've walked in right at 5 AM to work out. The staff always waves me in with a hearty "Good Morning!". You'd think they'd realize, but I think they hate their jobs and don't care. I am ready to pay whatever I owe, but want to see how long I can get away with it.
0non-cybersec
Reddit
163
647
PostgreSQL using COALESCE or other Conditional Expressions to SET field. <p>I have a PostgreSQL v10 DB with the following values:</p> <pre><code>CREATE TABLE test ( id INT, custom_fields jsonb not null default '{}'::jsonb, guest_profile_id character varying(100) ); INSERT INTO test (id, custom_fields) VALUES (1, '[{"protelSurname": "Smith", "servicio_tags": ["protel-info"], "protelUniqueID": "[{\"ID\":\"Test1-ID\",\"Type\":\"21\",\"ID_Context\":\"GHA\"}{\"ID\":\"4842148\",\"Type\":\"1\",\"ID_Context\":\"protelIO\"}]", "protelGivenName": "Seth"}, {"value": "Test", "display_name": "Traces", "servicio_tags": ["trace"]}, {...}]'); INSERT INTO test (id, custom_fields) VALUES (2, '[{"protelSurname": "Smith", "servicio_tags": ["protel-info"], "protelUniqueID": "[{\"ID\":\"Test2-ID\",\"Type\":\"21\",\"ID_Context\":\"GHA\"},{\"ID\":\"4842148\",\"Type\":\"1\",\"ID_Context\":\"protelIO\"}]", "protelGivenName": "Seth"}, {"value": "Test2", "display_name": "Traces", "servicio_tags": ["trace"]}, {...}]'); INSERT INTO test (id, custom_fields) VALUES (3, '[{"value": "Test3-ID", "display_name": "Test", "servicio_tags": ["profile-id"]}, {...}]'); INSERT INTO test (id, custom_fields) VALUES (4, '[{"value": "Test4-ID", "display_name": "Test", "servicio_tags": ["person-name"]}, {...}]'); </code></pre> <p>I have a query, which works and saves values from the custom_field row to the guest_profile_id column in the same row:</p> <pre><code>UPDATE guest_group SET guest_profile_id = ( SELECT x -&gt;&gt; 'ID' FROM jsonb_array_elements(custom_fields) AS field, jsonb_array_elements((field -&gt;&gt; 'protelUniqueID') :: jsonb) AS dd(x) WHERE value @&gt; '{"servicio_tags": ["protel-info"]}'::jsonb AND x-&gt;&gt;'ID_Context' = 'protelIO' ); </code></pre> <p>But this only works for the first two rows. Therefor I want to use the next query-snippets in order to copy Test3-ID in row 3 to the guest_profile_id column and Test4-ID in row 4 to the guest_profile_id column.</p> <p>1.</p> <pre><code>SELECT field -&gt;&gt;'value' cross join lateral jsonb_array_elements(custom_fields) AS field WHERE value @&gt; '{"servicio_tags": ["profile-id"]}'::jsonb </code></pre> <p>2.</p> <pre><code>SELECT field -&gt;&gt;'value' cross join lateral jsonb_array_elements(custom_fields) AS field WHERE value @&gt; '{"servicio_tags": ["person-name"]}'::jsonb </code></pre> <p>My problem: I do not know how to use <code>COALESCE</code> or other Conditional Expressions in order to chain those small queries. Because this should be possible if the first query uses <code>NULL</code> to set the field, <code>COALESCE</code> should help me to ignore this value and jump to the next query-snippet.</p> <p>Desires result: I want that all the TestX-ID values from the table above are copied to the <code>guest_profile_id</code> column into the same row.</p> <p>My try: </p> <pre><code> UPDATE test SET guest_profile_id = COALESCE(( SELECT x -&gt;&gt; 'ID' FROM jsonb_array_elements(custom_fields) AS field, jsonb_array_elements((field -&gt;&gt; 'protelUniqueID') :: jsonb) AS dd(x) WHERE value @&gt; '{"servicio_tags": ["protel-info"]}'::jsonb AND x-&gt;&gt;'ID_Context' = 'protelIO'),( SELECT field -&gt;&gt;'value' cross join lateral jsonb_array_elements(custom_fields) AS field WHERE value @&gt; '{"servicio_tags": ["profile-id"]}'::jsonb),( SELECT field -&gt;&gt;'value' cross join lateral jsonb_array_elements(custom_fields) AS field WHERE value @&gt; '{"servicio_tags": ["person-name"]}'::jsonb)); </code></pre> <p>Gives me: </p> <blockquote> <p>ERROR: syntax error at or near "cross" LINE 9: cross join lateral jsonb_array_elements(custom_fields) ...</p> </blockquote> <p>Thanks a lot for the help!</p>
0non-cybersec
Stackexchange
1,321
3,785
Keep tabbing within modal pane only. <p>On my current project we have some modal panes that open up on certain actions. I am trying to get it so that when that modal pane is open you can't tab to an element outside of it. The jQuery UI dialog boxes and the Malsup jQuery block plugins seem to do this but I am trying to get just that one feature and apply it in my project and it's not immediately obvious to me how they are doing that.</p> <p>I've seen that some people are of the opinion that tabbing shouldn't be disabled and I can see that point of view but I am being given the directive to disable it.</p>
0non-cybersec
Stackexchange
148
613
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Hibernate @ManyToOne Referenced Class using @NaturalId instead of @Id. <p>I have some Hibernate/JPA annotations (still don't know the difference to be honest) that are allowing me to create an association class. This class is combining two items that are related into one object. I originally was using <code>@JoinTable</code> but realized I needed a lot more meta data with the associations, so had to convert the code over into another object type.</p> <p>For now I am using <code>@Id</code> to mark the <code>ID</code> column for my objects, and using <code>@NaturalId (mutable = false)</code> for a <code>String uuid</code>.</p> <p>My association class is using <code>@ManyToOne</code> and creates the table just fine, but when I look into it the table is using the <code>@Id</code> field as the mapping column. I would prefer to have this association class use the <code>@NaturalId uuid</code> for ease of transferring relationship/associations across to other systems.</p> <p>How can I get the relationship to use the correct identifier?</p> <p>For reference, my DB's and Java code look like this:</p> <pre><code>AssociationsTable ---------------------------------------------- | ID | META DATA | ID ASSOC. 1 | ID ASSOC. 2 | ---------------------------------------------- | 1 | stuff | 1 | 2 | ---------------------------------------------- Objects ------------------------------ | ID | META DATA | UUID | ------------------------------ | 1 | stuff | FOO-123 | ------------------------------ | 2 | stuff | BAR-456 | ------------------------------ Association Class{ ObjA main; ObjA sub; @ManyToOne getMain() @ManyToOne getSub() } ObjA Class{ Long id; @Id @GeneratedValue(generator="increment") @GenericGenerator(name="increment", strategy = "increment") @XmlElement @Column(name = "ID", unique = true, nullable = false) getId() String uuid; @NaturalId (mutable = false) @GeneratedValue(generator = "uuid") @GenericGenerator(name = "uuid", strategy = "uuid2") @Column(name = "uuid", unique = true) getUUID() } </code></pre>
0non-cybersec
Stackexchange
596
2,130
problem with setting up multiboot ISO usb using syslinux. <p>I have followed this tutorial: <a href="http://blog.jakgibb.com/2013/01/03/creating-a-multiboot-usb-stick-using-syslinux/" rel="nofollow">http://blog.jakgibb.com/2013/01/03/creating-a-multiboot-usb-stick-using-syslinux/</a></p> <p>I want to boot linux live ISOs directly from USB drive using syslinux instead of method provied here: <a href="http://www.pendrivelinux.com/boot-multiple-iso-from-usb-via-grub2-using-linux/" rel="nofollow">http://www.pendrivelinux.com/boot-multiple-iso-from-usb-via-grub2-using-linux/</a></p> <p>Here is my syslinux.cfg:</p> <pre><code>default vesamenu.c32 prompt 0 timeout 300 menu title Geek USB menu background /bg.png MENU TABMSG Created by Salman MENU WIDTH 72 MENU MARGIN 10 MENU VSHIFT 3 MENU HSHIFT 6 MENU ROWS 15 MENU TABMSGROW 20 MENU TIMEOUTROW 22 menu color title 1;36;44 #66A0FF #00000000 none menu color hotsel 30;47 #C00000 #DDDDDDDD menu color sel 30;47 #000000 #FFFFFFFF menu color border 30;44 #D00000 #00000000 std menu color scrollbar 30;44 #DDDDDDDD #00000000 none label HardDisk menu label Continue to Boot from ^First HD (default) KERNEL chain.c32 APPEND hd1 MENU DEFAULT label MY menu label ^MY loopback loop /ubuntu-12.04.3-desktop-i386.iso linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/ubuntu-12.04.3-desktop-i386.iso noeject noprompt splash -- initrd (loop)/casper/initrd.lz label MIX menu label ^MIX insmod loopback insmod iso9660 set isofile="/ubuntu-12.04.3-desktop-i386.iso" loopback loop $isofile kernel (loop)/casper/vmlinuz append boot=casper initrd=(loop)/casper/initrd.lz splash -- label MIX2 menu label ^MIX2 set isofile="/ubuntu-12.04.3-desktop-i386.iso" loopback loop $isofile kernel (loop)/casper/vmlinuz append boot=casper live-media-path=(loop)/casper/ file=(loop)/preseed/ubuntu.seed initrd=(loop)/casper/initrd.lz splash -- label MIX3 menu label ^MIX3 loopback loop /ubuntu-12.04.3-desktop-i386.iso kernel (loop)/casper/vmlinuz append boot=casper live-media-path=(loop)/casper/ file=(loop)/preseed/ubuntu.seed initrd=(loop)/casper/initrd.lz splash -- </code></pre> <p>My USB is booting and syslinux is working and boot menu (<strong>syslinux.cfg</strong>) is displaying fine but menus are not working, don't know why? No menu is booting ubuntu-12.04.3-desktop-i386.iso. The worst part is that no error is coming when I select a menu and hit enter, screen blinks and return to main menu.</p> <p>What is wrong with my code?</p>
0non-cybersec
Stackexchange
911
2,582
Two colors in one text field using Actionscript 3. <p>Is it possible to have two text colors in one text field using Actionscript 3.0? </p> <p>ex: how can i make like the first string black and the second string red?</p> <p>Here is my code when using a single color:</p> <pre><code> public function logs(txt) { if (txt == '') { textLog.text = "Let's Open up our treasure boxes !!!"; } else { textLog.text = '' + txt + ''; } textLog.x = 38.60; textLog.y = 60.45; textLog.width = 354.50; textLog.height = 31.35; textLog.selectable = false; textLog.border = false; var format:TextFormat = new TextFormat(); var myFont:Font = new Font1(); format.color = 0x000000; format.font = myFont.fontName; format.size = 18; format.align = TextFormatAlign.CENTER; format.bold = false; textLog.embedFonts = true; textLog.setTextFormat(format); this.addChild(textLog); } </code></pre>
0non-cybersec
Stackexchange
328
1,081
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
How do I select a cell range using the keyboard while editing a formula?. <p>When your typing a formula, you can hit one of the arrow keys to select a cell with your keyboard:</p> <p><a href="https://i.stack.imgur.com/ZpTXx.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZpTXx.jpg" alt="enter image description here"></a></p> <p>That's nifty because you don't have to reach for your mouse to select a cell. However, while editing a function after you've already typed it out, you can't select a cell with your keyboard (I can understand if excel blocks out the left and right arrow keys because it'd then be confusing for the program to know whether I want to move the cursor within the active cell or whether I'm trying to move out of the cell to select a range -- but why block the up and down keys as well?)</p> <p>So, when you're trying to edit a function, say, like here where I want to change the cell "D5" by clicking on a appropriate cell), you can't use your keyboard:</p> <p><a href="https://i.stack.imgur.com/7FsR8.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7FsR8.jpg" alt="enter image description here"></a></p> <p>Any workarounds?</p>
0non-cybersec
Stackexchange
351
1,197
In ActiveDirectory, how are security audit events transmitted to the Domain Controller&#39;s event log? How does the mechanism scale?. <p>In a multi-domain-setting, I want to collect security file access audit events at a central place.</p> <p>In ActiveDirectory, it is possible to enable file access auditing at the Domain Controller by creating a GPO. Additionally, at a different 'file server' computer, that is a member of one of the domains, a SACL has to be configured at the file system objects that I want to be audited (and that are included in a network share).</p> <p>Once this is done, the file access events are recorded and somehow magically transfered to the event log of the domain controller.</p> <p>I would really like to know:</p> <ul> <li>How and when are these events transfered? Is the transfer encrypted?</li> <li>Is it possible to directly select another (additional) receiver of those events, apart from the domain controller? I know that it is possible to forward those log events later on, but are they by default forwarded to the Domain Controller? Is there an implicit forwarding configured?</li> <li>How much traffic is going to be generated, with respect to network load?</li> </ul>
0non-cybersec
Stackexchange
303
1,222
Beamer: how to keep an image at its location while using only to uncover text. <p>This question is essentially the same as one of my <a href="https://tex.stackexchange.com/questions/424116/beamer-displaying-four-images-how-to-pre-allocate-space-for-the-first-image">earlier one</a>, except the only difference is that I am using "only" to change the text at the same location (i.e., <a href="https://tex.stackexchange.com/questions/109677/latex-beamer-how-to-uncover-formulas-text-at-a-location-of-an-ununcovered-fo">this question</a>). In other words, I am destroying my earlier text as I go, and not adding new ones underneath the previous ones. </p> <p>Since the text for the first "only" is shorter than the second "only", therefore the image will shift location. I would like for the image to remain at its location. </p> <p>Here is an example <a href="https://i.stack.imgur.com/LKZFR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LKZFR.png" alt="enter image description here"></a></p> <p><a href="https://i.stack.imgur.com/Kf2P3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kf2P3.png" alt="enter image description here"></a></p> <p>it may not be obvious but the second image is higher up than the first.</p> <p>The code is here, can someone find a solution?</p> <pre><code>\documentclass{beamer} \usepackage{graphicx} \title[Title]{Presentation} \author{Sandro Botticelli} \institute{Italy} \date{1484} \begin{document} \begin{frame} \begin{figure} \includegraphics[scale = 0.8]{Venus} \caption{Nascita di Venere} \end{figure} \only&lt;1&gt;{In the centre the newly-born goddess Venus stands nude in a giant scallop shell. Its size is purely imaginary, and is also found in classical depictions of the subject. } \only&lt;2&gt;{Alternative identifications for the two secondary female figures involve those also found in the Primavera; the nymph held by Zephyr may be Chloris, a flower nymph he married in some versions of her story, and the figure on land may be Flora. Flora is generally the Roman equivalent of the Greek Chloris; in the Primavera Chloris is transformed into the figure of Flora next to her, following Ovid's Fasti, but it is hard to see that such a transformation is envisaged here.} \end{frame} \end{document} </code></pre>
0non-cybersec
Stackexchange
734
2,315
Calculate $2^{-1000000}(\frac{5+3\sqrt{3}}{i}-\frac{1}{1+\sqrt{3}i})^{999999}$. <p>what's an easy way to calculate</p> <p>$2^{-1000000}(\frac{5+3\sqrt{3}}{i}-\frac{1}{1+\sqrt{3}i})^{999999}$ ?</p> <p>My idea is that it must somehow be possible to merge -1000000 and 999999 to 1, but I just can't figure out what to do!</p> <p>I would be glad if someone could solve this riddle!</p>
0non-cybersec
Stackexchange
151
385
Why is $-1&gt;0$ not enough?. <blockquote> <p><strong>Theorem</strong>: Prove that no order can be defined in the complex field that turns it into an ordered field.</p> <p><strong>Proof</strong>: Suppose complex field is an ordered field. So, either <span class="math-container">$i$</span> or <span class="math-container">$-i$</span> must be positive. Suppose <span class="math-container">$i&gt;0$</span>. Hence <span class="math-container">$i^2=-1&gt;0$</span>, but then <span class="math-container">$(-1)^2=1&gt;0$</span>. But this is contradiction as both <span class="math-container">$x$</span> and <span class="math-container">$-x$</span> cannot be true in an ordered field, where <span class="math-container">$x$</span> belongs to that ordered field.</p> </blockquote> <p>My question: Why was <span class="math-container">$-1&gt;0$</span> not itself a contradiction an end of the proof?</p>
0non-cybersec
Stackexchange
283
897
Reload Vim highlight setting and colorscheme. <p>If I change Vim's <code>highlight</code> setting, how do I "reload" it for colorschemes to take effect?</p> <p>So, in my case, I remove <code>highlight</code>'s cursor line number—</p> <pre><code>se hl-=N:CursorLineNr </code></pre> <p>Changing <code>highlight</code> from—</p> <blockquote> <p>highlight=8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:Mor eMsg,M:ModeMsg,n:LineNr,<strong>N:CursorLineNr</strong>,r:Question,s:StatusLine,S:StatusLineNC,c:Vert Split,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:D iffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:Spel lCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine, #:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn</p> </blockquote> <p>To</p> <blockquote> <p>highlight=8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:Mor eMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v :Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffCh ange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRar e,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_: TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn</p> </blockquote> <p>(I've emphasized the change.)</p> <p>But the cursor line number is still "highlighted"!</p> <p>Changing <code>highlight</code> doesn't update the colorscheme—so how do I "force" an update? I've tried setting syntax coloring off then on again and changing colorschemes to no avail.</p> <p>(Cross-posted from <a href="https://stackoverflow.com/questions/14213381/reload-vim-highlight-setting-and-colorscheme">StackOverflow</a>.)</p>
0non-cybersec
Stackexchange
752
1,898
Solving Recurrence Relation with substitution. <p>How to solve T(n) = T(n-2) + n using iterative substitution</p> <pre><code>Base case: T(0) = 1 T(1) = 1 Solve: T(n) = T(n-2) + n </code></pre> <p>Currently I have:</p> <pre><code>T(n) = T(n-2) + n = T(n-4) + n - 2 + n = T(n-4) + 2n - 2 = T(n-6) + n - 4 + n - 2 + n = T(n-6) + 3n - 6 = T(n-8) + n - 6 + n - 4 + n -2 + n = T(n-8) + 4n - 12 = T(n-10) + n - 8 + n - 6 + n - 4 + n - 2 + n = T(n-10) + 5n - 20 </code></pre> <p>The pattern I see is: </p> <p>$$\ T(n-2 \sum_{i=1}^k i) + n \sum_{i=0}^k i - \sum_{i=0}^{k-1} i(i+1) $$</p> <p>but this may be wrong because I am completely stuck after this</p>
0non-cybersec
Stackexchange
343
676
Numerical integration over a surface of a sphere. <p><img src="https://i.stack.imgur.com/UFKd6.jpg" alt="enter image description here"></p> <p>I am integrating a double integral in spherical coordinates over the surface of a sphere in MATLAB numerically. Although I have changed the relative and absolute tolerance I get the feeling that this algorithm never terminates. And when I checked the values of my function that MATLAB had evaluated everything looked fine, no huge oscillations, no singularities. </p> <p>Do you know whether there are other algorithms that I could use which work faster and still give me reliable results?</p> <p>So the sphere sits at $(0,0,0)$ and has a radius of $10^{-6}$. Don't be confused that the $y$-component is not shown, I took this one as being fixed in order to plot this.</p> <p>Okay, maybe I define my problem a little bit better: I want to perform this integration as fast as possible with an accuracy that should be about $10^{-1}$ or $10^{-2}$, this is sufficient. Of course, I thought about adding this lower precision to the integral2 function, but still, this function is so slowly that it is useless for what I am currently doing here.</p>
0non-cybersec
Stackexchange
291
1,191
$|S_X|=|S_Y| \Leftrightarrow |X|=|Y|$. <p>Reading <a href="https://math.stackexchange.com/questions/73566/if-omega-1-2-3-cdots-then-s-omega-is-an-infinite-group">this problem</a> I remembered trying to solve the following problem. For a set $A$, denote by $S_A=\{ f : A \to A | f \text{ is bijective }\}$. Denote by $|X|$ the cardinal number of $|X|$.</p> <blockquote> <p>Prove that for two sets $X,Y$ we have $|X|=|Y| \Leftrightarrow |S_X|=|S_Y|$.</p> </blockquote> <p>I didn't manage to solve the case where $X,Y$ are infinite, and don't even know how to start. I tried to represent $X$ as a subset of $Y$( if $|X|&lt;|Y|$) and maybe find a permutation in $S_Y \setminus S_X$.</p>
0non-cybersec
Stackexchange
258
687
I contributed to the death of my friend.. No, I did not deliberately murder him, or even harm him in any way. I wish that was the case though, because then at least I could process my emotions and know for certain that I did, in fact, kill my friend. Back in 2005, I was a 16 year old kid living in London, UK, and was therefor in "Secondary school", which is the equivalent of High School in the U.S. For those who do not know, 15 to 16 year olds here are expected to sit their GCSE examinations during this time, which can add a lot of pressure to a young mans life. At this time, I was trying to come to terms with my sexuality and the fact that I was bisexual. And so, when, in about February or march, my friend called me a "Fag", I was understandably very hurt. It messed me up, since I had felt that I might be able to come out to him in the future. Being young and dumb, I stormed off and left him there in the yard. Two days went by, and I refused to speak to him, until one night when he calls me on the phone. I pick it up, and he sounds really upset; more upset than id ever heard him before. Now, I was still angry, and thought that, if I hung up, I would be in a better position to talk to him the next day. So, when he said "I need to speak to you", I put the phone down with a smug, childish sense of satisfaction creeping over my face. Then, I went to bed. Well, he wasn't there the next day, which was unusual, and I began to panic thinking that it had been something serious. Later that day, when I returned home, my mum seemed very upset and immediately sat me down. My friend had hung himself, after swallowing a large amount of hard proof vodka. There. I said it, something I've never said to anyone before. The guilt is just horrible. If there is anything I've learnt, its this; The punishment for murder is not the jail time, it is the guilt of knowing that you played a part in the ending of someone's life.
0non-cybersec
Reddit
477
1,941
Automatically delete git branch after merge to master. <p>We will be attempting a work flow in github where every ticket is a branch off of master.<br> After the ticket is complete, the work is merged into staging where regression and integration tests are performed before it is merged into master.</p> <p>A team lead brought up the issue of the old ticket branches after a merge will start to build up. </p> <p>I found <a href="http://clauswitt.com/Removing-Unused-git-branches-Automatically.html" rel="noreferrer">this</a> script and want to know if this would work in our environment. We only want to delete branches that have been merged into master.</p>
0non-cybersec
Stackexchange
169
662