text
stringlengths
3
1.74M
label
class label
2 classes
source
stringclasses
3 values
zip file download issue. <p>I am unable to download .zip file using filezilla or flashfxp, whenever I try downloading the file to our windows7 machine it gets stuck and keep on downloading until I manually kill the download process.</p> <p>Does anyone facing the same issue, is this a bug?</p>
0non-cybersec
Stackexchange
Even Star Wars is getting political in my office.
0non-cybersec
Reddit
How do I reassign win x in windows 8 to open chrome?. <p>and for that matter how do I reassign any win+ combo? (I am using a small software called winhotkey but it can only assign free letters with the win button - and Windows 8 has almost all the letters already assigned - I would like to reassign them to do things that I need - how do I do that?</p>
0non-cybersec
Stackexchange
Should blizzard implement an abandon and pause system for competative?. You know what I mean, similar to the one implemented in Dota. If you leave a game you have X amount of time to rejoin or you will offcially leave the game, meaning others can safely leave it too. I say this because, right now, if your computer crashes mid game you're stuck with the leavers penatly for something that wasn't your fault. I suggest giving the leaver a set amount of time to rejoin before saying they have officially left and letting their team-mates leave without reprecussions to prevent this from happening. Examples of people crashing and getting the penalty: https://us.battle.net/forums/en/overwatch/topic/20745404560 The second thing I'd like to see is a pause function so a team can pause the game if one of their team left and restart it when they rejoin the game. It's to prevent one team getting an unfair advantage when one of the other team DCs which could lead to a game winning push. Both teams will be able to unpause the game to prevent it being abused by instantly pausing and refusing to unpause. This would prevent alot of unfairly lost/won games and would make comp a little more enjoyable IMO. What do you think of these ideas?
0non-cybersec
Reddit
Counting in 2&#39;s, 3&#39;s, 4&#39;s, ... 9&#39;s - is there a general rule how to produce (repeating) sequence of last digits?. <p>If I <em>count in 3's</em> like <span class="math-container">$(3,6,9,12,15, ...)$</span> - then the <em>last digit</em> forms a <em>repeating sequence</em> <span class="math-container">$[3, 6, 9 / 2, 5, 8 / 1, 4, 7 / 0]$</span> (slash separates logical groups - we just do "minus one" from each number in the first [3,6,9] group, then we do "minus two", until "three minus three" gives zero).</p> <p>If I <em>count in 4's</em> like <span class="math-container">$(4, 8, 12, 16, 20, 24, 28, ...)$</span> - then the <em>last digit</em> forms a <em>repeating sequence</em> <span class="math-container">$[4, 8, 2, 6, 0]$</span>. I don't see any (easy mnemonic) rule here - like in the above "<em>count in 3's</em>" case.</p> <p>Question: if I count in 2's, 3's, 4's, 6's, 7's, 8's, 9's - is there a general rule for n (n=2, n=3, ... n=9) how to produce that repeating sequence of last digits?</p> <p>For 3's there is a simple (though not general) rule - take <span class="math-container">$3, 6, 9$</span> and subtract one until <span class="math-container">$3-3=0$</span> (see the first paragraph). </p> <p>Maybe there is a similar simple rule for others (4's, 6's, 7's, 8's, 9's) or even a general rule (one simple trick for them all).</p> <p>P.S. Originaly I wanted to provide a nice life-hack for my child learning to count in 3's, 4's etc - this hack is highly wanted, but besides I got interested myself. Sorry, I'm not a professional mathematician. Maybe modular arithmetics or some modern algebra / number theory findings (ring of residues modulo N?) does that (mnemonic / generalizing) trick?</p>
0non-cybersec
Stackexchange
Undoing all my hard work during finals season. Hey guys, I'm currently finishing up my second year in college and finals season is a week away. I've lived on campus this year and the food on campus is in the form of dining halls that are buffet-style. This entire year has been a journey of me learning to control my eating and restrain myself when I could eat all the delicious and fattening foods and desserts at any time I want. It has been one of the hardest things I've ever done and it hasn't been a perfect journey. I haven't lost as much as i would like but i'm still incredibly loud of myself for losing at all this year. Last week I finally hit a small milestone in my weight loss and I was feeling like I was on top of the world. However, one part about being at school means that some weeks get incredibly stressful, especially midterms and finals weeks. This week and next are shaping up to be incredibly stressful with all my tests, and I’ve just been feeling burnt out in school and also in my eating. After studying for hours I just crack in the dining halls and just eat and eat and eat. Now my weight is inching back up and i’m undoing weeks of hard work and diligence because of it. This crappy feelings are really dragging me down and I’m just getting more and more frustrated as I keep gaining. Anyways, I don’t have any friends here that would understand how I’m feeling and I just wanted to get it all out. Thanks for being such a great community, I’ve gotten so much motivation here over the year.
0non-cybersec
Reddit
[50/50] My 4th Grade Injury (NSFW) | A Cute Kitten (SFW).
0non-cybersec
Reddit
Representation formula for the $n$th power of a self-adjoint operator in terms of the spectral measure. <p>Let <span class="math-container">$H$</span> be a <span class="math-container">$\mathbb R$</span>-Hilbertspace, <span class="math-container">$A$</span> be a self-adjoint linear contraction on <span class="math-container">$H$</span> and <span class="math-container">$E:\mathcal B(\mathbb R)\to\mathfrak L(H)$</span> denote the spectral measure associated with <span class="math-container">$A$</span>. By contractivity, the spectrum <span class="math-container">$\sigma(A)$</span> of <span class="math-container">$A$</span> is contained in the closed unit ball <span class="math-container">$\overline B_1(0)$</span> around <span class="math-container">$0$</span> and hence <span class="math-container">$$A^n=\int_{B_1(0)}\lambda^n\:E({\rm d}\lambda)+\int_{\partial B_1(0)}\lambda^n\:E({\rm d}\lambda)\;\;\;\text{for all }n\in\mathbb N\tag1.$$</span></p> <blockquote> <p>In the complex setting, we can show that (see Lemma 1 in <a href="https://arxiv.org/pdf/1405.2411.pdf" rel="nofollow noreferrer">this paper</a>) <span class="math-container">$$A^n=\int_0^{2\pi}e^{{\rm i}\lambda n}\left(\left.E\right|_{\partial B_1(0)}+f(\lambda){\rm d}\lambda\right),\tag2$$</span> where <span class="math-container">$$f(\lambda):=\frac1{2\pi}\int_{B_1(0)}\frac{1-|\mu|^2}{|1-\mu e^{{\rm i}\lambda}|^2}\:E({\rm d}\mu)\;\;\;\text{for }\lambda\in\mathbb R,$$</span> for all <span class="math-container">$n\in\mathbb N$</span>. Is there a similar formula on the real case?</p> </blockquote>
0non-cybersec
Stackexchange
Just finished "I lost my body", by Jérémy Clapin. Here are my two cents:. I really liked the film, it took a while to get on board with the plot, but once you go past the logic of it all you can really submerge on its poetry. I believe the severed hand to be the main symbol of the film, representing how we latch on to things, how we hold on to feelings, and emotions, sometimes we grab on them so hard that is really difficult to let them loose. So the hand being ripped apart was an abrupt way to let it all go, let the past go. The wounds from the past, the ghost that we carry with us. Even if they came chasing after us, we need to take that leap of faith and reach the other side. Sadness, loneliness, when we live with them for so long they became familiar, they become home, we get used to them, the pain can be comforting. But getting to the other side of this feelings can be unknown territory, it's new, it's a new fate. A new life we didn't know how could feel, so it's scary, but once you're there a whole new path appears, and you can breath again, you can take a deep breath and smile at the new road ahead. And one more thing, maybe I'm dead wrong, but I believe Naoufel recorded his jump over his parents death, and if that's true, that's a very beautiful way to show how we can alter things, we can rewrite our story, that power is in our "hands". Ps.: Sorry for my poor english, hope I didn't screw it much.
0non-cybersec
Reddit
Graph: Difference between coordinates and ordinals. <p>What is the difference between coordinates and ordinals on a graph</p>
0non-cybersec
Stackexchange
Removing a Product using button in laravel route link. <p>I created a sample products page using laravel framework,where I added a Remove button to remove that particular product onclick. below is the laravel route code added to the button</p> <pre><code> &lt;button onclick= "window.location= '{{ route('customer.wishlist.remove', $item-&gt;id) }}'" &gt; Remove &lt;/button&gt; </code></pre> <p>here the item id is automatically generated from database which can also be seen by inspecting the remove button code.</p> <p>on clicking the Remove button the product is getting removed. but when i run the route link separately in the browser then also the product getting removed because the same location link is given to button also.</p> <p>I want this operation work only on Remove button click. if i entered the route url directly it should'nt. How can i resist that.</p> <p>please help me on this</p> <p>thank you</p>
0non-cybersec
Stackexchange
Ladies do you feel a sense of accomplishment when you make a man cum super-quick?. I was thinking about that thread the other day saying that men are trying their hardest not to cum, while women are doing everything to make it happen. A few weeks ago, my wife and I had been waiting to fuck all day. The tension had been there since lunchtime but there was work, kid to put to bed etc etc Anyway, when the moment arrived I was so horny I was done in minutes. I wasn't going to say 'I'm sorry' out loud or anything but before I even got that chance she said "It's so fucking hot I can make you cum so quickly after all these years". I guess I always figured sex that ends abruptly is disappointing for females. I never thought it might be an ego-boost. Is this a common thought pattern?
0non-cybersec
Reddit
How do I decode a URL and get the query string as a HashMap?. <p>I have a URL like this:</p> <pre class="lang-none prettyprint-override"><code>http%3A%2F%2Fexample.com%3Fa%3D1%26b%3D2%26c%3D3 </code></pre> <p>I parsed it with <code>hyper::Url::parse</code> and fetch the query string:</p> <pre><code>let parsed_url = hyper::Url::parse(&amp;u).unwrap(); let query_string = parsed_url.query(); </code></pre> <p>But it gives me the query as a string. I want to get the query string as <code>HashMap</code>. something like this:</p> <pre><code>// some code to convert query string to HashMap hash_query.get(&amp;"a"); // eq to 1 hash_query.get(&amp;"b"); // eq to 2 </code></pre>
0non-cybersec
Stackexchange
FreeNas on Dell Powervault 745N: 2TB Limit?. <p>I want to purchase 2 x 2TB drives, and install FreeNas on my Dell Powervault 745N.</p> <p>People on the internets seem to be having trouble with the MD3000 firmware, and I want to make sure I can solve any issues before buying the drives.</p> <p>Before I invest, I have 3 questions :</p> <ol> <li><p>Is there a partition size limit determined by the RAID controller? That is, could I have a striped 4TB partition?</p></li> <li><p>The spec sheets make me wonder if the RAID controller needs all 4 drives in order to work. Is there any reason this will have to run in RAID5?</p></li> <li><p>If I buy 4 matching drives, would the controller support a RAID6 configuration?</p></li> </ol> <p>I'm basically new to all this RAID stuff - sorry for any noob questions.</p>
0non-cybersec
Stackexchange
Traditional VC investment vs. bitcoin IPO. <p>There are few Bitcoin "stock exchanges" trading mainly BTC mining company pass-through shares, like </p> <ul> <li><p><a href="https://btct.co/" rel="nofollow">https://btct.co/</a> </p></li> <li><p><a href="https://bitfunder.com/" rel="nofollow">https://bitfunder.com/</a> </p></li> </ul> <p>We are planning to get investment for our Bitcoin-related business. Instead of traditional Silicon Valley-style venture capital investment, we are investigating the opportunity of doing "Bitcoin IPO" and liquidate some of the company shares through pass-through exchanges. </p> <p>We are looking for 0,7M - 1,5M USD investment. This money would be spent to expand and internationalize our business and enable Bitcoin interaction for more people in across the world. We really need to convert the investment to fiat currency in some point, as for marketing efforts (Google ads, etc.) are paid in fiat currency.</p> <p>Now I am looking for advice on what would be pros and cons of both options: VC investment vs. Bitcoin crowdfunding. We are pretty sure that doing a Bitcoin IPO first would close the door for VC investment, as our stock and IPR would get tainted with nameless Bitcoin investors of whose shares could not be bought back easily (am I correct?). However, we are also keen on doing a Bitcoin IPO because that way we could have more control over the company (not giving away voting rights) and steer the company to the direction more beneficial to the Bitcoin ecosystem instead of a 4-5 years exit plan. </p> <p>I am mainly looking advice on:</p> <ul> <li><p>Valuation in both scenarios. We believe we could get higher valuation through a Bitcoin IPO. </p></li> <li><p>How much goodwill Bitcoin fans and current Bitcoin millionaires have to build the ecosystem</p></li> <li><p>Credibility: a VC investment would give us more real-world credibility</p></li> <li><p>Bitcoin is hot in old-fashioned VC industry right now. We have been contacted by several world-class VCs by themselves to discuss with us.</p></li> <li><p>The legal implications: what is the relationship between pass-through shares and real shares? Should we move to live underground after a Bitcoin IPO to avoid possible later legal mess?</p></li> <li><p>Should we found the company in some tax haven where laws are more relaxed (e.g. Seychelles)</p></li> <li><p>It seems that the Bitcoin stock exchange industry is little shady, and it's hard to trust pseudonyms. Is it still too early to go there, as it might be that stock exchanges will be crashing within a year, like fiat money exchanges have, and we end up with a complete mess and lost information on shareholders, dividends and ownership?</p></li> </ul>
0non-cybersec
Stackexchange
How to execute Netscaler commands through a remote machine via SSH connection. <p>I have been trying to execute some NetScaler commands like "bind" &amp; "unbind" through a Linux Box via an SSH Connection. Now the Problem is, Manually we are able to enter &amp; execute commands on NetScalar, but through SSH we are not. Netscaler is a hardware device (or network appliance) manufactured by Citrix, which primary role is to provide Level 4 Load Balancing. It also supports Firewall, proxy and VPN functions.</p> <p>if we log on to the Machine (in which NetScaler is configured), through a connection manager(Putty) we get a different prompt other than the shell. &amp; Here we need to execute the commands like ...</p> <p>unbind lb vserver VS_Netbanking_443_26 -policyName manual_checkSession</p> <p>&amp;</p> <p>bind lb vserver VS_Netbanking_443_26 -policyname manual_checkSession -priority 155</p> <p>which we are able to execute, But when we try to execute the same through script (as given below), we are not able to.</p> <p>./rem_expect_con.sh $SERVER $PASSWORD <code>`unbind lb vserver VS_Netbanking_443_26 -policyName manual_checkSession</code> `</p> <p>&amp;</p> <p>./rem_expect_con.sh $SERVER $PASSWORD <code>`bind lb vserver VS_Netbanking_443_26 -policyname manual_checkSession -priority 155</code> `</p> <p>Above "rem_expect_con" is a script built for Password less connection.</p> <p>i have tried giving above arguments as</p> <p>./rem_expect_con.sh $SERVER $PASSWORD 'bind lb vserver VS_Netbanking_443_26 -policyname manual_checkSession -priority 155'</p> <p>./rem_expect_con.sh $SERVER $PASSWORD "bind lb vserver VS_Netbanking_443_26 -policyname manual_checkSession -priority 155"</p> <p><code>`./rem_expect_con.sh $SERVER $PASSWORD "bind lb vserver VS_Netbanking_443_26 -policyname manual_checkSession -priority 155"</code> `</p> <p>But none of them are working. None of them are executing on the Netscaler. Please help.</p>
0non-cybersec
Stackexchange
Django rest framework- writable(create,update) double nested serializer. <p>I am trying to create a nested serializer using DJANGO REST FRAMEWORK.</p> <p>But I don't know how to use create update methods in serializer.py. I already have created models and some working serializers.</p> <p>models.py </p> <pre class="lang-py prettyprint-override"><code>class JournalEntry(models.Model): CHOICES = ( ('SALES', 'Sales'), ('PURCHASE', 'Purchase'), ('DEBITNOTE', 'DebitNote'), ('CREDITNOTE', 'CreditNote'), ('COSTOMER_RECIEPT', 'CustomerReceipt'), ('SUPPLIER_PAYMENT', 'SupplierPayment'), ('EXPENSE', 'Expense'), ('JOURNAL', 'Journal'), ) date = models.DateField() transaction_type = models.CharField(max_length=15, choices=CHOICES, default='SALES',null=True, blank=True) description = models.CharField(max_length=15,null=True, blank=True) @property def child(self): return self.journalitem_set.all() class JournalItem(models.Model): journal_entry = models.ForeignKey('core.JournalEntry', on_delete=models.CASCADE) account = models.CharField(max_length=15, choices=CHOICES, default='SALES',null=True, blank=True) partner = models.ForeignKey(Customer, on_delete=models.CASCADE, null=True, blank=True) debit_amount = models.DecimalField(max_digits=15,decimal_places=2,null=True, blank=True) credit_amount = models.DecimalField(max_digits=15,decimal_places=2,null=True, blank=True) class CustomerReceipt(models.Model): reciept_no = models.IntegerField() journal_entry = models.ForeignKey(JournalEntry, on_delete=models.CASCADE, null=True, blank=True) </code></pre> <p>serializer.py, some required serializers are already did.</p> <pre class="lang-py prettyprint-override"><code>class JournalItemSerializer(serializers.ModelSerializer): id = serializers.IntegerField(required=False) class Meta: model = JournalItem fields = [ 'id','journal_entry', 'account','partner', 'debit_amount','credit_amount' ] read_only_fields = ('journal_entry',) class JournalEntrySerializer(serializers.ModelSerializer): child = JournalItemSerializer(many=True) class Meta: model = JournalEntry fields = ('id','date','transaction_type','description','child') def create(self, validated_data): albums_data = validated_data.pop('child') musician = JournalEntry.objects.create(**validated_data) for album_data in albums_data: JournalItem.objects.create(journal_entry=musician, **album_data) return musician def update(self, instance, validated_data): child = validated_data.pop('child') # albums = (instance.child).all() # albums = list(albums) instance.date = validated_data.get('date', instance.date) instance.transaction_type = validated_data.get('transaction_type', instance.transaction_type) instance.description = validated_data.get('description', instance.description) instance.save() keep_choices = [] for choice in child: if "id" in choice.keys(): if JournalItem.objects.filter(id=choice["id"]).exists(): c = JournalItem.objects.get(id=choice["id"]) c.account = choice.get('account', c.account) c.partner = choice.get('partner', c.partner) c.debit_amount = choice.get('debit_amount', c.debit_amount) c.credit_amount = choice.get('credit_amount', c.credit_amount) c.save() keep_choices.append(c.id) else: continue else: c = JournalItem.objects.create(**choice, journal_entry=instance) keep_choices.append(c.id) for choice in instance.child: if choice.id not in keep_choices: choice.delete() return instance </code></pre> <p>i need to add <strong>create</strong> and <strong>update</strong> method in <strong>CustomerReceiptSerializer</strong> .i need to work all operation(DELETE,PUT,PATCH $ POST) on the corersponding api.</p> <pre class="lang-py prettyprint-override"><code> class CustomerReceiptSerializer(serializers.ModelSerializer): journal_entry = JournalEntrySerializer() class Meta: model = CustomerReceipt # fields = ('reciept_no', 'journal_entry') fields = "__all__" def create: ...... def update: ...... class CustomerReceiptViewSet(viewsets.ModelViewSet): serializer_class = serializers.CustomerReceiptSerializer queryset = models.CustomerReceipt.objects.all() </code></pre> <p>the output like,</p> <pre><code>{ "id": 1, "journal_entry": { "id": 1, "date": "2019-05-09", "transaction_type": "SALES", "description": "description", "child": [ { "id": 1, "journal_entry": 1, "account": "Sales", "partner": null, "debit_amount": "400.00", "credit_amount": "400.00" }, { "id": 1, "journal_entry": 1, "account": "Purchase", "partner": null, "debit_amount": "800.00", "credit_amount": "400.00" } ] }, "reciept_no": 1 } </code></pre> <pre><code> json data for post into api is like, { "reciept_no": 1 "journal_entry": { "date": "2019-05-09", "transaction_type": "SALES", "description": "description", "child": [ { "account": "Sales", "partner": null, "debit_amount": "400.00", "credit_amount": "400.00" }, { "account": "Purchase", "partner": null, "debit_amount": "800.00", "credit_amount": "400.00" } ] } } </code></pre> <pre><code>iam using , Django - 2.1.3, djangorestframework - 3.9.0 </code></pre>
0non-cybersec
Stackexchange
homomorphism between smooth algebraic groups of the same dimension. <p>For Lie groups, we have a theorem:</p> <blockquote> <p>Suppose $G$ and $G'$ are Lie groups of the same dimension, $G'$ is connected, and $f : G \to G'$ is a homomorphism of Lie groups with discrete kernel. Then, $f$ is surjective. (In particular, $G$ is a covering of $G'$.)</p> </blockquote> <p>Clearly, this also works for algebraic groups in characteristic $0$. My question is does a similar statement hold for smooth algebraic groups in arbitrary characteristic?</p>
0non-cybersec
Stackexchange
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
How to type the use of Material-UI&#39;s `withStyles` decorator in the example?. <p>I'm trying to figure out how to annotate the types of the following styles (I converted from plain JavaScript to TypeScript and am adding type annotations):</p> <pre><code>import * as React from 'react' import { withStyles } from '@material-ui/core' @withStyles(styles) // TYPE ERROR HERE export default class App extends React.Component&lt;{}, {}&gt; { render(): JSX.Element { return ( &lt;div className="some-class"&gt; Hello &lt;/div&gt; ) } } function styles() { return { // assume I need to use global styles, my actual project is more // complex and for some reasons I need to use global styles '@global': { '.some-class': { overflowX: 'hidden' }, }, } } </code></pre> <p>How do we type this?</p> <p>At first, it gives me an error like:</p> <pre><code> Types of property 'overflowX' are incompatible. Type 'string' is not assignable to type '"scroll" | "hidden" | "visible" | "auto" | "clip" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | undefined'. </code></pre> <p>So I changed it to the following which uses <code>createStyles</code>:</p> <pre><code>import * as React from 'react' import { withStyles, createStyles } from '@material-ui/core' @withStyles(styles) // TYPE ERROR HERE export default class App extends React.Component&lt;{}, {}&gt; { render(): JSX.Element { return ( &lt;div className="some-class"&gt; Hello &lt;/div&gt; ) } } function styles() { return createStyles({ // assume I need to use global styles, my actual project is more // complex and for some reasons I need to use global styles '@global': { '.some-class': { overflowX: 'hidden' }, }, }) } </code></pre> <p>And now I get this error:</p> <pre><code>tmp.tsx:5:1 - error TS1238: Unable to resolve signature of class decorator when called as an expression. Type 'ComponentClass&lt;Pick&lt;{}, never&gt; &amp; StyledComponentProps&lt;"@global"&gt;, any&gt;' is not assignable to type 'void | typeof App'. Type 'ComponentClass&lt;Pick&lt;{}, never&gt; &amp; StyledComponentProps&lt;"@global"&gt;, any&gt;' is not assignable to type 'typeof App'. Type 'Component&lt;Pick&lt;{}, never&gt; &amp; StyledComponentProps&lt;"@global"&gt;, any, any&gt;' is not assignable to type 'App'. Types of property 'render' are incompatible. Type '() =&gt; ReactNode' is not assignable to type '() =&gt; Element'. Type 'ReactNode' is not assignable to type 'Element'. Type 'undefined' is not assignable to type 'Element'. 5 @withStyles(styles) // TYPE ERROR HERE ~~~~~~~~~~~~~~~~~~~ </code></pre> <p>In my actual, more-complicated code, the error is similar, about not being able to match the <code>Component</code> type:</p> <pre><code>App.tsx:44:1 - error TS1238: Unable to resolve signature of class decorator when called as an expression. Type 'ComponentClass&lt;Pick&lt;AppProps, never&gt; &amp; StyledComponentProps&lt;"@global"&gt;, any&gt;' is not assignable to type 'void | typeof App'. Type 'ComponentClass&lt;Pick&lt;AppProps, never&gt; &amp; StyledComponentProps&lt;"@global"&gt;, any&gt;' is not assignable to type 'typeof App'. Type 'Component&lt;Pick&lt;AppProps, never&gt; &amp; StyledComponentProps&lt;"@global"&gt;, any, any&gt;' is not assignable to type 'App'. Property 'makeOnStatusWindowClick' is missing in type 'Component&lt;Pick&lt;AppProps, never&gt; &amp; StyledComponentProps&lt;"@global"&gt;, any, any&gt;'. 44 @withStyles(styles) ~~~~~~~~~~~~~~~~~~~ </code></pre> <p>where <code>makeOnStatusWindowClick</code> is the very first method defined in my component class.</p>
0non-cybersec
Stackexchange
Algebraic conjugates. <p>Suppose $L/K$ is an algebraic field extension. Take $\alpha_1 \in L$. Then $\alpha_1$ has minimal polynomial $f(x)$ over $K$. Let $\alpha_2, ... \alpha_k$ be the other roots of $f$ in $L$. The $\alpha_i$ are known as algebraic conjugates.</p> <p>Suppose I am given an $\alpha \in L$ and wish to find the minimal polynomial of $\alpha$ over $K$. It'd be helpful if I knew something about how the algebraic conjugates of $\alpha$ behaved. </p> <p>Let's take a concrete example. Suppose $L = \mathbb Q(\sqrt{3})$ and $K = \mathbb Q$, and I want to know the minimal polynomial of $2 + \sqrt{3}$. I could work it out by writing $ x = 2 + \sqrt{3}$, squaring, rearranging and squaring again. But this would quickly become cumbersome if we chose a more complicated extension and complicated $\alpha$. I know its a good idea to look at the product $ \prod (x - \alpha_i) $, where the $\alpha_i$ are algebraic conjugates of $\alpha$. What are the algebraic conjugates of $ 2 + \sqrt{3} $? I 'know' they are $ \pm 2 \pm \sqrt{3}$, but why is this? </p> <p>I suppose my question really comes down to:</p> <p>i) Why are the conjugates of $2 + \sqrt{3}$ those mentioned above? Why do the symmetric sums and products involved in Vieta's formulas yield rationals in this case?</p> <p>ii) Are there any other 'types' of $\alpha$ (and/or $L$) for which the form of its conjugates are known?</p> <p>Thanks</p>
0non-cybersec
Stackexchange
Debian live server mirroring (copy) of main server. <p>I am installing a debian server and I need to install a mirror of that server, so that in case of problems with the main one, the users can connect to the mirror transparently. Any change in the main server should be reflected in the second one. Mostly i would have to sync postgresql and mysql datababases, but if possible the whole system.</p> <p>What are my options ?</p> <p><strong>Edit:</strong> This is what i was looking for: <a href="http://www.howtoforge.com/installing-a-web-email-and-mysql-database-cluster-on-debian-6.0-with-ispconfig-3" rel="nofollow noreferrer">http://www.howtoforge.com/installing-a-web-email-and-mysql-database-cluster-on-debian-6.0-with-ispconfig-3</a></p>
0non-cybersec
Stackexchange
SSH access without opening firewall ports. <p>I have a device running Linux (Debian) installed at a remote location with internet access. </p> <p>I can't modify the remote location's firewall, and the public IP address is dynamic.</p> <p>How can I access this machine via SSH from outside the machine's LAN, without modifying the firewall to port-forward port 22 to the machine?</p> <p>NOTE: I have a web-facing cloud server available with static IP address, and the remote device contacts this server every 5 seconds to retrieve configuration data. I could push a command to the device if necessary to initiate some sort of reverse SSH tunnel, but I'm not sure how to then utilize that tunnel from the server and/or my local desktop.</p> <p>Having the ability to SFTP files to the device from either the cloud server or my local desktop would be a huge added bonus.</p> <p>Thanks for any advice or suggestions on how to accomplish this!</p>
0non-cybersec
Stackexchange
What are some free services on the internet everyone should know about?.
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
Anaphoric list comprehension in Python. <p>Consider the following toy example:</p> <pre><code>&gt;&gt;&gt; def square(x): return x*x ... &gt;&gt;&gt; [square(x) for x in range(12) if square(x) &gt; 50] [64, 81, 100, 121] </code></pre> <p>I have to call square(x) twice in the list comprehension. The duplication is ugly, bug-prone (it's easy to change only one of the two calls when modifying the code), and inefficient.</p> <p>Of course I can do this:</p> <pre><code>&gt;&gt;&gt; squares = [square(x) for x in range(12)] &gt;&gt;&gt; [s for s in squares if s &gt; 50] [64, 81, 100, 121] </code></pre> <p>or this:</p> <pre><code>[s for s in [square(x) for x in range(12)] if s &gt; 50] </code></pre> <p>These are both livable, but it feels as though there might be a way to do it all in a single statement without nesting the two list comprehensions, which I know I'll have to stare it for a while next time I'm reading the code just to figure out what's going on. Is there a way?</p> <p>I think a fair question to ask of me would be what I imagine such syntax could look like. Here are two ideas, but neither feels idiomatic in Python (nor do they work). They are inspired by <a href="http://community.schemewiki.org/?anaphoric-if">anaphoric macros in Lisp</a>.</p> <pre><code>[square(x) for x in range(12) if it &gt; 50] [it=square(x) for x in range(12) if it &gt; 50] </code></pre>
0non-cybersec
Stackexchange
Grizzly Stealth Techniques.
0non-cybersec
Reddit
MTPro2 and pmatrix. <p>I am using the <code>mtpro2</code> package for math. Recently I changed the <code>pmatrix</code> enviroment like the MWE shows, in order to use the <code>\PARENS</code> command for the parenthesis of the matrix.</p> <pre><code>\documentclass[11pt]{article} \usepackage[lite]{mtpro2} \usepackage[no-math,cm-default]{fontspec} \usepackage{xunicode} \usepackage{xgreek} \usepackage{amsmath} \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} \setmainfont[Mapping=tex-text,Numbers=Lining,Scale=1.0,BoldFont={Minion Pro Bold}]{Minion Pro} \usepackage{environ} \let\pmatrix\relax \let\endpmatrix\relax \NewEnviron{pmatrix}{\PARENS{\begin{matrix}\BODY\end{matrix}}} \expandafter\let\csname pmatrix*\endcsname\relax \expandafter\let\csname endpmatrix*\endcsname\relax \NewEnviron{pmatrix*}[1][c]{\PARENS{\begin{matrix*}[#1]\BODY\end{matrix*}}} \begin{document} \begin{gather*} \begin{pmatrix} 1&amp;2&amp;1\\0&amp;1&amp;1\\0&amp;0&amp;0 \end{pmatrix} \end{gather*} \end{document} </code></pre> <p>If I place the <code>pmatrix</code> enviroment inside <code>\[ \]</code> then everything works fine. The <code>pmatrix</code> inside the <code>gather</code>, <code>gather*</code> or any other math enviroment does not compile an gives the following error:</p> <pre><code>Argument of \pmatrix has an extra }. \end{gather} </code></pre> <p>and a bunch of other errors.</p>
0non-cybersec
Stackexchange
Traditional tiger head done by Sue Garcia at Valor Tattoo in bucks county PA..
0non-cybersec
Reddit
roughly how much faster is a MacBook pro 13&quot; (the basic) compared to the basic 13&quot; MacBook air. <p>Im looking at buying a MacBook over the summer and have been looking at two different models, the Air and Pro models above, does anyone know roughly how much faster (or slower) the Pro will be compared to the Air. My immediate reaction would be to think the Pro would be loads faster due to the much higher spec but having had a go with them the Air certainly seems to benefit from the SSD - any comments appreciated! Thanks =)</p>
0non-cybersec
Stackexchange
[Idea]Dungeons: content for solo and rural players that puts walking back in the game.. Inspired by all the people who can't get groups together for raids, as well as the complaints about the game turning into Pokemon Drive and Pokemon Stop At The Gym For 30 Minutes To Wait For People. This is meant to address the problems of rural diversity, biome dependency even for cities, over-reliance on raiding, and the lack of walking in the current state of the game, all in one fell swoop. ***** Dungeons can be activated at any time, and are available on a cooldown of 21 hours. 3 types of dungeon are selected (cave, beach, desert, field etc.), and you choose which one to walk. Once activated you are given a distance to walk between 1km and 3km, depending on the dungeon's difficulty, ~~as well as a time limit (a very easy one, like an hour for 1km)~~. Completing that distance gives you a puzzle to complete depending on the dungeon (pushing rocks in a cave, a sliding puzzle for an ice cave, directional panels etc.), again depending on the difficulty of the dungeon. Completing the puzzle drops items and causes a pokemon to spawn for you based on the dungeon (Geodude for caves, Sandshrew for deserts, Krabby for ocean etc.). Failing the puzzle boots you from the dungeon. This is repeated three times, with the final puzzle guaranteeing an uncommon pokemon and occasionally something rare, with the odds increasing with difficulty. It also drops more and better items. Essentially, Dungeons require a walk between 3km and 9km to complete. ~~The time limit isn't stringent, so this can be done at a leisurely pace.~~ It also doesn't matter where you walk, so rural players can do this just as easily. Perhaps even more easily, given that they have fewer roads and people to be careful of while going. Successfully completing a dungeon gives the option of doing a dungeon of a higher difficulty next time, while failing a puzzle resets the difficulty to level 1. Higher level dungeons have rarer pokemon and more and better items, including raid items. Dungeons go up to level 7, and successfully completing one of those drops an Old Map that allows you to take on a Secret Dungeon. The difficulty resets to 1 regardless after this. Secret Dungeons are much more gruelling than regular dungeons, requiring 5 puzzles at 3km each (total of 15km). You can hold more than one Map, but you can't use more than one within 48 hours of each other. You can just save them for when you have time to walk that much. The puzzles are at their most fiendish, but they drop evolution items and raid items, including TMs, and the pokemon that spawn are some of the rarest. Clearing all 5 puzzles spawns a legendary pokemon. ***** It's a lot more effort to go to than getting the group together for a raid, but Dungeons would put the walking back into the game and offer solo and rural players a shot at legendaries. It could also work as a way to introduce roaming legendaries, like the Dogs: every Dungeon Pokemon has a small chance of being replaced by one of the Dogs (only once per dungeon, and never in Secret Dungeons since you're getting a legendary anyway). They have 100% flee rates, so you only get one shot at them. Other bonuses could include increasing buddy candy if that buddy matches the dungeon you're in, or a small discount on egg distance. **TL;DR**: Dungeons make players walk for their legendaries, picking up extra items and out-of-biome pokemon on the way, and it works just as well for rurals as urban players. ***** **EDIT/REVISION:** Lots of concerns raised about the distances involved and time limits. You are completely correct. Dungeons should probably work more like an egg, then: walk a certain distance in your own time to pop the goodies. The difference is that you can't walk more than one dungeon at once. If you take more than the 21 hour cooldown to finish a Dungeon, you can start another one immediately. The 48 hour cooldown on Secret Dungeons is separate, but you still can't run one at the same time as a regular Dungeon. **EDIT 2:** Couple of suggestions for fighting Dungeon pokemon before catching them, like a gym battle or a scaled down raid. Could potentially replace puzzles, since those would take the most resources to develop anyway. I'd say that you simply catch the regular encounters, with a mini-raid against the Dungeon Boss at the end (which, remember, is an uncommon or rare pokemon for that Dungeon's biome, or a legendary for Secret Dungeons).
0non-cybersec
Reddit
Use DOM background layer with keyframe animations and Canvas layer for a physic engine. <p>In my next game I'm planning to mix a DOM background layer with the canvas(es) on top of it. I would like to move non-interactive background animations to that DOM layer, and use keyframe animations for transformations and opacity changes, like moving clouds around, air-planes etc. </p> <p>As for me there are 2 pros for this:</p> <ol> <li><p>Simple keyframe animations are much easier to create. <em>imho</em></p></li> <li><p>The <strong>most interesting</strong> point - it should improve performance:</p> <ul> <li><code>transform</code> and <code>opacity</code> animations can be GPU accelerated and performed on separate thread.</li> <li>we do not perform those animations in our render frames, so we save here some milliseconds. </li> </ul></li> </ol> <p>Or am I wrong? Perhaps browsers need much more time to make the composition of those layers, or are there some other caveats?</p> <p>The biggest contrary for this technique is, that we can use it mostly for the decoration animations, and not for our game-play, as to control those animations is the hard task. </p> <p>Does anybody have an experience with such layering?</p> <p>Thank you in advance.</p>
0non-cybersec
Stackexchange
Chances of getting a knock off?. to preface, yes i know the dangers of getting makeup off of eBay. trust me I do! but my judgement lapsed. terribly anyway, I had been wanting the nars x Sarah moon eyeshadow and face palette for some time but, uh, forgot to get it until it wasn't available anymore. I figured since it was a LE item and honestly not so very popular that I could get it off of eBay. the sellers ratings were fine (and feedback minus some wonky ratings on vitamins?) but now I'm second guessing myself. I think the chances are slim but I really can't hold anyone above it. it's not like I got a naked palette for 10$ and whoops it's fake, it was a reasonable price for the palette and it's from a US seller. pics looked ok. I'm contemplating just returning it once I get it however. so: opinions?
0non-cybersec
Reddit
Acadec meme #5.
0non-cybersec
Reddit
Opening PDF String in new window with javascript. <p>I have a formatted PDF string that looks like </p> <pre><code>%PDF-1.73 0 obj&lt;&lt;&lt; /Type /Group /S /Transparency /CS /DeviceRGB &gt;&gt; /Resources 2 0 R/Contents 4 0 R&gt;&gt; endobj4 0 obj&lt;&gt; streamx��R=o�0��+��=|vL�R���l�-��ځ,���Ge�JK����{���Y5�����Z˯k�vf�a��`G֢ۢ��Asf�z�ͼ��`%��aI#�!;�t���GD?!���&lt;�����B�b�� ... 00000 n 0000000703 00000 n 0000000820 00000 n 0000000926 00000 n 0000001206 00000 n 0000001649 00000 n trailer &lt;&lt; /Size 11 /Root 10 0 R /Info 9 0 R &gt;&gt;startxref2015%%EOF </code></pre> <p>I am trying to open up this string in a new window as a PDF file. Whenever I use window.open() and write the string to the new tab it thinks that the text should be the contents of an HTML document. I want it to recognize that this is a PDF file.</p> <p>Any help is much appreciated</p>
0non-cybersec
Stackexchange
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
Anaconda 3 Navigator Not Opening. <p>I have installed Anaconda 3 on my computer and it will not open the navigator or let me run any of the programs, such as Jupyter Notebooks or Spyder. When I click on the Navigator app it briefly opens two black screens and then closes and then doesn't do anything. If I try to run it from the command prompt it gives me the following error.</p> <pre><code>&gt;anaconda-navigator </code></pre> <p>WARNING: The conda.compat module is deprecated and will be removed in a future release. Traceback (most recent call last): File "C:\Users\micha\Anaconda3\Scripts\anaconda-navigator-script.py", line 10, in sys.exit(main()) File "C:\Users\micha\Anaconda3\lib\site-packages\anaconda_navigator\app\main.py", line 103, in main from anaconda_navigator.app.start import start_app File "C:\Users\micha\Anaconda3\lib\site-packages\anaconda_navigator\app\start.py", line 34, in from anaconda_navigator.widgets.main_window import MainWindow File "C:\Users\micha\Anaconda3\lib\site-packages\anaconda_navigator\widgets\main_window.py", line 37, in from anaconda_navigator.utils.analytics import GATracker File "C:\Users\micha\Anaconda3\lib\site-packages\anaconda_navigator\utils\analytics.py", line 44, in from anaconda_navigator.external.UniversalAnalytics import Tracker File "C:\Users\micha\Anaconda3\lib\site-packages\anaconda_navigator\external\UniversalAnalytics\Tracker.py", line 28, in from six.moves.urllib.request import (HTTPSHandler, Request, build_opener, ImportError: cannot import name 'HTTPSHandler' from 'six.moves.urllib.request' (unknown location)</p> <p>I have attempted to uninstall and reinstall many times and I attempted to manually install an SSL package because some people suggested this worked for them.</p> <p>Any help with this matter would be greatly appreciated.</p>
0non-cybersec
Stackexchange
Sorry for those who had April Fool's memes on deck.
0non-cybersec
Reddit
Can I use Pollard&#39;-Rho even when the order is not a Prime?. <p>I am now solving the ECDL problem.</p> <p>I want to use [discrete_log_rho] in SageMath, but I can not use it because ORDER is not a prime number.</p> <p>Can I change it to a decimal number close to ORDER at my disposal?</p> <p>I tried to use another method, but the size of F was 100bit, so I could not use BSGS because of memory problem.</p> <p>If I can not use Pollard's-Rho and BSGS, what else is there?</p>
0non-cybersec
Stackexchange
A scientist explains what would actually happen if you took a pool full of liquor and dived in.
0non-cybersec
Reddit
I think I’ve found an r/insanepeoplefacebook goldmine.
0non-cybersec
Reddit
Should Wrathion, Merithra become the leader of their respected Ascepts?. Deathwing is no more. Ysera is at peace and with elune. Both Dragonflights have no leader to lead them, so should Wrathion become the Earth-warder and Merithra the Dreamer?
0non-cybersec
Reddit
iOS - Increase timeout for AFHTTPRequestOperationManager. <p>I'm downloading JSON data from a very slow server. It takes about a minute to get a resoonse from the server. I use AFNetworking library and my code throws "The request timed out" error:</p> <pre><code>NSString *urlString = [NSString stringWithFormat:@"%@/account.do?JSON&amp;sysparm_action=getRecords",baseUrlString]; NSString *login = [[NSUserDefaults standardUserDefaults] objectForKey:@"login"]; NSString *password = [[NSUserDefaults standardUserDefaults] objectForKey:@"password"]; [manager setRequestSerializer:[AFHTTPRequestSerializer serializer]]; [manager.requestSerializer setAuthorizationHeaderFieldWithUsername:login password:password]; [manager GET:urlString parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) { NSLog(@"JSON: %@", responseObject); [self parseJsonWithAccountsData:responseObject]; } failure:^(AFHTTPRequestOperation *operation, NSError *error) { NSLog(@"Error: %@", operation.responseString); [self performSelectorOnMainThread:@selector(failedWithContactsDownload) withObject:nil waitUntilDone:YES]; }]; </code></pre> <p>Didn't find a way to set a timeout for <code>AFHTTPRequestOperationManager</code>. How can I do it?</p>
0non-cybersec
Stackexchange
My [28f] boyfriend [37m] has a lot of friends that are girls I didn’t know about. My bf and I have been seeing each other for six months but we were seeing other people until last month. He didn’t want to put labels on it for a while because he’s really busy at his job blah blah. I almost broke up with him over it but the last month he stepped it up, got off dating apps, and told me he was committed to our relationship. He’s told me from the beginning he has more friends that are girls than guys, which I am fine with. But yesterday he left his computer open and I saw his text messages. He was receiving selfies from girl friends holding a beer saying “long day” others saying they need to meet up soon and relax together, texts from another girl asking him what he’s doing that night. I stormed out when I saw that and he ran after me. The first thing he said was “well you were talking to other guys too!” (Which isn’t true) but it seemed like he was trying to justify it by gaslighting me?? It just seemed like a lot of girls I didn’t know about. Like the other day he said he went to help his friend Jared move. I saw in the messages a girl (who sent him the selfie and asked what he was doing that night) had been there and he hadn’t mentioned that. When I asked why he didn’t mention it, he said because she’s just a neighbor and he saw her there. I asked why she was sending him a selfie and he said it was just friendly. He told one girl he waits for her to text him so he “knows it’s safe” I asked him what the hell that means and he said it’s his friend and he said that because her boyfriend doesn’t like him and doesn’t like when he contacts her. Another girl was clearly flirting with him sending him a picture of her bed and saying they should hang out. He said he was just being nice to her because he has to do work with her for his company. He also told another girl friend he had just booked a trip to Europe, but he has yet to tell me that information and I have no idea why. The weird part is, we hang out ALL THE TIME and I don’t even know how he would have time to meet up with all these girl friends. I just don’t know if I trust him because it took so long for him to commit to me. It seems like he’s keeping some girls on the back burner or something. At the same time, I know because he waited that he’s in the relationship now only because he’s ready. Maybe it’s hard for him to cut off old habits? Am I reading too much into this? Tl;dr my boyfriend texts a lot of girls during the day I didn’t know about. Don’t know if I should trust it.
0non-cybersec
Reddit
ITAP of a neighborhood.
0non-cybersec
Reddit
Get the attributes from the interface methods and the class methods. <p>Whats the best approach for getting the attribute values from a classes methods and from the interface methods when the methods are overloaded?</p> <p>For example I would want to know that in the following example the Get method with one parameter has the two attributes and the values are 5 and "any" while the other method has attributes with values 7 and "private".</p> <pre><code>public class ScopeAttribute : System.Attribute { public string Allowed { get; set; } } public class SizeAttribute : System.Attribute { public int Max { get; set; } } public interface Interface1 { [SizeAttribute( Max = 5 )] string Get( string name ); [SizeAttribute( Max = 7 )] string Get( string name, string area ); } public class Class1 : Interface1 { [ScopeAttribute( Allowed = "any" )] public string Get( string name ) { return string.Empty; } [ScopeAttribute( Allowed = "private" )] public string Get( string name, string area ) { return string.Empty; } } </code></pre>
0non-cybersec
Stackexchange
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
How can I restore Mozilla Firefox crashed session from &quot;sessionrestore-backups&quot; .jsonlz4 file?. <p>My Firefox (Quantum v.66 on Windows 10) crashed, and I accidentally clicked "Start New Session" instead of "Restore Session", which lost all of my previous tabs.</p> <p><strong>Good news</strong>: In my profile, in "sessionstore-backups" folder, I found a large file called previous.jsonlz4, which SEEMS like it contains all of my previous tabs and windows.</p> <p>I confirmed that it's a valid file using <a href="https://www.jeffersonscher.com/ffu/scrounger.html" rel="nofollow noreferrer">Session History Scrounger for Firefox</a> tool that seemed to be the only useful resource my Googling turned up on the topic.</p> <p><strong>Bad news</strong>: After a couple of days of Googling, I can't seem to figure out how to restore the data from jsonlz4 file <strong>to my browser's tabs</strong> (basically, turn it back into crash session restore).</p> <h1>How can I do that?</h1> <p><strong>What I tried:</strong></p> <ul> <li><p>Copied that jsonlz4 into "sessionrestore-backups" directory as "recovery.jsonlz4" - which seems to be the file that gets updated when FF crashes as per my experiments. This had no effect.</p></li> <li><p>Copied the JS file that Scrounger created for me into previous.js and recovery.js. No effect.</p></li> <li><p>Deleted "store.json.mozlz4" file in "crashes" subdirectory in my profile. No effect.</p></li> </ul> <p><strong>Notes:</strong></p> <ul> <li><p>Note: I am <strong>NOT</strong> looking for random ways to get a list of URLs from the JS file that Scrounger created. I know how to do that. I want to actually import my crashed session into crash session recovery in FireFox, or into active Firefox session.</p></li> <li><p>Note: I'm aware of <a href="https://superuser.com/questions/394896/how-do-i-use-firefox-sessionstore-files-to-restore-my-crashed-session">this similar question</a> but it asks about pre-version-57 session format circa 2012, which seems to have nothing to do with modern post-version-57 session mechanism.</p></li> </ul>
0non-cybersec
Stackexchange
"It's a miracle!" - my mom immediately gave credit to God when my wife's major surgery for a chronic illness went well. I stopped her right then and there.. The conversation went something like this: Mom: "So, how is osirisfrost'swife doing?" OP: "Much better! She's in a lot less pain than before, has a lot more energy and she's getting her old wit back" M: "oh that's wonderful! It's a miracle!" OP: "Well, I don't know about that" M: "how is that not a miracle! Thank God!" OP: "Well, it would be a miracle if she suddenly got better without any medical intervention. She was worked on by a top-level specialist along with her team of 5 surgeons for a little under 6 hours. And that specialist has been constantly training for decades and even went to New Zealand to train alongside other specialists. I'd say her surgeon is the one to thank, and I will" M: "What about God?" OP: "He didn't have the required training" Edit: holy crap this went boom! Thank you everyone for the support. I've been reading my wife your guys' comments and she's really feeling the love. You guys rock and also, thanks for the silver kind strangers!
0non-cybersec
Reddit
New users&#39; directories owned by root. <p>On a CentOS server running Plesk, new users are added for each new domain. The users' home directories are in <code>/var/www/vhosts/</code>. New users' home directories are owned by root, and need to have an admin with root access come in and <code>chown</code> them:</p> <pre><code>dotan@sh2:~$ echo $HOME /var/www/vhosts/someDomain.com dotan@sh2:~$ pwd /var/www/vhosts/someDomain.com dotan@sh2:~$ touch testFile touch: cannot touch `testFile': Permission denied dotan@sh2:~$ ls -la ../ | grep someDomain drwxr-xr-x 13 root root 4096 2012-08-07 19:47 someDomain.com dotan@sh2:~$ whoami dotan dotan@sh2:~$ chown dotan /var/www/vhosts/someDomain.com chown: changing ownership of `/var/www/vhosts/someDomain.com': Operation not permitted dotan@sh2:~$ </code></pre> <p>Why might the new users' directories be owned by root, and how might we fix this?</p> <p>Thanks.</p>
0non-cybersec
Stackexchange
"We will hold out until our last bullet is spent. Could do with some whiskey". 156 Irish Troops vs 3,500 Mercenaries (& a jet). Siege of Jadotville, Congo Crisis - September 1961 [720x478].
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
Preventing rings from turning fingers green?. So, I recently brought, as a memento of a pretty good two day holiday, this amazing ring (http://i.imgur.com/MRPMF.jpg). However, I am having a slight problem in that the band of my finger is slowly turning green. How the bloody hell do I stop this while being able to keep this ring on my finger? Getting a new ring is not an option I'm afraid due to the memento aspect.
0non-cybersec
Reddit
The old planet selection screen from Destiny, I made with spray paint.. http://imgur.com/a/rqTmi I just recently got into spray paint art. Ever since the first video I watched, I knew I had to do one that involved Destiny somehow. I ended up deciding to do the old planet selection screen. Considering this is only my third piece of art using spray paint, I think it came out really well. Any feedback or advice would be appreciated. Edit: Wow, who ever gave me gold, you are amazing. I didn't even expect many upvotes, let alone gold. This is insane. I can't believe my first post was gilded!! Edit: Wow guys, this has gotten way more traffic than I expected. Thank you so much, this is incredible😄 Edit: For those interested, [here](https://redd.it/5y8x5f) is my most recent Destiny piece.
0non-cybersec
Reddit
4 things I'd like to see in the next iOS....
0non-cybersec
Reddit
What's going on with the Washington Monument on February 16, 2020 at 10:41am?. Somebody showed me a meme on Facebook alluding to something happening at that date and time at the Washington Monument. I did some searching and this was the only thing I could turn up: https://www.reddit.com/r/dankmemes/comments/d81adm/the_washington_monument_is_a_great_place/ Any ideas?
0non-cybersec
Reddit
Realtek gbe family controller throttled at 100mbps. <p>I recently sent my laptop to service and I believe they changed the motherboard. Before that I could get 1000mbps, but now the connection is stuck at 100mbps as you can see in the screenshot:</p> <p><img src="https://i.stack.imgur.com/ntR6n.png" alt="Adapter properties"></p> <p>The router and the cable remained the same. I tried 2 different versions of drivers, including the last one on the realtek website. I performed a clean install of the windows, the speed won't budge.</p> <p>EDIT: The laptop is an ASUS GL752VW</p> <p>I know that most people think it's the cable since that solved the issue in other similar questions, but I tried other cables and the problem persists and as I said, I had 1gbps connection before I sent my laptop to service with the very same cable I use now.</p>
0non-cybersec
Stackexchange
Generic c++ project in Qt creator - No rule to make target. <p>I am trying to import a generic project into Qt creator by following <a href="http://qt-project.org/doc/qtcreator-2.6/creator-project-generic.html#specifying-include-paths" rel="noreferrer">this tutorial</a>. The project has its Makefile which builds multiple separate executables. </p> <p>Running <code>make all</code> in the root directory of the project builds everything correctly.</p> <p>The project has been imported into Qt creator and the sources show no errors regarding includes. When I press build, i get the error <code>No rule to make target</code>all'. Stop.` As if the Makefile is non existent.</p> <p>Where is Qt creator looking for the Makefile?</p>
0non-cybersec
Stackexchange
How to observe shared app groups file changed. <p>I have file which is shared between my app and extensions: Write to file from extension:</p> <pre><code>func writeToFile() { let file = "file.txt" let text = "data" //just a text let dir = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.com.ml.test.apps")! let fileURL = dir.appendingPathComponent(file) do { try text.write(to: fileURL, atomically: false, encoding: .utf8) } catch {/* error handling here */} } </code></pre> <p>Read from the app:</p> <pre><code>func readFromFile() { let file = "file.txt" let dir = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.com.ml.test.apps")! let fileURL = dir.appendingPathComponent(file) do { let text2 = try String(contentsOf: fileURL, encoding: .utf8) NSLog("Dan: \(text2)") } catch {/* error handling here */} } </code></pre> <p>My question is how can I observe changes to this file. In case the extension writes to it and changes data so the app will get notification change and read the file.</p>
0non-cybersec
Stackexchange
ECDSA: Why is SigningKey shorter than VerifyingKey. <p>Total Crypto Noob here.</p> <p>I was wondering why in ECDSA the Signing Key is so much (half of) shorter than the Verifying key?</p> <p>Lets look at some python code:</p> <pre><code>import ecdsa import binascii signing_key = ecdsa.SigningKey.generate(curve=ecdsa.SECP256k1) verifying_key = signing_key.get_verifying_key() print(binascii.hexlify(signing_key.to_string()) print(binascii.hexlify(verifying_key.to_string()) b'662ab496304f2d99aca32d813dbcba3c3ae10ab2b3359fbe43b05ee40b458cec' b'6632feae645469c16cb31d7e1364cae247bd4322040d7089476614399bcf59b2fccf5060686ab09ee64e1b768ba037184e9a87001a4897a745721f99000b44ee' </code></pre> <p>lets assume I send verifying keys over the network or store them someware, it would be nice if they were not so long. Is there a way to compress them?</p> <p>I assume it would be really bad to use the keys vice versa, but I don't understand why.</p>
0non-cybersec
Stackexchange
Did Jaden Smith Shout Me Out?.
0non-cybersec
Reddit
Function that will extract hour values from one table and populate &quot;buckets&quot; of one hour increments in another table. <p>I have data in the following format for people punching their work times in:</p> <pre><code>(dat&lt;-data.frame(Date = c("1/1/19", "1/2/19", "1/4/19", "1/2/19"), Person = c("John Doe", "Brian Smith", "Jane Doe", "Alexandra Wakes"), Time_In = c("1:15pm", "1:45am", "11:00pm", "1:00am"), Time_Out = c("2:30pm","3:33pm","3:00am","1:00am"))) Date Person Time_In Time_Out 1 1/1/19 John Doe 1:15pm 2:30pm 2 1/2/19 Brian Smith 1:45am 3:33pm 3 1/4/19 Jane Doe 3:00pm 3:00am 4 1/2/19 Alexandra Wakes 1:00am 1:00am </code></pre> <p>I am looking to write a function in R or Python that will extract the total number of hours each person worked into 24 different buckets with each bucket as its own column. It would look something like this:</p> <p><a href="https://i.stack.imgur.com/uOrYF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uOrYF.png" alt="enter image description here"></a></p> <p>So in the first case, the person worked from 1:15pm to 2:30 pm, so they worked .75 hours from 1pm to 2pm (13-14), and .5 hours from 2pm to 3pm (14-15). </p> <p>Some things I think may work are...</p> <ol> <li>A series of nested loops</li> <li>A long series of if/then statements</li> <li>Some function in Tidyverse or Pandas that I have not thought of yet.</li> </ol> <p>Attempts from #1 and #2 (?) from above were utter failures. Not sure what the workflow is but any advice is much appreciated.</p> <p>Note that the columns in the resulting table need notbe numbers (could be hour 1, hour 2, etc. or just any factor in general -as long as it represents a 24 hour period of time).</p> <p>My past attempts have included nested for loops like the following:</p> <pre><code>for (i in 1:nrow(data)){ if((int_overlaps(createinterval(data$PunchDate[i],0,1), workinterval[i]))){ `0-1`[i]=1} else{ `0-1`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],1,2), workinterval[i]))){ `1-2`[i]=1} else{ `1-2`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],2,3), workinterval[i]))){ `2-3`[i]=1} else{ `2-3`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],3,4), workinterval[i]))){ `3-4`[i]=1} else{ `3-4`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],4,5), workinterval[i]))){ `4-5`[i]=1} else{ `4-5`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],5,6), workinterval[i]))){ `5-6`[i]=1} else{ `5-6`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],6,7), workinterval[i]))){ `6-7`[i]=1} else{ `6-7`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],7,8), workinterval[i]))){ `7-8`[i]=1} else{ `7-8`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],8,9), workinterval[i]))){ `8-9`[i]=1} else{ `8-9`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],9,10), workinterval[i]))){ `9-10`[i]=1} else{ `9-10`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],10,11), workinterval[i]))){ `10-11`[i]=1} else{ `10-11`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],11,12), workinterval[i]))){ `11-12`[i]=1} else{ `11-12`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],12,13), workinterval[i]))){ `12-13`[i]=1} else{ `12-13`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],13,14), workinterval[i]))){ `13-14`[i]=1} else{ `13-14`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],14,15), workinterval[i]))){ `14-15`[i]=1} else{ `14-15`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],15,16), workinterval[i]))){ `15-16`[i]=1} else{ `15-16`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],16,17), workinterval[i]))){ `16-17`[i]=1} else{ `16-17`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],17,18), workinterval[i]))){ `17-18`[i]=1} else{ `17-18`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],18,19), workinterval[i]))){ `18-19`[i]=1} else{ `18-19`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],19,20), workinterval[i]))){ `19-20`[i]=1} else{ `19-20`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],20,21), workinterval[i]))){ `20-21`[i]=1} else{ `20-21`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],21,22), workinterval[i]))){ `21-22`[i]=1} else{ `21-22`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],22,23), workinterval[i]))){ `22-23`[i]=1} else{ `22-23`[i]=0} if((int_overlaps(createinterval(data$PunchDate[i],23,24), workinterval[i]))){ `23-24`[i]=1} else{ `23-24`[i]=0} } cbind(data, `0-1`, `1-2`, `2-3`, `3-4`, `4-5`, `5-6`, `6-7`, `7-8`, `8-9`, `9-10`, `10-11`, `11-12`, `12-13`, `13-14`, `14-15`, `15-16`, `16-17`, `17-18`, `18-19`, `19-20`, `20-21`, `21-22`, `22-23`, `23-24` ) </code></pre>
0non-cybersec
Stackexchange
Sneezing Corpse.
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
Push to legalize recreational pot use in Maine takes step forward.
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
This is the absolute best picture I've ever taken of my cat..
0non-cybersec
Reddit
What is the correct term for crunching long words in software?. <p>When drawing graphs in one of my software packages (KNIME), long text is "crunched" to fit into limited on-screen space, for example:</p> <pre><code>BROWN RAT becomes BRO... SWALLOW becomes SWA... </code></pre> <p>and so on. I've also seen long text get crunched as follows:</p> <pre><code>THIS IS LONG TEXT becomes THI..XT CHICKEN TIKKA MASALA becomes CHI..LA </code></pre> <p>I've seen this in lots of software. Is there a standard technical term for this feature?</p>
0non-cybersec
Stackexchange
AWStats 7 download - 206 Hits. <p>AWStats 7 shows two rows under download: hits and now 206 hits.</p> <p>I understand that 206 are partial downloads (e.g. when using a download manager).</p> <p>Here are some sample results:</p> <ul> <li>fileA.pdf - 23 hits, 38 206 hits</li> <li>fileB.pdf - 5 hits, 4 206 hits</li> <li>fileC.pdf - 1 hit, 0 206 hits</li> </ul> <p>What I don't understand is if the file was downloaded the sum of both hits, or just the hits: e.g. was fileA.pdf downloaded 23 times, or 61 times?</p>
0non-cybersec
Stackexchange
PHP installation missing while opening website. <p>All was working fine but then suddenly <strong>Your PHP installation appears to be missing the MySQL extension which is required by WordPress</strong> came when I try to my site.</p> <p>Hosting:Godaddy PHP version:5.4.26 MySQL version:5.5.36-cll-lve</p> <p>Pleaes help as my site is down for more than a day andI am suffering earning loss </p>
0non-cybersec
Stackexchange
Solving a nontransitive dice problem. <p>I have a dice problem I would require some help with (especially problem <strong>b</strong>). Here goes the problem: </p> <p>Player 1 and Player 2 are playing a dice game, where both first select one die and then they throw the die. The one who gets a larger number from the throw wins. Player 1 chooses a die first and then Player 2 chooses one. The dice are the following: </p> <pre><code>A: 2,2,2,5,5,5 B: 3,3,3,3,3,6 C: 1,1,1,4,4,4 </code></pre> <p>So for example Player 1 could choose first die A, and then Player 2 could choose die B. </p> <p>a) What die should Player 1 choose so that he always has advantage (i.e. > 50 % chance of winning) no matter what die Player 2 chooses?</p> <p>b) Player 2 is allowed to design a new die and replace it with die C. Then again <strong>Player 1 chooses a die first</strong> and <strong>then Player 2 makes the selection</strong>. What kind of a die should Player 2 design so that he would always have the winning advantage (i.e. > 50 % chance of winning), no matter what die Player 1 chooses?</p> <p>How to approach this problem? Is there an analytical solution for <strong>b</strong>?</p>
0non-cybersec
Stackexchange
Can GDB change the assembly code of a running program?. <p>I want to add some extra funcionality to /bin/ls.<br> So I started it on gdb and added a breakpoint at the beginning.</p> <p>Now question is: how can I change the code of a running program in memory? I can see the assembly code, but I'm not able to modify. How can I do it?</p> <p>On Windows I can easily do this with olldbg for example. How about on Linux?</p> <p>(I know that doing this I will only change the code of the process in memory. So then I can dump memory to a file, and then I'll have my changes saved in a binary file).</p> <p>Thank you.</p>
0non-cybersec
Stackexchange
Change the default language in Liferay. <p>How to change the default for language?</p> <p>When a user logs in for the first time, the default language is English, and I need to change that.</p>
0non-cybersec
Stackexchange
Is there a fast tool to show all the unique unicode characters in a file and their count?. <p>Does anybody know a tool to tabulate all the unique unicode characters and their counts in a file? </p>
0non-cybersec
Stackexchange
150 Years Ago today, My 3x Great Grandfather got home from the Civil War and wrote a single, long diary entry (Links in description).. On May 17th, 1865, William Walsh got back to Providence RI after over three years of service in the union army (R.I. Calvary) and wrote down everything he could remember. William Walsh is my Irish Immigrant Great, Great, Great Grandfather. Years ago, I was given a scan of this diary entry and transcription of what he wrote (his handwriting is at times impossible to read) prepared by Providence College. I have linked it below if you would like to read it. [Original Diary:] (http://www.kfeldman.massachusettsday.com/Walsh_Diary_1865.pdf) ["Translation":] (http://www.kfeldman.massachusettsday.com/Walsh_Civil_War_Diary_transcript.pdf)
0non-cybersec
Reddit
How to validate brackets in equation string in PHP. <p>I was wandering if someone good in PHP could advise on how to validate brackets in an expression sting like this:</p> <pre><code> ( 5 * 3 [ 6 ) - 6] </code></pre> <p>which is wrong expression. I need a function to to do this. Here is what I have tried so far:</p> <pre><code>&lt;?php function hasMatchedParenthesis($string) { $counter1 = 0; $counter2 = 0; $length = strlen($string); for ($i = 0;$i &lt; $length; $i++) { $char = $string[$i]; if( $char == '(' ) { $counter1 ++; } elseif( $char == ')' ) { $counter1 --; } for($j =0;$j &lt; $length; $j++) { $char = $string[$j]; if( $char == '[' ) { $counter2 ++; } elseif( $char == ']' ) { $counter2 --; } } if( $counter1 &lt; 0 || $counter2 &lt; 0) { return false; } } echo 'ok';; } hasMatchedParenthesis('[5] * 3 - ( 4 - 7 * [3-6])'); // this is ok! hasMatchedParenthesis('( 5 * 3 [ 6 ) - 6]'); // this returns as TRUE, but it is not! ?&gt; </code></pre> <p>Pleas help me to resolve validation of '[ 6 )' thing! I dont know how to do it:(</p>
0non-cybersec
Stackexchange
[UPDATE] I (19F) have a date (19F) tonight. She's *visually impaired. How can I make the date go well?. [Original Post](https://www.reddit.com/r/relationship_advice/comments/bmyk74/i_19f_have_a_date_19f_tonight_shes_differently/) &#x200B; I wanted to wait a few days before I updated you guys, just because it was a first date and we didn't know each other previously. I wanted her to still be talking to me for a few days afterwards. &#x200B; So, I picked her up from her house and I was in awe of how beautiful she looked. She got in and we figured out where to get fro yo, and when we got to the store, she asked me to read all the flavors to her. Of course, I did, then grabbed us some sample cups. She got pistachio, lavender blueberry, and either vanilla or classic tart. She left the last one a secret to me. I got classic tart and the lavender blueberry with some blueberries on top. We started the conversation on our frozen creations and delved into deeper conversation. Unfortunately, there were some loud little kids so we could barely hear each other, but we still enjoyed each other's company. We got back in the car, and I went to drop her off, and she invited me in to watch a movie! She wanted to spend more time with me, yes!! She handed me the remote and said to pick whatever, so I picked one of my favorite scary movies, and started it. During the opening scene she brought up the fact if I've ever been around someone who couldn't see. I told her no, and we kinda got back into the movie, bringing up odd conversation here and there. After the movie, I went home, pretty giddy from the experience. &#x200B; We're still talking, thankfully, and we're planning on when to meet up next. She's just sick right now, so it's hard to plan around that. I'm excited for our next date! \*changed title to fit her disability TLDR; The date went amazingly and we're planning for date #2 and I really had nothing to worry about in the end. &#x200B; EDIT: I see a lot of people mentioning my boyfriend, which yes I do have. We're in an open relationship and he wants me to explore my sexuality before we settle down, and my date was aware of our situation. We've had a lot of talks and conversations since. Maybe I should update the post I made about him?
0non-cybersec
Reddit
How to allow Superset to recognize that a string is a datetime?. <p>I am using Superset as a data visualizer with an SQLite database. Because SQLite doesn't have DATETIME type, I use the type TEXT to add a date and an hour.</p> <p>Nevertheless, Superset then doesn't recognize that this "TEXT" or String is a date ! </p> <p>This is my data : </p> <pre><code>CREATE TABLE TEST( TEST_ID int PRIMARY KEY NOT NULL, VEHICLE_ID int NULL, TEST_TYPE_ID int NULL, CHECK_TYPE_ID int NULL, NUM_TEST int NULL, TEST_DATE TEXT NOT NULL ); INSERT INTO TEST (TEST_ID, VEHICLE_ID, TEST_TYPE_ID, CHECK_TYPE_ID, NUM_TEST, TEST_DATE) VALUES (844, 504, 3, 1, 3, '2007-01-01 10:00:00'); </code></pre> <p>Then in Superset I have the following message : </p> <p>"Datetime column not provided as part table configuration and is required by this type of chart"</p> <p>With the details : </p> <pre><code> Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/superset/viz.py", line 234, in get_payload df = self.get_df() File "/usr/lib/python2.7/site-packages/superset/viz.py", line 78, in get_df self.results = self.datasource.query(query_obj) File "/usr/lib/python2.7/site-packages/superset/connectors/sqla/models.py", line 538, in query qry = self.get_sqla_query(**query_obj) File "/usr/lib/python2.7/site-packages/superset/connectors/sqla/models.py", line 370, in get_sqla_query "Datetime column not provided as part table configuration " Exception: Datetime column not provided as part table configuration and is required by this type of chart </code></pre> <p>I tried to replace TEXT by TEXT AS DATETIME creating the table but it's a syntax error.</p> <p>Do you have any solution ?</p>
0non-cybersec
Stackexchange
Touchscreen problem - Ubuntu 14.04 LTS in Dell inspiron 13 serie 7000 (7348). <p>I recently purchased a Dell Inspiron 13 7000 Series 2-in-1 (7348). I would like to install Ubuntu, though still not officially released a version pre-installed on this machine. Which version of Ubuntu would guarantee the Touchscreen and its rotation of 360° in your opinion? I read the version of ubuntu 12.04 about the dell XPS 13 (the most similar) that allows the touchscreen to function. Do you believe that this version of Ubuntu would be better for my 13 7000 series? What do you recommend to do?</p> <p>Thank you, I aspect reply!</p>
0non-cybersec
Stackexchange
Is there a Kummer theory for cyclic covers in higher dimension?. <p>Let $d \geq 2$ be an integer and $K$ a field of characteristic zero containing the roots of unity of order $d$. Let $X$ be a smooth curve over $K$, not necessarily projective. Let $\overline{x}$ be a geometric point of $X$ and consider a non-trivial character $$ \chi: \pi_1(X, \overline{x}) \to \mu_d(\mathbb{C}) $$ of the algebraic fundamental group of $X$. Then $\ker(\chi)$ is a normal subgroup of $\pi_1(X, \bar{x})$ and corresponds to an étale cyclic cover $Y \to X$ with Galois group $$ G=\pi_1(X, \overline{x})/ \ker(\chi). $$</p> <p>If I understand correctly, Kummer theory says that there exists a rational function $f$ on $Y$ such that $$ f^\sigma=\chi(\sigma) f \quad (*) $$ for each $\sigma \in G$. Then $f^d$ is a rational function on $X$. </p> <p>Does anybody know a good reference for this statement? All the papers I have found just say "By Kummer theory..." (sometimes it's hard to learn classic mathematics for a beginner!)</p> <p>My second question is how much of this story extends to higher dimension, that is, what happens if $\pi: Y \to X$ is a cyclic cover of a smooth higher dimensional variety $X$? Does there also exists a rational function on Y with the property (*)? </p> <p>In the curve case, $Y$ is also smooth, but in general it will be only normal. I don't know if this is a problem. </p>
0non-cybersec
Stackexchange
PCI-DSS for Financial Institutions and Issuer. <p>Here is the scenario: A financial institution outsourced all PCI-DSS related activities. Therefore (in theory), it does not store, transmit, or process credit/debit card data. It also issues debit cards but, it only initiates the process by taking basic client information. Then, the information is forwarded to a service provider that issues and sends the debit card to the client. However, the company has been required to be PCI-DSS compliant. In my humble opinion, PCI-DSS has not been 'designed' to work for financial institutions. It is more focused on service providers and merchants. In fact, the SAQs are for merchants and service providers only. I am not aware of a SAQs for financial institutions.</p> <p>Questions: 1. How can that financial institution prove that it is PCI-DSS compliant? What tools and processes can they use considering that the current ones are designed for merchants and service providers (e.g. SAQs)? 2. Can they use the SAQ (if so, which one?)to evaluate their compliance and put N/A on the related not applicable requirements? Can they use the prioritised approach? 3. If a requirement is N/A because it has been outsourced, who does own the responsibility to the requirement, the financial institution or the outsourcing company that handles the credit card information? In other words, am I correct in assuming that even if the financial institution outsources all the credit/debit card processes, it is still responsible to make sure that the outsourcing company is PCI-DSS compliant?</p> <p>Cheers</p>
0non-cybersec
Stackexchange
A reflective hot spring from Yellowstone National Park [OC] [5184 X 3456].
0non-cybersec
Reddit
[LPT Request]: How to escalate platonic relationships - i.e. turning acquaintances into real friendships. So though I'm naturally shy I'm doing alright socially these days and can meet new people and get chatting without too much trouble. However, it always stays at the "acquaintance stage" - I often meet people in a certain context(e.g. uni, a couchsurfer meeting, social dancing), and then I only ever meet them in that context without it ever feeling natural to for instance call them up to have a coffee or do something together. How does one turn acquaintances into real friends? So far I've only really found advice that goes "be interesting" and "ask questions" and the likes, but it's all very vague. Does anyone have more concrete tips or advice for how to make this happen?
0non-cybersec
Reddit
Happy doggo!!.
0non-cybersec
Reddit
Copy files from one folder to another folder within specific date range. <p>I am already using below command to copy files from a specific date.</p> <p>Previously I used this command and it worked well but now it was showing an error:</p> <pre><code>-bash: /bin/cp: Argument list too long </code></pre> <p>Commends used:</p> <pre><code>cd /share/new/ cp `find . -type f -newermt '16 july 2018'` /share/test </code></pre> <p>I need to copy all files in the folder "new" from July 20th to today date. How can I achieve this? </p>
0non-cybersec
Stackexchange
This is the best Cass Ult dodge I've ever done or seen. My body doesn't visibly turn around..
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
Docker memory leak?. <p>I'm running Docker 0.9.0</p> <pre><code>uname -a Linux 3.11.0-18-generic #32-Ubuntu SMP Tue Feb 18 21:11:14 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux </code></pre> <p>I have 40 containers running at once. Each container is fairly simple - it runs a snippet of code in a Node process. An infinite loop listens for more code snippets to run in Node.</p> <p>Occasionally I mark these containers to be killed, and I start another container to take its place. I've been experiencing memory errors. Sometimes everything crashes and Docker reports "cannot allocate memory for new container", and sometimes there's simply a timeout on the socket.</p> <p>Constant reporting cats meminfo and calls "free". This reporting suggests I have <em>plenty</em> of memory unused.</p> <p>The command</p> <pre><code>ps --sort -rss -eo rss,pid,command | grep docker </code></pre> <p>under different scenarios tells me that as new containers are replacing old containers, Resident Set Size memory is ever expanding. If I stop the service as-is and wait an hour this decreases somewhat but never reaches the previous level. For instance it will never drop back to the level at which the original 40 containers were created.</p> <pre><code>pmap `pidof docker` </code></pre> <p>Tells shows that all entries are [anon] - as I understand it this is memory reserved by malloc.</p> <p>Point of crash is ~2GB allocated to the Docker daemon RSS, up from ~40M when fresh.</p> <p>I am not certain if this is a[nother] Docker bug / memory leak.</p> <hr> <p>How might this lead to an out of memory error provided that <strong>free</strong> reports 4.5G unused?</p> <hr> <p>There is no swap on my system.</p> <p>IMPORTANT DETAIL: Docker fails to remove killed containers through the Remote API with an AUFS driver error. For this reason I rely on an external cron to remove stopped containers via the CLI. </p>
0non-cybersec
Stackexchange
Why is $P = I_N - \vec{1}\vec{1}^T/N$ a projection matrix, and $P^2=P$?. <p>Why is $P = I_N - \vec{1}\vec{1}^T/N$ a projection matrix, and $P^2=P$?</p> <p>For example, for N=3 :</p> <p>$$P = I_3 - \vec{1}\vec{1}^T/3 = \begin{pmatrix} 0.67 &amp; 0.33 &amp; 0.33 \\ 0.33 &amp; 0.67 &amp; 0.33 \\ 0.33 &amp; 0.33 &amp; 0.67 \\ \end{pmatrix} $$</p> <p>and,</p> <p>$$P^2 = \begin{pmatrix} 0.44 &amp; 0.11 &amp; 0.11 \\ 0.11 &amp; 0.44 &amp; 0.11 \\ 0.11 &amp; 0.11 &amp; 0.44 \\ \end{pmatrix} $$</p> <p>But the text I am reading says P is supposed to be a projection matrix, for which $P^2 = P$ ?</p>
0non-cybersec
Stackexchange
application of vectors: sailboat floats in a current. <p>A sailboat floats in a current that flows due east at 1 meter per second. Due to a wind the boats actual speed relative to the shore is $({\sqrt 3})$ meters per second in a direction 30 degrees North of East. Find the speed and direction of the wind. </p> <p>So far I have found the speed of the wind by using the formula for the resultant vector and got the speed to be 1 meter per second. Now how do I go about finding the direction of the wind? Can someone provide a step by step explanation. I don't understand why the wind would be East of North? </p>
0non-cybersec
Stackexchange
Drive, motherfuckers.. If you text and drive, please stop out of consideration for your fellow man in a motor vehicle. You are truly not worthy to have a license unless you know how to exercise self-control; having to take out your phone to respond to a measily text message demeans your ability to exercise the self-control and concentration that driving requires. You're performing an activity that can have an incredible impact on other, innocent human lives. Focus your attention to the road and only the road, and if you NEED to text message so badly, pull over. Or better yet, buy a phone that will text message by means of you using your voice. I have no sympathy for a dumbass driver who finds themselves in an accident because of their insatiable need to use their mobile device. Have some god damn respect for yourself, and exercise the courtesy of keeping your phone stowed away for the duration of your drive. I can assure you, and I promise you, if I'm ever struck by a driver texting, I will step out of my car and immediately confront the driver. Immediately. And I'm not the motherfucker you want in your face.
0non-cybersec
Reddit
One year on... Still fits.
0non-cybersec
Reddit
A guinea pig was rescued from a storm sewer today. His name is "Snowball".
0non-cybersec
Reddit
What are the differences between IE and, ehm, IE?. <p>I notice that there are very big differences between starting up IE from the desktop taskbar and starting it up from the Windows 8.1 start screen. Doing so results in a remarkably dissimilar user experience.</p> <p>For instance, the IE started up from the start screen has fewer options (no menu bar, no F12 etc). It behaves like a totally different program. Also, the icons shown in the Alt+Tab display are different.</p> <p><a href="https://i.stack.imgur.com/h954F.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h954F.jpg" alt="screen shot of Alt+Tab display"></a></p> <p>In fact, when I first noticed this, I thought maybe Microsoft had perhaps installed Edge on my machine. But no, both versions identify themselves as Internet Explorer 11.</p> <p>So, why this difference? Why does the same program behave in such different ways depending on how it is started up? Am I missing something?</p>
0non-cybersec
Stackexchange
Morse lemma with least amount of regularity.. <p>I recently came across with $C^2$ Morse functions in my work and as I was reviewing some of the stuff I learned about Morse theory, I noticed that all the proofs of the Morse lemma I could come across with work only for $C^3$ Morse functions. </p> <p>A Google search was inconclusive about the existence of a Morse lemma for Morse functions $f: M \to \Bbb R$ with lesser regularity then $C^3$, where $M$ is a smooth finite dimensional manifold.</p> <p>A reference is perhaps the best possible answer, but any chunk of information will be appreciated.</p>
0non-cybersec
Stackexchange
The Secrets of the Regenerating Flatworm's Genome Are Unveiled.
0non-cybersec
Reddit
TIL Frank Hayes was a jockey who, in 1923, suffered a fatal heart attack in the midst of a race at Belmont Park in New York. His horse finished and won the race with his lifeless body still atop, making him the first, and thus far, only, jockey to win a race after death.
0non-cybersec
Reddit
K.
0non-cybersec
Reddit
Blink-182 tattoo by Garrett at Frontline Tattoo in Oceanside, Ca.
0non-cybersec
Reddit