text
stringlengths
3
1.74M
label
class label
2 classes
source
stringclasses
3 values
File on USB 0 size. <p>I had a file on a USB stick, and I was editing it but then I saved it and pulled out the USB. Later when I plugged it back in, the file had a size of 0 as well as the backup made by kwrite(I a running linux). What happened? And how can I recover it?</p>
0non-cybersec
Stackexchange
3 days in, and River is handling self isolation pretty well, thank you.
0non-cybersec
Reddit
Slippery "slip-resistant" mat..
0non-cybersec
Reddit
Is the subset $\{P\in C[0,1]: P \text{ is polynomial and} P(0)=P&#39;(0)=0 \}$ dense in $L^1[0,1]$?. <p>Is the subset $\{P\in C[0,1]: P \text{ is polynomial and} P(0)=P'(0)=0 \}$ dense in $L^1[0,1]$?</p> <p>We know that for any $f\in L^1[0,1]$ and small enough $\epsilon$, there exists $g\in C_c[0,1]$ , $supp(g)\subseteq [0,1]$ st $||f-g||_1 &lt;\epsilon.$ For continuous $g$ above, we know $g(0)=0$, then there is a polynomial $P$ st $P(0)=0$, and $||g-p||_\infty &lt;\epsilon$. So the set $\{P\in C[0,1]: P \text{ is polynomial and} P(0)=0 \}$ is dense in $L^1[0,1]$.</p> <p>But if we strengthen it a little, we constrain that the first derivative at $0$ of polynomial is also $0$, can we get the same result? </p>
0non-cybersec
Stackexchange
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
Just found my new favourite brand of clothing. It's called Religion. I think you guys will like it..
0non-cybersec
Reddit
Finnish prime minister forgot to renew his site.
1cybersec
Reddit
He Went To The Barber And Asked For That LEGO Skin Fade.
0non-cybersec
Reddit
My dad saved my life and became a quadripeligic, but he still survived several heart attacks, a brain cancer scare, and being revived 9 times. Here he is with my equally amazing mom. .
0non-cybersec
Reddit
What should I use the Master Ball on in Emerald?. I was going to use it on Rayquaza but someone said I should use it on Latios or Latias. Thoughts?
0non-cybersec
Reddit
PHP &quot;for&quot; loop that lists all even numbers and displays a sum of all odd numbers from an array. <p>My task is to create a loop that displays all even numbers in a column and it also displays a sum of all odd numbers in an array. So far I have made this:</p> <pre><code>&lt;?php $numbers = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); foreach ($numbers as $index=&gt;$value) { if ($value % 2 == 0) echo "$value &lt;br&gt;"; } ?&gt; </code></pre> <p>This code successfully displays a list of all even numbers. However, I still have to include a sum of all odd numbers that is displayed below the list of evens. For some reason, I am supposed to use a variable $sumOdd = 0.</p> <p>How do I approach this from here on?</p>
0non-cybersec
Stackexchange
Fresh installed Windows XP refuses to update. <p>today I installed Windows XP SP2 Home on a computer. I went to try to run Windows Update on it and was greeted with "The website has encountered a problem and cannot display the page you are trying to view -- error number 0x8024400A"</p> <p><a href="http://lastyearswishes.com/static/updateerror.png"><img src="https://i.stack.imgur.com/N4pQf.png" alt="enter image description here"></a></p> <p>I've encountered this kind of problem a lot of times. I remember when I worked at a computer repair shop 6 or so years ago I encountered it on a lot of computers running Windows XP. I never figured out how to fix it other than to do a reinstall of Windows. Googling for the error number never came up with any solutions either.</p> <p>What is it that causes this problem and how do I fix it? </p> <p>Edit:</p> <p>Well, now I've installed <code>windowsupdateagent30-x86</code> and that got me to where I can now browse a list of needed updates, but when I go to install updates I get the same generic error message, but with error number 0x80070715</p>
0non-cybersec
Stackexchange
Don't think about it Morty....
0non-cybersec
Reddit
Kings in tournament. <p>What is the difference between king,serf and strong king? How to prove that if a tournament has no vertex with zero in-degree, then it has at least 3 kings. </p>
0non-cybersec
Stackexchange
How to change the unit for product weight in Magento?. <p>What is the default product weight unit in Magento? How can I change it?</p>
0non-cybersec
Stackexchange
How do I convert from void * back to int. <p>if I have</p> <pre><code>int a= 5; long b= 10; int count0 = 2; void ** args0; args0 = (void **)malloc(count0 * sizeof(void *)); args0[0] = (void *)&amp;a; args0[1] = (void *)&amp;b; </code></pre> <p>how can I convert from args[0] and args0[1] back to int and long? for example</p> <pre><code>int c=(something im missing)args0[0] long d=(something im missing)args1[0] </code></pre>
0non-cybersec
Stackexchange
My Moira career has officially peaked.
0non-cybersec
Reddit
How to get the video thumbnail path, and not the bitmap. <p>This question is actually asked and supposedly answered here: <a href="https://stackoverflow.com/questions/14483682/android-get-video-thumbnail-path-not-bitmap">android get video thumbnail PATH, not Bitmap</a>. </p> <p>I've tried several times but can't get it to work. I always get a null returned. Any help on this please?</p> <p><strong>Edit:</strong> The sample code I'm using now:</p> <pre><code>public static String getVideoThumbnailPath(Context context, String filePath) { String thubmnailPath; String where = Video.Thumbnails.VIDEO_ID + " In ( select _id from video where _data =?)"; final String[] VIDEO_THUMBNAIL_TABLE = new String[] { Video.Media._ID, // 0 Video.Media.DATA, // 1 }; Uri videoUri = MediaStore.Video.Thumbnails.getContentUri("external"); Cursor c = context.getContentResolver().query(videoUri, VIDEO_THUMBNAIL_TABLE, where, new String[] { filePath }, null); if ((c != null) &amp;&amp; c.moveToFirst()) { thubmnailPath = c.getString(1); c.close(); Log.i(TAG, "thumb path: " + thubmnailPath); return thubmnailPath; } else { c.close(); Log.i(TAG, "thumb path is null"); return null; } } </code></pre>
0non-cybersec
Stackexchange
Stacked rafts.
0non-cybersec
Reddit
What is the difference between &#39;Capacity&#39; and &#39;%iused&#39; when running the &#39;df&#39; command in the terminal. <p>When I run the <code>df</code> command I'm getting different values for <code>capacity</code> and <code>%iused</code>. What is the difference between them?</p> <p><img src="https://i.stack.imgur.com/fq0p9.png" alt="enter image description here"></p>
0non-cybersec
Stackexchange
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
Sawmill.
0non-cybersec
Reddit
How to share local files to docker container In swarm with docker-compose. <p>here is my docker compose file </p> <pre><code>version: '2' services: demoui: image: demoimage ports: - "80:8000" volumes: - ./democonfig/config.js:/usr/local/tomcat/webapps/demo-ui/config.js - ./logs/demo-ui:/usr/local/tomcat/logs restart: unless-stopped </code></pre> <p>This docker compose file works when I was in single node. After moving to docker swarm . It is not working. It throws the following error</p> <pre><code>ERROR: for demoui Error response from daemon: rpc error: code = 2 desc = "oci runtime error: could not synchronise with container process: not a directory" Traceback (most recent call last): File "&lt;string&gt;", line 3, in &lt;module&gt; File "compose/cli/main.py", line 63, in main AttributeError: 'ProjectError' object has no attribute 'msg' docker-compose returned -1 </code></pre> <p>So the questions are</p> <ol> <li><p>How to share file to swarm cluster ?</p></li> <li><p>Or need to copy all file into image and run it?</p></li> <li><p>Please share some documentation of docker volume with swarm.</p></li> </ol>
0non-cybersec
Stackexchange
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
I hope this belongs here. My friends dog came running up to us with this.
0non-cybersec
Reddit
Functions differentiable at zero. <p>Is there a case where a function $f$ that is not differentiable at $0$ and a function $g$ that is differentiable at $0$ where $f+g$ is differentiable at $0$?</p>
0non-cybersec
Stackexchange
The reverse cover.
0non-cybersec
Reddit
จีคลับคาสิโน ก็องปานีป้องแฟนหลังยูฟ่าสอบกรณีโห่เพลงชปล..
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
My cozy little happy garden.
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
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
[IDEA] "You have fewer than the recommended number of players for this raid... (Refund Raid Pass?) (Battle Anyway)". It's a simple fix for the problem of not knowing if you should use your raid pass or not. With no way to scout whether people are there or not, something needs to be done. The 'feel bad' experience when you end up being the only one at a level 4 gym and you wait there for an hour and nobody shows up... It's not good. Raids have a recommended number of players. If the timer ticks down and reaches 0 (10?) then it could ask you this question. This would also serve as a ready check to make sure everyone is ready right before the battle. "You have fewer than the recommended number of players for this raid..." (Refund Raid Pass) (Quit and Wait) (Battle Anyway) *-side rant- Feel absolutely cheated into buying an extra raid pass because of this issue. I should never be made to feel bad about purchases in game. And don't even get me started on rural player issues where there are no pokestops having to buy pokeballs...* edit: minor text fix
0non-cybersec
Reddit
I bought a lathe on the 5th. Didn't really get to use it that weekend, but this is what I've done since it was delivered. Critique, pointers, etc? (x-post from /r/turning).
0non-cybersec
Reddit
Humble setup.
0non-cybersec
Reddit
How to measure remaining daylight.
0non-cybersec
Reddit
Does Nvidia driver have any business with Xorg configuration?. <p>16.04 LTS, 4.15.13-041513-generic. Finally got Nvidia 390.25 driver working. Downloaded from graphics ppa. According to the Nvidia installation guide, I should let nvidia-xconfig rewrite the Xorg.conf, but it causes The login screen loop (Secure Boot ON, you guessed it). However, after Xorg.conf being deleted, the OS starts fine. Not sure about the graphics driver working currently, but if I managed to start Maple software, it seems like Nvidia is in action.</p> <p>So, I spilled liters of sweat to make the Nvidia driver work, something disturbed, whatever that was, but this time I'm shocked to know Xorg has no deal with Nvidia driver. If I'm right..?</p> <p>I couldn't sign SSH keys by (read the log below)</p> <pre><code>-> Signing kernel module: executing: '"/lib/modules/4.15.13-041513-generic/build/scripts/sign-file" "/root/.ssh/id_rsa.pub" "/root/.ssh/id_rsa" "./kernel/nvidia.ko"'... Usage: scripts/sign-file [-dp] [] scripts/sign-file -s [] executing: '"/lib/modules/4.15.13-041513-generic/build/scripts/sign-file" "sha512" "/root/.ssh/id_rsa.pub" "/root/.ssh/id_rsa" "./kernel/nvidia.ko"'... At main.c:163: - SSL error:0906D06C:PEM routines:PEM_read_bio:no start line: pem_lib.c:701 sign-file: /root/.ssh/id_rsa.pub: Success -> Failed to sign kernel module. ERROR: Installation has failed. Please see the file '/var/log/nvidia-installer.log' for details. You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.</code></pre> <p>Yes, I had to download the .run file for the same driver version. Or I didn't, I was just in a hurry to complete the damn mission.</p> <p>Anyway, Xorg conf deleted == tout va bien. Question's remaining: should I give a **** (put in whatever suits you, it's your fantasy)? Read helluva many threads around the net and didn't find a working solution. Would appreciate the explanation.</p>
0non-cybersec
Stackexchange
How to stop ProGuard from stripping the Serializable interface from a class. <p>Is there an explicit way to stop ProGuard from changing a class from implementing an interface?</p> <p>I have a class that implements <code>java.io.Serializable</code>, let's call it <code>com.my.package.name.Foo</code>. I've found that after running through ProGuard, it no longer implements <code>Serializable</code>. I get <code>null</code> after I cast from <code>Serializable</code> to <code>Foo</code> and <code>false</code> if I check an instance with <code>instanceof Serializable</code>. I've made sure to set ProGuard to ignore this class:</p> <pre><code>-keep class com.my.package.name.Foo </code></pre> <p>I've also tried:</p> <pre><code>-keep class com.my.package.name.Foo { *; } </code></pre> <p>and I've also tried the whole package by doing this:</p> <pre><code>-keep class com.my.package.name.** { *; } </code></pre> <p>or:</p> <pre><code>-keep class com.my.package.** { *; } </code></pre> <p>and also just to keep all <code>Serializable</code> classes:</p> <pre><code>-keep class * implements java.io.Serializable { *; } </code></pre> <p>but to no avail. I have another class in a sibling package (roughly: <code>com.my.package.name2.Bar</code>) that also implements <code>Serializable</code> and is used similarly but has no issues.</p> <p>I'm not sure it's relevant, but I'm packing this in a jar for use with Android. The code that uses these classes include putting them in <code>Bundle</code>s which is why I need <code>Serializable</code>. I considered that perhaps somehow ProGuard thinks that <code>Foo</code> is never used as a <code>Serializable</code> but that seems unlikely given that I pass it as a parameter to <code>Bundle.putSerializable(String, Serializable)</code> and also I do an implicit cast: <code>Serializable serializable = foo;</code>. In fact, when I debug, I can see the <code>Foo</code> get put into the <code>Bundle</code> and I can examine the <code>Bundle</code> and see the instance of <code>Foo</code> there, but when retrieving it the cast fails. </p>
0non-cybersec
Stackexchange
UITableViewAutomaticDimension not working until scroll. <p>When the Table View is first loaded, all of the visible cells are the estimatedRowHeight. As I scroll down, the cells are being automatically sized properly, and when I scroll back up the cells that were initially estimatedRowHeight are being automatically sized properly.</p> <p>Once the cells are being automatically sized, they don't ever seem to go back to being the estimatedRowHeight.</p> <pre><code>override func viewDidLoad() { super.viewDidLoad() self.navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .Plain, target: nil, action: nil) self.tableView.estimatedRowHeight = 80.0 self.tableView.rowHeight = UITableViewAutomaticDimension // Uncomment the following line to preserve selection between presentations // self.clearsSelectionOnViewWillAppear = false // Uncomment the following line to display an Edit button in the navigation bar for this view controller. // self.navigationItem.rightBarButtonItem = self.editButtonItem() } </code></pre> <p>and</p> <pre><code> override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell { let cellIdentifier = "Cell" let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as CustomTableViewCell // Configure the cell... let restaurant = restaurants[indexPath.row] cell.namelabel.text = restaurant.name cell.locationlabel.text = restaurant.location cell.typelabel.text = restaurant.type cell.thumbnailImageView.image = UIImage(named: restaurant.image) cell.thumbnailImageView.layer.cornerRadius = cell.thumbnailImageView.frame.size.width / 2 cell.thumbnailImageView.clipsToBounds = true cell.accessoryType = restaurant.isVisited ? .Checkmark : .None return cell } </code></pre> <p>Thoughts on how to have the cells autoresize initially?</p> <p><strong>UPDATE:</strong> As of Xcode 7 beta 6 this is no longer an issue</p>
0non-cybersec
Stackexchange
Geometric interpretation of the Noether normalization lemma. <p>I am currently working my way through a proof of the following statement: Let $X$ be an integral, affine $k$-Variety of dimension $n$. Then there exists a surjective morphism $X\rightarrow \mathbb{A}_k^n$ with finite fibres.</p> <p>The book containing the proof in question introduces the dimension of $X$ as the trancendence degree of the function field $K(X)$ over $k$. It then uses an anti-equivalence between the category of affine varieties over $k$ and that of finitely generated, reduced $k$-Algebras and Noether's normalization lemma for existence of such a morphism. It think I understand it except for the following: the coordinate ring $\mathcal{O}(X)$ is by Noether's normalization lemma a finitely generated $k[x_1,...,x_n]$-module. Let $M_P=(x_1-a_1,...,x_n-a_n)$ for any $P=(a_1,...,a_n)\in \mathbb{A}_k^n$. The book then claims that if follows that $\mathcal{O}(X)/M_P\mathcal{O}(X)$ is a finite-dimensional $k$-Algebra (Then $\mathcal{O}(X)/M_P\mathcal{O}(X)$ would only have finitely many maximal ideals which correspond to the points in the preimage of $P$ under the morphism). Why is that statement true though? I know that if in general if $A$ is a finitely generated $k$-Algebra and $M$ a maximal ideal in $A$ then $A/M$ is a finite-dimensional $k$-Algebra. But $M_P\mathcal{O}(X)$ isn't necessarily maximal, right? What am I missing?</p>
0non-cybersec
Stackexchange
Minimalist Miso Marinated Chilean Seabass.
0non-cybersec
Reddit
Problem with characters in SSH with MingW32 and not super-user. <p>I am connecting to my server with SSH from Windows 10 with MINGW32 (Git).</p> <p>When I connect and user the <strong>root user</strong> everything works correctly but when I login with another user and use special characters like <strong>backspace</strong> or similar, the console shows <strong>incorrect characters</strong> and I can't erase.</p> <p>An example:</p> <pre><code>root@sample:/# php -r 'echo "I can write\n";' I can write root@sample:/# php -r 'echo "I can erase without problem\n";' I can erase without problem root@sample:/# su sample $ php -r 'echo "I can write some characters";' I can write some characters $ php -r 'echo "I cant erase and I cant use the up arrow for repeat the last command";' I cant erase and I cant use the up arrow for repeat the last command$ $ ^[[A : not found $ : 16: $ trying erase^H^H^H^H^H </code></pre> <p>With Putty I have not problems.</p> <p>Regards and thanks.</p>
0non-cybersec
Stackexchange
Grammys 2017: Daft Punk Performing With the Weeknd.
0non-cybersec
Reddit
How do I calculate the Fourier transform of $\operatorname{sinc}^2\left ( \pi \frac{t-T}{\pi} \right )$?. <p>How do I calculate the Fourier transform of $\operatorname{sinc}^2\left ( \pi \frac{t-T}{\pi} \right )$?</p> <p>$\frac{\sin t}{t}\;\substack{\mathcal{F}\\ \leftrightarrow} \; \pi \mathrm{rect}\frac \omega 2 = \pi \cdot\begin{cases}0 &amp; \mbox{if } |\omega | &gt; 1 \\\frac{1}{2} &amp; \mbox{if } |\omega | = 1\\1 &amp; \mbox{if } |\omega | &lt; 1. \\ \end{cases}$</p> <p>and than I would do $sinc(t)^2$ but I always get wrong result.</p>
0non-cybersec
Stackexchange
Should I always encapsulate an internal data structure entirely?. <p>Please consider this class:</p> <pre><code>class ClassA{ private Thing[] things; // stores data // stuff omitted public Thing[] getThings(){ return things; } } </code></pre> <p>This class exposes the array it uses to store data, to any client code interested.</p> <p>I did this in an app I'm working on. I had a <code>ChordProgression</code> class that stores a sequence of <code>Chord</code>s (and does some other things). It had a <code>Chord[] getChords()</code> method that returned the array of chords. When the data structure had to change (from an array to an ArrayList), all client code broke.</p> <p>This made me think - maybe the following approach is better:</p> <pre><code>class ClassA{ private Thing[] things; // stores data // stuff omitted public Thing[] getThing(int index){ return things[index]; } public int getDataSize(){ return things.length; } public void setThing(int index, Thing thing){ things[index] = thing; } } </code></pre> <p>Instead of exposing the data structure itself, <strong>all of the operations offered by the data structure are now offered directly by the class enclosing it, using public methods that delegate to the data structure.</strong></p> <p>When the data structure changes, only these methods have to change - but after they do, all client code still works.</p> <p><strong>Note that collections more complex than arrays might require the enclosing class to implement even more than three methods just to access the internal data structure.</strong></p> <hr> <p>Is this approach common? What do you think of this? What downsides does it have other? Is it reasonable to have the enclosing class implement at least three public methods just to delegate to the inner data structure?</p>
0non-cybersec
Stackexchange
Subpoena for app called ‘Discord’ could unmask identities of Charlottesville white supremacists.
0non-cybersec
Reddit
arXiv:cs/9809106v1 [cs.CL] 25 Sep 1998 ar X iv :c s/ 98 09 10 6v 1 [ cs .C L ] 2 5 S ep 1 99 8 Processing Unknown Words in HPSG Petra Barg and Markus Walther∗ Seminar für Allgemeine Sprachwissenschaft Heinrich-Heine-Universität Düsseldorf Universitätsstr. 1, D-40225 Düsseldorf, Germany {barg,walther}@ling.uni-duesseldorf.de Abstract The lexical acquisition system presented in this pa- per incrementally updates linguistic properties of un- known words inferred from their surrounding con- text by parsing sentences with an HPSG grammar for German. We employ a gradual, information- based concept of “unknownness” providing a uni- form treatment for the range of completely known to maximally unknown lexical entries. “Unknown” in- formation is viewed as revisable information, which is either generalizable or specializable. Updating takes place after parsing, which only requires a mod- ified lexical lookup. Revisable pieces of informa- tion are identified by grammar-specified declarations which provide access paths into the parse feature structure. The updating mechanism revises the cor- responding places in the lexical feature structures iff the context actually provides new information. For revising generalizable information, type union is re- quired. A worked-out example demonstrates the in- ferential capacity of our implemented system. 1 Introduction It is a remarkable fact that humans can often un- derstand sentences containing unknown words, in- fer their grammatical properties and incrementally refine hypotheses about these words when encoun- tering later instances. In contrast, many current NLP systems still presuppose a complete lexicon. Notable exceptions include Zernik (1989), Erbach (1990), Hastings & Lytinen (1994). See Zernik for an intro- duction to the general issues involved. This paper describes an HPSG-based system which can incrementally learn and refine proper- ties of unknown words after parsing individual sen- ∗This work was carried out within the Sonderforschungs- bereich 282 ‘Theorie des Lexikons’ (project B3), funded by the German Federal Research Agency DFG. We thank James Kil- bury and members of the B3 group for fruitful discussion. tences. It focusses on extracting linguistic proper- ties, as compared to e.g. general concept learning (Hahn, Klenner & Schnattinger 1996). Unlike Er- bach (1990), however, it is not confined to sim- ple morpho-syntactic information but can also han- dle selectional restrictions, semantic types and argu- ment structure. Finally, while statistical approaches like Brent (1991) can gather e.g. valence informa- tion from large corpora, we are more interested in full grammatical processing of individual sentences to maximally exploit each context. The following three goals serve to structure our model. It should i) incorporate a gradual, information-based conceptualization of “unknown- ness”. Words are not unknown as a whole, but may contain unknown, i.e. revisable pieces of infor- mation. Consequently, even known words can un- dergo revision to e.g. acquire new senses. This view replaces the binary distinction between open and closed class words. It should ii) maximally exploit the rich representations and modelling conventions of HPSG and associated formalisms, with essen- tially the same grammar and lexicon as compared to closed-lexicon approaches. This is important both to facilitate reuse of existing grammars and to en- able meaningful feedback for linguistic theorizing. Finally, it should iii) possess domain-independent in- ference and lexicon-updating capabilities. The gram- mar writer must be able to fully declare which pieces of information are open to revision. The system was implemented using MicroCUF, a simplified version of the CUF typed unification formalism (Dörre & Dorna 1993) that we imple- mented in SICStus Prolog. It shares both the feature logic and the definite clause extensions with its big brother, but substitutes a closed-world type system for CUF’s open-world regime. A feature of our type system implementation that will be significant later on is that type information in internal feature struc- http://arxiv.org/abs/cs/9809106v1 tures (FSs) can be easily updated. The HPSG grammar developed with MicroCUF models a fragment of German. Since our focus is on the lexicon, the range of syntactic variation treated is currently limited to simplex sentences with canon- ical word order. We have incorporated some recent developments of HPSG, esp. the revisions of Pol- lard & Sag (1994, ch. 9), Manning & Sag (1995)’s proposal for an independent level of argument struc- ture and Bouma (1997)’s use of argument structure to eliminate procedural lexical rules in favour of re- lational constraints. Our elaborate ontology of se- mantic types – useful for non-trivial acquisition of selectional restrictions and nominal sorts – was de- rived from a systematic corpus study of a biological domain (Knodel 1980, 154-188). The grammar also covers all valence classes encountered in the corpus. As for the lexicon format, we currently list full forms only. Clearly, a morphology component would sup- ply more contextual information from known affixes but would still require the processing of unknown stems. 2 Incremental Lexical Acquisition When compared to a previous instance, a new sen- tential context can supply either identical, more spe- cial, more general, or even conflicting information along a given dimension. Example pairs illustrating the latter three relationships are given under (1)-(3) (words assumed to be unknown in bold face). (1) a. Im Axon tritt ein Ruhepotential auf. ‘a rest potential occurs in the axon’ b. Das Potential wandert über das Axon. ‘the potential travels along the axon’ (2) a. Das Ohr reagiert auf akustische Reize. ‘the ear reacts to acoustic stimuli’ b. Ein Sinnesorgan reagiert auf Reize. ‘a sense organ reacts to stimuli’ (3) a. Die Nase ist für Gerüche sensibel. ‘the nose is sensitive to smells’ b. Die sensible Nase reagiert auf Gerüche. ‘the sensitive nose reacts to smells’ In contrast to (1a), which provides the information that the gender of Axon is not feminine (via im), the context in (1b) is more specialized, assigning neuter gender (via das). Conversely, (2b) differs from (2a) in providing a more general selectional restriction for the subject of reagiert, since sense organs include ears as a subtype. Finally, the adjective sensibel is used predicatively in (3a), but attributively in (3b). The usage types must be formally disjoint, because some German adjectives allow for just one usage (ehemalig ‘former, attr.’, schuld ‘guilty, pred.’). On the basis of contrasts like those in (1)-(3) it makes sense to statically assign revisable informa- tion to one of two classes, namely specializable or generalizable.1 Apart from the specializable kinds ‘semantic type of nouns’ and ‘gender’, the inflec- tional class of nouns is another candidate (given a morphological component). Generalizable kinds of information include ‘selectional restrictions of verbs and adjectives’, ‘predicative vs attributive usage of adjectives’ as well as ‘case and form of PP argu- ments’ and ‘valence class of verbs’. Note that spe- cializable and generalizable information can cooccur in a given lexical entry. A particular kind of informa- tion may also figure in both classes, as e.g. seman- tic type of nouns and selectional restrictions of verbs are both drawn from the same semantic ontology. Yet the former must be invariantly specialized – indepen- dent of the order in which contexts are processed –, whereas selectional restrictions on NP complements should only become more general with further con- texts. 2.1 Representation We require all revisable or updateable information to be expressible as formal types.2 As relational clauses can be defined to map types to FSs, this is not much of a restriction in practice. Figure 1 shows a rele- vant fragment. Whereas the combination of special- ... genderprd pred attr fem u_g masc neut non_fem nom_sem sense_organ earnose stimulus smellsound Figure 1: Excerpt from type hierarchy izable information translates into simple type unifi- cation (e.g. non fem ∧ neut = neut), combining 1The different behaviour underlying this classification has previously been noted by e.g. Erbach (1990) and Hastings & Lytinen (1994) but received either no implementational status or no systematic association with arbitrary kinds of information. 2In HPSG types are sometimes also referred to as sorts. generalizable information requires type union (e.g. pred ∨ attr = prd). The latter might pose problems for type systems requiring the explicit definition of all possible unions, corresponding to least common supertypes. However, type union is easy for (Mi- cro)CUF and similar systems which allow for arbi- trary boolean combinations of types. Generalizable information exhibits another peculiarity: we need a disjoint auxiliary type u g to correctly mark the ini- tial unknown information state. 3 This is because ‘content’ types like prd, pred, attr are to be inter- preted as recording what contextual information was encountered in the past. Thus, using any of these to prespecify the initial value – either as the side-effect of a feature appropriateness declaration (e.g. prd) or through grammar-controlled specification (e.g. pred, attr) – would be wrong (cf. prdinitial ∨ attr = prd, but u ginitial ∨ attr = u g ∨ attr). Generalizable information evokes another ques- tion: can we simply have types like those in fig. 1 within HPSG signs and do in-place type union, just like type unification? The answer is no, for essen- tially two reasons. First, we still want to rule out ungrammatical constructions through (type) unifica- tion failure of coindexed values, so that generalizable types cannot always be combined by nonfailing type union (e.g. *der sensible Geruch ‘the sensitive smell’ must be ruled out via sense organ ∧ smell = ⊥). We would ideally like to order all type unifications pertaining to a value before all unions, but this vi- olates the order independence of constraint solv- ing. Secondly, we already know that a given infor- mational token can simultaneously be generalizable and specializable, e.g. by being coindexed through HPSG’s valence principle. However, simultaneous in-place union and unification is contradictory. To avoid these problems and keep the declarative monotonic setting, we employ two independent fea- tures gen and ctxt. ctxt is the repository of contex- tually unified information, where conflicts result in ungrammaticality. gen holds generalizable informa- tion. Since all gen values contain u g as a type dis- junct, they are always unifiable and thus not restric- tive during the parse. To nevertheless get correct gen values we perform type union after parsing, i.e. dur- ing lexicon update. We will see below how this works out. 3Actually, the situation is more symmetrical, as we need a dual type u s to correctly mark “unknown” specializable infor- mation. This prevents incorrect updating of known information. However, u s is unnecessary for the examples presented below. The last representational issue is how to identify revisable information in (substructures of) the parse FS. For this purpose the grammar defines revisability clauses like the following: (4) a. generalizable( 1 , 2 ) :=  synsem | loc | cat | head   adj prd [ gen 1 ctxt 2 ]     b. specializable( 1 ) := [ synsem | loc [ cat | head noun cont | ind | gend 1 ]] 2.2 Processing The first step in processing sentences with unknown or revisable words consists of conventional parsing. Any HPSG-compatible parser may be used, subject to the obvious requirement that lexical lookup must not fail if a word’s phonology is unknown. A canon- ical entry for such unknown words is defined as the disjunction of maximally underspecified generic lex- ical entries for nouns, adjectives and verbs. The actual updating of lexical entries consists of four major steps. Step 1 projects the parse FS derived from the whole sentence onto all participating word tokens. This results in word FSs which are contextu- ally enriched (as compared to their original lexicon state) and disambiguated (choosing the compatible disjunct per parse solution if the entry was disjunc- tive). It then filters the set of word FSs by unification with the right-hand side of revisability clauses like in (4). The output of step 1 is a list of update candidates for those words which were unifiable. Step 2 determines concrete update values for each word: for each matching generalizable clause we take the type union of the gen value of the old, lexical state of the word (LexGen) with the ctxt value of its parse projection (Ctxt) : TU = LexGen∪Ctxt. For each matching specializable(Spec) clause we take the parse value Spec. Step 3 checks whether updating would make a dif- ference w.r.t. the original lexical entry of each word. The condition to be met by generalizable information is that TU ) LexGen, for specializable information we similarly require Spec ( LexSpec. In step 4 the lexical entries of words surviving step 3 are actually modified. We retract the old lexical en- try, revise the entry and re-assert it. For words never encountered before, revision must obviously be pre- ceded by making a copy of the generic unknown en- try, but with the new word’s phonology. Revision it- self is the destructive modification of type informa- tion according to the values determined in step 2, at the places in a word FS pointed to by the revis- ability clauses. This is easy in MicroCUF, as types are implemented via the attributed variable mecha- nism of SICStus Prolog, which allows us to substi- tute the type in-place. In comparison, general updat- ing of Prolog-encoded FSs would typically require the traversal of large structures and be dangerous if structure-sharing between substituted and unaffected parts existed. Also note that we currently assume DNF-expanded entries, so that updates work on the contextually selected disjunct. This can be motivated by the advantages of working with presolved struc- tures at run-time, avoiding description-level opera- tions and incremental grammar recompilation. 2.3 A Worked-Out Example We will illustrate how incremental lexical revision works by going through the examples under (5)-(7). (5) Die Nase ist ein Sinnesorgan. ‘the nose is a sense organ’ (6) Das Ohr perzipiert. ‘the ear perceives’ (7) Eine verschnupfte Nase perzipiert den Gestank. ‘a bunged up nose perceives the stench’ The relevant substructures corresponding to the lex- ical FSs of the unknown noun and verb involved are depicted in fig. 2. The leading feature paths synsem|loc|cont for Nase and synsem|loc|cat|arg-st for perzipiert have been omitted. After parsing (5) the gender of the unknown noun Nase is instantiated to fem by agreement with the determiner die. As the specializable clause (4b) matches and the gend parse value differs from its lexical value gender, gender is updated to fem. Fur- thermore, the object’s semantic type has percolated to the subject Nase. Since the object’s sense organ type differs from generic initial nom sem, Nase’s ctxt value is updated as well. In place of the still nonex- isting entry for perzipiert, we have displayed the rel- evant part of the generic unknown verb entry. Having parsed (6) the system then knows that perzipiert can be used intransitively with a nomi- native subject referring to ears. Formally, an HPSG mapping principle was successful in mediating be- tween surface subject and complement lists and the argument list. Argument list instantiations are them- selves related to corresponding types by a further Nase perzipiert after (5)   gend fem gen u g ctxt sense organ   [ gen u g ctxt arg struc ] after (6)   gend fem gen u g ctxt sense organ       gen u g∨npnom ctxt arg struc args 〈[ loc | cont [ gen u g∨ear ctxt nom sem ]] | 〉     after (7)   gend fem gen u g ctxt nose           gen u g∨npnom∨npnom npacc ctxt arg struc args 〈 [ loc | cont [ gen u g∨sense organ ctxt nom sem ]] , [ loc | cont [ gen u g∨smell ctxt nom sem ]] | 〉         Figure 2: Updates on lexical FSs mapping. On the basis of this type classification of argument structure patterns, the parse derived the ctxt value npnom. Since gen values are generaliz- able, this new value is unioned with the old lexi- cal gen value. Note that ctxt is properly unaffected. The first (subject) element on the args list itself is targeted by another revisability clause. This has the side-effect of further instantiating the underspecified lexical FS. Since selectional restrictions on nominal subjects must become more general with new con- textual evidence, the union of ear and the old value u g is indeed appropriate. Sentence (7) first of all provides more specific evi- dence about the semantic type of partially known Nase by way of attributive modification through ver- schnupfte. The system detects this through the differ- ence between lexical ctxt value sense organ and the parse value nose, so that the entry is specialized ac- cordingly. Since the subject’s synsem value is coin- dexed with the first args element, [ ctxt nose ] simulta- neously appears in the FS of perzipiert. However, the revisability clause matching there is of class general- izable, so union takes place, yielding ear ∨ nose = sense organ (w.r.t. the simplified ontology of fig. 1 used in this paper). An analogous match with the second element of args identifies the necessary up- date to be the unioning-in of smell, the semantic type of Gestank. Finally, the system has learned that an accusative NP object can cooccur with perzipiert, so the argument structure type of gen receives another update through union with npnom npacc. 3 Discussion The incremental lexical acquisition approach de- scribed above attains the goals stated earlier. It re- alizes a gradual, information-based conceptualiza- tion of unknownness by providing updateable formal types – classified as either generalizable or special- izable – together with grammar-defined revisability clauses. It maximally exploits standard HPSG rep- resentations, requiring moderate rearrangements in grammars at best while keeping with the standard assumptions of typed unification formalisms. One noteworthy demand, however, is the need for a type union operation. Parsing is conventional modulo a modified lexical lookup. The actual lexical revision is done in a domain-independent postprocessing step guided by the revisability clauses. Of course there are areas requiring further consid- eration. In contrast to humans, who seem to leap to conclusions based on incomplete evidence, our ap- proach employs a conservative form of generaliza- tion, taking the disjunction of actually observed val- ues only. While this has the advantage of not leading to overgeneralization, the requirement of having to encounter all subtypes in order to infer their com- mon supertype is not realistic (sparse-data problem). In (2) sense organ as the semantic type of the first argument of perzipiert is only acquired because the simplified hierarchy in fig. 1 has nose and ear as its only subtypes. Here the work of Li & Abe (1995) who use the MDL principle to generalize over the slots of observed case frames might prove fruitful. An important question is how to administrate alternative parses and their update hypotheses. In Das Aktionspotential erreicht den Dendriten ‘the action potential reaches the dendrite(s)’, Dendriten is ambiguous between acc.sg. and dat.pl., giving rise to two valence hypotheses npnom npacc and npnom npdat for erreicht. Details remain to be worked out on how to delay the choice between such alternative hypotheses until further contexts provide enough information. Another topic concerns the treatment of ‘cooc- currence restrictions’. In fig. 2 the system has in- dependently generalized over the selectional restric- tions for subject and object, yet there are clear cases where this overgenerates (e.g. *Das Ohr perzipiert den Gestank ‘the ear perceives the stench’). An idea worth exploring is to have a partial, extensible list of type cooccurrences, which is traversed by a recursive principle at parse time. A more general issue is the apparent antagonism between the desire to have both sharp grammatical predictions and continuing openness to contextual revision. If after parsing (7) we transfer the fact that smells are acceptable objects to perzipiert into the re- stricting ctxt feature, a later usage with an object of type sound fails. The opposite case concerns newly acquired specializable values. If in a later context these are used to update a gen value, the result may be too general. It is a topic of future research when to consider information certain and when to make re- visable information restrictive. References Bouma, G. (1997). Valence Alternation without Lexi- cal Rules. In: Papers from the seventh CLIN Meet- ing 1996, Eindhoven, 25–40. Brent, M. R. (1991). Automatic Acquisition of Subcat- egorization Frames From Untagged Text. In: Pro- ceedings of 29th ACL, Berkeley, 209–214. Dörre, J. & M. Dorna (1993). CUF – A Formalism for Linguistic Knowledge Representation. In: J. Dörre (Ed.), Computational Aspects of Constraint-Based Linguistic Description. IMS, Universität Stuttgart. Deliverable R1.2.A, DYANA-2 – ESPRIT Project 6852. Erbach, G. (1990). Syntactic Processing of Un- known Words. IWBS Report 131, Institute for Knowledge-Based Systems (IWBS), IBM Stuttgart. Hahn, U., M. Klenner & K. Schnattinger (1996). Learning from Texts - A Terminological Meta- Reasoning Perspective. In: S. Wermter, E. Riloff & G. Scheler (Ed.), Connectionist, Statistical, and Symbolic Approaches to Learning for Natural Lan- guage Processing, 453–468. Berlin: Springer. Hastings, P. M. & S. L. Lytinen (1994). The Ups and Downs of Lexical Acquisition. In: Proceedings of AAAI’94, 754–759. Knodel, H. (1980). Linder Biologie – Lehrbuch für die Oberstufe. Stuttgart: J.B. Metzlersche Verlags- buchhandlung. Li, H. & N. Abe (1995). Generalizing Case Frames Us- ing a Thesaurus and the MDL Principle. In: Pro- ceedings of Recent Advantages in Natural Lan- guage Processing, Velingrad, Bulgaria, 239–248. Manning, C. & I. Sag (1995). Dissociations between argument structure and grammatical relations. Ms., Stanford University. Pollard, C. & I. Sag (1994). Head-Driven Phrase Structure Grammar. Chicago University Press. Zernik, U. (1989). Paradigms in Lexical Acquisition. In: U. Zernik (Ed.), Proceedings of the First Inter- national Lexical Acquisition Workshop, Detroit.
0non-cybersec
arXiv
Recovering 3 private keys if Eve knows that the keys are shared prime numbers and knows their public keys, How would this be done?. <p>okay so here is the original question:</p> <p>Alice Bob and Carl are generating public keys for RSA, but they are lazy and decide to share some of the work of generating prime numbers. They find 3 large prime numbers p,q and r, then Alice uses the modulus $n_A = pq$, Bob uses the modulus $n_B = pr$ and Carl uses the modulus $n_C = qr$. The prime numbers used are much to large factoring to be feasible, but Eve learns that they shared prime numbers (and knows their public keys) how does she obtain p, q and r?</p> <p>My thinking or possible reasoning for this question. Since Eve knows the public keys and that the keys share prime numbers she can compute the GCD of n or factorize n in order to calculate or find the private keys. In this case she would first use Euclid's algorithm for $n_A = pq$ &amp; $n_B= pr $ which we know is p because both n's share a common prime $p$. She would use the same process for computing $q$ which is $n_A = pq$ &amp; $n_C = qr$. Shes does it a third time for $r$ which $n_B = pr$ &amp; $n_C = qr$.</p> <p>I want to know If I am thinking about this the right way or if I have the right idea. If I am on the right track, how do I mathematically represent this? </p>
0non-cybersec
Stackexchange
Linear transformation defined on vector space of twice differentiable functions to $R^2$.How to determine whether it is one to one or onto. <p>Given that T is a linear transformation from V to <span class="math-container">$R^2$</span> where V be the vector space of all twice differentiable functions with the condition that <span class="math-container">$f''(0)-2f'(0)+f(0)=0$</span> and <span class="math-container">$T(f)=(f'(0),f(0))$</span> Then how to determine whether it is one one or onto I was trying to find out the dimension of the vector space V<br> But I am unable to find an basis of V How to proceed with this please help</p>
0non-cybersec
Stackexchange
Jordan Peterson and His Damn Lobsters...?.
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
Xpath select cell in table being in last row in fixed column position. <p>How can I use XPath to click a button in a table in a specific position? The column is constant and it is always the last row. I have the id of the table, but the cell contains a delete button, whose value is dynamic - a generated hash value.</p> <pre><code>Xpath = ".//[@=id='blah']/tbody/tr[5]/td[5]" # &lt;- this xpath fails. </code></pre> <p>This is for automation - python using the selenium.</p>
0non-cybersec
Stackexchange
Is it possible to format small-caps in Google Documents?. <p>I have found the need to format text in small caps (with minuscule letters looking like capitals, but still maintaining their size) in Google Docs. I have looked over, under, and in the Docs option menus, but I still have not found any such thing.</p> <p>I need to apply small caps to a small font size, and the font size won't go any further down, so the method of scaling all-caps text of a smaller font size won't work.</p>
0non-cybersec
Stackexchange
Android:What is difference between setFlags and addFlags for intent. <p>What is difference between setFlags and addFlags for intent. Could any one explain it please. Help Appreciated.</p>
0non-cybersec
Stackexchange
American Chemical Society: I’m May Nyman here to answer your questions about the August 12 warehouse explosion in Tianjin, China, AMA!. Hello, May Nyman here, professor of chemistry at Oregon State University. A warehouse exploded in Tianjin, China last week that did the damage of 20 tons of dynamite, felt like an earthquake, looked like a nuclear explosion from space, but we don’t know yet what caused it. Many different chemicals were stored in that warehouse, and scientists and other experts can only hypothesize what happened, and what will happen next. At Oregon State University, I run a [research lab](http://nyman.chem.oregonstate.edu/), training young scientists from all over the country and the world. We are inorganic synthetic chemists, and we make materials for energy and environmental applications. For example, we collaborate with other scientists in the [Center for Sustainable Materials Chemistry](http://sustainablematerialschemistry.org/) developing low energy methods to make the materials you find inside your smartphone and computer. We also work with scientists in the [Energy Frontier Research Center, Materials Science of Actinides](http://www.msa-efrc.com/) to discover new ways to make nuclear energy more efficient and safer. For the [Department of Energy](http://science.energy.gov/bes/mse/research-areas/materials-chemistry/), we figure out ways to make new materials with new properties. I have not always been a professor; for only three years in fact. I started my career at Sandia National Labs, studying nuclear wastes, and inventing ways to remove the radioactive elements and store them safely. I also figured out ways to make the water that we drink cleaner. But what I love most of all about chemistry is the beautiful and perfectly functional things in nature that are completely composed of the elements of the periodic table; including rocks and minerals, butterfly wings, leaves, and DNA! August 12, 2015 was a sad day for chemists when such a tragic accident happened that gives chemistry a bad name, and results in people fearing chemicals. The officials do not yet know what exactly happened, what caused the explosion, how it could’ve been prevented, and which chemicals stored in the warehouse might have been the source of explosion. We also do not know why the fish are dying and why ‘soap suds’ are observed everywhere after it rained in Tianjin. We do not know what the short-term or long-term impact of this accident will be, or if the people living near the accident site or sites like it are in danger of future explosions. We know of about a half dozen chemicals that were stored there including calcium carbide; ammonium potassium and sodium nitrate; sodium cyanide; toluene diisocyanate; and compressed gases. As scientists, we can form hypotheses of what chemical reactions could have occurred in Tianjin at the scene of this most unfortunate event. Update: strangely enough there was a second warehouse explosion a few hundred miles away, 10 days later in Shandong; the chemical mentioned here is adiponitrile I’ll be back at 1:00pm ET to begin answering your questions. EDIT: 9:53 PT good day Reddit community, Thank you for all your questions. I am online now until 2:00 Eastern time. May Nyman EDIT: 11:10 PT. thank you for all the fantastic questions and comments, Reddit community. My official hour is up, and I need to take a break and work on my day job. I will come back at 3:00 PT to answer some more questions. May Nyman EDIT: 2:59 PT I am back to answer a few more of these many many questions. and I will be sure to address storage, as this question comes up in various forms. May Nyman EDIT: 3:49 PT. It has been fun talking with you, Reddit community. A good day to all. May Nyman
0non-cybersec
Reddit
LPT: store your ice cream tubs in freezer bags in the freezer. This will keep them "just opened soft" for a long time.. I was skeptical, but seriously, try it. The ice cream will stay soft and scoop easy like you just opened it. No more bending spoons or running them under hot water.
0non-cybersec
Reddit
Wings | Animated Short Film.
0non-cybersec
Reddit
How to make OpenGL viewport have the exact size and position of my QML item which renders into it?. <p>I'm trying to render a <code>640x360</code> red square inside a <code>1280x720</code> window. The problem is that OpenGL's viewport won't automatically be inside the area occupied by the square into the Qt window system. That is, if my video object have <code>640x360</code> dimensions, the OpenGl viewport still have the <code>1280x720</code> dimensions (WHY?).</p> <p>Anyways, I can fix that by using <code>glViewport(this-&gt;x, this-&gt;y, this-&gt;width, this-&gt;height);</code>. The problem is that in OpenGL, the coordinate system has origin at the left low corner, and <code>this-&gt;x, this-&gt;y, this-&gt;width, this-&gt;height</code> are from the object's coordinates in QML syntax, where the origin is in the upper left corner. The result is this:</p> <p><strong>main.qml</strong>:</p> <pre><code>import QtQuick 2.0 import OpenGlVideoQtQuick2 1.0 Grid { columns: 2 spacing: 2 width: 1280 height: 720 OpenGlVideoQtQuick2 { width: 640 height: 360 } } </code></pre> <p><strong>but the red square occupies the 3rd grid instead of the 1st one:</strong></p> <p><a href="https://i.stack.imgur.com/zIBLN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zIBLN.png" alt="enter image description here"></a></p> <p>I could <strong>easily</strong> fix that by doing <code>glViewport(this-&gt;x, WINDOW_HEIGHT-this-&gt;y, this-&gt;width, this-&gt;height);</code> where <code>WINDOW_HEIGHT</code> would have the value <code>720</code>, however I don't think I should trust the OpenGL viewport to always have the size of the window, so instead I should get the OpenGl viewport dimensions, but I don't think that that is possible. </p> <p>I tried</p> <pre><code>GLint dims[2] = {9999, 9999}; glGetIntegerv(GL_MAX_VIEWPORT_DIMS, dims); std::cout &lt;&lt; "dimenson x:" &lt;&lt; dims[0] &lt;&lt; " dimenson y:" &lt;&lt; dims[1] &lt;&lt; std::endl; </code></pre> <p>which gives me <code>dimenson x:8192 dimenson y:8192</code> which makes no sense to me.</p> <p>Here is the OpenGL rendering code: <a href="https://github.com/lucaszanella/QQuickPaintedItemBug/blob/0a8ef6b5229afa7113ec1e4e3838981042792329/OpenGlVideoQtQuick2.cpp" rel="nofollow noreferrer">https://github.com/lucaszanella/QQuickPaintedItemBug/blob/0a8ef6b5229afa7113ec1e4e3838981042792329/OpenGlVideoQtQuick2.cpp</a></p> <p>You can view an entire buildable project here: <a href="https://github.com/lucaszanella/QQuickPaintedItemBug/tree/0a8ef6b5229afa7113ec1e4e3838981042792329" rel="nofollow noreferrer">https://github.com/lucaszanella/QQuickPaintedItemBug/tree/0a8ef6b5229afa7113ec1e4e3838981042792329</a></p>
0non-cybersec
Stackexchange
Where can I find log of System program problem?. <p>Every time I turn on my computer, I will meet many dialogues saying:</p> <p><img src="https://i.stack.imgur.com/RUZmS.png" alt="enter image description here"></p> <p>But after I click <code>Report problem</code>, it disappears and nothing more happens.</p> <p>Where can I find log for those problem ?</p>
0non-cybersec
Stackexchange
House Lannister Feature [Video].
0non-cybersec
Reddit
Well that was quick. My kid has already decided what he thinks about me..
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
One of the more interesting profiles I've seen.
0non-cybersec
Reddit
Not a fan of too many female rappers but this chick RIPS IT.
0non-cybersec
Reddit
IAmA mental health worker, who gets assaulted by patients, but cannot defend myself due to hospital policies..
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
jQuery Mousewheel Scroll Horizontally. <p>I'm currently developing a horizontally website that can enable my mouse scroll to scroll to the left and right... </p> <p>My jQuery included sequence:</p> <pre><code>&lt;script type="text/javascript" src="js/jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/jquery-1.11.1.js"&gt;&lt;/script&gt; &lt;!--jquery validation script--&gt; &lt;script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"&gt;&lt;/script&gt; &lt;!--Smooth Scroll--&gt; &lt;script type="text/javascript" src="js/jquery.easing.1.3.js"&gt;&lt;/script&gt; </code></pre> <p>My code as below:</p> <pre><code>&lt;script type="text/javascript" src="js/jquery.mousewheel.min.js"&gt;&lt;/script&gt; &lt;script&gt; $.noConflict(); $(function() { $("body").mousewheel(function(event,delta) { this.scrollLeft -= (delta * 30); event.preventDefault(); }) }) $(function() {...}); $(document).ready(function() { $('#form').validate({...}); $("#submit").click(function() {...}); }) &lt;/script&gt; </code></pre> <p>My "body" CSS as below:</p> <pre><code>html { width:100%; overflow-y:hidden; overflow-x: scroll; } body{ } </code></pre> <p>For right now the code that I doubt is:</p> <pre><code>&lt;!--Smooth Scroll--&gt; &lt;script type="text/javascript" src="js/jquery.easing.1.3.js"&gt;&lt;/script&gt; </code></pre> <p>which is crashing with the mouse scroll I think.</p> <p>The mouse scroll is working, the only problem is the mouse scroll is not smooth, sometimes stop there, sometimes cant even move, is not my mouse problem. I'm not sure what's cause this because I tried to debug it for 2 days already. Anyone here to share their thoughts on this issue?</p> <p>I been finding solution but it looked weird on my case. Scroll until a certain part and is jam at the middle. (Just the scrolling bar.) I'm using Chrome on Mac for testing. Btw is there any solution like AutoShift while scrolling because that's worked for me when I pressed Shift button.</p>
0non-cybersec
Stackexchange
Eagles Defender, Avonte Maddox, taunts Packers TE, Allen Lazard, after the play. Lazard shows him the flag..
0non-cybersec
Reddit
Engineering students who call themselves engineers. Why do you do this?.
0non-cybersec
Reddit
Making hostapd work with systemd-networkd using a bridge. <p>I have two ethernet ports and one wireless port on a router I am setting up. I am using systemd-networkd. I am renaming the ports first then creating a bridge then am bridging one of the the ethernet ports and the wireless board to create on combined lan port with a single IP and DHCP/DNSMASQ. The other ethernet being the wan port. Here you see the the networkctl output. lan is the bridge. You see wlan has same status as lan2 (which is the NIC and is working fine). So the bridge and all the routing is fine. </p> <pre><code>IDX LINK TYPE OPERATIONAL SETUP 1 lo loopback carrier unmanaged 2 wan ether routable configured 3 lan2 ether carrier configuring 4 wlan wlan carrier configuring 5 lan ether routable configured </code></pre> <p>So.....I am pretty close. It's only getting hostapd to start at the right time using systemd-networkd. The AP comes up but it looks like the wireless interface is not getting bound to the bridge. A client can enter WPA password and it is accepted but then it never connects. The logs aren't helping me to identify the issue but I am pretty sure the wireless port is not getting fixed to the bridge. That would explain why the AP functions seems fine but then there is not actual connection with an IP address being given out.</p> <p>Anyone with some experience have some tips? As you can see the hostapd.service I wrote tries to delay starting hostapd until networkd is done, in particular until the bridge has been created. Maybe it's something to do with hostapd delaying for networkd but networkd adding wlan to the lan bridge before hostapd has started...kinda a catch22.</p> <p>hostapd.conf</p> <pre><code>interface=wlan # the interface used by the AP hw_mode=g # g simply means 2.4GHz band channel=10 # the channel to use #ieee80211d=1 # limit the frequencies used to those allowed in the country #country_code=US # the country code ieee80211n=1 # 802.11n support #wmm_enabled=1 # QoS support #ignore_broadcast_ssid=0 ssid=645-gateway # the name of the AP auth_algs=1 # 1=wpa, 2=wep, 3=both wpa=2 # WPA2 only wpa_key_mgmt=WPA-PSK rsn_pairwise=CCMP wpa_passphrase=elf645Keb1920 </code></pre> <p>hostapd.service</p> <pre><code>[Unit] Description=Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator Wants=network-online.target After=systemd-networkd.service After=sys-subsystem-net-devices-wlan.device After=sys-subsystem-net-devices-lan.device BindsTo=sys-subsystem-net-devices-lan.device [Service] Type=forking PIDFile=/run/hostapd.pid ExecStart=/usr/sbin/hostapd /etc/hostapd/hostapd.conf -P /run/hostapd.pid -B [Install] WantedBy=multi-user.target </code></pre> <p>30-br-wlan-lan.network</p> <pre><code>[Match] Name=wlan [Network] Bridge=lan </code></pre>
0non-cybersec
Stackexchange
Preseed failed with exit 2. <p>Preseed does not seem to work for me. When executing the preseee/lat command it fails with exit 2. At this point after trying it 6 times it would be nice to get some advice.</p> <p>Every time I got an exit 2.</p> <p>This is the part of the preseed that fails:</p> <pre><code>d-i preseed/late_command string \ apt-install mednafen mame wget git openssh-server; \ in-target wget --no-check-certificate http://build.ppsspp.org/builds/iOS-fat/ppssppbuildbot-org.ppsspp.ppsspp-1.1.1-ios-fat.deb -O /home/arcadia/ppsspp.deb; \ in target dpkg -i /home/arcadia/ppsspp.deb; \ in-target git config http.sslVerify "false" &amp;&amp; git clone https://github.com/Prezto/Arcadia /opt/arcadia; \ in-target echo '#!/bin/bash' &gt; /usr/bin/arcadia; \ in-target echo '/opt/arcadia/Arcadia' &gt; /usr/bin/arcadia; \ in-target chmod a+x /usr/bin/arcadia; \ in-target git config http.sslVerify "false" &amp;&amp; git clone https://github.com/Prezto/Arcadia-splash /lib/plymouth/themes/arcadia-splash; \ in-target update-alternatives --install /lib/plymouth/themes/default.plymouth default.plymouth /lib/plymouth/themes/arcadia-splash/arcadia-splash.plymouth 100; \ in-target update-alternatives --set default.plymouth /lib/plymouth/themes/arcadia-splash/arcadia-splash.plymouth; \ in-target cat /etc/systemd/system/getty.target.wants/[email protected] | sed -e "s/ExecStart=-\/sbin\/agetty --noclear \%I \$TERM/ExecStart=-\/sbin\/agetty --autologin arcadia --noclear \%I \$TERM/" &gt; /etc/systemd/system/getty.target.wants/[email protected]; \ in-target mkdir -p /home/arcadia/.config/openbox; \ in-target echo 'hsetroot /lib/plymouth/themes/arcadia-splash/arcadia.png &amp;' &gt; /home/arcadia/.config/openbox/autostart; \ in-target echo 'arcadia &amp;' &gt;&gt; /home/arcadia/.config/openbox/autostart; \ in-target echo 'openbox-session' &gt; /home/arcadia/.xinitrc </code></pre> <p>Does anyone see what is wrong with this? And why this would fail?</p> <p>Update:</p> <p>After many hours it is clear to me that it is better to copy a script to the target system and execute it there.</p> <pre><code>d-i preseed/late_command string cp -a /cdrom/preseed/post-install.sh /target/post-install.sh; in-target /bin/bash /post-install.sh </code></pre>
0non-cybersec
Stackexchange
tikzpicture with 4 curves needs adjustment. <p>I would like to replicate the image below (see "Desired output") because it's too murky + I would like to change the labels. </p> <p>I would appreciate any help that get's me closer to the goal. </p> <p><strong>Current code</strong></p> <pre><code>\documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[domain=0:3,scale=1.6,thick] \usetikzlibrary{calc} %allows coordinate calculations. %Define linear parameters for marginal revenue and demand \def\dintone{5.5} %Y-intercept for DEMAND_1. \def\dslpone{-1} %Slope for DEMAND_1. \def\mintone{4.5} %Y-intercept for MR_1. \def\mslpone{-1.5} %Slope for MR_1. \def\dinttwo{2.5} %Y-intercept for DEMAND_2. \def\dslptwo{-0.4} %Slope for DEMAND_2. \def\minttwo{2} %Y-intercept for MR_2. \def\mslptwo{-0.6} %Slope for MR_2. \def\pmc{1} %marginal cost \def\demandone{\x,{\dslpone*\x+\dintone}} \def\marginalrevenueone{\x,{\mslpone*\x+\mintone}} \def\demandtwo{\x,{\dslptwo*\x+\dinttwo}} \def\marginalrevenuetwo{\x,{\mslptwo*\x+\minttwo}} % Define coordinates for D_1 and MR_1. \coordinate (ints) at ({(\mintone-\dintone)/(\dslpone-\mslpone)},{(\mintone-\dintone)/(\dslpone-\mslpone)*\mslpone+\mintone}); \coordinate (ep) at (0,{(\mintone-\dintone)/(\dslpone-\mslpone)*\mslpone+\mintone}); \coordinate (eq) at ({(\mintone-\dintone)/(\dslpone-\mslpone)},0); \coordinate (dintone) at (0,{\dintone}); \coordinate (mintone) at (0,{\mintone}); \coordinate (pfqone) at ({(\pmc-\dintone)/(\dslpone)},0); \coordinate (pfpone) at ({(\pmc-\dintone)/(\dslpone)},{\pmc}); \coordinate (mfqone) at ({(\pmc-\mintone)/(\mslpone)},0); \coordinate (mfpone) at ({(\pmc-\mintone)/(\mslpone)},{\pmc}); % Define coordinates for D_2 and MR_2. \coordinate (ints) at ({(\minttwo-\dinttwo)/(\dslptwo-\mslptwo)},{(\minttwo-\dinttwo)/(\dslptwo-\mslptwo)*\mslptwo+\minttwo}); \coordinate (ep) at (0,{(\minttwo-\dinttwo)/(\dslptwo-\mslptwo)*\mslptwo+\minttwo}); \coordinate (eq) at ({(\minttwo-\dinttwo)/(\dslptwo-\mslptwo)},0); \coordinate (dinttwo) at (0,{\dinttwo}); \coordinate (minttwo) at (0,{\minttwo}); \coordinate (pfqtwo) at ({(\pmc-\dinttwo)/(\dslptwo)},0); \coordinate (pfptwo) at ({(\pmc-\dinttwo)/(\dslptwo)},{\pmc}); \coordinate (mfqtwo) at ({(\pmc-\minttwo)/(\mslptwo)},0); \coordinate (mfptwo) at ({(\pmc-\minttwo)/(\mslptwo)},{\pmc}); % DEMAND_1 \draw[thick,color=blue] plot (\demandone) node[right] {$D_1$}; % MARGINAL REVENUE_1 \draw[thick,color=blue] plot (\marginalrevenueone) node[right] {$MR_1$}; % DEMAND_2 \draw[thick,color=black] plot (\demandtwo) node[right] {$D_2$}; % MARGINAL REVENUE_2 \draw[thick,color=black] plot (\marginalrevenuetwo) node[right] {$MR_2$}; % Draw axes, and dotted equilibrium lines. \draw[-&gt;] (0,0) -- (7,0) node[right] {$Q$}; \draw[-&gt;] (0,0) -- (0,6) node[above] {$P$}; %MC \draw[solid,color=red] plot (\x,{\pmc}) node[right] {$MC$}; \draw[dashed] (mfpone) -- (mfqone) node[below] {$Q_1$}; \draw[dashed] (mfptwo) -- (mfqtwo) node[below] {$Q_2$}; \end{tikzpicture} \end{document} </code></pre> <p><strong>Current output</strong></p> <p><a href="https://i.stack.imgur.com/KWfWj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KWfWj.png" alt="enter image description here"></a></p> <p><strong>Desired output</strong></p> <p><a href="https://i.stack.imgur.com/DBHql.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DBHql.jpg" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
Manually Installing A New Kernel. <p>For some reason, my kernel got uninstalled.</p> <p>I have only file called "initrd.img-2.6.26-1-xen-amd64.bak" in my /boot folder. The only other thing is a 'grub' folder.</p> <p>I booted into a rescue OS, but is there a way to install a kernel manually so that I can boot into my original OS again?</p> <p>Can I just download a vmlinuz file into that folder and then fix my menu.lst?</p>
0non-cybersec
Stackexchange
OMG OMG OMG. I applied for my first job and *drumroll please* I GOT ACCEPTED Omg i feel so good I'm going to go celebrate Now I finally get paid a decent amount of money. I feel like a minimum wage millionaire. Now I can pay for all the things that I want instead of having someone else buy it. This is a HUGE step into the future for me and may many, more come from this.
0non-cybersec
Reddit
He’s happy in both of them.
0non-cybersec
Reddit
Theorem 6.20 rudin Integration. <p>How does he do the algebra? (page 134 Rudin, chapter 6 ,theorem 6.20)</p> <p>$\left| \frac {F(t)- F(s)}{t-s} -f(x_o) \right| = \left| \frac{1}{t-s} \int_s^t[f(u) - f(x_o)]du \right|&lt; \epsilon $</p> <p>also, how does he conclude that $F'(x_o) = f(x_0)$</p> <p>: here is the theorem(and the proof by rudin)</p> <p>Let $f \in \Re$ on $[a,b]$. For $ a \leq x \leq b$, put: $F(x) = \int_a^x f(t)dt$, Then $F$ is continuous on $[a,b]$; furthermore, if $f$ is continuous at a point $x_0$ of $[a,b]$, then $F$ is differentiable at $x_o$ and $F'(x_0) = f(x_0)$. </p> <p>(i will omit the proof of continuity of $F$ on $[a,b]$)</p> <p>Suppose $f$ is continuous at $x_0$. Given $\epsilon &gt; 0 $ choose $\delta &gt; 0$ such that:</p> <p>$\vert f(t)- f(x_o) \vert &lt; \epsilon $</p> <p>if $\vert t- x_0 \vert &lt; \delta$, and $a \leq t \leq b $.Hence, if </p> <p>$x_0 - \delta &lt; s \leq x_0 \leq t &lt; x_0 + \delta$ $\enspace$ with: $a\ \leq s &lt; t \leq b$</p> <p>we have by theorem 6.12(d)</p> <p>$\left| \frac{F(t) - F(s)}{t-s} - f(x_0) \right| = \left| \frac{1}{t-s} \int_s^t [f(u) - f(x_0)]du \right| &lt; \epsilon$</p> <p>it follows that $F'(x_0) = f(x_0)$</p>
0non-cybersec
Stackexchange
Python datetime: strftime() codes for decimal numbers. <p>Why does it give error?</p> <pre class="lang-py prettyprint-override"><code>&gt;&gt;&gt; an = datetime.datetime.now(); an datetime.datetime(2020, 3, 8, 22, 52, 19, 256487) &gt;&gt;&gt; datetime.datetime.strftime(an, '%-d') Traceback (most recent call last): File "&lt;pyshell#16&gt;", line 1, in &lt;module&gt; datetime.datetime.strftime(an, '%-d') ValueError: Invalid format string </code></pre> <p>Based on this sources (<a href="https://strftime.org/" rel="nofollow noreferrer">sources1</a>, <a href="https://www.programiz.com/python-programming/datetime/strftime" rel="nofollow noreferrer">sources2</a>) I expected <strong>"8"</strong></p>
0non-cybersec
Stackexchange
How to create your own library for Android development to be used in every program you write?. <p>I am a Delphi programmer and have written, over the years, hundreds of classes and routines which I can use in every Delphi program I write.</p> <p>This <strong>library</strong> is called dlib and can be <strong>used in every Delphi program</strong> by putting this folder in my library path and using one of the units in the uses section of a Delphi unit.</p> <p>Being completely new to Java and Android development, I am wondering how to do this in similar way.</p> <p><strong>So my question, how can I write own classes, put them in some global folder, and use these classes and routines in every Android program I write</strong> ?</p> <p>I know this is a basic question, which I can probably find out by searching Google and trying it out in Eclipse, but if someone can put me on the right track, I know I will save much time.</p> <p>Thanks.</p>
0non-cybersec
Stackexchange
How do I exit the w3m help menu?. <p>I'm using scrapy and just discovered the view command from the shell. It brings up the webpage in a very convenient instance of <code>w3m</code>. From <code>man w3m</code>, I learned that <strong>H</strong> brings up the help menu, but despite reading through it, I can't find the proper way to exit it.</p> <p>I can do <code>C-h</code> which takes me back to history, but there must be a right way of exiting the help menu.</p>
0non-cybersec
Stackexchange
Why isn&#39;t SMART hard drive data showing up in SpeedFan?. <p>I use SpeedFan for it's "S.M.A.R.T." tab and the ability to check the health of my hard drives. Used it a several machines in the past but on the newest one I have there are no hard disks listed. Is it because I have an SSD drive now? Is that known to cause problems? I checked the BIOS and the SMART option is on.</p>
0non-cybersec
Stackexchange
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
How to get tombstone count for a cql query?. <p>I am trying to evaluate number of tombstones getting created in one of tables in our application. For that I am trying to use nodetool cfstats. Here is how I am doing it:</p> <pre><code>create table demo.test(a int, b int, c int, primary key (a)); insert into demo.test(a, b, c) values(1,2,3); </code></pre> <p>Now I am making the same insert as above. So I expect 3 tombstones to be created. But on running cfstats for this columnfamily, I still see that there are no tombstones created.</p> <pre><code>nodetool cfstats demo.test Average live cells per slice (last five minutes): 0.0 Average tombstones per slice (last five minutes): 0.0 </code></pre> <p>Now I tried deleting the record, but still I don't see any tombstones getting created. Is there any thing that I am missing here? Please suggest.</p> <p>BTW a few other details, * We are using version 2.1.1 of the Java driver * We are running against Cassandra 2.1.0</p>
0non-cybersec
Stackexchange
What exploits involve making long http requests with lots of mostly null byte octals?. <p>I've gotten a lot of strange http requests in my access logs before, like calls to nonexistent WordPress login scripts and application specific locations. I've even gotten a few wise guy requests like <code>...GET /your-site-sucks HTTP/1.1 400...</code>.</p> <p>I'm curious about some that have varying lengths of octal characters. Here's an example:</p> <pre><code>x.x.x.x - - [31/Aug/2019:15:20:13 -0400] "\x01A\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 400 157 "-" "-" </code></pre> <p>I understand this as <code>Start of heading start of text null null null null null....</code>. Looking up the ip address, I found it was labeled as an abusive ip.</p> <p><strong>What kind of exploit is this particular request looking for?</strong></p>
1cybersec
Stackexchange
5 things to know about China's Xi Jingping.
0non-cybersec
Reddit
Red beans and rice?. Whats a good recipe that isn't too spicy for puerto rican red beans and rice, that I can toss in the cooker for a while? My best friend is puerto rican and makes the BEST red beans and rice but she moved away and now I'm starving to death! :P
0non-cybersec
Reddit
How can I call async method from constructor?. <p>I need to call a <code>async</code> method from my <code>Form1</code> constructor. Since a constructor can't have a return type, I can't add a <code>async void</code>. I read that <a href="https://social.msdn.microsoft.com/Forums/windowsapps/en-US/0d24419e-36ad-4157-abb5-3d9e6c5dacf1/constructor-invoke-async-method" rel="noreferrer">static constructor</a> can be <code>async</code> but I need to call methods from constructor that aren't <code>static</code>, such as <code>InitializeComponent()</code> (since it's the Form's constructor).</p> <p>The class is:</p> <pre><code>public partial class Form1 : Form { InitializeComponent(); //some stuff await myMethod(); } </code></pre> <p>I read <a href="https://stackoverflow.com/questions/7261173/c-sharp-start-async-method-within-object-constructor-bad-practice">this</a> one too but I still don't know how to implement this (in my case) since the method still requires to use <code>async</code>.</p>
0non-cybersec
Stackexchange
Hard drive issue with HFS and windows. <p>I've got a problem with some hard drives. I've had some issues with my MBP and I'm unable to access my account on the computer. (I've been told its a graphical issue with the GPU, it keeps crashing before logging on) I've verified and repaired the disk on the macbook and it says its all great.</p> <p>Problem is that I have a few confidential files that I need to access quickly and the drive wont show the OSX partition on my windows computer. It shows up as a unknown partition in the Disk management. The windows partition (From bootcamp) shows up in my computer and as a NTFS partition in Disk management. I've tried installing apples bootcamp registry folders to allow my computer to read the disk, I've also gotten paragon HFS+ and HFSExplorer. Nothing comes up.</p> <p>I would appreciate some help on how I can gain access to my files once more as I really do need to access them urgently. Ideally at no cost (Sending in to HDD specialists etc)</p>
0non-cybersec
Stackexchange
Can we write a complex number z like this Re(z)+Im(z)?. <p>I mean without the i. Re(z) and Im(z) would be real numbers right?</p>
0non-cybersec
Stackexchange
Understanding Fatou&#39;s lemma. <p>I want to prove that (without using Fatou's lemma)</p> <p>for every $k \in N$ let $f_k$ be a nonnegative sequence $f_k(1),f_k(2),\ldots$</p> <p>$$\sum^\infty_{n=1}\liminf_{k \to \infty} f_k(n) \le \liminf_{k \to \infty} \sum^\infty_{n=1}f_k(n)$$</p> <p>Can you give some hint for me about that? hat</p>
0non-cybersec
Stackexchange
FALCON PUUUUUNCH.
0non-cybersec
Reddit
Unable to install Adobe Reader. <p>When I start the installation of Adobe Reader, I get an error message:</p> <blockquote> <p>This installer package could not be opened. Verify that the package exist and that you can access it, or contact the application vendor to verify that this is a valid windows installer package.</p> </blockquote> <p>Why am I getting this error message? </p>
0non-cybersec
Stackexchange
How has no one rear-ended this yet? .
0non-cybersec
Reddit
When something ruins your sexy.
0non-cybersec
Reddit
Android build success but cannot resolve R. <p>help me, my Android cannot resolve symbol R( the R becomes red color) but when i try to build project, it succeed. anybody know why ? i already try clean project, rebuild project, sync project with gradle files and also invalidate cache and restart but still cannot resolve R <a href="https://i.stack.imgur.com/fMEyu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fMEyu.png" alt=""></a></p> <p>here is my gradle (app):</p> <pre><code>apply plugin: 'com.android.application' android { compileSdkVersion 28 defaultConfig { applicationId "com.justinjunias.stockitem" minSdkVersion 24 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } apply plugin: 'com.google.gms.google-services' dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' // Butterknife implementation 'com.jakewharton:butterknife:8.6.0' annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0' //Design implementation 'com.android.support:design:28.0.0' //Volley implementation 'com.android.volley:volley:1.1.1' //Firebase implementation 'com.google.firebase:firebase-core:16.0.8' implementation 'com.google.firebase:firebase-database:16.0.6' implementation 'com.google.firebase:firebase-auth:16.2.0' implementation 'com.google.firebase:firebase-firestore:18.1.0' } </code></pre> <p>And my gradle build: </p> <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.3.2' //Firebase classpath 'com.google.gms:google-services:4.2.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir } </code></pre>
0non-cybersec
Stackexchange
My Near Finished Bench.
0non-cybersec
Reddit
Why websocket needs an opening handshake using HTTP? Why can&#39;t it be an independent protocol?. <p><em>Websocket is designed in such a way that its servers can share a port with HTTP servers, by having its handshake be a valid HTTP Upgrade request.</em></p> <p>I have a doubt in this design philosophy. Any ways the WebSocket Protocol is an independent TCP-based protocol.</p> <p>Why would we need this HTTP handshake(upgrade request) and a protocol switching. Instead why can't we directly(&amp; independently) follow a websocket like protocol?</p>
0non-cybersec
Stackexchange
Creating Two NFS Shares: One Read/Write and One Read Only. <p>Hopefully this is an easy question!</p> <p>Background: I am currently using Ubuntu 12.04 as a home media server running MythTV and using XBMC as frontends on both Windows and Ubuntu. My media is shared via SMB and NFS, but I use NFS primarily for the XBMC frontends because the lower overhead translates into significantly better performance.</p> <p>What I Want: What I would like to do is to create two NFS shares to my media files. One share I would like to be read/write, and the other share I would like to be read only. This way, I can set up a frontend for my roommate, for example, where he can access the files for viewing, but not screw anything up.</p> <p>Since I can't create two identical NFS shares, one read/write and one read-only, I tried to create two mounts to differentiate them.</p> <p>In /etc/fstab, I have the following device mounted:</p> <pre><code>/dev/stb1 /mnt/Media ext4 defaults 0 0 </code></pre> <p>And in /etc/exports, I have the following NFS share:</p> <pre><code>/mnt/Media *(rw,async,all_squash,insecure,anonuid=1001,anongid=122,no_subtree_check) </code></pre> <p>The above works fine for read/write access. My intention was to create a second, read-only mount, and then export it via NFS as /mnt/Media_ReadOnly. So I've tried to create the second mount as follows:</p> <pre><code>/dev/stb1 /mnt/Media_ReadOnly ext4 ro,auto,user,noexec 0 0 </code></pre> <p>but I get an error:</p> <pre><code>mount: according to mtab, /dev/sdb1 is mounted on /mnt/Media </code></pre> <p>So I guess I can't mount the same device twice?</p> <p>How can I export the same path via NFS in a read-only format?</p>
0non-cybersec
Stackexchange
72 hours in Iceland, in 2 minutes.
0non-cybersec
Reddit
A guy left a cup with coffee leftovers at our hackerspace, so I'm streaming it to Twitch using a Pi (how long until mold grows?) twitch.tv/crimier.
0non-cybersec
Reddit
Difference between os.getenv and os.environ.get. <p>Is there any difference at all between both approaches?</p> <pre><code>&gt;&gt;&gt; os.getenv('TERM') 'xterm' &gt;&gt;&gt; os.environ.get('TERM') 'xterm' &gt;&gt;&gt; os.getenv('FOOBAR', "not found") == "not found" True &gt;&gt;&gt; os.environ.get('FOOBAR', "not found") == "not found" True </code></pre> <p>They seem to have the exact same functionality.</p>
0non-cybersec
Stackexchange