text
stringlengths 3
1.74M
| label
class label 2
classes | source
stringclasses 3
values |
---|---|---|
TIFU by kissing my best friend and not getting a date. Three days ago I invited my best friend to come over to my place to have dinner and to have a good time with her, since I moved a few years and came to her city a few days ago where I have a place of my own.
I know this girl for 6 years and I know many of her stories and secrets, as she knows many of my stories too, including a bunch of them concerning other girls that I dated a few years ago.
Since I'm single now, at the middle of the night she thought it would be a good idea to meet another girl, especially one of her closest friends which already said to her that I seemed a nice guy. After seeing a few pictures of her, we agreed it would be a great idea to invite her for the next dinner.
However, we drank a little bit more that night and we ended up kissing each other. The kisses ended quickly and she was very nervous and told me that we shouldn't be doing that and that she didn't want to lose me as one of her best friends. She left my apartment a few minutes after.
Now I don't have the courage to invite her best friend to come over with her and also we didn't speak about that incident or anything else since that day.
My obvious believe is that she already told to that friend we kissed and not only I lost a potential date, but also a "best friend".
I do hope to be wrong though but I'm thinking I'm pretty screwed.
TL;DR - I kissed my best friend before she introduce me to her friend who I was suppose to have a date
​
EDIT: After almost a week, these are the developments:
\- Best Friend: I tried to contact her to grab a coffee during this week and to talk about the things that happen between us but she gave a BS excuse and since then I said that I would be glad to talk with her and laugh about this all situation when she's ready to see me again.
\- Date: Well, this is the funny part. Since I was unable to reach my Best Friend, I never get the opportunity to meet that girl. However, two days ago a different cute girl started to like a few random pictures of mine on instagram and taking into account that I'm not shy I started to talk with her and I ended up inviting her to have some drinks. The result: we made out last night.
Life is great!!
Thank you for your support and advices. | 0non-cybersec
| Reddit |
How is spectral norm of a parameter calculated?. <p>when I do,</p>
<pre><code>import torch, torch.nn as nn
x = nn.Linear(3, 3)
y = torch.nn.utils.spectral_norm(x)
</code></pre>
<p>then it gives four different weight matrices,</p>
<p><code>y.weight_u</code></p>
<pre><code>tensor([ 0.6534, -0.1644, 0.7390])
</code></pre>
<p><code>y.weight_orig</code></p>
<pre><code>Parameter containing:
tensor([[ 0.2538, 0.3196, 0.3380],
[ 0.4946, 0.0519, 0.1022],
[-0.5549, -0.0401, 0.1654]], requires_grad=True)
</code></pre>
<p><code>y.weight_v</code></p>
<pre><code>tensor([-0.3650, 0.2870, 0.8857])
</code></pre>
<p><code>y.weight</code></p>
<pre><code>tensor([[ 0.5556, 0.6997, 0.7399],
[ 1.0827, 0.1137, 0.2237],
[-1.2149, -0.0878, 0.3622]], grad_fn=<DivBackward0>)
</code></pre>
<p>how are these four matrices calculated?</p>
| 0non-cybersec
| Stackexchange |
[50/50] The evolution of the Starbucks logo (NSFW) | A rejected Starbucks logo (NSFW). | 0non-cybersec
| Reddit |
I find this juxtaposition titillating. Other big words.. | 0non-cybersec
| Reddit |
Bacon, Ribs, Pork Chops, Ham - they all have one thing in common. | 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 |
Somehow it had passed me by, but I've just seen 'Identity' (2003). Was reading a post earlier on about recommendations for movies to watch on a dark and stormy night (as it is here in England right now, pissing down ) Somebody recommended *Identity* with John Cusack. I love me a bit of Cusack so I gave it a go-what a great film! Nicely twisty & (mostly) kept me guessing until the end. Really good crime/slasher/psychological thriller/horror. I'd say it'd be equally an excellent pizza night film to watch with your mates as much as under a blanket on your own. Think I'm going to have my first rewatch of *A Dark Song* now since it came out (for dessert) Thoroughly recommend *Identity* if anyone's not seen it. 8/10. | 0non-cybersec
| Reddit |
How to use IApplicationBuilder and IServiceCollection when downgrading from .NET Core 2.1 to .NET 4.7.1?. <p>I had to change my project from .NET Core 2.1 to .NET 4.7.1 and I fixed almost all errors except the following that are still eluding me</p>
<ul>
<li><blockquote>
<p>'IApplicationBuilder' does not contain a definition for 'UseHsts' and no extension method 'UseHsts' accepting a first argument of type 'IApplicationBuilder' could be found (are you missing a using directive or an assembly reference?)</p>
</blockquote></li>
<li><blockquote>
<p>'IApplicationBuilder' does not contain a definition for 'UseAuthentication' and no extension method 'UseAuthentication' accepting a first argument of type 'IApplicationBuilder' could be found (are you missing a using directive or an assembly reference?)</p>
</blockquote></li>
<li><blockquote>
<p>'IApplicationBuilder' does not contain a definition for 'UseCookiePolicy' and no extension method 'UseCookiePolicy' accepting a first argument of type 'IApplicationBuilder' could be found (are you missing a using directive or an assembly reference?)</p>
</blockquote></li>
<li><blockquote>
<p>'IApplicationBuilder' does not contain a definition for 'UseHttpsRedirection' and no extension method 'UseHttpsRedirection' accepting a first argument of type 'IApplicationBuilder' could be found (are you missing a using directive or an assembly reference?)</p>
</blockquote></li>
<li><blockquote>
<p>'IApplicationBuilder' does not contain a definition for 'UseSession' and no extension method 'UseSession' accepting a first argument of type 'IApplicationBuilder' could be found (are you missing a using directive or an assembly reference?)</p>
</blockquote></li>
<li><blockquote>
<p>'IApplicationBuilder' does not contain a definition for 'UseStaticFiles' and no extension method 'UseStaticFiles' accepting a first argument of type 'IApplicationBuilder' could be found (are you missing a using directive or an assembly reference?)</p>
</blockquote></li>
<li><blockquote>
<p>'IServiceCollection' does not contain a definition for 'AddAuthentication' and no extension method 'AddAuthentication' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?)</p>
</blockquote></li>
<li><blockquote>
<p>'IServiceCollection' does not contain a definition for 'AddSession' and no extension method 'AddSession' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?)</p>
</blockquote></li>
</ul>
<p>I am using <code>Microsoft.AspNetCore.Builder</code> and <code>Microsoft.Extensions.DependencyInjection</code>. What else do I need to use/install/add to get <code>IApplicationBuilder</code> and <code>IServiceCollection</code> to work?</p>
<p>In my WebApi.csproj file I changed the target framework from netcoreapp2.1 to net471.</p>
<p>Old:</p>
<pre><code><PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
</code></pre>
<p>New:</p>
<pre><code><PropertyGroup>
<TargetFramework>net471</TargetFramework>
</PropertyGroup>
</code></pre>
| 0non-cybersec
| Stackexchange |
Mount and copy /var to EC2 instance store during first boot. <p>I'm running EC2 EBS images on instances with instance stores on /xvdb and /xvdc. I have managed to create a script to raid these two drives on first boot and mount them as /mnt. I am doing this as a OneTime service after systemd-remount-fs.service (I have no idea if that is the appropriate time). </p>
<p>What I really want to do is raid them, copy over the EBS's /var, and then mount them as /var before continuing booting for real. I'm assuming that I'll need to do this in the ram disk image during early boot. I'm quite out of touch with systemd and boot order - I last got dirty with building ram disks in 2009. What is the "proper" way to integrate a script that runs during the first boot and does the necessary setup?</p>
| 0non-cybersec
| Stackexchange |
TIFU by kicking a girl in the teeth.. Not really today, more like a few years ago. I used to learn tae kwan do and we were learning some moves. Well there was this move where if someone comes to grab you, you push their body down and kick them in the face. Obviously we didnt really kick them, just pretended. But when it was my turn to try this move with my partner, my leg went a bit too High and I smashed her teeth. At the time her parents where there and they saw the whole thing. I just stood there while chaos erupted. Oops | 0non-cybersec
| Reddit |
Led Zeppelin - The Lemon Song. | 0non-cybersec
| Reddit |
SQL Count function returning inaccurate results. <p>I am trying to write a query in oracle to list the number of records contained in a single table filtered by multiple columns in the tablespace. Here is the query syntax I have come up with:</p>
<pre><code>SELECT COUNT(CASE WHEN unique_id like '%OU=Users%' and employee_type > '-1' THEN 1 ELSE NULL
END) AS USERS1
,COUNT(CASE WHEN unique_id like '%OU=Vendors%' and employee_id is null and employee_type is null THEN 1 ELSE NULL
END) AS USERS2
,COUNT(CASE WHEN unique_id like '%OU=Temp Users%' and employee_type ='-1' THEN 1 ELSE NULL
END) AS USERS3
,COUNT(CASE WHEN unique_id like '%OU=Service%' THEN 1 ELSE NULL
END) AS USERS4
,COUNT(*) AS USERS5
FROM table_USERS
WHERE is_terminated = 'False'
</code></pre>
<p>Here is the resulting output:</p>
<pre><code>users1=1192
users2=38
users3=25
users4=240
users5=1548
</code></pre>
<p>The result is not correct it is showing "users5" as the total number of users that exist in the database (1548), when it should show me only 53 users which don't match any of the user categories (users1 - users4).</p>
<p>What am I missing and is there a more simplistic way to write this query?</p>
| 0non-cybersec
| Stackexchange |
Change values from terminal. <pre><code>\renewcommand{\name}{student}
</code></pre>
<p>i am using printing the word name in my case.
i want to have a script print for me the same files with different names that i will feed it with an array.
since i have to print the document for my students.</p>
<p>i am running the following command through terminal:</p>
<pre><code>xelatex popQuiz.tex '\def\name{{name}}'
</code></pre>
<p>but the student name is not changing to name.</p>
<p>please help me know why <code>xelatex popQuiz.tex '\def\ime{{name}}'</code> is not getting affected by name change thanks</p>
<p>exam consists of 5 pages, every page has a name field with as "student" and class name as "class"</p>
<p>on the preamble.tex file i have the following:</p>
<pre><code>\newcommand{\name}{student}
\newcommand{\class}{class}
</code></pre>
<p>and connected 5 pages to these and on each page i am using \name and \class, which is printing "student" and "class"respectively
now on the popQuiz.tx file
i am using \input to attach the preamble.tex file which has already set values after inputting that i am using</p>
<pre><code>\renewcommand{\name}{}
\renewcommand{\class}{}
</code></pre>
<p>what should i put in {} inorder to feed it values from the command line, so that i can be able to make a script for it</p>
| 0non-cybersec
| Stackexchange |
Internet Slang and Abbreviations. | 0non-cybersec
| Reddit |
Difference between closing the terminal using the closing button, and Ctrl-D. <p>When I'm launching a background process and then closes the terminal using the window's closing button, the background process gets killed. However if I close the terminal using <kbd>Ctrl</kbd>+<kbd>D</kbd>, the background process keeps running:</p>
<pre><code>sam@Sam-Pc:~$ yes > /dev/null &
[1] 10219
// I then close the terminal a reopen a new one
sam@Sam-Pc:~$ ps aux | grep yes
sam 10295 0.0 0.0 15948 2152 pts/8 S+ 00:54 0:00 grep --color=auto yes
</code></pre>
<p>And now using <kbd>Ctrl</kbd>+<kbd>D</kbd> to close the terminal:</p>
<pre><code>sam@Sam-Pc:~$ yes > /dev/null &
[1] 10299
sam@Sam-Pc:~$Ctrl-D
// I then reopen a new terminal
sam@Sam-Pc:~$ ps aux | grep yes
sam 10219 99.4 0.0 11404 812 ? R 00:52 2:01 yes
sam 10295 0.0 0.0 15948 2152 pts/8 S+ 00:54 0:00 grep --color=auto yes
</code></pre>
<p>Could anybody explain this behaviour?</p>
<p>Thanks!</p>
| 0non-cybersec
| Stackexchange |
How to fix the CUDA out of memory error on EC2 instance while running inference pipeline?. <p>I am trying to run a complete inference pipeline which takes a number of images and first runs Object Detection (multiprocessing) and further runs a Classifier (multiprocessing). I have tested the code on my local machine (CPU with 8 cores - No GPU) and it works perfectly. But when I tried to run the same code on EC2 (Deep Learning AMI (Amazon Linux) Version 24.1 - Instance type: p2.xlarge - 4 vCPUs (2 cores - 2 threads per core) - 1 GPU core - CUDA enabled), It throws CUDA - out of memory error.
<a href="https://i.stack.imgur.com/ecWJX.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ecWJX.jpg" alt="Output Error log on terminal"></a></p>
<hr>
<pre><code>import multiprocessing as mp
pool_od=mp.Pool()
results_OD=pool_od.map_async(localize_it, TEST_IMAGE_PATHS)
# TEST_IMAGES_PATH is the list of path of all images
pool_od.close()
pool_od.join()
final_results.append(results_OD.get())
</code></pre>
<hr>
<p>In the starting, I was specifying the number of cores in mp.Pool() but then I removed that so that the machine can decide for itself. As well as I removed the chunksize argument too. But still, I am getting the same error. Can you put some insight into it? Why this error is coming and what could be done? </p>
| 0non-cybersec
| Stackexchange |
How can I select all online friends?. <p>I'm currently working on a social network software written in PHP & MySQL, and it's all pretty fine, but one thing I'm stuck about is online friends. My tables looks following</p>
<p>Users</p>
<pre><code>+-----+------------+---------------------------------------------------------------+
| uid | timestamp | profile_img |
+-----+------------+---------------------------------------------------------------+
| 1 | 1322858590 | /photos/356a192b7b/profile.jpg |
| 2 | 13700000 | /photos/356a192b7/profile.jpg |
+-----+------------+---------------------------------------------------------------+
</code></pre>
<p>Friends</p>
<pre><code>+------+------+
| uid1 | uid2 |
+------+------+
| 1 | 2 |
+------+------+
</code></pre>
<p>now I want to select all online friends (online = <code>timestamp</code> > <code>current time</code> - <code>30 seconds</code>)</p>
<p>My try to create a query to select online friends is</p>
<pre><code>SELECT f.uid1 as friend1,
f.uid2 as friend2,
u1.profile_img profile_img1,
u2.profile_img profile_img2
FROM Friends f
INNER JOIN Users u1 ON u1.uid = f.uid1
INNER JOIN Users u2 ON u2.uid = f.uid2
WHERE
f.uid1 = 1 OR
f.uid2 = 1;
</code></pre>
<p>I have no idea how to compose the timestamp check, considering that </p>
<ul>
<li>friend1 can be me, but it can also be my friend. </li>
<li>friend2 can be me, but it can also be my friend.</li>
</ul>
<p>Is there a solution for this or should I think a bit more about database schema?</p>
| 0non-cybersec
| Stackexchange |
Xampp server Unable to Connect to ssl:// at port 443. <p>i was recentyly testing google spreadsheet api using Zend Framework, but Got this error </p>
<pre><code>Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Unable to Connect to ssl://www.google.com:443. Error #148105208: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?' in ....
</code></pre>
<p>I am using Xampp 1.7.4 , i have checked httpd.conf, mod_ssl.so is enabled there. please help</p>
| 0non-cybersec
| Stackexchange |
need help having a hard time with this, amdgpu-pro ubuntu 18.04. <p>xz: (stdin): File format not recognized
tar: Child returned status 2
tar: Error is not recoverable: exiting now</p>
| 0non-cybersec
| Stackexchange |
Is this black walnut?. | 0non-cybersec
| Reddit |
explict form of the equation of elliptic curve. <p>Let $E(\mathbb{F}_{q^2})$ is elliptic curve with #$E(\mathbb{F}_{q^2}) =q^2 + q + 1$.
Can we write equation of this curve in the explicit form?</p>
| 0non-cybersec
| Stackexchange |
How to force line breaks within a fancyvrb verbatim environment?. <p>Consider the following LaTeX document:</p>
<pre><code>\documentclass{article}
\usepackage{fancyvrb}
\DefineVerbatimEnvironment{example}{Verbatim}{commandchars=\\\{\}}
\begin{document}
\begin{example}
Foo\\{}Bar
Foo\linebreak{}Bar
\end{example}
\end{document}
</code></pre>
<p>I would expect the <code>\\</code> and <code>\linebreak</code> commands to produce a line break each, so the typeset output ought to look like</p>
<pre><code>Foo
Bar
Foo
Bar
</code></pre>
<p>However, the actual output is</p>
<pre><code>Foo Bar
FooBar
</code></pre>
<p>How do I produce an explicit line break inside a fancyvrb-based verbatim environment?</p>
<p>(Incidentally »Just hit Return« isn't the answer I'm looking for. I have lots of text based on the alltt environment which contains markup like</p>
<pre><code>Foo\nextline Bar
</code></pre>
<p>I use this to introduce »typographic« line breaks in shell command output, where there is no actual line break in the output but I need to start a new line because there is no more room on the current line. In my document, these »typographic« line breaks can be distinguished from genuine line breaks because there is a special symbol before/after the line break, along the lines of</p>
<pre><code>\newcommand{\nextline}{\ensuremath{\rhd}\linebreak\ensuremath{\lhd}}
</code></pre>
<p>I'd much rather not change a couple thousand pages' worth of documentation.)</p>
| 0non-cybersec
| Stackexchange |
British malware researcher Marcus Hutchins AKA @MalwareTech sentenced to time served. Will not see more prison for this conviction. | 1cybersec
| Reddit |
Homework: Examples for Special Sequences. <p>Sorry for asking this question. But wrecked my brain and having trouble coming up with anything. </p>
<blockquote>
<p>Find real sequences $(a_n), (b_n)$ and $(c_n)$ such that $\lim a_n
= \lim b_n = \lim c_n = 1$ but $\lim (a_n)^n = 0$, $\lim(b_n)^n = 2014$ and $\lim(c_n)^n = \infty$</p>
</blockquote>
<p>The only one that is obvious to me is $b_n = \sqrt[n]{2010}$. Can't come up with examples for the rest. Any help would be appreciated. </p>
| 0non-cybersec
| Stackexchange |
Do blue love in mist (Nigella damascena) flower seeds produce only blue flowers? and white produce white?. I want to organise my colours and get rid of all the blue. if I pull out all the blue plants and save the seeds from the white, pinks and purples in separate bags will this work for me? | 0non-cybersec
| Reddit |
Checking if a linear code exists - singleton , hamming and gilbert-varshamov bounds do not help.. <p>Suppose I want to check if a (11, 6, 4) code exists.</p>
<p>I cannot prove non-existence using the singleton and the hamming bound. I also cannot prove existence using the gilbert-varshamov bound. I'm not sure what is the best way to go then - shall I just try to create a parity-check matrix?</p>
| 0non-cybersec
| Stackexchange |
Bee Catastrophe: 1/3 of Colonies Died This Winter, Threatening Massive Ecological Catastrophe. | 0non-cybersec
| Reddit |
How to open a file handle on a string in Perl 6?. <p>In Perl 5, I can open a filehandle on string like this:</p>
<pre><code>open my $kfh, "<", \$message->payload;
</code></pre>
<p>I have a scenario that uses string as a filehandle and passes it to the <code>open</code> method:</p>
<pre><code>my $fh = new IO::Zlib;
open my $kfh, "<", \$message->payload;
if($fh->open($kfh, 'rb')){
print <$fh>;
$fh->close;
}
</code></pre>
<p>where <code>$message->payload</code> is read from <a href="https://kafka.apache.org/" rel="nofollow noreferrer">Kafka</a>, and the content is a byte array. <a href="https://stackoverflow.com/users/1077672/raiph">raiph</a> had a <a href="https://stackoverflow.com/questions/28702850/i-can-create-filehandles-to-strings-in-perl-5-how-do-i-do-it-in-perl-6">similar question</a>, but it didn't answer my question.</p>
<p>So I want to know how to open a filehandle on a string in Perl 6 like Perl 5 does? These documentation pages have no information on this:</p>
<ul>
<li><a href="https://docs.perl6.org/language/5to6-perlfunc#open" rel="nofollow noreferrer">open</a> </li>
<li><a href="https://docs.perl6.org/language/101-basics#index-entry-filehandle" rel="nofollow noreferrer">filehandle</a> </li>
<li><a href="https://docs.perl6.org/type/IO::Handle" rel="nofollow noreferrer">IO::Handle</a> </li>
</ul>
| 0non-cybersec
| Stackexchange |
Monitor doesn't turn on the first try, is power supply failure imminent?. <p>I been noticing for the last couple days that when I turn on my computer and then my monitor(22inch lcd) that my monitor does not turn on.</p>
<p>I push the "on" button and the blue light comes on but the screen is blank. I usually have to then restart my computer and then my monitor will show in the upper left hand corner a dialog bog that says "analog" and it is flickering.</p>
<p>Then everything goes to normal.</p>
<p>Thinking it is the power supply but at the same time the tower is a year old(it came with a power supply). So when I take that into consideration I am not sure. </p>
| 0non-cybersec
| Stackexchange |
ubuntu--vg-root does not exist after formatting boot partition. <p>I was recently trying to format a disk on my ubuntu 16.04 desktop with gparted and I accidentally formatted my boot partition which deleted GRUB and everything else on the partition. I managed to reinstall GRUB with boot repair. However, when I attempted a reboot, I was greeted with an initramfs console. Upon typing "exit" the console said that ubuntu--vg-root does not exist. When I actually change to the directory where it is supposed to be, it is not there. I am using a fully encrypted ssd (operating system), and another 2 tb hard drive (all the other stuff). I have really important data on the ssd and I really need to get it back. Any and all help is highly appreciated!!
Thanks you in advance!!</p>
<p>-Kolkoz P.</p>
| 0non-cybersec
| Stackexchange |
Underweight models could go to prison under French proposals. | 0non-cybersec
| Reddit |
How I exploited ACME TLS-SNI-01 issuing Let’s Encrypt SSL-certs for any domain using shared hosting. | 1cybersec
| Reddit |
Manziel texted Browns QB coach during the draft wanting them to trade up to get him. | 0non-cybersec
| Reddit |
X11 Forwarding Display. <p>I have putty on windows with x11 working(xapps all run fine) with the display set to $DISPLAY = localhost:10.0. I'm sshing through putty with x11 enabled into a raspberry pie application as root. I'm just wondering how I can get that display to show on my windows screen. And the application is in qt and it's only displaying on the device and not to my windows desktop when run. Like would I need to change some startup file or something else to make it so that the application that's running shows the display of the app to my windows screen? </p>
| 0non-cybersec
| Stackexchange |
Pandas cut function gives fewer categories than desired. <p>I have a df that looks likes this</p>
<pre><code> var1 var2 var3 var4 var5 var6
0 0.3 0.6 0.7 0.8 0.7 0.5
1 0.7 0.6 0.4 0.6 0.7 1.0
2 0.0 0.0 0.0 0.0 0.0 0.0
3 0.1 0.9 0.5 0.7 0.7 0.9
4 0.3 2.3 0.4 2.0 1.9 1.9
5 4.0 1.2 0.6 1.2 2.6 3.1
6 0.0 0.0 0.0 0.0 0.0 0.0
7 0.0 0.2 0.1 0.2 0.2 0.2
8 0.1 0.1 0.1 0.1 0.1 0.1
9 0.0 0.0 0.0 0.0 0.0 0.0
10 0.1 0.1 0.1 0.2 0.1 0.1
11 0.0 0.0 0.0 0.0 0.0 0.1
12 0.0 0.0 0.0 0.0 0.0 0.0
13 0.0 0.0 0.0 0.0 0.0 0.0
</code></pre>
<p>I want to create 4 bins (strictly 4 bins) for every column so i apply the <code>pandas</code> <code>cut</code> function in each column separately. So I do</p>
<pre><code>import pandas as pd
qt = so.apply(lambda x: pd.cut(x,4))
</code></pre>
<p>Then if I do </p>
<pre><code>qt.var1.unique()
</code></pre>
<p>I get </p>
<pre><code>[(-0.004, 1.0], (3.0, 4.0]]
Categories (2, interval[float64]): [(-0.004, 1.0] < (3.0, 4.0]]
</code></pre>
<p>Which has only 2 categories.</p>
<p>Any ideas why this happens ?</p>
| 0non-cybersec
| Stackexchange |
Find bijective correspondence between the sets. <blockquote>
<p>Find bijective correspondence between the set of all functions of $X$
in the set $\left\{ 0,1 \right\}$ and the power set of set $X$ and
find $| 2 ^ X |$, if $| X | = n.$</p>
</blockquote>
<hr>
<p><strong>My thoughts</strong>: number of functions between set $X$ and $\left\{ 0,1 \right\}$ = $2 ^ n$, because $| X | = n$. Power of power set is $| 2 ^ X | = 2 ^ n$. Therefore, between the two sets can be bijection. It remains to figure out now how to do it to each element of the power set put in correspondence exactly one function of $X$ into $\left\{ 0,1 \right\}$.</p>
| 0non-cybersec
| Stackexchange |
Windows machine to send email. <p>What software/package required on a new Windows machine (say Win10) to send email. My understanding is that it needs SMTP client kind of software installed to communicate with an SMTP server to able to send email. I know we can use telnet to an SMTP server on port 25 and send email. But what is not clear to me how an application will send email - does it need integration with SMTP client on that machine to communicate with SMTP server?</p>
<p>I think I have problem with basic concept here? Anybody can help?</p>
| 0non-cybersec
| Stackexchange |
What is "ExternalInterface escapes strings using JSON conventions" in the new flash player 14?. <p>There's an error when I use ExternalInterface as below:</p>
<blockquote>
<p>WARNING: For content targeting Flash Player version 14 or higher,
ExternalInterface escapes strings using JSON conventions. To maintain
compatibility, content published to earlier Flash Player versions
continues to use the legacy escaping behavior.</p>
</blockquote>
<p>What should I do to prevent the warning to show up and what's "legacy escaping" that I should use instead of "JSON convention"?</p>
| 0non-cybersec
| Stackexchange |
Headstone That Always Watches You. | 0non-cybersec
| Reddit |
Several thousand letters were just delivered to me. That's the last time I order a fucking dictionary from IKEA. | 0non-cybersec
| Reddit |
Kobe Bryant has knee surgery. | 0non-cybersec
| Reddit |
Two trashpandas having a romantic night out. | 0non-cybersec
| Reddit |
how do I encrypt data in R?. <p>I am adding a <a href="https://r-forge.r-project.org/scm/viewvc.php/handlers/pkg/R/sentry.R?view=markup&root=logging" rel="noreferrer">sentry handler</a> to the <a href="http://logging.r-forge.r-project.org/" rel="noreferrer">R logging package</a>. currently <a href="https://github.com/dcramer/django-sentry" rel="noreferrer">django-sentry</a> validates the client (the application sending log records) based on a shared key which travels in clear text in a secured channel.</p>
<p>I was wondering if it was possible to do encryption from R, preferably asymmetric, public key based, but I find nothing relevant.</p>
<p>all right, not "if it was possible", but "how to do that" and whether someone already did this.</p>
<hr>
<p>after interaction with the author of django-sentry, we opted for <code>hmac</code>, which I have implemented within the <a href="https://r-forge.r-project.org/projects/digest/" rel="noreferrer"><code>digest</code></a> R package (version 0.5+ contains it). This does <em>not</em> answer the question "how to encrypt data using R", but it solves the problem which formed the base for my initial question. </p>
<p>At this point I am not any more actively working at asymmetric encription in R, however, if you are interested in it and you want to contribute ideas or code, please leave a note here!</p>
| 0non-cybersec
| Stackexchange |
Show that these two structures are isomorphic. <p>I'm having difficulty knowing where to start with this question:</p>
<p>Show that:</p>
<p>(<span class="math-container">$\mathbb{Q}(\sqrt{2})$</span>,<)<span class="math-container">$\cong$</span>(<span class="math-container">$\mathbb{Q}$</span>,<)</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 |
Cool Cats (pics) . | 0non-cybersec
| Reddit |
Segmentation fault on dd command. <p>I ran this command on Ubuntu to resize the <code>/tmp</code> and after that there is segmentation fault coming. </p>
<pre><code>dd if=/dev/zero of=/dev/xvda1 bs=1024M count=2
</code></pre>
<p>Its our live server. Is there any way to get it working or get the data?</p>
<p>Thanks.</p>
| 0non-cybersec
| Stackexchange |
Transform an array into arguments of a command?. <p>I have an array of "options" of a command.</p>
<pre><code>my_array=(option1 option2 option3)
</code></pre>
<p>I want to call this command in a bash script, using the values from array as options. So, <code>command $(some magic here with my_array) "$1"</code> becomes:</p>
<pre><code>command -option1 -option2 -option3 "$1"
</code></pre>
<p>How can I do it? Is it possible?</p>
| 0non-cybersec
| Stackexchange |
Rumor: Apple TV+’s Ambitious Isaac Asimov Sci-Fi Series ‘Foundation’ Will Begin Shooting On November 11th. [HN Entertainment](https://hnentertainment.co/apple-tvs-ambitious-isaac-asimov-sci-fi-series-foundation-shoots-november-june/) is reporting that Asimov's Foundation TV series will begin shooting next month.
> HN Entertainment has learned that Skydance Televsion/Apple’s science fiction series Foundation, based on the novel by Isaac Asimov will begin shooting on November 11th and is expected to wrap on June 8th, 2020.
> Asimov’s Foundation is the complex saga of humans scattered on planets throughout the galaxy, all living under the rule of the Galactic Empire. The protagonist is a psycho-historian who has the ability to read the future and foresees the empire’s imminent collapse. He sets out to save the knowledge of mankind from being wiped out.
> Filming is said to take place in Ireland.
> We’ve confirmed that the production team will include cinematographer Steve Annis (I Am Mother), production designer Rory Cheyne (Locke and Key, Hannibal, American Gods), and art director William Cheng (Locke and Key, American Gods, The Shape of Water, Suicide Squad, Shazam!).
> With filming kicking-off next month we should start hearing big casting news soon.
> Foundation will likely begin airing on Apple TV+ sometime in 2020-2021.
Keep in mind that at the moment we don't have other sources to confirm the news. | 0non-cybersec
| Reddit |
FilmStruck's Demise Is Part of a Bigger Pattern. | 0non-cybersec
| Reddit |
kubernetes: cannot access NodePort from other machines. <p>I am trying to install kubernetes.
There was a problem when checking the container executed on kubernetes.
I set the type of service to Nodeport, but I could not access from a node other than the one on which the container is running.
Want to make it accessible from other computers, please tell me where it is different.
I tried externalIPs and LoadBarancer, but it was impossible.</p>
<p>Enviroment</p>
<ul>
<li>OS:Ubuntu 16.04 LTS</li>
<li>Kubernetes:1.8</li>
<li>Docker:17.09.0-ce</li>
<li>etcd:3.2.8</li>
<li>flannel:0.9.0</li>
</ul>
<p>Network</p>
<ul>
<li>Physical:10.1.1.0/24</li>
<li>flannel:172.16.0.0/16</li>
<li>docker:192.168.0.0/16</li>
</ul>
<p>Machines</p>
<ul>
<li>Master Node(2nodes):10.1.1.24,10.1.1.25</li>
<li>Worker Node(2nodes):10.1.1.26,10.1.1.27</li>
</ul>
<p>kubectl describe svc nginx-cluster</p>
<pre><code>Name: nginx-cluster
Namespace: default
Labels: app=nginx-demo
Annotations: <none>
Selector: app=nginx-demo
Type: ClusterIP
IP: 172.16.236.159
Port: <unset> 8090/TCP
TargetPort: 80/TCP
Endpoints: 192.168.24.2:80
Session Affinity: None
Events: <none>
</code></pre>
<p>kubectl describe svc nginx-service</p>
<pre><code>Name: nginx-service
Namespace: default
Labels: app=nginx-demo
Annotations: <none>
Selector: app=nginx-demo
Type: NodePort
IP: 172.16.199.69
Port: <unset> 8090/TCP
TargetPort: 80/TCP
NodePort: <unset> 31659/TCP
Endpoints: 192.168.24.2:80
Session Affinity: None
External Traffic Policy: Cluster
Events: <none>
</code></pre>
<p>running container worker node(10.1.1.27)</p>
<p>curl 10.1.1.27:31659</p>
<pre><code><!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
...
</code></pre>
<p>worker node(10.1.1.26)</p>
<p>curl 10.1.1.27:31659</p>
<pre><code>curl: (7) Failed to connect to 10.1.1.27 port 31659:Connection timed out.
</code></pre>
<p>other machine(10.1.1.XX)</p>
<p>curl 10.1.1.27:31659</p>
<pre><code>curl: (7) Failed to connect to 10.1.1.27 port 31659:Connection timed out.
</code></pre>
<p>kubectl get pods -o wide</p>
<pre><code>NAME READY STATUS RESTARTS AGE IP NODE
echoserver-848b75d85-9fx7r 1/1 Running 3 6d 192.168.70.2 k8swrksv01
nginx-demo-85cc49574c-wv2b9 1/1 Running 3 6d 192.168.2.2 k8swrksv02
</code></pre>
<p>kubectl get svc -o wide</p>
<pre><code>NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
clusterip ClusterIP 172.16.39.77 <none> 80/TCP 6d run=echoserver
kubernetes ClusterIP 172.16.0.1 <none> 443/TCP 10d <none>
nginx-cluster ClusterIP 172.16.236.159 <none> 8090/TCP 6d app=nginx-demo
nginx-service NodePort 172.16.199.69 <none> 8090:31659/TCP 6d app=nginx-demo
nodeport NodePort 172.16.38.40 <none> 80:31317/TCP 6d run=echoserver
</code></pre>
<p>netstat -ntlp</p>
<pre><code>tcp 0 0 127.0.0.1:10248 0.0.0.0:* LISTEN 1963/kubelet
tcp 0 0 127.0.0.1:10249 0.0.0.0:* LISTEN 2202/kube-proxy
tcp 0 0 127.0.0.1:4243 0.0.0.0:* LISTEN 1758/dockerd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 996/sshd
tcp6 0 0 :::4194 :::* LISTEN 1963/kubelet
tcp6 0 0 :::10250 :::* LISTEN 1963/kubelet
tcp6 0 0 :::31659 :::* LISTEN 2202/kube-proxy
tcp6 0 0 :::10255 :::* LISTEN 1963/kubelet
tcp6 0 0 :::10256 :::* LISTEN 2202/kube-proxy
tcp6 0 0 :::31317 :::* LISTEN 2202/kube-proxy
tcp6 0 0 :::22 :::* LISTEN 996/sshd
</code></pre>
<p>iptables-save</p>
<pre><code>*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:DOCKER - [0:0]
:KUBE-MARK-DROP - [0:0]
:KUBE-MARK-MASQ - [0:0]
:KUBE-NODEPORTS - [0:0]
:KUBE-POSTROUTING - [0:0]
:KUBE-SEP-AZ4EGFEAU4RTSLJO - [0:0]
:KUBE-SEP-C7HQKKO26GIFOZZM - [0:0]
:KUBE-SEP-EWKNS2YCPXGJCXDC - [0:0]
:KUBE-SEP-LQVPUPFGW6BWATIP - [0:0]
:KUBE-SEP-OMMOFZ27GPKZ4OPA - [0:0]
:KUBE-SEP-UD3HOGDD5NDLNY74 - [0:0]
:KUBE-SERVICES - [0:0]
:KUBE-SVC-CQNAS6RSUGJF2C2D - [0:0]
:KUBE-SVC-GKN7Y2BSGW4NJTYL - [0:0]
:KUBE-SVC-NPX46M4PTMTKRN6Y - [0:0]
:KUBE-SVC-XP7QDA4CRQ2QA33W - [0:0]
:KUBE-SVC-Z5P6OMNAEVLAQUTS - [0:0]
-A PREROUTING -m comment --comment "kubernetes service portals" -j KUBE-SERVICES
-A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER
-A OUTPUT -m comment --comment "kubernetes service portals" -j KUBE-SERVICES
-A OUTPUT ! -d 127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER
-A POSTROUTING -m comment --comment "kubernetes postrouting rules" -j KUBE-POSTROUTING
-A POSTROUTING -s 192.168.2.0/24 ! -o docker0 -j MASQUERADE
-A POSTROUTING -s 192.168.0.0/16 -d 192.168.0.0/16 -j RETURN
-A POSTROUTING -s 192.168.0.0/16 ! -d 224.0.0.0/4 -j MASQUERADE
-A POSTROUTING ! -s 192.168.0.0/16 -d 192.168.2.0/24 -j RETURN
-A POSTROUTING ! -s 192.168.0.0/16 -d 192.168.0.0/16 -j MASQUERADE
-A DOCKER -i docker0 -j RETURN
-A KUBE-MARK-DROP -j MARK --set-xmark 0x8000/0x8000
-A KUBE-MARK-MASQ -j MARK --set-xmark 0x4000/0x4000
-A KUBE-NODEPORTS -p tcp -m comment --comment "default/nginx-service:" -m tcp --dport 31659 -j KUBE-MARK-MASQ
-A KUBE-NODEPORTS -p tcp -m comment --comment "default/nginx-service:" -m tcp --dport 31659 -j KUBE-SVC-GKN7Y2BSGW4NJTYL
-A KUBE-NODEPORTS -p tcp -m comment --comment "default/nodeport:" -m tcp --dport 31317 -j KUBE-MARK-MASQ
-A KUBE-NODEPORTS -p tcp -m comment --comment "default/nodeport:" -m tcp --dport 31317 -j KUBE-SVC-XP7QDA4CRQ2QA33W
-A KUBE-POSTROUTING -m comment --comment "kubernetes service traffic requiring SNAT" -m mark --mark 0x4000/0x4000 -j MASQUERADE
-A KUBE-SEP-AZ4EGFEAU4RTSLJO -s 192.168.70.2/32 -m comment --comment "default/clusterip:" -j KUBE-MARK-MASQ
-A KUBE-SEP-AZ4EGFEAU4RTSLJO -p tcp -m comment --comment "default/clusterip:" -m tcp -j DNAT --to-destination 192.168.70.2:8080
-A KUBE-SEP-C7HQKKO26GIFOZZM -s 192.168.70.2/32 -m comment --comment "default/nodeport:" -j KUBE-MARK-MASQ
-A KUBE-SEP-C7HQKKO26GIFOZZM -p tcp -m comment --comment "default/nodeport:" -m tcp -j DNAT --to-destination 192.168.70.2:8080
-A KUBE-SEP-EWKNS2YCPXGJCXDC -s 10.1.1.25/32 -m comment --comment "default/kubernetes:https" -j KUBE-MARK-MASQ
-A KUBE-SEP-EWKNS2YCPXGJCXDC -p tcp -m comment --comment "default/kubernetes:https" -m recent --set --name KUBE-SEP-EWKNS2YCPXGJCXDC --mask 255.255.255.255 --rsource -m tcp -j DNAT --to-destination 10.1.1.25:6443
-A KUBE-SEP-LQVPUPFGW6BWATIP -s 192.168.2.2/32 -m comment --comment "default/nginx-service:" -j KUBE-MARK-MASQ
-A KUBE-SEP-LQVPUPFGW6BWATIP -p tcp -m comment --comment "default/nginx-service:" -m tcp -j DNAT --to-destination 192.168.2.2:80
-A KUBE-SEP-OMMOFZ27GPKZ4OPA -s 10.1.1.24/32 -m comment --comment "default/kubernetes:https" -j KUBE-MARK-MASQ
-A KUBE-SEP-OMMOFZ27GPKZ4OPA -p tcp -m comment --comment "default/kubernetes:https" -m recent --set --name KUBE-SEP-OMMOFZ27GPKZ4OPA --mask 255.255.255.255 --rsource -m tcp -j DNAT --to-destination 10.1.1.24:6443
-A KUBE-SEP-UD3HOGDD5NDLNY74 -s 192.168.2.2/32 -m comment --comment "default/nginx-cluster:" -j KUBE-MARK-MASQ
-A KUBE-SEP-UD3HOGDD5NDLNY74 -p tcp -m comment --comment "default/nginx-cluster:" -m tcp -j DNAT --to-destination 192.168.2.2:80
-A KUBE-SERVICES -d 172.16.236.159/32 -p tcp -m comment --comment "default/nginx-cluster: cluster IP" -m tcp --dport 8090 -j KUBE-SVC-Z5P6OMNAEVLAQUTS
-A KUBE-SERVICES -d 172.16.199.69/32 -p tcp -m comment --comment "default/nginx-service: cluster IP" -m tcp --dport 8090 -j KUBE-SVC-GKN7Y2BSGW4NJTYL
-A KUBE-SERVICES -d 172.16.38.40/32 -p tcp -m comment --comment "default/nodeport: cluster IP" -m tcp --dport 80 -j KUBE-SVC-XP7QDA4CRQ2QA33W
-A KUBE-SERVICES -d 172.16.39.77/32 -p tcp -m comment --comment "default/clusterip: cluster IP" -m tcp --dport 80 -j KUBE-SVC-CQNAS6RSUGJF2C2D
-A KUBE-SERVICES -d 172.16.0.1/32 -p tcp -m comment --comment "default/kubernetes:https cluster IP" -m tcp --dport 443 -j KUBE-SVC-NPX46M4PTMTKRN6Y
-A KUBE-SERVICES -m comment --comment "kubernetes service nodeports; NOTE: this must be the last rule in this chain" -m addrtype --dst-type LOCAL -j KUBE-NODEPORTS
-A KUBE-SVC-CQNAS6RSUGJF2C2D -m comment --comment "default/clusterip:" -j KUBE-SEP-AZ4EGFEAU4RTSLJO
-A KUBE-SVC-GKN7Y2BSGW4NJTYL -m comment --comment "default/nginx-service:" -j KUBE-SEP-LQVPUPFGW6BWATIP
-A KUBE-SVC-NPX46M4PTMTKRN6Y -m comment --comment "default/kubernetes:https" -m recent --rcheck --seconds 10800 --reap --name KUBE-SEP-OMMOFZ27GPKZ4OPA --mask 255.255.255.255 --rsource -j KUBE-SEP-OMMOFZ27GPKZ4OPA
-A KUBE-SVC-NPX46M4PTMTKRN6Y -m comment --comment "default/kubernetes:https" -m recent --rcheck --seconds 10800 --reap --name KUBE-SEP-EWKNS2YCPXGJCXDC --mask 255.255.255.255 --rsource -j KUBE-SEP-EWKNS2YCPXGJCXDC
-A KUBE-SVC-NPX46M4PTMTKRN6Y -m comment --comment "default/kubernetes:https" -m statistic --mode random --probability 0.50000000000 -j KUBE-SEP-OMMOFZ27GPKZ4OPA
-A KUBE-SVC-NPX46M4PTMTKRN6Y -m comment --comment "default/kubernetes:https" -j KUBE-SEP-EWKNS2YCPXGJCXDC
-A KUBE-SVC-XP7QDA4CRQ2QA33W -m comment --comment "default/nodeport:" -j KUBE-SEP-C7HQKKO26GIFOZZM
-A KUBE-SVC-Z5P6OMNAEVLAQUTS -m comment --comment "default/nginx-cluster:" -j KUBE-SEP-UD3HOGDD5NDLNY74
COMMIT
*filter
:INPUT ACCEPT [40:14606]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [42:6275]
:DOCKER - [0:0]
:DOCKER-ISOLATION - [0:0]
:DOCKER-USER - [0:0]
:KUBE-FIREWALL - [0:0]
:KUBE-SERVICES - [0:0]
-A INPUT -m comment --comment "kubernetes service portals" -j KUBE-SERVICES
-A INPUT -j KUBE-FIREWALL
-A FORWARD -j DOCKER-USER
-A FORWARD -j DOCKER-ISOLATION
-A FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -o docker0 -j DOCKER
-A FORWARD -i docker0 ! -o docker0 -j ACCEPT
-A FORWARD -i docker0 -o docker0 -j ACCEPT
-A OUTPUT -m comment --comment "kubernetes service portals" -j KUBE-SERVICES
-A OUTPUT -j KUBE-FIREWALL
-A DOCKER-ISOLATION -j RETURN
-A DOCKER-USER -j RETURN
-A KUBE-FIREWALL -m comment --comment "kubernetes firewall for dropping marked packets" -m mark --mark 0x8000/0x8000 -j DROP
COMMIT
</code></pre>
| 0non-cybersec
| Stackexchange |
My battlestation - triple monitor ambilight!. | 0non-cybersec
| Reddit |
TIL of Radiofax, analogue mode for transmitting monochrome images via high frequency radio waves.. | 0non-cybersec
| Reddit |
[FRESH] Kid Cudi - Confused. | 0non-cybersec
| Reddit |
Far Future Expire Headers. <p>Do you use these? If so, what strategies do you have for managing changes to the files?</p>
<p><a href="http://developer.yahoo.net/blog/archives/2007/05/high_performanc_2.html" rel="noreferrer">http://developer.yahoo.net/blog/archives/2007/05/high_performanc_2.html</a></p>
| 0non-cybersec
| Stackexchange |
Group by multiple columns in dplyr, using string vector input. <p>I'm trying to transfer my understanding of plyr into dplyr, but I can't figure out how to group by multiple columns.</p>
<pre><code># make data with weird column names that can't be hard coded
data = data.frame(
asihckhdoydkhxiydfgfTgdsx = sample(LETTERS[1:3], 100, replace=TRUE),
a30mvxigxkghc5cdsvxvyv0ja = sample(LETTERS[1:3], 100, replace=TRUE),
value = rnorm(100)
)
# get the columns we want to average within
columns = names(data)[-3]
# plyr - works
ddply(data, columns, summarize, value=mean(value))
# dplyr - raises error
data %.%
group_by(columns) %.%
summarise(Value = mean(value))
#> Error in eval(expr, envir, enclos) : index out of bounds
</code></pre>
<p>What am I missing to translate the plyr example into a dplyr-esque syntax?</p>
<p><strong>Edit 2017</strong>: Dplyr has been updated, so a simpler solution is available. See the currently selected answer.</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 |
find: meaning of the \? sign as a value of the name parameter. <p>What is the meaning of the ? sign in the following command?</p>
<pre><code>find /foo/path -name \?
</code></pre>
| 0non-cybersec
| Stackexchange |
C++ operator overload template with different arguments. <p>I'm discovering C++ and I would like to create a mini mathematic Matrix librairy using templates.</p>
<p>Here, I want to overload the operator*.</p>
<p>If i describe a matrix like this: <code>M(y, x)</code> with <code>M</code> the matrix name, <code>y</code> and <code>x</code> the height and the width, a matrix multiplication should look like that:</p>
<pre><code>M(a, b) * N(b, c) = R(a, c)
</code></pre>
<p>Currently I have this code:</p>
<pre><code>template<unsigned int y, unsigned int x>
class Matrix
{
public:
Matrix() { }
~Matrix() { }
Matrix<y, x2>& operator*(const Matrix<y2, x2>& right)
{
// code...
}
private:
std::array<std::array<double, x>, y> m_values;
};
</code></pre>
<p>So I would like to be able to multiply two differents matrix like that:</p>
<pre><code>Matrix<3, 4> m;
Matrix<4, 2> n;
// fill the matrix with values
Matrix<3, 2> o = m * n;
</code></pre>
<p>I've searched but I didn't find the answer to this question (maybe because I don't really know what I must search exactly).</p>
<p>Thanks for your help :)</p>
| 0non-cybersec
| Stackexchange |
The one-arrow category as a weighted limit in Cat. <p>Many categories can be defined as weighted limits or colimits in the 2-category of categories <strong>Cat</strong>. For example the category <em>1</em> (one object with its identity) is the terminal object of <strong>Cat</strong>, the category <em>2</em> (two object with their respective identities) is the coproduct <em>1+1</em>. Even comma categories are weighted limits in <strong>Cat</strong>.</p>
<p>What about the category <em>{0 --> 1}</em> consisting of two objects <em>0</em> and <em>1</em> with their identities and one morphism between them? Can it be defined as some kind of limit (or composition of limits like <em>1+1</em>) in <strong>Cat</strong>?</p>
| 0non-cybersec
| Stackexchange |
Is this probability inequality true?. <p>This question may be simple, though I'm not managing to find an answer. Let <span class="math-container">$X$</span> and <span class="math-container">$Y$</span> be two dependent random vectors in in <span class="math-container">$\mathbb{R}^d$</span>, with joint probability density <span class="math-container">$\mu(x,y)$</span> (with respect to the Lebesgue measure). For any subset <span class="math-container">$A \subset \mathbb{R}^d$</span> and vector <span class="math-container">$t \in \mathbb{R}^d$</span>, define
<span class="math-container">$$
A+t=\{x+t=(x_1+t_1, \ldots, x_d+t_d): x \in A\}.
$$</span>
Is it true that
<span class="math-container">$$
P(X-Y \in A, Y \in B) \leq \sup_{t \in B}P(X \in A+t)
$$</span>
where <span class="math-container">$A$</span> and <span class="math-container">$B$</span> are measurable proper subset of <span class="math-container">$\mathbb{R}^d$</span>? The inequality is trivially true if <span class="math-container">$X$</span> and <span class="math-container">$Y$</span> are independent:
<span class="math-container">$$
P(X-Y \in A, Y \in B) =\int_B \left[\int_{A+y} \mu(x|y)dx\right] \mu(y)dy\\
=\int_B \left[\int_{A+y} \mu(x)dx\right] \mu(y)dy\\
=\int_B P(X\in A+y)\mu(y)dy\\
\leq \sup_{y \in B}P(X\in A+y)
$$</span>
where <span class="math-container">$\mu(x|y)$</span>, <span class="math-container">$\mu(x)$</span> and <span class="math-container">$\mu(y)$</span> are the conditional density of <span class="math-container">$X$</span> given <span class="math-container">$Y=y$</span>, the marginal density of <span class="math-container">$X$</span> and the marginal density of <span class="math-container">$Y$</span>, respectively. What about the case where <span class="math-container">$X$</span> and <span class="math-container">$Y$</span> are dependent (i.e. <span class="math-container">$\mu(x|y)\neq \mu(x)$</span>)?</p>
<p><strong>EDIT 1</strong> Here is my attempt:</p>
<p><span class="math-container">$$
\mathbb{P}(X-Y \in A, Y\in B)= \int_{B}\int_{A+y}\mu(x,y)dxdy\\
\leq \sup_{t\in B}\int_{B}\int_{A+t}\mu(x,y)dxdy\\
=\sup_{t\in B}\int_{A+t}\int_B\mu(x,y)dydx\\
\leq \sup _{t\in B}\int_{A+t}\mu(x)dx\\
=\sup _{t\in B}\mathbb{P}(X \in A+t)
$$</span></p>
<p>but I have doubts about the second and third lines, I'm not sure they're correct. I pass from the third to the fourth line by using the fact that <span class="math-container">$\mu(x,y)$</span> is nonnegative and
<span class="math-container">$$
\int_B\mu(x,y)dy \leq \int_{\mathbb{R}^d}\mu(x,y)dy=\mu(x).
$$</span></p>
<p><strong>EDIT 2</strong> Are there conditions (different from independence) under which the inequaliy holds true? In the somewhat patological case <span class="math-container">$X=Y$</span> with probability one, as highlighted in the answer below, the inequality may not be true. But what if <span class="math-container">$X \neq Y$</span> with probability 1? Are there conditions under which, in such an istance, the inequality is satisfied?</p>
| 0non-cybersec
| Stackexchange |
Sequences Fibonacci style. <p>Ok, so I've had a go at this question and have yielded 36 pairs so far but there are actually 40 to be found so I am 4 short. The question is: A sequence of non-negative integers with nth term u(n) is defined by u(1) = a and u(2) = b, and u(n+2) = u(n+1) + u(n). How many pairs of non-negative integrers (a,b) are there such that all the following are true?
1) 21 is a term of the sequence
2) a not equal to 21
3) b not equal to 21</p>
<p>What I have done so far:</p>
<p>If 21 is the 3rd term of the sequence, i.e. a + b, we have 20 different combinations to make 21: 1 + 20, 2 + 19 ... 20 + 1</p>
<p>If 21 is the 4th term of the sequence i.e. a + 2b, we have 10 different combinations 1 + 2*10, 3 + 2*9 ... 19 + 2*1 (also a must be odd)</p>
<p>If 21 is the 5th term of the sequence i.e. 2a + 3b I found three combinations: 2*3 + 3*5, 6*2 + 3*3, 9*2 + 3*1</p>
<p>If 21 is the 6th term of the sequence i.e. 3a + 5b I found 1 combination: 3*2 + 5*3</p>
<p>If 21 is the 7th term of the sequence i.e. 5a + 8b I found 1 combination: 5*1 + 8*2</p>
<p>If 21 is the 8th term of the sequence i.e. 8a + 13b I found 1 combination 8*1 + 13*1 </p>
<p>21 cannot be the 9th term with these rules since we have already used a = 1 and b = 1 so it is impossible.</p>
<p>But yeah, this totals to 36 and there are 40 combinations. Any further help would be much appreciated :)</p>
| 0non-cybersec
| Stackexchange |
u/TheMissingLink5 asks for help in fulfilling his brother dying wish to play TW: Three Kingdoms. A Creative Assembly representative sees the post, steps in and fulfills his wish.. | 0non-cybersec
| Reddit |
Convert Debian Makefile for FreeBSD. <p>I'm trying to follow a guide to compile a program for Debian in FreeBSD. I have the following makefile:</p>
<pre><code>obj-m += kernelinfo.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
</code></pre>
<p>I'm confused as to how I would compile this on FreeBSD since I do not have a <code>/lib/modules</code> folder on the machine. I have installed all of the default headers on FreeBSD in the <code>/usr/src/</code> directory but I can't find a modules folder. I'm guessing the Makefile needs to be translated for FreeBSD, though I am very new to Linux and so I have no idea. Any help is much appreciated.</p>
| 0non-cybersec
| Stackexchange |
Poor kitten. | 0non-cybersec
| Reddit |
POST method to send form data with AJAX without JQUERY. <p>I have a script in js that sends the form data from one page to the server and it works well with a Jquery function but I would like to be able to do it without the use of Jquery. When I try without jQuery the form is sent but the mail arrives empty, without sender, without subject and without message. Thanks in advance. </p>
<h2>script con jQuery (OK)</h2>
<pre><code>$("#contact-form").on("submit", function(event) {
event.preventDefault();
$.ajax({
type: "POST",
url: "php/email-sender.php",
data: {
name: $("#contact-form #name").val(),
email: $("#contact-form #email").val(),
subject: $("#contact-form #subject").val(),
message: $("#contact-form #message").val()
},
dataType: "json",
success: function(data) {
console.log(“success”);
} else {
console.log(“error”);
}
},
error: function() {
console.log(“error”);
}
});
});
</code></pre>
<h2>PHP script that receives the data</h2>
<pre><code>session_cache_limiter('nocache');
header('Expires: ' . gmdate('r', 0));
header('Content-type: application/json');
$Recipient = '[email protected]'; // <-- Set your email here
if($Recipient) {
$Name = $_POST['name'];
$Email = $_POST['email'];
$Subject = $_POST['subject'];
$Message = $_POST['message'];
if (isset($_POST['category'])) {
$Category = $_POST['category'];
}
$Email_body = "";
if (isset($_POST['category'])) {
$Email_body .= "From: " . $Name . "\n" .
"Email: " . $Email . "\n" .
"Subject: " . $Subject . "\n" .
"Message: " . $Message . "\n" .
"Category: " . $Category . "\n";
} else {
$Email_body .= "From: " . $Name . "\n" .
"Email: " . $Email . "\n" .
"Subject: " . $Subject . "\n" .
"Message: " . $Message . "\n" .
"Enviado el " . date('d/m/Y', time());
}
$Email_headers = "";
$Email_headers .= 'From: ' . $Name . ' <' . $Email . '>' . "\r\n".
"Reply-To: " . $Email . "\r\n";
$sent = mail($Recipient, $Subject, $Email_body, $Email_headers);
if ($sent){
$emailResult = array ('sent'=>'yes');
} else{
$emailResult = array ('sent'=>'no');
}
echo json_encode($emailResult);
} else {
$emailResult = array ('sent'=>'no');
echo json_encode($emailResult);
}
</code></pre>
<h2>Associated HTML</h2>
<pre><code><form id="contact-form" role="form">
<div class="form-group has-feedback">
<input type="text" class="form-control" id="name" name="name" placeholder="Nombre" required>
</div>
<div class="form-group has-feedback">
<input type="email" class="form-control" id="email" name="email" placeholder="Correo electronico" required>
</div>
<div class="form-group has-feedback">
<input type="text" class="form-control" id="subject" name="subject" placeholder="Asunto" required>
</div>
<div class="form-group has-feedback">
<textarea class="box-msg" rows="6" id="message" name="message"> </textarea>
</div>
<div class="form-group has-feedback">
<input type="submit" value="Enviar" class="submit-button btn btn-default">
</div>
</form>
</code></pre>
<h2>Test1 without jQuery (does not work)</h2>
<pre><code>// Submit contactForm START
const contactForm = document.getElementById("contact-form");
contactForm.addEventListener("submit", function(event) {
event.preventDefault();
var request = new XMLHttpRequest();
request.open("POST", "/php/email-sender.php", true);
request.setRequestHeader(
"Content-Type",
"application/x-www-form-urlencoded; charset=UTF-8"
);
request.onreadystatechange = function() {
if (request.readyState == XMLHttpRequest.DONE) {
// request end.
if (request.status == 200) {
// success START
console.log(request.response);
// success END
} else {
// error START
console.log("error");
// error END
}
}
};
var formData = new FormData();
data.append("name", document.getElementById("name").value);
data.append("email", document.getElementById("email").value);
data.append("subject", document.getElementById("subject").value);
data.append("message", document.getElementById("message").value);
request.send(formData);
});
</code></pre>
<h2>Test2 without jQuery (does not work)</h2>
<pre><code>var contactForm = document.getElementById("contact-form");
contactForm.addEventListener("submit", function(event) {
event.preventDefault();
var request = new XMLHttpRequest();
request.open("POST", "/php/email-sender.php", true);
request.setRequestHeader("Content-Type", "application/json; charset=UTF-8");
request.onreadystatechange = function() {
if (request.readyState == XMLHttpRequest.DONE) {
// request end.
if (request.status == 200) {
// success START
console.log(request.response);
// success END
} else {
// error START
console.log("error");
// error END
}
}
};
var data = {
name: document.getElementById("name").value,
email: document.getElementById("email").value,
subject: document.getElementById("subject").value,
message: document.getElementById("message").value
};
request.send(JSON.stringify(data));
});
</code></pre>
| 0non-cybersec
| Stackexchange |
Using a data warehouse staging database as a source of operational data. <p>Should you use the staging database within a data warehouse as a source of operational data? </p>
<p>ie, is it good practice for other operational (non BI) systems to source their data from this database? Or is the data warehouse there for information reporting/analysis and definitely not for information processing/feeding to other systems?</p>
<p>In general, is it good practice to source operational data from any part of a data warehouse system? Or should a data warehouse be a consumer of data only?</p>
| 0non-cybersec
| Stackexchange |
"Tetris Effect" Coming Soon In Oculus Quest Store Listing. | 0non-cybersec
| Reddit |
Why do all nice things have to end. | 0non-cybersec
| Reddit |
Query multiple Google spreadsheets. <p>I have the following sheets:</p>
<ul>
<li>ListA</li>
<li>ListB</li>
<li>ListC</li>
</ul>
<p>Note: at each sheet I have a column which contains YES or NO.</p>
<p>How do I query all my lists (spreadsheets) where myBooleanColumn equals to YES/NO?</p>
| 0non-cybersec
| Stackexchange |
Update: Drake did not say "fuck Hot97" at his summer sixteen tour MSG stop. Complex just updated their story with a long paragraph basically saying a complex writer heard it and they ran with that bitch. Here's the update /#fuckcomplex
UPDATE 11:01 a.m.: Last night Complex reported that Drake said "fuck Hot 97," in addition to making a call for DJ Funkmaster Flex's termination, during his show at Madison Square Garden. This report was based on the first-hand account of Complex staffers in attendance, and corroborated by other concertgoers. However, while audio of the Flex slight has surfaced, no audio or visual evidence of Drake slighting the station as a whole in that manner has been produced. While our staffers maintain their recollection of events, as an outlet we must rescind that report until further evidence is produced, and apologize to both parties, as well as our audience, for our rush to publication. | 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 |
MRW someone fills me in on the details of my drunken night [FIXED]. | 0non-cybersec
| Reddit |
Why java division for integer is faster than hacker's delight implementation. <p>I am testing divs10 function throughput from hacker's delight book, coded in java on my jdk 1.7 64bit version 21 and i7 intel box
processor : 7
vendor_id : GenuineIntel
cpu family : 6
model : 26
model name : Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz</p>
<p>I am wondering why the default java operator / is faster than divs10 function from hacker's delight book, the result shows divs10 is 3 times slower than "/" operator, to my surprise.</p>
<p>anybody can tell me if there is any fancy intrinsic jvm can be using? </p>
<p>source code as below.</p>
<pre><code> public class div10 {
public static final int divs10(int n) {
int q, r;
n = n + (n >> 31 & 9);
q = (n >> 1) + (n >> 2);
q += q >> 4;
q += q >> 8;
q += q >> 16;
q = q >> 3;
r = n - ((q << 3) + (q << 1));
return q + ((r + 6) >> 4);
}
public static void main(String[] args) {
/*
long count = 0;
for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++) {
if ( (i/10) != divs10(i) ) {
System.err.println("error dividing :" + i );
}
if ((i & 0xFFFFFFF ) == 0 ) {
System.out.println("Finished:" + Long.toHexString(count) + ":" + count + ":" + i);
}
count++;
}
System.out.println("Success:" + count);
*/
long start = System.nanoTime();
long count = 0L;
int iter = 100_000;
for (int j = 0; j < 10; j++)
for (int i = -iter; i < iter; i++) {
count += (i/10);
}
for (int j = 0; j < 10; j++)
for (int i = -iter; i < iter; i++) {
count += divs10(i);
}
System.out.println(count + " warm up done ") ;
start = System.nanoTime();
count = 0L;
for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++) {
count += i/10;
}
System.out.println(count + ", took:" + (System.nanoTime() - start) / 1000_000L + " ms, " + (System.nanoTime() - start) / ((long)Integer.MAX_VALUE - (long)Integer.MIN_VALUE) + " ns per ops" ) ;
start = System.nanoTime();
count = 0L;
for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++) {
count += divs10(i);
}
System.out.println(count + ", took:" + (System.nanoTime() - start) / 1000_000L + " ms, " + (System.nanoTime() - start) / ((long)Integer.MAX_VALUE - (long)Integer.MIN_VALUE) + " ns per ops" ) ;
}
}
</code></pre>
| 0non-cybersec
| Stackexchange |
Limit of $x^5\cos\left(\frac1x\right)$ as $x$ approaches $0$. <p>Find the limit of $x^5\cos\left(\frac1x\right)$ as $x$ approaches $0$.
Can I just substitute $0$ to $x^5$? But what would be $\cos\left(\frac10\right)$ be?</p>
<p>I could solve for $-x^4\le x^4\cos(1/x)\leq x^4$
in which limit of $x^4$ is and $-x^4=0$ and by sandwich theorem limit=0
but is there a method to solve it without doing so</p>
| 0non-cybersec
| Stackexchange |
Atomic Tom had their equipment stolen, but they know how to improvise. Watch them perform their single "Take Me Out" on the New York Subway... with their iPhones.. | 0non-cybersec
| Reddit |
Django AWS Elastic Beanstalk error ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb. <p>I know this error have come to many people and I have tried different solutions and none of them worked.</p>
<p>I am using aws eb cli.</p>
<p>I am using following command <code>eb deploy</code> to deploy my application to server.</p>
<p>Following are the configuration for my Django.</p>
<p>under <code>.ebextensions</code> directory, I have following 2 files:</p>
<p><strong>1: 01_packages.config</strong></p>
<pre><code>packages:
yum:
git: []
python27-devel: []
mysql: []
mysql-devel: []
</code></pre>
<p>and another file is</p>
<p><strong>2: 02_django.conf</strong></p>
<pre><code>option_settings:
"aws:elasticbeanstalk:application:environment":
DJANGO_SETTINGS_MODULE: "settings.development"
"PYTHONPATH": "/opt/python/current/app/src:$PYTHONPATH"
"aws:elasticbeanstalk:container:python":
WSGIPath: src/wsgi.py
NumProcesses: 3
NumThreads: 20
"aws:elasticbeanstalk:container:python:staticfiles":
"/static/": "static/"
</code></pre>
<p>Following is my requirements.txt file after <code>pip freeze</code> in my local virtual environment.</p>
<p><strong>requirements.txt</strong></p>
<pre><code>asn1crypto==0.24.0
awsebcli==3.17.1
backports.ssl-match-hostname==3.5.0.1
botocore==1.14.17
cement==2.8.2
cent==2.1.0
centrifuge==0.8.4
certifi==2017.11.5
cffi==1.11.2
chardet==3.0.4
colorama==0.3.9
cryptography==2.1.4
Django==1.8.18
django-colorfield==0.1.14
django-countries==5.0
django-debug-toolbar==1.9.1
django-environ==0.4.4
django-multiselectfield==0.1.8
django-simple-history==1.9.1
django-sslserver==0.20
docutils==0.15.2
enum34==1.1.6
future==0.16.0
google-api-python-client==1.6.4
hiredis==0.2.0
html5lib==1.0b8
httplib2==0.10.3
icalendar==4.0.0
idna==2.6
ipaddress==1.0.18
jmespath==0.9.4
jsonschema==2.4.0
mysqlclient==1.4.6
oauth2client==2.0.0
oauthclient==1.0.3
olefile==0.44
pathspec==0.5.9
paypalrestsdk==1.13.1
pdfcrowd==4.0.1
phonenumbers==8.8.6
Pillow==4.3.0
pyasn1==0.3.7
pyasn1-modules==0.1.5
pycparser==2.18
PyJWT==1.5.3
pyOpenSSL==17.5.0
PyPDF2==1.26.0
pypiwin32==219
pytesseract==0.1.7
python-dateutil==2.6.1
pytz==2017.3
PyYAML==5.2
reportlab==3.4.0
requests==2.18.4
rsa==3.4.2
semantic-version==2.5.0
six==1.11.0
sockjs-tornado==1.0.1
sqlparse==0.2.4
termcolor==1.1.0
toredis-fork==0.1.4
tornado==4.2.1
toro==0.8
twilio==6.9.1
uritemplate==3.0.0
urllib3==1.22
wcwidth==0.1.8
webencodings==0.5.1
xhtml2pdf==0.2.2
</code></pre>
<p>I kept this in my root directory.</p>
<p>When I run <code>eb deploy</code></p>
<p>it deploys successfully.</p>
<p><a href="https://i.stack.imgur.com/bUbKO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bUbKO.png" alt="enter image description here"></a></p>
<p>but when I run the browser to my url.</p>
<p>I get this <code>Internal Server Error</code> page.</p>
<p><a href="https://i.stack.imgur.com/iWVbb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iWVbb.png" alt="enter image description here"></a></p>
<p>So I tried to look in to the log files on the server under <code>/var/log/httpd/error_log</code></p>
<p>i get the following error:</p>
<pre><code>[Mon Feb 24 17:56:57.227427 2020] [:error] [pid 8054] [remote 101.50.93.65:188] mod_wsgi (pid=8054): Target WSGI script '/opt/python/current/app/src/wsgi.py' cannot be loaded as Python module.
[Mon Feb 24 17:56:57.227450 2020] [:error] [pid 8054] [remote 101.50.93.65:188] mod_wsgi (pid=8054): Exception occurred processing WSGI script '/opt/python/current/app/src/wsgi.py'.
[Mon Feb 24 17:56:57.227466 2020] [:error] [pid 8054] [remote 101.50.93.65:188] Traceback (most recent call last):
[Mon Feb 24 17:56:57.227483 2020] [:error] [pid 8054] [remote 101.50.93.65:188] File "/opt/python/current/app/src/wsgi.py", line 17, in <module>
[Mon Feb 24 17:56:57.227585 2020] [:error] [pid 8054] [remote 101.50.93.65:188] application = get_wsgi_application()
[Mon Feb 24 17:56:57.227599 2020] [:error] [pid 8054] [remote 101.50.93.65:188] File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/core/wsgi.py", line 14, in get_wsgi_application
[Mon Feb 24 17:56:57.227627 2020] [:error] [pid 8054] [remote 101.50.93.65:188] django.setup()
[Mon Feb 24 17:56:57.227634 2020] [:error] [pid 8054] [remote 101.50.93.65:188] File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
[Mon Feb 24 17:56:57.227645 2020] [:error] [pid 8054] [remote 101.50.93.65:188] apps.populate(settings.INSTALLED_APPS)
[Mon Feb 24 17:56:57.227651 2020] [:error] [pid 8054] [remote 101.50.93.65:188] File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/apps/registry.py", line 78, in populate
[Mon Feb 24 17:56:57.227662 2020] [:error] [pid 8054] [remote 101.50.93.65:188] raise RuntimeError("populate() isn't reentrant")
[Mon Feb 24 17:56:57.227676 2020] [:error] [pid 8054] [remote 101.50.93.65:188] RuntimeError: populate() isn't reentrant
</code></pre>
<p>So I kept Googling, and found a post suggested to change wsgi file, and I did and then this error updated to the following lines of code.</p>
<pre><code>[Mon Feb 24 18:23:12.169850 2020] [mpm_prefork:notice] [pid 9081] AH00169: caught SIGTERM, shutting down
[Mon Feb 24 18:23:13.289449 2020] [suexec:notice] [pid 10286] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Feb 24 18:23:13.305290 2020] [so:warn] [pid 10286] AH01574: module wsgi_module is already loaded, skipping
[Mon Feb 24 18:23:13.307373 2020] [http2:warn] [pid 10286] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Mon Feb 24 18:23:13.307384 2020] [http2:warn] [pid 10286] AH02951: mod_ssl does not seem to be enabled
[Mon Feb 24 18:23:13.307990 2020] [lbmethod_heartbeat:notice] [pid 10286] AH02282: No slotmem from mod_heartmonitor
[Mon Feb 24 18:23:13.308050 2020] [:warn] [pid 10286] mod_wsgi: Compiled for Python/2.7.13.
[Mon Feb 24 18:23:13.308057 2020] [:warn] [pid 10286] mod_wsgi: Runtime using Python/2.7.16.
[Mon Feb 24 18:23:13.311200 2020] [mpm_prefork:notice] [pid 10286] AH00163: Apache/2.4.41 (Amazon) mod_wsgi/3.5 Python/2.7.16 configured -- resuming normal operations
[Mon Feb 24 18:23:13.311217 2020] [core:notice] [pid 10286] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Mon Feb 24 18:23:16.367182 2020] [:error] [pid 10293] [remote 127.0.0.1:0] mod_wsgi (pid=10293): Exception occurred processing WSGI script '/opt/python/current/app/src/wsgi.py'.
[Mon Feb 24 18:23:16.367240 2020] [:error] [pid 10293] [remote 127.0.0.1:0] RuntimeError: response has not been started
[Mon Feb 24 18:23:17.744228 2020] [:error] [pid 10291] [remote 127.0.0.1:0] mod_wsgi (pid=10291): Exception occurred processing WSGI script '/opt/python/current/app/src/wsgi.py'.
[Mon Feb 24 18:23:17.744288 2020] [:error] [pid 10291] [remote 127.0.0.1:0] RuntimeError: response has not been started
[Mon Feb 24 18:23:19.116825 2020] [:error] [pid 10292] [remote 127.0.0.1:0] mod_wsgi (pid=10292): Exception occurred processing WSGI script '/opt/python/current/app/src/wsgi.py'.
[Mon Feb 24 18:23:19.116892 2020] [:error] [pid 10292] [remote 127.0.0.1:0] RuntimeError: response has not been started
[Mon Feb 24 18:23:20.493432 2020] [:error] [pid 10418] [remote 127.0.0.1:0] mod_wsgi (pid=10418): Exception occurred processing WSGI script '/opt/python/current/app/src/wsgi.py'.
[Mon Feb 24 18:23:20.493489 2020] [:error] [pid 10418] [remote 127.0.0.1:0] RuntimeError: response has not been started
[Mon Feb 24 18:36:44.987693 2020] [:error] [pid 10443] [remote 95.105.12.68:0] mod_wsgi (pid=10443): Exception occurred processing WSGI script '/opt/python/current/app/src/wsgi.py'.
[Mon Feb 24 18:36:44.987766 2020] [:error] [pid 10443] [remote 95.105.12.68:0] RuntimeError: response has not been started
[Mon Feb 24 18:55:28.298121 2020] [:error] [pid 10468] [remote 101.50.93.65:0] mod_wsgi (pid=10468): Exception occurred processing WSGI script '/opt/python/current/app/src/wsgi.py'.
[Mon Feb 24 18:55:28.298180 2020] [:error] [pid 10468] [remote 101.50.93.65:0] RuntimeError: response has not been started
[Mon Feb 24 18:55:30.126198 2020] [:error] [pid 10499] [remote 101.50.93.65:0] mod_wsgi (pid=10499): Exception occurred processing WSGI script '/opt/python/current/app/src/wsgi.py'.
[Mon Feb 24 18:55:30.126260 2020] [:error] [pid 10499] [remote 101.50.93.65:0] RuntimeError: response has not been started
[Mon Feb 24 18:55:31.671293 2020] [:error] [pid 10973] [remote 101.50.93.65:0] mod_wsgi (pid=10973): Exception occurred processing WSGI script '/opt/python/current/app/src/wsgi.py'.
[Mon Feb 24 18:55:31.671358 2020] [:error] [pid 10973] [remote 101.50.93.65:0] RuntimeError: response has not been started
[Mon Feb 24 18:55:32.858757 2020] [:error] [pid 11606] [remote 101.50.93.65:0] mod_wsgi (pid=11606): Exception occurred processing WSGI script '/opt/python/current/app/src/wsgi.py'.
[Mon Feb 24 18:55:32.858821 2020] [:error] [pid 11606] [remote 101.50.93.65:0] RuntimeError: response has not been started
</code></pre>
<p>and this is the new <strong>wsgi.py</strong> file.</p>
<pre><code>import os
import logging
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.development")
from django.core.wsgi import get_wsgi_application
# application = get_wsgi_application()
env_variables_to_pass = ['DJANGO_SETTINGS_MODULE', ]
def application(environ, start_response):
if environ['mod_wsgi.process_group'] != '':
import signal
os.kill(os.getpid(), signal.SIGINT)
return ["killed"]
</code></pre>
<p>and following was the old <strong>wsgi.py</strong> file</p>
<pre><code>
import os
import logging
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.development")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
env_variables_to_pass = ['DJANGO_SETTINGS_MODULE', ]
</code></pre>
<p>So then I tried to run application on the server using <code>python manage.py runserver</code> as there was nothing else to do to fix this and I was not sure where the problem is.</p>
<p>So I did ssh and I did used the virtualenvironment of server that was already there created by EB.</p>
<p><a href="https://i.stack.imgur.com/rY9XA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rY9XA.png" alt="enter image description here"></a></p>
<p>after running python manage.py runserver.</p>
<p>I get this following error.</p>
<pre><code> File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 27, in <module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb
</code></pre>
<p><a href="https://i.stack.imgur.com/1mXR9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1mXR9.png" alt="enter image description here"></a></p>
<p>So I tried to follow any advice that I could see available on google.</p>
<p>I tried <code>pip install mysqlclient</code></p>
<p>I get this error.</p>
<pre><code>
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/d0/97/7326248ac8d5049968bf4ec708a5d3d4806e412a42e74160d7f266a3e03a/mysqlclient-1.4.6.tar.gz
Complete output from command python setup.py egg_info:
sh: mysql_config: command not found
sh: mariadb_config: command not found
sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-MxFUOd/mysqlclient/setup.py", line 16, in <module>
metadata, options = get_config()
File "setup_posix.py", line 61, in get_config
libs = mysql_config("libs")
File "setup_posix.py", line 29, in mysql_config
raise EnvironmentError("%s not found" % (_mysql_config_path,))
EnvironmentError: mysql_config not found
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-MxFUOd/mysqlclient/
</code></pre>
<p>I tried both </p>
<p><code>pip install mysqlclient --no-cache-dir</code></p>
<p>and </p>
<p><code>pip install mysqlclient</code></p>
<p>It's Centos server so I cannot do the sudo apt-get commands.</p>
<p>Only yum commands work.</p>
<p>I tried this following command with sudo</p>
<p><code>sudo pip install mysql-connector-python</code></p>
<p>But I think this will be installed globally rather than env. </p>
<p>So I tried without sudo, and it gave permission error.</p>
<p>I used other commands to install mysql both with sudo and not sudo.</p>
<p><code>pip install pymysql</code></p>
<p><code>sudo yum install python-mysqldb</code></p>
<p>No matter what I do I get this MySQL error.</p>
<p>I don't want to move to other database as I would have to move data as well.</p>
<hr>
<p><strong>UPDATE</strong></p>
<p>from given suggession of <code>@Arun K</code> i ran this following command</p>
<p><code>which mysql_config</code></p>
<p>i got this following response.</p>
<pre><code>/usr/bin/which: no mysql_config in (/opt/python/run/venv/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin)
</code></pre>
<p><a href="https://i.stack.imgur.com/qQBt1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qQBt1.png" alt="enter image description here"></a></p>
| 0non-cybersec
| Stackexchange |
Make a clip from a video with FFMPEG. <p>I want to make a clip from a video with FFmpeg with 2-second video every <code>m</code> minutes, where</p>
<pre><code>m = video_length / 5
</code></pre>
<p>For example I have a video that is 10 minutes long. The video clip will have 10 seconds total length (5 segments by 2 seconds) and will be composed of these video timestamp ranges:</p>
<pre><code>00:00 - 00:02
02:00 - 02:02
04:00 - 04:02
06:00 - 06:02
08:00 - 08:02
</code></pre>
<p>This will produce a sort of trailer from the video.</p>
<p>I know I can achieve that with segment but can't figure out the whole process.</p>
| 0non-cybersec
| Stackexchange |
The Wire is full great dialogue, but this conversation between Cutty and Avon is one of the best.. | 0non-cybersec
| Reddit |
Microsoft is planning to EOL EMET as a separate product. | 0non-cybersec
| Reddit |
Proof of Independence of two functions of random variables. <p>If we have two random variables $X$ and $Y$ ($0<x<y$) and we know the conditional density $f(x\mid y) = \frac{3x^2}{y^3}$, how can we show that $Z = \frac{X}{Y}$ and $Y$ are independent?</p>
<p>Specifically, we don't have $f_Y(y)$ and, as a result, can't say anything about the joint density $f_{X,Y}(x,y)$.</p>
<p>In terms of the definition of independence, I believe that you would want to show that you can express the joint density of $Z$ and $Y$, $f_{Z,Y}(z,y)$, as a separable product $f_Z(z) f_Y(y)$.</p>
| 0non-cybersec
| Stackexchange |
C# equivalent of DecryptByPassPhrase. <p>I have a requirement to decrypt a value that was encrypted on the database using EncryptByPassPhrase, but without accessing the database.</p>
<p>How do I get the encryption key from the passphrase?</p>
<p>I've looked at</p>
<p><a href="https://stackoverflow.com/questions/13617807/replicate-t-sql-decryptbypassphrase-in-c-sharp">Replicate T-SQL DecryptByPassPhrase in C#</a></p>
<p>and</p>
<p><a href="https://stackoverflow.com/questions/21684733/c-sharp-decrypt-bytes-from-sql-server-encryptbypassphrase?lq=1">C# Decrypt bytes from SQL Server EncryptByPassPhrase?</a></p>
<p>and my code is:</p>
<pre><code>public static string AESDatabaseDecrypt(string encryptedString)
{
passphrase = "S0meFakePassPhrase01234!";
encryptedString = "AQAAAOmuc52dnbVwTqEx1kp+4WhI89LYKHh3jg=="; // temporarily hard coded
// setup encryption settings to match decryptbypassphrase
TripleDESCryptoServiceProvider provider = new TripleDESCryptoServiceProvider();
provider.Key = UTF8Encoding.UTF8.GetBytes(passphrase).Take(16).ToArray(); // stuck on getting key from passphrase
provider.KeySize = 128;
provider.Padding = PaddingMode.Zeros;
// setup data to be decrypted
byte[] encryptedStringAsByteArray = Convert.FromBase64String(encryptedString);
// hack some extra bytes up to a multiple of 8
encryptedStringAsByteArray = encryptedStringAsByteArray.Concat(new byte[] { byte.MinValue, byte.MinValue, byte.MinValue, byte.MinValue }).ToArray(); // add 4 empty bytes to make 32 bytes
MemoryStream encryptedStringAsMemoryStream = new MemoryStream(encryptedStringAsByteArray);
// decrypt
CryptoStream cryptoStream = new CryptoStream(encryptedStringAsMemoryStream, provider.CreateDecryptor(), CryptoStreamMode.Read);
// return the result
StreamReader cryptoStreamReader = new StreamReader(cryptoStream);
string decryptedString = cryptoStreamReader.ReadToEnd();
}
</code></pre>
| 0non-cybersec
| Stackexchange |
Guitar strings oscillating is very oddly satisfying. | 0non-cybersec
| Reddit |
After hearing TCU's QB suspended for the Bowl game, Blue Mountain State was all I could think of.. | 0non-cybersec
| Reddit |
Setting-up Beetel BG64 3G USB modem in ubuntu 13.10 [How-To]. <p>I have just bought a Beetel BG64 usb modem.
This modem is working fine on Win 7 but not in ubuntu 13.10 (saucy).</p>
<p>I have tried a lot, but still not working.I have posted the output of <code>lsusb</code> & <code>usb-devices</code> necessarily. Any suggestion will be helpful. Thank you in advance.</p>
<h1>edit:<br></h1>
<h3>What I did:</h3>
<ul>
<li>without attaching the dongle I pressed <kbd>Ctrl</kbd>+<kbd>Meta</kbd>+<kbd>T</kbd>, then typed:<br></li>
</ul>
<pre>mount /dev/sr <br></pre>
<p>And pressed Tab. This gave me the only suggestion,<br></p>
<pre>mount /dev/sr0 <br></pre>
<ul>
<li>Again I attached the dongle , then did the same, and the output is:<br></li>
</ul>
<pre>mount /dev/sr
sr0 sr1</pre>
<ul>
<li>Now I pulled out the dongle from my machine and did:<br></li>
</ul>
<pre>lsusb</pre>
<p>And I got the result:<br></p>
<pre><code>Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br>
Bus 002 Device 003: ID 0d8c:0201 C-Media Electronics, Inc. CM6501<br>
Bus 002 Device 002: ID 04f3:0212 Elan Microelectronics Corp. Laser Mouse<br>
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br>
</code></pre>
<ul>
<li>Then I connected it to the machine again and did the same, and got:</li>
</ul>
<pre>lsusb</pre>
<pre><code>Bus 001 Device 004: ID 2020:0002 <br>
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br>
Bus 002 Device 003: ID 0d8c:0201 C-Media Electronics, Inc. CM6501<br>
Bus 002 Device 002: ID 04f3:0212 Elan Microelectronics Corp. Laser Mouse<br>
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br>
<br>
</code></pre>
<ul>
<li>without connecting the dongle I did:<br></li>
</ul>
<pre>usb-devices</pre>
<p>and got:<br></p>
<pre><code>T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 9<br>
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1<br>
P: Vendor=1d6b ProdID=0002 Rev=03.11<br>
S: Manufacturer=Linux 3.11.0-15-generic ehci_hcd<br>
S: Product=EHCI Host Controller<br>
S: SerialNumber=0000:00:02.1<br>
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA<br>
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub<br>
T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 9<br>
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1<br>
P: Vendor=1d6b ProdID=0001 Rev=03.11<br>
S: Manufacturer=Linux 3.11.0-15-generic ohci_hcd<br>
S: Product=OHCI PCI host controller<br>
S: SerialNumber=0000:00:02.0<br>
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA<br>
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub<br>
T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=1.5 MxCh= 0<br>
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1<br>
P: Vendor=04f3 ProdID=0212 Rev=23.24<br>
S: Product=PS/2+USB Mouse<br>
C: #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA<br>
I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=usbhid<br>
T: Bus=02 Lev=01 Prnt=01 Port=06 Cnt=02 Dev#= 3 Spd=12 MxCh= 0<br>
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1<br>
P: Vendor=0d8c ProdID=0201 Rev=00.10<br>
S: Product=PnP Audio Device <br>
C: #Ifs= 3 Cfg#= 1 Atr=80 MxPwr=500mA<br>
I: If#= 0 Alt= 0 #EPs= 1 Cls=01(audio) Sub=01 Prot=00 Driver=snd-usb-audio<br>
I: If#= 1 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio<br>
I: If#= 2 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio<br>
</code></pre>
<ul>
<li>Then I did the same after attaching it again, and got:<br></li>
</ul>
<pre>usb-devices</pre>
<pre><code>T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 9<br>
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1<br>
P: Vendor=1d6b ProdID=0002 Rev=03.11<br>
S: Manufacturer=Linux 3.11.0-15-generic ehci_hcd<br>
S: Product=EHCI Host Controller<br>
S: SerialNumber=0000:00:02.1<br>
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA<br>
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub<br>
T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 5 Spd=480 MxCh= 0<br>
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1<br>
P: Vendor=2020 ProdID=0002 Rev=02.00<br>
S: Manufacturer=Network Connect<br>
S: Product=MT6229 <br>
S: SerialNumber=192101021136100<br>
C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA<br>
I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage<br>
T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 9<br>
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1<br>
P: Vendor=1d6b ProdID=0001 Rev=03.11<br>
S: Manufacturer=Linux 3.11.0-15-generic ohci_hcd<br>
S: Product=OHCI PCI host controller<br>
S: SerialNumber=0000:00:02.0<br>
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA<br>
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub<br>
T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=1.5 MxCh= 0<br>
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1<br>
P: Vendor=04f3 ProdID=0212 Rev=23.24<br>
S: Product=PS/2+USB Mouse<br>
C: #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA<br>
I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=usbhid<br>
T: Bus=02 Lev=01 Prnt=01 Port=06 Cnt=02 Dev#= 3 Spd=12 MxCh= 0<br>
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1<br>
P: Vendor=0d8c ProdID=0201 Rev=00.10<br>
S: Product=PnP Audio Device <br>
C: #Ifs= 3 Cfg#= 1 Atr=80 MxPwr=500mA<br>
I: If#= 0 Alt= 0 #EPs= 1 Cls=01(audio) Sub=01 Prot=00 Driver=snd-usb-audio<br>
I: If#= 1 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio<br>
I: If#= 2 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio<br>
</code></pre>
<ul>
<li>Then I did:</li>
</ul>
<pre>sudo mount /dev/sr1 /cdrom/</pre>
<p>got the output as:</p>
<pre>mount: block device /dev/sr1 is write-protected, mounting read-only</pre>
<ul>
<li>Finally doing:<br></li>
</ul>
<pre>nautilus /cdrom/</pre>
<p>I got no .tar.bz2 or .deb so that I could make it or directly install its driver.<br></p>
<ul>
<li>In my gesture my device is (lsusb):<br></li>
</ul>
<blockquote>
<p>Bus 001 Device 004: ID 2020:0002 <br></p>
</blockquote>
<p>and (usb-devices),<br></p>
<pre><code>T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 5 Spd=480 MxCh= 0<br>
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1<br>
P: Vendor=2020 ProdID=0002 Rev=02.00<br>
S: Manufacturer=Network Connect<br>
S: Product=MT6229 <br>
S: SerialNumber=192101021136100<br>
C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA<br>
I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage<br>
</code></pre>
<p>Modem Detail:<br><br>
beetel<br>
S/N: 110100371109632<br>
IMEI: 911210201163014<br>
Made in China<br></p>
<hr>
<p>Ubuntu 13.10 (saucy)<br>
GNOME 3.8.4 (Ubuntu 2013-12-05)<br>
Kernel 3.11.0-15-generic (#25-Ubuntu SMP Thu Jan 30 17:22:01 UTC 2014)<br></p>
<p>OS Type Linux<br>
GCC Version 4.8 (x86_64-linux-gnu)<br>
Xorg Version 1.14.5 (17 December 2013 10:06:15AM)<br></p>
<p>More strangely this dongle does not show up my 2GB micro SD memory card.</p>
<p>Any help will be saviour for me.
Otherwise I would have to stick to Windows 7,<br>
since without an internet connection ubuntu cannot even be upgraded.</p>
<p>-------------------------------------------------------------------<br>
With the dongle attached I started booting ubuntu, did the following and got:<br></p>
<pre><code>appuraja@appuraja-System-Product-Name:~$ dmesg | tail <br>
[ 24.919630] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready<br>
[ 26.631204] init: udev-fallback-graphics main process (1237) terminated with status 1<br>
[ 26.839371] nvidia 0000:05:00.0: irq 44 for MSI/MSI-X<br>
[ 27.340359] vboxdrv: Found 2 processor cores.<br>
[ 27.342598] vboxdrv: fAsync=1 offMin=0x5c90e offMax=0x5c90e<br>
[ 27.346034] vboxdrv: TSC mode is 'asynchronous', kernel timer mode is 'normal'.<br>
[ 27.346040] vboxdrv: Successfully loaded version 4.2.16_Ubuntu (interface 0x001a0005).<br>
[ 27.388335] vboxpci: IOMMU not found (not registered)<br>
[ 45.088400] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.<br>
[ 70.090509] systemd-hostnamed[2508]: Warning: nss-myhostname is not installed. Changing the local hostname might make it unresolveable. Please install nss-myhostname!<br>
appuraja@appuraja-System-Product-Name:~$ lsusb <br>
Bus 001 Device 004: ID 2020:2000 <br>
Bus 001 Device 003: ID 0781:556b SanDisk Corp. <br>
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br>
Bus 002 Device 003: ID 0d8c:0201 C-Media Electronics, Inc. CM6501<br>
Bus 002 Device 002: ID 04f3:0212 Elan Microelectronics Corp. Laser Mouse<br>
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br>
<br>
</code></pre>
<p>Then after removing the dongle I did this and got:</p>
<pre><code>appuraja@appuraja-System-Product-Name:~$ dmesg | tail <br>
[ 207.048903] usb 1-4: New USB device strings: Mfr=2, Product=3, SerialNumber=4<br>
[ 207.048909] usb 1-4: Product: MT6229 <br>
[ 207.048914] usb 1-4: Manufacturer: Network Connect<br>
[ 207.048919] usb 1-4: SerialNumber: 192101021136100<br>
[ 207.049560] usb-storage 1-4:1.0: USB Mass Storage device detected<br>
[ 207.051143] scsi8 : usb-storage 1-4:1.0<br>
[ 208.049695] scsi 8:0:0:0: CD-ROM UsbModem Storage Disk 6229 PQ: 0 ANSI: 0 CCS<br>
[ 208.051794] sr1: scsi3-mmc drive: 0x/0x caddy<br>
[ 208.053540] sr 8:0:0:0: Attached scsi CD-ROM sr1<br>
[ 208.060184] sr 8:0:0:0: Attached scsi generic sg4 type 5<br>
appuraja@appuraja-System-Product-Name:~$ lsusb <br>
Bus 001 Device 006: ID 2020:0002 <br>
Bus 001 Device 003: ID 0781:556b SanDisk Corp. <br>
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br>
Bus 002 Device 003: ID 0d8c:0201 C-Media Electronics, Inc. CM6501<br>
Bus 002 Device 002: ID 04f3:0212 Elan Microelectronics Corp. Laser Mouse<br>
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br>
<br>
</code></pre>
<p>Oh! I forgot to tell you this time I had left a SanDisk Cruzer Edge 8GB pendrive in one USB port.<br><br></p>
<p><em>Edit</em> (05/02/2014 12:30 PM):<br/></p>
<pre><code>appuraja@appuraja-System-Product-Name:~$ dmesg | tail & lsusb <br/>
[1] 21063<br/>
[ 1519.068041] usb 1-2: new high-speed USB device number 5 using ehci-pci<br/>
[ 1519.200920] usb 1-2: New USB device found, idVendor=2020, idProduct=0002<br/>
[ 1519.200933] usb 1-2: New USB device strings: Mfr=2, Product=3, SerialNumber=4<br/>
[ 1519.200939] usb 1-2: Product: MT6229 <br/>
[ 1519.200945] usb 1-2: Manufacturer: Network Connect<br/>
[ 1519.200950] usb 1-2: SerialNumber: 192101021136100<br/>
[ 1519.201451] usbserial_generic 1-2:1.0: The "generic" usb-serial driver is only for testing and one-off prototypes.<br/>
[ 1519.201458] usbserial_generic 1-2:1.0: Tell [email protected] to add your device to a proper driver.<br/>
[ 1519.201464] usbserial_generic 1-2:1.0: generic converter detected<br/>
[ 1519.203272] usb 1-2: generic converter now attached to ttyUSB0<br/>
Bus 001 Device 005: ID 2020:0002 <br/>
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br/>
Bus 002 Device 003: ID 0d8c:0201 C-Media Electronics, Inc. CM6501<br/>
Bus 002 Device 002: ID 04f3:0212 Elan Microelectronics Corp. Laser Mouse<br/>
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br/>
[1]+ Done dmesg | tail <br/>
appuraja@appuraja-System-Product-Name:~$ <br/>
</code></pre>
<p><em>Edit:</em></p>
<p>07/02/2014 04:56 P.M.</p>
<p>The issue is finally solved, I followed the complete instruction by Azker Mohamed, and the issue was already 99% solved, I give him many thanks, but for him, thanks would be insufficient appreciation, he helped me a lot.</p>
<p>By the grace of GOD, I suddenly discovered the following and issue is 100% solved:</p>
<p>1) Put the dongle plugged in,</p>
<p>2) Start the computer with ubuntu, it searches for the devices attached, although
you will not see the internal process.</p>
<p>3) Never Ever put a blank modem into any USB port, be equipped with a valid SIM card and
a freshly formatted (you can use Windows 7 also to format)
micro sd memory card. Be sure you have sufficient Internet balance,
at least 10 MB, I recommend 30 MB, which will be useful when we will be testing the connection.
Put both of them into the respective slots.
If your micro sd memory card is shown in the unity launcher, the problem is almost solved.</p>
<p>4) All the problem arises when your micro sd memory card is not shown in the unity launcher,
so manage to show it, here is the process:
Open Terminal by Ctrl+Meta+T then type</p>
<pre><code>sudo mount /dev/sr
</code></pre>
<p>then hit 'Tab key' twice at least. If you see the options like sr0 sr1 then your
card is detected but not mounted, you have to do it manually.
/dev/sr0 is generally DVD-RW Drive in my case, and /dev/sr1 is the required micro sd that all we need.
Don't close the terminal and do:
sudo mount /dev/sr1<br>
If ubuntu says ' mount: can't find /dev/sr1 in /etc/fstab or /etc/mtab ', don't get anxiety, its normal.
DO:</p>
<pre><code>sudo eject /dev/sr1
</code></pre>
<p>Your micro sd is immediately shown in the unity launcher, see it.</p>
<p>5) Now in the same terminal do:</p>
<pre><code>sudo modprobe usbserial vendor=0x2020 product=0x0002
</code></pre>
<p>close the terminal.</p>
<p>6) Start sakish3g and choose the following option one by one:
a) More Option -> Only switch modem (if applicable). See whether it only says 'Modem Switched',
if it says 'modem switched to 2020:0002' then there is surely some problem.
b) Only setup modem (Switch+load module+setup tty), if it says 'Modem setup residing on /dev/ttyUSB0.'
Then you have one more level of success. If it gives some warning message,
don't bother even. Its natural. It may ask you for your login password, submit it.</p>
<p>c) Only prepare modem (Setup+PIN unlock+Register Network+Update HAL),
if it says 'Modem on /dev/ttyUSB0 is registered to Unknown operator 40491.'
don't bother if any warning is shown.</p>
<p>d) At the top-right corner of your screen (between Ubuntu Cloud and the sound icon)
network manager applet is present, click to select 'Enable Mobile Broadband',
already you may see the name of your network provider.
Wait for a few minute, let the blinking radar sign stop,
then click the network provider's name e.g., Airtel, BSNL, AIRCEL etc.</p>
<p>e) Open Mozilla Firefox, Opera, Google Chrome, Chrome Browser etc., or open Software
Updater to check whether there are any updates available.</p>
<p>The Process is complete, but remember a few things:</p>
<p>1) You need the following programs:
lsusb, usb_modeswitch, wvdial and data files for usb_modeswitch.</p>
<p>2) For the first time you need a freshly formatted micro sd maybe formatted with Win7/XP, Linux etc.</p>
<p>3) You need a Valid connection (SIM card) with sufficient balance.</p>
<p>4) If you plan to use the usb-modem with ubuntu even after a few hour later, it doesn't matter,</p>
<p>you may not use it if you don't need it but plug it before booting,
then unplug after boot up and setting it up.
And again plug it when needed. Device is already set up in memory.
Ubuntu searches for attached the devices at boot time so plug the device earlier the boot,
if this not the case and you have just inserted the device while ubuntiu is running,
you may need to re-boot the pc.</p>
<p>5) If you eject the micro sd card after setting up, your modem is still usable if you re-plug it,
but you may need to do the following to access the micro sd drive in it:</p>
<pre><code>sudo mount /dev/sr1
sudo eject /dev/sr1
</code></pre>
<p>Enjoy the internet.</p>
| 0non-cybersec
| Stackexchange |
[NO SPOILERS] GRRM may be a mass murderer, but can he SLAY?! (halloween costume). | 0non-cybersec
| Reddit |
My boyfriend has been playing Minecraft with his friends all morning. We just moved in to our first apartment together. We’ve been here about a month. About two weeks ago, we were chatting and he told me that he still didn’t really feel like this was home.
This morning, we got up and made breakfast + mimosas, and now he’s got his headset on and is playing Minecraft with his buddies online. I’m so thrilled, because I feel like we are finally taking steps where he will be comfortable. I love seeing him on our couch, doing his thing.
I know it takes time to settle in, but it’s really thrilling that we are finally starting our lives together and we are both acclimating.
I’m just really, really happy, and thank you all for letting me share :) | 0non-cybersec
| Reddit |
Don't Run out of anything During Covid19. | 0non-cybersec
| Reddit |
First meal prep using gnocchi! I hope it lasts the week 😅. | 0non-cybersec
| Reddit |
Difference Between *(Pointer + Index) and Pointer[]. <pre><code>int* myPointer = new int[100];
// ...
int firstValue = *(myPointer + 0);
int secondValue = myPointer[1];
</code></pre>
<p>Is there any functional difference between <code>*(myPointer + index)</code> and <code>myPointer[index]</code>? Which is considered better practice?</p>
| 0non-cybersec
| Stackexchange |
Nexus 4, Galaxy Nexus and other phones have barometers. We're building a gigantic global network of user-submitted atmospheric pressure data and hope to vastly improve weather forecasting. This is pressureNET.. | 0non-cybersec
| Reddit |
siunitx: Bold single numeric cells. <p>I'm struggling to make a single numeric cell in an <code>siunitx</code> table bold. (A similar question for making a <em>whole</em> column bold is available <a href="https://tex.stackexchange.com/questions/60069/siunitx-how-to-get-bold-aligned-entries-and-how-to-align-when-units-differ-in">here</a>.)</p>
<p>I want to define a simple macro which I can set for the largest value in a row to make it bold. </p>
<p>A quick MWE:</p>
<pre><code>\documentclass{standalone}
\usepackage{siunitx}
\usepackage{times}
\newcommand{\maxf}[1]{\ensuremath{\mathbf{#1}}}
\begin{document}
\begin{tabular}{S[table-format=1.2]S[table-format=2.2]}
\sisetup{detect-weight=true,detect-inline-weight=math}
{A} & {B} \\
1.01 & \maxf{11.1}\\
\maxf{2.1} & 1.94 \\
\end{tabular}
\end{document}
</code></pre>
<p>(I use <code>times</code> because the math font (CM) and text font (Times) are slightly different in my document ... this is just to highlight that need to format numbers in math mode.)</p>
<p>As I understand it, the following line should make <code>siunitx</code> listen for bold in math font.</p>
<pre><code>\sisetup{detect-weight=true,detect-inline-weight=math}
</code></pre>
<p>But then I get the following:</p>
<p><img src="https://i.stack.imgur.com/z16qM.png" alt="bold not aligned"></p>
<p>... the decimals are not aligned in either column.</p>
<p>If I instead try:</p>
<pre><code>\newcommand{\maxf}[1]{\ensuremath{\boldmath #1}}
</code></pre>
<p>...with <code>boldmath</code> used in <a href="ftp://ftp.tex.ac.uk/tex-archive/macros/latex/exptl/siunitx/siunitx.pdf" rel="noreferrer">page 18 of the <code>siunitx</code> documentation</a> (have never seen this command before), the numbers do not appear bold.</p>
<hr>
<ul>
<li>How can I define a macro (<code>\maxf</code>) to make single numeric cells bold in math mode and keep decimals aligned in <code>siunitx</code>?</li>
<li>If this is not possible or convenient, what highlighting options are available? For example, I notice that underlining using <code>\newcommand{\maxf}[1]{\ensuremath{\underline{#1}}</code> breaks decimal alignment.</li>
</ul>
<hr>
<p><strong>EDIT</strong>, with Joseph's code below, I get the following (no bold):</p>
<p><img src="https://i.stack.imgur.com/slw0m.png" alt="enter image description here"></p>
<p><strong>EDIT3</strong> This was because I had an older version of <code>siunitx</code> (v 2.3). I later upgraded to version 2.5 and it worked.</p>
<hr>
<p><strong>EDIT2</strong> I solved my original highlighting needs by shading the cells of the max results instead.</p>
<pre><code>\documentclass{standalone}
\usepackage{siunitx}
\usepackage{times}
\usepackage[table]{xcolor}
\newcommand{\maxf}[1]{{\cellcolor[gray]{0.8}} #1}
\begin{document}
\begin{tabular}{S[table-format=1.2]S[table-format=2.2]}
\sisetup{detect-weight=true,detect-inline-weight=math}
{A} & {B} \\
1.01 & \maxf{11.1}\\
\maxf{2.1} & 1.94 \\
\end{tabular}
\end{document}
</code></pre>
<p><img src="https://i.stack.imgur.com/6vNwv.png" alt="enter image description here"></p>
| 0non-cybersec
| Stackexchange |
Vivo Z3x with 16MP Selfie camera announced at CNY 1,198 ($180). | 0non-cybersec
| Reddit |
Is there any reasonable way to determine what executed a query?. <p>I have an S3 SQL Server database in Azure, and I'm having an issue with a specific Entity Framework generated query and how often it is being run.</p>
<p>As the numbers below show, I'm getting 160K+ executions per hour, and this number is unexpected (for the time periods illustrated I would have expected less than 10K executions per hour).</p>
<p><a href="https://i.stack.imgur.com/9Zd5j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9Zd5j.png" alt="enter image description here"></a></p>
<p>The number of executions also doesn't correlate with the number of requests to the API methods that issue this query (they were called about 50 times in the corresponding period).</p>
<p>So my question is: using Azure analytics is there any way I can trace the query to determine who/what made the call? Can I somehow get an IP address? This is clearly a code problem, is there any helpful way to determine where the calls are coming from?</p>
| 0non-cybersec
| Stackexchange |
This sand "nickel" I found on the beach. | 0non-cybersec
| Reddit |
Take a seat. | 0non-cybersec
| Reddit |
Well.. I can't say they didn't try, but this pops up whenever I come here.. | 0non-cybersec
| Reddit |
How do you redirect C:\windows\system32\config\systemprofile in GPMC?. <p>We are locking down the C: drive in Windows 10 1809 Enterprise. We allow FULL CONTROL to <code>%UserProfile%\Documents</code>, Downloads, Desktop, Picture and Favorites. However the Group Policy Management Console (GPMC) directs to the following path: <code>C:\windows\system32\config\systemprofile</code>.</p>
<p><a href="https://i.stack.imgur.com/lrICY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lrICY.png" alt="image"></a></p>
<p>How can we edit the paths to point to <code>%UserProfile%\Desktop</code> instead in GPMC ?</p>
| 0non-cybersec
| Stackexchange |
Initialize large two dimensional array in C++. <p>I want to have <strong>static</strong> and <strong>constant</strong> two dimensional array inside a class. The array is relatively large, but I only want to initialize a few elements and others may be whatever compiler initializes them to.</p>
<p>For example, if a class is defined like:</p>
<pre><code>class A {
public:
static int const test[10][10];
};
int const A::test[10][10] = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 7, 7, 7, 7, 0, 0, 0},
{0, 0, 0, 7, 7, 7, 7, 0, 0, 0},
{0, 0, 0, 7, 7, 7, 7, 0, 0, 0},
{0, 0, 0, 7, 7, 7, 7, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
};
</code></pre>
<p>and I am interested only to initialize the elements marked with '7', how do I do this on the same elements, but with array of larger size, like array[1024][1024]?</p>
| 0non-cybersec
| Stackexchange |
Derpy ferret gets stuck behind door. | 0non-cybersec
| Reddit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.