text
stringlengths 36
35k
| label
class label 2
classes | source
stringclasses 3
values | tokens_length
int64 128
4.1k
| text_length
int64 36
35k
|
---|---|---|---|---|
How can I change the voice used by Firefox Reader View (Narrator) in Ubuntu?. <p><a href="https://i.stack.imgur.com/6DYQpm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6DYQpm.png" alt="**how to change firefox reader view voice in ubuntu** "></a></p>
<p>The default voice as well as all alternative voices are very difficult to understand.</p>
<p>I cannot find any documentation about how this feature is wired up.</p>
| 0non-cybersec
| Stackexchange | 132 | 433 |
Inequality involving $\lim \sup$. <blockquote>
<p>Let $\{a_n\}$ be sequence of positive terms. Prove that $\displaystyle \lim_{n\to\infty}\sup\left(\frac{a_1+a_{n+1}}{a_n}\right)^n\ge e$</p>
</blockquote>
<p>I'm tring to reduce the LHS to some form of the type $\displaystyle \lim_{n\to \infty}\left(1+\frac{1}{n}\right)^n$ and also tried using the fact that $\lim \sup a_n\ge \lim a_n$ but couldn't get much.</p>
| 0non-cybersec
| Stackexchange | 158 | 418 |
Has anyone defined a limit of a sequence of fields? In particular, what is the limit of finite fields?. <p>I'm curious about
$$ \lim_{n \rightarrow \infty} \mathbb{F}_n $$
Is it $\mathbb{Z}$? That seems reasonable if you consider it as a set but of course $\mathbb{Z}$ is not a field so that is confusing. I think the problem is probably how you define the limit in this case. Has anyone ever done so?</p>
<p>Edit: Another question. What is the smallest field that contains all finite fields? We think the answer to this is $\mathbb{Q}$, but again we don't have a formal definition of "containment", so this is a problem too. Maybe using subfields. Have either of my questions ever been studied?</p>
| 0non-cybersec
| Stackexchange | 183 | 702 |
Unable to boot windows after installing drivers for graphics card. <p>I have a laptop Samsung Chronos 700z (I don't remember exact model number, and I don't have laptop in front of me to check, I can update it later if required) </p>
<p>Recently, while I was browsing internet, laptop suddenly turned off. I tried turn it on, but during loading OS it shuts itself down. Initially I thought it is because it was overheated, so after it cooled down, I used compressed air to remove all dust. </p>
<p>But this didn't solve problem. It worked when I run windows in safe mode, so I thought it was some issues with system, so i reinstalled system.
After I reinstalled new system on the top of old one, and everything seems working fine, till I install graphics card drivers. I got exactly same issues as i had at the beginning.</p>
<p>Other thing, I tried to run linux from live cd, and it didn't work.</p>
<p>Anyone have suggestion what i should do, or at least idea what happened?</p>
| 0non-cybersec
| Stackexchange | 249 | 985 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
How to convert from char* to id* with ARC enabled. <p>I'm trying to construct "fake" variable arguments list, using the technique described <a href="http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html" rel="noreferrer">here</a>, but for ARC-enabled project and I can't figure out how to get rid of the error I'm getting.</p>
<p>Here's the code in question:</p>
<pre><code>NSMutableArray* argumentsArray = [NSMutableArray array];
// ... Here I fill argumentsArray with some elements
// And then, I want to construct a "fake" variable argument list
char* fakeArgList = (char*) malloc( sizeof(NSString*) * [argumentsArray count]);
[argumentsArray getObjects: (id*) fakeArgList];
NSString* content = [[NSString alloc] initWithFormat: formatString arguments:fakeArgList];
</code></pre>
<p>XCode complains on the <em>(id</em>) fakeArgList* casting, saying:</p>
<blockquote>
<p>Cast of non-Objective-C pointer type 'char *' to '_autoreleasing id *'
is disallowed with ARC</p>
</blockquote>
<p>My initial theory was that I just need to add __unsafe_unretained to (id*) casting to tell ARC that I'm responsible for that block of memory and it shouldn't retain/release it, but that doesn't work and I can't figure out how to fix this problem.</p>
<p><strong>Update:</strong> Here's the full function. It should take a printf-style format string and a variable list of field names inside the .plist and output a formatted string with data loaded from .plist. I.e., if I have a .plist file with fields "field1" = "foo" and "field2" = 3 and I call <code>[loadStringFromFixture: @"?param1=%@&param2=%d", @"field1", @field2]</code> then I should get string "?param1=foo&param2=3"</p>
<pre><code>- (NSString*) loadStringFromFixture:(NSString*) format, ...
{
NSString* path = [[NSBundle mainBundle] bundlePath];
NSString* finalPath = [path stringByAppendingPathComponent:@"MockAPI-Fixtures.plist"];
NSDictionary* plistData = [NSDictionary dictionaryWithContentsOfFile:finalPath];
va_list argumentsList;
va_start(argumentsList, format);
NSString* nextArgument;
NSMutableArray* argumentsArray = [NSMutableArray array];
while((nextArgument = va_arg(argumentsList, NSString*)))
{
[argumentsArray addObject: [plistData objectForKey:nextArgument]];
}
NSRange myRange = NSMakeRange(0, [argumentsArray count]);
id* fakeArgList = (__bridge id *)malloc(sizeof(NSString *) * [argumentsArray count]);
[argumentsArray getObjects:fakeArgList range:myRange];
NSString * content = [[NSString alloc] initWithFormat:formatString
arguments:(__bridge va_list)fakeArgList];
free(fakeArgList);
return content;
}
</code></pre>
| 0non-cybersec
| Stackexchange | 788 | 2,763 |
Biochemistry Problem:Calculating the virtual volume/diameter of a protein from the peptide sequence. I am given a problem to calclute the virtual volume/diamater of the GFP protein found in Pacific Northwest Jellyfish. My experience with the problem so far has been to visualize it in Jmol and I have also determined it encompasses eleven beta sheets with a single alpha helix. Now I am confused on how to measure the distance from one of the beta strands to the other. Using first principles and the van der waals radius of the side chain groups I can estimate the volume of any position in the protein.
Can any biochemistry guy help me understand a good model for how to approach any problem like this? | 0non-cybersec
| Reddit | 150 | 705 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
Unable to sudo apt upgrade properly on Ubuntu-Budgie facing isuses with Python-Samba upgrade. <p>Hi I am new to Ubuntu and I am loving it already. I had just checked for update on Ubuntu-Budgie (Ubuntu 18.04.4 LTS) and during update I had encountered with the following error.</p>
<p>Here is the scneraio, I tried this command - <code>sudo apt upgrade</code> and I get the following output <br></p>
<blockquote>
<pre><code>Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
python-samba
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/1,919 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 365163 files and directories currently installed.)
Preparing to unpack .../python-samba_2%3a4.7.6+dfsg~ubuntu-0ubuntu2.16_amd64.deb ...
/var/lib/dpkg/info/python-samba.prerm: 6: /var/lib/dpkg/info/python-samba.prerm: pyclean: not found
dpkg: warning: old python-samba package pre-removal script subprocess returned error exit status 127
dpkg: trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: pyclean: not found
dpkg: error processing archive /var/cache/apt/archives/python-samba_2%3a4.7.6+dfsg~ubuntu-0ubuntu2.16_amd64.deb (--unpack):
new python-samba package pre-removal script subprocess returned error exit status 127
/var/lib/dpkg/info/python-samba.postinst: 6: /var/lib/dpkg/info/python-samba.postinst: pycompile: not found
dpkg: error while cleaning up:
installed python-samba package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
/var/cache/apt/archives/python-samba_2%3a4.7.6+dfsg~ubuntu-0ubuntu2.16_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
</code></pre>
</blockquote>
<p>I tried the following commands in addition to fix this based on google search <br></p>
<pre><code>sudo apt autoremove
sudo apt clean
sudo apt autoclean
sudo apt remove python-samba
sudo apt install --reinstall python-samba
sudo dpkg --configure -a
sudo apt --fix-broken install
</code></pre>
<p>But my bad nothing worked still I get the same output could you please help me in understanding and fixing the issue. Thanks.</p>
<h1>UPDATE 1</h1>
<p>As per the comments tried this command - <code>sudo apt install python-minimal</code> and I got the below errors</p>
<pre><code>Reading package lists... Done
Building dependency tree
Reading state information... Done
python-minimal is already the newest version (2.7.15~rc1-1).
python-minimal set to manually installed.
Suggested packages:
python-gpgme
The following packages will be upgraded:
python-samba
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/1,919 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 365163 files and directories currently installed.)
Preparing to unpack .../python-samba_2%3a4.7.6+dfsg~ubuntu-0ubuntu2.16_amd64.deb ...
/var/lib/dpkg/info/python-samba.prerm: 6: /var/lib/dpkg/info/python-samba.prerm: pyclean: not found
dpkg: warning: old python-samba package pre-removal script subprocess returned error exit status 127
dpkg: trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: pyclean: not found
dpkg: error processing archive /var/cache/apt/archives/python-samba_2%3a4.7.6+dfsg~ubuntu-0ubuntu2.16_amd64.deb (--unpack):
new python-samba package pre-removal script subprocess returned error exit status 127
/var/lib/dpkg/info/python-samba.postinst: 6: /var/lib/dpkg/info/python-samba.postinst: pycompile: not found
dpkg: error while cleaning up:
installed python-samba package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
/var/cache/apt/archives/python-samba_2%3a4.7.6+dfsg~ubuntu-0ubuntu2.16_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
</code></pre>
<h1>UPDATE 2 and SOLUTION</h1>
<p>I tried the following commands and it worked for me based on provided solution.</p>
<pre><code>sudo apt-get -m --reinstall install python python-minimal dh-python
sudo apt-get -f install
sudo apt install --reinstall python-minimal
</code></pre>
| 0non-cybersec
| Stackexchange | 1,395 | 4,473 |
Rails 5 default_url_options oddities. <p>I have a pretty simple rails app that I'm working on upgrading from Rails 4 to Rails 5, but I'm noticing some weirdness with <code>default_url_options</code></p>
<p>In <code>config/environments/test.rb</code> I have:</p>
<pre><code>Rails.application.routes.default_url_options[:host]= ENV["HTTP_HOST"] || "localhost"
Rails.application.routes.default_url_options[:port]= ENV["PORT"] || 3000
</code></pre>
<p>My application has a namespace called <code>api</code>. In my request specs, I'm seeing this:</p>
<pre><code>[1] pry> api_v3_sample_url
=> "http://www.example.com:3000/api/v3/sample"
[2] pry> Rails.application.routes.url_helpers.api_v3_sample_url
=> "http://localhost:3000/api/v3/sample"
</code></pre>
<p>What am I missing that is causing those URLs to be different?</p>
<p><strong>EDIT</strong></p>
<p>Per <a href="https://github.com/rspec/rspec-rails/issues/1275#issuecomment-69807351" rel="noreferrer">this thread</a> I set </p>
<pre><code>config.action_controller.default_url_options = {
host: ENV['HTTP_HOST'] || 'localhost'
}
</code></pre>
<p>in <code>config/environments/test.rb</code> but now I get this:</p>
<pre><code>> Rails.application.routes.url_helpers.api_v3_sample_url
ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
> api_v3_sample_url
=> "http://www.example.com/api/v3/sample"
</code></pre>
<p><strong>EDIT 2</strong></p>
<p>Probably worth noting that these are request specs and not feature specs (not using capybara).</p>
| 0non-cybersec
| Stackexchange | 573 | 1,611 |
40lbs down in 2 1/2 months - Before/After pics. Warning: MOOBS. Sorry, I couldn't figure out paragraphs. 24 years old. 5"9. 228 lbs - 188 lbs. First new years resolution that I've actually stuck to. I entered into a weight loss pact with some mutual fatties and I think that's what gave me the extra boost. I'm currently winning! My diet consists of a piece of fruit for breakfast, a small tin of sardines in tomato sauce (drained) on two pieces of toast and a small helping of kimchi for lunch, and stir fry or a smoothie for dinner. I live in China where not much food has nutritional info on the label so I couldn't calorie count for the most part. Exercise consists of me running up and down the stairs of my apartment complex for 30 mins and 20-30 minutes on a rowing machine five times a week. I've had 18 cheat days so far, ranging from getting totally wasted to simply adding another portion of food in a day. On the whole, I don't think it's affected my weight loss as much as I thought it would. My current goal weight is 160 lbs. Before/After pics: http://i.imgur.com/H7Ir1.jpg
| 0non-cybersec
| Reddit | 272 | 1,090 |
How do I add information to an exception message in Ruby?. <p>How do I add information to an exception message without changing its class in ruby?</p>
<p>The approach I'm currently using is</p>
<pre><code>strings.each_with_index do |string, i|
begin
do_risky_operation(string)
rescue
raise $!.class, "Problem with string number #{i}: #{$!}"
end
end
</code></pre>
<p>Ideally, I would also like to preserve the backtrace.</p>
<p>Is there a better way?</p>
| 0non-cybersec
| Stackexchange | 154 | 472 |
Network applications with high % of system time. <p>I have an Windows 2003 (don't laugh) server with 10GbE connectivity processing data coming to it over the network and sending it back out.</p>
<p>Here's the graph of overall system performance and the particular application being examined:</p>
<p><img src="https://i.stack.imgur.com/BbxFt.png" alt="sexy graph 1">
<img src="https://i.stack.imgur.com/tCbKl.png" alt="sexy graph 2"></p>
<p>The second graph is zoomed into the momentary spike and is relevant to the data in my answer.</p>
<p>How should I interpret the high percentage of kernel time on these processes? Overall, they're doing a lot of network I/O (66K PPS in, 96K PPS out) and I'm wondering if the correct interpretation is that the time spent in privileged space is copying the data back and forth between buffers and application memory. Would that make sense?</p>
| 0non-cybersec
| Stackexchange | 242 | 886 |
How can I post to Twitter an URL to a Tumblr-hosted page without Twitter changing the link to point to the Tumblr app on mobile?. <p>I'm trying to publish a Twitter post that includes the URL of a page hosted on the Tumblr platform. Something like this:</p>
<blockquote>
<p>[My custom text here] <a href="https://plaintextoffenders.com/faq/devs" rel="nofollow noreferrer">https://plaintextoffenders.com/faq/devs</a></p>
</blockquote>
<p>(That plaintextoffenders.com page is hosted on Tumblr.)</p>
<p>Once the Twitter post is published, the link to the Tumblr-hosted page works fine when viewed on my computer's Twitter.com web client. </p>
<p>However, when viewed on the Twitter native app for iPhone, the link instead points at the Tumblr app on the App Store. There's no way for a viewer to bypass that, and just view the linked article.</p>
<p>The article does display fine -- without the App Store redirect -- when the article URL is entered directly into Safari on iPhone. So it's evidently Twitter that is changing the link to Tumblr on the app store, and not a redirect on the Tumblr-hosted site itself.</p>
<p>I tried setting up a redirect to my target article using the tinyurl.com URL shortener, but Twitter still changed the link to point at the Tumblr app on the App Store when viewed on the Twitter iPhone client.</p>
<p>Is there a way to compose my Twitter post such that the link works as expected when followed by a client reading the post on Twitter's native iPhone app?</p>
| 0non-cybersec
| Stackexchange | 400 | 1,501 |
Allow users to access only a few websites. <p>I want to block my network users to access most of the external websites. Some users may need access to Facebook (like the users from marketing department), while others may need access to banks websites.</p>
<p>What I want to do is to control the access of these users, allowing them to access only the necessary websites.</p>
<p>To do that, I've been thinking about using a Captive Portal to control authentication (so I'll know 'who' is requesting the website). Also, I'll need a proxy to deny access to the blocked websites.</p>
<p>Doing some research I've not found any single software capable of doing both tasks. I tried PacketFence and Squid. The first handled very well the authentication steps. The other, the URL blocking. But could not make both talk nor do the desired job.</p>
<p>Anyone have ever implemented something like this? Is it possible with any of these softwares?</p>
<p><strong>EDIT:</strong></p>
<p>It is very important that the users are authenticated against an Active Directory server.</p>
| 0non-cybersec
| Stackexchange | 262 | 1,071 |
Joomla 3.2.2 - frontend connection problems, backend working perfect. <p>First of all, I'd like to say hello to everybody in this great community :) Countless times before, I was able to find my way out of a problem thanks to you. But now, I can't find any similar topic to my problem.</p>
<p>It started 5 days ago with frontend errors - Internal 500 or connection was reset. Every time after very long waiting. I thought that it's some problem on the provider side, they checked, said everything was fine, they checked two times. The second time they suggested I clean my browser cache. I did, and my site worked great. For a minute. It allowed one or two clicks in articles and... again, same old story. Then, it became even worse - even after cleaning the browser cache, I have problems to launch the frontend. Backend works perfect, I can edit, save and so on every article, module, and so on. When frontend finally manages to open, it reflects changes. So... it's very strange to me.</p>
<p>That was the situation till two days ago, when things got a bit better. </p>
<p>Now - no 500 internals or "connection was reset" during loading. Presently it looks like that : there is longer than average "awaiting for connection" time, and when finally download starts, it's very fast. Sometimes this waiting is 5, sometimes 10 seconds, which is way too long. I tried disabling modules, compressing js & css, but nothing helped to come to real awaiting time which is normally below 1s on other sites.</p>
<p>Hosting keeps claiming that it's not their fault, and suggested it's some module or extension causing problems, but as I said, I tried disabling every module one by one, with no result.</p>
<p>Did anybody encounter something like that?</p>
<p>By the way, other websites on same hosting and same Joomla version work just fine. Template? For the first two days it was ok, so it's not template either. I tried to change options of SEF links, url rewriting - nothing. It's driving me mad.</p>
<p>Additionaly, I created an account on Pingdom, and they show that my page loads worse than 70-80% of other websites. I also set checking each minute and letting me know via sms (it's free up to 20 smses) if the site is offline more than 5 minutes in a row - and I get one-two such smses daily.</p>
<p>Thank you in advance for your imput, maybe somebody has to look at this with a clear head.</p>
<p>Joomla version is 3.2.2</p>
<p>Cheers and thank you in advance,</p>
<p>Artur</p>
| 0non-cybersec
| Stackexchange | 648 | 2,491 |
Appropriate statistical test to test if probabilities are accurate. <p>I have some data that looks like this:</p>
<pre><code>Prob Outcome
0.09 0
0.10 0
0.10 0
0.11 1
0.84 1
0.99 1
0.86 1
0.78 1
0.86 1
0.00 0
etc.
</code></pre>
<p>i.e. a bunch a probabilities each with a single test. What statisitcal test should I use to test the hypothesis that the probabilities are correct?</p>
<p><strong>Further details</strong>: The data points are <em>combat probabilities</em> from the game Civilization IV, and I have over 3000 of them in my set. Thus, each probaility is generated using some unknown formula from different input data, depending on the relative strengths of the units in that battle.</p>
<p>It has been suggested that the outcomes do not accurately reflect the probabilities given: for instance, the computer player wins more often that it should, based on the probabilites displayed, which is what we want to test.</p>
<p>So there is a link insofar as we assume the probabilities displayed are generated using the same formula for each line. It's this unknown formula that we want to test for consistency with the actual results.</p>
| 0non-cybersec
| Stackexchange | 320 | 1,183 |
How to explicitly perform the circle eversion in the $3$-dimensional space?. <p>The following claim is a well-known consequence of the <a href="http://mathworld.wolfram.com/Whitney-GrausteinTheorem.html" rel="nofollow noreferrer">Whitney-Graustein theorem</a>:</p>
<blockquote>
<p><strong>Claim.</strong> It does not exist $H\colon\mathbb{S}^1\times[0,1]\overset{C^1}{\rightarrow}\mathbb{R}^2$ such that for all $t\in [0,1]$, $H(\cdot,t)\colon\mathbb{S}^1\rightarrow\mathbb{R}^2$ is an immersion, $H(\cdot,0)=(\cos(2\pi\cdot),\sin(2\pi\cdot))$ and $H(\cdot,1)=(\cos(2\pi \cdot),-\sin(2\pi\cdot))$.</p>
</blockquote>
<p><a href="https://i.stack.imgur.com/XfPxS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XfPxS.png" alt="enter image description here"></a></p>
<p>In other words, it is impossible to perform a circle eversion in the plane, namely it is impossible to continuously and regularly change the orientation of the circle while sticking to the plane. </p>
<p>However, I want to illustrate that it is possible to realize the circle eversion in the $3$-dimensional space. </p>
<p>The idea is to thicken the circle into a cylinder, perform a $\pi$-twist on the cylinder in order to put its inside out and finally to retract the everted cylinder onto its equatorial circle.</p>
<p>My main concern is to graphically represent the above process using a mathematical software, e.g. SageMath. I tried in vain to write down explicit formulas for it and here I am stuck. Please note that the following homotopy did not seem to do any good:</p>
<p>$$\forall x\in\mathbb{S}^1\times [-1,1],\forall t\in [0,1],H(x,t)=\frac{x}{\|x\|^{2t}}.$$</p>
<p>Any enlightenment will be greatly appreciated!</p>
| 0non-cybersec
| Stackexchange | 557 | 1,725 |
Hey MFA, I have a very specific question in regards to jeans and the versatility of certain washes as opposed to others. Care to help me out? . Alright so the Brand that I have been buying form in the last few years is Naked and Famous and I'm looking to get 2 new pairs before I head off for school in the fall.
I want to get a dark of jeans, which is better/more versatile
1. http://www.nakedandfamousdenim.com/collection/men/weirdguy/solid-black-selvedge.html
2. http://www.nakedandfamousdenim.com/collection/men/weirdguy/black-selvedge.html
And now I'm looking to get a pair of Indigo jeans which between these two are best?
1. http://www.nakedandfamousdenim.com/collection/men/weirdguy/indigo-selvedge.html
2. http://www.nakedandfamousdenim.com/collection/men/weirdguy/natural-indigo-organic-selvedge.html
I know the second pair of Indigo's is darker slightly and people seem to prefer that around here. Although, I felt as that the light brown stitching on the back of the second pair would stand out, this would in turn cause a lack in versatility with certain colors.
Question : I'd prefer non-raw if possible does anyone know if the first solid black pair I linked are. I could not find that info.
And finally these are boots I own. I will be attempting choose my denim according to the colors of each boot and hopefully some great input from you guys!
Pair #1 : http://www.redwingheritage.com/boots#&f=&m=/detail/8111-heritage-us/8111-red-wing-lifestyle-mens-iron-ranger-boot-amber
Pair #2 http://www.redwingheritage.com/boots#&f=&m=/detail/9014-heritage-us/9014-red-wing-lifestyle-mens-beckman-boot-black.
Hopefully with this info I can make my decision, THANK YOU MFA! | 0non-cybersec
| Reddit | 506 | 1,690 |
Postfix: User unknown in virtual alias table. <p>For some reason when I send an email from my self-hosted postfix server, it works, but can't receive due to this:</p>
<pre><code>Nov 3 18:30:06 pi postfix/qmgr[31993]: CB178142FAB: from=<[email protected]>, size=738, nrcpt=1 (queue active)
Nov 3 18:30:06 pi postfix/error[1173]: CB178142FAB: to=<[email protected]>, orig_to=<megver83>, relay=none, delay=4.7, delays=4.7/0/0/0.01, dsn=5.1.1, status=bounced (User unknown in virtual alias table)
Nov 3 18:30:06 pi postfix/error[1232]: D3CEC142FAD: to=<[email protected]>, relay=none, delay=0.03, delays=0.01/0.01/0/0.01, dsn=5.1.1, status=bounced (User unknown in virtual alias table)
Nov 3 18:30:07 pi postfix/qmgr[31993]: 0E1AC142FAB: from=<[email protected]>, size=734, nrcpt=1 (queue active)
Nov 3 18:30:07 pi postfix/error[1173]: 0E1AC142FAB: to=<[email protected]>, orig_to=<megver83>, relay=none, delay=4.9, delays=4.8/0/0/0.01, dsn=5.1.1, status=bounced (User unknown in virtual alias table)
Nov 3 18:30:07 pi postfix/error[1232]: 1685A142FAD: to=<[email protected]>, relay=none, delay=0.03, delays=0.02/0/0/0.01, dsn=5.1.1, status=bounced (User unknown in virtual alias table)
Nov 3 18:34:37 pi postfix/error[1292]: BC405142FAB: to=<[email protected]>, relay=none, delay=0.28, delays=0.27/0/0/0.01, dsn=5.1.1, status=bounced (User unknown in virtual alias table)
Nov 3 19:11:39 pi postfix/qmgr[31993]: EDC14142FAB: from=<[email protected]>, size=1238, nrcpt=1 (queue active)
Nov 3 19:11:43 pi postfix/smtp[2064]: 3D67B142FAD: to=<[email protected]>, relay=spool.mail.gandi.net[217.70.184.6]:25, delay=3.8, delays=0.02/0.1/3.5/0.27, dsn=5.7.1, status=bounced (host spool.mail.gandi.net[217.70.184.6] said: 554 5.7.1 Service unavailable; Client host [190.100.12.50] blocked using pbl.spamhaus.org; https://www.spamhaus.org/query/ip/190.100.12.50 (in reply to RCPT TO command))
Nov 3 19:13:02 pi postfix/qmgr[31993]: 899D4142FAB: from=<[email protected]>, size=1256, nrcpt=1 (queue active)
Nov 3 19:13:02 pi postfix/error[1958]: 899D4142FAB: to=<[email protected]>, relay=none, delay=0.26, delays=0.25/0/0/0.01, dsn=5.1.1, status=bounced (User unknown in virtual alias table)
Nov 3 19:13:05 pi postfix/smtp[2064]: CA3A8142FAD: to=<[email protected]>, relay=spool.mail.gandi.net[217.70.184.6]:25, delay=2.3, delays=0.02/0/2.1/0.25, dsn=5.7.1, status=bounced (host spool.mail.gandi.net[217.70.184.6] said: 554 5.7.1 Service unavailable; Client host [190.100.12.50] blocked using pbl.spamhaus.org; https://www.spamhaus.org/query/ip/190.100.12.50 (in reply to RCPT TO command))
</code></pre>
<p>I'm trying to send a mail from [email protected] to [email protected], but doesn't work. However, as I said, it works the other way around. This is my <code>postconf -n</code></p>
<pre><code>alias_database = $alias_maps
alias_maps = hash:/etc/postfix/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
command_directory = /usr/bin
compatibility_level = 2
daemon_directory = /usr/lib/postfix/bin
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
mail_owner = postfix
mailbox_size_limit = 134217728
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
message_size_limit = 134217728
meta_directory = /etc/postfix
mydomain = megver83.ga
myhostname = pi.megver83.ga
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix
relay_domains = *
relayhost =
sample_directory = /etc/postfix
sendmail_path = /usr/bin/sendmail
setgid_group = postdrop
shlib_directory = /usr/lib/postfix
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtpd_helo_required = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/letsencrypt/live/megver83.ga/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/megver83.ga/privkey.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
unknown_local_recipient_reject_code = 550
virtual_alias_domains = megver83.ga, eumela.ga, heckyel.ga
virtual_alias_maps = hash:/etc/postfix/virtual
</code></pre>
<p>/etc/postfix/virtual:</p>
<pre><code>megver83.ga megver83.ga
[email protected] megver83
</code></pre>
| 0non-cybersec
| Stackexchange | 1,955 | 4,701 |
[UK] Looking for certification advice.. Hi guys,
I trust you all had a great holiday? :)
I'm sad to say that I wasn't accepted to the SANS CyberAcademy as I mentioned in a previous thread I created; no clue why, but should be receiving more information from SANS by the end of Jan.
Due to not having been accepted, and also having received a great salary increase, I've decided on a New Years Resolution: to get either a OSCP cert and/or a few Cisco certifications.
That brings me to my question(s); if I want to get into penetration testing it would seem as the OSCP cert (PWK) is the one held in highest esteem, but what about the CREST (I live in the UK) certifications? I see a lot of job listings referencing them, but are they worth the paper they are written on compared to an OSCP cert?
Also, I'd love to have any more hands-on thoughts / experiences with the difference between Cisco and the equivalent CompTIA certs?
At a glance they seem very similar (albeit CompTIA being more overall tech-y), but CompTIA being slightly cheaper? | 1cybersec
| Reddit | 287 | 1,086 |
How to use a CFG to restrict a subset of a*b*c*d* so that there are at most as many a's and b's as d's?. <blockquote>
<p>Give Context-free Grammar for the language $\{a^i b^j c^k d^h \mid i,j,h \ge 0, k>0, i+j \le h\}$</p>
</blockquote>
<p>This is a training exercise, for which we don't get any answers, in a course I'm taking. I have found similar examples, but nothing that touches on the <code>i+j≤h</code> part of this. My biggest trouble is that it is ordered, so I have no idea how to add <strong><em>d</em></strong>'s to the end when I add <strong><em>a</em></strong>'s or <strong><em>b</em></strong>'s to the front. I haven't gotten very far because of this, but my thinking looks like this at the moment:</p>
<pre><code>S→ABcCD
A→aA | ϵ
B→bB | ϵ
C→cC | ϵ
D→dD | ϵ
</code></pre>
<p>I can't put things like <code>A→aAd</code> or <code>A→aBCD</code> because that would result in <strong><em>c</em></strong>'s and <strong><em>d</em></strong>'s before <strong><em>b</em></strong>'s in the end word/string. My conclusion is that I am probably on the wrong track, but all examples I find use some sort of partitioning like this.</p>
<p>So could anyone point me in the right direction?</p>
| 0non-cybersec
| Stackexchange | 433 | 1,213 |
Josephson junction with circuitikz. <p>I would like to draw a Josephson junction which looks like this:</p>
<p><a href="https://i.stack.imgur.com/oL8Su.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oL8Su.png" alt="enter image description here"></a></p>
<p>and make circuit with <code>circuitikz</code> in latex.</p>
<p>Is it possible to define it as an element of a circuit and use it like a <code>node</code>?</p>
| 0non-cybersec
| Stackexchange | 150 | 439 |
I am unable to mentally enjoy sex due to my penis size. Help?. Throwaway obviously, but I'm having some issues.
I've been single for a long while and my sex life has mainly consisted of one-night stands or brief hook-up buddy situations for the past two years. I'm confident about my ability to get girls in bed. I consider myself pretty good looking and socially fluid. I play the part of being a confident guy on the outside.
But once things get back to the bedroom, I start having issues. Last time I measured my penis is about 4.8 inches length, ~4.2 inches circumference. I know it's on the small side, and I've read all the advice articles about how size doesn't really matter, etc. etc. so we don't need to rehash that. I've asked all my female friends where they rank size, stamina and technique and they usually put technique and stamina at the top. But I still can't get over the smallness.
Basically, I can't enjoy sex because I don't believe the girl is enjoying it and I'm just thinking the whole time how she's probably really disappointed about the whole thing. I haven't really had a scarring incident, I've never been laughed out of a bedroom. My first girlfriend noted that it was on the small side, but she liked it. But I don't believe her or any women that say size don't matter. I mean I believe there exist means to compensate for it, but I think women would prefer a certain bigger size if they had a choice. Girls who are quiet in bed make me really nervous because I don't think they like it, and girls who are really loud in bed freak me out because I'm convinced they're just faking it.
And once in a while I'll have a female friend say something like, "I hooked up with this guy and he was _huge,_ it was incredible." or something like "Nothing more disappointing than a hot guy with a small penis," and I try my best to ignore it, but it seems like they're just telling me technique is the most important because they sense I have a lot of insecurities about it or that size really is all that matters.
So I haven't enjoyed sex very much. I just find it mentally exhausting because the whole time I'm worried about how long I'm lasting, if she's enjoying it, if she's disappointed, if she's going to blab to her friends about it. I'm just paranoid the whole time and feel like I'm acting out something I should be doing and not really just enjoying the act of it and just being with a woman.
*tl;dr: My smaller-than-average penis size is making me incredibly insecure to the point I can no longer enjoy sex because I spend the whole time fretting about whether or not the girl is enjoying it.*
Help please :( | 0non-cybersec
| Reddit | 627 | 2,659 |
What do Flags and Reqs mean in uTorrent?. <p>I'm seeding a torrent file in uTorrent, and under <strong>Peers</strong> tab it shows the following statistics:</p>
<p><img src="https://i.stack.imgur.com/PQrlK.png" alt="01">
<img src="https://i.stack.imgur.com/umFOQ.png" alt="02"></p>
<p>What do those <strong>Flags</strong> (some combinations of upper and lower case letters like u, h, i, x, e, p) mean? Secondly, what does <strong>Reqs</strong> (0|5, 0|7, 0|11, etc.) mean? It's not visible for every peer and its value changes every second.</p>
| 0non-cybersec
| Stackexchange | 189 | 547 |
Why is the Git .git/objects/ folder subdivided in many SHA-prefix folders?. <p>Git internally stores objects (Blobs, trees) in the <code>.git/objects/</code> folder. Each object can be referenced by a SHA1 hash that is computed from the contents of the object.</p>
<p>However, Objects are not stored inside the <code>.git/objects/</code> folder directly. Instead, each object is stored inside a folder that starts with the prefix of its SHA1 hash. So an object with the hash <code>b7e23ec29af22b0b4e41da31e868d57226121c84</code> would be stored at <code>.git/objects/b7/e23ec29af22b0b4e41da31e868d57226121c84</code></p>
<p>Why does Git subdivide its object storage this way?</p>
<p>The resources I could find, such as <a href="http://git-scm.com/book/en/v2/Git-Internals-Git-Objects">the page on Git's internals</a> on git-scm, only only explained <em>how</em>, not <em>why</em>.</p>
| 0non-cybersec
| Stackexchange | 294 | 887 |
How do you stick to your diet when cutting after a long day of working?. Recently, I got hired at the amazon fulfillment center in delaware and I love it here! but the only bad thing about it is that after im done working for the day, I am so tired and hungry that I gorge myself on whatever food is available. I try so hard not to gorge myself but this job just leaves me so hungry, especially on days when I go to the gym. currently Im at 225 pounds but need to lose more but eating only 1500 calories a day while working here is pretty hard. I dont know if the answer is right in front of my face or if someone can help me, I just really need some advice on how to stay withing my calorie range with these bad cravings.
Edit: Thanks everyone! | 0non-cybersec
| Reddit | 173 | 749 |
Why does click package validation fail?. <p>I'm trying to publish an app for Ubuntu touch, but I can't get past the validation phase.
I'm using Ubuntu SDK. The current build configuration is for device (armhf). I was able to run the app on the device. From the "Publish" tab, I clicked "Build and validate click package", and I got 11 "Error" nodes, with no further information.
<a href="https://i.stack.imgur.com/iaOdO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iaOdO.png" alt="enter image description here"></a></p>
<p>The same if I select "Validate existing click package" and choose my click file from the build directory.</p>
<p>I did expand the "Log" node, but there's just a huge JSON with nothing suspect inside (not that I understand much of its content).</p>
<p>How could I find out what's wrong?</p>
<hr>
<p>Edit: On a closer look, I found this error in the <a href="http://pastebin.ubuntu.com/12018607/" rel="nofollow noreferrer">log</a>:</p>
<pre><code>"error": {
"security_policy_version_matches_framework (Trolly.apparmor)": {
"manual_review": false,
"text": "Invalid framework 'ubuntu-sdk-15.04-html'"
}
}
</code></pre>
<p>My <code>apparmor</code> file contains:</p>
<pre><code>{
"policy_groups": [
"networking",
"webview"
],
"policy_version": 1.3
}
</code></pre>
| 0non-cybersec
| Stackexchange | 436 | 1,352 |
How do I map a property with no setter and no backing property fluently with NHibernate?. <p>Let's say I have the following entity:</p>
<pre><code>public class CalculationInfo
{
public virtual Int64 Id { get; set; }
public virtual decimal Amount { get; set; }
public virtual decimal SomeVariable { get; set; }
public virtual decimal SomeOtherVariable { get; set; }
public virtual decimal CalculatedAmount
{
get
{
decimal result;
// do crazy stuff with Amount, SomeVariable and SomeOtherVariable
return result;
}
}
}
</code></pre>
<p>Basically <strong>I want to read and write all of the fields to my database with NHibernate with the exception of <code>CalculatedAmount</code></strong>, which I simply want to write and not read back in.</p>
<p>Every similar issue and corresponding answer has dealt with specifying a backing store for the value, which I won't have in this scenario.</p>
<p>How can I accomplish this using Fluent NHibernate?</p>
<p>Thanks!</p>
<p><strong>UPDATE:</strong> Here's what I've tried, and the error it leads to:</p>
<p>Here's my mapping for the property...</p>
<pre><code>Map(x => x.CalculatedAmount)
.ReadOnly();
</code></pre>
<p>And the exception it yields...</p>
<p><em>Could not find a setter for property 'CalculatedAmount' in class 'xxx.CalculationInfo'</em></p>
| 0non-cybersec
| Stackexchange | 401 | 1,412 |
Finding degree of the extension. <p>Is it true that the degree of extension $\mathbb Q(\sqrt {2},\sqrt {3},\sqrt {5},\dotsc,\sqrt {p_n}) / \mathbb Q$ is $2^n$ where $p_n$ is the $n$th prime number. If so, how to prove this? My idea is to consider the chain of extensions $\mathbb Q\subset \mathbb Q(\sqrt{2}) \subset \mathbb Q(\sqrt{2},\sqrt{3}) \subset \dotsb \subset \mathbb Q(\sqrt {2},\sqrt {3},\sqrt {5},...,\sqrt {p_n})$ and using transitivity. I am having problems in finding degrees of intermediate extensions. Please help me.</p>
| 0non-cybersec
| Stackexchange | 168 | 539 |
Name of the following summation: $\sum_{a=b}^{\infty}{\binom{a-1}{b-1}x^{a-b}}=(1-x)^{-b}$. <p>I was proofing a formula when I meet a summation that I culdn't solve.
After some efforts and investigations I've successfully recognized it in its generalized formula:
$$\sum_{a=b}^{\infty}{\binom{a-1}{b-1}x^{a-b}}=(1-x)^{-b}$$
that I saw online in a list of knowed series.</p>
<p>I've searched for a long time now, but I can't find information about it, even it's name, can you help me please?</p>
<p>I would like to prove it.</p>
| 0non-cybersec
| Stackexchange | 177 | 531 |
Use find to find a directory and move it to a different path. <p>I have hundreds of thousands of files in hundreds of directories.</p>
<p>An example directory structure is</p>
<pre><code>./main/foo1/bar/*
./main/foo2/bar/*
./main/foo3/bar/*
./main/foo1/ran/*
./main/foo2/ran/*
</code></pre>
<p>For folders that have 'bar' directories, I want to move contents to following structure.</p>
<pre><code>./secondary/bar/foo1/*
./secondary/bar/foo2/*
./secondary/bar/foo3/*
</code></pre>
<p>Can this be accomplished using find and mv?</p>
| 0non-cybersec
| Stackexchange | 186 | 537 |
Prove that $f\in L^1(A)\Leftrightarrow \sum_{n}^{\infty}m(\{ x\in A : f(x)\geq n \}) < \infty$. <p>I'm stuck with some problem of my Integral Calculation in Several Variables course. The problem goes like this:</p>
<blockquote>
<p>Let <span class="math-container">$A\subset \mathbb{R}$</span> be a measurable set with <span class="math-container">$m(A)<\infty$</span>, and <span class="math-container">$f:A\longrightarrow [0,\infty)$</span> a Lebesgue-measurable function. Prove that:
<span class="math-container">$$f\in L^1(A)\Longleftrightarrow \sum_{n}^{\infty}m(\{ x\in A : f(x)\geq n \}) < \infty.$$</span></p>
</blockquote>
<p>The notation I used is:</p>
<ul>
<li><span class="math-container">$m$</span> as the Lebesgue measure function</li>
<li><span class="math-container">$L^1(A)=\{ f:A\rightarrow \mathbb{\overline{R}} : \int_{A}|f|\,\mathrm{d}m<+\infty \}$</span></li>
</ul>
<p>I've started defining the set <span class="math-container">$A=f^{-1}([0,\infty))$</span> as a numerable sum of disjoint measurable sets (because it's said it's measurable) <span class="math-container">$\sum^{\infty}_{k=0}\cup I_k$</span>, being each <span class="math-container">$I_k$</span> the real interval <span class="math-container">$[k,k+1)$</span>. I imagine I should come to some conclusion like that any unbounded (upper bound) sets of <span class="math-container">$f(x)$</span> with <span class="math-container">$(x\in A)$</span> have measure <span class="math-container">$0$</span>.</p>
| 0non-cybersec
| Stackexchange | 522 | 1,508 |
Why kernel modesetting, instead of privilege separation?. <p>Kernel modesetting was kind of painful to get on Linux at first, but now it's pretty awesome to have. I mean, X not need to run as root? High-res hardware accelerated consoles? Cool stuff.</p>
<p>Problem is, a lot of UNIX platforms don't have modesetting kernel drivers of any sort. So hardware that relies on KMS is now mostly limited to Linux.</p>
<p>My question: why actually implement this in the kernel?</p>
<p>If hardware access is needed to set the screen resolution, why not use a separate privileged daemon, or a small setuid binary? That would maintain the advantage of separating out the privileged code, and letting the display server run as limited user; while getting rid of the special driver requirement, and making cross-UNIX support easier. Right? Or am I missing something significant here?</p>
| 0non-cybersec
| Stackexchange | 207 | 878 |
understanding of hash code. <p>hash function is important in implementing hash table. I know that in java
Object has its hash code, which might be generated from weak hash function.</p>
<p>Following is one snippet that is "supplement hash function"</p>
<pre><code>static int hash(Object x) {
int h = x.hashCode();
h += ~(h << 9);
h ^= (h >>> 14);
h += (h << 4);
h ^= (h >>> 10);
return h;
}
</code></pre>
<p>Can anybody help to explain what is the fundamental idea of a hash algorithm
? to generate non-duplicate integer? If so, how does these bitwise
operations make it?</p>
| 0non-cybersec
| Stackexchange | 208 | 637 |
Squid proxy between two firewalls, need iptables solution. <p>At the company I work for we need to implement what I think it's called transparent proxy.</p>
<p>How it's now:</p>
<p>A(lower secured area)--Cisco ASA-----Cisco ASA----B(higher secured area)</p>
<p>What we need:</p>
<p>A(lower secured area)--Cisco ASA---(eth0)Proxy(eth1)---Cisco ASA----B(higher secured area)</p>
<p>We've already set up an alpine linux with squid proxy, added two interfaces for both sides towards the firewalls but hit a wall with the iptables configuration.</p>
<p>The proxy just needs to log traffic and pass through everything, without change to packets on src/dst. We don't need any kind of filtering or blocking, all 1-65535 ports can be allowed.</p>
<p>Read about TPROXY, but couldn't find a good example to try.</p>
<p>I know that there are other design options for an implementations like this, but this is how it must be done.</p>
| 0non-cybersec
| Stackexchange | 277 | 930 |
List service as failing only after a certain duration. <p>My Debian systems have <code>unattended-upgrades</code> installed, which installs security upgrades automatically, once per day. I also have a Nagios check that reports whether upgrades need to be installed.</p>
<p>In this setup, it is normal that this check can report a failing state, but not for longer than 24h. Can I configure Nagios to consider a service as “up” unless it has been failing for more than 24h?</p>
<p>(<code>retry_interval</code> only seems to affect when I get a notification, but I also don't want the front-end to be red during these expected failures.)</p>
| 0non-cybersec
| Stackexchange | 165 | 642 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
Partial upgrade - why remove MariaDB?. <p>My 12.04 system wants to run a partial upgrade, as part of which it proposes to remove certain MariaDB packages (see screenshot below). Attached is my <code>sources.list</code> file - I don't understand why the system should be proposing the removal of the MariaDB packages, given I have explicitly chosen MariaDB as a replacement for MySQL?</p>
<p><img src="https://i.stack.imgur.com/7D0p7.png" alt="enter image description here"></p>
<pre><code>clive@cooler-master:~$ cat /etc/apt/sources.list
# deb cdrom:[Ubuntu 12.04 LTS _Precise Pangolin_ - Release i386 (20120423)]/ precise main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://gb.archive.ubuntu.com/ubuntu/ precise main restricted
deb-src http://gb.archive.ubuntu.com/ubuntu/ precise main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://gb.archive.ubuntu.com/ubuntu/ precise-updates main restricted
deb-src http://gb.archive.ubuntu.com/ubuntu/ precise-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://gb.archive.ubuntu.com/ubuntu/ precise universe
deb-src http://gb.archive.ubuntu.com/ubuntu/ precise universe
deb http://gb.archive.ubuntu.com/ubuntu/ precise-updates universe
deb-src http://gb.archive.ubuntu.com/ubuntu/ precise-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://gb.archive.ubuntu.com/ubuntu/ precise multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ precise multiverse
deb http://gb.archive.ubuntu.com/ubuntu/ precise-updates multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ precise-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://gb.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu precise-security main restricted
deb-src http://security.ubuntu.com/ubuntu precise-security main restricted
deb http://security.ubuntu.com/ubuntu precise-security universe
deb-src http://security.ubuntu.com/ubuntu precise-security universe
deb http://security.ubuntu.com/ubuntu precise-security multiverse
deb-src http://security.ubuntu.com/ubuntu precise-security multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu precise partner
# deb-src http://archive.canonical.com/ubuntu precise partner
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu precise main
deb-src http://extras.ubuntu.com/ubuntu precise main
# MariaDB 5.5 repository list - created 2012-09-21 09:23 UTC
# http://downloads.mariadb.org/mariadb/repositories/
deb http://ftp.heanet.ie/mirrors/mariadb/repo/5.5/ubuntu precise main
deb-src http://ftp.heanet.ie/mirrors/mariadb/repo/5.5/ubuntu precise main
# deb http://repository.spotify.com stable non-free
deb http://deb.opera.com/opera/ stable non-free
deb http://ppa.launchpad.net/yorba/ppa/ubuntu precise main
deb-src http://ppa.launchpad.net/yorba/ppa/ubuntu precise main
</code></pre>
| 0non-cybersec
| Stackexchange | 1,137 | 4,171 |
Changing the rootViewController of a UIWindow. <p>When my app first loads, I set the <code>rootViewController</code> property of my <code>UIWindow</code> to <code>controllerA</code>. </p>
<p>Sometime during my app, I choose to change the <code>rootViewController</code> to <code>controllerB</code>.</p>
<p>The issue is that sometimes when I do a flip transition in <code>controllerB</code>, I see <code>controllerA</code>'s view behind it. For some reason that view isn't getting removed. Whats even more worrying is that after setting the <code>rootViewController</code> to <code>controllerB</code>, <code>controllerA</code>'s <code>dealloc</code> method never gets fired.</p>
<p>I've tried removing the subviews of <code>UIWindow</code> manually before switching to <code>controllerB</code>, that solves the issue of seeing <code>controllerA</code>'s views in the background but <code>controllerA</code>'s dealloc still never gets called. <strong>Whats going on here????</strong></p>
<p>Apples docs say:</p>
<blockquote>
<p>The root view controller provides the content view of the window. Assigning a view controller to this property (either programmatically or using Interface Builder) installs the view controller’s view as the content view of the window. If the window has an existing view hierarchy, the old views are removed before the new ones are installed.</p>
</blockquote>
<p><strong>UPDATE</strong></p>
<p>Here's the code of my AppDelegate:</p>
<pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[self showControllerA];
[self.window makeKeyAndVisible];
return YES;
}
- (void)showControllerA
{
ControllerA* a = [ControllerA new];
self.window.rootViewController = a;
}
- (void) showControllerB {
ControllerB* b = [ControllerB new];
self.window.rootViewController = b;
}
</code></pre>
| 0non-cybersec
| Stackexchange | 559 | 1,990 |
Martingale roulette system. <p>I'm making a roulette system simulator, specifically right now the Martingale roulette system. So what I do know about the system that there is an Anti-Martingale too, which is the same, but you have to double the bet at every win.
So let's only take a look at the red bets:</p>
<p>The function looks like this:</p>
<pre><code>public void Red(List<int> red, int random)
{
if (anti == false)
{
if (red.Contains(random)) // reds: 1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36
{
money -= currentPot;
money += currentPot * 2;
currentPot = startPot;
}
else // if it's black or null
{
money -= currentPot;
currentPot *= 2;
}
}
else // double at win
{
if(red.Contains(random))
{
money -= currentPot;
money += currentPot * 2;
currentPot *= 2;
}
else
{
money -= currentPot;
currentPot = startPot;
}
}
}
</code></pre>
<p>the anti variable holds if it's anti or normal martingale, random is the spinned number.</p>
<p>So I have an output file, after 10 spins it looks like this:</p>
<p>money, startPot, currentPot, spinnedNumber</p>
<p>900, 100, 100, -</p>
<p>800, 100, 200, BLACK</p>
<p>1000, 100, 100, RED</p>
<p>900, 100, 200, BLACK</p>
<p>700, 100, 400, BLACK</p>
<p>1100, 100, 100, RED</p>
<p>1000, 100, 200, BLACK</p>
<p>800, 100, 400, BLACK</p>
<p>1200, 100, 100, RED</p>
<p>1300, 100, 100, RED</p>
<p>1200, 100, 200, NULL</p>
<p>My question is: Does the Martingale system make always profit or there's something wrong with my code? I know every casino has an edge, but if there's no edge, it will always be profitable after a certain number of spins.</p>
| 0non-cybersec
| Stackexchange | 622 | 2,106 |
What would you want to see at the Museum of Mathematics?. <p><b>EDIT</b> (30 Nov 2012): MoMath is opening in a couple of weeks, so this seems like it might be a good time for any last-minute additions to this question before I vote to close my own question as "no longer relevant".</p>
<hr>
<p>As some of you may already know, there are plans in the making for a <a href="http://momath.org/">Museum of Mathematics</a> in New York City. Some of you may have already seen the <a href="http://mathmidway.org/">Math Midway</a>, a preview of the coming attractions at MoMath.</p>
<p>I've been involved in a small way, having an account at the <a href="http://mathfactory.org/tiki-index.php?page=Exhibit%20Plans">Math Factory</a> where I have made some suggestions for exhibits. It occurred to me that it would be a good idea to solicit exhibit ideas from a wider community of mathematicians.</p>
<blockquote>
<p>What would you like to see at MoMath?</p>
</blockquote>
<p>There are already a lot of suggestions at the above Math Factory site; however, you need an account to view the details. But never mind that; you should not hesitate to suggest something here even if you suspect that it has already been suggested by someone at the Math Factory, because part of the value of MO is that the voting system allows us to estimate the level of enthusiasm for various ideas.</p>
<p>Let me also mention that exhibit ideas showing the connections between mathematics and other fields are particularly welcome, particularly if the connection is not well-known or obvious.</p>
<hr>
<p>A couple of the answers are announcements which may be better seen if they are included in the question.</p>
<p>Maria Droujkova: We are going to host an open online event with Cindy Lawrence, one of the organizers of MoMath, in the <a href="http://mathfuture.wikispaces.com/events">Math Future series.</a> On January 12th 2011, at 9:30pm ET, follow <a href="http://tinyurl.com/math20event">this link</a> to join the live session using Elluminate. </p>
<p>George Hart: ...we at MoMath are looking for all kinds of input. If you’re at the Joint Math Meetings this week, come to our booth in the exhibit hall to meet us, learn more, and give us your ideas.</p>
| 0non-cybersec
| Stackexchange | 597 | 2,247 |
How to add a file to a docker container which has no root permissions?. <p>I'm trying to add a file to a Docker image built from the official <code>tomcat</code> image. That image does not seem to have root rights, as I'm logged in as user <code>tomcat</code> if I run bash:</p>
<pre><code>docker run -it tomcat /bin/bash
tomcat@06359f7cc4db:/usr/local/tomcat$
</code></pre>
<p>If I instruct a <code>Dockerfile</code> to copy a file to that container, the file has permissions <code>644</code> and the owner is <code>root</code>. As far as I understand, that seems to be reasonable as all commands in the Dockerfile are run as root. However, if I try to change ownership of that file to <code>tomcat:tomcat</code>, I get a <code>Operation not permitted</code> error.</p>
<p><strong><em>Why can't I change the permissions of a file copied to that image?</em></strong></p>
<p>How it can be reproduced:</p>
<pre><code>mkdir docker-addfilepermission
cd docker-addfilepermission
touch test.txt
echo 'FROM tomcat
COPY test.txt /usr/local/tomcat/webapps/
RUN chown tomcat:tomcat /usr/local/tomcat/webapps/test.txt' > Dockerfile
docker build .
</code></pre>
<p>The output of <code>docker build .</code>:</p>
<pre><code>Sending build context to Docker daemon 3.072 kB
Sending build context to Docker daemon
Step 0 : FROM tomcat
---> 44859847ef64
Step 1 : COPY test.txt /usr/local/tomcat/webapps/
---> Using cache
---> a2ccb92480a4
Step 2 : RUN chown tomcat:tomcat /usr/local/tomcat/webapps/test.txt
---> Running in 208e7ff0ec8f
chown: changing ownership of '/usr/local/tomcat/webapps/test.txt': Operation not permitted
2014/11/01 00:30:33 The command [/bin/sh -c chown tomcat:tomcat /usr/local/tomcat/webapps/test.txt] returned a non-zero code: 1
</code></pre>
| 0non-cybersec
| Stackexchange | 592 | 1,781 |
[Help] How can I install a ceiling fan light fixture in a regular ceiling light box?. Situation: I have a basement room that is a full 12x12 room, but only about half finished. I'm using the room as a studio/den, but lighting in there is pretty bad. Limited outlets to only two walls, only one tiny window so very little natural light. There is **a ceiling light fixture (standard light box) but it's not attached to any light switch**, so I have a really basic single bulb light with a pull chain installed there now [like this](https://images-na.ssl-images-amazon.com/images/I/31lfA27V9bL._SY300_.jpg). Thing is I really want more light in the room. Most of the light fixtures with a pull chain are at best two bulb, but I really want a 4 bulb solution. There are some excellent options for this designed for ceiling fans [like this one](https://hw.menardc.com/main/items/media/HUNTE001/ProductLarge/99094.jpg) that are really inexpensive, but they have a completely different mounting system than a regular light box allows. I think.
So can anyone offer some suggestions on getting a ceiling fan light kit to work in a regular light box? Is there a ready made product out there already? | 0non-cybersec
| Reddit | 290 | 1,190 |
How to specify bit/key size with gpg -c?. <p>I'm trying to specify the RSA key size when using <code>-c</code> with gpg or gpg2. Example:</p>
<pre><code>> gpg -c --armor --passphrase <password> --keysize 4096 file.txt
</code></pre>
<p>Is this possible? I couldn't find the command line flag in the gpg manpage. How many bits long is default when using <code>-c</code>?</p>
| 0non-cybersec
| Stackexchange | 132 | 384 |
MD5 Checksum and DLL injection. <p>I would like to know if it is possible that a file checksum or MD5 Checksum is an option for identifying malicious embedded code. As an example, I have a development environment and I want to prevent somebody or an internal threat from injecting malicious code or something into an external dll and using it with the original dll name. So an developer saying, can during development call an external malicious dll and use it as the same name as the original dll?</p>
<p>That way altering the application's behaviour. Making it difficult to find out. I have done some research but digital signatures may help fix but not sure if all. </p>
<p>Please if there is any solution to this I will be very grateful.</p>
| 1cybersec
| Stackexchange | 175 | 747 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
Intersection multiplicity for two curves defined by $f=0,g=0$. <p>I want to understand how I can find the intersection multiplicity $I_p$ at a point $p$ for two curves $f,g$. </p>
<blockquote>
<p>I have the example where
$$ f(x,y) = y^2-x^3, \,\,\,\, g(x,y)=y^2-x^2(x+1) $$
Then I am looking for the intersection multiplicity of the ideal $(f,g)$ at $p=(0,0)$.</p>
</blockquote>
<p>My first attempt is to notice that $g(x,y)=y^2-x^3-x$ and the ideal $(f,g)$ can be written as $(f,g-f)=(y^2-x^3,x^2)$. But now I am stuck since I cannot find a way to possibly simplify this ideal as to conclude about the intersection form. Only step I can go further is to note that
$$ I_{(0,0)}(y^2-x^3,x^2) = 2I_{(0,0)}(y^2-x^3,x) $$<br>
What would the next step be in order to determine $I_p$? In a previous example I was able to reduce the original ideal to an ideal involving only degree 1 curves concluding easily about what the multiplicity is. Now? </p>
| 0non-cybersec
| Stackexchange | 332 | 953 |
I have super limited calf ankle flexion which keeps me from getting too low in my squats, any ideas?. So basically I can't flex my ankle the way that you'd pull your toes up towards me hardly at all. If I stand with my toes against a wall I can barely touch my knees to it. The problem is this makes it nearly impossible to squat deep. Like I can get almost parallel but then there's just too much weight backwards and since I can't lean foward with my calves I either stop or fall backward. So I've been doing calf (gastrocnemius and soleus) stretches but I can't tell if they're working They feel stretched out but I don't know if I'm making progress (and even if I do it will take some time).
So what can a guy do to get lower in his squats while he's waiting for his ankle flexibility to increase? | 0non-cybersec
| Reddit | 194 | 808 |
Apache security for multi-user development web server. <p>I've been searching and reading through documents all morning and understand that I need to use some combination of chown and probably 'jailing' to securely give programmers access to directories on my centos webserver.</p>
<p>Here's the situation: I have an apache web server that has any number of virtual sites located in /var/www/site1 /var/www/site2 etc..</p>
<p>I have different developers that need full access both ssh and vsFTP to only the site they are working on. What is the best way to create and maintain security in this scenario. My thought would be to create a new user for each coder, jail that user to the website directory they are allowed to work in, add their user to a group and set the webroot's owner to that group. </p>
<p>Any thoughts? Good, bad, ugly? Thanks!</p>
| 0non-cybersec
| Stackexchange | 218 | 857 |
An interesting series. <p>$\sum_{n=1}^{\infty} \frac{\varphi(n)}{n}$ where $\varphi(n)$ is 1 if the variable $\text n$ has the number $\text 7$ in its typical base-$\text10$ representation, and $\text0$ otherwise.</p>
<p>I am supposed to find out if this series converges or diverges. I think it diverges, and here is why.</p>
<p>We can see that there is a series whose partial sums are always below our series, but which diverges. Compare some of the terms of each sequence</p>
<p>$\frac{1}{7} > \frac{1}{8}$<br/>
$\frac{1}{70} > \frac{1}{80}$<br/>
$\frac{1}{71} > \frac{1}{80}$<br/>
$\frac{1}{72} > \frac{1}{80}$<br/>
$\text ... $<br/>
$\frac{1}{79} > \frac{1}{80}$<br/>
$\text ... $<br/>
$\frac{1}{700} > \frac{1}{800}$<br/>
$\text ... $<br/></p>
<p>And continue in this way.</p>
<p>Obviously some terms are left out of the sequence on the left, which is fine since our sequence of terms on the left is already greater than the right side. Notice the right side can be grouped into</p>
<p>$\frac{1}{8} + \frac{1}{8} + ... $ because we will have $10$ $\frac{1}{80}$s, $100$ $\frac{1}{800}$s, etc etc. Thus we are adding up infinitely many 1/8s. This is similar to the idea of the divergence of the harmonic series. So, my conclusion is that it diverges. A bunch of other students in my real analysis class have come to the conclusion that is, in fact, convergent, and launched into a detailed verbal explanation about comparison with a geometric series that I couldn't follow without seeing their work. Is my reasoning, like they suspect, flawed? I can't see how.</p>
<p>Sorry about the poor format, I'm new to TeX and couldn't figure out how to format a piecewise function (it was telling me a my \left delimiter wasn't recognized).</p>
| 0non-cybersec
| Stackexchange | 543 | 1,747 |
Never let a man convince you that abuse in any form is normal.. (**Please also read the edit at the bottom of this post**)
The subject of domestic violence is weighing heavily on my heart today, and I feel a strong need to reiterate these thoughts on the chance someone needs to see it:
If your boyfriend or husband hits you, pushes you around, demands sex from you when you don’t want it, guilts you into giving false consent for things, isolates you from your friends or family, hurts you and then makes you feel sorry for him, insults you, that is not normal behavior. Anything even remotely like this is abnormal.
I grew up in an abusive household. When we finally left and moved into our safe house, my mother explained to me what a slow escalation it was from the initial red flag warnings to the life-threatening situations they became 20 years later. Take the warnings seriously because they will not get better.
Please. If you’re experiencing any of these red flags, *get out*. It breaks my heart to see women settle for these types of men, and think that it’s the way relationships are across the board. You might not think you deserve better, but you absolutely do. We’re all deserving of love and respect, and no man holds the right to abuse us, especially in the name of “love.”
I know that leaving is not always a simple solution, and that you put yourself at a potential high risk in doing so. But please find out what your resources are:
United States:
*National Domestic Violence Hotline* 1-800-799-7233
thehotline.org
Outside US Resources:
Domesticshelters.org has listings for other countries and may be a good resource. (I’m sorry I couldn’t find more concrete resources.)
Be safe, friends. Advocate for yourselves, because you deserve it. ❤️
**EDIT: This applies to all relationships, and I apologize for limiting it to saying just men! But it absolutely applies to all** ❤️ | 0non-cybersec
| Reddit | 450 | 1,909 |
ltablex and booktabs. <p>I need a table which is larger than one page and it should have a fixed size. To improve the look, I use booktabs. However, the foot of the table is not nice on all pages, except on the last page.
<img src="https://i.stack.imgur.com/V0rwa.png" alt="enter image description here">
Here is my MWE</p>
<pre><code>\documentclass{scrartcl}
\usepackage{booktabs}
\usepackage{ltablex}
\usepackage{blindtext}
\begin{document}
\begin{tabularx}{\linewidth}{XX}
left & right\\\toprule
\endhead
\bottomrule
\endfoot
\blindtext & \blindtext\\*\midrule
\blindtext & \blindtext\\*\midrule
\blindtext & \blindtext\\
\end{tabularx}
\end{document}
</code></pre>
<p>Is there a possibility to detect, if a row will be the last row on a page? Than I would be able to avoid the double line. Like the following pseudo code</p>
<pre><code>is row last row of the page than \bottomrule else \midrule
</code></pre>
<p>I would like to have only a <code>\bottomrule</code> at the end of each page but no double line</p>
<p><img src="https://i.stack.imgur.com/ygQI5.png" alt="enter image description here"></p>
| 0non-cybersec
| Stackexchange | 370 | 1,128 |
Use Vue variable in style section of a component. <p>Is it possible to use a variable with the style tag of a component? Basically I have imported a mixin to my style tag that accepts 2 colors to create a gradient within a class. It works great but I want this dynamic so I can set it via a database. I understand I can bind a style via inline but a gradient for a div is rather long and works way better as a mixin. </p>
<p>component:</p>
<pre><code><template>
<section class="section" v-bind:class=" { 'color-section' : content.gradient_color_one }">
<div class="container">
<div class="columns">
<div class="column is-half">
<h2 class="is-size-4" v-html="content.title"></h2>
<div class="section-content" v-html="content.description"></div>
<a class="button" :href=" '/'+ content.button_link">{{ content.button_text }}</a>
</div>
<div class="column">
<img :src="content.image" :alt="content.title" />
</div>
</div>
</div>
</section>
</template>
<script>
export default {
props:[
'content'
],
}
</script>
<style lang="scss" scoped>
@import "../../sass/helpers/mixins";
.color-section{
color:red;
@include diagonalGradient( content.gradient_color_one , content.gradient_color_two);
}
</style>
</code></pre>
<p>mixins</p>
<pre><code>@mixin diagonalGradient($top, $bottom){
background: $top;
background: -moz-linear-gradient(-45deg, $top 0%, $bottom 100%);
background: -webkit-gradient(left top, right bottom, color-stop(0%, $top), color-stop(100%, $bottom));
background: -webkit-linear-gradient(-45deg, $top 0%, $bottom 100%);
background: -o-linear-gradient(-45deg, $top 0%, $bottom 100%);
background: -ms-linear-gradient(-45deg, $top 0%, $bottom 100%);
background: linear-gradient(135deg, $top 0%, $bottom 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#92fe9d', endColorstr='#00c8ff', GradientType=1 );
}
</code></pre>
| 0non-cybersec
| Stackexchange | 738 | 2,284 |
How to derive the general formula for the Killing form for classical Lie algebras?. <p>Let $\mathfrak g$ be a semisimple Lie algebra over a field $k$ of characteristic zero. Then the Killing form is a symmetric, nondegenerate bilinear form on $\mathfrak g$ by defined by $B(X,Y) = \textrm{Tr}(\textrm{ad}(X) \circ \textrm{ad}(Y))$.</p>
<p>The wikipedia article on the Killing form gives the following formulas: </p>
<p><a href="https://i.stack.imgur.com/osqFI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/osqFI.png" alt="enter image description here"></a></p>
<p>With the basis $e_1 = \begin{pmatrix} 1 & \\ & -1\end{pmatrix}, e_2 = \begin{pmatrix} & 1 \\ & \end{pmatrix}, e_3 = \begin{pmatrix} & \\ 1 & \end{pmatrix}$ for $\mathfrak{sl}(2,\mathbb{R})$, I calculated the matrices of the linear transformations $\textrm{ad}(e_i)$ and then found the matrix of the Killing form to be the symmetric nonsingular matrix:</p>
<p>$$\begin{pmatrix} 8 \\ & & 4 \\ & 4 \end{pmatrix}$$</p>
<p>That is, $(e_1,e_1) = 8, (e_2,e_3) = (e_3,e_2) = 4$, and all other combinations are zero. From here, I verified the formula for $B(X,Y)$ in the table for $\mathfrak{sl}(2,\mathbb{R})$. How does one begin to see the general formulas for the Killing form for all classical Lie algebras?</p>
| 0non-cybersec
| Stackexchange | 441 | 1,336 |
Porting Silverligtht application to web application with Asp.net and HTML 5. <p>I work as internal software developer. We used Silverlight to build our application, but we have been asked to start considering their replacement.</p>
<p>Currently our set-up is:</p>
<ul>
<li>Silverlight application for client side.</li>
<li>Asp.Net soap web service. Deployed in two servers with a load
balancer.</li>
<li>MS SQL server 2008. Also Deployed in two servers with a load
balancer.</li>
</ul>
<p>Our application as as a sort of suite, performing several different functions, included but not restricted to:</p>
<ul>
<li>Reporting.</li>
<li>Data analysis.</li>
<li>Front-end for several database tables that are used both for other
processes in the application, and for other applications in the
company.</li>
</ul>
<p>Our constraints:</p>
<p><strong>Limited development resources:</strong> We are a small team, a dozen or so developers, and while we have already hired more people to be able to cope with a increasing work load, getting more reinforcements is unlikely. Time also is constrained, as new projects, bug fixes,requests for new features in existing application and changes in the business logic are quite frequent. </p>
<p><strong>Slow technology update:</strong> Our company changed from Windows XP to Windows 7 last year, and only because the support ended. We started considering to upgrade database servers to SQL server 2010 recently. Official browser is Internet Explorer 9 and Chrome. New Servers,licenses and tools can be requested, but they often take time.</p>
<p><strong>Big, slow data:</strong> Some of our data come from tables big, clunky tables with million of rows and many columns, with only the bare minimum indexing, because they are updated frequently. We have little control over those specific big tables because they are feeds from other systems and requesting changes in those feeds is possible, but, as before, it takes time.</p>
<p><strong>User mentality:</strong> The managers appreciate the fancy interfaces and dashboards to show in meetings. All users appreciate responsiveness and general UI smoothness. Also, many of our users come from a Excel background, which means that they are accustomed to take big chunks of data and filter them, perform analysis, make statistics, generate charts, etc, and they expect to be able to do it in the application too. </p>
<p><strong>Our own experience:</strong> Most of our developers have backgrounds related to .net, asp.net, Windows Forms and Silverlight. Only a few of us have Java experience (non android). Only a few of us have experience with web applications besides some small projects.</p>
<p><strong>Our past:</strong> The first iteration of our application was a windows forms application who suffered an acute case of installer bloating. Some of the IT heads decided that this could be solved by turning it into a web application. Since this was before HTML5 and we were still using IE6 as our official browser, we decided to go with Silverlight as it offered us the best compromise. </p>
<p>Our advantages:</p>
<p><strong>Homogenized hardware:</strong> Most users use exactly the same type of laptop with the same specifications. Available screen size range is not very wide, so we should not have to struggle with different resolutions.</p>
<p><strong>Intranet:</strong> We work in a controlled environment.</p>
<p><strong>Reasonable budget:</strong> Most request for Servers,licenses and the like will be approved if a sufficiently good reason is given.</p>
<p>Recently, the higher ups has started to fear that Silverlight support may end abruptly. And they have suggested that we update the application to a more stable technology, hinting that HTML5 would be a good idea. They have asked us how feasible would be, and how much time it would take. We have next to 0 experience in this type of projects, so we are researching a bit to be able to give them an answer. This is my question:</p>
<p>Given this situation and set-up, would be feasible to port this kind of application to a web application with HTML5 and asp.net while keeping most of its functionality? </p>
<p>If not, why? Which of the above would need to be changed in order to make it possible?.</p>
| 0non-cybersec
| Stackexchange | 1,016 | 4,278 |
On decompositions of integers as a linear combination of $(1, 2, 3,\ldots)$. <p>Edited: Given integer $N\geq 0$, let $$I(N):=\Bigl\{(n_k)_{k\geq 1}\in {\mathbb N}^\infty \,:\, n_k\geq 0, \sum_{k\geq 1}kn_k = N \Bigr\}$$ be the set of all decompositions of $N$ as a linear combination of $(1, 2, 3,\ldots)$ with nonnegative integer coefficients. Then $$\sum_{(n_k)\in I(N)}\prod_{k\geq 1} \frac{1}{k^{n_k} n_k!} = 1.$$
Is there a simple (non Fourier analytic) proof of this identity?</p>
| 0non-cybersec
| Stackexchange | 173 | 487 |
How to prevent forced line break between vbox and text when vbox starts a line and precedes text?. <p>I was surprised to copy a character (I'd spent so much time to trim whitespace around) from a <code>\vbox</code> just to discover that it forces a line break whenever it precedes text (on the same line). Below is a simplified version that creates the same outcome. I need <code>@</code> to appear on the same line as <code>hello world</code>, without enclosing both within an <code>\hbox</code> (this is the only way I discovered that works, but I can't enclose <code>hello world</code>--only <code>@</code>--in my original code due to design issues).</p>
<p>P.S. let's limit solution to plain TeX code compiled in XeLaTeX.</p>
<pre><code>\documentclass[border=5mm,varwidth]{standalone}
\usepackage{color}
\pagecolor{black}
\color{white}
\begin{document}
\newbox\zT
\setbox\zT\vbox{\makeatletter@\makeatother}
\copy\zT hello world\par % try 1 (failed)
\hbox{\copy\zT}hello world % try 2 (failed)
\end{document}
</code></pre>
<p><img src="https://i.ibb.co/KbDsnx9/SCREEN1.png" alt=""></p>
<p>EXPECTED OUTPUT (APPROXIMATION):</p>
<p><img src="https://i.ibb.co/rmMnct8/SCREEN2.png" alt=""></p>
| 0non-cybersec
| Stackexchange | 413 | 1,208 |
Django Structlog is not printing or writing log message to console or file. <p>I have installed <a href="https://pypi.org/project/django-structlog/" rel="nofollow noreferrer">django-structlog 1.4.1</a> for my Django project. I have followed all the steps which has been described in that link.</p>
<p>In my <strong>settings.py</strong> file:</p>
<pre><code>import structlog
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django_structlog.middlewares.RequestMiddleware',
]
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"json_formatter": {
"()": structlog.stdlib.ProcessorFormatter,
"processor": structlog.processors.JSONRenderer(),
},
"plain_console": {
"()": structlog.stdlib.ProcessorFormatter,
"processor": structlog.dev.ConsoleRenderer(),
},
"key_value": {
"()": structlog.stdlib.ProcessorFormatter,
"processor": structlog.processors.KeyValueRenderer(key_order=['timestamp', 'level', 'event', 'logger']),
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"formatter": "plain_console",
},
"json_file": {
"class": "logging.handlers.WatchedFileHandler",
"filename": "log/json.log",
"formatter": "json_formatter",
},
"flat_line_file": {
"class": "logging.handlers.WatchedFileHandler",
"filename": "log/flat_line.log",
"formatter": "key_value",
},
},
"loggers": {
"django_structlog": {
"handlers": ["console", "flat_line_file", "json_file"],
"level": "DEBUG",
},
"django_structlog_demo_project": {
"handlers": ["console", "flat_line_file", "json_file"],
"level": "DEBUG",
},
}
}
structlog.configure(
processors=[
structlog.stdlib.filter_by_level,
structlog.processors.TimeStamper(fmt="iso"),
structlog.stdlib.add_logger_name,
structlog.stdlib.add_log_level,
structlog.stdlib.PositionalArgumentsFormatter(),
structlog.processors.StackInfoRenderer(),
structlog.processors.format_exc_info,
structlog.processors.UnicodeDecoder(),
structlog.processors.ExceptionPrettyPrinter(),
structlog.stdlib.ProcessorFormatter.wrap_for_formatter,
],
context_class=structlog.threadlocal.wrap_dict(dict),
logger_factory=structlog.stdlib.LoggerFactory(),
wrapper_class=structlog.stdlib.BoundLogger,
cache_logger_on_first_use=True,
)
</code></pre>
<p>In my <strong>views.py</strong>:</p>
<pre><code>from django.http.response import HttpResponse
import structlog
logger = structlog.get_logger(__name__)
def func(request):
logger.debug("debug message", bar="Buz")
logger.info("info message", bar="Buz")
logger.warning("warning message", bar="Buz")
logger.error("error message", bar="Buz")
logger.critical("critical message", bar="Buz")
return HttpResponse('success')
</code></pre>
<p>Output in <strong>json.log</strong>:</p>
<pre><code>{"request_id": "7903fdfb-e99a-4360-a8f0-769696520cc9", "user_id": null, "ip": "127.0.0.1", "request": "<WSGIRequest: GET '/test'>", "user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36", "event": "request_started", "timestamp": "2020-02-12T05:11:23.877111Z", "logger": "django_structlog.middlewares.request", "level": "info"}
{"request_id": "7903fdfb-e99a-4360-a8f0-769696520cc9", "user_id": null, "ip": "127.0.0.1", "code": 200, "request": "<WSGIRequest: GET '/test'>", "event": "request_finished", "timestamp": "2020-02-12T05:11:23.879736Z", "logger": "django_structlog.middlewares.request", "level": "info"}
</code></pre>
<p>Output in <strong>flat_line.log</strong>:</p>
<pre><code>timestamp='2020-02-12T05:11:23.877111Z' level='info' event='request_started' logger='django_structlog.middlewares.request' request_id='7903fdfb-e99a-4360-a8f0-769696520cc9' user_id=None ip='127.0.0.1' request=<WSGIRequest: GET '/test'> user_agent='Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36'
timestamp='2020-02-12T05:11:23.879736Z' level='info' event='request_finished' logger='django_structlog.middlewares.request' request_id='7903fdfb-e99a-4360-a8f0-769696520cc9' user_id=None ip='127.0.0.1' code=200 request=<WSGIRequest: GET '/test'>
</code></pre>
<p>Output in <strong>console</strong>:</p>
<pre><code>2020-02-12T05:11:23.877111Z [info ] request_started [django_structlog.middlewares.request] ip=127.0.0.1 request=<WSGIRequest: GET '/test'> request_id=7903fdfb-e99a-4360-a8f0-769696520cc9 user_agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36 user_id=None
{'request_id': '7903fdfb-e99a-4360-a8f0-769696520cc9', 'user_id': None, 'ip': '127.0.0.1', 'bar': 'Buz', 'event': 'warning message', 'timestamp': '2020-02-12T05:11:23.879035Z', 'logger': 'operational.views.core_view', 'level': 'warning'}
{'request_id': '7903fdfb-e99a-4360-a8f0-769696520cc9', 'user_id': None, 'ip': '127.0.0.1', 'bar': 'Buz', 'event': 'error message', 'timestamp': '2020-02-12T05:11:23.879292Z', 'logger': 'operational.views.core_view', 'level': 'error'}
{'request_id': '7903fdfb-e99a-4360-a8f0-769696520cc9', 'user_id': None, 'ip': '127.0.0.1', 'bar': 'Buz', 'event': 'critical message', 'timestamp': '2020-02-12T05:11:23.879468Z', 'logger': 'operational.views.core_view', 'level': 'critical'}
2020-02-12T05:11:23.879736Z [info ] request_finished [django_structlog.middlewares.request] code=200 ip=127.0.0.1 request=<WSGIRequest: GET '/test'> request_id=7903fdfb-e99a-4360-a8f0-769696520cc9 user_id=None
[12/Feb/2020 05:11:23] "GET /test HTTP/1.1" 200 7
</code></pre>
<p><strong>My issues are:</strong></p>
<ul>
<li>'info' and 'debug' level log message is not showing at the console.</li>
<li>Any type of log message is not writing at the log files except "event='request_started'" and "event='request_finished'"</li>
</ul>
<p><em>I want same message in all of my log files and console. How can i achieve this?</em></p>
| 0non-cybersec
| Stackexchange | 2,372 | 6,697 |
I (M18) have to literally pull my FWB (F18) off me when she gives me head because of sensitivity issues. Something I can work on to improve my endurance so she can enjoy finishing?. Essentially my FWB gives absolutely amazing head. Literally mind blowing. In the past I'm used to girls just trying to deep throat and apply that fully "engulfed" feeling I guess? Anyway she has trouble deepthroating me because even though length wise I'm maybe a little above average, I'm thick (like 4.5-5 around). She makes up for it by paying a lot of attention to the head using her tongue and slurping around and for some reason it becomes a sensory overload! Like I have to pull her off because it's just too much after 45 seconds to a minute. It doesn't hurt, it's just more intense than the feeling of sensitivity post orgasm and I just get all fidgety and I can't take it anymore.
tl:dr FWB gives amazing BJ, but head of penis is too sensitive to let her perform for more than a minute. Any way that I can try to fix this?
Edit: Can't English. | 0non-cybersec
| Reddit | 250 | 1,039 |
Unpacked a tar...badly - now locked out of my own files!. <p>Not knowing well what I was doing, I opened a tar with sudo, and now it's linked to a user that doesn't exist and I can't remove it under any circumstances - perhaps because it's off the home directory. Help please?</p>
<pre><code>total 44
drwx------ 2 3047 3047 4096 Sep 25 2012 library
drwx------ 2 3047 3047 4096 Sep 25 2012 source
drwx------ 2 3047 3047 4096 Sep 25 2012 examples
-rw-rw-rw- 1 q q 28828 May 6 07:02 image_processing.tar.gz
</code></pre>
| 0non-cybersec
| Stackexchange | 169 | 533 |
"Host key verification failed" despite deleting known_hosts. <p>I know what this error means, and usually I just remove that entry from the known_hosts file and get on with it (when I know why the verification is failing). </p>
<p>This time I still got the error after removing the specific entry for the host from known_hosts, so I removed all the entries and still got the error, then removed the entire known_hosts file and still get the error?!</p>
<p>I'm having this issue on all hosts.</p>
<p>I just moved .ssh to .ssh-bak, copied my keys into the new directory and still got the error.</p>
<p>What is the cause of this?</p>
<pre><code>$ ssh -vvv [email protected]
OpenSSH_7.3p1, LibreSSL 2.4.1
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug2: resolving "github.com" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to github.com [192.30.253.113] port 22.
debug1: Connection established.
debug1: identity file /Users/herbert/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/herbert/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/herbert/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/herbert/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/herbert/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/herbert/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/herbert/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/herbert/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.3
debug1: Remote protocol version 2.0, remote software version libssh-0.7.0
debug1: no match: libssh-0.7.0
debug2: fd 5 setting O_NONBLOCK
debug1: Authenticating to github.com:22 as 'git'
debug3: hostkeys_foreach: reading file "/Users/herbert/.ssh/known_hosts"
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: [email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,[email protected],zlib
debug2: compression stoc: none,[email protected],zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: [email protected],ecdh-sha2-nistp256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: host key algorithms: ssh-dss,ssh-rsa
debug2: ciphers ctos: [email protected],aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,blowfish-cbc
debug2: ciphers stoc: [email protected],aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,blowfish-cbc
debug2: MACs ctos: hmac-sha1,hmac-sha2-256,hmac-sha2-512
debug2: MACs stoc: hmac-sha1,hmac-sha2-256,hmac-sha2-512
debug2: compression ctos: none,zlib,[email protected]
debug2: compression stoc: none,zlib,[email protected]
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: [email protected]
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
debug3: hostkeys_foreach: reading file "/Users/herbert/.ssh/known_hosts"
debug3: hostkeys_foreach: reading file "/Users/herbert/.ssh/known_hosts"
Host key verification failed.
$ ssh -G github.com
user herbert
hostname github.com
port 22
addressfamily any
batchmode yes
canonicalizefallbacklocal yes
canonicalizehostname false
challengeresponseauthentication yes
checkhostip yes
compression no
controlmaster false
enablesshkeysign no
clearallforwardings no
exitonforwardfailure no
fingerprinthash SHA256
forwardagent no
forwardx11 no
forwardx11trusted no
gatewayports no
gssapiauthentication no
gssapidelegatecredentials no
hashknownhosts no
hostbasedauthentication no
identitiesonly no
kbdinteractiveauthentication yes
nohostauthenticationforlocalhost no
passwordauthentication yes
permitlocalcommand no
protocol 2
proxyusefdpass no
pubkeyauthentication yes
requesttty auto
rhostsrsaauthentication no
rsaauthentication yes
streamlocalbindunlink no
stricthostkeychecking ask
tcpkeepalive yes
tunnel false
useprivilegedport no
verifyhostkeydns false
visualhostkey no
updatehostkeys false
canonicalizemaxdots 1
compressionlevel 6
connectionattempts 1
forwardx11timeout 1200
numberofpasswordprompts 3
serveralivecountmax 3
serveraliveinterval 0
ciphers [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
hostkeyalgorithms [email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
hostbasedkeytypes [email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
kexalgorithms [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
loglevel INFO
macs [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
pubkeyacceptedkeytypes [email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
xauthlocation xauth
identityfile ~/.ssh/id_rsa
identityfile ~/.ssh/id_dsa
identityfile ~/.ssh/id_ecdsa
identityfile ~/.ssh/id_ed25519
canonicaldomains
globalknownhostsfile /etc/ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts2
userknownhostsfile ~/.ssh/known_hosts ~/.ssh/known_hosts2
sendenv LANG
sendenv LC_*
connecttimeout none
tunneldevice any:any
controlpersist no
escapechar ~
ipqos lowdelay throughput
rekeylimit 0 0
streamlocalbindmask 0177
</code></pre>
<p>Almost everything in dev has these permissions: </p>
<pre><code>0 crw-rw-rw- 1 root wheel 2, 0 22 Mar 10:07 tty
</code></pre>
<p>Could these 4 have something to do with it? </p>
<pre><code>0 crw--w---- 1 herbert tty 16, 0 12 Mar 12:55 ttys000
0 crw--w---- 1 herbert tty 16, 1 22 Mar 15:12 ttys001
0 crw--w---- 1 herbert tty 16, 2 22 Mar 15:14 ttys002
0 crw--w---- 1 herbert tty 16, 3 22 Mar 17:44 ttys003
0 crw--w---- 1 herbert tty 16, 4 22 Mar 17:44 ttys004
$ ls -lsa ~/.ssh
total 24
0 drwx------ 5 herbert staff 170 22 Mar 15:39 .
0 drwxr-xr-x+ 114 herbert staff 3876 22 Mar 15:29 ..
8 -rw------- 1 herbert staff 1675 22 Mar 15:31 id_rsa
8 -rw-r--r-- 1 herbert staff 414 22 Mar 15:31 id_rsa.pub
8 -rw-r--r-- 1 herbert staff 848 22 Mar 16:42 known_hosts
</code></pre>
| 0non-cybersec
| Stackexchange | 3,737 | 9,405 |
What's my Ubuntu Server administrator password?. <p>I just installed Ubuntu Server here, which went fine. However, not sure what's going on here now.</p>
<p>I installed gnome using <code>sudo aptitude install --without-recommends ubuntu-desktop</code>, which worked great. But, I'm not able to use the Synaptic Package Manager!</p>
<p>When using the Login Screen thing I can click unlock and it asks for authorization. I enter the password I gave during install, and it works fine. But when SPM asks for my password, it doesn't accept it! What's going on? My user password is the only one I have been asked to create. I can use <code>sudo</code> fine in the terminal. Why does SPM block me here?</p>
| 0non-cybersec
| Stackexchange | 185 | 706 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
HTTPS doesn't work anymore after adding SSLRequireSSL directive. <p>I have a Mac Mini Server, running macOS Sierra (10.12.2) with macOS Server (5.2). This comes with a built-in Apache server, which is set up to listen on ports 80 and 443. This works fine; documents are accessible over both HTTP and HTTPS.</p>
<p>However, as soon as I use the <code>SSLRequireSSL</code> directive in the .htaccess file, it stops working. In the browser, when accessing <code>https://www.example.com/path/document</code>, I see the following:</p>
<blockquote>
<h2>Forbidden</h2>
<p>You don't have permission to access /path/document on this server.</p>
<hr>
<p><em>Apache Server at www.example.com Port 80</em></p>
</blockquote>
<p>Note that the error message mentions port 80, even though it is served over HTTPS / port 443 (I checked this with curl - so browser redirects aren't an issue here). But this <em>could</em> be related to the source of the problem.</p>
<p>In the Apache error log, the following is shown:</p>
<blockquote>
<p>[Sun Jan 29 16:38:07.674342 2017] [ssl:error] [pid 82204] [client 127.0.0.1:50195] AH02219: access to /Users/Glorfindel/wwwroot/path/document failed, reason: SSL connection required</p>
</blockquote>
<p>Other directives in the .htaccess file do work (e.g. <code>Options -Indexes</code>).</p>
| 0non-cybersec
| Stackexchange | 426 | 1,342 |
What are common design patterns in Cocoa Touch?. <p>In Java community, design pattern is very common term. </p>
<p>In Object C and Cocoa touch world, there are also some design patterns, such as MVC, target-action, delegate, KVO etc. </p>
<p>The purpose question here is to hear more professional experience from guru. After all, some patterns are common used in iOS development. Just like some are very common in J2EE world. </p>
<p>So question maybe how many common patterns in iOS development field ? Let me put some here</p>
<ul>
<li>MVC </li>
<li>delegate, target-action ( communication between V and C ) </li>
<li>KVC KVO Notification ( comm between M and C ) </li>
<li>Singleton
....
....</li>
</ul>
| 0non-cybersec
| Stackexchange | 210 | 713 |
[Help] I would like to socialize my adult dogs, but am anxious about how they'll act at, for instance, a dog park. They don't know how to react to other dogs.. I have two female dogs, 9 and 5 years old, who are good with each other and crazy about people, but they did not get the opportunity to socialize much when they were young. When I take them on walks, they misbehave when they see other dogs, pulling on the leash toward them, staring at them as if fixated, sometimes barking, sometimes their hair stands up on their backs.
I'd like it if they could be cool with other dogs and make new friends, and I wonder if trying a dog park is the right move, but I don't know what kinds of behavior need to be established before they can handle the very stimulating environment of a dog park. What are the right precautions I should take and what behaviors should I watch for if I do take them to a dog park? Should I try taking them one at a time first?
I really just want to enrich their lives and reduce both their anxiety and my own. Any advice would be appreciated.
Edit: [Obligatory photo](http://imgur.com/a/HNTF5) | 0non-cybersec
| Reddit | 272 | 1,123 |
Can't load files using system.file or file.path in R?. <p>I am using a program that requires me to load a "sam" file. However, the code given does not create the <code>data.file</code> variable necessary and instead produces <code>""</code>, a blank instead. </p>
<p>This is the code given:</p>
<pre><code>data.file <- system.file(file.path('extdata', 'vignette-sam.txt'), package='flipflop')
</code></pre>
<p>I put in:</p>
<pre><code>data.file <- system.file(file.path("Users", "User1", "Desktop", "Cond_18",
"Sorted_bam_files", "Cond_18_1.bam_sorted.sam"),
package='flipflop')
</code></pre>
<p>The path is definitely correct and the package name is <code>flipflop</code>. However every time I check what the variable <code>data.file</code> is, it produces <code>""</code>. So the file is never being loaded and the script can't run. </p>
<p>I also put in the entire file path into one version of it:</p>
<pre><code>data.file <- system.file('/Users/User1/Desktop/Cond_18/Sorted_bam_files/DBM_18_1.bam_sorted.sam',
package='flipflop')
</code></pre>
<p>That version does not include <code>file.path</code>, but it is one of the script examples.</p>
<p>The line in the code that uses these variables is this:</p>
<pre><code>if(preprocess.instance==''){
print('PRE-PROCESSING sam file ....')
data.file <- path.expand(path=data.file) # In case there is a '~' in the input path
if(data.file==''){ print('Did you forget to give a SAM file?') ; return(NULL) }
annot.file <- path.expand(path=annot.file)
samples.file <- path.expand(path=samples.file)
</code></pre>
<p>And since data.file is <code>""</code> it defaults to <code>NULL</code>.</p>
| 0non-cybersec
| Stackexchange | 594 | 1,771 |
1 class model or 3 class models? 1 for each - UI, Hardware API Library, and Database. <p>I've always used one class model in all 3 area's of my projects. User Interface, Hardware API (for data collection), Database (entity database context). Every new project only seems to grow in size, which means it gets hard to change the class model because everything uses it. </p>
<p>It was suggested to me by seasoned programmer to split up my class model and use a different one for each part of my project. Then convert the data between models with passing data back and forth between the different parts. Which means if one of the models change that you only have to change the code in that section and change the "converters".</p>
<p>Is this a general practice? It's definitely more work initially but I am wondering if it will save me time in the future.</p>
<p>EDIT: I changed data model to class model as suggested in the comments. Though what I am specifically talking about is data modeled in classes in my application.</p>
| 0non-cybersec
| Stackexchange | 238 | 1,028 |
Why can we assume that a piecewise continuous function has a maximum?. <p>In a proof I found in a book regarding the ODE <span class="math-container">$\dot{x}(t) = A(t)x(t)$</span> where <span class="math-container">$A$</span> is piecewise continuous on a compact interval I, it is assumed that the maximum <span class="math-container">$K = \max_I ||A(t)||$</span> exists. In my opinion this doesn't have to be the case. Take, for example, <span class="math-container">$I = [-1,1]$</span> and <span class="math-container">$A(t) = \frac{1}{t}$</span> for <span class="math-container">$t > 0$</span> and <span class="math-container">$A(t) = 0$</span> for <span class="math-container">$t \leq 0$</span>. Is there a mistake in the book or am I just wrong somewhere?</p>
| 0non-cybersec
| Stackexchange | 251 | 769 |
I constantly fantasize about saying no to women once I achieve my dream body.. This fantasy is so motivating that its ridiculous.
Sometimes I think I want to know what it feels like to deny a beautiful woman more than I want to actually be with a beautiful woman.
Its not just about finally sitting on the other side of the table. I want to sit there and put someone firmly on the other end.
I lift heavier and diet harder than anyone I know in hopes of being able to do this one day.
I know its wrong. Im not proud of myself and I should find more positive motivations for sculpting my body. Hell, I think everyone knows what it feels like to pine after someone 'out of your league.' It just plain sucks.
But my female friends/colleagues make it seem like such a thrill to have this power over someone that I want to hold it over women myself.
| 0non-cybersec
| Reddit | 198 | 869 |
Discussion of: Treelets—An adaptive multi-Scale basis for sparse unordered data
ar
X
iv
:0
80
7.
40
11
v1
[
st
at
.A
P
]
2
5
Ju
l
20
08
The Annals of Applied Statistics
2008, Vol. 2, No. 2, 472–473
DOI: 10.1214/08-AOAS137A
Main article DOI: 10.1214/07-AOAS137
c© Institute of Mathematical Statistics, 2008
DISCUSSION OF: TREELETS—AN ADAPTIVE MULTI-SCALE
BASIS FOR SPARSE UNORDERED DATA
By Fionn Murtagh
University of London
The work of Lee et al. is theoretically well founded and thoroughly moti-
vated by practical data analysis. The algorithm presented has the following
important properties:
1. Hierarchical clustering using a novel, adaptive, eigenvector-related, ag-
glomerative criterion.
2. Principal components analysis carried out locally, leading to the required
sample size for consistency being logarithmic rather than linear; and com-
putational time being quadratic rather than cubic.
3. Multiresolution transform with interesting characteristics: data-adaptive
at each node of the tree, orthonormal, and the tree decomposition itself
is data-adaptive.
4. Integration of all of the following: hierarchical clustering, dimensionality
reduction, and multiresolution transform.
5. Range of data patterns explored, in particular, block patterns in the
covariances, and “model” or pattern contexts.
While I admire the work of the authors, nonetheless I have a different
point of view on key aspects of this work:
1. The highest dimensionality analyzed seems to be 760 in the Internet
advertisements case study. In fact, the quadratic computational time re-
quirements (Section 2.1 of Lee et al.) preclude scalability. My approach
in Murtagh (2007a) to wavelet transforming a dendrogram is of linear
computational complexity (for both observations, and attributes) in the
multiresolution transform. The hierarchical clustering, to begin with, is
typically quadratic for the n observations, and linear in the p attributes.
These computational requirements are necessary for the “small n, large
p” problem which motivates this work (Section 1). In particular, linearity
in p is a sine qua non for very high dimensionality data exploration.
Received October 2007; revised October 2007.
This is an electronic reprint of the original article published by the
Institute of Mathematical Statistics in The Annals of Applied Statistics,
2008, Vol. 2, No. 2, 472–473. This reprint differs from the original in pagination
and typographic detail.
1
http://arxiv.org/abs/0807.4011v1
http://www.imstat.org/aoas/
http://dx.doi.org/10.1214/08-AOAS137A
http://dx.doi.org/10.1214/07-AOAS137
http://www.imstat.org
http://www.imstat.org
http://www.imstat.org/aoas/
http://dx.doi.org/10.1214/08-AOAS137A
2 F. MURTAGH
Since L = O(p) in Section 2.1, this cubic time requirement has to be
alleviated, in practice, through limiting L to a user-specified value.
2. The local principal components analysis (Section 2.1) inherently helps
with data normalization, but it only goes some distance. For qualitative,
mixed quantitative and qualitative, or other forms of messy data, I would
use a correspondence analysis to furnish a Euclidean data embedding.
This, then, can be the basis for classification or discrimination, benefiting
from the Euclidean framework. See Murtagh (2005).
3. My final point is in relation to the following (Section 1): “The key prop-
erty that allows successful inference and prediction in high-dimensional
settings is the notion of sparsity.” I disagree, in that sparsity of course
can be exploited, but what is far more rewarding is that high dimensions
are of particular topology, and not just data morphology.
This is shown in the work of Hall et al. (2005), Ahn et al. (2007), Donoho
and Tanner (2005) and Breuel (2007), as well as Murtagh (2004). What
this leads to, potentially, is the exploitation of the remarkable simplicity
that is concomitant with very high dimensionality: Murtagh (2007b).
Applications include text analysis, in many varied applications, and high
frequency financial and other signal analysis.
In conclusion, I thank the authors for their thought-provoking and moti-
vating work.
REFERENCES
Ahn, J., Marron, J. S., Muller, K. M. and Chi, Y.-Y. (2007). The high-dimension,
low-sample-size geometric representation holds under mild conditions. Biometrika 94
760–766.
Breuel, T. M. (2007). A note on approximate nearest neighbor methods. Available at
http://arxiv.org/pdf/cs/0703101.
Donoho, D. L. and Tanner, J. (2005). Neighborliness of randomly-projected simplices
in high dimensions. Proc. Natl. Acad. Sci. USA 102 9452–9457. MR2168716
Hall, P., Marron, J. S. and Neeman, A. (2005). Geometric representation of high
dimension low sample size data. J. Roy. Statist. Soc. B 67 427–444. MR2155347
Murtagh, F. (2004). On ultrametricity, data coding, and computation. J. Classification
21 167–184. MR2100389
Murtagh, F. (2005). Correspondence Analysis and Data Coding with R and Java. Chap-
man and Hall/CRC, Boca Raton, FL. With a foreword by J.-P. Benzécri. MR2155971
Murtagh, F. (2007a). The Haar wavelet transform of a dendrogram. J. Classification 24
3–32. MR2370773
Murtagh, F. (2007b). The remarkable simplicity of very high dimensional data: Appli-
cation of model-based clustering. Available at www.cs.rhul.ac.uk/home/fionn/papers.
Department of Computer Science
Royal Holloway
University of London
Egham, Surrey TW20 0EX
United Kingdom
E-mail: [email protected]
http://arxiv.org/pdf/cs/0703101
http://www.ams.org/mathscinet-getitem?mr=2168716
http://www.ams.org/mathscinet-getitem?mr=2155347
http://www.ams.org/mathscinet-getitem?mr=2100389
http://www.ams.org/mathscinet-getitem?mr=2155971
http://www.ams.org/mathscinet-getitem?mr=2370773
http://www.cs.rhul.ac.uk/home/fionn/papers
mailto:[email protected]
References
Author's addresses
| 0non-cybersec
| arXiv | 1,711 | 5,894 |
Building around the RTX 3000 series. I’m new to building a PC but have finally decided to give it a shot. My goal is to build a future-set machine that’s capable of whatever I can throw at it. It’ll be primarily for gaming, thinking Halo Infinite - 4K to start. The GF works at Nvidia which is part of what sparked the idea to build around their flagship GPU. That said, I’m planning on waiting for the new RTX 3080 or RTX 3080 TI. I’m not in a rush and looking to start the planning. Anyone else started planning around Nvidia’s latest for their new build? | 0non-cybersec
| Reddit | 148 | 564 |
What is the benefit of std::literals::.. being inline namespaces?. <p>In the C++-Standard (eg. N4594) there are two definitions for <code>operator""s</code>:</p>
<p>One for <code>std::chrono::seconds</code> :</p>
<pre><code>namespace std {
...
inline namespace literals {
inline namespace chrono_literals {
// 20.15.5.8, suffixes for duration literals
constexpr chrono::seconds operator "" s(unsigned long long);
</code></pre>
<p>and one for <code>std::string</code> :</p>
<pre><code>namespace std {
....
inline namespace literals {
inline namespace string_literals {
// 21.3.5, suffix for basic_string literals:
string operator "" s(const char* str, size_t len);
</code></pre>
<p>I wonder what is gained from those namespaces (and all the other namespaces inside <code>std::literals</code>), if they are <code>inline</code>.</p>
<p>I thought they were inside separate namespaces so they do not conflict with each other. But when they are <code>inline</code>, this motivation is undone, right? <em>Edit:</em> Because <a href="http://www.stroustrup.com/C++11FAQ.html#inline-namespace" rel="nofollow noreferrer">Bjarne explains</a> the main motivation is "library versioning", but this does not fit here.</p>
<p>I can see that the overloads for "Seconds" and "String" are distinct and therefor do not conflict. But would they conflict if the overloads were the same? Or does take the (<code>inline</code>?) <code>namespace</code> prevents that somehow?</p>
<p>Therefore, what is gained from them being in an <code>inline namespace</code> at all?
How, as @Columbo points out below, are overloading across inline namespaces resolved, and do they clash?</p>
| 0non-cybersec
| Stackexchange | 503 | 1,662 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
Documented way to disable ASLR on OS X?. <p>On OS X 10.9 (Mavericks), it's possible to disable <a href="http://en.wikipedia.org/wiki/Address_space_layout_randomization" rel="noreferrer">address space layout randomization</a> for a single process if you launch the process by calling <a href="https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man2/posix_spawn.2.html" rel="noreferrer"><code>posix_spawn()</code></a> and passing the undocumented attribute <code>0x100</code>. Like this:</p>
<pre class="lang-c prettyprint-override"><code>extern char **environ;
pid_t pid;
posix_spawnattr_t attr;
posix_spawnattr_init(&attr);
posix_spawnattr_setflags(&attr, 0x100);
posix_spawn(&pid, argv[0], NULL, &attr, argv, environ);
</code></pre>
<p>(This is reverse-engineered from <a href="http://www.opensource.apple.com/source/gdb/gdb-1708/src/gdb/macosx/macosx-nat-inferior.c" rel="noreferrer">Apple's GDB sources</a>.)</p>
<p>The trouble with undocumented features like this is that they tend to disappear without notice. According to <a href="https://stackoverflow.com/a/22001746/68063">this Stack Overflow answer</a> the dynamic linker <a href="https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/dyld.1.html" rel="noreferrer"><code>dyld</code></a> used to consult the environment variable <code>DYLD_NO_PIE</code>, but this does not work in 10.9; similarly the static linker apparently used to take a <code>--no-pie</code> option, but this is no longer the case.</p>
<p>So is there a documented way to disable ASLR?</p>
<p>(The reason why I need to disable ASLR is to ensure repeatability, when testing and debugging, of code whose behaviour depends on the addresses of objects, for example address-based hash tables and <a href="http://www.memorymanagement.org/glossary/b.html#term-bibop" rel="noreferrer">BIBOP-based</a> memory managers.)</p>
| 0non-cybersec
| Stackexchange | 615 | 1,925 |
Using Pandoc to transform Markdown to Beamer Latex Code?. <p>According to </p>
<p><a href="http://pandoc.org/demos.html">http://pandoc.org/demos.html</a></p>
<p>I see the command for turning an md file into a beamer pdf file.</p>
<blockquote>
<p>pandoc -t beamer SLIDES -o example8.pdf</p>
</blockquote>
<p>When I change the extension to tex instead of pdf,</p>
<blockquote>
<p>pandoc -t beamer SLIDES -o example8.tex</p>
</blockquote>
<p>the body of the tex file gets produced but there is no preamble. (No \begin{document}, etc)</p>
<p>Is there a way to get the tex file for beamer with the headings? It's not that big of a deal, but it would be convenient.</p>
| 0non-cybersec
| Stackexchange | 245 | 675 |
Resize the box in relation to the text contained inside. <p>Two questions:</p>
<ol>
<li><em>How can I reduce the size of the box?</em></li>
<li><em>How I can reduce the box in relation to the text contained in the box?</em></li>
</ol>
<p><a href="https://i.stack.imgur.com/gI0JO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gI0JO.png" alt="enter image description here"></a></p>
<p>Here my MWE.</p>
<pre><code>\documentclass[12pt,a4paper,oneside]{book}
\usepackage[lmargin=.8cm, rmargin=.7cm, bmargin=2cm,
marginparwidth=5.5cm, marginparsep=2em]{geometry}
\usepackage[svgnames]{xcolor}
\usepackage[most]{tcolorbox}
\begin{document}
\tcbset{enhanced,colback=LightGoldenrodYellow,
boxrule=1.1pt, colframe=LightGoldenrodYellow,fonttitle=\bfseries,halign=center,valign=center}
\begin{tcolorbox}[
lifted shadow={1mm}{-2mm}{3mm}{0.1mm}%
{black!50!white}]
\textbf{SVILUPPO IN MULTIPOLI \\DI POTENZIALI NEWTONIANI \\E COULOMBIANI}
\end{tcolorbox}
\end{document}
</code></pre>
| 0non-cybersec
| Stackexchange | 400 | 1,021 |
TypeScript and field initializers. <p>How to init a new class in <code>TS</code> in such a way (example in <code>C#</code> to show what I want):</p>
<pre><code>// ... some code before
return new MyClass { Field1 = "ASD", Field2 = "QWE" };
// ... some code after
</code></pre>
<p><strong>[edit]</strong><br>
When I was writing this question I was pure .NET developer without much of JS knowledge. Also TypeScript was something completely new, announced as new C#-based superset of JavaScript. Today I see how stupid this question was. </p>
<p>Anyway if anyone still is looking for an answer, please, look at the possible solutions below.</p>
<p>First thing to note is in TS we shouldn't create empty classes for models. Better way is to create interface or type (depending on needs). Good article from Todd Motto: <a href="https://ultimatecourses.com/blog/classes-vs-interfaces-in-typescript" rel="noreferrer">https://ultimatecourses.com/blog/classes-vs-interfaces-in-typescript</a></p>
<p><strong>SOLUTION 1:</strong></p>
<pre><code>type MyType = { prop1: string, prop2: string };
return <MyType> { prop1: '', prop2: '' };
</code></pre>
<p><strong>SOLUTION 2:</strong></p>
<pre><code>type MyType = { prop1: string, prop2: string };
return { prop1: '', prop2: '' } as MyType;
</code></pre>
<p><strong>SOLUTION 3 (when you really need a class):</strong></p>
<pre><code>class MyClass {
constructor(public data: { prop1: string, prop2: string }) {}
}
// ...
return new MyClass({ prop1: '', prop2: '' });
</code></pre>
<p>or </p>
<pre><code>class MyClass {
constructor(public prop1: string, public prop2: string) {}
}
// ...
return new MyClass('', '');
</code></pre>
<p>Of course in both cases you may not need casting types manually because they will be resolved from function/method return type.</p>
| 0non-cybersec
| Stackexchange | 581 | 1,826 |
Bluetooth fails to load firmware on boot - Ubuntu 15.04. <p>I get bluetooth firmware errors on boot in 15.04 on an Inspiron 3647. How can I fix it?</p>
<pre><code>Bus 003 Device 003: ID 0c45:8603 Microdia
Bus 003 Device 007: ID 0cf3:0036 Atheros Communications, Inc.
Bus 003 Device 002: ID 062a:4102 Creative Labs
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
bluetooth 391136 2 ath3k,btusb
0: phy0: Wireless LAN
Soft blocked: yes
Hard blocked: no
[ 9.983204] Bluetooth: Core ver 2.17
[ 9.983221] Bluetooth: HCI device and connection manager initialized
[ 9.983227] Bluetooth: HCI socket layer initialized
[ 9.983229] Bluetooth: L2CAP socket layer initialized
[ 9.983231] Bluetooth: SCO socket layer initialized
[ 16.957937] Bluetooth: Error in firmware loading err = -110,len = 448, size = 1906
[ 16.957969] Bluetooth: Loading sysconfig file failed
[ 16.957937] Bluetooth: Error in firmware loading err = -110,len = 448, size = 1906
</code></pre>
| 0non-cybersec
| Stackexchange | 327 | 1,011 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
RxJava : Using Retry with Extended Single Observable doesn't Emit the data. <p>The <code>subscriber</code> doesn't receive the data if the retry operator is added to an <code>observable</code> which was created by extending <code>Single</code>.</p>
<pre><code> getSingle()
.retry(1)
.subscribe(System.out::println, System.out::println);
getSingleExt()
.subscribe(res -> System.out.println("WITHOUT RETRY " + res),
System.out::println);
getSingleExt()
.retry(1)
.subscribe(res -> System.out.println("WITH RETRY " + res),
System.out::println);
private static Single<String> getSingle() {
return Single.create(emitter -> emitter.onSuccess("Single.create"));
}
private static Single<String> getSingleExt() {
return new ExtendedSingle();
}
private static class ExtendedSingle extends Single<String> {
@Override
protected void subscribeActual(SingleObserver<? super String> emitter) {
emitter.onSuccess("ExtendedSingle");
}
}
</code></pre>
<p>Output</p>
<p><code>Single.create</code></p>
<p><code>WITHOUT RETRY ExtendedSingle</code></p>
<p>Expected</p>
<p><code>Single.create</code></p>
<p><code>WITHOUT RETRY ExtendedSingle</code></p>
<p><code>WITH RETRY ExtendedSingle</code></p>
| 0non-cybersec
| Stackexchange | 420 | 1,366 |
Solving $y'(x)-2xy(x)=2x$ by using power series. <p>I have a first order differential equation:</p>
<p>$y'(x)-2xy(x)=2x$</p>
<p>I want to construct a function that satisfies this equation by using power series. </p>
<p><strong>General approach:</strong></p>
<p>$y(x)=\sum_0^\infty a_nx^n$</p>
<p><strong>Differentiate once:</strong></p>
<p>$y'(x)=\sum_1^\infty a_nnx^{n-1}$</p>
<p><strong>Now I plug in the series into my diff. equation:</strong></p>
<p>$\sum_1^\infty a_nnx^{n-1}-2x\sum_0^\infty a_nx^n=2x$</p>
<p>$\iff \sum_0^\infty a_{n+1}(n+1)x^n-2x\sum_0^\infty a_nx^n=2x$</p>
<p>$\iff \sum_0^\infty [a_{n+1}(n+1)x^n-2xa_nx^n]=2x$</p>
<p>$\iff \sum_0^\infty [a_{n+1}(n+1)-2xa_n]x^n=2x $ </p>
<p><strong>Now I can equate the coefficients:</strong></p>
<p>$a_{n+1}(n+1)-2xa_n=2x$</p>
<p>I am stuck here. I don't really understand why equating the coefficients works in the first place. Whats the idea behind doing this. I don't want to blindly follow some rules so maybe someone can explain it to me. Do I just solve for $a_{n+1}$ now?</p>
<p>Thanks in advance</p>
<p><strong>Edit:</strong></p>
<p>Additional calculation in response to LutzL:</p>
<p>$\sum_1^\infty a_nnx^{n-1}-\sum_0^\infty 2a_nx^{n+1}=2x$</p>
<p>$\iff \sum_0^\infty a_{n+1}(n+1)x^n-\sum_1^\infty 2a_{n-1}x^n=2x$</p>
<p>$\iff \sum_1^\infty a_{n+1}(n+1)x^n+a_1-\sum_1^\infty 2a_{n-1}x^n=2x$</p>
<p>$\iff \sum_1^\infty [a_{n+1}(n+1)-2a_{n-1}]x^n=2x-a_1$</p>
<p>So how do I deal with the x on the other side now? Can I just equate the coefficients like this:</p>
<p>$a_{n+1}(n+1)-2a_{n-1}=2x-a_1$?</p>
| 0non-cybersec
| Stackexchange | 754 | 1,596 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
Porn/relationship Question. I don't know if I would consider myself addicted to pornography but I enjoy looking at it and can find any excuse to look at it (boredom). Fyi, when I say porn, it is typically man on woman, girl on guy (nothing too "crazy"). When I was single, it became somewhat of a daily habit. However, now that I have been in a relationship for two years, its dropped to looking at it around twice a week. In the beginning of the relationship, I was open and honest with her about looking at it quite a bit. Now that we live together, the initial request was that I not look at it when she is home (she felt weird about it, and has no desire to watch it with me). Because our communication is pretty spot on, my fiancee has told me that she "feels uncomfortable" when I look at it in general, because she is self conscious about her body and doesn't like the idea of me looking at naked women and "envisioning having sex with them." I understand that women and men view sex differently, but to me, porn isn't a big deal. However, I'm trying to be aware of her feelings. It has been two weeks since I've last looked at it and I feel like that is a type of accomplishment. Yet I feel the urge. She and I work pretty hard throughout the week, and after we get home, make dinner, I typically have an hour or two of work, we are too exhausted for sex. I used to get home and to relax, look at porn before she got home. But even though she has voiced how she feels (and we have argued about it a bit), there is still that urge to look... We have talked about how we want to have more sex, but we are so wiped out, we end up waiting for the weekends (usually twice). Growing up in a pretty religious family, we were taught that porn/masturbation is a bad thing. So I used to feel awful after the fact when I looked at it. Nowadays, I just "shrug it off." My hope is that I the urge to look at porn would go away over time, and while I don't think about it, it still sounds awesome (even knowing how she feels). And when I initially found Gonewild several months ago, I thought "this is so great! A site for normal women that have the confidence to show off their bodies." **I think it all comes down to how I feel that porn isn't really that bad (though after reading this, I think I might have a problem), but I'm trying to respect what she thinks and feels even if I don't necessarily agree with it myself.** Any advice on continuing to fight this? | 0non-cybersec
| Reddit | 580 | 2,462 |
Permission when running script in Vagrant using Vagrantfile. <p>I have created a vagrant box for running rails applications and I have managed to create it manually.</p>
<p>My next step was to create a shell script that I can include in the Vagrantfile so when creating new boxes all installation will be done automatically.</p>
<p>But when I reach the line:</p>
<pre><code>source ~/.bash_profile
</code></pre>
<p>I get this error</p>
<pre><code>mkdir: cannot create directory `/home/vagrant/.rbenv/shims': Permission denied
mkdir: cannot create directory `/home/vagrant/.rbenv/versions': Permission denied
</code></pre>
<p>Works fine from CLI</p>
<p>Any ideas?</p>
<h2><strong>UPDATE</strong></h2>
<p>I have fixed the mkdir error and the script runs from end to end with no apparent errors.</p>
<p>Now when I <code>vagrant ssh</code> and check my home directory I do not find any of the git repos I downloaded and installed using my script nor .bash_profile hence I can not <code>rbenv</code> </p>
<p>Any ideas why this may happen - what am I doing wrong?</p>
<pre><code>vagrant@precise64:~$ ls -a
. .bash_history .cache .profile .sudo_as_admin_successful .veewee_version
.. .bash_logout .bashrc postinstall.sh .ssh .vbox_version
vagrant@precise64:~$
</code></pre>
<p>this is setup.sh:</p>
<pre><code># Update sources:
sudo apt-get -y update
# Install development tools:
sudo apt-get -y install build-essential
# Packages required for compilation of some stdlib modules
sudo apt-get -y install tklib
# Extras for RubyGems and Rails:
sudo apt-get -y install zlib1g-dev libssl-dev
# Readline Dev on Ubuntu:
sudo apt-get -y install libreadline-gplv2-dev
# Install some nokogiri dependencies:
sudo apt-get -y install libxml2 libxml2-dev libxslt1-dev
# Install Git
sudo apt-get -y install git-core
# Install Sqlite
sudo apt-get -y install sqlite3 libsqlite3-dev
# Install Make
sudo apt-get -y install make
# Install NodeJS (Required for Rails)
sudo apt-get -y install python-software-properties
sudo add-apt-repository -y ppa:chris-lea/node.js
sudo apt-get -y update
sudo apt-get -y install curl nodejs
# Install RBENV
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
touch ~/.bash_profile
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
# Install Ruby 2.1.0
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
sudo sh ~/.rbenv/plugins/ruby-build/install.sh
rbenv install 2.1.0
rbenv rehash
rbenv global 2.1.0
# Install gems for Rails
# gem install rdoc
gem install bundler
# gem install rake
gem install sqlite3 -v '1.3.9'
gem install rails
rbenv rehash
</code></pre>
<p>Many thanks in advance.</p>
| 0non-cybersec
| Stackexchange | 947 | 2,804 |
App for Reading - iPad & PDF. <p>I am searching for a application with the following functionality, but cant find one:</p>
<p>I want to read PDFs. I want to highlight some text from time to time or add a note (with its timestamp). The summary of all highlights / notes should aggregated together so there is some special page(s) / section that contain only the highlighted text and notes.</p>
<p>Does something like this exist? I know there are dozens of apps for reading itself, but i am not sure whether there is app that allows me to list in "my highlighted content" only.</p>
| 0non-cybersec
| Stackexchange | 145 | 591 |
How to make Facebook’s Messenger desktop app start with Windows?. <p>The <a href="https://www.microsoft.com/en-us/p/messenger/9wzdncrf0083?activetab=pivot:overviewtab" rel="nofollow noreferrer">offical desktop app</a> works well on Windows, but apparently it doesn't show notification for new messages if the app is not started.</p>
<p>Is there an option to start it with Windows automatically? Such apps usually has a setting like that, but I couldn't find it.</p>
| 0non-cybersec
| Stackexchange | 135 | 467 |
How do I get 2 Dell monitors to work with my MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports). <p>OSX doesn't support MST daisy chaining monitors. I've got 2 brand new monitors and a decent mac and Apple wont let me use it due to software limitations.</p>
<p>Is there any product I can buy (Amazon preferably) that will let me use my two monitors (not screen mirroring) as I want to? I can plug both displays into the mac but then I can't charge the mac at the same time or close the lid without it going off. Dell U2518D are the displays.</p>
| 0non-cybersec
| Stackexchange | 147 | 549 |
Bootstrap/Stylus - Make Table Column as small as possible. <p>I'm practicing using Bootstrap to make my table responsive on a search list I'm creating, the issue is that two of my columns I'd like to make as small as possible instead of equal sized.
In the picture below, you can see Date and Link take up more space then they need. How can I go about fixing this? Thanks in advance!</p>
<p><img src="https://i.stack.imgur.com/H7jpU.png" alt="Title and Link are too big"></p>
<p>HTML (Snipped):</p>
<pre><code><div class="table-responsive">
<table class="table table-striped table-hover table-bordered table-condensed">
<tbody>
<tr class="active" ng-repeat="s in results">
<!-- <td class="hidden-xs hidden-sm">{{$index}}</td> -->
<td class="hidden-xs hidden-sm">{{s.provider}}</td>
<td>{{s.title}}</td>
<td>{{s.date}}</td>
<td class="hidden-xs hidden-sm">{{s.cat}}</td>
<td><a href="{{s.link}}">D/L</a></td>
</tr>
</tbody>
</table>
</div>
</code></pre>
<p>Stylus:</p>
<pre><code>table
table-layout fixed
word-wrap break-word
</code></pre>
| 0non-cybersec
| Stackexchange | 479 | 1,334 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
embed shiny app into Rmarkdown html document. <p>I am able to create an Rmarkdown file and I'm trying to embed a shiny app into the html output. The interactive graph shows if I run the code in the Rmarkdown file. But in the html output it only shows a blank box. Can anybody help fix it?</p>
<p>Run the code in Rmarkdown file:</p>
<p><a href="https://i.stack.imgur.com/nYUbY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nYUbY.png" alt="enter image description here" /></a></p>
<p>In the html output:</p>
<p><a href="https://i.stack.imgur.com/WNnYj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WNnYj.png" alt="enter image description here" /></a></p>
<p>My Rmarkdown file (please add the three code sign at the end yourself somehow i cannot do here):</p>
<pre><code> ---
title: "Data Science - Tagging"
pagetitle: "Data Science - Style Tagging"
author:
name: "yyy"
params:
creation_date: "`r format(Sys.time(), c('%Y%m%d', '%h:%m'))`"
runtime: shiny
---
```{r plt.suppVSauto.week.EB, out.width = '100%'}
data <- data.frame(BclgID = c('US','US','US','UK','UK','UK','DE','DE','DE'),
week = as.Date(c('2020-06-28', '2020-06-21', '2020-06-14', '2020-06-28', '2020-06-21', '2020-06-14', '2020-06-28', '2020-06-21', '2020-06-14')),
value = c(1,2,3,1,2,2,3,1,1))
shinyApp(
ui <- fluidPage(
radioButtons(inputId = 'BclgID', label = 'Catalog',
choices = type.convert(unique(plot$BclgID), as.is = TRUE),
selected = 'US'),
plotOutput("myplot")
),
server <- function(input, output) {
mychoice <- reactive({
subset(data, BclgID %in% input$BclgID)
})
output$myplot <- renderPlot({
if (length(row.names(mychoice())) == 0) {
print("Values are not available")
}
p <- ggplot(mychoice(), aes(x=as.factor(week), y=value)) +
geom_line() +
labs(title = "test",
subtitle = "",
y="Value",
x ="Date") +
theme(axis.text.x = element_text(angle = 90)) +
facet_wrap( ~ BclgID, ncol = 1)
print(p)
}, height = 450, width = 450)
}
)
</code></pre>
| 0non-cybersec
| Stackexchange | 865 | 2,637 |
Set the line separation in a tabu table equal to the line separation in the document. <p>As is known, the <code>tabu</code> environment does not automatically adjust the vertical distance between a cell with multiple lines and another cell, cf. <a href="https://tex.stackexchange.com/questions/82573/text-too-close-to-cell-border-when-having-a-nested-tabu-and-vspace-in-a-cell">Text too close to cell border when having a nested tabu and \vspace in a cell</a> and <a href="https://tex.stackexchange.com/questions/64337/consistent-vertical-spacing-with-tabu">Consistent vertical spacing with tabu</a>.</p>
<p>This can be adjusted with <code>tabu</code>'s <code>\tabulinesep</code> command, but instead of setting this separator to some arbitrary value, I would like it to be the same as the vertical distance between lines in the document as such. How do I do that?</p>
<pre><code>\documentclass{article}
\usepackage{tabu,setspace}
\singlespacing
\parindent=0pt
\begin{document}
% \tabulinesep = <whatever the distance between lines in the document is>
\begin{tabu} to\linewidth{lX}
Lipsum & Fgyjgh Fgyjgh Fgyjgh Fgyjgh Fgyjgh Fgyjgh Fgyjgh Fgyjgh Fgyjgh Fgyjgh Fgyjgh\\
Lipsum & FkRtfh\\
\end{tabu}
\end{document}
</code></pre>
<p><img src="https://i.stack.imgur.com/a8tKq.png" alt="enter image description here"></p>
| 0non-cybersec
| Stackexchange | 452 | 1,366 |
If `[` is a function for subsetting in R, what is `]`?. <p>I'm reading the advanced R introduction by Hadley Wickham, where he states that [ (and +, -, {, etc) are functions, so that [ can be used in this manner</p>
<pre><code>> x <- list(1:3, 4:9, 10:12)
> sapply(x, "[", 2)
[1] 2 5 11
</code></pre>
<p>Which is perfectly fine and understandable. But if [ is the function required to subset, does ] have another use rather than a syntactical one?</p>
<p>I found that:</p>
<pre><code>> `]`
Error: object ']' not found
</code></pre>
<p>so I assume there is no other use for it?</p>
| 0non-cybersec
| Stackexchange | 218 | 600 |
Spring wiring by type is slower by magnitude than wiring by name. <p>In my project, I am trying to migrate all usages of</p>
<pre><code>Foo foo = (Foo) beanFactory.getBean("name");
</code></pre>
<p>into </p>
<pre><code>Foo foo = beanFactory.getBean(Foo.class);
</code></pre>
<p>The benefits are obvious: type safety, less convoluted code, less useless constants, etc. Typically such lines are located in static legacy contexts where such a wiring is the only option.</p>
<p>This was all fine until one day users started to complain about the slowness which turned out to come from Spring internals. So I fired up a profiler to find a hotspot in </p>
<p><code>org.springframework.beans.factory.support.AbstractBeanFactory::doGetBean(String, Class<T>, Object[], boolean)</code> </p>
<p>which has an expensive call to </p>
<p><code>Class.isAssignableFrom(anotherClass)</code>.</p>
<p>I have quickly created a small performance test to find out the speed difference between string name and type lookups is a whooping <strong>350</strong> times (I'm using <code>StaticApplicationContext</code> for this test FAIW)!</p>
<p>While investigating this, I found <a href="https://jira.springsource.org/browse/SPR-6870">SPR-6870</a> which has high number of votes but for some reason isn't addressed. This led me to <a href="http://jawspeak.com/2010/11/28/spring-slow-autowiring-by-type-getbeannamesfortype-fix-10x-speed-boost-3600ms-to/comment-page-1/">an attempt to solve this problem</a> which does significantly improve the situation but is still slower <strong>~25</strong> times than lookup by String! It turns out this attempt only solves half of the problem: it caches the name of the bean to save on O(n) iteration but still has to do call <code>isAssignableFrom</code> to validate the type.</p>
<p>Described problem is not only related to my scenario but is also for beans which use <code>@Autowired</code> and can be felt hard in cases where beans are created inside a loop.</p>
<p>One of solutions would be to override one of the bean factory methods and cache the is-this-bean-of-the-same-type check results but clearly this should be done in Spring and not in my own code.</p>
<p>Is anyone else suffering from a similar problem and found a solution to it?</p>
| 0non-cybersec
| Stackexchange | 660 | 2,280 |
16.04 - How To Purge Intel Default Drivers & Reinstall Intel Graphic Drivers. <p>I posted <a href="https://askubuntu.com/questions/763617/graphic-issues-after-ubuntu-16-04-upgrade">this question</a> as I am encountering display problems after upgrading Ubuntu 15.10 to 16.04. I went into 'additional drivers' & noticed this:</p>
<p><a href="https://i.stack.imgur.com/IOWbX.png" rel="noreferrer"><img src="https://i.stack.imgur.com/IOWbX.png" alt="enter image description here"></a></p>
<p>I was wondering whether purging the current drivers & 'reinstalling' them again would help detect the graphic hardware I have on my system. For info, my system is a Lenovo X220 Thinkpad:
i5 2420M
6Gb RAM
Onboard Graphic Card</p>
<p>Any suggestions would be great help. Many thanks,</p>
| 0non-cybersec
| Stackexchange | 252 | 791 |
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
| Stackexchange | 349 | 1,234 |
Oracle: How can I get a value 'TRUE' or 'FALSE' comparing two NUMBERS in a query?. <p>I want to compare two numbers. Let's take i.e. 1 and 2.</p>
<p>I've tried to write the following query but it simply doesn't work as expected (Toad says: ORA-00923: FROM keyword not found where expected):</p>
<pre><code>SELECT 1 > 2 from dual
</code></pre>
<p>The DECODE is something like a Switch case, so how can I get the result of an expression evalutation (i.e. a number comparison) putting it in the select list?</p>
<p>I have found a solution using a functions instead of an expression in the SELECT LIST: i.e. </p>
<pre><code>select DECODE(SIGN(actual - target)
, -1, 'NO Bonus for you'
, 0,'Just made it'
, 1, 'Congrats, you are a winner')
from some_table
</code></pre>
<p>Is there a more elegant way? </p>
<p>Also how do I compare two dates? </p>
| 0non-cybersec
| Stackexchange | 297 | 902 |
Reload choices dynamically when using MultipleChoiceFilter. <p>I am trying to construct a <code>MultipleChoiceFilter</code> where the choices are the set of possible dates that exist on a related model (<code>DatedResource</code>).</p>
<p>Here is what I am working with so far...</p>
<pre><code>resource_date = filters.MultipleChoiceFilter(
field_name='dated_resource__date',
choices=[
(d, d.strftime('%Y-%m-%d')) for d in
sorted(resource_models.DatedResource.objects.all().values_list('date', flat=True).distinct())
],
label="Resource Date"
)
</code></pre>
<p>When this is displayed in a html view...</p>
<p><a href="https://i.stack.imgur.com/5a0ro.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5a0ro.png" alt="enter image description here"></a></p>
<p>This works fine at first, however if I create new <code>DatedResource</code> objects with new distinct <code>date</code> values I need to re-launch my webserver in order for them to get picked up as a valid choice in this filter. I believe this is because the <code>choices</code> list is evaluated once when the webserver starts up, not every time my page loads.</p>
<p>Is there any way to get around this? Maybe through some creative use of a <code>ModelMultipleChoiceFilter</code>?</p>
<p>Thanks!</p>
<p><strong>Edit:</strong>
I tried some simple <code>ModelMultipleChoice</code> usage, but hitting some issues.</p>
<pre><code>resource_date = filters.ModelMultipleChoiceFilter(
field_name='dated_resource__date',
queryset=resource_models.DatedResource.objects.all().values_list('date', flat=True).order_by('date').distinct(),
label="Resource Date"
)
</code></pre>
<p>The HTML form is showing up just fine, however the choices are not accepted values to the filter. I get <code>"2019-04-03" is not a valid value.</code> validation errors, I am assuming because this filter is expecting <code>datetime.date</code> objects. I thought about using the <code>coerce</code> parameter, however those are not accepted in <code>ModelMultipleChoice</code> filters.</p>
<p>Per dirkgroten's comment, I tried to use what was suggested in the <a href="https://stackoverflow.com/questions/26210217/how-to-use-modelmultiplechoicefilter">linked question</a>. This ends up being something like</p>
<pre><code>resource_date = filters.ModelMultipleChoiceFilter(
field_name='dated_resource__date',
to_field_name='date',
queryset=resource_models.DatedResource.objects.all(),
label="Resource Date"
)
</code></pre>
<p>This also isnt what I want, as the HTML now form is now a) displaying the <code>str</code> representation of each <code>DatedResource</code>, instead of the <code>DatedResource.date</code> field and b) they are not unique (ex if I have two <code>DatedResource</code> objects with the same <code>date</code>, both of their <code>str</code> representations appear in the list. This also isnt sustainable because I have 200k+ <code>DatedResources</code>, and the page hangs when attempting to load them all (as compared to the <code>values_list</code> filter, which is able to pull all distinct dates out in seconds.</p>
| 0non-cybersec
| Stackexchange | 916 | 3,153 |
How can I make Internet Explorer 6 render Web pages like Internet Explorer 11?. <p>Now, I know that this may seem like a bad question in that I can just upgrade to Internet Explorer 8, but I am sticking with IE6 in that IE8 removes valuable features, like the ability to save favorites offline and the fact that a file path turns into a Windows Explorer window and typing a Web address into Windows Explorer changes it into an IE window.</p>
<p>I know that Internet Explorer 6 does a <em>really</em> bad job at rendering some pages. I know of the Google Chrome Frame extension that brings Chrome-style rendering into IE, but that will soon be discontinued. So, I tried another thing: I know that <code>C:\Windows\System32\mshtml.dll</code> contains the Trident rendering engine that is used by IE, so I tried something: I first backed up the original file by renaming it on Windows XP to <code>mshtml-old.dll</code>, then I tried to copy in the DLL from a computer running Windows 7 with Internet Explorer 10. I noticed that, after copying, the system had replaced the new DLL with the old one, but left the one I backed up intact.</p>
<p>Is there any way I can get the system to not replace the DLL like that so that I can transfer in IE11's <code>mshtml.dll</code> into Windows XP and make IE6 render like IE11?</p>
<p>I'm looking for an answer that describes how to tweak my system to make IE6 render like IE11 (or IE10), not one that tells me to upgrade IE or install another browser. I don't care how tedious the method is, just as long as it works.</p>
<blockquote>
<p>In case you think that I am on outdated hardware, the Windows XP machine is actually Windows XP Mode running on Windows 7. The <em>real</em> reason why I don't want to switch that to another browser is because I want to experiment.</p>
</blockquote>
| 0non-cybersec
| Stackexchange | 455 | 1,831 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.