text
stringlengths
36
35k
label
class label
2 classes
source
stringclasses
3 values
tokens_length
int64
128
4.1k
text_length
int64
36
35k
Problem to understand the proof : $\forall \varepsilon &gt;0, \exists \delta &gt;0: m(E)&lt;\delta \implies \int_E|f|&lt;\varepsilon $. <p>Let <span class="math-container">$f\in L^1(\mathbb R^d)$</span>. Then, for all <span class="math-container">$\varepsilon &gt;0$</span> there is <span class="math-container">$\delta &gt;0$</span> s.t. for all measurable set <span class="math-container">$E\subset \mathbb R^d$</span> s.t. <span class="math-container">$m(E)&lt;\delta $</span>, we have <span class="math-container">$$\int_E|f|&lt;\varepsilon .$$</span></p> <hr> <p>The proof goes as follow : let <span class="math-container">$\varepsilon &gt;0$</span> and set <span class="math-container">$F_n=\{x\mid |f|\leq n\}$</span>. Set <span class="math-container">$f_N(x)=f(x)\boldsymbol 1_{F_n}$</span>. Then <span class="math-container">$|f_N|$</span> is an increasing and non negative sequence. By Monotone convergence theorem, there is <span class="math-container">$N$</span> s.t. <span class="math-container">$$\int (|f|-|f_N|)&lt;\frac{\varepsilon }{2}.$$</span></p> <p>Let <span class="math-container">$\delta &gt;0$</span> s.t. <span class="math-container">$\delta N&lt;\frac{\varepsilon }{2}$</span>. Then, if <span class="math-container">$m(E)&lt;\delta $</span>, <span class="math-container">$$\int_E|f|\leq \int(|f|-|f_n|)+\int_{E}|f_N|\leq \frac{\varepsilon }{2}+Nm(E)\leq \varepsilon .$$</span></p> <hr> <p>My problem : I have doubt with this proof since for me <span class="math-container">$\delta $</span> depend on <span class="math-container">$\varepsilon $</span> (of course) and <span class="math-container">$N$</span> (that's not good since <span class="math-container">$\delta $</span> should depend on <span class="math-container">$\varepsilon $</span> only). Don't we have a problem ? (it's an official solution, so the solution should be correct). Could someone explain ?</p>
0non-cybersec
Stackexchange
647
1,901
IF EXIST C:\directory\ goto a else goto b problems windows XP batch files. <p>whenever i run the <code>code</code> below it occurs to me I have made a mistake using the if exist lines, as no matter whether the directory exists or not, it acts as if the line was never there... either that or its not reading the else line.</p> <hr> <pre><code>echo off echo echo (c) Ryan Leach 2010 echo Stockmaster Backup System for exclusive use of Riverland Paper Supplies echo echo Please ensure that all computers are out of stock master to the windows xp screen echo and that the backup usb with the day of the week labeled on it is inserted pause IF EXIST D:\RPS_BACKUP\backups_to_zip\ goto zipexist else goto zipexistcontinue :zipexist IF EXIST d:\RPS_BACKUP\backups_old\ rd /s /q D:\RPS_BACKUP\backups_old echo backup did not complete last time, backup will restart from zip-usb phase. pause call zip goto tidyup :zipexistcontinue IF EXIST D:\RPS_BACKUP\backups_old\ goto oldexists else oldexistscontinue :oldexists IF EXIST d:\RPS_BACKUP\backup_temp\ rename D:\RPS_BACKUP\backups_temp backups_to_zip rd /s /q D:\RPS_BACKUP\backups_old echo backup did not complete last time, backup will restart at the zip to usb phase. pause call zip goto tidyup :oldexistscontinue IF EXIST D:\RPS_BACKUP\backups_temp\ goto tempexists else goto tempexistscontinue :tempexists IF EXIST D:\RPS_BACKUP\backups_old\ goto backupfailed else goto tempexistscontinue :backupfailed @rd /s /q D:\RPS_BACKUP\backups_temp echo backup did not complete last time, backup will restart from start. pause :tempexistscontinue md D:\RPS_BACKUPS\backups_temp xcopy \\user1\c\* D:\RPS_BACKUP\backups_temp\user1\c /h /e /z /f /r /i /s /k IF NOT ERRORLEVEL == 1 GOTO ErrorHandler xcopy C:\* D:\RPS_BACKUP\backups_temp\user2\c /h /e /f /r /i /s /k IF NOT ERRORLEVEL == 1 GOTO ErrorHandler xcopy \\user3\c\* D:\RPS_BACKUP\backups_temp\user3\c /h /e /z /f /r /i /s /k IF NOT ERRORLEVEL == 1 GOTO ErrorHandler call sub call zip :tidyup rename D:\RPS_BACKUP\backups_to_zip backups pause goto :eof :ErrorHandler echo xcopyerrorcode is ERRORLEVEL contact ryan pause </code></pre>
0non-cybersec
Stackexchange
775
2,233
Double Integral, spectrum integrated density. <p>Good Afternoon,</p> <blockquote> <p>I am trying to understand this equality :</p> <p><span class="math-container">$$ \mathbb E \left [ \int_{-1/2}^{1/2} \int_{-1/2}^{1/2} d Z^*(f) d Z(f') \right ] = \int_{-1/2}^{1/2} d S^{(I)} $$</span></p> </blockquote> <p>where <span class="math-container">$*$</span> stands for the complex conjugate, and where the <span class="math-container">$dZ^*$</span> and <span class="math-container">$dZ$</span> are orthogonal processes (and <span class="math-container">$L_1$</span> obviously for convergence sake), in other words :</p> <p><span class="math-container">$$ \mathbb E \left [ dZ^*(f) dZ(f') \right ] = 1_{f = f'} dS^{(I)}(f) $$</span></p> <p>my concern is that I have the impression the above equality is "kind of" the same as:</p> <p><span class="math-container">$$ \int_{-1/2}^{1/2} \int_{-1/2}^{1/2} 1_{x=y} dx dy ( = 0) = \int_{-1/2}^{1/2} dx (\neq 0) $$</span></p> <p>Can someone explain me why is the first equality true, and if there is any bit of information missing please let me know.</p>
0non-cybersec
Stackexchange
402
1,105
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
Angular 5: Passing dynamic class name to &quot;select&quot; attribute of ng-content. <p>I'm following <a href="https://dzone.com/articles/simplifying-content-projection-in-angular" rel="nofollow noreferrer">THIS</a> tutorial article to test how Angular Projection works. In this article I came across <code>select</code> attribute of <code>ng-content</code>, to which we can pass <code>class name</code> or <code>attribute</code> to select and target a particular <code>ng-content</code>.</p> <p>Eg:</p> <pre><code>@Component({ selector: 'greet', template: ` &lt;ng-content select=".headerText"&gt;&lt;/ng-content&gt; &lt;ng-content select="btnp"&gt;&lt;/ng-content&gt; ` &lt;greet&gt; &lt;h1 class="headerText"&gt;Hello&lt;/h1&gt; &lt;/greet&gt; &lt;greet&gt; &lt;button btnp&gt;Click Here&lt;/button&gt; &lt;/greet&gt; </code></pre> <p>The above example works fine. But, now what I want is to dynamically pass a class name to select like:</p> <pre><code>&lt;ng-content select=".headerText{{some_id}}"&gt;&lt;/ng-content&gt; </code></pre> <p>But, when I attempt this, I get error:</p> <blockquote> <p>Can't bind to 'select' since it isn't a known property of 'ng-content'.</p> </blockquote> <p>How can I achieve this?</p>
0non-cybersec
Stackexchange
457
1,254
SQLiteConstraintException error showing after start of every activity. <p>I have this error popping out in logcat all the time. It always shows after every change of activity. And sometimes, the app disappears and in a second it shows again. There is not any fatal error in logcat, all I see is this:</p> <pre><code>2020-05-20 11:53:26.422 2940-8484/? E/SQLiteDatabase: Error inserting flex_time=3324000 job_id=-1 period=6650000 source=16 requires_charging=0 preferred_network_type=1 target_class=com.google.android.gms.measurement.PackageMeasurementTaskService user_id=0 target_package=com.google.android.gms tag=Measurement.PackageMeasurementTaskService.UPLOAD_TASK_TAG task_type=0 required_idleness_state=0 service_kind=0 source_version=201516000 persistence_level=1 preferred_charging_state=1 required_network_type=0 runtime=1589968406417 retry_strategy={"maximum_backoff_seconds":{"3600":0},"initial_backoff_seconds":{"30":0},"retry_policy":{"0":0}} last_runtime=0 android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: pending_ops.tag, pending_ops.target_class, pending_ops.target_package, pending_ops.user_id (code 2067 SQLITE_CONSTRAINT_UNIQUE) at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method) at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:879) at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:790) at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:88) at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1599) at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1468) at aplm.a(:com.google.android.gms@[email protected] (120406-309763488):76) at aplb.a(:com.google.android.gms@[email protected] (120406-309763488):173) at aplb.a(:com.google.android.gms@[email protected] (120406-309763488):21) at aplb.a(:com.google.android.gms@[email protected] (120406-309763488):167) at aphk.run(:com.google.android.gms@[email protected] (120406-309763488):8) at sob.b(:com.google.android.gms@[email protected] (120406-309763488):12) at sob.run(:com.google.android.gms@[email protected] (120406-309763488):7) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at sub.run(:com.google.android.gms@[email protected] (120406-309763488):0) at java.lang.Thread.run(Thread.java:919) </code></pre> <p>But it does not show anywhere to the code is there any solution to it?</p> <p>Edit: Google libraries:</p> <pre><code>implementation 'com.google.android.material:material:1.1.0' implementation 'com.google.firebase:firebase-core:17.1.0' implementation 'com.google.firebase:firebase-database:19.0.0' implementation 'com.google.firebase:firebase-analytics:17.0.1' implementation 'com.google.firebase:firebase-perf:19.0.0' implementation 'com.google.android.gms:play-services-ads:18.1.1' </code></pre>
0non-cybersec
Stackexchange
1,068
3,109
Prevention of devices using same OTP secret. <p>I have a requirement of OTP applications on mobile devices not sharing the same secret (even if the mobile devices are owned by the same user). A single secret must be present in a single device.</p> <p>Open source applications that implement OTP (like Google Authenticator and FreeOTP) do not satisfies my requirement: the secret is not device unique, due the fact that I can scan the QR-Code with more than one device and backend never will know about that. I think it is not something related with the application itself, but with the RFC 4226 that not specifies this requirement.</p> <p>So I thought about a process to mitigate the risk of users using OTP secret in more than one device (need internet connection - not a requirement be offline). The steps:</p> <ol> <li>App generate unique secret protection key on first execution</li> <li>App send the secret protection key to the server</li> <li>Server generate a unique secret for app</li> <li>Server encrypt the secret using the secret protection key from the app and return the blob to the app</li> <li>App decrypt the info using the generated key and starts to generate OTPs</li> <li>Both encrypted secret and secret protection key would be storaged on app</li> </ol> <p>I know that this approach is not tamper-proof and the secret could be restored from storage but would be more difficult.</p> <p>About all explained here, my questions are:</p> <ul> <li>Would be a good approach exchange OTP's secret through web, even if it is protect by TLS?</li> <li>Is the unique secret protection adding security or a flaw to the process?</li> <li>Would be possible to achieve a similar result in a offline sync?</li> <li>Is there open source frameworks to achieve a better protection of the secret key (<em>i.e.</em> not exposing directly to user, like QR-Code does)?</li> </ul>
0non-cybersec
Stackexchange
477
1,884
My mediawiki page displayed index of/ after updating to apache 2.4.23. <p>I had this problem with MediaWiki after updating apache At first, i installed using yum and i had apache 2.4.6, php 5.4 on my Centos7</p> <p>Then i want to update them to latest version which is apache 2.4.23 and PHP 7.0 Until now, the only way to update apache is using source code. I removed the 2.4.6 and install new 2.4.23</p> <p>Btw, the old DocumentRoot is /var/www/html After updating, the new DocumentRoot is /usr/local/apache2/htdocs I copy all the MediaWiki file from old documentroot to new documentroot. But when i access the server's IP, i just saw the index of/ and list of MediaWiki file. How should i fix this?</p>
0non-cybersec
Stackexchange
217
707
Finding the sample space and the event space.. <p>A number of n digits is randomly generated. Find the probability that the number is a numerical palindrome.</p> <p>How do you denote the sample space of this problem?</p> <p>My try.</p> <p><span class="math-container">$\Omega = \{a_1a_2a_3...a_n\} $</span></p> <p>a) I wasn't sure whether to write it with commas or not. I mean <span class="math-container">$\Omega = \{a_1,a_2,a_3...,a_n\}$</span></p> <p>The event space, <span class="math-container">$F = P(\Omega)$</span>, where P denotes the power set. And its cardinality <span class="math-container">$$|P(\Omega)|=2^{10^n}$$</span></p>
0non-cybersec
Stackexchange
223
646
Creating a second EDMX file never runs the Entity Data Model Wizard. <p>I am trying to add a second connection in my project, and I went through the steps: got the connection string, confirmed I could access it, planned the location in the solution.</p> <p>I did an Add .. New .. Data .. Entity Framework 6.x dbContext Generator The hour glass ran for a minute, then it returned to the solution without any information collection and no EDMX record was created. It created all of the files that would normally go under the edmx file though. Including the file that has a pointer name back to the edmx file. </p> <p>This is in Visual Studio 2015. I also removed and reinstalled Entity Framework and tried using EF 5.x instead of 6.x in two separate projects with no EF in the main project. No change in behaviour.</p> <p>So does anyone know what could cause this and how to get around it so that I can get this last step completed?</p> <p>Thanks, Michael</p>
0non-cybersec
Stackexchange
245
966
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
Add an Image from url into custom InfoWindow google maps v2. <p>I'm am working in an android app. The user make a search at google maps for restaurants. In google map display markers for all of his neighbor's restaurant. If he tap at a marker it show up a custom InfoWindow. My problem is that I can't load the image that return form Google places. Im getting right the url of image but I can't show it at Window.</p> <p>InfoWindow</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" android:background="@color/bg_color" &gt; &lt;ImageView android:id="@+id/place_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:focusable="false"" /&gt; &lt;TextView android:id="@+id/place_title" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;TextView android:id="@+id/place_vicinity" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:background="@color/bg_color" &gt; &lt;RatingBar android:id="@+id/place_rating" style="?android:attr/ratingBarStyleSmall" android:numStars="5" android:rating="0" android:isIndicator="false" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="5dip" /&gt; &lt;ImageView android:id="@+id/navigate_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:focusable="false" android:src="@drawable/navigate" /&gt; &lt;/LinearLayout&gt; </code></pre> <p></p> <p>On create i have this</p> <pre><code>mGoogleMap.setInfoWindowAdapter(new InfoWindowAdapter() { // Use default InfoWindow frame @Override public View getInfoWindow(Marker arg0) { return null; } // Defines the contents of the InfoWindow @Override public View getInfoContents(Marker arg0) { // Getting view from the layout file info_window_layout View v = getLayoutInflater().inflate(R.layout.info_window_layout, null); // Getting the snippet from the marker String snippet = arg0.getSnippet(); // Getting the snippet from the marker String titlestr = arg0.getTitle(); String cutchar1= "%#"; String cutchar2= "%##"; String ratingstr = snippet.substring(0,snippet.indexOf( cutchar1 )); String vicinitystr = snippet.substring(snippet.indexOf( cutchar1 )+2, snippet.indexOf( cutchar2 ) ); String iconurl= snippet.substring(snippet.indexOf( cutchar2 )+3); // Getting reference to the TextView to set latitude TextView title = (TextView) v.findViewById(R.id.place_title); TextView vicinity = (TextView) v.findViewById(R.id.place_vicinity); ImageView image = (ImageView) v.findViewById(R.id.navigate_icon); // Setting the latitude title.setText(titlestr); // declare RatingBar object RatingBar rating=(RatingBar) v.findViewById(R.id.place_rating);// create RatingBar object if( !(ratingstr.equals("null")) ){ rating.setRating(Float.parseFloat(ratingstr)); } vicinity.setText(vicinitystr); final DownloadImageTask download = new DownloadImageTask((ImageView) v.findViewById(R.id.place_icon) ,arg0); download.execute(iconurl); // Returning the view containing InfoWindow contents return v; } </code></pre> <p>});</p> <p>and the DownloadImage code is:</p> <pre><code>private class DownloadImageTask extends AsyncTask&lt;String, Void, Bitmap&gt; { ImageView bmImage; Marker marker; boolean refresh; public DownloadImageTask(final ImageView bmImage, final Marker marker) { this.bmImage = bmImage; this.marker=marker; this.refresh=false; } public void SetRefresh(boolean refresh ){ this.refresh=true; } /* @Override protected void onPreExecute() { super.onPreExecute(); bmImage.setImageBitmap(null); }*/ @Override protected Bitmap doInBackground(String... urls) { String urldisplay = urls[0]; Bitmap mIcon11 = null; try { InputStream in = new java.net.URL(urldisplay).openStream(); mIcon11 = BitmapFactory.decodeStream(in); } catch (Exception e) { Log.e("Error", e.getMessage()); e.printStackTrace(); } return mIcon11; } @Override protected void onPostExecute(Bitmap result) { if(!refresh){ SetRefresh(refresh); bmImage.setImageBitmap(result); marker.showInfoWindow(); } } } </code></pre> <p>Finally when I execute the code and tap the marker the getInfoContents doesn't stop execute and the icon does not appear. </p> <p>Why this happen?</p>
0non-cybersec
Stackexchange
1,503
5,629
ElGamal like encryption. <p>How can I approach the following exercise:</p> <p><img src="https://i.stack.imgur.com/eWx3r.png" alt="enter image description here"></p> <p>Source: An Introduction to Mathematical Cryptography by Hoffstein</p> <p>This exercise describes an approach similar to ElGamal cryptosystem with a numerical example, and in order to solve it, one should do some "reverse-engineering" and find a ay how to deduce a general algorithm from the example given.</p> <p>I copied the entire text so that you get some extra context of this task. I don't know in which relationship are the exponents.</p> <p>The only conclusion I've managed to made is: $m ^{ a \cdot b \cdot a' \cdot b' } = m$ with $m, a$ and $b$ defined as above and $a'= 15619$ and $b'=31883$.</p> <p>One can be very fast trapped to think of an obvious solution - namely that $a$ and $a'$ are inverses in $\mathbb{Z}_p$, but they are not because: $gcd(3589,32611) = 1 = 822*32611 - 7469*3589 \Rightarrow - 7469 = 25142 (\mod 32611)$ and $25142$ is not equal to $15619$. </p> <p>(This also means that I was barking barking up the wrong tree saying that $aa'$ and $bb'$ are such numbers that $\exists k: m^{ k \varphi ( p + 1 )} mod p = 1$, ie $m^{(aa')(bb')} mod p =m$ => $k \varphi ( p + 1 ) = aa'bb'$, where $\varphi(n)$ is defined like in the Euler Theorem. This is wrong because we should be able to calculate a' without any knowledge about b).</p>
0non-cybersec
Stackexchange
449
1,436
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Proof that every polygon has at least 2 ears. <p>I had this question asked a few weeks ago and gave an argument that involved finding an ear and clipping it, professor said it was not quite the correct answer and that I lacked some insights.</p> <p>How would you prove this? I'm not allowed to use the dual graph of a triangulation, because given that any polygon has at least 2 ears, then we can triangulate the polygon by ear clipping. </p> <p><strong>So how can I prove that every polygon has at least 2 ears?</strong></p>
0non-cybersec
Stackexchange
134
528
When to write software project documentation on code. <p>I usually write my software projects in java, and I am still a bit confused as to when to document my classes, interfaces and methods.</p> <p>There are two ways:</p> <p><strong>1)</strong> Write documentation after declaring or coding a class/interface/method/constructor. This way I am sure documentation is handled immediately.</p> <p><strong>Disadvantage:</strong> I might modify the arguments of a method/constructor or I might modify the functionality of the class or interface and forget to edit the documentation.</p> <p><strong>2)</strong> Write documentation after finishing the project (or a major finish/version of the project), this way I am sure to document the full functionality/arguments of methods/constructors as well as documenting all exceptions thrown.</p> <p><strong>Disadvantage:</strong> It usually becomes another great overwhelming task to go through hundreds of classes and methods at the end of the project, trying to write documentation code.</p> <p>As you can see both scenarios have their disadvantages but I think one is more advantageous than the other. I am puzzled as to which. Also I am not implying this to Java alone, it can be applied to any programming language that requires documentation.</p>
0non-cybersec
Stackexchange
292
1,298
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
Analysis of Coupon Collector variant with diminishing probabilities of finding a new coupon. <p>The variant of this Coupon Collector problem can be defined like so. Suppose you initially have exactly one of <span class="math-container">$n$</span> different types of coupons in a pile. The probability of grabbing a coupon of type <span class="math-container">$i$</span> at any moment is equal to the number of coupons of type <span class="math-container">$i$</span> in the pile, divided by the total number of coupons. Clearly, at the start, each type of coupon might be obtained with probability <span class="math-container">$1/n$</span>. However, suppose at some turn you select coupon <span class="math-container">$i$</span>. That coupon of type <span class="math-container">$i$</span> will then be put back in the pile <em>and</em> you will add into the pile a new coupon of type <span class="math-container">$i$</span>. This implies that there's one more coupon of type <span class="math-container">$i$</span> in the pile than before and the total number of coupons in the pile has increased by one.</p> <p>The goal, given these dynamics, is to find the number of turns until you have seen all the coupons at least once. Interestingly, it can be shown that the expected number of turns is unbounded, which makes sense since you become more likely to see a coupon you've seen before and less likely to see a coupon you've never seen. So instead of bounding the expected number of turns, instead we want to know the number of turns such that we see all the coupons with probability <span class="math-container">$\geq 1/2$</span>. More specifically, define <span class="math-container">$X_n$</span> as the number of turns needed to find the <span class="math-container">$n^{th}$</span> distinct coupon. Our goal is to find some values <span class="math-container">$t_l$</span> and <span class="math-container">$t_u$</span> such that <span class="math-container">$P(X_n \leq t_u ) \geq 1/2$</span> and <span class="math-container">$P(X_n \geq t_l) \geq 1/2$</span>.</p> <p>If one goes through the work to model these dynamics, one can find that the probability that <span class="math-container">$X_n = s$</span> for some <span class="math-container">$s$</span> can be described by</p> <p><span class="math-container">\begin{align} P(X_n = s) &amp;= \frac{n(n-1)}{s(s+1)} \prod_{i=2}^{(n-1)} \frac{(s-i)}{(s+i)} \end{align}</span></p> <p>This distribution can be checked against a simple Monte Carlo (MC) styled approach, and so below is the analytical distribution versus the MC computed distribution for <span class="math-container">$n=5$</span> (with the domain cropped for visualization purposes).</p> <p><a href="https://i.stack.imgur.com/fPY2I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fPY2I.png" alt="Monte Carlo Results vs Analytical Distribution"></a></p> <p>Now using this distribution, we can readily obtain the probability functions we need to find values for <span class="math-container">$t_l$</span> and <span class="math-container">$t_u$</span>. More precisely, we have that</p> <p><span class="math-container">\begin{align} P(X_n \leq t_u ) &amp;= n(n-1)\sum_{s=n}^{t_u} \frac{\prod_{i=2}^{(n-1)}(s-i)}{s \prod_{i=1}^{(n-1)} (s+i)}\\ P(X_n \geq t_l) &amp;= n(n-1) \sum_{s=t_l}^{\infty} \frac{\prod_{i=2}^{(n-1)}(s-i)}{s \prod_{i=1}^{(n-1)} (s+i)} \end{align}</span></p> <p>What I've tried to do from here is find some tight enough lower bounds on the above quantities and then find values for <span class="math-container">$t_u$</span> and <span class="math-container">$t_l$</span> such that those lower bounds equal <span class="math-container">$1/2$</span>. However, I've been finding that most of the lower bounds I try to use are not tight enough, so I end up not being able to find some value for say <span class="math-container">$t_u$</span> such that the lower bound I find can even be equal to <span class="math-container">$1/2$</span>. For example, let me show one bound I obtained that is unable to work for finding <span class="math-container">$t_u$</span>. First notice that <span class="math-container">$f(s) = \frac{(s-i)}{(s+i)}$</span> is an increasing function for at least <span class="math-container">$s &gt; i$</span>. Using this fact, we can bound things in the following way</p> <p><span class="math-container">\begin{align} P(X_n \leq t_u ) &amp;= n(n-1)\sum_{s=n}^{t_u} \frac{\prod_{i=2}^{(n-1)}(s-i)}{s \prod_{i=1}^{(n-1)} (s+i)} \\ &amp;\geq \frac{n(n-1) \prod_{i=2}^{(n-1)}(n-i)}{\prod_{i=2}^{(n-1)} (n+i)} \sum_{s=n}^{t_u} \frac{1}{s(s+1)} \\ &amp;= \frac{n(n-1)(n-2)!}{(2n-1)\cdots(n+2)} \left(\frac{t_u}{1 + t_u} - \frac{(n-1)}{n}\right) \tag{since $\sum_{i=1}^t \frac{1}{i(i+1)} = \frac{t}{1+t}$} \\ &amp;= \underbrace{\frac{2n(n+1)}{\binom{2n}{n}}}_{\dagger}\underbrace{\left(\frac{t_u}{1 + t_u} - \frac{(n-1)}{n}\right)}_{\ddagger} \end{align}</span></p> <p>Sadly, this result is unusable because the <span class="math-container">$\dagger$</span> term is very small for large <span class="math-container">$n$</span>, while the <span class="math-container">$\ddagger$</span> term grows very slowly, so a value for <span class="math-container">$t_u$</span> that allows this overall bound to grow above <span class="math-container">$1/2$</span> is enormous. I also tried to approach this lower bound by investigating the product terms and finding the partial fraction decomposition. One interesting fact I proved by induction was that</p> <p><span class="math-container">\begin{align} \frac{\prod_{i=2}^m(s-i)}{\prod_{i=1}^m(s+i)} &amp;= \sum_{i=1}^m \frac{a_i}{(s+i)} \end{align}</span></p> <p>with <span class="math-container">$\sum_{i=1}^m a_i = 1$</span> for all <span class="math-container">$m&gt;1$</span>. I also proved to myself the following claim:</p> <p><span class="math-container">\begin{align} \sum_{s=1}^t \frac{1}{s(s+i)} = \frac{1}{i}\left(H_t + H_i - H_{(t+i)}\right) \end{align}</span></p> <p>where <span class="math-container">$H_n$</span> is the Harmonic number. These results can allow us to obtain that</p> <p><span class="math-container">\begin{align} P(X_n \leq t_u ) &amp;= n(n-1)\sum_{s=n}^{t_u} \frac{\prod_{i=2}^{(n-1)}(s-i)}{s \prod_{i=1}^{(n-1)} (s+i)} \\ &amp;= n(n-1)\sum_{s=n}^{t_u} \frac{1}{s} \sum_{i=1}^{(n-1)} \frac{a_i}{(s+i)} \\ &amp;= n(n-1) \sum_{i=1}^{(n-1)} a_i \sum_{s=n}^{t} \frac{1}{s(s+i)} \\ &amp;= n(n-1) \sum_{i=1}^{(n-1)} \frac{a_i}{i} \left(H_t + H_i - H_{(t+i)}\right) \end{align}</span></p> <p>The dilemma with this is I had not worked out exact representations for <span class="math-container">$a_i$</span> but when you start to do so, you realize about half the terms are positive and half negative, with a wide range of magnitudes. Not sure how to best approach bounding this.</p> <p>This leaves me with my question. Does anyone have any tips or thoughts on how to approach getting a relatively tight bound for these probabilities? Or better, any ideas for how to find <span class="math-container">$t_u$</span> and <span class="math-container">$t_l$</span> that require no bounding of their corresponding probability distributions?</p>
0non-cybersec
Stackexchange
2,434
7,181
String comparison with list/array of variables. <p>Is it possible to do a string comparison with a list/array of variables?</p> <p>Here is my example code, ticking the defined <code>\currentbox</code>:</p> <pre><code>\documentclass{standalone} \usepackage[most]{tcolorbox} \makeatletter % DEFINE BOX WITH GIVEN NAME \newcommand\mybox[1]{% \ifnum\pdf@strcmp{\unexpanded{#1}}{\currentbox}=0 % \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi {\setlength\fboxsep{0pt}\colorbox{teal}{\framebox(18,10){\textbf{\color{white}#1}}}} {\framebox(18,10){\textbf{#1}}}% } \makeatother % define current box \def\currentbox{B} \begin{document} \begin{tcbitemize}[size=fbox, colframe=white, colback=white, raster equal height, raster force size=false, raster equal skip=0pt, raster columns=4] \tcbitem[width=0.20\linewidth] \mybox{A} \tcbitem[width=0.20\linewidth] \mybox{B} \tcbitem[width=0.20\linewidth] \mybox{C} \tcbitem[width=0.20\linewidth] \mybox{D} \end{tcbitemize}% \end{document} </code></pre> <p>So if <code>\currentbox</code> is a list/array containing 'A' and 'B' and it is possible to <code>strcmp</code> if it is in a list/array, this would generate:</p> <p><a href="https://i.stack.imgur.com/c583J.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c583J.png" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
536
1,594
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
Help with first credit card. So I'm 27 and don't have a credit card. Graduating College within the next year and will be moving out. So I need to build credit. Thinking about using one for gas and food - paying monthly. I use Bank of America and would like to get a card from them, but I was overwhelmed on their websites. So man options for cards! Maybe a student card with cash rewards? Also I live at home at the moment and don't pay rent. Currently work part-time and school full-time and I bet I make like only 6-8k a year. Do I seriously put 8k for wage and $0 for rent. I'm planning and hoping to land a job within the next year and possible sooner that pays much more then my current situation. Also I'll probably be paying at least $500 rent by next year. I really new this credit cards, but Ive been told I need to have at least one. Maybe I should just talk with someone at my bank for help?
0non-cybersec
Reddit
238
920
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
Please don't upvote -- just some noob questions. So I'm in my mid 20s and I've never cared to watch any games before, but this year is totally changed. I guess I got some kind of bug. Anyway, I'm from Dallas but I don't feel like I want to make the cowboys "my team." So who do ya'll think would be more fun to watch. Additionally, I like to read up on stuff, so what are your go-to resources to pick up info/stats/plays etc for the season? **Edit:** Holy shit dudes. Thanks so much, this has been a great help. Also, I told yall not to upvote. Assholes. **P.S.** --I am going to be watching the Boys tonight to see how they do, but I do really like the idea of rooting for the Skins. Also, the Texans and Packers are high in my esteem, so I'll be keeping an eye on all of thems. But who knows, maybe I'll wind up liking the Raiders :P Thanks again everyone.
0non-cybersec
Reddit
239
864
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
Applying a function in each row of a big PySpark dataframe?. <p>I have a big dataframe (~30M rows). I have a function <code>f</code>. The business of <code>f</code> is to run through each row, check some logics and feed the outputs into a dictionary. The function needs to be performed row by row.</p> <p>I tried:</p> <p><code> dic = dict() for row in df.rdd.collect(): f(row, dic) </code></p> <p>But I always meet the error OOM. I set the memory of Docker to 8GB.</p> <p>How can I effectively perform the business?</p> <p>Thanks a lot</p>
0non-cybersec
Stackexchange
187
549
TIFU by suffering explosive diarrhea while my car drove itself into a fast food restaurant. Obligatory "this didn't actually happen today." I don't remember when it was exactly, but it had to have been around 2001. I'm posting this because I posted it as a comment on an earlier post, and a few people told me they thought my story was WAY worse than the original and deserved its own TIFU... And yes, what follows is verbatim what I wrote over there. I was in the fast food drive-thru (building on one side, curb and hedge row on the other - i.e. I can't pull out of line) when my stomach started its death moans... Apparently it was anticipating what was to come and trying to warn me off. The car in front of me finally moves, I gun it past the window without picking up (or paying for) my food, and almost literally skid sideways into the handicapped spot (illegally) RIGHT outside the door closest to their bathroom. I'm struggling to keep it in at this point, but if I don't get out NOW I'm gonna fertilize the interior of my truck. I get out of the truck and am doing the best I can to sprint for the door while simultaneously clenching my ass muscles as tightly as humanly possible... I made it to the door before the dam broke... There was a massive trail of liquid shit from the door all the way into the bathroom, and by the time I got my pants down and sat on the toilet I was empty. Not one drop ended up in the toilet. I did the best I could to clean myself and the bathroom up (let's face it, there's no "cleaning up" in a public restroom after an event like this) and make a bee-line for the door. I opened the bathroom door and there stood a very unhappy store manager and a police officer. Behind them was my truck. Sitting inside the entry of the restaurant. In my desperation I forgot to put it in park before I got out and it drove itself through the doors just a few seconds behind me. Not only did I get tickets for parking in the handicapped spot illegally, and for careless operation of a motor vehicle (for not putting it in park), but I also then had to explain to a judge (and my insurance company) that it all happened while I was shitting myself running through a restaurant, and not because I'm a careless idiot or drunk. The judge actually laughed at me and said "I don't even care if it's made up, that's the best excuse I've ever heard!" He dismissed the tickets, which saved me a few hundred dollars. My insurance company was not as amused... **TL;DR** I shit my pants and all over the floor of a restaurant while my truck drove itself through the front doors. I got tickets, the judge laughed at me before dismissing them, and my insurance company fought hard to avoid paying for the damages. **Edit:** formatting **Edit 2:** This is now my top post... Glad I could make a few people smile, even though it was at the expense of my dignity. **Edit 3:** You did it Reddit! Thank you for completely ruining my internet anonymity! Apparently this hit the front page some time in the early morning hours while I was sleeping. I woke up to a text from a good friend who recognized the story, and its taken a considerable bribe to convince him not to tell EVERYONE I know. In any case, thanks everyone for enjoying my most embarrassing moment, and thanks for the support. I laugh about it now (and you all probably will too for a long time), but those were definitely the most mortifying moments of my life.
0non-cybersec
Reddit
803
3,455
Prove that if $p\mid ab$ where $a$ and $b$ are positive integers and $a\lt p$ then $p\le b$. <p>I have found an old textbook called "Real Variables by Claude W. Burrill and John R. Knudsen" in the first chapter this textbook uses 15 axioms to derive much of the well known and basic facts about the integers, i have been reading and solving all the exercise and so far so good until exercise 1-27 which asks the following: "Prove that if <span class="math-container">$p$</span> is prime and divides <span class="math-container">$ab$</span> where <span class="math-container">$a$</span> and <span class="math-container">$b$</span> are positive and <span class="math-container">$a\lt p$</span>, then <span class="math-container">$p\le b$</span>." this would be very easy if we assume Euclid's lemma but it hasn't been proven and the very next exercise asks for its proof so i believe that there is a way to prove it without Euclid's lemma but how? Is there even a way to prove this without Euclid's lemma? I also believe i'm not allowed to use Bézout's identity because its proof is exercise 1-29</p> <p>I have been thinking about this problem since yesterday and i searched online for exercise solutions for this textbook but there was no results.</p> <p>As another question:does the theorem above imply Euclid's lemma in a straightforward way?</p>
0non-cybersec
Stackexchange
367
1,350
Find unique pairs in list of pairs. <p>I have a (large) list of lists of integers, e.g.,</p> <pre><code>a = [ [1, 2], [3, 6], [2, 1], [3, 5], [3, 6] ] </code></pre> <p>Most of the pairs will appear twice, where the order of the integers doesn't matter (i.e., <code>[1, 2]</code> is equivalent to <code>[2, 1]</code>). I'd now like to find the pairs that appear only <em>once</em>, and get a Boolean list indicating that. For the above example,</p> <pre><code>b = [False, False, False, True, False] </code></pre> <p>Since <code>a</code> is typically large, I'd like to avoid explicit loops. Mapping to <code>frozenset</code>s may be advised, but I'm not sure if that's overkill.</p>
0non-cybersec
Stackexchange
252
714
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
Woodland mansion didn't spawn in my world, it spawned in the copy I made, can I make it appear in my original save?. I traded for a woodland explorer map and went off to find it. Two hours later I had travelled over 11000 blocks just to find - no mansion. I created a copy of my world and tp;d to the mansion, and there it was. Is there any way I can make the mansion spawn in my original save? I don't have cheats turned on so I can't even tp back to my house lol. I'm playing on PC, version 1.13.2 The seed is -1814936794799467066 and the coordinates for the mansion are X: 11818.300 Y: 7100000 Z: 6875.269 My options now are to just accept defeat and travel the 11000 blocks home again, this was such a let down.
0non-cybersec
Reddit
203
722
While using Intel GPU, Ubuntu 16.04 freezes on shutdown. <p>My laptop has <strong>Intel 6700HQ</strong> CPU and <strong>Nvidia 960M</strong> as graphics card. I have <strong>nvidia-361</strong> driver installed. </p> <p>I can use the nvidia program provided with the driver to switch between Intel GPU and Nvidia GPU. Nvidia GPU works fine actually, and gives me no problems most of the time. But it heats a lot and drains/heats up the battery too. So it is not practical to use.</p> <p>While switching from nvidia GPU to intel GPU, I'm not having any problems. When nvidia is on, I can easily reboot, suspend, sleep, poweroff. But when I'm on intel GPU, I can do none of those. It always freezes and I have to hold on the power button to force close it. If it sleeps, it won't wake up and so on. Same problem occurs if I use terminal commands (such as <code>sudo reboot</code>) to do these too.</p> <p>It stays like one of these. And nothing happens: <img src="https://i.stack.imgur.com/EtC49.jpg" alt="It stays like one of these. And nothing happens."></p> <p>The cursor doesn't blink. Screen is completely frozen.</p> <p>I've removed "quiet splash" from grub to see what's wrong in more details, but it gave something like <img src="https://i.stack.imgur.com/gJZ3X.jpg" alt="this, which, doesn&#39;t tell much."></p>
0non-cybersec
Stackexchange
387
1,325
Logitech Gamepad F310 interacts with mouse...why?. <p>I downloaded the N64 emulator off of the Software center a while ago, and I was doing OK with using the keyboard. Then a friend of mine gave me the brilliant idea of getting a USB controller. So I got it and it was working fine with the Mupen64Plus, the GFCE Ultra NES, and the ZSNES emulators, until I got the rom for Turok. The controls are different in that game than the others, and utilizes the four yellow "C" buttons that would be on a N64 controller. The Logitech (F310 if it might be useful to know) I got, looks much more like a PS2 or PS3 controller... four buttons on the right, 2 360 directional sticks that push down as a separate button, etc..</p> <p>So Turok uses the four yellow "C" buttons as the main movement for it's character. I don't have so many buttons so I started to mess with using the "U" and "V" axis 360 directional stick. </p> <p>All of a sudden, the controller started to manipulate the cursor, and before I knew it the mouse arrow was sliding to the top left corner of the screen. It wouldn't interact with the controller anymore, and the mouse itself, when moved, would move with great resistance back to the top left corner of the screen. </p> <p>My immediate solution solution was to unplug the controller from the USB.</p> <p>Now, every time I plug the controller back in, it sends the cursor flailing into the corner of my screen.</p> <p>I've looked up getting all sorts of "jscalibrators" and other junk from the Software center and I've typed stuff into the terminal from other forums, postings that asked similar questions, but it's been totally hit or miss... mostly miss.</p> <p>I can't quite figure out what to tell the computer to do to stop thinking the gamepad is the mouse. I been get so frustrated about this over the past two days, I've been taking afternoon naps after researching and fighting for a few hours. </p> <p>Logitech support hung up on me before even connecting me to a human.</p> <p>How do I keep the controller from thinking it's the mouse?</p>
0non-cybersec
Stackexchange
535
2,079
First timer here. Help with food?. So I'm not exactly a "first timer" like the title says. I did do a good bit of "backpacking/camping" in The Marines, but I've been out for seven years now, and it was very different anyway. Even on long trips into the field, we would only carry six or so field-stripped MREs at a time, and would get resupplied almost daily. My situation now is that I haven't camped in forever, and I have no idea how the rest of the community normally does it. The trip is going to be four days, three nights on Alabama's Pinhoti Trail, and we're planning on covering about 65 miles. My initial thought is to carry sixteen dehydrated meals(four per day) and a jetboil, which seems like the only thing to do since we wont have access to vehicles(we're going to drop them off at opposite ends of the trail) for supply runs during the trip. I know it seems like a monotonous meal plan, but it seems like the easiest/lightest way to pack our trash out as well. Are there any other options that I'm not thinking of? What do y'all do for food on four day trips?
0non-cybersec
Reddit
275
1,085
How to avoid total view-hierarchy re-layout when using EditText?. <h2>Background</h2> <p>I have a rather complex layout being shown to the user in an activity.</p> <p>One of the views is an EditText.</p> <p>Since I had to make one of the views stay behind the soft-keyboard, yet the rest above it, I had to listen to view-layout changes (written about it <a href="https://stackoverflow.com/q/34851155/878126"><strong>here</strong></a>).</p> <h2>The problem</h2> <p>I've noticed that whenever the EditText has focus and shows its caret, the entire view-hierarchy gets re-layout. </p> <p>You can see it by either looking at the log of the listener I've created, or by enabling "show surface updates" via the developers settings.</p> <p>This causes bad performance on some devices, especially if the layout of the activity is complex or have fragments that have complex layouts.</p> <h2>The code</h2> <p>I'm not going to show the original code, but there is a simple way to reproduce the issue:</p> <p><strong>activity_main.xml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.user.myapplication.MainActivity"&gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"&gt; &lt;TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="just some text"/&gt; &lt;EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="phone" android:text="write here" android:textSize="18dp"/&gt; &lt;TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="just some text 2"/&gt; &lt;/LinearLayout&gt; &lt;/FrameLayout&gt; </code></pre> <p><strong>MainActivity.java</strong></p> <pre><code>public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); findViewById(android.R.id.content).getViewTreeObserver().addOnPreDrawListener(new OnPreDrawListener() { @Override public boolean onPreDraw() { Log.d("AppLog", "onPreDraw"); return true; } }); } } </code></pre> <h2>What I've tried</h2> <p>When disabling the caret (using "cursorVisible", which for some reason is called a "cursor" instead) , I can see that the problem doesn't exist.</p> <p>I've tried to find an alternative to the built-in caret behavior, but I can't find. Only thing I've found is <a href="https://stackoverflow.com/questions/31388810/android-edittext-stop-cursor-blinking-want-a-solid-cursor"><strong>this post</strong></a>, but it seems to make it static and I'm not sure as to how well it performs (performance and compatibility vs normal caret).</p> <p>I've tried to set the size of the EditText forcefully, so that it won't need to cause invalidation of the layout that contains it. It didn't work.</p> <p>I've also noticed that on the original app, the logs can (for some reason) continue being written even when the app goes to the background.</p> <p>I've reported about this issue (including sample and video) <a href="https://code.google.com/p/android/issues/detail?id=200022" rel="nofollow noreferrer"><strong>here</strong></a>, hoping that Google will show what's wrong or a fix for this.</p> <h2>The question</h2> <p>Is there a way to avoid the re-layout of the entire view hierarchy ? A way that will still let the EditText have the same look&amp;feel of normal EditText?</p> <p>Maybe a way to customize how the EditText behaves with the caret?</p>
0non-cybersec
Stackexchange
1,190
4,122
Why is ::operator new[] necessary when ::operator new is enough?. <p>As we know, the C++ standard defines two forms of global allocation functions:</p> <pre><code>void* operator new(size_t); void* operator new[](size_t); </code></pre> <p>And also, the draft C++ standard (18.6.1.2 n3797) says:</p> <blockquote> <p>227) It is not the direct responsibility of operator new or operator delete to note the repetition count or element size of the array. Those operations are performed elsewhere in the array new and delete expressions. The array new expression, may, however, increase the size argument to operator new to obtain space to store supplemental information.</p> </blockquote> <p>What makes me confused is:</p> <p>What if we remove <code>void* operator new[](size_t);</code> from the standard, and just use <code>void* operator new(size_t)</code> instead? What's the rationale to define a redundant global allocation function?</p>
0non-cybersec
Stackexchange
268
954
How to access Ubuntu running Openfire from the Internet (Public IP)?. <p>I have Openfire installed in my Ubuntu server using port 7070. Now using <a href="http://www.ipchicken.com/" rel="nofollow noreferrer">ipchicken</a> I found my public IP (example: 111.11.000.0/7070). When I try connecting from another PC through connected to the Internet the Ubuntu server is not accessible. </p> <p>How to config the firewall in Ubuntu so that I can access it using the public IP? Please guide me with a step by step example since I am new to Ubuntu.</p>
0non-cybersec
Stackexchange
152
549
Reduce blank space between bar button items in UINavigationBar. <p>I notice the blank space between bar button items is quite large. I want to reduce the space to have more room for my title. I tried to create fixed space then added it among the buttons but it didn't work. Does anybody know how to do it?</p> <pre><code>UIBarButtonItem *fixedItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; fixedItem.width = 10.0f; self.navigationItem.rightBarButtonItems = @[settingsButtonItem, fixedItem, speakerButtonItem, fixedItem, favouriteButtonItem]; </code></pre>
0non-cybersec
Stackexchange
171
630
What is the reason for redirecting the landing page of a site to a URL with &#39;/#/&#39; at the end?. <p>What is the reason for redirecting the landing page of a site to a URL with '/#/' at the end?</p> <p>The system administrators at my company use a Apache reverse proxy, and they always redirect all the external websites to a landing page that ends with '/#/'.</p> <p>For example:</p> <pre><code>https://example.com/springApp/#/ </code></pre> <p>Is there any particular reason for this? I am a technical person, but I can't think of a reason for this. Just curious. NOTE: our website does NOT use page scroll anchors.</p>
0non-cybersec
Stackexchange
183
635
Nautilus &quot;context menu&quot; spanish &quot;accent&quot; error. <p>I have installed Ubuntu 16.04 Unity (4.4.0-34-generic x86_64), Spanish Mexico. After install the Nautilus tool "nautilus-image-converter" my context menu on Nautilus shows some grammar (accent) errors on the options of this tools. Other words are correct written on the menu "Im<strong>á</strong>genes" only this "new" options are wrong. Any help will be appreciated. </p> <p><a href="https://i.stack.imgur.com/6GRCS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6GRCS.png" alt="nautilus-image-converter"></a></p>
0non-cybersec
Stackexchange
199
607
How to send data to server and fetched response using react native application?. <p>I am trying to learn react native application by making a simple login page using api call. Where I will send user name and password to api and it will give me response. But I can't do it. Well I am sharing my code here.....</p> <pre><code>var myRequest = new Request('&lt;my API &gt;', {method: 'POST', body: '{"username":this.state.uName , "password":this.state.pwd}'}); fetch(myRequest).then(function(response) { alert('Res'+response); }).then(function(response) { alert('Blank'+response); }) .catch(function(error) { alert('Error'+error); }); </code></pre> <p>I think the way of passing my user name and password to server is wrong. Please give me some idea then I can understand what is wrong here.</p>
0non-cybersec
Stackexchange
238
840
Warning sign/exclamation point in red circle next to table names and Query tab?. <p>I have a VPS with CENTOS 6.4 and WHM 11.38.2. I just updated WHM to the latest version, and now when I go to phpMyAdmin there are red circles with white exclamation points in them next to the table names and before the word "Query" in the Query tab.</p> <p>The warning signs are kind of stupid, because there's no message when I hover over them and they aren't clickable. Searching the web and on here for these warning signs didn't produce any results.</p> <p>What do these warning signs mean, and what should I do to fix whatever issue exists?</p> <p>UPDATE:</p> <p>I've been messing around with phpMyAdmin and there's definitely something wrong. When I click on a database name, the tables no longer show in the left pane.</p>
0non-cybersec
Stackexchange
219
818
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
Is there a way I can add points together for the same team in a list?. <p>How can I add the points together for one team?</p> <p>This is what I have tried:</p> <pre><code>def check_league(league_points): league_results = [] for teams in league_points: team, points = teams.strip().rsplit(' ', 1) print(team, points) </code></pre> <p>This is the list I have:</p> <pre><code>['Lions 1', 'Snakes 1', 'Tarantulas 3', 'FC Awesome 0', 'Lions 1', 'FC Awesome 1', 'Tarantulas 3', 'Snakes 0', 'Lions 3', 'Grouches 0'] </code></pre> <p>Output:</p> <pre><code>('Lions', '1') ('Snakes', '1') ('Tarantulas', '3') ('FC Awesome', '0') ('Lions', '1') ('FC Awesome', '1') ('Tarantulas', '3') ('Snakes', '0') ('Lions', '3') ('Grouches', '0') </code></pre> <p>I want the output to be:</p> <pre><code>'Tarantulas', '6' 'Lions', '5' 'FC Awesome', '1' 'Snakes', '1' 'Grouches', '0' </code></pre>
0non-cybersec
Stackexchange
375
909
Finding kernel of a column matrix. <p>I've got a matrix and linear mapping problem, giving me vector $v_1$ as \begin{bmatrix} 1\\ 0\\ 1\\ \end{bmatrix}</p> <p>and $v_2$ as \begin{bmatrix} 0\\ 1\\ 1\\ \end{bmatrix} also, it gives me the mapping $f(x)=(x,v_1)v_1+(x,v_2)v_2$ while $x\in\mathbb{R}^3$ and the expression $(x,v_i)$ is dot product of $x$ and vector $v$</p> <p>the problem asks me to find the basis of kernel of $f(x)$</p> <p>so, I start thinking from $f(x)$. as dot product of vectors give scalar and I assume $x$ as \begin{bmatrix} x_1\\ x_2\\ x_3\\ \end{bmatrix} I'll get $f(x) = (x_1+x_3)\begin{bmatrix} 0\\ 1\\ 1\\ \end{bmatrix} + (x_2+x_3) \begin{bmatrix} 0\\ 1\\ 1\\ \end{bmatrix}$</p> <p>and do the multiplication to get $f(x)=\begin{bmatrix} 1 &amp; 0\\ 0 &amp; 1\\ 1 &amp; 1\\ \end{bmatrix}\begin{bmatrix} x_1+x_3\\ x_2+x_3\\ \end{bmatrix}$</p> <p>and finally $f(x)=\begin{bmatrix} x_1+x_3\\ x_2+x_3\\ x_1+x_2+2x_3\\ \end{bmatrix}$</p> <p>then to find kernel I should take the matrix equal to $0$ and find the kernel but I cannot find it</p>
0non-cybersec
Stackexchange
514
1,321
mdframed causes &quot;too many floats&quot; error. <p>I defined a new environemnt <code>examples</code> for a book I am writing. I would like examples to be with a framed grey box, and use the following construct</p> <pre><code>%---------------------------------------------------------------------------- % EXAMPLES %---------------------------------------------------------------------------- \newlistof[chapter]{examples}{exp}{\listexamples} \newcommand{\bex}[1]{% \begin{mdframed}[linewidth=2, leftmargin=0, rightmargin=0, backgroundcolor=gray, linecolor=black, splittopskip=\topskip, skipbelow=\baselineskip, skipabove=\baselineskip] \refstepcounter{examples} \par\noindent\sqrblt\underline{\textbf{Example \theexamples. #1}} \addcontentsline{exp}{examples} {\protect\numberline{\theexamples}#1}\par} \cftsetindents{examples}{0em}{2em} % for example numbers which are greater than 9 % Solution \newcommand{\sol}{\begin{center}\underline{{\bf Solution:}}\end{center}} % End of Example \newcommand{\eex}{ \noindent \hbox{~~}\hfill \hbox{~~} \sqrblt \end{mdframed} } </code></pre> <p>If I activate the <code>mdframed</code>, I get "not in outer par mode". If I comment the <code>mdframed</code> part, all is well</p>
0non-cybersec
Stackexchange
365
1,221
OpenVPN strange behavior. <p>I have a KVM VPS for my personal VPN. Server running on FreeBSD 11.0-RELEASE-p1 with OpenVPN 2.4.0, and ipfw kernel nat. Direct connection speed between me and VPS ~10-12 Mbps. Via tunnel speed is ~1.6-5 Mbps (which enough for me).</p> <p>This tunnel is for web surfing. When I download file from server via tunnel everything fine. But when I try to open some web page, speed is 2-7kbps!! <strong>EXCEPT</strong> youtube! Youtube always works fast and shows videos in 1080p with no freezes.</p> <p>I tried different combinations of tcp/udp, cipers, sndbuf/rcvbuf, tun-mtu/mssfix, comp-lzo/compress lz4-v2/no compress, different TAP drivers, Windows 7 64/Ubuntu with no luck.</p> <p>OpenVPN server conf:</p> <pre><code>port 3344 proto udp dev tun ca ca.crt cert gate.crt key gate.key dh dh.pem server 10.80.50.0 255.255.255.240 ifconfig-pool-persist ipp.txt client-config-dir ccd route 10.80.50.0 255.255.255.240 push "redirect-gateway def1 bypass-dhcp" push "dhcp-option DNS 10.80.50.1" keepalive 10 120 tls-authta.key 0 cipher AES-256-CBC max-clients 3 user nobody group nobody persist-key persist-tun status /var/log/openvpn-status.log log /var/log/openvpn.log verb 6 askpass keyp auth-nocache sndbuf 393216 rcvbuf 393216 push "sndbuf 393216" push "rcvbuf 393216" </code></pre> <p>Client conf</p> <pre><code>dev tun proto udp remote remove_vps 3344 client resolv-retry infinite ca ca.crt cert client1.crt key client1.key tls-auth ta.key 1 remote-cert-tls server persist-key persist-tun verb 3 cipher AES-256-CBC askpass keyp auth-nocache </code></pre> <p>IPFW:</p> <pre><code>allow ip from any to any via lo0 nat 1 ip from 10.80.50.6 to any out via vtnet0 nat 1 ip from any to $wanip in via vtnet0 allow ip from any to any via tun0 allow ip from any to any deny log logamount 5 ip from any to any deny ip from any to any </code></pre> <p>Can somebody help me to figure out where is the problem ?</p>
0non-cybersec
Stackexchange
721
1,948
Solving Addition Rule other way. <p>I know the General Addition Rule for Two Events is </p> <blockquote> <p>$$P (A\cup B) = P (A) + P(B) - P(A\cap B)$$</p> </blockquote> <p>I know the proof where ${R_1} = A\cap B, R_2 = A\cap B', R_3 = A'\cap B,$ and $R_4 = A'\cap B'.$ The $R_i$'s are a partition of a sample space S and they are disjoint.</p> <p>However I was wondering if we can prove this by making use of the set equations:</p> <p>$A\cup B =A\cup(A'\cap B) $(I know the RHS is disjoint) and<br> $B = (A\cap B)\cup(A'\cap B) $(where the RHS is disjoint).</p> <p>How would one go proving the theorem using these set equations? Can someone please show me? </p>
0non-cybersec
Stackexchange
255
670
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
Has anyone ever had a worthwhile affair?. As per the title, has anyone ever had an affair they felt they strengthened their main relationship for one reason or another? Anyone have on-going affairs and perfectly happy main relationships? Why do you do it, if you're happy? For the sex? For the excitement? There's always the advice "it will always come out", but that isn't true. A friend i know of 17 years has a wonderful wife, and great kids but recently revealed to me that his secret to success was having an affair on occasion. He said they'd be going through some problem or other, he'd go out and have a fling of some sort and it would often provide him with the energy or desire to put renewed effort into his marriage. I tried to argue with him about the morality, but then i thought this guy has the kind of marriage i can only dream of. Seriously, they are mostly happy together, she's happy, he's happy and before someone comes along and says "oh no they can't possibly be" let me stop you, they aren't fake happy. I know both of them well and can tell instantly when they're faking happiness for the benefit of others. While i know it's "wrong" to cheat i have to start asking myself, if it's working so well for this guy and his family maybe other cheaters are just doing it wrong? How are we to know that for every one cheater who lazily cheats with his wife's best friend there aren't 10 more who are tactful enough to use protection with an escort at least 5 hours away from his home? My ethical side and my rational side are at odds. Someone give me something to work with here?
0non-cybersec
Reddit
362
1,601
pacemaker failover nginx only once. <p>I setup a cluster with two nodes with pacemaker 1.1.10 on CentOS 7. Then I downloaded a <a href="https://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/nginx" rel="nofollow noreferrer">resource agent for nginx from github</a></p> <p>I tested my setup like this:</p> <ol> <li>Node 1 is started with the nginx and vip, everyting is ok</li> <li>Kill Node1 nginx, wait for a few seconds</li> <li>See the ngnix and vip are moved to node2, failover succeeded, and Node1 doesn't have any resources active</li> <li>I kill nginx on node2, but nginx and vip don't come back to Node1</li> </ol> <p>I set <code>no-quorum-policy="ignore"</code> and <code>stonith-enabled="false"</code>.</p> <p>Why won't pacemaker let the resource come back to Node1? What did I miss here? </p>
0non-cybersec
Stackexchange
281
822
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
[Vent] Found a dog. Got him all fixed up. Spay and neuter place took him away.. So about 6 weeks ago we found an awesome dog. He was way under weight and had two kinds of worms and covered in fleas. The end of his tail had rotted and needed to be removed. We took him to a vet and asked them to check for a chip and they said there wasn't one and he had no collar when we found him. We then spent about $2,500 on him between vet bills, food and supplies. Yesterday, we took him to a place in town that does neutering. We said we would like to get him chipped as well. They called us and said he already had a chip and that his old owner will pick him up now. We were floored. I left work for some day drinking and tears. They said the previous owner said the tail happened in an accident with the doggy door (which it seems like they must have just ignored it then). They also said they lost him 3 weeks before we found him. It really seemed like he looked pretty bad for being gone only 3 weeks. I just hope he is taken care of. We really fell in love with that dog. We took him everywhere. Farewell buddy! http://imgur.com/a/1T61r. Edit: Corrected some spelling. Edit: I am not going to try and get the dog back or my money. Just sad that he is gone. I learned a lesson about taking in strays. Edit: Thanks for all your replies! This has been really good for dealing with it by hearing all of your input on the matter.
0non-cybersec
Reddit
361
1,428
Word 2016 equation font keeps auto-resetting to Hindi fonts. <p>In Word 2016, when I insert an equation, it shows it to me correctly.</p> <p>However, when I save the document and re-open it, the font gets automatically changed to Hindi fonts. Each time I change the font and save the document and then re-open it, it keeps going back to Hindi.</p> <p>My default office language is set to English.</p> <p>I have tried uninstalling the Hindi fonts but to no avail. When I uninstall one font, it just picks up another Hindi font.</p> <p>I have also tried reinstalling Word itself, but that too didn't help.</p> <p>Please guide what should I do to change the default equation language. I have become somewhat frustrated with this problem since the last many months.</p>
0non-cybersec
Stackexchange
205
771
Android autocomplete with SQLite LIKE works partially. <p>I have a <code>Restaurants</code> table in my SQLite DB that have the following records</p> <pre><code>| Name | Latin_Name | +--------+------------+ | Манаки | Manaki | +--------+------------+ | Енрико | Enriko | +---------------------+ </code></pre> <p>Now I'm doing the search like this:</p> <p>From my fragment:</p> <pre><code>String selection = DBHelper.COL_NAME + " LIKE ? OR " + DBHelper.COL_LATIN_NAME + " LIKE ?"; String[] selectionArgs = {"%"+term+"%", "%"+term+"%"}; CursorLoader loader = new CursorLoader(getActivity(), DatabaseContentProvider.REST_CONTENT_URI, columns, selection, selectionArgs, null); </code></pre> <p>The content provider <code>query</code> method:</p> <pre><code> public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { db = dbHelper.getReadableDatabase(); SQLiteQueryBuilder builder = new SQLiteQueryBuilder(); switch(URI_MATCHER.match(uri)){ case REST_LIST: builder.setTables(DBHelper.REST_TABLE); break; case REST_ID: builder.appendWhere(DBHelper.COL_ID + " = " + uri.getLastPathSegment()); break; default: throw new IllegalArgumentException("Unsupported URI: " + uri); } Cursor cursor = builder.query(db, projection, selection, selectionArgs, null, null, sortOrder); cursor.setNotificationUri(getContext().getContentResolver(), uri); return cursor; } </code></pre> <p>So pretty basic right? Now here comes the problem:</p> <p>If the <code>term</code> that comes in is <strong><code>en</code></strong> I can see the <em>Enriko</em> restaurants among the others.</p> <p>If I pass <strong><code>enri</code></strong> I can't see the <em>Enriko</em> as a result anymore.</p> <p>Same goes for the <em>Manaki</em> restaurant I can see it until <strong><code>mana</code></strong> and after that (for <strong><code>manak</code></strong> term for ex) I can't see it in the results list.</p> <p>I was debugging my ContentProvider and I realized that the cursor was empty, so the problem have to be at the database level, I guess.</p> <p>Please help.</p> <p><strong>UPDATE:</strong></p> <p>Having the @laalto comments in mind I decided to do some test on the database. In the <code>onCreate()</code> method of my <code>SQLiteOpenHelper</code>I inserted only those two records in the table by hand and it worked.</p> <p>Now the problem is that I have to insert 1300 records <code>onCreate()</code> from a <code>json</code> file shipped in the <code>assets</code> folder. Right now I'm parsing the <code>json</code> file create an <code>ArrayList&lt;Restaurant&gt;</code> then loop trough it and insert one record per object for all 1300 items. </p> <p>That kind of insertion won't work with the SQLite <code>LIKE</code> method. </p> <p>Are there any gotchas about this kind of populating the database? </p> <p>Maybe I need to change file encoding (it is UTF-8 now) or maybe database's collation, or maybe <code>getString()</code> from <code>JSONObject</code> can be tweaked for the database?</p>
0non-cybersec
Stackexchange
972
3,315
Regex in LibreOffice Writer - finding &quot;everything&quot; but one thing. <p>I have a text (html code) and need to find <code>&lt;p&gt;</code> tags with their classes, id, styles (if any) etc. I'm doing this using the following regexs: <code>&lt;p(.*?)&gt;</code> or <code>(&lt;p([^&gt;]+))&gt;</code></p> <p>The pattern of my text is here:</p> <pre><code>&lt;p class="navi_buttons"&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit.&lt;/p&gt; &lt;p class="reg"&gt;Aliquam mi sapien, rutrum eget sem vel, semper efficitur.&lt;a href="xyz.html" class="topiclink"&gt;vitae velit&lt;/a&gt;&lt;/p&gt; &lt;p class="THIS_SHOULD_BE_AVOIDED"&gt;Donec fringilla sapien vitae interdum volutpat.&lt;/p&gt; &lt;p class="nav"&gt;Cras nec orci non dolor ultrices luctus sit amet vitae velit.&lt;/p&gt; </code></pre> <p>The problem is that I need to find every occurrence of <code>&lt;p&gt;</code> tag except one certain class (i.e. I want to avoid paragraphs of this class). I don't know how to write an exclusion that is treated as a string, not a set of the individual characters. I would appreciate your help. Kind regards,</p>
0non-cybersec
Stackexchange
410
1,135
3Com Switch Fan Fault &quot;Approve&quot;. <p>I have a second hand 3Com 4200G 24 Port Switch. I have opened the case and unplugged one of the two case fans. I am not running the switch at anywhere near its full capabilities so I am comfortable disabling a fan.</p> <p>As expected the power light is red and the small seven segment display reads F to show a fault. But I kind of want the display to show the unit number for easier troubleshooting when I have my other switches.</p> <p>Is there any way to "Approve" a fault in the switches web interface so that the display resumes normal operation or should I be putting a resistor across a certain two fan connector pins so the unit thinks the fan is working?</p> <p>Thanks in advance. :-)</p>
0non-cybersec
Stackexchange
192
747
Cannot update grub with parameters on live USB. <p>I have booted from a live USB ("Try Ubuntu"), that also has a persistent option set (I used <a href="http://www.linuxliveusb.com/" rel="noreferrer">LiLi</a> to create one) to do some tests for <a href="https://askubuntu.com/questions/153813/crippling-repeating-pciehp-card-not-present-notifications">this pcie hotplug issue I'm having</a>.</p> <p>I'm trying to test <a href="https://help.ubuntu.com/community/ExpressCard" rel="noreferrer">some boot paramaters</a> (like <a href="https://askubuntu.com/questions/19486/how-do-i-add-a-boot-parameter">in this question</a>) by doing this</p> <pre><code>sudo nano /etc/default/grub sudo update-grub </code></pre> <p>The problem is that that last command gives me this:</p> <pre><code>/usr/sbin/grub-probe: error: failed to get canonical path of /cow. </code></pre> <p>It looks like <code>/cow</code> is the file-system that is mounted on <code>/</code>, according to:</p> <pre><code>:~# df Filesystem 1K-blocks Used Available Use% Mounted on /cow 4056896 2840204 1007284 74% / udev 1525912 4 1525908 1% /dev tmpfs 613768 844 612924 1% /run .... </code></pre> <p>Is there a way for me to run update-grub?</p>
0non-cybersec
Stackexchange
435
1,276
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
Cracked screen on HP Chromebook x360 - Model # 14-DA0012DX. <p>I have a HP Chromebook x360 14&quot; touchscreen (product 7UL19UA, model 14-DA0012DX) that has a cracked screen. I posted a question in HP’s forum but didn’t get much help. How do I know if just the digitizer/touchscreen is cracked or if the LCD screen is also cracked? Do I replace them individually or is there a part that includes both the digitizer and screen? I looked in the manual and it makes reference to a display assembly (part number L36904-001 - &quot;HU LCD 14'INCH FHD BV LED UWVA&quot;). Is that the part I need and does that part include both the digitizer/touchscreen and the LCD screen? I’m having trouble finding the part as it’s not offered through HP.</p>
0non-cybersec
Stackexchange
201
741
Anyone take 'under-the-radar' supplements that aren't mainstream, but swear by them?. Pretty much everybody recommends Fish Oil, Vitamin D, Multivitamins, etc. as supplements to take, but there has to be more quality stuff out there than just these guys. So essentially, what are you taking that you think not many people are, and for what reasons? For me; CoQ10, Chromium, and Fucoxanthine. (EDIT: Vinpocetine) CoQ10: I believe this to be the most underrated supplement, as there is a lot of evidence on it's heart health yet a shit-ton of anecdotal evidence for well-being. Even many abstracts have noted that 'patients reported increased feelings of well-being'. It's bioelectric involvement in the Mitochondria makes it theoretically a godsend, and it appears to, in part, have these effects. Chromium: Not many people take care of their blood sugar, sad. I also put cinnamon in my protein shakes, but that stuff can't go on everything. Fucoxanthine: Is a 'promising but needs more evidence supplement', not many studies done on it, but they all seemed to be positive. Tried it out and it is now going to be a mainstay in my fat loss regimes in the future. In short it just converts more energy to heat in the body, so it is released as heat rather than stored; not too significant, but it builds up over the course of 2 months or so to be pretty nice. (EDIT: Vinpocetine: Take care of your brain, it is your most important organ. Neural antioxidant + Neural vasodilator + Reperfusion-protection agent + cheap.) So r/fit, lets hear what unorthodox supplements you swear by! (Pre-emptive strike: To anyone who says that supplements can't replace a healthy diet, well, no shit Sherlock. They can be fun to experiment with and can exert effects in isolation or superphysiological doses that can't be matched by foods though)
0non-cybersec
Reddit
450
1,833
apache removes the first / from url. <p>For example, <code>https://subdom.mysite.com/contact_us/</code> --> <code>https://subdom.mysite.comcontact_us/</code> </p> <p>These are the only rewrite rules that I have:</p> <pre><code>RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^(.*)$ /#/$1 [L] </code></pre> <p>Some background: I'm using an apache webserver to host an angularjs 1.6 web application. Changing the last two lines seems to break the webapp, in the sense that I can't reload the page anymore..</p> <p>I've read <a href="https://stackoverflow.com/questions/20042434/why-is-apache-permanent-redirect-removing-the-slash-between-the-domain-and-the-p">this question</a>, but their issue stemmed from http urls, which isn't the case here.</p> <p>Here are the server logs:</p> <blockquote> <p>[Tue Aug 13 18:20:18.897503 2019] [suexec:notice] [pid 1] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) <br> [Tue Aug 13 18:20:18.924270 2019] [lbmethod_heartbeat:notice] [pid 1] AH02282: No slotmem from mod_heartmonitor <br> [Tue Aug 13 18:20:18.938867 2019] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.0.33 configured -- resuming normal operations <br> [Tue Aug 13 18:20:18.938916 2019] [core:notice] [pid 1] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND' <br> - - [13/Aug/2019:18:20:43 +0000] "GET /contact_us HTTP/1.1" 302 357 <br> [13/Aug/2019:18:20:43 +0000] TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 "GET /contact_us HTTP/1.1" 357 <br> - - [13/Aug/2019:18:20:46 +0000] "GET /contact_us HTTP/1.1" 302 228</p> </blockquote>
0non-cybersec
Stackexchange
680
1,758
SQL Server 2008 stopped receiving network connections after SP2 installed. <p>After SP2 I was unable to connect to SQL Server 2008. I found that the SQL&nbsp;Server Browser service was stopped. I enabled Browser, but it did not help. Everything was fine before SP2. My OS is Windows 7 64-bit.</p> <p>Protocols for SQL&nbsp;Server: Enabled Shared memory, Named pipes and TCP/IP</p> <p>Under TCP/IP, all settings seem OK.</p> <p>A connection fails from the local network to this computer, but otherwise the server is working OK.</p>
0non-cybersec
Stackexchange
145
534
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
SQL Agent - PowerShell step &quot;syntax error&quot;. <p>I have the following code setup in SQL Agent Job step that is not running. The message received is simply:</p> <blockquote> <p>Unable to start execution of step 1 (reason: line(46): Syntax error). The step failed.</p> </blockquote> <p>The duration of the job is: <code>00:00:00</code></p> <p>Line 46 of this script is a <code><a href="http://technet.microsoft.com/en-us/library/ee692792.aspx" rel="noreferrer">here-string</a></code>:</p> <pre><code> ,@DriveLetter = '$($c.DriveLetter)' </code></pre> <p>This script runs perfect outside of SQL Server Agent.</p> <p>ServerNames table:</p> <pre><code> CREATE TABLE ServerTable ( ServerName varchar(50) ) </code></pre> <p>Disk Space table would be something similar to:</p> <pre><code> CREATE TABLE DiskSpace ( ID int IDENTITY(1,1), ServerName varchar(50), DriveLetter varchar(2), DiskSpaceCapacityGB decimal(12,5), DiskSpaceFreeGB decimal(12,5) ) </code></pre> <p>PowerShell Script: <pre><code> <em>This command is to allow SQL Agent job to show failure in event PowerShell script errors Default behavior in SQL Agent for PowerShell steps it 'Continue'</em> $erroractionpreference = "Stop"</p> <p>$sqlInstance = 'server1' $sqlDatabase = 'database1'</p> <p>$qServerList = @" Select ServerName From ServerTable "@</p> <p>$srvList = Invoke-Sqlcmd -ServerInstance $sqlInstance -Database $sqlDatabase -Query $qServerList | Where-Object {$_ -ne '' -or $_ -ne $null} | Select-Object -ExpandProperty ServerName</p> <p>foreach ($s in $srvList) { if (Test-Connection -ComputerName $s -Count 1 -ErrorAction 'SilentlyContinue') { try { $cServer = Get-WmiObject Win32_Volume -ComputerName $s -ErrorAction 'Stop' | where {$<em>.DriveType -eq 3 -and $</em>.DriveLetter } | Select-Object @{Label="ServerName";Expression={$s}}, @{Label="DriveLetter";Expression={$<em>.DriveLetter}}, @{Label="DiskSpaceCapacityGB";Expression={"{0:N0}" -f($</em>.Capacity/1GB)}}, @{Label="DiskFreeSpaceGB";Expression={"{0:N2}" -f($_.FreeSpace/1GB)}}</p> <pre><code> foreach ($c in $cServer) { $qAddServerDiskSpace = @" </code></pre> <p>EXEC [dbo].[StoredProcInsert] @ServerName = '$($c.ServerName)' ,@DriveLetter = '$($c.DriveLetter)' ,@DiskSpaceCapacityGB = $($c.DiskSpaceCapacityGB) ,@DiskFreeSpaceGB = $($c.DiskFreeSpaceGB) "@</p> <pre><code> try { Invoke-Sqlcmd -ServerInstance $sqlInstance -Database $sqlDatabase -Query $qAddServerDiskSpace -ErrorAction 'Stop' } catch { $ErrorMsg = $_.Exception.Message $fullMsg = "Error writing executing dbo.StoredProcInsert for $s - $ErrorMsg" Return $fullMsg } } } catch { $ErrorMsg = $_.Exception.Message $qAddPSErrorLog = @" </code></pre> <p>EXEC [dbo].[StoredProcInsert_Error] @ServerName = '$($cServer.ServerName)' , @ErrorText = '$($ErrorMsg)' "@ try { Invoke-Sqlcmd -ServerInstance $sqlInstance -Database $sqlDatabase -Query $qAddPSErrorLog -ErrorAction 'Stop' } catch { $ErrorMsg = $_.Exception.Message $fullMsg = "Error writing executing dbo.StoredProcInsert_Error for $s - $ErrorMsg" Return $fullMsg } } } else { $qAddPSErrorLog = @" EXEC [dbo].[StoredProcInsert_Error] @ServerName = '$($cServer.ServerName)' , @ErrorText = 'Unable to ping server' "@</p> <pre><code> try { Invoke-Sqlcmd -ServerInstance $sqlInstance -Database $sqlDatabase -Query $qAddPSErrorLog -ErrorAction 'Stop' } catch { $ErrorMsg = $_.Exception.Message $fullMsg = "Error writing executing dbo.StoredProcInsert_Error for $s - $ErrorMsg" Return $fullMsg } } </code></pre> <p>}</p> <p></pre></code></p> <p><strong>EDIT</strong></p> <p>Setup additional steps to try using CmdExec type as <code>PowerShell -Command "&amp; { }"</code>. With this execution the script runs and the error log is populated for the appropriate catch blocks, but no disk space data is written to the table.</p> <p>The agent history for this run shows a warning message:</p> <blockquote> <p>Message Executed as user: NT Service\SQLAgent$myInstance. WARNING: Some imported command names include unapproved verbs which might make them less discoverable. Use the Verbose parameter for more detail or type Get-Verb to see the list of approved verbs. Process Exit Code 0. The step succeeded.</p> </blockquote> <p>If I use the same type step but call the file: <code>PowerShell -File MyScript.ps1</code> I get the same message as the PowerShell step type above for syntax error.</p>
0non-cybersec
Stackexchange
1,534
4,986
CentOs, Apache24. <p>Essentially I am installing apache2.4 onto centOs6.6 using the Apache2 CHEF cookbook. I have it working to the point where all the service commands work minus the </p> <pre><code> sudo service httpd24-httpd graceful </code></pre> <p>command, unfortunately the chef script will not complete without that service. It provides me with the following error:</p> <pre><code>/opt/rh/httpd24/root/usr/sbin/apachectl: line 112: /usr/bin/systemctl: No such file or directory </code></pre> <p>sure enough that file (systemctl) isn't there. The cookbook is just deferring to yum to install apache - so I am a bit confused as to why it isn't installed, IF it is needed. How is systemctl installed on centos?</p> <p>Folow up question: Isn't systemctl an ubuntu app? If is my apache24 install messed up OR does apache24 have a reliance on this? </p> <hr> <p>So I retried on a fresh VM </p> <pre><code> cd /yum/repos.d wget http://repos.fedorapeople.org/repos/jkaluza/httpd24/epel-httpd24.repo sudo yum install httpd24 sudo service httpd24-httpd graceful </code></pre> <p>Then a </p> <pre><code>/opt/rh/httpd24/root/usr/sbin/apachectl: line 116: /usr/bin/systemctl: No such file or directory </code></pre> <p>It doesn't look to be associated with the cookbook at all. It looks tobe completely associated with the httpd24 install</p>
0non-cybersec
Stackexchange
444
1,357
Integrate Cocos2dx project within Swift Project (XCode 6.3). <p>I have 2 separate Projects one is in Cocos2dx v3.6 and one is in Swift. I want to start a game from the Swift project. How can I do it?</p> <p>I have copied whole cocos2dx project into my Swift project and then created one View Controller in swift and trying to open CCDirector as a root view of the project. but not able to find director, I am trying to import cocos2dx with this <strong>#import "cocos2d.h"</strong> , but it is giving me error of "undefined file".</p> <p><a href="https://i.stack.imgur.com/kJpSh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kJpSh.png" alt="This is how I added Cocos2dx project in my Swift Project"></a></p> <p>Apple Swift version 1.2</p>
0non-cybersec
Stackexchange
246
763
Are faces of a compact, convex body &quot;opposed&quot; iff their extreme points are pairwise &quot;opposed&quot;?. <p>Let $P$ be a compact, convex subset of $\mathbb{R}^n$ (infinite-dimensional generalisations welcome, but not necessary). Let's say that disjoint subsets $W_1$, $W_2$ $\subset P$ are <em>opposed</em> if there exist parallel hyperplanes $H_1$, $H_2$ supporting $P$, such that $W_i \subset H_i \cap P$.</p> <p>Let $F_1$ and $F_2$ be faces of $P$, such that their extreme points are pairwise opposed: i.e. $v_1, v_2 \in P$ are opposed whenever $v_i$ is an extreme point of $F_i$. Are $F_1$ and $F_2$ opposed? </p> <p>I have a tentative proof when $P$ has affine dimension equal to 2, which I am struggling to generalise even to 3 dimensions. The converse is trivial. I'd also be interested to know if a proof of this requires some restriction on $P$ (e.g. letting $P$ be a polytope).</p>
0non-cybersec
Stackexchange
293
905
Terminology: What to call a set where equivalence is defined over all members?. <p>Math amateur here, and new to the site. I have to write a technical specification, and am rather unsure about how to express things mathematically properly.</p> <p>So I have a set of “entities” of some sort. Let's call it A. It shouldn't matter what the entities are for this question.</p> <p>I also have a notion of equivalence between the entities in A.</p> <p>But, for any two entities, it may or may not be possible to tell whether they are equivalent. So, the equivalence relationship is not defined for all pairs of entities.</p> <p>Now, I need to talk a lot about subsets of A where the equivalence relationship is defined for all members of the subset. (For any a and b in the subset, “a equivalent b” is defined.) </p> <p>What should I call these subsets? Is there a good term for describing exactly that? So I'm looking for a good term for XXX in this sentence: “If a subset B of A is a XXX (that is, “a equivalent b” is defined for any a and b in B), then…”</p>
0non-cybersec
Stackexchange
278
1,061
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
Python - matplotlib - how do I plot a plane from equation?. <p>I have an equation z=0.12861723162963065X + 0.0014024845304814665Y + 1.0964608113924048</p> <p>I need to plot a 3D plane for this equation in python using matplotlib. I have already tried following this post -- <a href="https://stackoverflow.com/questions/48335279/given-general-3d-plane-equation-how-can-i-plot-this-in-python-matplotlib">Given general 3D plane equation, how can I plot this in python matplotlib?</a></p> <p>However I am unable to set the x,y and z limits for this plane.</p> <p>Can someone provide me the correct way of converting this equation into 3D plane. Thanks</p>
0non-cybersec
Stackexchange
212
655
How to use Admin SDK with limited privileges on Firestore?. <p>I have some trouble with Cloud function and firestore rules. I would like use cloud function with limited privilèges on Firestore and give only has access as defined in the Security Rules</p> <p>It's working without problem on RTDB but not on Firestore.</p> <p>I have try with this rules </p> <pre><code>service cloud.firestore { match /databases/{database}/documents { match /init/{ID=**} { allow read, write: if true; } match /test/{ID=**} { allow read, write: if false; } } } </code></pre> <p>And this </p> <pre><code>const admin = require('firebase-admin'); const functions = require('firebase-functions'); const FieldValue = require('firebase-admin').firestore.FieldValue; admin.initializeApp({ credential: admin.credential.cert(serviceAccount), databaseURL: 'https://******.firebaseio.com', databaseAuthVariableOverride: { uid: 'my-worker', }, }); const db = admin.firestore(); exports.onTestRights = functions.firestore .document('init/{initID}') .onCreate((event) =&gt; { const initID = event.params.initID; return db.collection('test').doc(initID).set({'random key': 'random value'}).then(()=&gt;{ console.log('working'); return; }).catch((err) =&gt;{ console.log('error: ', err); return; }); }); </code></pre> <p>But it's still writing so whereas it should be "permission denied"</p> <p>Anyone know if it's normal(or not yet implanted) on firestore or I have misunderstood something ?</p> <p><strong>Edit:</strong> Of course my final goal is not with this rules, but only give write/read access on some documents/collections using (<code>allow read, write: if request.auth.uid == 'my-worker';</code>)</p> <p><strong>Edit2:</strong> I would like use the security rules for checking like a transaction if no change during process <a href="https://i.stack.imgur.com/sRlGV.png" rel="nofollow noreferrer">using this model </a></p>
0non-cybersec
Stackexchange
620
2,068
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
Position image next to a text within an adjustbox created in a newenvironment. <p>I try to create a box with a gray background color, where there is a centered image on the left and a text on the right side of the box. It should look like the boxes created in <a href="https://bookdown.org/yihui/bookdown/custom-blocks.html" rel="nofollow noreferrer">here</a>. Here's a short reproducable example. </p> <pre class="lang-latex prettyprint-override"><code> \documentclass[12pt]{article} \usepackage[utf8]{inputenc} \usepackage[british]{babel} \usepackage[T1]{fontenc} \usepackage[table]{xcolor} \definecolor{lightgray}{HTML}{f5f5f5} \usepackage{adjustbox} \usepackage{fontawesome} \newenvironment{idea} {% \begin{adjustbox}{minipage=[b] {380px},margin=1ex,bgcolor=lightgray,env=center}\faCoffee } {% \end{adjustbox}% } \begin{document} \begin{idea} I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. \end{idea} \begin{tabular}{p{1cm}p{11cm}} \vspace{0.7em} \Huge \faCoffee &amp; I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. \\ \end{tabular} \end{document} </code></pre> <p>It's important that the box is created through <code>\newenvironment</code>.</p> <p><a href="https://i.stack.imgur.com/eECnZ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eECnZ.jpg" alt="enter image description here"></a></p> <p>I already tried to use a <code>tabular</code> but I have no idea how to integrate it into the <code>adjustbox</code>. The final result should look like the second example with the icon being centered and with gray background. </p> <p>Any help is greatly appreciated! </p> <p>UPDATE:</p> <p>I played around a little and got a pretty hacky solution for this one case, but I need something more flexible. It should look like this though: </p> <pre class="lang-latex prettyprint-override"><code>\renewcommand{\arraystretch}{1.5} \newenvironment{warning} {% \begin{centering} \begin{tabular}{p{0.1\linewidth}p{\linewidth}} \rowcolor{lightgray} \vspace{0.5em} \hspace{0.7em} \Huge \faWarning &amp; } {% \end{tabular} \end{centering} } \begin{warning} I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. \end{warning} </code></pre> <p><a href="https://i.stack.imgur.com/jUluS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jUluS.jpg" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
1,004
3,047
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
Not able to access internet after connecting to VPNC. <p>I am using VPNC-client to connect to my <code>office-network</code>. It is working fine. </p> <p>My machine is <strong>ubuntu16.04</strong>.</p> <p>But when I get connected to <code>VPN</code>, I can not access to the public internet or <code>google.com</code></p> <p><strong>ifconfig</strong>(When VPN is connected)</p> <pre><code>br-1b5f9a5d3ef3 Link encap:Ethernet HWaddr 02:42:02:97:fc:19 inet addr:171.18.0.1 Bcast:0.0.0.0 Mask:255.255.0.0 inet6 addr: fe80::42:2ff:fe97:fc19/64 Scope:Link UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:1202 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:137378 (137.3 KB) docker0 Link encap:Ethernet HWaddr 02:42:e6:dd:41:9c inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) enp3s0 Link encap:Ethernet HWaddr 3c:97:0e:52:9c:4b inet addr:192.168.1.124 Bcast:192.168.1.124 Mask:255.255.255.255 inet6 addr: fe80::f45:59f7:5048:911c/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:523084 errors:0 dropped:80 overruns:0 frame:0 TX packets:628988 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:212687829 (212.6 MB) TX bytes:247005317 (247.0 MB) Interrupt:19 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:53197 errors:0 dropped:0 overruns:0 frame:0 TX packets:53197 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1 RX bytes:5917170 (5.9 MB) TX bytes:5917170 (5.9 MB) tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:11.129.222.84 P-t-P:10.129.222.84 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1412 Metric:1 RX packets:317 errors:0 dropped:0 overruns:0 frame:0 TX packets:1996 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:500 RX bytes:78204 (78.2 KB) TX bytes:532254 (532.2 KB) wlp2s0 Link encap:Ethernet HWaddr 67:94:23:38:c2:f5 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:2 errors:0 dropped:0 overruns:0 frame:777078 TX packets:1 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:226 (226.0 B) TX bytes:143 (143.0 B) Interrupt:17 </code></pre> <p><strong>route</strong> (Before VPNC connected)</p> <pre><code>Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.1.1 0.0.0.0 UG 100 0 0 enp3s0 link-local * 255.255.0.0 U 1000 0 0 br-1b5f9a5d3ef3 182.17.0.0 * 255.255.0.0 U 0 0 0 docker0 182.18.0.0 * 255.255.0.0 U 0 0 0 br-1b5f9a5d3ef3 192.168.1.1 * 255.255.255.255 UH 100 0 0 enp3s0 192.168.1.124 * 255.255.255.255 UH 100 0 0 enp3s0 oo-234.officeweb 192.168.1.1 255.255.255.255 UGH 0 0 0 enp3s0 255.255.255.0 * 255.255.255.255 UH 100 0 0 enp3s0 </code></pre> <p><strong>route</strong> (After VPNC connected)</p> <pre><code>kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default * 0.0.0.0 U 0 0 0 tun0 default 192.168.1.1 0.0.0.0 UG 100 0 0 enp3s0 10.129.222.84 * 255.255.255.255 UH 0 0 0 tun0 link-local * 255.255.0.0 U 1000 0 0 br-1b5f9a5d3ef3 182.17.0.0 * 255.255.0.0 U 0 0 0 docker0 182.18.0.0 * 255.255.0.0 U 0 0 0 br-1b5f9a5d3ef3 192.168.1.1 * 255.255.255.255 UH 100 0 0 enp3s0 192.168.1.124 * 255.255.255.255 UH 100 0 0 enp3s0 oo-234.officeweb 192.168.1.1 255.255.255.255 UGH 0 0 0 enp3s0 255.255.255.0 * 255.255.255.255 UH 100 0 0 enp3s0 </code></pre> <p><strong>Edit: 1</strong></p> <p><strong>route</strong> (after <code>route del default dev tun0</code>)</p> <pre><code>Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.1.1 0.0.0.0 UG 100 0 0 enp3s0 default 192.168.43.1 0.0.0.0 UG 600 0 0 wlp2s0 11.12.222.107 * 255.255.255.255 UH 0 0 0 tun0 link-local * 255.255.0.0 U 1000 0 0 br-1b5f9a5d3ef3 171.17.0.0 * 255.255.0.0 U 0 0 0 docker0 172.18.0.0 * 255.255.0.0 U 0 0 0 br-1b5f9a5d3ef3 192.168.1.1 * 255.255.255.255 UH 100 0 0 enp3s0 192.168.1.124 * 255.255.255.255 UH 100 0 0 enp3s0 192.168.43.0 * 255.255.255.0 U 600 0 0 wlp2s0 oo-234.officeweb 192.168.1.1 255.255.255.255 UGH 0 0 0 enp3s0 255.255.255.0 * 255.255.255.255 UH 100 0 0 enp3s0 </code></pre>
0non-cybersec
Stackexchange
2,260
5,966
Poll: Ugliest car of all time?. My Top Picks 1.) [Fiat Multipla](http://upload.wikimedia.org/wikipedia/commons/thumb/e/e0/Fiat_Multipla_silver_front.JPG/280px-Fiat_Multipla_silver_front.JPG) 2.) [Ford Scorpio](http://gomotors.net/pics/Ford/ford-scorpio-ii-06.jpg) 3.) [Lancia Y](http://upload.wikimedia.org/wikipedia/commons/2/2c/Lancia_Y_1.2_Fire_rear.JPG) 4.) [SSangYong Rodius](http://gomotors.net/pics/Ssangyong/ssangyong-rodius-03.jpg) 5.) [SsangYong Korrado](http://assets.carbuzz.co.uk/blog/Ssangyong+korrando.jpg) (or any SsangYong for that matter) Let's hear what yours are.
0non-cybersec
Reddit
263
590
lowest achievable watts for decent resolution display?. <p>I have an unusual question. The scenario is onboard computing / entertainment for a live aboard boat with a very tight energy budget. I'm trying to figure out what is the most energy efficient display technology that is capable or pretty high resolutions? </p> <p>Is it LCD or perhaps pico projectors are starting to get into the HD arena? Do 1080p pico projectors exist yet? </p> <p>I'm considering the possibility of a pico projector because there's usually not very much light below deck. </p>
0non-cybersec
Stackexchange
132
559
Relationship between $\Sigma_{1}$ and $\Pi_{1}$ functions (Logic). <p>I am working on the following homework problem for a logic class on Godel's incompleteness theorems and the following question is asked.</p> <blockquote> <p>Is the converse of Theorem $13.1$ true? Explain.</p> </blockquote> <p>Theorem 13.1 states, "If a function is $\Sigma_{1}$ it is also $\Pi_{1}$." So, we are asked to prove or disprove that, "If a function is $\Pi_{1}$ it is also $\Sigma_{1}$." I think that the converse is true and I have attempted the question by giving the following "proof",</p> <blockquote> <p>Assume that $f$ is a $\Pi_{1}$ function. That is, $f$ can be expressed by a strictly $\Pi_{1}$ wff. Let $\Phi(x,y):=\forall \eta_{1} \cdot \cdot \cdot \forall \eta_{k} \varphi(x,y)$ be such a $\Pi_{1}$ wff, where $\varphi(x,y)$ is $\Delta_{0}$. Well, by DeMorgan's law for quantifiers, we have that $\forall \eta_{1} \cdot \cdot \cdot \forall \eta_{k} \varphi(x,y) \equiv \exists \eta_{1} \cdot \cdot \cdot \exists \eta_{k} \neg \varphi(x,y)$, where $\neg \varphi(x,y)$ is again $\Delta_{0}$. So, $\Phi(x,y) = \exists \eta_{1} \cdot \cdot \cdot \exists \eta_{k} \neg \varphi(x,y)$ still expresses $f$ and so since $\Phi(x,y)$ is not only $\Pi_{1}$, but $\Sigma_{1}$, we conclude that $f$ is also $\Sigma_{1}$.</p> </blockquote> <p>This seems to be a sufficient argument for my tastes (disregard my idiotic proof), but the proof the book gave for Theorem 13.1 seems to be of quite a different style, I will post it here:</p> <blockquote> <p>Suppose the one-place function $f$ can be expressed by the strictly $\Sigma_{1}$ wff $\varphi(x,y)$. Since $f$ is a function, and maps numbers of unique values, we have $f(m) =n$ if and only if $\forall z ( f(m) = z \rightarrow z = n)$. Hence $f(m)=n$ if and only if $\forall z(\varphi(\bar{m},z) \rightarrow z= \bar{n})$ is true. In other words, $f$ is equally well expressed by $\forall z(\varphi(x,z) \rightarrow z=y)$. But it is a trivial exercise of moving quantifiers around to show that if $\varphi(x,y)$ is strictly $\Sigma_{1}$, then $\forall z(\varphi(x,z) \rightarrow z=y)$ is $\Pi_{1}$.</p> </blockquote> <p>(Note that, $\bar{x}$ means the value of $x$, meaning $\underbrace{S \cdot \cdot \cdot S}_\text{x times}0$).</p> <p>It seems that the book is actually using an explicit wff to express $f$, in my case I just keep $\Phi$ as some ethereal wff which we assume expresses $f$; is there any problem with this? I essentially want to know if my proof is adequate, and if not where I went wrong or what I misunderstand. It seems to me utterly trivial to prove both Theorem 13.1 and its converse if the method I provided is correct, which is why I suspect that my method is incorrect. Any suggestions and nudges in the right direction would be greatly appreciated, thank you!</p>
0non-cybersec
Stackexchange
890
2,833
Postgresql and comparing to an empty field. <p>It seems that in PostgreSQL, <code>empty_field != 1</code> (or some other value) is <strong>FALSE</strong>. If this is true, can somebody tell me how to compare with empty fields? </p> <p>I have following query, which translates to "select all posts in users group for which one hasn't voted yet:</p> <pre><code>SELECT p.id, p.body, p.author_id, p.created_at FROM posts p LEFT OUTER JOIN votes v ON v.post_id = p.id WHERE p.group_id = 1 AND v.user_id != 1 </code></pre> <p>and it outputs nothing, even though <strong>votes</strong> table is empty. Maybe there is something wrong with my query and not with the logic above?</p> <p><strong>Edit:</strong> it seems that changing <code>v.user_id != 1</code>, to <code>v.user_id IS DISTINCT FROM 1</code>, did the job. From PostgreSQL docs:</p> <blockquote> <p>For non-null inputs, IS DISTINCT FROM is the same as the &lt;> operator. However, when both inputs are null it will return false, and when just one input is null it will return true.</p> </blockquote>
0non-cybersec
Stackexchange
344
1,070
Bibliography with enumerate. <p>I have the following MWE</p> <pre><code>\documentclass[12pt, A4paper]{article} \usepackage{amssymb} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{graphicx} \usepackage{wrapfig} \usepackage{lscape} \usepackage{rotating} \usepackage{bm} \usepackage{epstopdf} \usepackage[nodayofweek]{datetime} \usepackage{setspace} \usepackage[left=2cm, right=2cm, top=2cm,bottom=2cm]{geometry} \newcommand{\overbar}[1]{\mkern 1.5mu\overline{\mkern-1.5mu#1\mkern-1.5mu}\mkern 1.5mu} \begin{document} \section{References} \begin{enumerate} \item Autor, David, David Dorn, Gordon Hanson, and Kaveh Majlesi (2016). ``A Note on the Effect of Rising Trade Exposure on the 2016 Presidential Election.'' Mimeo, MIT Department of Economics. \item Baldwin, Richard (2016). \emph{The Great Convergence. Information Technology and the New Globalization}. Cambridge: Harvard University Press. \item Baumeister, Roy F. and Mark R. Leary (1995). ``The Need to Belong: Desire for Interpersonal Attachments as a Fundamental Human Motivation''. \emph{Psychological Bulletin}, 117:497-529. \item Bavetta, Sebastiano and Francesco Guala, (2003). ``Autonomy Freedom and Deliberation''. \emph{Journal of Theoretical Politics}, 15: 423-443. \end{enumerate} \end{document} </code></pre> <p>The above is a bibliography for a paper. When I use enumerate each reference is marked as 1. and so on. I would like to have [1] instead. I know that I can reach that result by using an appropriate style and bibtex. However, I need to use enumerate. Any hint about? Thanks in advance</p>
0non-cybersec
Stackexchange
489
1,591
MS BOT Framework (adaptive cards): How to send value (Stepcontext.Value) from directline. <p>I have deployed a Bot in Azure, the Bot displays a welcome message OnMemberAdd. Its adaptive card so the entered value are sent to stepcontext.value. I have integrated it with multiple channels, for directline, I would like to bypass the welcome card and pass the message directly to stepcontext.value so the second prompt is displayed instead of first. I have tried the below but it does not work, please help.</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang="en-US"&gt; &lt;head&gt; &lt;title&gt;Web Chat: Send welcome event&lt;/title&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt; &lt;script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"&gt;&lt;/script&gt; &lt;style&gt; html, body { height: 100%; } body { margin: 0; } #webchat { height: 100%; width: 100%; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="webchat"&gt;&lt;/div&gt; &lt;script&gt; (async function() { // In this demo, we are using Direct Line token from MockBot. // Your client code must provide either a secret or a token to talk to your bot. // Tokens are more secure. To learn about the differences between secrets and tokens // and to understand the risks associated with using secrets, visit https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-direct-line-3-0-authentication?view=azure-bot-service-4.0 const { token } = { token}; // We are using a customized store to add hooks to connect event const store = window.WebChat.createStore({}, ({ dispatch }) =&gt; next =&gt; action =&gt; { if (action.type === 'DIRECT_LINE/CONNECT_FULFILLED') { dispatch({ type: 'WEB_CHAT/SEND_EVENT', payload: { name: 'userInfo', value: { fname:'user', lname:'test', pnumber:'0678775453'} } }); } return next(action); }); const styleOptions = { botAvatarImage: '', botAvatarInitials: 'Chatbot', userAvatarImage: '', userAvatarInitials: 'User', showNub: true, bubbleFromUserNubOffset: 'bottom', bubbleFromUserNubSize: 10, bubbleFromUserBorderColor: '#0077CC', bubbleNubOffset: 'top', bubbleNubSize: 0, bubbleBorderColor: '#009900', sendBoxButtonColor: '#009900', hideUploadButton: true, hideSendBox : true }; window.WebChat.renderWebChat( { directLine: window.WebChat.createDirectLine({ token }), store, styleOptions }, document.getElementById('webchat') ); document.querySelector('#webchat &gt; *').focus(); })().catch(err =&gt; console.error(err)); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I have tried to send the data via postman and it works well but when I do it using above code it does not work.</p> <p>Postman body</p> <pre><code>{ "type": "message", "from": { "id": "user1" }, "value": { "fname":"user", "lname":"test", "pnumber":"0678787543" } } </code></pre>
0non-cybersec
Stackexchange
1,018
3,236
Android unit test using ant with library project. <p>It seems that also the latest android SDK tools still don't properly support testing of applications that contain linked library projects.</p> <p>I have a project with the following setup:</p> <p>TestLib (android library project) &lt;- TestMain (android project) &lt;- TestMainTest (android unit test project)</p> <p>I created all those projects in eclipse and then used <code>android update (test-/lib-)project ...</code> to generate the <code>build.xml</code> et. al.</p> <p>The problem starts as soon as you have a class in TestMain (<code>InheritAddition.java</code> in my example) that inherits from a class in TestLib (<code>Addition.java</code>) and you want to reference this class in the unit test (<code>InheritAdditionTest.java</code>).</p> <h2>TestLib</h2> <pre><code>public class Addition { public int add2(int o1, int o2) { return o1 + o2; } } </code></pre> <h2>TestMain</h2> <pre><code>public class InheritAddition extends Addition { public int sub(int p1, int p2) { return p1 - p2; } } </code></pre> <h2>TestMainTest</h2> <pre><code>public class InheritAdditionTest extends AndroidTestCase { public void testSub() { Assert.assertEquals(2, new InheritAddition().sub(3, 1)); } } </code></pre> <p>When building on the command line the result is the following:</p> <pre> W/ClassPathPackageInfoSource(14871): Caused by: java.lang.NoClassDefFoundError: org/test/main/InheritAddition W/ClassPathPackageInfoSource(14871): ... 26 more W/ClassPathPackageInfoSource(14871): Caused by: java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation W/ClassPathPackageInfoSource(14871): at dalvik.system.DexFile.defineClass(Native Method) W/ClassPathPackageInfoSource(14871): at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:195) W/ClassPathPackageInfoSource(14871): at dalvik.system.DexPathList.findClass(DexPathList.java:315) W/ClassPathPackageInfoSource(14871): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:58) W/ClassPathPackageInfoSource(14871): at java.lang.ClassLoader.loadClass(ClassLoader.java:501) W/ClassPathPackageInfoSource(14871): at java.lang.ClassLoader.loadClass(ClassLoader.java:461) W/ClassPathPackageInfoSource(14871): ... 26 more W/dalvikvm(14871): Class resolved by unexpected DEX: Lorg/test/main/InheritAddition;(0x41356250):0x13772e0 ref [Lorg/test/lib/Addition;] Lorg/test/lib/Addition;(0x41356250):0x13ba910 </pre> <p>I found some workaround that works for eclipse:</p> <p><a href="https://stackoverflow.com/questions/2472059/cant-build-and-run-an-android-test-project-created-using-ant-create-test-proje">Can&#39;t build and run an android test project created using &quot;ant create test-project&quot; when tested project has jars in libs directory</a></p> <p>That does the trick, but I am looking for a solution that works with ANT (more precisely I am looking for a solution that works on both at the same time).</p> <p>The documented approach (by changing build.xml to include jars from the main project into the class path) is not applicable here as the sample project doesn't use any library jars (also I believe that this particular problem is now fixed with SDK tools r16).</p> <p>I guess the brute force way of solving that is to try and somehow remove the dependencies of <code>TestMainTest</code> to <code>TestLib</code> (by modifying <code>project.properties</code>) and instead manage to hack the build script to put those built jars into the class path (so replace the <code>-compile</code> target with something that modifies the class path for <code>javac</code>). Since I have a long history of trying to keep up with android SDK toolchain changes, this is not really my favorite option as it is a) rather complicated and b) requires constant modification of the <code>build.xml</code> whenever the toolchain changes (which is quite frequently).</p> <p>So I am looking for ideas of how to get such a setup working without using the sledge hammer. Maybe I am missing something totally obvious but for me this use case is fairly standard and I have a hard time understanding why this isn't supported out of the box.</p>
0non-cybersec
Stackexchange
1,254
4,277
Generating function of $\frac{h(x)}{(1-x)^2}$. <blockquote> <p>If <span class="math-container">$h(x)$</span> is the generating function for <span class="math-container">$a_r$</span>, what is the generating function of <span class="math-container">$$\frac{h(x)}{(1-x)^2}$$</span></p> </blockquote> <p>Let <span class="math-container">$h(x)$</span> be written as</p> <p><span class="math-container">$$h(x) = \sum_{r} a_r x^r $$</span></p> <p>Consider more simply</p> <p><span class="math-container">$$\frac{h(x)}{1-x} = \frac{1}{1-x} h(x) =\sum_{r} x^r \sum_{r} a_r x^r$$</span></p> <p>I tried to expand this and see what I could get</p> <p><span class="math-container">$$(1+x+x^2+x^3+\dots+x^r+\dots)(a_0+a_1x+a_2x^2+a_3x^3+\dots+a_rx^r+\dots)$$</span></p> <p>there are two ways to simplify the product, either</p> <p><span class="math-container">$$a_0(1+x+x^2+\dots)+a_1(x+x^2+x^3+\dots)+ a_2(x^2+x^3+x^4+\dots)+\dots= \sum_ra_r\sum_{k\ge r}x^k$$</span></p> <p>or <span class="math-container">$$a_0 + (a_0+a_1)x+(a_0+a_1+a_2)x^2+(a_0+a_1+a_2+a_3)x^3 = \sum_r \left(\sum_{k\le r}a_k \right)x^r$$</span></p> <p>obviously this is only for one factor of <span class="math-container">$\frac{1}{1-x}$</span> but I assume If I can get help for this I can extend it to two factors.</p> <p>I'm not sure what form the answer is expected to be in? Because I could say the generating function is</p> <p><span class="math-container">$$\frac{h(x)}{1-x} = h\left(\sum_{k \ge r}x^k\right)$$</span></p> <p>but I'm not sure that makes any sense. I was expecting to say something like</p> <p><span class="math-container">$$\frac{h(x)}{1-x} \mapsto h(x^2)$$</span></p> <p>(the <span class="math-container">$x^2$</span> is not intentional, just some idea of what I believe the answer could look like)</p> <p>Any help for the case of <span class="math-container">$\frac{1}{1-x}$</span> would be great and then I could extend it to <span class="math-container">$\frac{1}{(1-x)^2}$</span></p>
0non-cybersec
Stackexchange
830
1,987
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
Modulo expansion with divisor multiples. <p>Is there any general expansion for 'a mod mn' ?<br> mod is modulo operation: <a href="http://en.wikipedia.org/wiki/Modulo_operation" rel="nofollow">http://en.wikipedia.org/wiki/Modulo_operation</a></p> <pre><code>Eg: we have (a + b ) mod n = ((a mod n) + (b mod n)) mod n (a x b ) mod n = ((a mod n) x (b mod n)) mod n Similarly, Is there any simplification/expansion for : a mod (m x n) = ? </code></pre> <p>Thanks</p> <p>Edit: Added example for clarification</p>
0non-cybersec
Stackexchange
189
513
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
Bungie, I would 100% be willing to buy Destiny 2 on PC if Cross-Save could be implemented. While I bought D2 on PS4 and love it, I would very much enjoy having the option to play at a nice 60fps on my PC as well. Unfortunately, the main thing holding me back from making the leap is all the 300+ hours I've already put into D2 across three different characters on PS4. I am not sure from a technical standpoint how difficult it would be but I would bet the main issue for this being a feature would be console exclusive content (such as on the PS4). I would hope there could be a way around this, such as locking out the exclusive strikes from being playable when playing on PC. Anyone else in the same boat?
0non-cybersec
Reddit
166
708
How do I grant NETWORK SERVICE read permissions. <p>I'm currently learning ASP.NET and I'm running into difficulties integrating SQL Server into ASP.NET. I'm trying to grant NETWORK SERVICE read permission as follows:</p> <p>4.NETWORK SERVICE must be granted Read permission to the top-level Visual Studio folder located in your user's Documents folder. The Visual Studio folder will have different names depending on the version: "Visual Studio 2005", "Visual Studio 2008", or "Visual Studio 2010".</p> <p>5.NETWORK SERVICE must be granted both read and write permissions to your project's top-level project folder. For example if your WAP project is called "MyCustomWebProject", then the folder "Documents\Visual Studio 20xx\Projects\MyCustomWebProject" needs to have read and write access enabled for NETWORK SERVICE. Or, if your webiste project is called "MyCustomWebProject", then the folder "Documents\Visual Studio 20xx\Websites\MyCustomWebProject" needs to have read and write access enabled for NETWORK SERVICE.</p> <p>6.NETWORK SERVICE must be granted both read and write permissions to the App_Data folder located within your web project's directory structure.</p> <p>I've located the folders and accessed their properties but under security I do not have an entry for NETWORK SERVICE, how do I grant NETWORK SERVICE read and write permissions?</p>
0non-cybersec
Stackexchange
332
1,369
Girlfriend can't feel sex? Suggestions?. Alright, throwaway account here. My girlfriend and I have been having some bedroom-related issues for awhile. And after lurking around this subreddit for awhile, I thought I'd ask for some help. Firstly, she's pretty shy in bed. Basically, I thought that I'd never given her an orgasm, but she informed me later that she had finished long before me almost every time we had sex. I didn't know this however, because she is always completely silent in bed. When asking her why she didn't say anything sooner, she just told me that she felt very shy. we also haven't ventured very far in terms of positions (Missionary, Cowgirl, Sitting up on Couch). And for the last little while, she's told me that she now doesn't feel anything. Shes said that she feels the initial penetration, and it's good for about five seconds afterwards, and then nothing. I've tried to talk to her, asking what I can do to make it better, what she thinks I'm doing wrong, and all that kind of stuff, and she simply responds with "I don't know" There is the occasional time (1 in 10-15) that everything is good, and she orgasms, but obviously that is not a very good number. I want her to enjoy sex as much as I do. It's certainly not as nice when the only way I can finish her is with my hand or mouth (which she doesn't usually want afterwards because she's frustrated about not feeling anything) Needless to say, it's getting frustrating for the both of us. She still wants me, all the time for some reason. Though I love that, I'm finding myself not looking forward to sex nearly as much anymore, because if it doesn't go well, she seems angry at me, and I kind of get the cold shoulder for the rest of the night, and sometimes next morning (which I believe is absolutely unfair) Any tips, suggestions, or what people who may have been in similar situations did to overcome it would be greatly appreciated. Thanks! tl: dr- girlfriend can't feel sex anymore, shy and doesn't know what to say about it, frustrated, need advice. Then all of a sudden,
0non-cybersec
Reddit
494
2,079
virtualization platform: Ubuntu + KVM/Xen. <p>performance and feature set offered by the latest Ubuntu 11.04?</p> <p>while it works best as virtual workstation with direct attached storage, what is the tool-stack offered for server virtualization management: VM, network and storage provisioning?</p> <p>want to be using the latest Linux Kernel and Filesystems: EXT4, XFS which are not offered by XenCloud Platform</p> <p>thanks in advance for sharing your experiences/advice</p>
0non-cybersec
Stackexchange
132
484
Evaluate $I=\int_{0}^{\infty}\frac{(x^2+x+1)dx}{(x^3+x+1)\sqrt{x}}$. <p>Evaluate <span class="math-container">$$I=\int_{0}^{\infty}\frac{(x^2+x+1)dx}{(x^3+x+1)\sqrt{x}}$$</span></p> <p>My try:</p> <p>Letting <span class="math-container">$\sqrt{x}=t$</span> we get</p> <p><span class="math-container">$$I=2\int_{0}^{\infty} \frac{t^4+t^2+1}{(t^6+t^2+1)}\,dt$$</span></p> <p>Now</p> <p><span class="math-container">$$t^4+t^2+1=(t^2+1)^2-(t^2+1)+1$$</span></p> <p><span class="math-container">$$t^6+t^2+1=(t^2+1)^3-2(t^2+1)^2+(t^2+1)+1$$</span></p> <p>Any clue then?</p>
0non-cybersec
Stackexchange
300
575
Thinking about upgrading from the iPhone 5 to a iPhone 6. Would like some advice.. Recently, my iPhone 5's (not 5s) camera went out and I mainly use the camera along with a few other apps. As far as upgrading, I have to buy **off contract** since Im still grandfathered into the *Unlimited Plan* at **Verizon**. I've been looking at the iPhone 6 and the pricing and it is quite expensive so I want to know the best way of going about the upgrade to a new phone. I've looked at **Amazon, Ebay, and Gazelle** so far and all the prices vary. **1.)** Do I need to buy an Unlocked iPhone 6 to be off contract? **2.)** Where is the best place to get an iPhone for the best price? (*Not going the craigslist route*) **3.)** Should I buy certified used if I go through Gazelle? **4.)** Should I wait till the iPhone 6s? **5.)** Maybe I should just repair the iPhone 5 camera? Any input is greatly accepted!!
0non-cybersec
Reddit
246
908
Lotus Domino 8.5.3 FP6 ignoring archive policy. <p>We are using Domino 8.5.3 FP6. (64bit) on Win-2008 R2 64bit.</p> <p>We have a policy to archive emails older then 365 days into archive folder (for all users). 2 years back, our server crashed dueto hardware failure. we acquired new hardware and restored the email DB's and settings from backup. all went fine.</p> <p>After that we noticed that archive policy which run weekly and moves mails older then 365 days is moving many recent random emails like last days, week,month to the 'Older than 365days Archive' folder so I disabled archiving. </p> <p>Today i found out that it happens with old accounts only, And Accounts which were created after that crash are working ok there archive is ok.</p> <p>I have executed fixup -f -j , tried replacing the Mailfile template, Running an Updall -RX and a Compact -C. but no use.</p> <p>my server is still bleeding with this bloody issue from past 2 years till date. most users inbox have crossed 15-20 Gb and above.</p> <p>When ever i try to run the archive, it does not select only 365 days old. it selects random emails like one week, one month, few months also and move them to archive which creates confusion when users try to search recent email.</p> <p>its getting very frustrating for me </p>
0non-cybersec
Stackexchange
348
1,303
Java JMS Messaging. <p>I have a working example of sending message to server and server receiving it via qpid messaging. Here is simple hello world to send to server :</p> <p><a href="http://pastebin.com/M7mSECJn" rel="noreferrer">http://pastebin.com/M7mSECJn</a></p> <p>And here is server which receives requests and sends response(the current client doesn't receive response) :</p> <p><a href="http://pastebin.com/2mEeuzrV" rel="noreferrer">http://pastebin.com/2mEeuzrV</a></p> <p>Here is my property file :</p> <p><a href="http://pastebin.com/TLEFdpXG" rel="noreferrer">http://pastebin.com/TLEFdpXG</a></p> <p>They all work perfectly, I can see the messages in the qpid queue via Qpid JMX management console. These examples are downloaded from <a href="https://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/example" rel="noreferrer">https://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/example</a> (someone may need it also).</p> <p>I've done Jboss messaging using spring before, but I can't manage to do the same with qpid. With jboss inside applicationsContext I had beans jndiTemplate, conectionFactory, destinationQueue, and jmscontainer like this :</p> <pre><code>&lt;!-- Queue configuration --&gt; &lt;bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate"&gt; &lt;property name="environment"&gt; &lt;props&gt; &lt;prop key="java.naming.factory.initial"&gt;org.jnp.interfaces.NamingContextFactory&lt;/prop&gt; &lt;prop key="java.naming.provider.url"&gt;jnp://localhost:1099&lt;/prop&gt; &lt;prop key="java.naming.factory.url.pkgs"&gt;org.jboss.naming:org.jnp.interfaces&lt;/prop&gt; &lt;prop key="java.naming.security.principal"&gt;admin&lt;/prop&gt; &lt;prop key="java.naming.security.credentials"&gt;admin&lt;/prop&gt; &lt;/props&gt; &lt;/property&gt; &lt;/bean&gt; &lt;bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean"&gt; &lt;property name="jndiTemplate" ref="jndiTemplate" /&gt; &lt;property name="jndiName" value="ConnectionFactory" /&gt; &lt;/bean&gt; &lt;bean id="queueDestination" class="org.springframework.jndi.JndiObjectFactoryBean"&gt; &lt;property name="jndiTemplate" ref="jndiTemplate" /&gt; &lt;property name="jndiName"&gt; &lt;value&gt;queue/testQueue&lt;/value&gt; &lt;/property&gt; &lt;/bean&gt; &lt;bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer"&gt; &lt;property name="connectionFactory" ref="connectionFactory" /&gt; &lt;property name="destination" ref="queueDestination" /&gt; &lt;property name="messageListener" ref="listener" /&gt; &lt;/bean&gt; </code></pre> <p>and of course sender and listener :</p> <pre><code> &lt;bean id="sender" class="com.practice.Sender"&gt; &lt;property name="connectionFactory" ref="connectionFactory" /&gt; &lt;property name="queueDestination" ref="queueDestination" /&gt; &lt;/bean&gt; &lt;bean id="listener" class="com.practice.MsgListener" /&gt; </code></pre> <p>Now I'd like to rewrite this qpid example using spring context logic. Can anyone help me?</p>
0non-cybersec
Stackexchange
1,116
3,115
How to check if hot-swap or hot-plug are activated on my Linux machine. <p>I have Ubuntu 12.04.1 LTS 64-bit on a PowerEdge 2900. My current setup has two 300GB disks (no RAID), but I want migrate the system to three new 600GB disks. I'm trying to connect the new disks, make a RAID5 array, and copy my partitions to the new RAID, but i'm not sure if the server has hot-plug support or, in particular, if it's activated.</p> <p>Looking at the system I get:</p> <pre><code>admin@host:~$ lsscsi -v [4:0:0:0] disk HITACHI HUS151414VLS300 A48B /dev/sda dir: /sys/bus/scsi/devices/4:0:0:0 [/sys/devices/pci0000:00/0000:00:05.0/0000:01:00.0/0000:02:08.0/host4/port-4:0/end_device-4:0/target4:0:0/4:0:0:0] [4:0:1:0] disk HITACHI HUS151414VLS300 A48B /dev/sdb dir: /sys/bus/scsi/devices/4:0:1:0 [/sys/devices/pci0000:00/0000:00:05.0/0000:01:00.0/0000:02:08.0/host4/port-4:1/end_device-4:1/target4:0:1/4:0:1:0] admin@host:~$ lspci | grep '02:08.0' 02:08.0 SCSI storage controller: LSI Logic / Symbios Logic SAS1068 PCI-X Fusion-MPT SAS (rev 01) </code></pre> <p><a href="http://www.lsi.com/products/storagecomponents/Pages/LSISAS1068.aspx" rel="nofollow">LSI SAS 1068</a> has hot-swap support according to the description, but I'm not sure, and I can't power-off the system for migration or check in bios. I'm afraid to just connect a disk in case it damages the controller or the disk itself, so I need a way to check if hot-plug/hot-swap is activated in the system.</p>
0non-cybersec
Stackexchange
582
1,490
Analyticity of one-dimensional PDE solutions with respect to the space variable. <p>Let $n&gt;1$ and $u$ be a solution of a linear PDE with constant coefficients $$ u_t-\sum_{k=0}^n a_k \partial_x^k u=0,\quad a_k\in \mathbb C,\quad a_n\ne0, $$ in some neighborhood of a point $(x_0,t_0)$ on a plane. Is it true that the function $u(x,t_0)$ is analytic in some neighborhood of $x_0$?</p> <p>In some special cases, such as the heat equation it follows from results of Petrovskii, namely that solutions of homogeneous parabolic equations with analytic coefficients are analytic with respect to space variables. But in the general case I'm unable to find a reference.</p>
0non-cybersec
Stackexchange
200
670
How do the steady states change as we change the parameter?. <blockquote> <p>Consider the following ODE <span class="math-container">$$ \frac{dx}{dt} = x \left(1-\frac{x}{m} - \frac{a}{1+x}\right), $$</span> where <span class="math-container">$a$</span> is a bifurcation parameter and <span class="math-container">$a\in(0,\infty)$</span> a positive constant. How do you find the steady states as <span class="math-container">$a$</span> varies? And what are the bifurcation points? I know that <span class="math-container">$\frac{dx}{dt} = 0$</span>, however how do you move on from there? </p> </blockquote> <p>Also what is conufusing is the <span class="math-container">$m$</span>. It is a fixed parameter. However, how do you find the steady states if you have one parameter that varies and the other one fixed?</p> <p>EDIT: This is what I got after the reading the answer below. The steady points are <span class="math-container">$x=0$</span> and <span class="math-container">$$ x = \frac{-(m-1)\pm \sqrt{(m-1)^2+4m(1-a)}}{2} $$</span> where <span class="math-container">$m&gt;0$</span>. Now my question is how do you determine the stability of such a complicated root? You get distinct roots when <span class="math-container">$0&lt; a\leq1$</span>. However as soon as <span class="math-container">$a&gt;1$</span> I am not sure if I get a complex root or a distinct root because of the parameter <span class="math-container">$m$</span>. </p> <p>Moreover,how do you determine their stability? Lastly,what are their bifurcation points?</p> <p>NOTE: This a dimensionless biological system.</p>
0non-cybersec
Stackexchange
507
1,612
Identify local maximum/minimum from contour map. <p><a href="https://i.stack.imgur.com/DZBGq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DZBGq.png" alt="contour map"></a></p> <p>function f = green level curves, constraint g = pink curve</p> <p>I'm supposed to identify what point A and B are in the function f. The options are (a) local max (b) local min (c) neither.</p> <p>For A, I think it is a local minimum. For B, I think it is neither. </p> <p>Can someone tell me if I'm wrong or right? If wrong, why? Thank you. </p>
0non-cybersec
Stackexchange
194
552