text
stringlengths 3
1.74M
| label
class label 2
classes | source
stringclasses 3
values |
---|---|---|
How to invalidate images on Amazon CloudFront after optimising them?. <p>After checking on <a href="https://developers.google.com/speed/pagespeed/insights" rel="nofollow">Google PageSpeed Insights</a>, I have optimised the images on several websites using <code>jpegoptim</code> and <code>optipng</code>.</p>
<p>Obviously a lot of the images are now smaller and they have new timestamps, but they have not been updated through the Amazon CloudFront CDN.</p>
<p>The expire headers in <code>.htaccess</code> have been set for one year.</p>
<p>There are many hundreds of images that have been optimised, so manually invalidating them is not that feasible.</p>
<p>What is the best way to do this?</p>
| 0non-cybersec
| Stackexchange |
How to select text in Iterm using hotkeys. <p>I am using iTerm as terminal and zsh with oh-my-zsh as shell. Sometimes I would like to select part of entered command only using hot keys. </p>
<p>How can I do it?</p>
| 0non-cybersec
| Stackexchange |
I wanna start making Pho at home. Where should i start? Any favorite recipes? Things i should buy? (Is there a best way to cook using a certain type of cooker etc?) | 0non-cybersec
| Reddit |
Amavisd-new ports 10026 10024 not running. <p>I have mail stuck in the queue and the problem according to the logs points to amavisd-new. Ports 10024 and 10026 are not running and I'm not sure whether it might have something to do with spamassassin. I installed spamassassin but if the problem does point to spamassassin I would like to disable it althought I already run this command.</p>
<blockquote>
<p>update-rc.d -f spamassassin remove</p>
</blockquote>
<p>amavisd-new status</p>
<pre><code>root@mail:/var/log# systemctl status amavisd-new.service
● amavis.service - LSB: Starts amavisd-new mailfilter
Loaded: loaded (/etc/init.d/amavis; generated)
Active: active (exited) since Sat 2020-06-27 12:30:24 EAT; 1h 10min ago
Docs: man:systemd-sysv-generator(8)
Process: 29156 ExecStop=/etc/init.d/amavis stop (code=exited, status=0/SUCCESS)
Process: 29162 ExecStart=/etc/init.d/amavis start (code=exited, status=0/SUCCESS)
Jun 27 12:30:24 mail.domain.tld amavis[29342]: No decoder for .jar
Jun 27 12:30:24 mail.domain.tld amavis[29342]: No decoder for .lha
Jun 27 12:30:24 mail.domain.tld amavis[29342]: No decoder for .lrz
Jun 27 12:30:24 mail.domain.tld amavis[29342]: No decoder for .lz4
Jun 27 12:30:24 mail.domain.tld amavis[29342]: No decoder for .rar
Jun 27 12:30:24 mail.domain.tld amavis[29342]: No decoder for .swf
Jun 27 12:30:24 mail.domain.tld amavis[29342]: Using primary internal av scanner code for ClamAV-clamd
Jun 27 12:30:24 mail.domain.tld amavis[29342]: Found secondary av scanner ClamAV-clamscan at /usr/local/bin/clamscan
Jun 27 12:30:30 mail.domain.tld amavis[29342]: (!!)TROUBLE in pre_loop_hook: config: no rules were found! Do you need to run 'sa-update'?
Jun 27 12:30:30 mail.domain.tld amavis[29342]: (!)_DIE: Suicide () TROUBLE in pre_loop_hook: config: no rules were found! Do you need to run 'sa-update'?
</code></pre>
<p>netstat -tlnp</p>
<pre><code> root@mail:/var/log# netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:10025 0.0.0.0:* LISTEN 20868/master
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 28799/mysqld
tcp 0 0 127.0.0.1:10027 0.0.0.0:* LISTEN 20868/master
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 20868/master
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 29367/dovecot
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 29367/dovecot
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1450/rpcbind
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 23784/apache2
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 20868/master
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 1448/systemd-resolv
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1659/sshd
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 20868/master
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 29367/dovecot
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 1556/nrpe
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 29367/dovecot
tcp6 0 0 :::587 :::* LISTEN 20868/master
tcp6 0 0 :::110 :::* LISTEN 29367/dovecot
tcp6 0 0 :::143 :::* LISTEN 29367/dovecot
tcp6 0 0 :::111 :::* LISTEN 1450/rpcbind
tcp6 0 0 :::465 :::* LISTEN 20868/master
tcp6 0 0 :::22 :::* LISTEN 1659/sshd
tcp6 0 0 :::25 :::* LISTEN 20868/master
tcp6 0 0 :::993 :::* LISTEN 29367/dovecot
tcp6 0 0 :::5666 :::* LISTEN 1556/nrpe
tcp6 0 0 :::995 :::* LISTEN 29367/dovecot
</code></pre>
<p>Postconf -n</p>
<pre><code>root@mail:/var/log# postconf -n
alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
append_dot_mydomain = no
biff = no
body_checks = regexp:/etc/postfix/body_checks
broken_sasl_auth_clients = yes
content_filter = amavis:[127.0.0.1]:10024
dovecot_destination_recipient_limit = 1
greylisting = check_policy_service inet:127.0.0.1:10023
header_checks = regexp:/etc/postfix/header_checks
html_directory = /usr/share/doc/postfix/html
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 0
maildrop_destination_concurrency_limit = 1
maildrop_destination_recipient_limit = 1
mailman_destination_recipient_limit = 1
message_size_limit = 0
mime_header_checks = regexp:/etc/postfix/mime_header_checks
mydestination = mail.domain.tld, localhost, localhost.localdomain
myhostname = mail.domain.tld
mynetworks = 127.0.0.0/8 x.x.x.x/32 x.x.x.x/32 x.x.x.x/32 [::1]/128
myorigin = /etc/mailname
nested_header_checks = regexp:/etc/postfix/nested_header_checks
owner_request_special = no
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $sender_bcc_maps $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $smtpd_sender_login_maps
readme_directory = /usr/share/doc/postfix
receive_override_options = no_address_mappings
recipient_delimiter = +
relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf
relayhost =
sender_bcc_maps = proxy:mysql:/etc/postfix/mysql-virtual_outgoing_bcc.cf
smtp_sasl_auth_enable = no
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
smtp_tls_exclude_ciphers = RC4, aNULL
smtp_tls_protocols = !SSLv2,!SSLv3
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_client_message_rate_limit = 100
smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-virtual_client.cf
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_sasl_authenticated, permit_mynetworks, check_helo_access regexp:/etc/postfix/helo_access, reject_invalid_hostname, reject_non_fqdn_hostname, reject_invalid_helo_hostname, reject_unknown_helo_hostname, check_helo_access regexp:/etc/postfix/blacklist_helo
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, check_recipient_access mysql:/etc/postfix/mysql-virtual_policy_greylist.cf
smtpd_restriction_classes = greylisting
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql-virtual_sender_login_maps.cf
smtpd_sender_restrictions = check_sender_access regexp:/etc/postfix/tag_as_originating.re , permit_mynetworks, permit_sasl_authenticated, check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf, check_sender_access regexp:/etc/postfix/tag_as_foreign.re
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_exclude_ciphers = RC4, aNULL
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_tls_protocols = !SSLv2,!SSLv3
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
virtual_alias_domains =
virtual_alias_maps = hash:/var/lib/mailman/data/virtual-mailman, proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, proxy:mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_gid_maps = mysql:/etc/postfix/mysql-virtual_gids.cf
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_maps = hash:/var/lib/mailman/data/virtual-mailman
virtual_transport = dovecot
virtual_uid_maps = mysql:/etc/postfix/mysql-virtual_uids.cf
</code></pre>
<p>master.cf</p>
<pre><code>amavis unix - - - - 2 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
-o smtp_bind_address=
127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=127.0.0.0/8
-o strict_rfc821_envelopes=yes
-o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
127.0.0.1:10027 inet n - n - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=127.0.0.0/8
-o strict_rfc821_envelopes=yes
-o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
-o smtp_send_xforward_command=yes
-o milter_default_action=accept
-o milter_macro_daemon_name=ORIGINATING
-o disable_dns_lookups=yes
</code></pre>
<p>Your help would be highly appreciated.</p>
| 0non-cybersec
| Stackexchange |
I think there was a missed opportunity with the final battle vs. Lusamine. I feel as though after defeating her Pokemon we should have had to battle against the Lusamine/UB-01 fusion. She looked extremely powerful and I thought after seeing them fuse (combine, IDK what to really call it) that would be the case. Seemed rather lackluster to beat her Pokemon and have Nebby defeat her in a cut scene. | 0non-cybersec
| Reddit |
Should I(20F) reconnect with my father(50sM)?. Tl;dr: my father kicked me when I was 17, but now I’m thinking of reconnecting after 3 years to try and rebuild a relationship.
My father has never been a very good parent - he’s a terrible listener, is convinced he’s always right, won’t apologize for anything he does, and can sometimes just be plain mean for no good reason. However, I’ve always loved him and he loves me in his own way as well. He’s very funny and does have moments where he’s genuinely kind. I also feel like we have a lot of similarities I just don’t share with the rest of my family.
When I was about 3 or 4 I was m******* by a babysitter. I didn’t tell anyone and kept it to myself because I was scared of what others would think. At 17, I got a job at a daycare and seeing all those vulnerable children day in and day out made me break down. I was constantly reminded of what happened to me, and I also constantly felt on edge wondering if these kids were safe and cared for. I went into a really bad depressive phase where I wouldn’t talk to anyone and just sat in my room and cried. My dad was never good at dealing with my poor mental health, and this made him really pissed at me. Eventually, I told him how I was m******* and that this was the reason why I was behaving like that. He got even more pissed and accused me of lying, saying he never saw anything happen and that the babysitter was a good kid. He ended up throwing me out, and I moved in with my less-than-functional mother. My life has kinda sucked since then, but my brother and friends have all supported me and it’s getting better bit by bit.
I know he seems like a terrible guy (and he is), but I do still love him. Also, through reflection I’ve realized a lot of his behavior probably stems from trauma he’s suffered himself - he had an abusive upbringing and my older sister died before I was born, which really made him super emotionally volatile. He’s never gotten treatment for his own mental problems, so I think his abusive behavior is a result of that.
My question I guess is if I should try to reconnect with him, and if so, how? He calls me once a month but I never pick up, I’m scared what he’ll say if I do. Has anyone else been through something like this? Any advice appreciated, sorry if this doesn’t make sense. I’ll answer any questions anyone has. | 0non-cybersec
| Reddit |
ITAP of a decaying building. | 0non-cybersec
| Reddit |
Practiced my wedding makeup today. Constructive criticism is welcome! . | 0non-cybersec
| Reddit |
MRW my wife queefs while I'm going down on her after she promised me she was done with her period.. | 0non-cybersec
| Reddit |
Shades of blue. | 0non-cybersec
| Reddit |
Construction of orthonormal basis of the Hilbert space $\mathcal{S}^p_{\mathcal{H}}$ of vectors of $p \in \mathbb{N}$ Hilbert Schmidt operators. <p>Let $(e_j)$ be a orthonormal basis (ONB) of a separable Hilbert space $(\mathcal{H}, \langle\cdot, \cdot\rangle_{\mathcal{H}})$ and $(\mathcal{S_H}, \langle\cdot, \cdot\rangle_{\mathcal{S_H}})$ be the separable Hilbert space of Hilbert Schmidt operators. Then, e.g. $(\phi_{ij})$ is a ONB of $\mathcal{S_H}$ with $\phi_{ij}(e_k) = e_i\delta_{jk},\,\forall k,$ where $\delta_{jk}$ denotes the Kronecker-Delta.</p>
<p>Moreover, for $p \in \mathbb{N},$ let's consider the $p$-dimensional case. $(\mathcal{S}^p_{\mathcal{H}},\langle\cdot, \cdot\rangle_{\mathcal{S}^p_{\mathcal{H}}})$ can be considered as the space of vectors where each component can be considered as a Hilbert Schmidt operater from $\mathcal{H} \rightarrow \mathcal{H}$ (in other words every component is an element of $\mathcal{S_H})$ and for $\boldsymbol{s} \colon\!= (s_1, ..., s_p)^T,$ $\boldsymbol{t} \colon\!=(t_1, ..., t_p)^T \in \!\mathcal{S}^p_{\mathcal{H}}\colon \langle\boldsymbol{s}, \boldsymbol{t}\rangle_{\mathcal{S}^p_{\mathcal{H}}} \colon\!= \sum_{i=1}^p\langle s_i, t_i\rangle_{\mathcal{S_H}}.$ Also, $(E_j)_j = ((E^{(1)}_j\!\!\!, ..., E^{(p)}_j)^T)$ is a ONB of $(\mathcal{H}^p, \langle\cdot, \cdot\rangle_{\mathcal{H}^p})$ where $\langle\boldsymbol{x}, \boldsymbol{y}\rangle_{\mathcal{H}^p} \colon\!= \sum_{i=1}^p\langle x_i, y_i\rangle_{\mathcal{H}}, \boldsymbol{x} \colon\!= (x_1, ..., x_p)^T \in\mathcal{H}^p$ and $\boldsymbol{y} \colon\!=(y_1, ..., y_p)^T \in \!\mathcal{H}^p.$</p>
<p><strong>Question:</strong> Am I able (and how?) to construct a ONB of $\mathcal{S}^p_{\mathcal{H}}$ given a ONB $(E_j)$ of $\mathcal{H}^p$ ?</p>
<p>Thank you in advance!</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 |
When there is an eclipse, why does the earth not become cold for that period?. | 0non-cybersec
| Reddit |
Is it possible to change the icon for New Tab in Firefox?. <p><a href="https://i.stack.imgur.com/f3BkC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f3BkC.png" alt="New Tab"></a></p>
<p>Is it possible to change the icon for New Tab in Firefox? I'm looking to change it to Internet Explorer.</p>
<p>If it matters, I'm using Linux with a Windows 95 theme.</p>
| 0non-cybersec
| Stackexchange |
Regarding complementary slackness condition. <p>I have a question regarding <strong>complementary slackness</strong>, the answer should be true of false. </p>
<blockquote>
<p>The complementary slackness conditions connect pairs of optimal basic feasible solution of primal and dual linear programs. They correspond to connection between non zero variables in the solution to one linear program and constraints that are satisfied with equality in the other linear program. If there is optimal solution that is not basic feasible solution, complementary slackness condition may not be held.</p>
</blockquote>
<p>In my opinion, the answer is false, but I am not completely sure. Why it mentions the optimal solution which is not basic feasible solution? I thought it's impossible, optimal solution has to be one of the BFSs. The following remark made the issue completely ambiguous <a href="http://books.google.com/books?id=VqjhIZhsITsC&lpg=PP1&ots=mbLk0q5SAL&dq=dave%20rader%20deterministic&pg=PA332#v=onepage&q=%22dual%20solution%20that%20satisfy%20the%20complementary%20slackness%22&f=false" rel="nofollow"><em>Deterministic Operations Research: Models and Methods in Linear Optimization</em></a>. So, on every iteration the complementary slackness conditions are held? But this is not what the complementary slackness theorem was talking about.</p>
<p>If you have good understanding of the topic, please point out what exactly I missed.
Thanks! </p>
| 0non-cybersec
| Stackexchange |
Example of normal subgroup that contains the commutator group as a proper subgroup.. <p>In my algebra class, we went over the theorem:</p>
<blockquote>
<p>Suppose that $N$ is a normal subgroup. Then $G/N$ is abelian iff $[G:G]\subseteq N$</p>
</blockquote>
<p>The proof we used seemed to imply that the normal subgroup is the commutator. I know that this observation is actually meaningless, an artifact of the exact proof we used, but my professor couldn't think up an example to the contrary, neither could wikipedia, and I would like one.</p>
<p>Just to be clear, by proper, I mean also non-trivial, rather than simply of a smaller cardinality.</p>
| 0non-cybersec
| Stackexchange |
Exploding nested Struct in Spark dataframe. <p>I'm working through the Databricks <a href="https://docs.cloud.databricks.com/docs/latest/databricks_guide/04%20SQL,%20DataFrames%20%26%20Datasets/02%20Introduction%20to%20DataFrames%20-%20scala.html" rel="noreferrer">example</a>. The schema for the dataframe looks like:</p>
<pre><code>> parquetDF.printSchema
root
|-- department: struct (nullable = true)
| |-- id: string (nullable = true)
| |-- name: string (nullable = true)
|-- employees: array (nullable = true)
| |-- element: struct (containsNull = true)
| | |-- firstName: string (nullable = true)
| | |-- lastName: string (nullable = true)
| | |-- email: string (nullable = true)
| | |-- salary: integer (nullable = true)
</code></pre>
<p>In the example, they show how to explode the employees column into 4 additional columns:</p>
<pre><code>val explodeDF = parquetDF.explode($"employees") {
case Row(employee: Seq[Row]) => employee.map{ employee =>
val firstName = employee(0).asInstanceOf[String]
val lastName = employee(1).asInstanceOf[String]
val email = employee(2).asInstanceOf[String]
val salary = employee(3).asInstanceOf[Int]
Employee(firstName, lastName, email, salary)
}
}.cache()
display(explodeDF)
</code></pre>
<p>How would I do something similar with the department column (i.e. add two additional columns to the dataframe called "id" and "name")? The methods aren't exactly the same, and I can only figure out how to create a brand new data frame using:</p>
<pre><code>val explodeDF = parquetDF.select("department.id","department.name")
display(explodeDF)
</code></pre>
<p>If I try:</p>
<pre><code>val explodeDF = parquetDF.explode($"department") {
case Row(dept: Seq[String]) => dept.map{dept =>
val id = dept(0)
val name = dept(1)
}
}.cache()
display(explodeDF)
</code></pre>
<p>I get the warning and error:</p>
<pre><code><console>:38: warning: non-variable type argument String in type pattern Seq[String] is unchecked since it is eliminated by erasure
case Row(dept: Seq[String]) => dept.map{dept =>
^
<console>:37: error: inferred type arguments [Unit] do not conform to method explode's type parameter bounds [A <: Product]
val explodeDF = parquetDF.explode($"department") {
^
</code></pre>
| 0non-cybersec
| Stackexchange |
Cisco ASA 8.4 port forwarding. <p>I am having trouble port-forwarding on an Cisco ASA from a host on the internet to a host on the internal network. The outside interface of the ASA is assigned via DHCP. Is there something else that has to be done in order to make this work correctly?</p>
<p><strong>update to problem</strong></p>
<pre><code>(outside) to (outside) source dynamic VPN_NETWORK interface
</code></pre>
<p>per:</p>
<p><a href="https://www.cisco.com/en/US/docs/security/asa/asa84/configuration/guide/nat_rules.html" rel="nofollow noreferrer">https://www.cisco.com/en/US/docs/security/asa/asa84/configuration/guide/nat_rules.html</a></p>
<pre><code>(outside) to (outside) after-auto source dynamic VPN_NETWORK interface
</code></pre>
<p><strong>packet-tracer:</strong></p>
<pre><code># packet-tracer input outside tcp 74.x.x.x 1025 71.x.x.x 555
Phase: 1
Type: ROUTE-LOOKUP
Subtype: input
Result: ALLOW
Config:
Additional Information:
in 71.x.x.x 255.255.255.255 identity
Phase: 2
Type: ACCESS-LIST
Subtype:
Result: DROP
Config:
Implicit Rule
Additional Information:
Result:
input-interface: outside
input-status: up
input-line-status: up
output-interface: NP Identity Ifc
output-status: up
output-line-status: up
Action: drop
Drop-reason: (acl-drop) Flow is denied by configured rule
</code></pre>
<p><strong>running-config</strong></p>
<pre><code>ASA Version 8.4(2)
!
hostname asa
enable password ***** encrypted
passwd ***** encrypted
names
!
interface Ethernet0/0
switchport access vlan 2
!
interface Ethernet0/1
!
interface Ethernet0/2
!
interface Ethernet0/3
!
interface Ethernet0/4
!
interface Ethernet0/5
!
interface Ethernet0/6
!
interface Ethernet0/7
!
interface Vlan1
nameif inside
security-level 100
ip address 172.16.1.1 255.255.255.0
!
interface Vlan2
nameif outside
security-level 0
ip address dhcp setroute
!
boot system disk0:/asa842-k8.bin
ftp mode passive
same-security-traffic permit intra-interface
object network obj_any
subnet 0.0.0.0 0.0.0.0
object network VPN_NETWORK
subnet 192.168.1.0 255.255.255.192
object network VM
host 172.16.1.100
access-list dynamic-filter_acl extended permit ip any any
access-list VM-IN extended permit tcp any host 172.16.1.100 eq 555
pager lines 24
logging enable
logging asdm informational
mtu inside 1500
mtu outside 1500
ip local pool VPN-DHCP-POOL 192.168.1.10-192.168.1.50
icmp unreachable rate-limit 1 burst-size 1
asdm image disk0:/asdm-645-206.bin
no asdm history enable
arp timeout 14400
nat (inside,outside) source static any any destination static VPN_NETWORK VPN_NETWORK no-proxy-arp route-lookup
nat (outside,outside) source dynamic VPN_NETWORK interface
!
object network obj_any
nat (inside,outside) dynamic interface
object network VM
nat (inside,outside) static interface service tcp 555 555
access-group VM-IN in interface outside
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
timeout tcp-proxy-reassembly 0:01:00
timeout floating-conn 0:00:00
dynamic-access-policy-record DfltAccessPolicy
user-identity default-domain LOCAL
aaa authentication http console LOCAL
aaa authentication ssh console LOCAL
http server enable
http 172.16.1.0 255.255.255.0 inside
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstart
crypto ipsec ikev1 transform-set ESP-AES-256-SHA esp-aes-256 esp-sha-hmac
crypto ipsec ikev1 transform-set ESP-AES-128-SHA esp-aes esp-sha-hmac
crypto ipsec ikev1 transform-set ESP-AES-192-SHA esp-aes-192 esp-sha-hmac
crypto dynamic-map SYSTEM_DEFAULT_CRYPTO_MAP 65535 set pfs group1
crypto dynamic-map SYSTEM_DEFAULT_CRYPTO_MAP 65535 set ikev1 transform-set ESP-AES-256-SHA
crypto map outside_map 65535 ipsec-isakmp dynamic SYSTEM_DEFAULT_CRYPTO_MAP
crypto map outside_map interface outside
crypto map inside_map 65535 ipsec-isakmp dynamic SYSTEM_DEFAULT_CRYPTO_MAP
crypto map inside_map interface inside
crypto ikev1 enable inside
crypto ikev1 enable outside
crypto ikev1 policy 10
authentication crack
encryption aes-256
hash sha
group 2
lifetime 86400
crypto ikev1 policy 20
authentication rsa-sig
encryption aes-256
hash sha
group 2
lifetime 86400
crypto ikev1 policy 30
authentication pre-share
encryption aes-256
hash sha
group 2
lifetime 86400
telnet timeout 5
ssh 172.16.1.0 255.255.255.0 inside
ssh timeout 5
ssh version 2
console timeout 0
dhcp-client client-id interface outside
dhcpd auto_config outside
!
dhcpd address 172.16.1.100-172.16.1.200 inside
dhcpd dns 8.8.8.8 8.8.4.4 interface inside
dhcpd option 3 ip 172.16.1.1 interface inside
dhcpd enable inside
!
threat-detection basic-threat
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
dynamic-filter enable interface outside classify-list dynamic-filter_acl
dynamic-filter drop blacklist interface outside
ssl encryption des-sha1
webvpn
group-policy EdgeAccess internal
group-policy EdgeAccess attributes
dns-server value 8.8.8.8 8.8.4.4
vpn-tunnel-protocol ikev1
username user password ***** encrypted
tunnel-group EdgeAccess type remote-access
tunnel-group EdgeAccess general-attributes
address-pool VPN-DHCP-POOL
default-group-policy EdgeAccess
tunnel-group EdgeAccess ipsec-attributes
ikev1 pre-shared-key *****
!
class-map inspection_default
match default-inspection-traffic
!
!
policy-map type inspect dns preset_dns_map
parameters
message-length maximum 512
policy-map global_policy
class inspection_default
inspect dns preset_dns_map
inspect ftp
inspect h323 h225
inspect h323 ras
inspect rsh
inspect rtsp
inspect esmtp
inspect sqlnet
inspect skinny
inspect sunrpc
inspect xdmcp
inspect sip
inspect netbios
inspect tftp
inspect ip-options
!
service-policy global_policy global
privilege show level 0 mode configure command filter
privilege cmd level 0 mode configure command filter
privilege cmd level 0 mode config-group-webvpn command filter
privilege cmd level 0 mode config-username-webvpn command filter
prompt hostname context
no call-home reporting anonymous
: end
</code></pre>
| 0non-cybersec
| Stackexchange |
Like a Boss. . | 0non-cybersec
| Reddit |
Tomcat doesn't stop. How can I debug this?. <p>I have a <code>Tomcat 7</code> running in Linux that I start via <code>$CATALINA_HOME/bin/startup.sh</code> and shutdown via <code>$CATALINA_HOME/bin/shutdown.sh</code><br>
from <code>/etc/init.d</code> </p>
<p>All is ok except 1 problem. Sometimes tomcat does not stop.<br>
Although I stop it and I see in catalina.out logs that is going down, if I do <code>ps -ef</code> I can still see the process running. </p>
<p>What could be the problem? How can I debug this? My feeling is, that this is related to threads. </p>
<p>So the parts that are suspicious are the following:<br>
1) I use Log4j's LogManager to detect if the log4j configuration has been changed, but I do <code>Log4jManager.shutdown</code> on a <code>contextDestroyed</code> <code>ServletContextListener</code><br>
2) I use <code>H2</code> database and I see on shutdown: </p>
<blockquote>
<p>SEVERE: The web application [/MyApplication] appears to have started a<br>
thread named [H2 Log Writer MYAPPLICATION] but has failed to stop it.<br>
This is very likely to create a memory leak </p>
<p>SEVERE: The web application [/MyApplication] appears to have started a<br>
thread named [H2 File Lock Watchdog<br>
/opt/myOrg/tomcat/webapps/MyApplication/db/myDatabase.lock.db] but has<br>
failed to stop it. This is very likely to create a memory leak. Apr 2,<br>
2012 9:08:08 AM org.apache.catalina.loader.WebappClassLoader<br>
clearReferencesThreads SEVERE: The web application [/MyApplication]<br>
appears to have started a thread named [FileWatchdog] but has failed<br>
to stop it. This is very likely to create a memory leak. </p>
</blockquote>
<p>Any help please? How can I detect the problem here? </p>
<p><strong>UPDATE:</strong><br>
I did a <code>kill -3</code> as suggested by @daveb, and in the catalina.out I see: </p>
<blockquote>
<p>JVMDUMP006I Processing dump event "user", detail "" - please wait.
JVMDUMP032I JVM requested Java dump using
'/etc/init.d/javacore.20120402.093922.2568.0001.txt' in response to an
event JVMDUMP010I Java dump written to
/etc/init.d/javacore.20120402.093922.2568.0001.txt JVMDUMP013I
Processed dump event "user", detail "". </p>
</blockquote>
<p>There is a javacore in <code>/etc/init.d</code> but I don't know how to process it. I.e. what parts should I investigate</p>
| 0non-cybersec
| Stackexchange |
ASP.NET MVC session is null. Session Variables are not being set. <p>I have the following code in my Global.asax</p>
<pre><code>protected void Application_AcquireRequestState(object sender, EventArgs e)
{
if (HttpContext.Current.Handler is IRequiresSessionState)
{
if (Request.IsAuthenticated)
{
if (HttpContext.Current.Session[this.MemberShipProvider.PrincipalSessionKey] != null)
{
CxPrincipal principal;
try
{
principal = (CxPrincipal)HttpContext.Current.Session[this.MemberShipProvider.PrincipalSessionKey];
}
catch
{
principal = null;
}
HttpContext.Current.User = principal;
Thread.CurrentPrincipal = principal;
}
else
{
var identity = new CxIdentity("admin", 1, "", true);
CxPrincipal principalLogin = new CxPrincipal(identity, 1);
HttpContext.Current.Session[this.MemberShipProvider.PrincipalSessionKey] = principalLogin;
HttpContext.Current.Session[SessionName.CurrentUser] = "Admin User";
HttpContext.Current.User = principalLogin;
Thread.CurrentPrincipal = principalLogin;
this.FormServiceProvider.SignIn("admin", false); // this is equal to FormsAuthentication.SetAuthCookie
}
}
}
}
</code></pre>
<p>The problem is that everytime the Session is object is null. Not only here, I can't use sessions in my application as well. Either the session is being Reset or something like that. </p>
<p>My application doesn't require the user to Login anymore. Therefore I am not using Session.Clear or Session.Abandon any where in my application.</p>
<p>Please help me, why is my session variable not setting?</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 |
Zach Anner needs our money for gas. | 0non-cybersec
| Reddit |
Car run off road and hits a pedestr...oh, it was just a sign. Phew!. | 0non-cybersec
| Reddit |
implicit differentiation yielding different expressions. <p>I was studying Thomas's Calculus book and attempted a question using implicit differentiation.</p>
<p><span class="math-container">$$x^3=\frac{2x-y}{x+3y}$$</span></p>
<p>I differentiated both sides directly, using the quotient rule on the RHS to obtain. <span class="math-container">$$ \frac{dy}{dx}=\frac{7y-3x^2(x+3y)^2}{7x} \hspace{1cm}(1)$$</span></p>
<p>The steps in the solution were to bring <span class="math-container">$x+3y$</span> to the LHS and differentiate every term to get <span class="math-container">$$ \frac{dy}{dx}=\frac{2-4x^3-9x^2y}{3x^3+1}\hspace{1cm} (2)$$</span></p>
<p>I was confused at first, and guessed that the two must be equal. And could show it using these steps. Expanding the numerator of <span class="math-container">$(1)$</span> gives <span class="math-container">$$\frac{dy}{dx}=\frac{7y-3x^4-18x^3y-27x^2y^2}{7x}\hspace{1cm} (1)$$</span></p>
<p>Replacing <span class="math-container">$x^3$</span> in the denominator of <span class="math-container">$(2)$</span> by <span class="math-container">$\frac{2x-y}{x+3y}$</span> and some simplification gives<span class="math-container">$$ \begin{align}\frac{dy}{dx}&=\frac{2x+6y-4x^4-21x^3y-27x^2y^2}{7x}\\&=\frac{7y-3x^4-18x^3-27x^2y^2+(2x-y-x^4-3x^3y)}{7x}\end{align}\hspace{1cm} (2)$$</span> </p>
<p>The sum in the brackets is zero by <span class="math-container">$$2x-y-x^4-3x^3y=2x-y-x^3(x+3y)=2x-y-(2x-y)=0$$</span></p>
<p>Therefore <span class="math-container">$(1)=(2)$</span>. Firstly, I am still not entirely sure <span class="math-container">$\textbf{why}$</span> we get two expressions which look completely different in the first place. Moreover is there any <span class="math-container">$\textbf{better way}$</span> to show that they are equal besides the fortuitous, trial and error, method I used? Many many thanks.</p>
| 0non-cybersec
| Stackexchange |
Prove $\phi=0$ if $\int_{\mathbb{R}^n}x^{\alpha}\phi=0$. <p>These are two closely related question to prove</p>
<p>1)If $\phi\in C_0^{\infty}$,and $\int_{\mathbb{R}^n}x^{\alpha}\phi=0$ for all multiindices $\alpha$,
where $\alpha=(\alpha_1,\cdots,\alpha_n),x^{\alpha}=x_1^{\alpha_1}\cdots x_n^{\alpha_n}$
then $\phi=0$</p>
<p>2)There exists $\phi$ in Schwartz class s.t. $\int_{\mathbb{R}^n}x^{\alpha}\phi=0$.</p>
<hr>
<p>It is quite confusing because $C_{0}^{\infty}$ is dense in Schwartz class and I don't know how to prove these two statements.</p>
| 0non-cybersec
| Stackexchange |
Backticks vs braces in Bash. <p>When I went to answer <a href="https://stackoverflow.com/questions/22693415/cpu-usage-from-linux-then-using-it-in-a-arithmetic-expression">this question</a>, I was going to use the <code>${}</code> notation, as I've seen so many times on here that it's preferable to backticks.</p>
<p>However, when I tried </p>
<pre><code>joulesFinal=${echo $joules2 \* $cpu | bc}
</code></pre>
<p>I got the message </p>
<pre><code>-bash: ${echo $joules * $cpu | bc}: bad substitution
</code></pre>
<p>but </p>
<pre><code>joulesFinal=`echo $joules2 \* $cpu | bc`
</code></pre>
<p>works fine. So what other changes do I need to make?</p>
| 0non-cybersec
| Stackexchange |
How to browse a font by characters from a given codepage?. <p>Most of the font manager tools display characters of a font grouped by subsets of the <em>Unicode</em> character set. Is there a tool that displays the characters grouped by the particular <em>code page</em> that a given font supports? I.e. for the font <code>Arial</code>, display all characters that are part of the <code>Windows 1252</code> code page.</p>
<p>//edit:</p>
<p>The only program that does exactly this is Windows Character Map:</p>
<p><img src="https://i.stack.imgur.com/wDfCZ.jpg" alt="enter image description here"></p>
<p>The problem with Character Map is that:</p>
<ul>
<li>I'm not sure how do entries in the menu map to actual code pages. For the <code>Windows*</code> ones, one could use <a href="http://msdn.microsoft.com/en-us/library/dd317756%28VS.85%29.aspx" rel="nofollow noreferrer">this</a> table (i.e. <code>Windows: Central Europe</code> maps to <code>Windows-1250</code>), but what about the <code>DOS</code> ones</li>
<li>certain code pages are missing in the menu</li>
<li>inside of the properties of the font file, there is a list of code pages that a given font supports. Seeing <em>those</em> code pages would be helpful, if possible</li>
<li>there is no way that I've found to see the character code from the code page selected, only the UTF-16 character code is shown (<code>U+XXXX</code>), though for this one could use the <a href="http://www.fileformat.info/info/charset/windows-1250/grid.htm?hyperlink=Y" rel="nofollow noreferrer">conversion</a> table.</li>
</ul>
| 0non-cybersec
| Stackexchange |
Moment of Inertia of a Polygon. <p>I'm programming a game and I have to find the moment of inertia of a flat polygon (axis of rotation is perpendicular to the polygon, from now on I will call it the point of rotation). My idea was to cut the polygon into n triangles with one vertex at the point of rotation. This should work for all convex polygons where point of rotation lies inside the polygon. I think it should also work with general polygons if you add and substract accordingly but I will investigate that later. For now I'm having trouble calculating the moment of inertia for this triangle. I'm not very good at this.</p>
<p>Let's translate the system so that the point of rotation is at the origin O and call the other two vertices $P_{1}$ and $P_{2}$ and assume that the vertices are counterclockwise. Let's also rotate the system so that the vector $P_{1}$ has no horizontal component.</p>
<p>The moment of inertia, let's call it $I$, should be
$I = \rho * \int \int r(x, y)^{2} \partial x \partial y$, assuming constant density. I will drop the density term, assuming a density of $1$.</p>
<p>Using the vector $P_{1}$ and $P_{2}$ as basis, the square distance of a point inside the triangle to the origin is<br>
$r^{2} = (\cos(\delta)\ast v\ast|P_{2}|)^{2} + (u\ast|P_{1} + \sin(\delta)\ast v\ast|P_{2}|)^{2}$<br>
, where $\delta$ is the angle between $P_{1}$ and $P_{2}$.<br>
multiplying that out, I get:<br>
$$r^{2} = \cos^{2}(\delta)\ast v^{2}\ast|P_{2}|^{2} + u^{2}\ast|P_{1}|^{2} + 2\ast\sin(\delta)\ast u\ast v\ast|P_{1}|\ast|P_{2}| + \sin^{2}(\delta)\ast v^{2}\ast|P_{2}|^{2}.$$
Since $\sin^{2}(\delta) + \cos^{2}(\delta) = 1$,<br>
$$r^{2} = u^{2} \ast |P_{1}|^{2} + v^{2} \ast |P_{2}|^{2} + 2 \ast \sin(\delta) \ast u \ast v \ast |P_{1}| \ast |P_{2}|.$$<br>
Since $\sin(\delta) = \frac{P_{1} \times P_{2}}{|P_{1}| * |P_{2}|}$ this is reduced to:<br>
$r^{2} = u^{2}*|P_{1}|^{2} + v^{2}*|P_{2}|^{2} + 2*u*v*(P_{1} \times P_{2})$</p>
<p>The Integral, then, looks like this:<br>
$\int_{0}^{1} \int_{0}^{1-v} u^{2}*|P_{1}|^{2} + v^{2}*|P_{2}|^{2} + 2*u*v*(P_{1} \times P_{2}) \partial u \partial v$</p>
<p>Integrating once:<br>
$$
\begin{array}{mml}
I & = & \int_{0}^{1} [\frac{u^{3} \ast |P_{1}|^{2}}{3} + u \ast v^{2} \ast |P_{2}|^{2} + u^{2} \ast v \ast (P_{1} \times P_{2})]_{0}^{1-v} \partial v \newline
& = &\int_{0}^{1} \frac{(1-v)^{3} \ast |P_{1}|^{2}}{3} + (1-v) \ast v^{2} \ast |P_{2}|^{2} + (1-v)^{2} \ast v \ast (P_{1} \times P_{2}) \partial v \newline
& = & \int_{0}^{1} \frac{(1 - 3 \ast v + 3 \ast v^{2} - v^{3})*|P_{1}|^{2}}{3} + (v^{2} - v^{3}) \ast |P_{2}|^{2} + (v - 2 \ast v^{2} + v^{3}) \ast (P_{1} \times P_{2}) \partial v
\end{array}
$$</p>
<p>Integrating a second time:<br>
$$
\begin{array}{mml}
I & = & [(\frac{v}{3} - \frac{v^{2}}{2} + \frac{v^{3}}{3} - \frac{v^{4}}{12})*|P_{1}|^{2} + (\frac{v^{3}}{3} - \frac{v^{4}}{4})\ast|P_{2}|^{2} + (\frac{v^{2}}{2} - \frac{2\ast v^{3}}{3} + \frac{v^{4}}{4})\ast(P_{1} \times P_{2})]_{0}^{1} \newline
&= &\frac{|P_{1}|^{2} + |P_{2}|^{2} + (P_{1} \times P_{2})}{12}
\end{array}
$$</p>
<p>That's a nice equation. However, it doesn't work. I tried comparing the results with the moment of inertia of a rectangle that rotates around it's center of mass.</p>
<p>The moment of intertia of a rectangle with sides a and b and constant density is<br>
$$
\begin{array}{mml}
I & = & \int_{\frac{-a}{2}}^{\frac{a}{2}} \int_{\frac{-b}{2}}^{\frac{b}{2}} x^{2} + y^{2} \partial x \partial y
\newline
& = & \int_{-\frac{-a}{2}}^{\frac{a}{2}} [\frac{x^{3}}{3} + x\ast y^{2}]_{-\frac{-a}{2}}^{\frac{a}{2}} \partial y \newline
& = & \int_{-\frac{-a}{2}}^{\frac{a}{2}} \frac{b^{3}}{12} + b\ast y^{2} \partial y \newline
& = & [\frac{a^{3}\ast y}{12} + \frac{a\ast y^{3}}{3}]_{-\frac{-a}{2}}^{\frac{a}{2}} \newline
& = &\frac{a^{3}\ast b + a\ast b^{3}}{12}
\end{array}
$$</p>
<p>The moment of a rectangle rotating on it's center has to be the sum of the moment of inertia of it's triangles $I(O, P_{0}, P_{1}) + I(O, P_{1}, P_{2}) + I(O, P_{2}, P_{3}) + I(O, P_{3}, P_{0})$</p>
<p>Using the simplest case of a square with its vertices at the coordinates (1,1), (1,-1), (-1,-1) and (-1,1) the moment of inertia is $\frac{2^{3}\ast2 + 2\ast2^{3}}{12} = \frac{8}{3}$</p>
<p>The moment of inertia of each of it's triangles is $\frac{2+2+2}{12} = \frac{1}{2}$<br>
But $4\ast \frac{1}{2}$ is $2$ not $\frac{8}{3}$.</p>
<p>Where is my mistake?</p>
<p>Later, I also need to find the so-called area moment of rotation. I assumed you just divide the moment of inertia by the area but that doesn't seem to be the case.
There is a list on wikipedia, listing many different area moments of inertia, including polygons <a href="http://en.wikipedia.org/wiki/List_of_moments_of_inertia" rel="nofollow">http://en.wikipedia.org/wiki/List_of_moments_of_inertia</a>. But the equation for the polygon case is not explained at all and I don't want to use formulas that I don't understand. It also doesn't make any sense to me at first glance.</p>
| 0non-cybersec
| Stackexchange |
New Watch_Dogs trailer welcomes you to Chicago. | 0non-cybersec
| Reddit |
Is it better to use a crowded 2.4GHz Wi-Fi channel 1, 6, 11 or "unused" 3, 4, 8, or 9?. <p>I understand that 2.4GHz Wi-Fi channels overlap, and that the most popular non-overlapping set of channels in the US is 1, 6, and 11. Generally, my signal strength on channels 1, 6, and 11 are much stronger than my neighbors' on the same channel. However, these channels usually have 4 or 5 APs already using them. In this scenario, is it better to use 3, 4, 8, or 9? Or is it better to use the crowded channels 1, 6, and 11?</p>
<p>As a secondary question, does it even matter that my signal strength is much higher than theirs?</p>
<h3>Related:</h3>
<p><a href="https://superuser.com/questions/382042/why-use-wifi-channels-other-than-1-6-or-11">Why use wifi channels other than 1, 6 or 11?</a></p>
| 0non-cybersec
| Stackexchange |
Data structure for spatial data. <p>I am looking for a good functional data structure to store spatial (point) data. The data structure should allow simple epsilon queries for points already present. Also I need to modify the data quite often. This means points can move and should be able to be updated in the data structure. This can probably be handled using a normal delete/add, but a real move might be faster.</p>
<p>For now I am thinking about using <a href="http://en.wikipedia.org/wiki/Quadtree" rel="nofollow">quad/oct-trees</a> (or higher), since the move part should be quite easy to do. However quad-trees are known to be worse as far as balancing is concerned. <a href="http://en.wikipedia.org/wiki/Kd-tree" rel="nofollow">KD-Trees</a> might be another choice, but the update seems quite nasty. Also most spacial data structure implementations I can find are only procedural and I am using a functional language.</p>
| 0non-cybersec
| Stackexchange |
Super key not working on external keyboard. <p>I am using an external keyboard on my laptop and the <strong>Super</strong> key doesn't work. The laptop's keyboard works just fine, every key is regularly detected.</p>
<p>I tried using <code>xinput</code> to debug this issue. Here you can see the output of <code>xinput list</code>, the device I am having issues with is the <strong>Cooler Master Technology Inc. MasterKeys Pro L White</strong>.</p>
<pre><code>⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=15 [slave pointer (2)]
⎜ ↳ Bluetooth Mouse id=16 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Video Bus id=8 [slave keyboard (3)]
↳ Power Button id=9 [slave keyboard (3)]
↳ Sleep Button id=10 [slave keyboard (3)]
↳ Chicony USB 2.0 Camera: Chicony id=13 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=14 [slave keyboard (3)]
↳ Cooler Master Technology Inc. MasterKeys Pro L White id=11 [slave keyboard (3)]
↳ Cooler Master Technology Inc. MasterKeys Pro L White id=12 [slave keyboard (3)]
</code></pre>
<p>I tried running <code>xinput test-xi2 12</code> to see if the events from the keyboard where issued. All keys are working except for the super keys. I tested the keyboard with my desktop PC and all keys are working fine. </p>
<p>I am running <strong>Ubuntu 16.04.5</strong> with kernel version <strong>4.13.0-45-generic</strong>, <strong>Unity</strong> as Desktop Environment and <strong>Compiz</strong> as Windows Manager.</p>
| 0non-cybersec
| Stackexchange |
The way the sky is split in this picture. | 0non-cybersec
| Reddit |
What are some signs that you might overlook when you should leave a relationship?. | 0non-cybersec
| Reddit |
Jon Stewart on 16 Years of The Daily Show and His Directorial Debut Rosewater. | 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 |
[Homemade] Scotch bonnet carrot cake with cream cheese buttercream, topped with candied pecans and walnuts.. | 0non-cybersec
| Reddit |
A leak in your sink!. | 0non-cybersec
| Reddit |
And chicken waffles for all. | 0non-cybersec
| Reddit |
Winter Anime Chart 2014 [Atxpieces v6]. | 0non-cybersec
| Reddit |
Who usually does the use case analysis in the team?. <p>I've just started my first IT job in a team with two developers (junior and senior), a project leader and an architect. My role is not yet completely defined and I said I'd be ok with both programming or testing. For now they put me on use case analysis since the PL says that it would leverage my analytical skills (I'm a science phd).</p>
<p>Now the question is who's usually responsible for use case analysis? How usual is it to put a newbie on it?</p>
<p>The hidden fear I have is: are they trying to keep me away from programming (after two weeks I still haven't SEEN a line of code...)?</p>
| 0non-cybersec
| Stackexchange |
[Breeds] My dachshund seems pretty bulky to me. Otto has been my first and only child, I love him to death, I brought him to this world, his mom was my ex's dog and forever I reached a teckel so we found her a mate and she gave birth 4 beautiful puppies, I help her deliver them. I fell in love as soon as I saw that snout.
Fast forward 3 years and unfortunately all of Otto's siblings are dead, he's the survivor of his bloodline.
I tell you this so you know I have nothing to compare him to, no brothers or sisters.
Even though both his parents are dachshunds, very skinny, long snout and short dachshund, Otto seem to have had a steroids binge. Since he stopped being a puppy and started to grow he just kept getting bulkier and thicker.
I know he's not fat, but he seems like he has been lifting weights his whole life, my neighbor has a female dachshund but she seems tiny next to Otto even tho she's not a miniature.
So I was just wondering what happened to my Otto, maybe his parents were mixed? Even tho they seemed pretty wiener-y to me?
Here's some photos of him
http://imgur.com/a/fkpAs | 0non-cybersec
| Reddit |
Found on a hike through the Virginia woods. It's about the size of a penny.. | 0non-cybersec
| Reddit |
Keeping your genitals clean is nice but cleaning up your place before you have someone over for sex is even nicer. PSA: Clean your apartment before you bring someone over for sex. It is just as important as washing your dick. Simple things like putting away your dirty laundry, making your bed and putting the toilet seat down will put your date at ease and show that your actually respect your space and your things. It will also probably increase your chances that they’ll want to see you again and come back to your place in the future.
I was reflecting on some of my past dating and sexual experiences and just remembered this guy who I thought was such a wonderful match for me. We were compatible on every level, especially sexually. But I ended things because he kept his apartment in such bad shape.
One time after sex I go the the bathroom to pee and clean up and after turning the light on I was in horror. Absolute complete horror. Toilet seat left up with mysterious stains on it (probably piss, etc) counter top was covered in a mess of products, dust and other gross things. Toothpaste stains everywhere. I don’t think he had changed his toothbrush on well over a year because it was doing that thing where the bristles are all splayed out and flat. The tub was dingy af and the shower curtain had mildew. I don’t even remember if I peed because I was just so grossed out. His bedroom was no better... the first time I went over I remember being embarrassed for him. But he was so non-chalant! He casually picked up dirty underwear that was lying on his unmade bed. There were clothes everywhere, books, papers, dust and random stuff all over his dresser, broken Xbox on the floor. It was such a mind fuck for me because on our dates he was so well put together and well groomed.
Each time I went to his place I tried to convince myself that maybe he had a long week and didn’t get a chance to tidy up to give him the benefit of the doubt. After being at his place on three occasions I knew I had to end it. I couldn’t keep having sex with him (especially at his place) because I was so anxious about the mess and paranoid about bacteria and stuff.
Sorry if this post sounds rude but please please please don’t bring people over for sex if your place is a mess! It’s just common courtesy.
Edit: I’m really happy to see that this has gotten quite a reach because I think this is an important issue that can have long term effects in relationships and marriages. There’s a clear divide in the comments between people who are ok with this type of situation and those who are not. To each their own. This experience is not limited to heterosexual relationships, it can affect anyone. Some people seem like they are feeling hurt or attacked here but maybe it's an opportunity for self evaluation. We're all a work in progress.
To the responses that intended to shame or criticize me for deciding to end things, please consider reading this article: [She Divorced Me Because I Left Dishes by the Sink](https://mustbethistalltoride.com/2016/01/14/she-divorced-me-because-i-left-dishes-by-the-sink/).
Additionally, it may have been a short fling but I still had respect for this person and did not end things in a malicious or insensitive way. There are so many superficial reasons why people break up (especially due to physical appearance) that are not as heavily criticized and are deemed ok because, hey, preferences right?
I know there are a few comments about the mental health of this person being a potential reason as to why they could not perform proper housekeeping for themselves. This is valid. I do think there may have been a deeper issue present but it was my personal choice to opt out of doing the emotional and mental labour to work through that with them. I chose to prioritize my own mental health and remove myself from the situation.
And for clarification, cleaning your genitals is just as important as cleaning your living space. Good hygiene is sexy. Can't believe I had to clarify that but lmao there ya go. | 0non-cybersec
| Reddit |
Lucian Blaga - Eu nu strivesc corola de minuni a lumii | Modernismul. | 0non-cybersec
| Reddit |
Took a father and son 10 years to build this 240z datsun in Brunei, everything from a BNR32 GTR. | 0non-cybersec
| Reddit |
Spectral norm of a matrix obtained by setting some entries to zero. <p>For example can we say, that if $A$ is original matrix and $A'$ obtained from $A$ by zeroing some elements then $\|A\|_2 \geq \|A'\|_2$?</p>
| 0non-cybersec
| Stackexchange |
Linux kernel - issues with Intel Pentium g4400 gpu drivers. <p>I tried to install both <strong>Debian</strong> and <strong>Ubuntu</strong> last versions as virtual machines, but I couldn't use neither because of an <strong>issue</strong> with my <strong>Intel Pentium g4400</strong>. The fact is that Debian gives a <strong>white error screen</strong> with something like <strong><em>Something has gone wrong</em></strong> etc, while Ubuntu apparently loads the GUI but has <strong>several bugs</strong>. Only <strong>terminal mode</strong> worked properly. In the past, when I had an Intel Duo Core Duo, there wasn't any problem. What I have thought is that there are no <strong>drivers</strong> available for my Pentium g4400 gpu, the hd510 graphics series, but obviously I wish I'm wrong. Anybody can help me?</p>
<p><strong>EDIT :</strong> I've just installed ubuntu 13.04 (32-bit) and I have no problems with the graphics. The only thing is that it's a bit slow but I think it's normal. However I run it on VirtualBox, Windows 10 10.0.14393, 8GB DDR4 RAM, Pentium g4400. </p>
| 0non-cybersec
| Stackexchange |
How does TeX's mechanism for sorting out quotation marks work?. <p>When I enter <code>``hello''</code> in TeX, it very nicely reformats it to some nicer version of <code>"hello"</code>. The mechanism for this seems to be buried deep down in the depths of TeX (and I can't find it in my usual resource: TeXbyTopic).</p>
<p>It <em>seems</em> like a font thing because if I do <code>\ttfamily</code> (in LaTeX) to get a monospaced font then this automatic replacement is turned off. I'd really like to turn it back on again, so that with <code>\ttfamily</code> I still get <code>"hello"</code>. Defining <code>'</code> and <code>`</code> as active characters seems a little dangerous for this task (though I'm happy to be proven wrong).</p>
| 0non-cybersec
| Stackexchange |
How to set base URL in Django. <p>I would like to run Django from location <a href="https://www.example.com/someuri/" rel="noreferrer">https://www.example.com/someuri/</a> so that I have the admin interface at <a href="https://www.example.com/someuri/admin/" rel="noreferrer">https://www.example.com/someuri/admin/</a>. I can see the login window but when I log in I get redirected to <a href="https://www.example.com/admin/" rel="noreferrer">https://www.example.com/admin/</a>. </p>
<p>Where can I set the base URL of Django to <a href="https://www.example.com/someuri/" rel="noreferrer">https://www.example.com/someuri/</a>? I tried with BASE_URL but with no luck.</p>
| 0non-cybersec
| Stackexchange |
Session timeout and ViewExpiredException handling on JSF/PrimeFaces ajax request. <p>I find this article to be useful for non-ajax request <a href="https://stackoverflow.com/questions/4992526/how-to-handle-session-expiration-and-viewexpiredexception-in-jsf-2">How to handle session expiration and ViewExpiredException in JSF 2?</a>
but I can't make use of this when I am submitting using an AJAX call.</p>
<p>Suppose in a primefaces dialog, I am making a post request using AJAX and session has already timed out.
I see my page getting stuck.</p>
<p>How to fix this kind of scenario such that when I post using AJAX, I could redirect him to my view expired page and
then forward him to the login page similar to the solution in the link above?</p>
<p>JSF2/Primefaces/Glassfish</p>
| 0non-cybersec
| Stackexchange |
The strange feature of the crisis is that Italy is not fundamentally insolvent. "The strange feature of the crisis is that Italy is not fundamentally insolvent. Public debt has been stable for several years at about 120pc of GDP. The country has a primary budget surplus. Household debt is low at 42pc of GDP. Net household wealth is €2.3 trillion, higher in per capita terms than in Germany. Combined public and private debt is under 260pc, lower than in Holland, France, Britain, the US and Japan. The core problem is not Italy's debts but the 40pc loss of labour competitiveness against Germany over the past 15 years. This has left the country trapped inside EMU with misaligned currency, choking growth."
http://www.telegraph.co.uk/finance/financialcrisis/8880306/Europe-pushes-Italy-into-the-abyss.html
Italy has not sunk because it has too much debt, it has sunk because it has entered recession and no one can see how it can get out again, the debt-death spiral begins just as it did with the other southern euro nations.
Austerity will take too long to create any meaningful turn around and nobody has a bailout fund big enough to finance Italy in the meantime.
Fiscal union? Eurobonds? How long will that take, the markets won't come back until the final referendum has been taken and it's all in place.
The europhiles get cross when I point these things out but every day they do not start the process of fiscal integration is a day closer to the euro's breakup. At a certain point it will become an inevitability, I personally now believe that its inevitable that at least one or more nations will leave the euro. | 0non-cybersec
| Reddit |
Brought toys for everyone, big brother wants them all for himself. | 0non-cybersec
| Reddit |
Altering the order of the variables in an equation system?. <p>I'm wondering if it's possible to alter the order LaTeX outputs the equation.</p>
<p>The following code</p>
<pre><code>\documentclass{article}
\usepackage{systeme}
\begin{document}
\[
\systeme{3+2t+s=x,s+2=y,1+t+2s=z}
\]
\end{document}
</code></pre>
<p>outputs </p>
<p><a href="https://i.stack.imgur.com/FrvYr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FrvYr.png" alt="enter image description here"></a></p>
<p>This really hurts my eyes as I would like the numbers to be displayed first, followed by the <em>t</em> and the <em>s</em> lastly.</p>
| 0non-cybersec
| Stackexchange |
timezone setting per virtual host. <p>I am trying to test functionality related to timezone handling/conversion
during synchronization between two of my test servers (currently they are running on same mashine).</p>
<p>Is it possible to set up hosts so one will be running, say, by London time, and the other by Moscow?</p>
<p>Web applications running on both servers are written on Perl.</p>
| 0non-cybersec
| Stackexchange |
Guy launches a model rocket to 118,000 feet, gets great onboard video.. | 0non-cybersec
| Reddit |
Hessian with rank one. <p>Let $\boldsymbol{\mathsf{H}}$ be the Hessian of the function $F(\boldsymbol{x})$. If this function is of the form
$$
F(\boldsymbol{x}) = f(\hat{\boldsymbol{\omega}}\cdot\boldsymbol{x})
$$
with some unit vector $\hat{\boldsymbol{\omega}}$ and function $f$, then
$$
\mathsf{H}_{ij} = \hat{\omega}_i\,\hat{\omega}_j\,f''(\hat{\boldsymbol{\omega}}\cdot\boldsymbol{x}).
$$
In particular, $\boldsymbol{\mathsf{H}}$ has rank one everywhere with the only non-trivial eigenvector being $\hat{\boldsymbol{\omega}}$.</p>
<p>My question, is the reverse also true? That is, if $\boldsymbol{\mathsf{H}}$ has rank one everywhere, is then necessarily $F(\boldsymbol{x})$ of the form above?</p>
| 0non-cybersec
| Stackexchange |
What is causing this memory leak when (inner) joining this table?. <p>I have SQL that in my head, would and should run in under 1 second:</p>
<pre><code>SELECT mem.`epid`,
mem.`model_id`,
em.`UKM_Make`,
em.`UKM_Model`,
em.`UKM_CCM`,
em.`UKM_Submodel`,
em.`Year`,
em.`UKM_StreetName`,
f.`fit_part_number`
FROM `table_one` AS mem
INNER JOIN `table_two` em ON mem.`epid` = em.`ePID`
INNER JOIN `table_three` f ON `mem`.`model_id` = f.`fit_model_id`
LIMIT 1;
</code></pre>
<p>When I run in the terminal this SQL executes in 16 seconds. However, if I remove the line:</p>
<pre><code>INNER JOIN `table_three` f ON `mem`.`model_id` = f.`fit_model_id`
</code></pre>
<p>then it executes in 0.03 seconds. Unfortunately for me, I'm not to sure how to debug MYSQL performance issues. This causes my PHP script to run out of memory trying to execute the query.</p>
<p>Here are my table structures:</p>
<blockquote>
<p>table_one</p>
</blockquote>
<pre><code>+----------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+---------+------+-----+---------+-------+
| epid | int(11) | YES | | NULL | |
| model_id | int(11) | YES | | NULL | |
+----------+---------+------+-----+---------+-------+
</code></pre>
<blockquote>
<p>table_two</p>
</blockquote>
<pre><code>+----------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------+--------------+------+-----+---------+-------+
| id | int(11) | NO | PRI | NULL | |
| ePID | int(11) | NO | | NULL | |
| UKM_Make | varchar(100) | NO | | NULL | |
| UKM_Model | varchar(100) | NO | | NULL | |
| UKM_CCM | int(11) | NO | | NULL | |
| UKM_Submodel | varchar(100) | NO | | NULL | |
| Year | int(11) | NO | | NULL | |
| UKM_StreetName | varchar(100) | NO | | NULL | |
| Vehicle Type | varchar(100) | NO | | NULL | |
+----------------+--------------+------+-----+---------+-------+
</code></pre>
<blockquote>
<p>table_three</p>
</blockquote>
<pre><code>+-----------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+-------------+------+-----+---------+----------------+
| fit_fitment_id | int(11) | NO | PRI | NULL | auto_increment |
| fit_part_number | varchar(50) | NO | | NULL | |
| fit_model_id | int(11) | YES | | NULL | |
| fit_year_start | varchar(4) | YES | | NULL | |
| fit_year_end | varchar(4) | YES | | NULL | |
+-----------------+-------------+------+-----+---------+----------------+
</code></pre>
<p>The above is output from <code>describe $table_name</code></p>
<p>Is there anything that I'm obviously missing and if not, how can I try to find out why including <code>table_three</code> causes such a slow response time?</p>
<p><strong>EDIT ONE:</strong> </p>
<p>After the indexing suggestion (used <code>CREATE INDEX fit_model ON table_three (fit_model_id)</code>, it performs the query in 0.00 seconds (in MYSQL). Removing the limit, is still running from after doing the suggestion ... so not quite there. Anton's suggestion about using EXPLAIN I used it and got this output:</p>
<pre><code>+------+-------------+-------+------+---------------+-----------+---------+----------------------+-------+-------------------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+-------+------+---------------+-----------+---------+----------------------+-------+-------------------------------------------------+
| 1 | SIMPLE | mem | ALL | NULL | NULL | NULL | NULL | 5587 | Using where |
| 1 | SIMPLE | f | ref | fit_model | fit_model | 5 | mastern.mem.model_id | 14 | |
| 1 | SIMPLE | em | ALL | NULL | NULL | NULL | NULL | 36773 | Using where; Using join buffer (flat, BNL join) |
+------+-------------+-------+------+---------------+-----------+---------+----------------------+-------+-------------------------------------------------+
</code></pre>
<p><strong>EDIT TWO</strong></p>
<p>I've added a Foreign Key based on suggestions using the below query:</p>
<pre><code>ALTER TABLE `table_one`
ADD CONSTRAINT `model_id_fk_tbl_three`
FOREIGN KEY (`model_id`)
REFERENCES `table_three` (`fit_model_id`)
</code></pre>
<p>MYSQL is still executing the command - there are a lot of rows, so half-expecting this behaviour. With PHP I can break up the query and build my array like that, so I guess that possibly solves the issue - thought is there anything more I can do to try and reduce execution time?</p>
| 0non-cybersec
| Stackexchange |
How rappers sound currently. | 0non-cybersec
| Reddit |
[OC] Longitudinal trends in global COVID-19 research - sorted by article topic, type, and medical speciality. | 0non-cybersec
| Reddit |
Access Secure variable from unit test on Azure pipeline maven build. <p>I'm trying to create a Azure DevOps pipeline for one of Java application using maven and in the unit test I have 2 secrets which needs to access the value from environment variables. </p>
<pre><code>String key = System.getenv().get("MY_KEY");
String secret = System.getenv().get("MY_SECRET");
</code></pre>
<p>I have added 2 values under pipeline variables from the browser and mark them as "Keep this value secret" so that values will be kept as secret.</p>
<p><a href="https://i.stack.imgur.com/tWu1i.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tWu1i.png" alt="enter image description here"></a></p>
<p>In the pipeline I have added required variables and substitute the value with configured variables.</p>
<pre><code>variables:
MY_KEY: $(MY_KEY_VAL)
MY_SECRET: $(MY_SECRET_VAL)
</code></pre>
<p>However, when I run the build pipeline, it fails with unit test due to null values on both 'key' and 'secret' values.</p>
<p>How can I fix this? Am I doing anything wrong on the configurations?</p>
<p><strong>UPDATE</strong></p>
<p>As Ben mentioned below, it is not possible to set environment variable on hosted agents. In order to run all unit tests during the build pipeline and still keep the key & secret secure, I have modified the unit tests to read the key and secret from a file on the project root. Instead adding the file containing key & secret to git repo, it was added as a Secure File on the pipeline library and was given permission to access by pipeline.</p>
<p>On the Pipeline I was able to download the secure file using 'DownloadSecureFile' task.</p>
<pre><code>- task: DownloadSecureFile@1
displayName: Download API secrets
name: configfile
inputs:
secureFile: 'service_api_keys'
</code></pre>
<p>Moved the file to project root using bash.</p>
<pre><code>- bash: mv $(configfile.secureFilePath) ./
</code></pre>
<p>Run the build the process which will read the secrets on unit test execution.</p>
| 0non-cybersec
| Stackexchange |
Get total row count while paging. <p>I have a search screen where the user has 5 filters to search on.<br />
I constructed a dynamic query, based on these filter values, and page 10 results at a time.<br />
This is working fine in SQL2012 using <code>OFFSET</code> and <code>FETCH</code>, but I'm using <strong><em>two</em></strong> queries to do this.</p>
<p>I want to show the 10 results <em>and</em> display the total number of rows found by the query (let's say 1000).<br />
Currently I do this by running the query <strong><em>twice</em></strong> - once for the Total count, then again to page the 10 rows.<br />
Is there a more efficient way to do this?</p>
| 0non-cybersec
| Stackexchange |
How far will you get with an 'rm -rf /' command?. <p>I've often wondered how far the system will actually get if you run <code>rm -rf /</code>. I doubt the OS would be able to erase itself (?)</p>
<p><strong>Bonus Question</strong>: After the command has been executed, will <code>rm</code> have removed itself?</p>
<p><strong>Update:</strong>
I've tested this in a couple of the main unix distributions using VirtualBox and the answers describe exactly what happens. If given the correct parameters, rm will remove every physical bit of data on the disc. However, I ran into some issues when using a version of rm other than the GNU one. For example, I believe BusyBox has their own version and it doesn't let you remove as much as you potentially could.</p>
<blockquote>
<p>This question was a <strong><a href="http://meta.superuser.com/questions/2936/super-user-questions-of-the-week-25">Super User Question of the Week</a></strong>.<br/>
Read the July 7th, 2011 <strong><a href="http://blog.superuser.com/2011/07/25/the-path-of-destruction-rm-rf/">blog entry</a></strong> for more details or <strong><a href="http://meta.superuser.com/questions/tagged/question-of-the-week?sort=newest">submit your own</a></strong> Question of the Week.</p>
</blockquote>
| 0non-cybersec
| Stackexchange |
In-depth analysis of an attack vector that involves a digital version of the Risk Board Game.. | 1cybersec
| Reddit |
Watch this lit vid it’s funny. | 0non-cybersec
| Reddit |
belanja online baju anak ambil di mangga dua. | 1cybersec
| Reddit |
There’s no sleep like a stoned sleep!. | 0non-cybersec
| Reddit |
How can I disable graphical boot, yet start x during boot?. <h1>My question</h1>
<p>I am not attached to the splashscreen or whatever. <strong>How can I configure a non-graphical boot that still takes me to the login screen?</strong> In other words, I do want X to start as the last thing in the boot process, but I do not need any other tools (plymouth or userspace bootsplash or whatever).</p>
<h1>My problem</h1>
<p>I get a blank/purple screen at undefined times when use the battery or when I have used it. I have a Lenovo Easypad z580. At times the problem also occurs after a suspend. In that case it states something like <code>userspace bootsplash stopped</code>.</p>
<h1>My research</h1>
<p>I read and tried the solutions in the following pages:</p>
<ol>
<li><a href="https://wiki.ubuntu.com/X/Troubleshooting/BlankScreen" rel="nofollow noreferrer">https://wiki.ubuntu.com/X/Troubleshooting/BlankScreen</a></li>
<li><a href="https://wiki.ubuntu.com/X/Troubleshooting/Freeze" rel="nofollow noreferrer">https://wiki.ubuntu.com/X/Troubleshooting/Freeze</a></li>
<li><a href="https://wiki.ubuntu.com/X/NonGraphicalBoot" rel="nofollow noreferrer">https://wiki.ubuntu.com/X/NonGraphicalBoot</a></li>
<li><a href="https://askubuntu.com/questions/162075/my-computer-boots-to-a-black-screen-what-options-do-i-have-to-fix-it">My computer boots to a black screen, what options do I have to fix it?</a></li>
</ol>
<p>I already disabled plymouth.</p>
<p>I do not think that this question is a duplicate (because I want a non-graphical boot, yet a graphical desktop). But I might be mistaking. Also my scenario is none of the ones proposed in <a href="https://askubuntu.com/questions/162075/my-computer-boots-to-a-black-screen-what-options-do-i-have-to-fix-it">My computer boots to a black screen, what options do I have to fix it?</a> (If you are trying to install Ubuntu, If you have a dual boot system, If an update or something else caused your problem).</p>
| 0non-cybersec
| Stackexchange |
Buying Forbidden Fruit: the R32 Skyline GTR. | 0non-cybersec
| Reddit |
Check out our Minecraft Sci-Fi Rp server. Set in a universe post-singularity. Releasing soon!. | 0non-cybersec
| Reddit |
How does github figure out a project's language?. <p>I was recently working on a github project in both JavaScript and C++, and noticed that github tagged the project as C++. If you have to pick a single language, this is probably the correct designation since the C++ code is compiled as a JavaScript library, but this made me wonder... how does github figure out what language to tag each project?</p>
| 0non-cybersec
| Stackexchange |
TIL When ATM machines were introduced, it was assumed that the tellers' job would be eliminated. But ATMs ended up increasing tellers overall. ATMs introduced - Teller jobs per branch reduced - Branches became cheaper to operate - Number of branches increased - Overall number of tellers increased.. | 0non-cybersec
| Reddit |
Get Debian Wheezy netinstall to detect wlan. <p>I'm attempting to install debian wheezy from the netinstall iso burned to usb. I'm trying to use a Belkin F9L1002v1. First time I attempted installation, I was notified of some missing firmware, so I downloaded the firmware package from Debian's site and put the .deb files in the /firmware folder of the usb. I can now proceed in the installation, but when it attempts to configure the network it only scans eth0, and not wlan0. How do I get Debian to recognize the adapter?</p>
<p>Last few lines of dmesg:
<img src="https://i.stack.imgur.com/mad6r.jpg" alt="dmesg"></p>
<p>"Ifconfig -a" returns a command not found error</p>
| 0non-cybersec
| Stackexchange |
Ubuntu 16.04 wont boot without USB. <p>I want to use ubuntu 16.04 with windows 8.1 (dual boot) . But after installing ubuntu it only boots with a USB. after booting in the grub page it shows 4 options . they are :-</p>
<ol>
<li><p>try ubuntu without installing.</p>
</li>
<li><p>install ubuntu</p>
</li>
<li><p>odx installation (for manufacturers)</p>
</li>
<li><p>check for drive errors.</p>
<p>I am now using the 1st option because after installing ubuntu this is the option that I find suitable for using.</p>
</li>
</ol>
<p>I have installed ubuntu 2 times but nothing is working out for me.</p>
<p>then I saw a post which instructed me to write some codes in the terminals.</p>
<p>the result I got after I tried the below codes:-</p>
<pre><code>$ ls -l /dev/disk/by-label/
total 0
lrwxrwxrwx 1 root root 10 Apr 27 15:46 RECOVERY -> ../../sda5
lrwxrwxrwx 1 root root 10 Apr 27 15:46 UBUNTU\x2016_0 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Apr 27 15:46 Windows -> ../../sda4
lrwxrwxrwx 1 root root 10 Apr 27 15:46 WINRE -> ../../sda1
$ sudo grub-install /dev/sdb
Installing for i386-pc platform.
grub-install: error: failed to get canonical path of `aufs'.
</code></pre>
<p>Even I am not able to access any files in my pc through Ubuntu.
it shows the error :-</p>
<pre><code>unable to access "windows".
Error mounting /dev/sda4 at /media/ubuntu/Windows: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=999,gid=999" "/dev/sda4" "/media/ubuntu/Windows"' exited with non-zero exit status 1:
Blockquote
</code></pre>
<p>I am not able to understand what is wrong and I am not able to find a solution for it. I am a new to Ubuntu so do give a bit of explanations.</p>
| 0non-cybersec
| Stackexchange |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange |
USA's 16 year old Junior Flores signs with Bundesliga Champions Borussia Dortmund.. | 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 |
Strange ps output. Should i be worried if i see something like this when i do a ps in my unix machine
User1 1234 1245 0 oct 01 ? 0:00 ./usr/sbin/sftp
Why is the output showing a “Dot slash” in the command.? Usually it should be displayed the full path, like /usr/bin/sftp right?
Any ideas? | 1cybersec
| Reddit |
Making diffeomorphism of submanifolds boring. <p>This is probably very well known in surgery theory... I'm looking for a modern reference on the following questions (the only one I know is Browder's <a href="http://www.ams.org/tran/1967-128-01/S0002-9947-1967-0212816-0/S0002-9947-1967-0212816-0.pdf" rel="nofollow noreferrer">"Diffeomorphism of 1-connected manifolds"</a> from 1976 which is nice but probably a little outdated):</p>
<p>Let <span class="math-container">$M$</span> be a smooth manifold and let <span class="math-container">$N \hookrightarrow M$</span> be a smooth submanifold. We assume that <span class="math-container">$\dim(N) \geq 2$</span>, <span class="math-container">$\dim(M) \geq \dim(N)+3$</span> and that <span class="math-container">$M$</span> is 1-connected (or has a finite fundamental group).</p>
<p>Let <span class="math-container">$\phi : N \to N$</span> be an orientation preserving diffeomorphism which represents a non-trivial element in the smooth mapping class group <span class="math-container">$\pi_0 \mathrm{Diff}^+(N)$</span>.</p>
<p><strong>Question.</strong> What are the conditions/obstructions to lifting <span class="math-container">$\phi$</span> to:</p>
<ol>
<li><p>A homotopy equivalence <span class="math-container">$\Phi : M \to M$</span>?</p>
<p>(Perhaps more generally - how does one relate the groups of self-homotopy equivalences of <span class="math-container">$M$</span> and <span class="math-container">$N$</span>?)</p>
</li>
<li><p>An orientation preserving diffeomorphism <span class="math-container">$\Phi : M \to M$</span>?</p>
</li>
<li><p>A diffeomorphism <span class="math-container">$\Phi : M \to M$</span> which is trivial in <span class="math-container">$\pi_0 \mathrm{Diff}^+(M)$</span>?</p>
<p>(More generally - what can be said about the topology of the space of pairs which consist of: orientation preserving diffeomorphism <span class="math-container">$\Phi : M \to M$</span> which lift <span class="math-container">$\phi$</span> and a choice of trivializing isotopy?)</p>
</li>
</ol>
| 0non-cybersec
| Stackexchange |
The Fumbling Escape. https://youtu.be/-Dgq5Z5HqpM | 0non-cybersec
| Reddit |
Big Daddy and Little Sister done by Kay Lee at Gem Tattoo in Seoul, Korea. | 0non-cybersec
| Reddit |
How to add shell script to launcher in Ubuntu 17.04?. <p>I want to add a launcher icon to execute a shell script. The script has execute permissions for all users. I've created a file called <code>wake.desktop</code> in <code>~/.local/share/applications/</code>:</p>
<pre><code>[Desktop Entry]
Exec=gksudo /home/myuser/enablewake.sh
Icon=/home/myuser/icon1.png
Encoding=UTF-8
Terminal=true
Name=EnableWake
Type=Application
</code></pre>
<p>This is the script:</p>
<pre><code>#!/bin/bash
# Enable Wake on IR for USB bus 3 port 1 (MCE Remote)
echo enabled > /sys/bus/usb/devices/3-1/power/wakeup
</code></pre>
<p>Unfortunately there's no entry in my launcher. How can I get a shortcut to this shell script on my launcher?</p>
| 0non-cybersec
| Stackexchange |
Again? Golden opportunity part deux. God speed!. | 0non-cybersec
| Reddit |
ELI5 What causes the involuntary scowl when we eat something unexpectedly bitter?. | 0non-cybersec
| Reddit |
I know we all want cheaters in football to be punished, but at the weekend Danny Rose was given a yellow card for diving for this.... | 0non-cybersec
| Reddit |
ELI5: How does a pyrolysis waste disposal machine work?. ​
1. How does the main 'reactor' chamber get heated up to such high temperatures without using a huge amount of energy in the process?
2. After reaching that temperature, how is it maintained for an indefinite period of time in the absence of oxygen?
3. How are the waste gases treated?
New here so I hope these questions are clear enough. Thanks in advance! | 0non-cybersec
| Reddit |
Seen at a KFC in New Brunswick. | 0non-cybersec
| Reddit |
Why is the ForEach method only for lists. <p>From what I can see, the <code>ForEach</code> method is available only for the <code>List</code> <a href="http://msdn.microsoft.com/en-us/library/bwabdf9z.aspx" rel="nofollow noreferrer">class</a>. </p>
<p>Why is that? I can see no reason for <code>ForEach</code> not to be available to any class implementing the <code>IEnumerable</code>/<code>IEnumerator</code> interfaces, and this is a really useful method if you need to perform a small action (1 line is more readable than 1 line + 2 boilerplate foreach syntax...).</p>
<p><strong>Update:</strong> I'll clarify my question. There are perfectly valid reasons for including <code>ForEach</code> in sequences. There are perfectly good reasons for <em>not</em> including <code>ForEach</code>in all sequences.</p>
<p>But I cannot understand why would <code>ForEach</code> be included in just some of the sequences.</p>
| 0non-cybersec
| Stackexchange |
What is new in Kernel 3.0?. <p>I understand this is somewhat less Ubuntu related, but it affects it.</p>
<p>So,what is so new about it that Linus decided to name it 3.0? I'm not trying to get information about the drivers that got into it or stuff that always gets improved. I want to know what really made it 3.0. I read somewhere that Linus wanted to get rid of the code that supports legacy hardware. Hm, not sure what that really meant because 3.0 is bigger (in MB), not smaller, than, say, 2.6.38.</p>
<p>What was the cause of naming it 3.0?</p>
| 0non-cybersec
| Stackexchange |
[Homemade] Chocolate and vanilla berry medley crepes. | 0non-cybersec
| Reddit |
Basil and cashew pesto. | 0non-cybersec
| Reddit |
Errors with lualatex, siunitx and pgfplotstable replacing emdash. <p>I'm referring to this <a href="https://tex.stackexchange.com/a/69082/45570">answer</a> from @Jake to replace the string <code>---</code> of an input csv to <code>\textemdash</code> in a pgfplotstable table with the <code>S</code> column of <code>siunitx</code>. The provided solution works fine when <code>pdflatex</code> is used. However, using <code>lualatex</code> with the additional package <code>fontspec</code> will produce a lot of these errors:</p>
<pre><code>Missing number, treated as zero.
</code></pre>
<p>I would like to get it to work for <code>lualatex</code> as well. Any ideas?</p>
<p>MWE:</p>
<pre><code>\documentclass{memoir}
\usepackage{fontspec}
\usepackage{pgfplotstable}
\usepackage{siunitx}
\usepackage{longtable}
\pgfplotstableset{
begin table=\begin{longtable},
end table=\end{longtable},
}
\begin{document}
\pgfplotstabletypeset[%
col sep=comma,
string replace={---}{\textemdash}, %
columns/atomnum/.style={int detect,column type=c},%
columns/atomtype/.style={string type,column type=c},%
columns/x/.style={string type,column type={S[table-format=-1.6]}},%
columns/y/.style={string type,column type={S[table-format=-1.6]}},%
columns/z/.style={string type,column type={S[table-format=-1.6]}},%
columns/nmrshieldtens/.style={string type, column type={S[table-format=3.4]}},%
columns/nmrscaledshifts/.style={
string type,
column type={S[table-format=2.4]}},%
header=true,multicolumn names,
every head row/.style={before row=\toprule, after row=\midrule\endhead},%
every last row/.style={after row=\bottomrule}%
]{
atomnum,atomtype,x,y,z,nmrshieldtens,nmrscaledshifts
1, C ,2.645924,-0.284964,1.121739,145.6803,38.1985
2, C ,3.061887,-0.314747,-1.738533,138.1991,45.6797
3, C ,4.192868,-0.744373,-0.81303,152.3163,31.5625
4, C ,3.609622,-1.293585,0.487818,158.2814,25.5974
5, H ,2.179934,-0.733573,2.004648,29.7536,2.1014
6, H ,3.222428,0.584598,1.466674,30.9379,0.9171
7, H ,2.482083,-1.204262,-2.037409,28.7647,3.0903
8, H ,3.460033,0.135058,-2.653243,29.1953,2.6597
9, H ,4.8172,-1.495056,-1.309066,30.3061,1.5489
10, H ,4.826006,0.126259,-0.596497,30.5419,1.3131
11, H ,4.407002,-1.530092,1.200573,30.3571,1.4979
12, H ,3.088045,-2.236207,0.278539,30.219,1.636
13, C ,-0.54058,-1.145592,0.929915,143.9137,39.9651
14, C ,0.528585,-0.902319,-0.152946,143.2553,40.6235
15, C ,1.550392,0.221805,0.156845,124.581,59.2978
16, C ,0.851532,1.450518,0.80068,133.676,50.2028
17, C ,0.027293,1.042491,2.023216,147.7008,36.178
18, C ,-1.109706,0.152585,1.53285,140.8497,43.0291
19, H ,-0.057217,-1.683382,1.759072,30.1175,1.7375
20, H ,0.034879,-0.650236,-1.095222,30.0622,1.7928
21, H ,1.056471,-1.849267,-0.318437,29.5661,2.2889
22, H ,1.648183,2.146325,1.095154,30.7693,1.0857
23, H ,0.631687,0.517402,2.770335,29.9253,1.9297
24, H ,-0.375923,1.941621,2.506378,30.4385,1.4165
25, H ,-1.749305,-0.12778,2.381335,30.3971,1.4579
26, C ,-0.086446,2.231626,-0.127235,121.2219,62.6569
27, C ,-2.015491,0.916314,0.549213,113.5813,70.2975
28, H ,-0.424133,3.132366,0.42693,29.8436,2.0114
29, H ,0.446378,2.597638,-1.011354,28.8531,3.0019
30, C ,-1.676245,-2.03098,0.39515,138.255,45.6238
31, H ,-2.274539,-2.393781,1.244793,30.6875,1.1675
32, H ,-1.25699,-2.917557,-0.100028,30.3609,1.4941
33, C ,-2.623346,-1.297773,-0.5652,156.7968,27.082
34, H ,-2.066223,-1.014811,-1.468623,29.9263,1.9287
35, C ,-3.14384,-0.01614,0.093255,140.5753,43.3035
36, H ,-2.46664,1.767252,1.104586,29.9266,1.9284
37, H ,-3.843967,0.497571,-0.574314,29.7727,2.0823
38, H ,-3.719835,-0.292135,0.988647,31.0288,0.8262
39, C ,-3.780339,-2.203913,-0.982867,159.2459,24.6329
40, H ,-4.373272,-2.494855,-0.106965,31.3512,0.5038
41, H ,-4.447095,-1.695357,-1.687373,30.882,0.973
42, H ,-3.413599,-3.118855,-1.46021,30.8992,0.9558
43, N ,-1.242229,1.456093,-0.582487,---,---
44, C ,-2.064595,2.286645,-1.451361,138.6569,45.2219
45, H ,-1.433234,2.735618,-2.223064,29.7894,2.0656
46, H ,-2.833329,1.693382,-1.950341,29.0105,2.8445
47, H ,-2.559918,3.103363,-0.892348,30.514,1.341
48, N ,2.23005,0.694822,-1.070475,---,---
49, H ,1.515066,0.996756,-1.729488,30.5467,1.3083
}%
\end{document}
</code></pre>
| 0non-cybersec
| Stackexchange |
Installation for libxml2-dev libonig-dev failed with "connection failed" on Ubuntu 18.04. <p>I want to install <code>libxml2-dev</code> and <code>libonig-dev</code> on Ubuntu 18.04.</p>
<p>I am getting the following error every time I am trying to install it.</p>
<pre><code>$ sudo apt-get install libxml2-dev libonig-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
gir1.2-harfbuzz-0.0 icu-devtools libglib2.0-dev libglib2.0-dev-bin libgraphite2-dev libharfbuzz-dev libharfbuzz-gobject0 libicu-dev libicu-le-hb-dev libicu-le-hb0 libiculx60 libonig4 libpcre16-3
libpcre3-dev libpcre32-3 libpcrecpp0v5 pkg-config python3-distutils python3-lib2to3 zlib1g-dev
Suggested packages:
libglib2.0-doc libgraphite2-utils icu-doc
The following NEW packages will be installed:
gir1.2-harfbuzz-0.0 icu-devtools libglib2.0-dev libglib2.0-dev-bin libgraphite2-dev libharfbuzz-dev libharfbuzz-gobject0 libicu-dev libicu-le-hb-dev libicu-le-hb0 libiculx60 libonig-dev libonig4
libpcre16-3 libpcre3-dev libpcre32-3 libpcrecpp0v5 libxml2-dev pkg-config python3-distutils python3-lib2to3 zlib1g-dev
0 upgraded, 22 newly installed, 0 to remove and 6 not upgraded.
Need to get 537 kB/13.2 MB of archives.
After this operation, 64.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err:1 http://archive.ubuntu.com/ubuntu bionic/main amd64 libpcre3-dev amd64 2:8.39-9
Connection failed [IP: 91.189.91.23 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/pcre3/libpcre3-dev_8.39-9_amd64.deb Connection failed [IP: 91.189.91.23 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
</code></pre>
<p>I tried <code>sudo apt-get update && sudo apt-get upgrade</code> but it didn't work. </p>
| 0non-cybersec
| Stackexchange |
Bye bye promises. | 0non-cybersec
| Reddit |
[Idea][Skip advert]. Hi Folks. I'm writing a post about an idea which maybe could be useful for some of you. The problem is that I don't know if it is realizable.
Let me explain : My girlfriend watch TV. The thing is that I hate TV advert. They make the soud louder to be listen-able throug all your house even if you have headphones on. Therefore I'm wondering if it could be doable to build a raspberry which bound TV and set top box.
The concept is by configuring a pattern (image, sound) it should be able to trigger a process,when advertising starts and switch to youtube and play random channel video while advertising is shown. When the pattern is matched again it return to its normal state?
Is it do-able ? [using this as a base](http://rdmilligan.wordpress.com/2014/05/01/skip-adverts-using-raspberry-pi/) | 0non-cybersec
| Reddit |
Post on somebody else’s page. <p>I've written birthday posts on a friend’s page, but they don't show up. Where did they go? And how do I find them and bring them up?</p>
| 0non-cybersec
| Stackexchange |
What's the one thing you know you're an asshole for?. We all know we aren't perfect and we like to judge others on their wrongdoings, but what's the one thing you do that you know deserves an asshole title? | 0non-cybersec
| Reddit |
Webpack loader equivalent of requirejs plugin load with XMLHttpRequest. <p>I have a pair of requirejs plugins, that I'd like to replace with a webpack loader.</p>
<pre><code>define('firstLoader', {
load: function (name, parentRequire, onload, config) {
var xhr = new XMLHttpRequest();
xhr.addEventListener('load', function () {onload(this.responseText);});
xhr.addEventListener('error', onload.error);
xhr.addEventListener('abort', onload.error);
var url = '...' + name;
xhr.open('GET', url);
xhr.send()
}
})
define('jsonLoader', {
load: function (name, parentRequire, onload, config) {
//This is the nasty part.
req(['firstLoader!' + name], function (text) {
try {
onload(JSON.parse(text));
}
catch (err) {
onload.error(err);
}
})
}
});
</code></pre>
<p>The biggest problems are the lack of promises for the async request and the dynamic require. Is there a way around this without transpilation (with `System.load) or additional libraries (bluebird, etc.)?</p>
<h3>Edit</h3>
<p>So I've taken a crack at this, and now I'm getting an error</p>
<p><code>Module not found: Error: Can't resolve 'future/url'</code></p>
<p>when I go to <code>require('jsonLoader!future/url'</code>). Does webpack allow loaders to operate at runtime? Here's the updated code.</p>
<p><em>firstPlugin.js</em></p>
<pre><code>module.exports = function loadAsync (content, callback) {
var host = document.location.host
var url = host + '...' + name
xhr.addEventListener("load", function () {callback(null, this.responseText)})
xhr.open("GET", url)
xhr.send()
}
}
</code></pre>
<p><em>jsonPlugin.js</em></p>
<pre><code>module.exports = function (content, callback) {
require('firstPlugin!' + content, function (result) {
callback(null, JSON.parse(result))
})
}
</code></pre>
| 0non-cybersec
| Stackexchange |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.