text
stringlengths
36
35k
label
class label
2 classes
source
stringclasses
3 values
tokens_length
int64
128
4.1k
text_length
int64
36
35k
Do Cisco ACL need to be configured in both directions to allow traffic?. <p>I'm not sure how Cisco ACL works on a SF300 managed switch. </p> <p>I have the switch in L3 mode and with different VLANs configured. </p> <p>Each VLAN has couple of ports in Access mode assigned to it. </p> <p>For each VLAN, I wanted to apply some ACL rules. For example, one VLAN should only be able to access the internet to browse websites, so allowing ports 80 and 443.</p> <p>The ACE rules I tried look like this:</p> <pre><code>permit tcp 10.0.100.0 0.0.0.255 any any www ace-priority 100335 permit tcp 10.0.100.0 0.0.0.255 any any 443 ace-priority 100355 </code></pre> <p>But this alone will not let the clients access the web. To do that, I had to allow the traffic in opposite direction as well:</p> <pre><code>permit tcp any www 10.0.100.0 0.0.0.255 any ace-priority 100375 permit tcp any 443 10.0.100.0 0.0.0.255 any ace-priority 100395 </code></pre> <p>Which is something I don't like because I want to only allow connections requested by the clients in the VLAN. I don't want to allow unsolicited connection from outside.</p> <p><strong>So my question is whether there's a way to allow web access without having to use both sets of rules on this Cisco managed switch.</strong> </p> <p>My only guess is that what I try to achieve is not a job for a switch but instead for a firewall, which the SF300 is not. Or maybe I miss some keyword, like "established", which I found in some manuals but it doesn't seem to apply to the SF300 switch as there's no such keyword.</p>
0non-cybersec
Stackexchange
466
1,570
How to use merge hints to isolate complex queries in SQL Server. <p>I can understand that if I join individual queries that are "individually fast" the combination may become slow because the default execution plan may be non-optimal. However when I know the number of rows for one query is very small I think I should be able to use hints to control the joins.</p> <pre><code>select cj.a, cv.b from (select distinct a from complexJoin) cj -- 2 rows inner loop join complexView cv on cj.a = cv.a order by cj.a, cv.b </code></pre> <p>If cj is &lt;1s and cv &lt;1s expect this to be &lt;~2s but using any hint (merge/hash/loop) it is often > 1min.</p> <p>I also tried to use CROSS APPLY because the docs claimed that the inner select is executed exactly once for each outer row. The query takes ~100x longer than running the inner query twice manually so perhaps I don't understand the docs.</p> <pre><code>select cj.a, cv.b from (select distinct a from complexJoin) cj -- 2 rows cross apply (select * from complexView where a = cj.a) cv order by cj.a, cv.b </code></pre> <p>If I populate a temp table with results from "cj" and then join _with_no_hint_ or use the cross apply it is fast but do I really have to resort to that? If I use the temp table and attempt "any" of the join hints (loop/merge/hash) it is slow so maybe that is a key point.</p> <p>I don't believe diving into the depths of the query plan (both are complex to begin with) are required to solve this type of problem in general: I just want guaranteed isolation without resorting to a temp table--is that really not possible?</p>
0non-cybersec
Stackexchange
466
1,634
Always use MVVM in a WPF app, or are alternative patterns still practical/useful?. <p>On page 374 in the book <a href="https://rads.stackoverflow.com/amzn/click/com/073562609X" rel="noreferrer" rel="nofollow noreferrer"><strong><em>Microsoft .NET Architecting Applications for the Enterprise</em></strong></a>, there is a chart regarding the evolution of patterns for the presentation layer and their impact on platforms (figure 7-14).</p> <p>In addition to showing the evolution from the original MVC pattern, to the more modern variants, that chart also shows that the following modern patterns can be applied across the following technologies:</p> <ol> <li><strong>Model2</strong> (MVC) <ul> <li>Web Only</li> </ul></li> <li><strong>Passive View</strong> (MVP) <ul> <li>Web</li> <li>WinForms</li> <li>WPF</li> </ul></li> <li><strong>Supervising Controller</strong> (MVP) <ul> <li>Web</li> <li>WinForms</li> <li>WPF</li> </ul></li> <li><strong>MVVM</strong> (Presentation Model) <ul> <li>WPF Only</li> </ul></li> </ol> <p><strong>Note:</strong> One other recent pattern of interest lately not in that chart is <a href="http://www.atomicobject.com/files/PresenterFirstAgile2006.pdf" rel="noreferrer"><strong><em>Presenter First (MVP)</em></strong></a> which was envisioned to be more accommodating of TDD. </p> <hr> <p>From what I understand if one develops with WPF, then the <em>MVVM</em> pattern is the de facto choice (kind of like <em>Model2</em> is for web development). That said, it appears nothing prevents one from using <em>Passive View</em>, <em>Supervising Controller</em>, or <em>Presenter First</em> in a WPF app. Such an approach would result in an application that doesn't really care if the front end is WPF, WinForms, or the Web. It appears that these MVP variants allow more flexibility.</p> <p>However, does aiming for UI-platform-agnostic flexibility (that might not be needed) come at the cost of making WPF development much more difficult and lose out on a portion of the features/power that WPF offers? So much so that the costs outweigh the benefits?</p> <p>In other words, is MVVM so great that one shouldn't consider other alternatives in WPF applications?</p>
0non-cybersec
Stackexchange
670
2,202
TIFU by requesting $23625 worth of drug money over Google Wallet. So sometimes when I show friends or people how you can request money over Google Wallet, I'll send a request for a few thousand bucks to close friends with a note saying something like "for my ransom" or "need crack". They know whats up, they read it, chuckle and reject the request, it's all good. Except today I got this [email](http://i.imgur.com/4rm3YVC.png) from Google... EDIT: All out of inbox invites, /u/herrsergio and /u/3sidedpolygon and /u/OLDDAZE enjoy your inbox, everyone else go bother those guys :)
0non-cybersec
Reddit
157
584
How easy is it to solo-mine new altcoins?. <p>It seems to be pretty clear that CPU/GPU mining is obsolete for the big fellas (Litecoin, Bitcoin, Ethereum, arguably Dogecoin). This is a bummer for beginners like myself cause I'm keen to dive in and get my PC grinding away at the digital coalface like it's 2009.</p> <p>I've decided that I want to mine a bunch of altcoins and completely disregard short-term profitability (mining BTC wasn't profitable in 2009, but look at how much it's worth now!). </p> <p>My actual question: Exactly how does one go about solo mining altcoins? Is the process the same as mining bitcoin, litecoin, dogecoin, ethereum etc? What program do you need to download and how easy is it to configure? I ask because I have had zero luck even getting set up with mining these more mainstream coins. I was really hoping for a "download program, punch in your wallet code and go" situation, but instead I've had to muck around with mining pools and heaps of complicated settings and I can never get it working. Some guidance would be appreciated</p>
0non-cybersec
Stackexchange
264
1,074
Why is final the only modifier for local variables in Java?. <pre><code>class Test { public static void main(String[] args) { private int x = 10; public int y = 20; protected int z = 30; static int w = 40; final int i = 50; } } </code></pre> <p>The <strong>only applicable modifier is final</strong> here; <strong>for other modifiers</strong>, the program gives <strong>compiler errors</strong>. Why is that? Please explain in detail. </p>
0non-cybersec
Stackexchange
139
492
Advice on removing and/or replacing waterlox finish on wood countertop?. Have a wood countertop finished with waterlox about 4 years ago that did pretty well except where a soap dish was set for several months. There are dark blotchy areas where I presume soapy water and associated soap residue accumulated. [Pic](https://photos.app.goo.gl/xK4SahjeXW7MUAQ76) Can I get some advice about how I might best either salvage/reapply the waterlox finish or perhaps strip and use an alternative finish? This is unstained oak, would like to keep it a similar naturalish color. Thanks
0non-cybersec
Reddit
149
582
how to catch angular ng-include error. <p>When I use <code>ng-include</code> as a title, how do I catch the error when the address (file path) does not exist?</p> <p>I finished a <code>ng-include router</code> inside a <code>ng-view(with ng-route)</code>, It's a little bit like this:</p> <p><strong>ContentCtrl</strong>:</p> <pre><code>var content = $route.current.params.content, tmplArr = content.split("_"), tmpl = {}, personId=$route.current.params.personId||$scope.persons[0].id; $scope.personId=personId; tmpl.url = "content/"; for (var i = 0, len = tmplArr.length; i &lt; len; i++) { tmpl.url += tmplArr[i] + "/"; } tmpl.url = tmpl.url.substring(0, tmpl.url.length - 1) + ".html"; $scope.template = tmpl; </code></pre> <p><strong>ContentView</strong>:</p> <pre><code>&lt;div ng-include="template.url" class="ng-animate"&gt;&lt;/div&gt; </code></pre> <p>when I use the addr is not exist like:/home/#/content/profile_asdfa, the angular just fetch the resource in a loop. So I need to catch the ng-include error,when there is no template file in the hash. Can anybody Help me ? Thx!</p>
0non-cybersec
Stackexchange
404
1,115
Any two points in a Stone space can be disconnected by clopen sets. <p>Let $B$ be a Stone space (compact, Hausdorff, and totally disconnected). Then I am basically certain (because of Stone's representation theorem) that if $a, b \in B$ are two distinct points in $B$, then $B$ can be written as a disjoint union $U \cup V$ of open sets where $a \in U, b \in V$. </p> <p>However, I can't seem to prove this directly. The proof should be fairly straightforward, so I am sure I'm missing something obvious. (As an exercise for myself, I'm trying to prove Stone's representation theorem, and I need this as a lemma.)</p>
0non-cybersec
Stackexchange
170
623
Why is the VPN switch sometimes missing from settings on my iPad?. <p>There is a VPN switch in settings that often appears below the wifi option in settings on iOS: <img src="https://i.stack.imgur.com/NzpIl.png" alt="enter image description here"> (the above image is from a website and not my iPad, as I can't seem to get my iPad to show VPN right now)</p> <p>The trouble is, it seems to be missing: <img src="https://i.stack.imgur.com/enMUt.png" alt="enter image description here"> (this image is from my iPad)</p> <p><strong>VPN switch present:</strong></p> <ul> <li>in all circumstances prior to installing an AT&amp;T sim card, including when a Telus sim card was installed</li> <li>while using wifi with an AT&amp;T sim card installed but in a region with no AT&amp;T coverage and no data roaming disable by AT&amp;T (ie. "searching..." shown in connection status area)</li> </ul> <p><strong>VPN switch missing:</strong></p> <ul> <li>while connected to AT&amp;T LTE/4G using iPad sim</li> <li>while connected to my AT&amp;T iPhone using personal hotspot (via either Bluetooth or wifi) even though VPN is available from the settings screen of my iPhone whether or not cellular data is enabled on iPad</li> <li>while connected to WIFI whether or not cellular data is enabled on my iPad</li> </ul> <p><strong>What is going on here? Does the connection/sim card/network somehow determine whether VPN is available? Is there something else altogether I need to check?</strong></p>
0non-cybersec
Stackexchange
429
1,490
Questions re: syncing iPad2 to MacBook, specifically having to do with Apps and how not to erase them when syncing. I want to sync the iCal entries on my MacBook with my wife's iPad2, but it seems that if I select the Apps option on the iPad2 when I am connecting the devices, the only option I have is to erase all the Apps on the iPad2 and replace them with the Apps on my MacBook. I think this is really kind of weird, and I don't quite understand it... what will happen to all the apps I bought and/or downloaded onto the iPad2 that are not on the MacBook? Will they be gone? Am I missing something here, besides a clue?
0non-cybersec
Reddit
155
627
No Miner can connect to RPC Server. <p>I'm new to this BitCoin, as in read about it yesterday started with it today. This technology has intrigued me to the level I cannot explain, its truly genius!</p> <p>Back to my problem, I have a <strong>NVIDIA NVS3100</strong> with approx <strong>48 GFlops speed</strong>. I am using it to mine. I have taken part in different pools, but the problem is that miner is not connecting to the RPC server. This is the error:</p> <pre><code>Could not retrieve work from RPC Server CURL Return Value = 1 </code></pre> <p>I'm using <code>rpcminer-cuda</code> made by <strong>puddinpop</strong> on <strong>Windows 8</strong>.</p> <p>Would I have to make rules in firewall? or something like that?</p>
0non-cybersec
Stackexchange
228
736
&quot;Additional Drivers&quot; program crash help on 12.04?. <p>When I select the "Additional Drivers" program, it searches for available drivers but becomes unresponsive shortly after. I tried closing it, to try again, but now it just blinks 3 times when I select it. Any ideas to work around this? I'm unsure if there's a driver I need. My network connection seems fine, though.</p> <p>Edit: When I use the command <code>jockey-gtk</code>, I get an error message that ends with:</p> <pre><code>Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken. </code></pre>
0non-cybersec
Stackexchange
179
698
Which cable will work with my headset?. <p>Today my audio/mic splitter cable broke, and I'm looking to buy a new one, however I'm scared I'm going to buy the wrong one. <br></p> <p>The headset description for the cable is the following: <br> <em>3.5mm 4 Pole Audio/Mic</em> <br> <em>3.5 mm Audio Splitter Cable</em> <br></p> <p>The following link is the link to where I purchased the headset (so you can get a better idea on what I'm talking about / specifications): <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16826140142&amp;cm_re=gaming_headset_detachable-_-26-140-142-_-Product" rel="nofollow noreferrer">Gaming Headset</a></p> <p>So I've been searching around, and I found the following item: <a href="http://www.gearbest.com/cables-adapter/pp_160521.html" rel="nofollow noreferrer">Audio Splitter Cable Dual 3.5mm Male to Single Female</a> <br> I'm not sure whether this is the correct cord to buy or not, and I don't want to buy it not knowing 100% if it will work or not.</p> <p>If someone could help me out and tell me if that's the correct cord, and if it's not, help me find the correct one, I would greatly appreciate it!</p> <p>Thanks guys. I hope I wrote my question correct. Have a good night.</p>
0non-cybersec
Stackexchange
400
1,237
TeamCity Nuget install build step not working with multiple sources, one of them TC&#39;s private NuGet feed. <p>I receive the following error in NuGet Install build step when setting sources to TeamCity's NuGet server:</p> <pre><code>Step 1/4: NuGet install (NuGet Installer) (3s) [15:11:19][Step 1/4] scan: Searching for nuget.config files [15:11:19][Step 1/4] install: Installing NuGet packages for packages.config (3s) [15:11:19][install] NuGet command: C:\TeamCity\buildAgent\tools\NuGet.CommandLine.2.2.0.nupkg\tools\NuGet.exe install C:\TeamCity\buildAgent\work\a4b9de5be22a981\packages.config -OutputDirectory C:\TeamCity\buildAgent\work\a4b9de5be22a981\packages -Source http://localhost:9090/guestAuth/app/nuget/v1/FeedService.svc [15:11:19][install] Starting: C:\TeamCity\buildAgent\temp\agentTmp\custom_script96367186180319830.cmd [15:11:19][install] in directory: C:\TeamCity\buildAgent\work\a4b9de5be22a981 [15:11:22][install] The remote server returned an error: (404) Not Found. [15:11:22][install] Process exited with code 1 [15:11:22][Step 1/4] Step NuGet install (NuGet Installer) failed </code></pre> <p>If I leave sources field blank, it will find the NuGet packages from the default feed (NuGet community feed) but not the ones that are built and packaged locally and hosted within TC's NuGet feed.</p> <p>How do you use both the default feed and the internal TC's NuGet feed within the NuGet installer build step?</p>
0non-cybersec
Stackexchange
486
1,451
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
QVariant to QObject*. <p>I'm trying to attach a pointer to an <code>QListWidgetItem</code>, to be used in the slot <code>itemActivated</code>.</p> <p>The pointer I'm trying to attach is a <code>QObject*</code> descendant, so, my code is something like this:</p> <pre><code>Image * im = new Image(); // here I add data to my Image object // now I create my item QListWidgetItem * lst1 = new QListWidgetItem(*icon, serie-&gt;getSeriesInstanceUID(), m_iconView); // then I set my instance to a QVariant QVariant v(QMetaType::QObjectStar, &amp;im) // now I "attach" the variant to the item. lst1-&gt;setData(Qt::UserRole, v); //After this, I connect the SIGNAL and SLOT ... </code></pre> <p>Now my problem, the <code>itemActivated</code> slot. Here I need to extract my <code>Image*</code> from the variant, and I don't know how to.</p> <p>I tried this, but I get the error:</p> <blockquote> <p>‘qt_metatype_id’ is not a member of ‘QMetaTypeId’</p> </blockquote> <pre><code>void MainWindow::itemActivated( QListWidgetItem * item ) { Image * im = item-&gt;data(Qt::UserRole).value&lt;Image *&gt;(); qDebug( im-&gt;getImage().toAscii() ); } </code></pre> <p>Any hint?</p> <pre><code>Image * im = item-&gt;data(Qt::UserRole).value&lt;Image *&gt;(); </code></pre>
0non-cybersec
Stackexchange
465
1,277
Are there any security implications in creating an SSH key for the root user?. <p>I've written an install script on a server to quickly set up new sites in the /srv directory. It needs to do a <code>git clone</code>, and has to be run via <code>sudo</code> in order to have the permissions to do all the things it needs to do (create directories in /srv, create a new VirtualHost, restart Apache, etc).</p> <p>The question I have is simply this: at the moment the root user has no SSH key, but I'll need one in order to <code>git clone</code> from BitBucket. Are there any security issues with generating one? That is, if I run <code>ssh-keygen</code> as root so I have public and private keys for the root user, will I be making the server less secure in any way?</p> <hr> <p>Incidentally, this is a script that is already in use and has been working fine, but until now the repo I'm cloning from has been a local one, hosted on the same server. I've recently switched to hosting it remotely (on BitBucket), so I need a "deployment key" in order to git clone it.</p>
0non-cybersec
Stackexchange
284
1,071
C++ preprocessor token pasting for namespace qualification. <p>I am having trouble with the preprocessor token pasting operator in gcc 4.7.1 (std=c++11). Namely, consider the following code:</p> <pre><code>// Create a name for a global map (this works) #define GLOBAL_MAP(name) g_map_ ## name // This works fine // Now, namespace qualify this map (this fails to compile when used) #define NS_QUAL_GLOBAL_MAP(name) SomeNamespace:: ## GLOBAL_MAP(name) </code></pre> <p>Usage scenarios - first the map definitions:</p> <pre><code>std::map&lt;std::string,std::string&gt; GLOBAL_MAP(my_map); namespace SomeNamespace { std::map&lt;std::string,std::string&gt; GLOBAL_MAP(my_map); } </code></pre> <p>Now the usage:</p> <pre><code>void foo() { bar(GLOBAL_MAP(my_map)); // This compiles fine baz(NS_QUAL_GLOBAL_MAP(my_map)); // This fails to compile with: // error: pasting "::" and "NAME_MAP" does not give a // valid preprocessing token } </code></pre> <p>What I believe might be happening is that it is interpreting <code>GLOBAL_MAP</code> after <code>##</code> as a token for pasting rather than a macro to be further expanded. How do I get around this?</p>
0non-cybersec
Stackexchange
394
1,244
Plot dash chart side by side. <p>i have 2 charts and i want it to display side by side . Barchart and piechart side by side and probably the same barchart below these 2 charts.i have tried a lot and i would really appreciate some help.</p> <p>this is the below code </p> <pre><code>import dash import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go from dash.dependencies import Output, Input, State import numpy as np import pandas as pd import plotly.figure_factory as ff from pandas import read_excel import plotly.io as pio # external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] # app = dash.Dash(__name__, external_stylesheets=external_stylesheets) # app = dash.Dash() external_stylesheets = ['https://codepen.io/amyoshino/pen/jzXypZ.css'] app = dash.Dash(__name__,external_stylesheets=external_stylesheets) # app = dash.Dash() file_name = 'samplePop1.csv' df = pd.read_csv(file_name) print(df.head()) colors = {     'BLACK' : '#000000',     'TEXT' :  '#696969',     'PLOT_COLOR' : '#C0C0C0',     'WHITE' : '#FFFFFF',     'GOLD' : '#EEBC35' ,     'BROWN' : '#53354D' ,     'GREEN' : '#42CE90' ,     'RED' : '#F87861' ,     'YELLOW' : '#F1F145' ,     'SKY_BLUE' : '#A3DBE1' ,     'SILVER': '#CCCCCC' ,     'LIGHT_BLACK' : '#374649'      } #status options for dropdown status_options = [] for status in df['Status'].unique():     status_options.append({'label':str(status),'value':status}) # print(status_options) #Pie chart static function def pop_pie():     pie_data = df.groupby('Status')['Population Census 1991'].count()     pie_dataframe = pie_data.to_frame().reset_index()     # print(pie_dataframe)     # print(df['Status'].unique())     # print(pie_data.tolist())     # print(type(pie_data.tolist()))     # print(pie_data['Status'].tolist())     # print(pie_data['Population Census 1991'].tolist())     trace1 = go.Pie(                 labels = pie_dataframe['Status'].tolist(),                 values= pie_dataframe['Population Census 1991'].tolist(),                 textinfo='label+percent',                 name='population 1991 status wise',pull=[0,0,0,0,0,0,0,0,0]                 )     data = [trace1]     layout = go.Layout(             title='piechart',             )     fig = go.Figure(data=data)     return fig ''' #Barchart static function def pop_bar():     trace1 =go.Bar(y=df['Population Census 1991'],                          x=df['Name'],name ='1991',                         marker = {'color' : colors['GREEN']}                         # orientation='h'                         )     trace2 =go.Bar(y=df['Population Census 2001'],                          x=df['Name'],name ='2001',                         marker = {'color' : colors['RED']}                         # orientation='h'                         )     trace3 = go.Bar(y=df['Population Census 2011'],                          x=df['Name'],name ='2011',                         marker = {'color' : colors['YELLOW']}                         # orientation='h'                         )     data = [trace1, trace2, trace3]     #layout = go.Layout(barmode='group', xaxis={'categoryorder':'array', 'categoryarray':df['District']})     # layout = go.Layout(barmode='group', xaxis={'categoryorder':'total descending'})     layout = go.Layout(     title='Population Census',     paper_bgcolor=colors['LIGHT_BLACK'],     plot_bgcolor=colors['LIGHT_BLACK'],     font ={'color' : colors['WHITE']},     xaxis_tickfont_size=14,     yaxis=dict(showgrid=False,         title='Population',         titlefont_size=16,         tickfont_size=14,     ),     legend=dict(         x=0,         y=1.0,         bgcolor='rgba(255, 255, 255, 0)',         bordercolor='rgba(255, 255, 255, 0)',         orientation="h"         ),     barmode='group',     bargap=0.15, # gap between bars of adjacent location coordinates.     bargroupgap=0.1, # gap between bars of the same location coordinate.     xaxis={'categoryorder':'total descending'})     fig = go.Figure(data=data, layout=layout)     return fig ''' app.layout = html.Div(children=[     html.Div(             [         html.H1("Test Dashboard",         style = {                      'textAlign' : 'center',             'color' : colors['SILVER']         }         ),         html.Div('Developed by Centroxy Solution pvt.ltd',                 style = {             'textAlign' : 'right',             'color' : colors['SILVER']         }         ),         html.Img(         src="https://i.imgur.com/CIxE22f.png",         className='three columns',         style={             'height': '9%',             'width': '9%',             'float': 'right',             'position': 'relative',             'margin-top': '-91px',         }),             html.Br(),             html.Br()             ],style={'backgroundColor': colors['LIGHT_BLACK']}             ),         html.Div(              dcc.Dropdown(id='status_picker',options=status_options,                           placeholder="Select Status",                                style = {'color' : colors['LIGHT_BLACK']},                                multi=True,                                clearable=True,                                searchable=True                             )                             #,style={"background-color": colors['LIGHT_BLACK']}                             ,style={'backgroundColor': colors['LIGHT_BLACK']}         ),           html.Div([             dcc.Graph(id='Bar-Chart')         ]),              html.Div([             dcc.Graph(id='pie-chart', figure=pop_pie())         ]),             ]) @app.callback(Output('Bar-Chart','figure'),             [Input('status_picker','value')]) def update_figure(selected_status):     print(selected_status)     if selected_status == [] or selected_status == None:         trace1 =go.Bar(y=df['Population Census 1991'],                              x=df['Name'],name ='1991',                             marker = {'color' : colors['GREEN']}                             # orientation='h'                             )         trace2 =go.Bar(y=df['Population Census 2001'],                              x=df['Name'],name ='2001',                             marker = {'color' : colors['RED']}                             # orientation='h'                             )         trace3 = go.Bar(y=df['Population Census 2011'],                              x=df['Name'],name ='2011',                             marker = {'color' : colors['YELLOW']}                             # orientation='h'                             )     else:         filtered_df = df[df['Status'].isin(selected_status)]         print(filtered_df)         trace1=go.Bar(y=filtered_df['Population Census 1991'],                              x=filtered_df['Name'],name ='1991',                             marker = {'color' : colors['GREEN']}                             # orientation='h'                             )         trace2=go.Bar(y=filtered_df['Population Census 2001'],                              x=filtered_df['Name'],name ='2001',                             marker = {'color' : colors['RED']}                             # orientation='h'                             )         trace3=go.Bar(y=filtered_df['Population Census 2011'],                              x=filtered_df['Name'],name ='2011',                             marker = {'color' : colors['YELLOW']}                             # orientation='h'                             )     traces= [trace1,trace2,trace3]     '''     for status in filtered_df['Status'].unique():         df_by_status = filtered_df[filtered_df['Status'] == selected_status]         traces.append(             go.Bar(y=df_by_status['Population Census 1991'],                          x=df_by_status['Name'],name ='1991',                         marker = {'color' : colors['GREEN']}                         # orientation='h'                         ))         traces.append(             go.Bar(y=df_by_status['Population Census 2001'],                          x=df_by_status['Name'],name ='2001',                         marker = {'color' : colors['RED']}                         # orientation='h'                         ))         traces.append(go.Bar(y=df_by_status['Population Census 2011'],                          x=df_by_status['Name'],name ='2011',                         marker = {'color' : colors['YELLOW']}                         # orientation='h'                         ))'''     return {         'data' : traces,         'layout' : go.Layout(             title='Population Census',             paper_bgcolor=colors['LIGHT_BLACK'],             plot_bgcolor=colors['LIGHT_BLACK'],             font ={'color' : colors['WHITE']},             xaxis_tickfont_size=14,             yaxis=dict(showgrid=False,                 title='Population',                 titlefont_size=16,                 tickfont_size=14,             ),             legend=dict(                 x=0,                 y=1.0,                 bgcolor='rgba(255, 255, 255, 0)',                 bordercolor='rgba(255, 255, 255, 0)',                 orientation="h"                 ),             barmode='group',             bargap=0.15, # gap between bars of adjacent location coordinates.             bargroupgap=0.1, # gap between bars of the same location coordinate.             xaxis={'categoryorder':'total descending'})             } if __name__ == '__main__':     app.run_server(port =  '8080' , debug ='True') </code></pre> <p>Also the background colour is not completely the one i specified , please help Attaching an image below <a href="https://i.stack.imgur.com/KiZpq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KiZpq.png" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
3,609
9,961
SV: 100 pounds down, [42/F/5'6"/258-154] with progress pics.. So I decided a while back that i would post my progress pics when i hit 100 pounds down since it also matched perfectly with me hitting normal BMI for the first time in over 30 years! I've been overweight since I was a child and my father put me on my first diet when I was around 7 or 8 and many more were to follow until I turned obese at 14 and just got bigger and bigger ever since. I've always hated being so big, but I had no idea of what to do to fix it. All my diets growing up had been failures and my father eventually gave up. My biggest wish all my life was to lose the weight, but I did nothing to help, I continued to eat, I got depressed and I stopped going out. My BMI was 42, same as my age. In october last year I broke a rib. It made it really difficult to wipe my butt cause of the pain, but a thought occured, if you keep this eating up soon you wont be able to wipe your butt even without a broken rib. I knew I had to do something, but what? I literally had no idea about what to do to lose weight. So I started reading up, and being a redditor i found loseit and after reading i realised it's actually simple math. All my life weightloss had seemed like this impossibly hard thing and now I was told it was all about math. Well, I decided to give myself a year of counting calories before considering surgery. I now have one month left of that year and I've lost 104 pounds and 14 pounds from my goal. Being female and not very tall i started eating 1400 calories a day and the pounds flew off, after about two months I got impatient and lowered it to 1200 and they flew off even faster. I'm still at 1200 calories and even though the pounds aren't flying off just as fast anymore they're still going a a decent pace. I have not cheated, but I count my calories weekly and at the beginning of the week i "collect" 100 caloriest from each day, these 700 calories i can use whenever I want that week for eating out or maybe some wine or some extra snacks. This means I feel like I'm cheating when I'm not and I can indulge some days, but work it back on other days without making it too hard for myself. I have become more active as the weight has decreased but I haven't been excercising, it's just so much easier and more fun to be active without carrying all the extra weight around. I walk a lot more than before simply because I'm out and active instead of sitting inside, but I haven't excercised as a mean to lose weight, only counting and logging my calories. I will start at a gym next month when i have money, I wan't to build muscle now I'm getting closer to my goal, and then I will be removing the excess skin on my stomach. I have lots, but I really didn't expect anything else at my age. Luckily I live in a country where I will get the surgery for free if it's bad enough, and in my case it really is. [Here's my album for pictures!](http://imgur.com/a/56XKc) I didn't take a full body before picture before I started which is sad, but 2 months in and allready 20 pounds down I took my before pictures. Since all the pictures I have from before are of my face only it wasn't that hard to find a before picture for the face-progress pic. I feel like my life has changed with the weight loss and I know not everyone feels this way after weight loss, but I have never felt better or been happier in my life. Apologizing for any spelling errors and bad wording, not my first language.
0non-cybersec
Reddit
829
3,490
MyBatis: Getting affected rows number using java interface mapper. <p>Reading MyBatis tutorial I understood that using session in order to execute query is old practice and it's much better to use java interface mapper. I mean that is a good practice :</p> <pre><code>mapper=session.getMapper(mapperClass); mapper.updateFoo(boo); </code></pre> <p>I started using interface mappers and now I need to get the number of affected rows. All examples I've found are with <code>int number=session.update()</code></p> <p>My question how to get number of affected rows using mapper?</p>
0non-cybersec
Stackexchange
162
581
Seeking advice on paying off debt if unemployed, broke, and being sued. Well, let me explain my situation here. I'm 22 years old. I went to college for 1 year after high school, and then I made the mistake of "staying home a semester." Yeah, and here I am now, still not back in college. I do plan on taking more college courses in the future, but I hope to first get myself more financially stable. For awhile I ran a local pool hall in the town I live in. Sadly, we slowly started to get less business and our overhead became more than what we could support, so we had to close the business. We (my cousin and myself, co-owners) left behind some debt as well. I'm currently unemployed, but will soon be getting a job with PAM Transport as a truck driver. I know it's not very good money by any means, but it's still a job that gives me a paycheck, and plus it gets me out of my norm and out to see some of the world. Now on to the debt... * I have a college loan (Stafford) of $2,803.07 with a 5.6% interest, payed in monthly installments of $50, $150 of which is currently due. * I have a credit card that has been so severely overdue, it'd been turned over to prosecuting attorneys. They sent me a letter stating I owe $820.38, and if I don't pay the lump sum within 30 days, they will take action. * I have personal property tax for the business of $82,41. * There's state taxes (business) that's currently $353.87. It's overdue to the point that they currently have a tax lien on the personal and real property of the business. * AT&T bill of $328.00 is due, and has been turned over to a debt collector. * An electric bill of about $600 last time I looked at it. Needless to say it's been shut off for awhile now. * Also, when we started the business, we took out a loan from the bank to help with starting capital. Current monthly payments are at $350/month. Now, I do realize this isn't *serious* debt like I see others on this subreddit are, but then again I'm just looking for general advice here. I know that once I get this job, I just need to start making payments on everything. But is there any certain order these bills need to be paid in? Does it even matter? Also, even though I'm being sued for the outstanding bill, I have no non-exempt property for them to take. I have no house, land, vehicle, or basically anything. What else could they do? I have also been looking at YNAB and mint.com for money tracking and budgeting options to help give me a little more solidarity here. If you need any more info, just ask. This is my first time posting in this subreddit, and first time also asking for advice about any of this stuff, so I'm not really sure what all is needed to give someone enough to advise me with. Also, my current credit score is 611. What would be the best way to raise this score back up? **TL;DR** I'm in some debt, currently unemployed, being sued. Halp?
0non-cybersec
Reddit
737
2,913
Error message &quot;console.error in react-test-renderer&quot; (although test still passes). <p>This is my root component:</p> <pre><code>const App = () =&gt; ( &lt;Provider store={store}&gt; &lt;PersistGate persistor={persistor} loading={&lt;LoadingView /&gt;}&gt; &lt;MainTabNavigator /&gt; &lt;/PersistGate&gt; &lt;/Provider&gt; ) export default App </code></pre> <p>And a pretty simple snapshot test for it:</p> <pre><code>describe('Testing root App component', () =&gt; { test('Renders as expected', () =&gt; { const tree = renderer.create(&lt;App /&gt;).toJSON() expect(tree).toMatchSnapshot() }) }) </code></pre> <p>When I run the test, it passes but I get this error message under it:</p> <pre><code>PASS __tests__/App.test.tsx ● Console console.error node_modules/react-test-renderer/cjs/react-test-renderer.development.js:5190 The above error occurred in the &lt;TabView&gt; component: in TabView (created by withCachedChildNavigation(TabView)) in withCachedChildNavigation(TabView) in Unknown (created by Navigator) in Navigator (created by NavigationContainer) in NavigationContainer (created by App) in PersistGate (created by App) in Provider (created by App) in App Consider adding an error boundary to your tree to customize error handling behavior. Visit (url) to learn more about error boundaries. </code></pre> <p>Because the test passes, does this even matter? What's going on?</p>
0non-cybersec
Stackexchange
468
1,575
Reading all process memory to find address of a string variable c#. <p>I have 2 programs written in c#, first one called "ScanMe" contains a string variable that contains value "FINDMEEEEEEE", and a double variable that has the value of 1546.22915487. And the other program called "MemoryScan" reads all the memory of the first program. I want to get the memory address of the string variable of that process</p> <p>When i execute "MemoryScan" and reads all the memory of "ScanMe" process, then i try to find the byte array of the string in all the data scanned and i get nothing. If i try to find the double i get the specific memory address and also i can change its value, but when i try to do that with the string variable i cant cause i dont even get the address of that string variable.</p> <p>ScanMe and MemoryScan Code:</p> <pre><code>class Program { public static string FindMeString = "FINDMEEEEEEE"; public static double FindMeDouble = 1546.22915487; static void Main(string[] args) { while (FindMeDouble == 1546.22915487) { System.Threading.Thread.Sleep(2000); } Console.WriteLine(FindMeDouble.ToString()); Console.ReadLine(); } } using System; using System.Collections.Generic; using System.Runtime.InteropServices; namespace MemoryScan { class MemoryController { // REQUIRED CONSTS const int PROCESS_QUERY_INFORMATION = 0x0400; const int MEM_COMMIT = 0x00001000; const int PAGE_READWRITE = 0x04; const int PROCESS_WM_READ = 0x0010; readonly Dictionary&lt;IntPtr, byte[]&gt; Regions = new Dictionary&lt;IntPtr, byte[]&gt;(); readonly List&lt;SearchResult&gt; _results = new List&lt;SearchResult&gt;(); // REQUIRED METHODS [DllImport("kernel32.dll")] public static extern IntPtr OpenProcess(int dwDesiredAccess, bool bInheritHandle, int dwProcessId); [DllImport("kernel32.dll")] public static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, uint dwSize, ref int lpNumberOfBytesRead); [DllImport("kernel32.dll")] static extern void GetSystemInfo(out SystemInfo lpSystemInfo); [DllImport("kernel32.dll", SetLastError = true)] static extern int VirtualQueryEx(IntPtr hProcess, IntPtr lpAddress, out MEMORY_BASIC_INFORMATION lpBuffer, int dwLength); public enum ProcessorArchitecture { X86 = 0, X64 = 9, Arm = -1, Itanium = 6, Unknown = 0xFFFF } // REQUIRED STRUCTS [StructLayout(LayoutKind.Sequential)] public struct SystemInfo { public ProcessorArchitecture ProcessorArchitecture; public uint PageSize; public IntPtr MinimumApplicationAddress; public IntPtr MaximumApplicationAddress; public IntPtr ActiveProcessorMask; public uint NumberOfProcessors; public uint ProcessorType; public uint AllocationGranularity; public ushort ProcessorLevel; public ushort ProcessorRevision; } [StructLayout(LayoutKind.Sequential)] public struct MEMORY_BASIC_INFORMATION { public IntPtr BaseAddress; public IntPtr AllocationBase; public uint AllocationProtect; public IntPtr RegionSize; public uint State; public uint Protect; public uint Type; } public void FindProcessMemory(int processId) { // getting minimum &amp; maximum address SystemInfo sys_info; GetSystemInfo(out sys_info); uint max_Address = (uint)sys_info.MaximumApplicationAddress; // opening the process with desired access level IntPtr processHandle = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_WM_READ, false, processId); IntPtr current = IntPtr.Zero; int bytesRead = 0; // number of bytes read with ReadProcessMemory int dwLength = Marshal.SizeOf(typeof(MEMORY_BASIC_INFORMATION)); while ((uint)current &lt; max_Address &amp;&amp; VirtualQueryEx(processHandle, current, out MEMORY_BASIC_INFORMATION mem_basic_info, dwLength) != 0) { // if this memory chunk is accessible if (mem_basic_info.Protect == PAGE_READWRITE &amp;&amp; mem_basic_info.State == MEM_COMMIT) { byte[] buffer = new byte[(int)mem_basic_info.RegionSize]; // read everything in the buffer above if (ReadProcessMemory(processHandle, mem_basic_info.BaseAddress, buffer, (uint)mem_basic_info.RegionSize, ref bytesRead)) { Regions.Add(mem_basic_info.BaseAddress, buffer); } else Console.WriteLine($"Error code: Marshal.GetLastWin32Error()"); } // move to the next memory chunk current = IntPtr.Add(mem_basic_info.BaseAddress, mem_basic_info.RegionSize.ToInt32()); } byte[] data = System.Text.Encoding.Unicode.GetBytes("FINDMEEEEEEE"); foreach (IntPtr address in Regions.Keys) { foreach (int i in ByteSearch.AllIndexOf(Regions[address], data)) _results.Add(new SearchResult(IntPtr.Add(address, i), data)); } Console.ReadLine(); } } public static class ByteSearch { static int[] createTable(byte[] pattern) { int[] table = new int[256]; for (int i = 0; i &lt; table.Length; i++) table[i] = pattern.Length; for (int i = 0; i &lt; pattern.Length - 1; i++) table[Convert.ToInt32(pattern[i])] = pattern.Length - i - 1; return table; } public static bool matchAtOffset(byte[] toSearch, byte[] pattern, int index) { if (index + pattern.Length &gt; toSearch.Length) return false; for (int i = 0; i &lt; pattern.Length; i++) { if (toSearch[i + index] != pattern[i]) return false; } return true; } public static bool Contains(byte[] toSearch, byte[] pattern) { return FirstIndexOf(toSearch, pattern) != -1; } public static int FirstIndexOf(byte[] toSearch, byte[] pattern) { int[] table = createTable(pattern); int position = pattern.Length - 1; while (position &lt; toSearch.Length) { int i; for (i = 0; i &lt; pattern.Length; i++) { if (pattern[pattern.Length - 1 - i] != toSearch[position - i]) break; if (i == pattern.Length - 1) return position - i; } position += table[Convert.ToInt32(toSearch[position - i])]; } return -1; } public static int LastIndexOf(byte[] toSearch, byte[] pattern) { int ret = -1; int[] table = createTable(pattern); int position = pattern.Length - 1; while (position &lt; toSearch.Length) { int i; bool found = false; for (i = 0; i &lt; pattern.Length; i++) { if (pattern[pattern.Length - 1 - i] != toSearch[position - i]) break; if (i == pattern.Length - 1) { ret = position - i; found = true; } } if (found) position++; else position += table[Convert.ToInt32(toSearch[position - i])]; } return ret; } public static int[] AllIndexOf(byte[] toSearch, byte[] pattern) { List&lt;int&gt; indices = new List&lt;int&gt;(); int[] table = createTable(pattern); int position = pattern.Length - 1; while (position &lt; toSearch.Length) { int i; bool found = false; for (i = 0; i &lt; pattern.Length; i++) { if (pattern[pattern.Length - 1 - i] != toSearch[position - i]) break; if (i == pattern.Length - 1) { indices.Add(position - i); found = true; } } if (found) position++; else position += table[Convert.ToInt32(toSearch[position - i])]; } return indices.ToArray(); } } public class SearchResult { public SearchResult(IntPtr add, byte[] value) { Address = add; Buffer = value; } public IntPtr Address { get; set; } public byte[] Buffer { get; set; } } </code></pre> <p>}</p> <p>Why i cant find the string and when i try to find the double i find it with no problem and even also i can change its value with the extern writeprocessmemory? Thanks.</p>
0non-cybersec
Stackexchange
2,408
8,851
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Let $K \subset F$ fields. Proof that $F^n$ and $F \,\otimes K^n$ are isomorphic as $F-$vector spaces. <p>Let $F$ and $K$ be fields such that $K \subset F$. We can consider the tensor product $F\, \otimes \, K^n$ as $F-$vector space with the operation: </p> <p>$$ \lambda (a \otimes v) = (\alpha a \otimes v), \, \forall a \in F, \, \forall a\otimes v \in F\,\otimes \, K^n. $$</p> <p>How one can show that $F^n$ and $F \,\otimes K^n$ are isomorphic as $F-$vector spaces?</p> <p>I've tried the canonic way $\lambda \otimes (x_1,...,x_n) \in F \, \otimes \, K^n \mapsto (\lambda x_1,...,\lambda x_n) \in F^n$. However, I couldn't proof that this transform is isomorphism.</p> <p>Help?</p>
0non-cybersec
Stackexchange
254
691
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
How to get rid of widow in List of theorems. <p>In my PhD thesis I have 31 definitions in my List of Definitions. The last definition does not fit on the page, and becomes a widow on the next page.</p> <p>How can I get one or more definitions to be moved to the next page as well?</p> <p>In the following MWE Bernard's suggestion <code>\enlargethispage*{\baselineskip}</code> works, placed after <code>\listoftheorems</code>. However, in my thesis the widow remains on the next page. </p> <pre><code>\documentclass[10pt,twoside,openright]{book} \usepackage{geometry} \geometry{ vmarginratio=7:5, hmarginratio=1:1, papersize={170mm,240mm}, total={130mm,190mm} } % twee packages voor betere fonts \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern,textcomp} % package voor de laatste versie van het standaard lettertype \renewcommand{\familydefault}{\sfdefault} \usepackage{amsmath,amsthm,thmtools,thm-restate} \newtheoremstyle{mydef} {\topsep}{\topsep}% {\itshape}{}% {\bfseries}{} {\newline} {% \rule{\textwidth}{0.4pt}\\*% \thmname{#1}~\thmnumber{#2}\thmnote{\ -\ #3}\\*[-1.5ex]% \rule{\textwidth}{0.4pt}}% \theoremstyle{mydef} \newtheorem{definition}{Definition}[chapter] \declaretheorem[name=Definition,numberwithin=chapter]{thm} \renewcommand\listtheoremname{List of Definitions} % \usepackage[defaultlines=3,all]{nowidow} \begin{document} \frontmatter \listoftheorems[ignoreall,show={thm}] \enlargethispage*{\baselineskip} \mainmatter \chapter{Some definitions} \begin{restatable}[One]{thm}{one} This is a definition. \end{restatable} \begin{restatable}[Two]{thm}{two} This is a definition. \end{restatable} \begin{restatable}[Three]{thm}{three} This is a definition. \end{restatable} \chapter{Some more definitions} \begin{restatable}[Four]{thm}{four} This is a definition. \end{restatable} \begin{restatable}[Five]{thm}{five} This is a definition. \end{restatable} \begin{restatable}[Six]{thm}{six} This is a definition. \end{restatable} \begin{restatable}[Seven]{thm}{seven} This is a definition. \end{restatable} \begin{restatable}[Eight]{thm}{eight} This is a definition. \end{restatable} \begin{restatable}[Nine]{thm}{nine} This is a definition. \end{restatable} \begin{restatable}[Ten]{thm}{ten} This is a definition. \end{restatable} \begin{restatable}[Eleven]{thm}{eleven} This is a definition. \end{restatable} \begin{restatable}[Twelve]{thm}{twelve} This is a definition. \end{restatable} \begin{restatable}[Thirteen]{thm}{thirteen} This is a definition. \end{restatable} \begin{restatable}[Fourteen]{thm}{fourteen} This is a definition. \end{restatable} \begin{restatable}[Fifteen]{thm}{fifteen} This is a definition. \end{restatable} \begin{restatable}[Sixteen]{thm}{sixteen} This is a definition. \end{restatable} \chapter{And more definitions} \begin{restatable}[Seventeen]{thm}{seventeen} This is two. \end{restatable} \begin{restatable}[Eighteen]{thm}{eighteen} This is a definition. \end{restatable} \begin{restatable}[Nineteen]{thm}{nineteen} This is a definition. \end{restatable} \begin{restatable}[Twenty]{thm}{twenty} This is a definition. \end{restatable} \begin{restatable}[Twenty-one]{thm}{twentyone} This is a definition. \end{restatable} \begin{restatable}[Twenty-two]{thm}{twentytwo} This is a definition. \end{restatable} \begin{restatable}[Twenty-three]{thm}{twentythree} This is a definition. \end{restatable} \chapter{Even more definitions} \begin{restatable}[Twenty-four]{thm}{twentyfour} This is a definition. \end{restatable} \begin{restatable}[Twenty-five]{thm}{twentyfive} This is a definition. \end{restatable} \begin{restatable}[Twenty-six]{thm}{twentysix} This is a definition. \end{restatable} \begin{restatable}[Twenty-seven]{thm}{twentyseven} This is a definition. \end{restatable} \begin{restatable}[Twenty-eight]{thm}{twentyeight} This is a definition. \end{restatable} \begin{restatable}[Twenty-nine]{thm}{twentynine} This is a definition. \end{restatable} \begin{restatable}[Thirty]{thm}{thirty} This is a definition. \end{restatable} \begin{restatable}[Thirty-one]{thm}{thirtyone} This is a definition. \end{restatable} \end{document} </code></pre> <p><a href="https://i.stack.imgur.com/5AkaF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5AkaF.png" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
1,528
4,364
Lateral surface area of a frustum of a cone. <p>A cone is divided into two parts: upper part is a small cone and the lower part is a frustum. Given: Radius of frustum( R) =10, radius of upper cone( r)= 5, slant height of frustum (S)= 12, Slant height of whole cone= 20, slant height of upper cone (s)= 8 I tried to find the lateral surface area of a frustum of a cone. First I used: phi X (R+r) X s. Then I used another method: lateral surface area if big cone minus that of small cone. But the results are different. The first is 3.14 x (10+5) x 12= 565.2. The second is (3.14 x 10 x 20) - (3.14 x 5 x 8)=502.4 Please help!</p>
0non-cybersec
Stackexchange
204
629
General form for mapping one disk onto another?. <p>Say I have two disks $A$ and $B$, with two points $a\in A$ and $b\in B$. Is there a way to explicitly construct a linear fractional transformation from $A$ onto $B$ that sends $a$ to $b$?</p> <p>I know a linear fractional transformation is determined by its image on 3 distinct points, and that they sends circles and lines to circles and lines. Would it then be enough to map $a\mapsto b$, and then choose two boundary points on $A$ to map to two arbitrary boundary points on $B$, or does more care need to be taken? My worry is that the boundary points may map onto a circle which isn't the boundary of $B$.</p>
0non-cybersec
Stackexchange
175
667
How to fix graphical glitch in Chromium?. <p>I am using Chromium 45 on Ubuntu 15.04 on a Thinkpad X230. Each time I am opening a new tab, I am presented with the following graphical glitch:</p> <p><a href="https://i.stack.imgur.com/IAxFc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IAxFc.png" alt="enter image description here"></a></p> <p>Has someone experienced this irritating glitch and knows how to remove it?</p>
0non-cybersec
Stackexchange
142
444
When does the browser execute Javascript? How does the execution cursor move?. <p>I was wondering if there are any available resources that describe how a browser's cursor executes Javascript.</p> <p>I know it loads and executes tags when a page loads, and that you can attach functions to various window events, but where things get fuzzy is when, for instance, I retrieve a remote page via AJAX and put its contents into a div.</p> <p>If that remote page has got to load script libraries such as <code>&lt;script src="anotherscript.js" /&gt;</code>, when is "anotherscript.js" being loaded and its contents are being executed?</p> <p>What happens if I included "anotherscript.js" on my current page, and then I load some remote content which has a duplicate include of this script? Does it overwrite the original one? What if the original "anotherscript.js" has a var in it whose value I altered, and then I reload that file... do I lose the original value or is the second inclusion of this script ignored?</p> <p>If I load some procedural Javascript via AJAX, when is it executed? Immediately after I do <code>mydiv.innerHTML(remoteContent)</code>? Or is it executed before that?</p>
0non-cybersec
Stackexchange
298
1,197
Keeping tables / figures (floats) on either the current even (left) or odd (right) page. <p>I'm writing a two sided <code>LaTeX</code> document and would like tables / figures (floats) to be depicted</p> <p>) in the best case, immediately after the end of the sentence in which the float is referred to with <code>\ref{...}</code> for the first time and</p> <p>) in the worst case, still on either the current even (left) or odd (right) page.</p> <p>To elaborate, </p> <p>) if the float is referred to on the even (left) page number <code>x</code>, the float is to be depicted on that even (left) page with number <code>x</code> or on the odd (right) page with number <code>x+1</code> and </p> <p>) if the float is referred to on the odd (right) page number <code>x+1</code>, the float is to be depicted on that odd (right) page with number <code>x+1</code> or on the even (left) page with number <code>x</code>.</p> <p>How do I achieve this? Is there perhaps a way to put <code>\FloatBarrier</code>s just before the next even (left) page?</p> <p>Minimum working example:</p> <pre><code>\documentclass{book} \usepackage{lipsum} \usepackage{showframe} \usepackage{tikz} \begin{document} \lipsum[1-6] Figure~\ref{float1}. \lipsum[1] \begin{figure}[htbp] \begin{center} \begin{tikzpicture}[scale=1] \fill (0,0) rectangle (1,1); \end{tikzpicture} \end{center} \caption{Test picture 1.} \label{float1} \end{figure} Figure~\ref{float2}. \lipsum[2] \begin{figure}[htbp] \begin{center} \begin{tikzpicture}[scale=1] \fill (0,0) rectangle (1,1); \end{tikzpicture} \end{center} \caption{Test picture 2.} \label{float2} \end{figure} Figure~\ref{float3}. \lipsum[3] \begin{figure}[htbp] \begin{center} \begin{tikzpicture}[scale=1] \fill (0,0) rectangle (1,1); \end{tikzpicture} \end{center} \caption{Test picture 3.} \label{float3} \end{figure} Figure~\ref{float4}. \lipsum[4] \begin{figure}[htbp] \begin{center} \begin{tikzpicture}[scale=1] \fill (0,0) rectangle (1,1); \end{tikzpicture} \end{center} \caption{Test picture 4.} \label{float4} \end{figure} Figure~\ref{float5}. \lipsum[5] \begin{figure}[htbp] \begin{center} \begin{tikzpicture}[scale=1] \fill (0,0) rectangle (1,1); \end{tikzpicture} \end{center} \caption{Test picture 5.} \label{float5} \end{figure} Figure~\ref{float6}. \lipsum[6] \begin{figure}[htbp] \begin{center} \begin{tikzpicture}[scale=1] \fill (0,0) rectangle (1,1); \end{tikzpicture} \end{center} \caption{Test picture 6.} \label{float6} \end{figure} \end{document} </code></pre> <p>Here, float 6 is referred to on the odd (right) page 3 but placed on the even (left) page 4. It should be restricted to being placed no later than the odd-even page set 2-3.</p>
0non-cybersec
Stackexchange
1,026
3,192
Modifying viridis colormap (replacing some colors) in matplotlib. <p>I've searched around and found things that came close to working but nothing exactly suiting what I need.</p> <p>Basically, I really like the viridis colormap as a starting point. However, I would like to replace the purple at the lowest end of the map with white. </p> <p>I tried using <code>set_under()</code> but that doesn't suite my needs. I need to simply replace purple with white. </p> <p>For example, I tried the following (from here <a href="https://stackoverflow.com/questions/14777066/matplotlib-discrete-colorbar">Matplotlib discrete colorbar</a>) -</p> <pre><code>cmap = plt.get_cmap('jet') cmaplist = [cmap(i) for i in range(cmap.N)] cmaplist[0] = (1.0,1.0,1.0,1.0) cmap = cmap.from_list('Custom cmap', cmaplist, cmap.N) </code></pre> <p>Which works perfectly and does exactly what I need with 'jet' but when I replace 'jet' with 'viridis' I get the following error</p> <pre><code>AttributeError: 'ListedColormap' object has no attribute 'from_list' </code></pre> <p>How can I get around this and simply do what I want?</p> <p>Any assistance at all would be greatly appreciated.</p> <p>Thank you!</p>
0non-cybersec
Stackexchange
399
1,195
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Best practice privileges and roles for postgres schema migration. <p>I'm having a re-look at roles and privileges in postgres to minimise the damage that a compromised account can do.</p> <p>Ownership and migrations is a part I'm having trouble getting my head around.</p> <p>As I understand it, a table is initially owned by the role that creates it, and a table can only be dropped by the owner. However, the owner of a table is effectively a super-user. They can grant themselves all permissions on that table, making any attempt to limit that user's access to the table fairly pointless.</p> <p>I've a separate role that our application uses (application_role) to connect and that role is not the owner and does not have permission to alter the table or truncate.</p> <p>Changes to the schema are automated as part of our build process with fairly high permission levels. I'm looking at a couple of alternatives to see if they offer any practical additional security. But it seems like not really?</p> <ol> <li><p>One option would be to set up the migration user as <code>CREATE ROLE build_account NOINHERIT IN ROLE db_owner</code> and then <code>SET ROLE db_owner</code> before creating/dropping a table.</p> </li> <li><p>Have the build role do <code>ALTER TABLE new_table TO db_owner</code> after it creates a table. This does seem more robust than the above option, but means we'll have to intervene manually if we ever want to drop a table. That might be ok, since dropping tables is rare, but it eliminates some of the advantage of automated schema changes as it introduces more opportunity for user error.</p> </li> </ol> <p>Is there anything I've missed? Is there a best practice for setting up the role that performs Postgres schema migrations in a build process?</p>
0non-cybersec
Stackexchange
443
1,780
Convergent or divergent series? Asymptotic of the series?. <p><span class="math-container">\begin{align} A&amp;=\sum_{n\ge 0} \frac{(-1)^n}{n!} \frac{b^n}{(n+1)^3}\\ &amp;= \sum_{n=0}^{\infty}\frac{(-1)^{n}b^{n}}{n!}\frac{1}{(1+n)^{3}} = 1\,{}_{3}F_{3}(1,1,1;2,2,2;-b) \end{align}</span> The series is convergent or divergent when b ~ 10^6? Can we survey the asymptotic of this series when b large? I have use the wolfarm alpha and see that it come to zero for b large! However it's not help for my problem. I need an approximation when b large for this series so any suggestions for me to do that? <span class="math-container">${}_{3}F_{3}(1,1,1;2,2,2;-b)$</span> is the generalized hypergeometric function.</p>
0non-cybersec
Stackexchange
257
714
Geodesic completeness of the Poincare ball model without using Hopf-Rinow theorem. <p>A Riemannian manifold is said to be <em>geodesically complete</em> if every maximal geodesic is defined for all $t\in \mathbb R$.</p> <p>Poincare ball is a unit ball(open) in $\mathbb R^n$ with metric $$g_{ij} = \frac{\delta_{ij}}{(1 - x_k x^k)^2}.$$</p> <p>The geodesic equation is</p> <p>$$\frac{d^2x^i}{ds^2} + \Gamma^{i}_{jk}\frac{dx^j}{ds}\frac{dx^k}{ds} = 0$$</p> <p>where $\Gamma^i_{jk} = \frac{2}{(1 - x_\mu x^\mu)}[\delta^i_kx_{j} + \delta^i_jx_{k} - \delta_{jk}x^i]$(after <a href="https://math.stackexchange.com/questions/1583434/christoffel-symbols-for-the-poincar%C3%A9-ball-model">computation</a>).</p> <p>Given $x(0)=0$ and $x'(0)=v$, I wonder how to solve this geodesic equation for the geodesic curve $x$. I know the locus of it is either a straight line or a circular arc that meets the boundary of the ball orthogonally. </p>
0non-cybersec
Stackexchange
360
937
How to make LINQ-to-Objects handle projections?. <p>I have implemented a basic (naive?) LINQ provider that works ok for my purposes, but there's a number of quirks I'd like to address, but I'm not sure how. For example:</p> <pre><code>// performing projection with Linq-to-Objects, since Linq-to-Sage won't handle this: var vendorCodes = context.Vendors.ToList().Select(e =&gt; e.Key); </code></pre> <p>My <code>IQueryProvider</code> implementation had a <code>CreateQuery&lt;TResult&gt;</code> implementation looking like this:</p> <pre><code>public IQueryable&lt;TResult&gt; CreateQuery&lt;TResult&gt;(Expression expression) { return (IQueryable&lt;TResult&gt;)Activator .CreateInstance(typeof(ViewSet&lt;&gt;) .MakeGenericType(elementType), _view, this, expression, _context); } </code></pre> <p>Obviously this chokes when the <code>Expression</code> is a <code>MethodCallExpression</code> and <code>TResult</code> is a <code>string</code>, so I figured I'd <em>execute</em> the darn thing:</p> <pre><code>public IQueryable&lt;TResult&gt; CreateQuery&lt;TResult&gt;(Expression expression) { var elementType = TypeSystem.GetElementType(expression.Type); if (elementType == typeof(EntityBase)) { Debug.Assert(elementType == typeof(TResult)); return (IQueryable&lt;TResult&gt;)Activator.CreateInstance(typeof(ViewSet&lt;&gt;).MakeGenericType(elementType), _view, this, expression, _context); } var methodCallExpression = expression as MethodCallExpression; if(methodCallExpression != null &amp;&amp; methodCallExpression.Method.Name == "Select") { return (IQueryable&lt;TResult&gt;)Execute(methodCallExpression); } throw new NotSupportedException(string.Format("Expression '{0}' is not supported by this provider.", expression)); } </code></pre> <p>So when I run <code>var vendorCodes = context.Vendors.Select(e =&gt; e.Key);</code> I end up in my <code>private static object Execute&lt;T&gt;(Expression,ViewSet&lt;T&gt;)</code> overload, which switches on the innermost filter expression's method name and makes the actual calls in the underlying API.</p> <p>Now, in this case I'm passing the <code>Select</code> method call expression, so the filter expression is <code>null</code> and my <code>switch</code> block gets skipped - which is fine - where I'm stuck at is here:</p> <pre><code>var method = expression as MethodCallExpression; if (method != null &amp;&amp; method.Method.Name == "Select") { // handle projections var returnType = method.Type.GenericTypeArguments[0]; var expType = typeof (Func&lt;,&gt;).MakeGenericType(typeof (T), returnType); var body = method.Arguments[1] as Expression&lt;Func&lt;T,object&gt;&gt;; if (body != null) { // body is null here because it should be as Expression&lt;Func&lt;T,expType&gt;&gt; var compiled = body.Compile(); return viewSet.Select(string.Empty).AsEnumerable().Select(compiled); } } </code></pre> <p>What do I need to do to my <code>MethodCallExpression</code> in order to be able to pass it to LINQ-to-Objects' <code>Select</code> method? Am I even approaching this correctly?</p>
0non-cybersec
Stackexchange
970
3,184
SVG tooltip z-index with html title. <p>I'm trying to use an HTML title with a very large tooltip. However I can't seem to get the tooltip background to appear above the title.</p> <p>Here's my code:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>var chart = new Highcharts.Chart({ "chart": { "type": "gauge", "renderTo": "chart-2-container", "marginTop": 60 }, "series": [{ "data": [{ "y": 55.6, "name": "Area", "tooltip": "Area: 50.6 %&lt;br/&gt;Minimum: 50.6&lt;br/&gt;3rd quartile: 57.1&lt;br/&gt;2nd quartile: 59.4&lt;br/&gt;1st quartile: 64.7&lt;br/&gt;Maximum: 75.7" }], "name": "%" }], "tooltip": { "borderColor": "#E2E2E2", "borderRadius": 5, "backgroundColor": "white", "style": { "color": "#454545", "fontSize": 14, "fontFamily": "Arial, sans-serif", "zIndex": 9999, "lineHeight": 14 * 1.4 }, "formatter": function() { return this.point.tooltip; } }, "title": { "floating": true, "useHTML": true, "style": { "zIndex": 1, }, "text": "&lt;a href=\"http://www.google.com\"&gt;This is some link as a very long title which will probably wrap a couple of lines&lt;/a&gt;" }, "yAxis": { "title": null, "tickPixelInterval": 72, "tickLength": 10, "minorTickLength": 8, "minorTickWidth": 1, "min": 50.6, "max": 75.7, "plotBands": [{ "from": 50.6, "to": 57.1, "color": "#ee2c34", "thickness": 15, }, { "from": 57.1, "to": 59.4, "color": "#f07627", "thickness": 15, }, { "from": 59.4, "to": 64.7, "color": "#a88735", "thickness": 15, }, { "from": 64.7, "to": 75.7, "color": "#2c876d", "thickness": 15, }] }, "pane": { "startAngle": -150, "endAngle": 150 } });</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://code.highcharts.com/highcharts.js"&gt;&lt;/script&gt; &lt;script src="https://code.highcharts.com/highcharts-more.js"&gt;&lt;/script&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div id='chart-2-container' style="width: 400px; height: 300px;"&gt; &lt;/div&gt;</code></pre> </div> </div> </p> <p>(also as a fiddle <a href="https://jsfiddle.net/d6q1gt4m/" rel="nofollow noreferrer">https://jsfiddle.net/d6q1gt4m/</a>) </p> <p>The problem is that the background is always behind the title. I could switch to non-html title but then I have the problem that only the 1st line is actually a URL if the title is wrapping (and I need to reapply all my link styles). </p> <p>Does anyone know how I can get the svg tooltip to appear on top of HTML ?</p> <p>Note: I would like to avoid having to set <code>useHTML</code> for the tooltip if possible as that opens up another can of worms for me. </p>
0non-cybersec
Stackexchange
1,162
3,158
Losing Your Voice. I, Jason DuBois, am keeping this journal in the event that… something… happens to me, and the reason as to why is unknown. I want my story out there. I’m sure it’s likely that whoever finds this assumes it to be the ravings of a lunatic, and it’s likely that they’re correct as well. But I just want to make it clear. It’s not the simple fact that I hear voices that makes me crazy, the voices drove me crazy. It began two weeks ago, but it didn’t get really bad until a few days ago. The first time I heard them, I was lying awake in bed. I had just finished writing some of my dissertation for grad school, and I was sitting in bed surfing Youtube, the pale glow of my laptop the only light in my darkened room. I was flipping through random related videos, not really paying attention to where I was going. It got weird when I clicked a link advertising: “Call of Duty New Easter Eggz.” I’m not an intense player, but I played enough to be interested in what I would find. It had nothing to do with Call of Duty. Instead, the video began with a dark screen. Then, out of nowhere, a small girl began approaching the front of the screen from a point in the distance. Her approach was accompanied by furtive whisperings, but I couldn’t quite make out what was being said. I desperately wanted to shut off my laptop, but a part of me wanted to see what was going to happen. The girl stopped walking, and by now her body took up the majority of the screen. Her face was empty and sorrowful. This close, I could see that she was whispering something along with the other voices. I strained my ears to match some phrase of whispering with the pattern of her moving lips. When I was successful, the blood left my face. “Jason, Jason, Jason,” she was whispering. It had to be a coincidence. It had to be. All of a sudden her face snapped from one of sorrow into a giant grin stretching from ear to ear, literally, splitting her face in two. “We want to talk to you Jason.” That was enough for me. I slammed my laptop shut and dashed from my bed. My palm slammed up on the light switch on my wall. There was no way I was going to fall asleep without it on. I tried to brush the occurrence off as a coincidence, or maybe I had just fallen asleep. That was probably it I told myself, I had been up late working on my dissertation. Looking back at that now, I would laugh at my naiveté; unfortunately, laughing is difficult when you’re terrified every second of the day. Regardless, my second of conviction that everything would be okay was short-lived. Because, when I climbed back into bed, I realized that even though I turned off my laptop, I could still hear the whisperings from the video. The next week, I couldn’t shake the whisperings from my head. But there was something even more ominous accompanying the voices. Despite their incessant noise, there was still a hollow silence underlying them that I could almost hear. A lack of noise that was just as loud as their abundance of noise. I was terrified, but I was even more terrified to see a shrink and get locked up for schizophrenia. Not to mention, the voices weren’t the only strange things going on. I was watching an episode of House that I had watched a thousand times before, and at the beginning, when they introduce the first symptom of whoever is to be sick that episode, I knew that the man would be struck with severe muscle cramps and wouldn’t be able to move. Instead, the man went to speak, but couldn’t. It was as though he were choking on his own words. The worst part was though, in the background, I could see the little girl from the Youtube video, amongst a crowd of onlookers, but her focus wasn’t on the sick man. She was staring at me and whispering “Jason, Jason, Jason,” over and over again. I haven’t turned on the TV since. I had almost grown accustomed to the voices about three days ago when something shook me anew. I had been having difficulty falling asleep because of the voices, but that night, I almost remember falling asleep as waking up. I was aware the second I fell asleep and fell into my dream. I was in my room, except it was a mirror image of my room, as though it had all been reflected over the wall with my door on it. And in the center of the room, the small girl, with her back turned on me, was sitting at a small square table with four other people. Two of them were adults, one a man, dressed smartly in a business suit, the other a woman, wearing a jogging uniform. But it was as though the color had faded from them. The man’s suit was gray, and his face pale white. The woman’s exercise clothes were a pale pink. Both of their faces were empty, their eyes focused on nothing. And the fourth guest. Tall and lanky, with long arms. Clothed in a black long-sleeved shirt, black gloves covering his long, boney fingers, and long black pants. No face. No face at all. It filled me with a sense of dread watching him sitting there. Where his features should have been, there was just a flat face. I now understood the source of the noticeable silence that accompanied the voices. The small girl was serving tea to all the guests. The entity with no face left his untouched, but the man and woman picked up theirs and began drinking. Then I noticed them. As they swallowed the tea, it poured out slits in their necks and all down the front of their clothing. A sob of fear escaped my mouth. It was the most realistic dream I ever experienced. The girl’s head began to swivel on her neck. I could hear it cracking as it slowly turned all the way around and locked eyes with me. A bright red slash split her neck open as well. “I lost my voice Jason, she whispered, I lost my voice and I want a new one.” “What the hell are you talking about,” I choked out. “You’ve been doing nothing but talk to me for the past few weeks, what the hell do you want.” This only seemed to enrage the girl. Blood began seeping from the slit in her throat. She screamed. She screamed and screamed and screamed until her the line in her neck split almost all the way around and her head fell forward and began dangling by a little strip of flesh. This set the man and woman off screaming as well. I was thrown out of the dream and into the waking world. Away from the screams, but back to the whispers. I felt warm liquid in-between my legs. “Shit,” I muttered to myself. I touched a hand to my throat. It felt like it was on fire. “Shit.” The next night was even worse. I tried to stay awake as long as possible, but despite the four cups of coffee and the five hour energy shot I took, I fell into sleep anyways. The little girl was standing next to my bed, her head still hanging by a thread, staring at me when I entered my dream. She told me she was irritated I had tried avoiding sleep. That I had tried avoiding her. The man and the woman were lying on the floor next to the table they had been sharing the night before. The tea cups were shattered and the pot was overturned next to them. The worst part was, the little girl was holding their heads in each of her hands. “What the hell did you do?” I asked. “I wanted their voices,” she whispered silently. Her voice rose, “But I couldn’t find them, they didn’t have any! I want my voice! He stole my voice!” She began slamming the heads into the ground, over and over, until they were nothing but bloody pulps in the girls hands. Her head was swinging precariously on her own neck. I almost expected it to fall off. As she finished her rampage, panting, I noticed that the face-less guest had swiveled its head towards me. It was a foot closer to my bed the night before. As I gazed into its empty features, a primal fear swelled in my chest. There was something about his silence that was more terrifying than the girl’s screaming ever would be. I awoke. I had pissed myself again. That day, I reluctantly opened my computer again. I had to find out who this girl was, if she was anything. After an hour of pointless surfing on discussion boards discussing ghosts and spirits, I found my way onto a news site. It so happened, that there was a girl of about seven years old, that had been murdered a week and five days before. Her throat had been cut. But the worst part was, her larynx had been removed. It also just so happened that this was third death in a series of three similar murders. The other victims: a corporate executive and a mom from suburbia. There had been no murder weapon found on any of the occasions, and no evidence left behind. The murderer was nameless. Worse than that, I realized, he wasn’t just nameless, he was face-less. My heart skipped a beat. I should never have been terrified of the little girl. I knew there had been something more ominous about the silence of the other guest than the girl’s screaming. I didn’t want to sleep. I didn’t want to face whatever was sitting in that chair in my dream. The featureless monster. Last night I dreamt again. Like the night before, nothing helped in preventing sleep. I fell into my dream again. As I lifted my head off my dream-pillow and turned my face, I met face to face with the fourth guest. His nothingness stared back at me, cutting deeper than any stare. This time, I noticed the three bloody lumps of cartilage hanging from his right hand. I couldn’t contain my scream. I openly shrieked as, starting from the left side of his face, the skin around where his mouth would have been began splitting open, tearing apart. What was left was a bloody mockery of a mouth, filled with bright red flesh and hanging skin. It opened its mouth as though screaming, but instead of noise, the silence in the room seemed to get louder. Press in on me. I awoke this morning, bed wet once more, and began writing this account. I don’t want to fall asleep tonight. I know what’s going to happen. But I know I will. I know I’m going to lose my voice.
0non-cybersec
Reddit
2,318
9,912
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Bungie In-Game punishment for over use of Well and Synthsceps Exploit?. At this point the exploit is confirmed to be fixed at a later date. Thank you for that first of all. Now to address the real issue at hand, continued use of a confirmed and clear exploit of game mechanics and ruining the game for the opposing team and in some cases your own. Maybe people wanted to actually earn their wins? Maybe people wanted to get the high of winning a close match. All together this strategy is not good for the game. There should be repercussions for continued use of this exploit. Not bans, in-game repercussions. Take away infamy, take away Dredgen, do something to make people who have consistently ruined the game for others be marked so everyone knows they are not a fair player. This is the kind of thing games should have. Community wide visible in-game punishments for people who have ruined it for others. Be better Bungie, Be Just, and do not tolerate or condone exploits in your game. Very Soap Boxey I'm sorry. TL;DR In-game Repercussions for continued exploiters of Well and Synthoceps would be nice.
0non-cybersec
Reddit
274
1,117
Fedora command-line installation proposals. <p>How to force Fedora command-line to give me proposals for installation of package when a missing command is typed?</p> <p>Now when I type <code>git</code> the command-line tells me :</p> <pre><code>-bash: git: command not found </code></pre> <p>Before it gave me proposal (something like this):</p> <pre><code>Command not found. Install package 'git' to provide command 'git'? [N/y] </code></pre> <p>I made a clean installation of Fedora 24 and obviously this feature is missing. I tried to <code>dnf install command-not-found</code> but it couldn't find the package. What should I do to bring this feature back?</p>
0non-cybersec
Stackexchange
196
669
Why is $\dim(W)=3$?. <p>I am teaching myself upper-division linear algebra for the moment, and I currently do not understand this example in my textbook. </p> <p>This is from page 50 of Linear Algebra by Friedberg, Insel, and Spence - 4th edition.</p> <blockquote> <p>Let $W$ be defined by $$W=\{(a_1,a_2,a_3,a_4,a_5)\in F^5 : a_1+a_3+a_5=0,a_2=a_4\}.$$ It is easily shown that $W$ is a subspace of $F^5$ having $$\{(-1,0,1,0,0),(-1,0,0,0,1),(0,1,0,1,0)\}$$ as a basis. Thus $\dim(W)=3$.</p> </blockquote> <p>I understand that $\dim(W)=3$ because there are three elements listed in the basis of $W$. But how did the textbook come up with this basis, given the above definition of $W$? </p> <p>Also, an even stupider question: what is $F^5$? I know that $F$ in my textbook is a field, and in linear algebra a field is typically seen as either $\mathbb{R}$ or $\mathbb{C}$, although there are others or $F$ can even be treated generally.</p>
0non-cybersec
Stackexchange
340
946
Looking for Pseudo-code for Fortune&#39;s algorithm. <p>I'd really appreciate if someone who ever dealt with Fortune's algorithm for generating Delaunay-triangulations presented me a rather low-level pseudo-code of the algorithm! I read the one on wikipedia but it's a bit confusing and looks high-level, and any piece of code I could find had the original C implementation's inconveniences.</p> <p>I'd like to implement it in C++, but in a way that the output generated is in the form of (my own) classes I'm going to use (vertices, edges and triangles as objects). So I need to understand everything and implement it from scratch.</p> <p>I also read the description of the algorithm, and I know what it does and how, but this is still to abstract for me right now. However, I'd also be happy with a similar description going into the (implementation) details, it doesn't have to be code-like!</p>
0non-cybersec
Stackexchange
222
901
SQL injection with a URL separated with dashes. <p>I have have used sqlmap for a long time now. I have come across a this url pattern. <code>http://www.example.com/parameter-somethingid01-anotherthingid023</code></p> <p>Where parameter is expendable meaning it doesn't matter if the it's available or not. <code>http://www.example.com/somethingid01-anotherthingid023</code> is the same as the one above</p> <p>if you change <code>somethingid01</code> to <code>somethingid012</code> or other id it will take you to a different resource that applies to <code>anotherthingid</code> too.</p> <p>My question is how am I going to tell sqlmap to attack this kind of URL?</p>
1cybersec
Stackexchange
199
671
Calculate increment/decrement percentage from two values. <p>Hi all I got a very stupid question which I could not figure out how to solve it.</p> <p>So basically I am trying to calculate how many percentage of increment/decrement for the expense and income of current from past month.</p> <p>So let's say I got these data:</p> <pre><code>Current Month Expense: 10454 Current Month Income: 2233 Last Month Expense: 15 Last Month Income: 1500 </code></pre> <p>To calculate the income:</p> <pre><code>if(thisMonthtotalIncome &lt; lastMonthtotalIncome){ incomePercentage = Math.round(thisMonthtotalIncome/lastMonthtotalIncome * 100); }else if(thisMonthtotalIncome &gt; lastMonthtotalIncome){ incomePercentage = Math.round((thisMonthtotalIncome/lastMonthtotalIncome)); } </code></pre> <p>To calculate the expense:</p> <pre><code>if(thisMonthtotalExpense &lt; lastMonthtotalExpense){ expensePercentage = Math.round(thisMonthtotalExpense/lastMonthtotalExpense * 100); }else if(thisMonthtotalExpense &gt; lastMonthtotalExpense){ expensePercentage = Math.round((thisMonthtotalExpense/lastMonthtotalExpense)); } </code></pre> <p>I realized the percentage was somewhat wrong because from the data above, I get the expense increases by 697%. Is there any way or correct way to limit it to be in the range of 0% - 100%?</p> <p>Also, I think that the formula is wrong as well cause I am so lousy at Maths.</p> <p>Any suggestions? Thanks in advance!</p>
0non-cybersec
Stackexchange
463
1,507
Direct sum of subspaces using Cayley-Hamilton. <p><span class="math-container">$\renewcommand{\phi}{\varphi}\newcommand{\id}{\text{id}}$</span>Consider an endomorphism <span class="math-container">$\phi:V\to V$</span>, where <span class="math-container">$V$</span> is any finite dimensional <span class="math-container">$F$</span>-vector space. Assume the characteristic polynomial <span class="math-container">$\chi_\phi=fg\in F[x]$</span>, where <span class="math-container">$f,g$</span> are monic polynomials that are relatively prime. Set <span class="math-container">$W_1=\ker f(\phi)$</span> and <span class="math-container">$W_2=\ker g(\phi)$</span>. Show <span class="math-container">$V=W_1\oplus W_2$</span>.</p> <p>Here is what I have done:</p> <p>By Cayley-Hamilton, we have <span class="math-container">$\chi_\phi(\phi)=0$</span>, thus <span class="math-container">$f(\phi)g(\phi)=0$</span>. So either <span class="math-container">$f(\phi)=0$</span> or <span class="math-container">$g(\phi)=0$</span>. This means either <span class="math-container">$\ker f(\phi)=V$</span> or <span class="math-container">$\ker g(\phi)=V$</span>, so either <span class="math-container">$W_1=V$</span> or <span class="math-container">$W_2=V$</span>. Thus <span class="math-container">$V=W_1+W_2$</span>. We now show the sum is direct. From our previous work we know either <span class="math-container">$f(\phi)=0$</span> or <span class="math-container">$g(\phi)=0$</span>, so assume without loss of generality that <span class="math-container">$f(\phi)=0$</span>. Since <span class="math-container">$f$</span> and <span class="math-container">$g$</span> are relatively prime, there are polynomials <span class="math-container">$h_1,h_2\in F[x]$</span> such that <span class="math-container">$h_1f+h_2g=1$</span>. Thus <span class="math-container">$h_1(\phi)f(\phi)+h_2(\phi)g(\phi)=\id_V$</span>. But <span class="math-container">$f(\phi)=0$</span>, so <span class="math-container">$h_2(\phi)g(\phi)=\id_V$</span>. For any non-zero <span class="math-container">$x\in V$</span>, we have <span class="math-container">$h_2(\phi(x))g(\phi(x))=x$</span>, so <span class="math-container">$g(\phi(x))$</span> cannot be zero. Thus <span class="math-container">$\ker g(\phi)=W_2$</span> is trivial, so <span class="math-container">$W_1\cap W_2=0$</span>, hence <span class="math-container">$V=W_1\oplus W_2$</span>.</p> <p>I am wondering if this line of reasoning holds, since I feel a bit weird about the fact that one of the summands ends up being the whole space and the other one ends up being empty. I also don't think I ever used the assumption that both polynomials are monic, but does this even matter?</p>
0non-cybersec
Stackexchange
909
2,703
There is something very strange going on with my wife...... [Part 2](http://www.reddit.com/r/nosleep/comments/33cfo3/part_2_what_exactly_is_it/) [Part 3](http://www.reddit.com/r/nosleep/comments/33l41r/part_3_her_green_eyes/) [Part 4] (http://www.reddit.com/r/nosleep/comments/35da9g/part_4_there_is_something_even_stranger_going_on/) [Part 5](http://www.reddit.com/r/nosleep/comments/36btic/part_5_i_finally_understand/) This is my first post on nosleep, but I feel you guys should know about this. If you want to get to the ‘meat’ of the story, you can skip ahead to the 4th paragraph. Growing up I always feared monsters. Even in college, which most would consider to be the time when you can be called an adult, my greatest fears were the monsters under my bed, in the closet or at the window. I would always tell myself how silly this was seeing as I was an adult at this point and I was still afraid of something I knew did not exist. That was until……. I met my wife. But before I tell you what happened, let me elaborate on how I met my wife to be and how much she means to me. I met Natalie in college. I was a nerdy guy, yet she saw in me something that no other girl in my life had. She was an extremely kind person, who always had the sweetest of intentions. As I spent more time with her, I realized how many things we had in common. To me she was the most beautiful girl in the world. I could stare into her green eyes for the rest of my life, and that’s what I chose to do when I proposed and we finally got married. Fast forward to married life, I am working now, while she is working on an online masters degree. Life is good, life is actually perfect, too perfect. Ever since we got married, I’ve told her everything, my deepest secrets, my deepest feelings, and most importantly, my deepest fears. I remember when I first told her about my silly fear of monsters, at first she laughed it off. But over time, she noticed how I would sometimes shiver in bed, lying awake in fear. Being the sweet heart that she is, she would hold me, and tell me it would be alright. My wife became my protector, she became the one to keep my fears in check. Her face became that of an angel to me, one that would protect me from whatever scary things life had in store for me. I came to trust those beautiful green eyes, and every time I saw her, I knew I was safe. Now to the more……weird things that have been happening of late. The first incident that I can recall that could be defined as strange happened at 3:00 am one night. I woke up feeling extremely thirsty, and being the fearful guy that I am, grabbed the flash light to go get some water. As soon as I turned on the flashlight I noticed my wife wasn’t in bed. I looked over to the bathroom and the light was on and I could hear the water running so I assumed she was there. Half asleep I walked downstairs to the kitchen and almost had a heart attack when I saw my wife standing in a corner drinking water. As soon as I saw her though, I felt safe. She smiled at me as she sipped the water from the glass. I was too tired and I mumbled something about how hot it is as I got some water. She continued to smile at me as I finished my water and headed upstairs. As I walked back upstairs I called out that she should come back to bed seeing as it’s so late. When I get back to my room, there she was, sound asleep. This was the moment I became wide awake. I could have sworn she was downstairs having water. Afraid to go back downstairs, I woke her up and told her what happened. Half asleep, half upset, she comforted me and told me to go back to bed. The next morning she joked about how I’m so afraid of the dark that I see her everywhere as my protector. “Besides, I was using the bathroom when you thought I was out of bed” she claimed. With that warm smile, how could I think otherwise? A week later, another strange incident. This was in broad day light, while on a Saturday morning, Natalie woke me up at 11:00 am and told me she was going to get groceries. At around 11:30 am I finally got out of bed and dressed up for a late brunch with my beautiful wife. I went to the kitchen and found her drinking a glass of water. I smiled and said “Back so soon honey?” She didn’t reply, just smiled as she sipped on her water. Before I could approach her, the doorbell rang and I immediately went to go see who it was. I opened the door. Yes, it was my wife, back with all the groceries. “Oh help me with all of this will you?” she jokingly snapped as she put down the paper bags by the door. As soon as she saw my color drained face, she knew something was wrong. She sat me down, got me some water and I told her what happened. This time it was in broad daylight, and I knew what I saw. As much as I had come to adore her beautiful green eyes, for the first time, I saw in them a strange fear. My wife was the strong one, never afraid. She told me there is something she should have told me a long time ago. She said this happened to her as a kid, a lot. Where her parents and siblings would see her in places they knew she wasn’t. They could never explain these occurrences, but seeing as it caused no harm, they came to live with it without really questioning these encounters. It took me a few months to process everything she had told me, but I started to live with it also. Like I said, my true perception of fear was monsters, not my beautiful wife. Several similar incidents happen, for instance I would see her sitting in bed, only to find her cooking in the kitchen downstairs. And in all these instances, when I would interact with this ‘entity’ that I still saw as my wife, she would smile and not say anything. I actually came to find comfort in seeing my wife all the time, always smiling, always happy, and always perfect. It is important to note, however, that in all of these incidents, there was never any overlap. Meaning I never saw her in two places simultaneously. I guess any sane person would have called out to their wife when they thought they were seeing the entity. But like I said, I found comfort in her green eyes, in her smiling face, so honestly I didn’t really care. Then today, everything changed. My wife told me she was going to visit her grandparents who live an hour away from where we do. She invited me to go, but seeing as it was a Sunday and I just wanted to be lazy, I told her to go ahead without me. This is when it finally happened. The overlap. I was in my living room watching TV when I got up to get myself a coke. There she was, my wife again, sipping water from a glass and just smiling. I was so used to it by now, knowing this was the ‘entity’, I smiled and said “And it is nice to see you are still watching over me!” She smile and continued to look at me with those beautiful green eyes I had grown so fond of. That’s when the phone rang and I turned away from the ‘entity’ to pick it up. “Hey sweetie, I’m going to run a little late since granny insists on me staying for lunch!” It was my wife, and as soon as I heard her voice, I heard a glass shatter, which my wife on the phone also heard. I turned around and saw that the ‘entity’ was now glaring at me, the smile no longer there. But rather, a very disturbing grin. She was pointing at me, with her head tilted at a perfect 90 degree angle. But that wasn’t what disturbed me, it was her eyes. They were no longer the green that I found so much comfort in. They were pitch black, like those demons in the movies. I stared at her as I was at a complete loss of words. “Honey, is everything ok? Did you drop something?” my wife asked on the phone. I whispered back into the phone “I didn’t, she did…….” At this point my wife screamed into the phone “HANG UP AND LOOK AWAY!!!!” I don’t know how I found the strength to do so, but I did exactly what she said. When I opened my eyes a split second later, she was gone. Confused and scared, I called my wife back who said she was already on the way “It shouldn’t have happened, it shouldn’t have overlapped, they said it wouldn’t……..they said she was harmless………” I am too scared to just sit around and wait, I still keep looking over my shoulder. My wife should be home anytime now. As soon as she gets back I will ask her who she meant by “they” and what the hell is going on. She knows something and I have to know what it is. Never did I think that the one I hold so near and dear to my heart, the one who protects me, could become the monster that I fear the most. P.S. If enough of you are interested, I will continue my story and update when I find out more information.
0non-cybersec
Reddit
2,121
8,651
What is the point of `std::make_optional`. <p>All the <code>std::make_</code> are made redundant by C++17 with the introduction of <a href="https://en.cppreference.com/w/cpp/language/class_template_argument_deduction" rel="nofollow noreferrer">Class template argument deduction</a> (except <code>make_unique</code> and <code>make_shared</code>).</p> <p>So what is the point of <a href="https://en.cppreference.com/w/cpp/utility/optional/make_optional" rel="nofollow noreferrer"><code>std::make_optional</code></a>? As far as I can tell it does the exact same thing as the <a href="https://en.cppreference.com/w/cpp/utility/optional/deduction_guides" rel="nofollow noreferrer">deduction guides for <code>std::optional</code></a>.</p> <p>Is there a scenario where <code>std::make_optional</code> is preferred over deduction guides?</p>
0non-cybersec
Stackexchange
268
834
Kendo Grid: Getting widget instance in Angular. <p>I was trying to get an instance of the Kendo grid within my Angular Controller, so I can try and hook up to some events (and call methods) I know this is probably not best practice (and should probably use a custom directive), but according to the <a href="http://docs.telerik.com/kendo-ui/AngularJS/introduction" rel="noreferrer">documentation</a>, we should be able to use...</p> <pre><code>&lt;div ng-app="app" ng-controller="MyCtrl"&gt; &lt;input kendo-datepicker="datePicker" k-on-change="onChange()"&gt; &lt;/div&gt; &lt;script&gt; angular.module("app", [ "kendo.directives" ]).controller("MyCtrl", function($scope) { $scope.onChange = function() { alert($scope.datePicker.value()); }; </code></pre> <p>}); </p> <p>So, I was trying to do the same with the grid. I have the following markup...</p> <pre><code>&lt;div ng-controller="Grid"&gt; &lt;div kendo-grid='grid' k-options="vm.gridOptions"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>and then in the controller js file..</p> <pre><code> angular .module("mygrid") .controller("Grid", ['$scope', Grid]); function Grid($scope) { var gridInstance = $scope.grid; ... </code></pre> <p>as can be seen <a href="http://jsfiddle.net/peterjc/ocdhxxpv/2/" rel="noreferrer">here</a></p> <p>However, gridInstance is always undefined. Does anyone know if I shoud be able to do this with the grid, and if so why the above always returns undefined?</p> <p>Thanks in advance for any help</p> <p>Peter</p>
0non-cybersec
Stackexchange
523
1,560
Chase Bank no longer supports third party budgeting software with syncing. Chase has not been loading lately on Mint and today, while looking through the message boards to figure out a timeline for the issue, I found this "Thank you for contacting Chase about not being able to give Mint.com access to the financial information in your account. Please be aware that we are no longer allowing third party websites or software to access your account. This is for your security and protection. I apologize for the inconvenience this may cause you. I regret that you are disappointed in our decision to stop third party applications. Please understand, when an account is enrolled in such a service as Mint, the online login information must be given to the outside financial institution so their system may be able obtain billing information. Because protecting your information is our top priority, we have made the decision to only support the financially responsible person accessing their account. If you need any other assistance, you can call the number on the back of your card or send us a secure message. We appreciate your business and thank you for choosing Chase. Thank you, Dana Knight Customer Service Specialist 1-800-436-7927" This can be found at https://mint.lc.intuit.com/questions/1243101-chase-accounts-are-down
0non-cybersec
Reddit
290
1,342
improve speed of fuzzy search. <p>I have configured <a href="https://www.freecodecamp.org/news/fuzzy-string-matching-with-postgresql/" rel="nofollow noreferrer">trigram index</a> for fuzzy search in Postgres. I inserted 8500000 rows to this table with 4 words text.</p> <pre><code>CREATE DATABASE people; \connect people; CREATE TABLE person ( id bigserial NOT NULL, name text NULL ); CREATE EXTENSION fuzzystrmatch; CREATE EXTENSION pg_trgm; CREATE INDEX name_trigram_idx ON person USING gin (name gin_trgm_ops); INSERT INTO person (name) SELECT CONCAT(g.name, ' ', g.name, ' ', g.name, ' ', (SELECT array_to_string( array(select substr( 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', ((random() * (36 - 1) + 1)::integer), 1) from generate_series(1, 10)), ''))) FROM generate_series(1, 8500000) AS g (name); </code></pre> <p>Now I do a fuzzy search:</p> <pre><code>SELECT * FROM person WHERE name % '1200000' </code></pre> <p>And have results:</p> <pre><code> id | name ---------+------------------------------------ 12000 | 12000 12000 12000 CLXBHQVEKC 120000 | 120000 120000 120000 CLXBHQVEKC 1200000 | 1200000 1200000 1200000 CLXBHQVEKC 1202000 | 1202000 1202000 1202000 CLXBHQVEKC 1212000 | 1212000 1212000 1212000 CLXBHQVEKC (5 rows) </code></pre> <p>It takes about 1 second. That's good but I would like to have it faster (300ms).</p> <p>What's are possible ways for optimization the speed? Here is <code>explain-analyze</code> request:</p> <pre><code>EXPLAIN (ANALYZE) SELECT * FROM person WHERE name % '1200000' QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------- Bitmap Heap Scan on person (cost=201.87..24804.13 rows=8499 width=42) (actual time=45.135..972.583 rows=5 loops=1) Recheck Cond: (name % '1200000'::text) Rows Removed by Index Recheck: 147980 Heap Blocks: exact=25286 -&gt; Bitmap Index Scan on name_trigram_idx (cost=0.00..199.74 rows=8499 width=0) (actual time=40.833..40.840 rows=147985 loops=1) Index Cond: (name % '1200000'::text) Planning Time: 1.538 ms Execution Time: 973.046 ms (8 rows) </code></pre> <p>And a link to my <a href="https://github.com/ypapax/fuzzy_postgres_speed" rel="nofollow noreferrer">test repo</a>.</p> <p>Generally speaking, I would like to have a typo-proof search for a text with several words which has about 9 million rows and it shouldn't respond longer than 300ms.</p> <p>P.S. for this experiment I'm running Postgres in docker with 6 CPUs, 8GB memory and 1GB of swap.</p>
0non-cybersec
Stackexchange
893
3,154
difference between LC/PC and LC/APC couplers?. <p>i have to connect two LC/APC male connector plugs. Currently i only have blue LC-LC couplers on stock. Due to analogue RF-Overlay signals that are transmitted via this link, the quality of the connection is important here.</p> <p>Is there a difference between LC/APC and LC/PC couplers? In my understanding the "angled" part is only defined by the tip of the male LC connector, so it should be irrelevant if i use a green or a blue coupler. Am i right or is there a difference in real world?</p> <p>Thanks for all replys!</p> <p>//Andreas</p>
0non-cybersec
Stackexchange
173
596
How I got a $6k raise 3 months into my first job just by asking.. Using a throwaway to protect my main account. This will certainly not apply to everyone, but has been a huge boon to my wife and I. I started my first job out of college 3 months ago, and just became eligible for my company's health insurance plan. However, we're both under 26 and can stay on our parents' family plans for at least two more years. I asked my employer if A) I could opt out of the plan and B) they would pay me what they otherwise would have had to pay on my behalf. They were completely fine with that, so I now make an extra $500/month. Obviously this only applies to a small group of people, but it's already been a huge benefit to us and could be to others as well. We now have an extra $4k/year or so after taxes to put towards my student loans and saving for a house down payment. If you're under 26 and your parents need a family insurance plan anyway, ask your employer! It certainly can't hurt.
0non-cybersec
Reddit
235
988
Git: cannot checkout branch - error: pathspec &#39;...&#39; did not match any file(s) known to git. <p>I'm not sure why I'm <strong>unable to checkout</strong> a branch that I had worked on earlier. See the commands below (note: <code>co</code> is an alias for <code>checkout</code>):</p> <pre><code>ramon@ramon-desktop:~/source/unstilted$ git branch -a * develop feature/datts_right feature/user_controlled_menu feature/user_controlled_site_layouts master remotes/origin/HEAD -&gt; origin/master remotes/origin/develop remotes/origin/feature/datts_right remotes/origin/master ramon@ramon-desktop:~/source/unstilted$ git co feature/user_controlled_site_layouts error: pathspec 'feature/user_controlled_site_layouts' did not match any file(s) known to git. </code></pre> <p>I'm not sure what it means, and I can't seem to find anything I can understand on Google. </p> <p><strong>How do I checkout that branch, and what may I have done to break this?</strong></p> <p><strong>UPDATE</strong>:</p> <p>I found <a href="https://stackoverflow.com/questions/4181861/git-error-src-refspec-master-does-not-match-any">this post</a>, and running <code>git show-ref</code> gives me:</p> <pre><code>97e2cb33914e763ff92bbe38531d3fd02408da46 refs/heads/develop c438c439c66da3f2356d2449505c073549b221c1 refs/heads/feature/datts_right 11a90dae8897ceed318700b9af3019f4b4dceb1e refs/heads/feature/user_controlled_menu c889b37a5ee690986935c9c74b71999e2cf3c6d7 refs/heads/master c889b37a5ee690986935c9c74b71999e2cf3c6d7 refs/remotes/origin/HEAD e7c17eb40610505eea4e6687e4572191216ad4c6 refs/remotes/origin/develop c438c439c66da3f2356d2449505c073549b221c1 refs/remotes/origin/feature/datts_right c889b37a5ee690986935c9c74b71999e2cf3c6d7 refs/remotes/origin/master 23768aa5425cbf29d10ff24274adad42d90d15cc refs/stash e572cf91e95da03f04a5e51820f58a7306ce01de refs/tags/menu_shows_published_only 429ebaa895d9d41d835a34da72676caa75902e3d refs/tags/slow_dev </code></pre> <p><strong>UPDATE on <code>.git</code> directory</strong> (<code>user_controlled_site_layouts</code> is in the <code>refs/heads/feature folder</code>):</p> <pre><code>$ ls .git/refs/heads/feature/ datts_right user_controlled_menu user_controlled_site_layouts $ cat .git/refs/heads/feature/user_controlled_site_layouts 3af84fcf1508c44013844dcd0998a14e61455034 </code></pre> <p><strong>UPDATE on <code>git show 3af84fcf1508c44013844dcd0998a14e61455034</code></strong></p> <pre><code>$ git show 3af84fcf1508c44013844dcd0998a14e61455034 commit 3af84fcf1508c44013844dcd0998a14e61455034 Author: Ramon Tayag &lt;[email protected]&gt; Date: Thu May 12 19:00:03 2011 +0800 Removed site layouts migration diff --git a/db/schema.rb b/db/schema.rb index 1218fc8..2040b9f 100755 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version =&gt; 20110511012647) do +ActiveRecord::Schema.define(:version =&gt; 20110503040056) do create_table "attachments", :force =&gt; true do |t| t.string "name" @@ -205,15 +205,6 @@ ActiveRecord::Schema.define(:version =&gt; 20110511012647) do t.integer "old_id" end - create_table "site_layouts", :force =&gt; true do |t| - t.string "name" - t.text "description" - t.text "content" - t.integer "site_id" - t.datetime "created_at" - t.datetime "updated_at" - end - create_table "site_styles", :force =&gt; true do |t| t.text "published" t.datetime "created_at" </code></pre>
0non-cybersec
Stackexchange
1,400
3,564
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Read CSV in R and filter columns by name. <p>Let's say I have a CSV with dozens or hundreds of columns and I want to pull in just about 2 or 3 columns. I know about the <code>colClasses</code> solution as described <a href="https://stats.stackexchange.com/questions/16796/reading-only-two-out-of-three-columns-with-read-csv">here</a> but the code gets very unreadable.</p> <p>I want something like <code>usecols</code> from <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html" rel="nofollow noreferrer">pandas' <code>read_csv</code></a>.</p> <p>Loading everything and just selecting afterwards is not a solution (the file is super big, it doesn't fit in memory).</p>
0non-cybersec
Stackexchange
228
706
New Cisco SG350X changing config of SG500 switches. <p>We have about 20 Cisco SG500 Switches in our network configured with various VLANs, trunks, ports etc.</p> <p>We recently needed to install additional network capacity so purchased some SG350X switches as the SG500s are end-of-life.</p> <p>Whilst getting the SG350X configured and ready to deploy, we noticed some weird network issues on our existing network, specifically Wifi access points and IP phones were broken and no longer.</p> <p>Our investigation revealed that the configuration of the broken ports had been changed and we suspect that the new SG350X may have been the culprit. We did change the admin password of the switch to match that of our other switches so does the SG350X have the ability to manage other switches? And if not, any other ideas of how it couold have happened? Is their an audit of configuration changes?</p> <p>An example of a change to a ports configuration is from:</p> <pre><code>interface gigabitethernet1/1/19 loopback-detection enable dot1x guest-vlan enable dot1x port-control auto description 115 switchport trunk native vlan 210 </code></pre> <p>To</p> <pre><code>interface gigabitethernet1/1/19 loopback-detection enable dot1x guest-vlan enable dot1x port-control auto description 115 storm-control broadcast enable storm-control broadcast level 10 storm-control include-multicast port security max 10 port security mode max-addresses spanning-tree portfast macro description ip_phone_desktop !next command is internal. macro auto smartport dynamic_type unknown </code></pre>
0non-cybersec
Stackexchange
429
1,598
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Font-independent convention for multi-letter variables in math mode. <p>For several years now, I have always used <code>\mathit</code> to display variables that have more than one letter, to ensure proper kerning:</p> <pre><code>\fbox{$foo = f(jazz)$} vs. \fbox{$\mathit{foo} = f(\mathit{jazz})$} </code></pre> <p><img src="https://i.stack.imgur.com/sXFlf.png" alt="first example"></p> <p>I see that this has been suggested <a href="https://tex.stackexchange.com/questions/67109/how-to-use-suggestive-variable-names-in-math/67117">several</a> <a href="https://tex.stackexchange.com/questions/6087/two-letter-variable-names">times</a> here as well.</p> <p>However I would now like to update my document and use the Euler math fonts. In this setup, the default mathematical font has upright letters, and suddenly, all my <code>\mathit</code> have become wrong. I do not even know how to fix it:</p> <pre><code>\documentclass{minimal} \usepackage{eulervm} \begin{document} \fbox{$foo = f(jazz)$} vs. \fbox{$\mathit{foo} = f(\mathit{jazz})$} vs. \fbox{$\mathrm{foo} = f(\mathrm{jazz})$} vs. \fbox{$\mbox{foo} = f(\mbox{jazz})$} \end{document} </code></pre> <p><img src="https://i.stack.imgur.com/vQPkt.png" alt="second example"></p> <p>Surely there must be a way to tell LaTeX "here is a block of text to treat as a single name", disabling the spacing for the implicit multiplication, and without forcing any particular font, so that the formula can be rendered nicely independently of the mathematical font I later decide to use?</p>
0non-cybersec
Stackexchange
496
1,585
Real analysis: Limit of sequence. <p>Question: If $0&lt;a&lt;b$ determine the limit $\left(\frac{a^{n+1}+b^{n+1}}{a^n+b^n} \right)$</p> <p>Attempt: Well we cannot assume that any of them are convergent on their own as they could be greater then 1 and so they could all diverge individualy. I was thinking if I could show $\lim \left(\frac{a^{n+1}}{a^n+b^n}\right)$ is convergent then the same with $b^{n+1}$ then their sum is convergent. I can only use simple theorems, no derivative. </p>
0non-cybersec
Stackexchange
165
493
Exchange 2010 queue viewer not working in Exchange Management console. <p>I recently agreed to help my works network admin with the exchange 2010 server (seeing as I have experience in 2016 which were migrating to at the end of the year), but when trying to administer it, <a href="https://i.stack.imgur.com/D7DZS.png" rel="nofollow noreferrer">I get this message</a>. This happens when I try to open queue viewer, or message viewer. I have the same exchange privileges that the network admin has but when he tries there is no issue. I also can not run a handful of cmdlets in the exchange management shell. Unless there is a certain privilege I do know about I don't know the issue. Any help?</p>
0non-cybersec
Stackexchange
169
698
Can you find an element of order 10 in $\mathbb{Z}_{31}^{*}$. <p>I'm stuck on that question, because I'm trying to find a simple way to solve it.</p> <p>I'm pretty sure there exists such elements because the group is cyclic and $|\mathbb{Z}_{31}^{*}| = 30$, hence there exists a sub-group of any order dividing $30$. So I know there is a sub-group of order $10$ and it's cyclic because any sub-group of a cyclic group is cyclic, and it's generator is an elements of order $10$. </p> <blockquote> <p>Now, how can I proceed from here? How can one find the generator of this sub-group?</p> </blockquote>
0non-cybersec
Stackexchange
174
605
Debian 8, Apache 2.4.10: Scoreboard is full, not at MaxRequestWorkers. <p>Fresh install of Debian 8. After running my web server for a few minutes/hours, Apache2 stops working. I always get the error "Scoreboard is full, not at MaxRequestWorkers" from Apache2 error.log. </p> <p><a href="https://support.plesk.com/hc/en-us/articles/213901685-Apache-crashes-scoreboard-is-full-not-at-MaxRequestWorkers" rel="nofollow noreferrer">This workaround</a> works for me, however - I do not want to change MPM mode to prefork. So is there any other solution to this? Like upgrading the Apache2 version? I'm relatively new to Linux/Debian, so I'm not sure what to do exactly whatsoever.</p>
0non-cybersec
Stackexchange
206
681
Long Division in Fractions. <p>In order to do long division on this problem, do I have to first do Foil? <span class="math-container">$$\frac{6x^2-3x}{(x-2)(x+4)}$$</span> How should I go about this long division?<br> If I do FOIL first, do I end up with a problem like this? <span class="math-container">$$(x^2+4x-8)\overline { )6x^2-3x}$$</span>How should I do the division on it?</p>
0non-cybersec
Stackexchange
136
387
Optimal Stopping Theorem for UI Martingales. <p>In my notes, I was given that:</p> <p>"Let $X_n$ be an $F_n$ (super,sub) martingale and $\tau$ an $F_n$ stopping time. Then $X_{n \wedge \tau}$ is a (super, sub) martingale wrt $F_n$ and $F_{n \wedge \tau}$"</p> <p>However in the section about Uniformly Integrable Martingales it says:</p> <p>"Let $X_n$ be a UI Martingale. Then for any $F_n$ stopping time $\tau$, $X_{n \wedge \tau}$ is Uniformly integrable."</p> <p>Is it not true that if $X_n$ is a UI Martingale then $X_{n \wedge \tau}$ is a Uniformly integrable martingale?</p>
0non-cybersec
Stackexchange
215
585
Introductory textbooks on Morse-Kelley set theory. <p>Are there simple textbooks on Morse-Kelley set theory for mathematicians who are not specialists in this field (like me)? </p> <p>I know only <a href="http://rads.stackoverflow.com/amzn/click/0923891552" rel="nofollow">J.L.Kelley's "General topology"</a>, but it does not contain many important things, in particular, the notion of rank of a set, and everything connected to it. Can anybody suggest me some reading on this topic? </p>
0non-cybersec
Stackexchange
140
490
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Can&#39;t upgrade the system, dist. update stuck. <p>I've just bought a Dell inspirion laptop , core i3 , 4gb ram , nvidia graphics (2gb vram) and it came with Ubuntu 12.0.4 LTS which is nice cuz i need it for programming. But when i run distribution update from update manager it always gets stuck afterabout halfway, almost never at the same place(i had to return it to factory state a couple of times). I tried sudo apt-get -f install , tried sudo fuser /var/etc... and then sudo apt-get -f install, it run the update but had some errors when installing kernels and couldn't load at all. Please help</p> <p>P.S. I'm new to Ubuntu and Linux, i got the basics but I still dont get smoe things around here.</p>
0non-cybersec
Stackexchange
193
714
Storage product testing. <p>I know this is out of place (being an active member here I am coming for the help from seniors), but I need some information regarding storage testing, testing of RAID arrays, SCSI, SAS, SATA and also test carried out on fabric manager (Cisco MDS series switches).</p> <p>I am aware that this is an administrative forum and I would really appreciate if you could direct me to the correct forum ar links where i can learn things.</p> <p>@ moderators - Sorry for posting at the wrong place, I would be deleting this as soon as I get the help.</p> <p>Thanks!</p>
0non-cybersec
Stackexchange
153
591
How does useState() in React Hooks know which Component instance it is?. <p><a href="https://reactjs.org/docs/hooks-faq.html#how-does-react-associate-hook-calls-with-components" rel="nofollow noreferrer">React Docs</a> says:</p> <blockquote> <h3>How does React associate Hook calls with components?</h3> <p>React keeps track of the currently rendering component. Thanks to the Rules of Hooks, we know that Hooks are only called from React components (or custom Hooks — which are also only called from React components). There is an internal list of “memory cells” associated with each component. They’re just JavaScript objects where we can put some data. When you call a Hook like useState(), it reads the current cell (or initializes it during the first render), and then moves the pointer to the next one. This is how multiple useState() calls each get independent local state.</p> </blockquote> <p>First of all... what is this "memory cell"? Can we print it out ourselves to see its value?</p> <p>Second, there is only <strong>one</strong> instance of the function (such as <code>Counter()</code> in the following example). So if we render <code>&lt;Counter /&gt;</code> twice into the DOM, once to <code>&lt;div id="root1"&gt;</code> and the second time to <code>&lt;div id="root2"&gt;</code>, how does the function <code>Counter()</code> know which is which?</p> <pre><code>function Counter() { let [count, setCount] = React.useState(0); return ( &lt;div&gt; &lt;button onClick={() =&gt; setCount(count + 1)}&gt; + &lt;/button&gt; { count } &lt;button onClick={() =&gt; setCount(count - 1)}&gt; - &lt;/button&gt; &lt;/div&gt; ) } </code></pre>
0non-cybersec
Stackexchange
530
1,766
Hydra brute force error message. <pre><code>hydra 190.13.132.90 -s 8081 -V -L /home/nicolas/Escritorio/USER -P /home/nicolas/Escritorio/passwords.txt http-post-form "/user=^USER^&amp;password=^PASS^=Ingresar&amp;culture=es-CL&amp;mobile=0&amp;clasica=1:F=Usuario inexistente:H=Cookie: stwa2={"lang":"es-CL"}" Hydra v8.7-dev (c) 2017 by van Hauser/THC - Please do not use in military or secret service organizations, or for illegal purposes. Hydra (http://www.thc.org/thc-hydra) starting at 2018-04-29 14:34:51 [ERROR] the variables argument needs at least the strings ^USER^, ^PASS^, ^USER64^ or ^PASS64^: F=Usuario inexistente </code></pre> <p>Could anyone write the correct string to use in hydra please? I’m a noob using hydra :)</p> <p>The username is Gonzalo Sepulveda.</p> <p>The full URL of the login is:</p> <p><a href="http://190.13.132.90:8081/" rel="nofollow noreferrer">http://190.13.132.90:8081/</a></p>
1cybersec
Stackexchange
353
921
&quot;Serious errors found HF checking the drive for /home&quot; After Moving /home to external HFSplus partition. <p>I just installed Mac OS X 10.7 "Lion" and Ubuntu 11.10 on my MacBook Pro using these instructions: <a href="http://www.tuxation.com/creating-home-partition-mac-linux.html" rel="nofollow">Creating a shared home partition between Linux and Mac OS X</a>. </p> <p>After changing the location of my home folder to the new location, it gives me the error in the title, and my username no longer appears in the login screen. Using the "Other" option with my username seems to make it try to log in, but the screen quickly flashes between blank and a shell before kicking me back to the login screen without notice.</p> <p>I'm trying to share my home folder between Mac OS X and Ubuntu, using an hfsplus partition (unjournaled) between the two. The home partition seems to mount fine as <code>/home</code>, and I am able to modify it under Ubuntu.</p> <p>Below is the line I've added to fstab:</p> <p><code>/dev/sda3 /home hfsplus defaults 0 1</code></p> <p>I should also note that I changed my account's username and home directory location to match this, though I've double checked that and everything seems in order there...</p> <p>Thank you in advance for any assistance.</p> <p>Edit: It seems that the <code>/etc/passwd</code> file didn't have my new home directory's location in it, so I changed that, and I am now able to log into my account, although I am still not listed in the login screen, and my username in the menu on the top right shows up as "[Invalid UTF-8]"...</p>
0non-cybersec
Stackexchange
434
1,601
Pycharm debugger does not stop on breakpoints. <p>I have a flask project I am trying to debug (this was working absolutely ok till few hours ago) - When I debug the project, I see the following :</p> <pre><code>Connected to pydev debugger (build 135.1057) /Users/vantani/cp/bin/python /Applications/PyCharm.app/helpers/pydev/pydevd.py --multiproc --save- signatures --client 127.0.0.1 --port 49223 --file /Users/vantani/cp/unnamed/manage.py server pydev debugger: process 484 is connecting /Users/vantani/cp/lib/python2.7/site-packages/flask_cache/__init__.py:152: UserWarning: Flask- Cache: CACHE_TYPE is set to null, caching is effectively disabled. warnings.warn("Flask-Cache: CACHE_TYPE is set to null, " * Running on http://127.0.0.1:5000/ * Restarting with reloader pydev debugger: process 498 is connecting </code></pre> <p>As I said this setup was working fine. Now, the debugger does not stop at the breakpoint and the debugger window is empty. I see that there are two processes created by PyDev and I guess that is causing this issue. I have restarted my machine and there is only one pycharm process running.</p>
0non-cybersec
Stackexchange
350
1,133
Rotating a triangle around $(x, y)$. <p>I have two coordinates $(x, y)$ lets call this point $A$. The triangle is drawn between point $B$, $C$ and $D$ which have the following values</p> <p>$B = (A_x - 5, A_y)$</p> <p>$C = (A_x + 5, A_y)$</p> <p>$D = (A_x, A_y + 25)$</p> <p>I also have a variable $R$ which stands for rotation, it will be from $0-180$ or $0-360$ whichever you prefer to work with.</p> <p>How do I rotate the triangle $\triangle BCD$ a degree of $R$ ?</p> <p>Edit:</p> <p>My current attempt to create something like this, looks like this</p> <pre><code>sinr = sin(R*3.14/180.0) cosr = cos(R*3.14/180.0) B = int((x + 5)*cosr - y*sinr), int((x + 5)*sinr + y*cosr) C = int((x - 5)*cosr - y*sinr), int((x - 5)*sinr + y*cosr) D = int(x*cosr - (y - 25)*sinr), int(x*sinr + (y - 25)*cosr) </code></pre> <p>However it leads to the following: <a href="https://gyazo.com/30899a78b4a4b7ed7c619796005cd600" rel="nofollow noreferrer">link</a></p> <p>Note: the $X$ and $ Y $ value does not change in this example</p>
0non-cybersec
Stackexchange
440
1,031
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Is it possible to compute Right Triangle&#39;s Legs starting from another Right Triangle with the same Hypotenuse?. <p>In an application of the Manhattan Distance trough the haversine formula, I was stuck in a problem that doesn't allow me to compute the right distance among two points in a space.</p> <p>Despite the scope, it could be useful to many other applications, so I'm trying to find a "good enough" solution of this tedious problem.</p> <p>Take a look at this simple picture to easily understand the problem: <a href="https://i.stack.imgur.com/VyhTS.png" rel="nofollow noreferrer">right triangles with same hypotenuse</a></p> <p>There are two right triangles, one red and one blue, which have the same hypotenuse but different legs and legs ratios. The two legs of the red triangle are known, so it is easy to compute both <strong><em>hypotenuse</em></strong> and angles <strong><em>gamma</em></strong> and <strong><em>beta</em></strong>, but what is important for me is the computation of <strong><em>c</em></strong> and <strong><em>d</em></strong> which are the legs of the blue triangle. </p> <p>There doesn't exist a same ratio among the red legs and the blue ones (such as 16:9 in TV monitors), so it is probably impossible to solve this problem, but maybe I'm wrong.</p> <p>I spent some time trying to compute <strong><em>alpha</em></strong> and now I think that this is impossible, I know that putting <strong><em>alpha</em></strong> equal to 45° I will be able to compute <strong><em>c = d</em></strong> but this is not the solution that I want, as you can see the blue legs are different each other.</p> <p>If you have any idea concerning this problem please let me know your POV, I will appreciate because I was not able to find any suggestion. THANK YOU</p>
0non-cybersec
Stackexchange
487
1,786
Alembic support for multiple Postgres schemas. <p>How can I use Alembic's <code>--autogenerate</code> to migrate <em>multiple</em> Postgres schemas that are not hard-coded in the SQL Alchemy model? (mirror question of <a href="https://stackoverflow.com/questions/9298296/sqlalchemy-support-of-postgres-schemas">SQLAlchemy support of Postgres Schemas</a>, but for Alembic).</p> <p>In particular, we use Postgres schemas to seperate different clients that share the same set of tables. Moreover, there is a schema with <em>shared</em> stuff among clients. The SQL Alchemy model has no knowledge of schemas, the schema is set at run-time using <code>session.execute("SET search_path TO client1,shared")</code>.</p> <p>The default <code>--autogenerate</code> is not helping at all, as it is detecting multiple schemas that do not exist in the model and ends up deleting the schemas and re-creating every table in the default schema.</p> <p>I would really like to use <code>--autogenerate</code> though, with the proper plumbing to set the schemas correctly. Any suggestions on if/how Alembic's API can do this?</p>
0non-cybersec
Stackexchange
317
1,114
How to Import mongodb database from development Environment to local env by using Commmand?. <p>I have lots of collections in my development server. I need to use the same data for testing scenarios. I am trying to import all the data of development environment to local by command is it possible?</p> <p>I successfully imported to a file by using below command:</p> <pre><code>mongoimport -d dbName -c collectionName dataFile.js </code></pre> <p>But how can we do same to import DB from development environment to local Env command-line?</p>
0non-cybersec
Stackexchange
140
546
C++ entangled shared pointer. <p>I have found code below in "The C++ programming language, 4th edition", chapter 17.5.1.3</p> <pre><code>struct S2 { shared_ptr&lt;int&gt; p; }; S2 x {new int{0}}; void f() { S2 y {x}; // ‘‘copy’’ x ∗y.p = 1; // change y, affects x ∗x.p = 2; // change x; affects y y.p.reset(new int{3}); // change y; affects x ∗x.p = 4; // change x; affects y } </code></pre> <p>I don't understand the last comment, indeed y.p should point to a new memory address after the reset() call, and so </p> <pre><code> ∗x.p = 4; </code></pre> <p>should let y.p unchanged, isn't it?</p> <p>Thanks</p>
0non-cybersec
Stackexchange
263
706
Cannot debug in Xcode: Debug info from this module will be unavailable in the debugger. <p>Debugging in Xcode is not possible after adding Firebase.</p> <p>You cannot execute commands with <strong>expr</strong> and there is no variable information viewable.</p> <p>Firebase was integrated without Cocoapods using these directions: <a href="https://firebase.google.com/docs/ios/setup#frameworks" rel="noreferrer">https://firebase.google.com/docs/ios/setup#frameworks</a></p> <p>Here's what Xcode displays after trying to execute a command with <strong>expr</strong>:</p> <pre><code>warning: Swift error in module Test. Debug info from this module will be unavailable in the debugger. error: in auto-import: failed to get module 'Test' from AST context: error: missing required module 'Firebase' </code></pre> <p>We're using Swift 3.</p>
0non-cybersec
Stackexchange
243
842
If I have a reference to a bound method in Python, will that alone keep the object alive?. <p>I wrote something like this today (not unlike the mpl_connect documentation:</p> <pre><code>class Foo(object): def __init__(self): print 'init Foo', self def __del__(self): print 'del Foo', self def callback(self, event=None): print 'Foo.callback', self, event from pylab import * fig = figure() plot(randn(10)) cid = fig.canvas.mpl_connect('button_press_event', Foo().callback) show() </code></pre> <p>This looks reasonable, but it doesn't work -- it's as though matplotlib loses track of the function I've given it. If instead of passing it <code>Foo().callback</code> I pass it <code>lambda e: Foo().callback(e)</code>, it works. Similarly if I say <code>x = Foo()</code> and then pass it <code>x.callback</code>, it works.</p> <p>My presumption is that the unnamed Foo instance created by <code>Foo()</code> is immediately destroyed after the <code>mpl_connect</code> line -- that matplotlib having the <code>Foo.callback</code> reference doesn't keep the <code>Foo</code> alive. Is that correct? </p> <p>In the non-toy code I encountered this in, the solution of <code>x = Foo()</code> didn't work, presumably because in that case <code>show()</code> was elsewhere so <code>x</code> had gone out of scope.</p> <p>More generally, <code>Foo().callback</code> is a <code>&lt;bound method Foo.callback of &lt;__main__.Foo object at 0x03B37890&gt;&gt;</code>. My primary surprise is that it seems like a bound method isn't actually keeping a reference to the object. Is that correct?</p>
0non-cybersec
Stackexchange
469
1,601
Build is just about ready. Looking for some feedback.. I'm giving my brother my old pc as a graduation present. I will be keeping some parts and buying him alternatives. Keeping the mobo, ssd, and the psu. Main goals here are a quiet work pc and 1440 gaming. I'll be doing work in R, Excel, and Python. I want to leave myself open to 32gb of ram in case I get into some bigger data sets. Wasn't quite sure what cooler to use. Apparently this one is easy to set up and quiet. I don't know what my power/sound tradeoff should be for case fans. I'm thinking about some be quiet! SilentWings 2 but they seem really weak. Corsair quiet edition seems like another good option. Idk about the 980ti. It gives me the performance I'm looking for, but it doesn't fit my theme. How long does it usually take for other ones to come out? [PCPartPicker part list](http://pcpartpicker.com/p/zKNTxr) / [Price breakdown by merchant](http://pcpartpicker.com/p/zKNTxr/by_merchant/) Type|Item|Price :----|:----|:---- **CPU** | [Intel Core i7-4790K 4.0GHz Quad-Core Processor](http://pcpartpicker.com/part/intel-cpu-bx80646i74790k) | $325.99 @ SuperBiiz **CPU Cooler** | [Cooler Master Nepton 240M 76.0 CFM Liquid CPU Cooler](http://pcpartpicker.com/part/cooler-master-cpu-cooler-rln24m24pkr1) | $103.99 @ Newegg **Motherboard** | [Asus MAXIMUS VII HERO ATX LGA1150 Motherboard](http://pcpartpicker.com/part/asus-motherboard-maximusviihero) | Purchased For $0.00 **Memory** | [G.Skill Ares Series 16GB (2 x 8GB) DDR3-1600 Memory](http://pcpartpicker.com/part/gskill-memory-f31600c9d16gar) | $109.99 @ Newegg **Storage** | [Silicon Power S60 120GB 2.5&quot; Solid State Drive](http://pcpartpicker.com/part/silicon-power-internal-hard-drive-sp120gbss3s60s25) | Purchased For $0.00 **Storage** | [Samsung 850 Pro Series 1TB 2.5&quot; Solid State Drive](http://pcpartpicker.com/part/samsung-internal-hard-drive-mz7ke1t0bw) | $489.08 @ Amazon **Video Card** | [Gigabyte GeForce GTX 980 Ti 6GB Video Card](http://pcpartpicker.com/part/gigabyte-video-card-gvn98td56gdb) | $649.99 @ Amazon **Case** | [NZXT H440 (Black/Red) ATX Mid Tower Case](http://pcpartpicker.com/part/nzxt-case-cah440wm1) | $108.99 @ SuperBiiz **Power Supply** | [EVGA 850W 80+ Gold Certified Fully-Modular ATX Power Supply](http://pcpartpicker.com/part/evga-power-supply-220g20850xr) | Purchased For $0.00 **Operating System** | [Microsoft Windows 8.1 OEM (64-bit)](http://pcpartpicker.com/part/microsoft-os-wn700615) | Purchased For $0.00 **Case Fan** | [Noctua NF-F12 industrialPPC-2000 PWM 71.7 CFM 120mm Fan](http://pcpartpicker.com/part/noctua-case-fan-nff12industrialppc2000pwm) | $23.07 @ Mwave **Case Fan** | [Noctua NF-F12 industrialPPC-2000 PWM 71.7 CFM 120mm Fan](http://pcpartpicker.com/part/noctua-case-fan-nff12industrialppc2000pwm) | $23.07 @ Mwave **Case Fan** | [Noctua NF-F12 industrialPPC-2000 PWM 71.7 CFM 120mm Fan](http://pcpartpicker.com/part/noctua-case-fan-nff12industrialppc2000pwm) | $23.07 @ Mwave **Case Fan** | [Noctua NF-F12 industrialPPC-2000 PWM 71.7 CFM 120mm Fan](http://pcpartpicker.com/part/noctua-case-fan-nff12industrialppc2000pwm) | $23.07 @ Mwave **Case Fan** | [Noctua NF-F12 industrialPPC-2000 PWM 71.7 CFM 120mm Fan](http://pcpartpicker.com/part/noctua-case-fan-nff12industrialppc2000pwm) | $23.07 @ Mwave **Case Fan** | [Noctua NF-F12 industrialPPC-2000 PWM 71.7 CFM 120mm Fan](http://pcpartpicker.com/part/noctua-case-fan-nff12industrialppc2000pwm) | $23.07 @ Mwave | *Prices include shipping, taxes, rebates, and discounts* | | Total (before mail-in rebates) | $1936.45 | Mail-in rebates | -$10.00 | **Total** | **$1926.45** | Generated by [PCPartPicker](http://pcpartpicker.com) 2015-06-01 00:06 EDT-0400 |
0non-cybersec
Reddit
1,362
3,730
Windows 8 fat binary (exe for x86 &amp; ARM). <p>Does anyone (here) know if Windows 8 will have a sort of fat exe that one can compile with Visual Studio 2012 that will be supported on both ARM and x86 machines? I am guessing not, since you can't create fat binaries that will execute 32 or 64 bit code so far as I am aware (only solution available that I am aware of is 32 bit that creates a 64 bit executable on the fly).</p> <p>It seems like it would be helpful of Microsoft to extend exe or create a fat binary format for Windows 8 and beyond at least that would allow one to compile a single executable for Window's expanding palette of platforms.</p> <p>edit: The following link shows how to compile an ARM exe in the first dev preview. Figured I would add that because it gives no hint of fat binary support, but it is also early in the game. I don't think not having it now rules it out as a possibility. <a href="http://www.bitcrazed.com/post/2011/09/20/Visual-Studio-11-Developer-Preview-native-ARM-Compiler.aspx" rel="nofollow">Compile for ARM</a></p>
0non-cybersec
Stackexchange
276
1,065
PLEASE let me know if I'm doing this right.. Hi! I'm trying this out for the millionth time... I plan on going through to the end with this but I really need some feedback. Please take a look at my meal plan for tomorrow (Monday) and let me know. The meatballs are a recipe I found online and it's 1 serving (no spaghetti). The detox soup is another I found online though it has more carbs than I anticipated. I made so much of it I can't just throw it out... KWIM? I am keeping my carbs below 50g at first to ease into this as I kept failing before while setting my carbs around 20-25g. I'm hoping being able to eat a little more will help keep me motivated. Let me know your thoughts! Thanks!!! [LINK](http://imgur.com/gix99sg)
0non-cybersec
Reddit
207
754
How to use Eclipse&#39;s Display View for Debug?. <p>At the link below it explains that the "display view allows you to manipulate live code in a scrapbook type fashion (see Figure 8). To manipulate a variable, simply type the name of the variable in the Display view, and you'll be greeted with a familiar content assist."</p> <p><a href="http://www.ibm.com/developerworks/library/os-ecbug/">http://www.ibm.com/developerworks/library/os-ecbug/</a></p> <p>However, I am having trouble getting it to work. I have the view open but all the buttons are disabled. I have tried putting code in the view, selecting code in the view, selecting code in other views, while running and while not running debug, but the only button that is ever enabled on the view is "clear console".</p> <p>Suggestions on what I am doing wrong?</p>
0non-cybersec
Stackexchange
225
829
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
How to extract unique permutations from pandas DataSeries?. <p>Working in Jupyter with Pandas DataSeries I have a dataset with rows like this:</p> <pre><code>color: white engineType: diesel make: Ford manufacturingYear: 2004 accidentCount: 123 </code></pre> <p>What I need to do is to plot charts of accident counts (y-axis) by manufacturing year (x-axis) for all permutations of color/engineType/make. Any ideas how to proceed with this?</p> <p>To speed things up I have this initial setup:</p> <pre><code>import numpy as np import pandas as pd from pandas import DataFrame, Series import random colors = ['white', 'black','silver'] engineTypes = ['diesel', 'petrol'] makes = ['ford', 'mazda', 'subaru'] years = range(2000,2005) rowCount = 100 def randomEl(data): rand_items = [data[random.randrange(len(data))] for item in range(rowCount)] return rand_items df = DataFrame({ 'color': Series(randomEl(colors)), 'engineType': Series(randomEl(engineTypes)), 'make': Series(randomEl(makes)), 'year': Series(randomEl(years)), 'accidents': Series([int(1000*random.random()) for i in range(rowCount)]) }) </code></pre>
0non-cybersec
Stackexchange
357
1,152
Affiliation number by default relaxed. <p>I am using authblk.sty and xkeyvalue.sty. By default the author number should be relaxed. But by default my current output is author number is one. </p> <p>My code is below mentioned:</p> <pre><code>\author{Maria Luisa Di Vona} \author{Emanuela Sgreccia} \author[aff={1,2},coraddress={Richard, Dipartimento di Scienze e Tecnologie Chimiche, Universita di Roma Tor Vergata, Via della Ricerca Scientifica 1, 00133 Roma, Italia},email={[email protected]}]{Riccardo Narducci} </code></pre> <p>My current output is:</p> <pre><code>Maria Luisa Di Vona 1 , Emanuela Sgreccia 1 , and Riccardo Narducci 1,2 </code></pre> <p>My Required output is:</p> <pre><code>Maria Luisa Di Vona, Emanuela Sgreccia, and Riccardo Narducci 1,2 </code></pre> <p>I am not give any value <code>aff={affilation number}</code> in the following author "Maria Luisa Di Vona, Emanuela Sgreccia,". If i am not give the value the affiliation number should be relxed. But current output is by default displayed one. How to relax the affiliation number by defult?. Please advice.</p> <p>MWE:</p> <pre><code>\documentclass{article} \usepackage{authblk} \usepackage{xkeyval} \usepackage{etoolbox}% \usepackage{xparse}% \usepackage{hyperref} \makeatletter \def\@maketitle{% \vbox to \textheight{\vbox to \textheight{\vspace*{12pc}%\vfill% \hbox to 10pc{\hfill% \begin{minipage}[b]{10pc} {\@correspondence\par}% \vskip 6pt% {\@presentaddress}% \end{minipage}}} \hspace*{11pc} \vbox to \textheight{\vspace*{-44pc}% \hbox to 10pc{\hfill% \begin{minipage}[b]{25pc} \let \footnote \thanks {\raggedright\fontsize{18pt}{20pt}\selectfont\@title \par}% \vskip 1.5em% {\large \begin{tabular}[t]{l}% \raggedright\@author \end{tabular}\par}% \end{minipage}}}}% \par \vskip 8.5em} \def\@correspondence{} \def\correspondence#1{% \gdef\@correspondence{\textbf{\textit{*Correspondence:}}\newline% \raggedright #1\FrontKVMacroEmail% }} \def\@presentaddress{} \def\presentaddress#1{% \gdef\@presentaddress{\textbf{\textit{$\dagger$presentaddress:}}\newline% \raggedright #1}} \define@key{authorinfo}{aff}{% \def\FrontKVMacroAff{#1}% }% \define@key{authorinfo}{coraddress}{% \def\FrontKVMacroCorAddress{#1}% }% \define@key{authorinfo}{email}{% \def\FrontKVMacroEmail{#1}% }% \define@key{authorinfo}{presentaddress}{% \def\FrontKVMacroPresentAddress{#1}% }% \define@key{authorinfo}{link}{% \def\FrontKVMacroLink{#1}% }% \let\OriginalAuthor\author \RenewDocumentCommand{\author}{+O{}+m}{% \setkeys{authorinfo}{#1}% \ifdef{\FrontKVMacroAff}{% \ifdef{\FrontKVMacroLink}{% \OriginalAuthor[\FrontKVMacroAff]{\href{\FrontKVMacroLink}{#2}}% }{% \OriginalAuthor[\FrontKVMacroAff]{#2}% }% }{% \ifdef{\FrontKVMacroLink}{% \OriginalAuthor{\href{\FrontKVMacroLink}{#2}}% }{% \OriginalAuthor{#2}% }% }% \ifdef{\FrontKVMacroCorAddress}{% \correspondence{\FrontKVMacroCorAddress}% }{% } \ifdef{\FrontKVMacroPresentAddress}{% \presentaddress{\FrontKVMacroPresentAddress}% }{% }% \undef\FrontKVMacroAff% }% End of RenewDocumentCommand. \makeatother \begin{document} \title{Hormonal crosstalk for root development} \author{Maria Luisa Di Vona} \author{Emanuela Sgreccia} \author[aff={1,2},coraddress={Richard, Dipartimento di Scienze e Tecnologie Chimiche, Universita di Roma Tor Vergata, Via della Ricerca Scientifica 1, 00133 Roma, Italia},email={[email protected]}]{Riccardo Narducci} \affil{Integrative Cell Biology Laboratory, School of Biological and Biomedical Sciences, The Bio physical Sciences Institute, Durham University, Durham, UK} \maketitle \end{document} </code></pre>
0non-cybersec
Stackexchange
1,347
3,691
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
linux debugger detection in multi-thread application using ptrace. <p>I have to implement debugger detection technique under linux. So the main idea is, my piece of code creates second thread via syscall clone. After that, created thread is supposed to check if debugger is present in while loop, sleeping for a few seconds. My question is how to implement debugger detection via ptrace in multi-thread environment inside infinite loop. My problem is that after calling ptrace(PTRACE_TRACEME, 0, 1, 0) for a second time debugger is detected (that's reasonable and correct of course). So do I have to detach tracer somehow at the end of loop or use ptrace in another way? Here is a piece of code:</p> <pre><code>new_thread: ; PTRACE xor rdi, rdi xor rsi, rsi xor rdx, rdx inc rdx xor r10, r10 mov rax, 101 ; ptrace syscall syscall cmp rax, 0 jge __nondbg call _dbg db 'debugged!', 0xa, 0 _dbg: mov rdi, 1 pop rsi mov rdx, 10 mov rax, 1 ; syscall write syscall ; exit_group call mov rdi, 127 mov rax, 231 ; exit_group syscall syscall __nondbg: call _nondbg db 'non-debugged!', 0xa, 0 _nondbg: mov rdi, 1 pop rsi mov rdx, 14 mov rax, 1 ; syscall write syscall ; ========== ; SLEEP..... ; ========== push 0 ; value should be a parameter push 5 ; value should be a parameter mov rdi, rsp xor rsi, rsi mov rax, 35 ; syscall nanosleep syscall ; syscall pop rax pop rax jmp new_thread </code></pre>
0non-cybersec
Stackexchange
443
1,392
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Grab Handles appearing randomly, causes erratic mouse behavior . <p>I did a clean install of Ubuntu 11.10 recently. Every so often, <a href="https://askubuntu.com/questions/31877/how-do-i-turn-on-unity-drag-handles">Grab Handles</a> will appear on the active window. Sometimes they simply disappear after a few seconds without causing me any problems. </p> <p>Other times, the mouse appears already grabbing the window (like when you grab the center handle) and the mouse and the window will shake erratically for a few moments. In this case, I lose control over the mouse until the grab handles fade out a few seconds later. This occurs multiple times a day, maybe once every hour or two. The oddest thing about it is that I don't have Grab Handles enabled: </p> <p><img src="https://i.stack.imgur.com/akRkz.png" alt="enter image description here"></p> <p>For reference, this is an Asus G53SW laptop with a Core i7, GeForce GTX 460M and 6 GB of RAM. Any ideas?</p>
0non-cybersec
Stackexchange
268
969
Going out with a new friend for the first time.... Can anyone help me? I just recently met this girl who's really great. We like ALL the same things, she's beautiful, and she's so kind. We've been talking over text, but she wants to meet up and get some boba and go to a park now. But I'm so horrible at meeting people for the first time. I once met this other girl for boba, and was so awkward and kept putting my hands over my face. I was wearing a sweater and it got stuck on my braces cause I kept talking with my hands over my mouth. It was so embarrassing. My interactions with everyone consist mainly of awkward laughter, them saying "what?" twenty times because I trail off at the end of my sentences, and stuttering. I really want to make good conversation with her, but it's so hard to not be awkward, even if we do like all the same things. I really want to do this right instead of failing and being shy like every other time I go out with someone. Advice would be greatly appreciated.
0non-cybersec
Reddit
228
997
Pandas rank method dense but skip a number. <p>I have a sample data set that i'm trying to rank based on the values in the column 'HP':</p> <pre><code>import pandas as pd d = { 'unit': ['UD', 'UD', 'UD' ,'UC','UC', 'UC','UA','UA','UA','UB','UB','UB'], 'N-D': [ 'C1', 'C2', 'C3','Q1', 'Q2', 'Q3','D1','D2','D3','E1','E2','E3'], 'HP': [24, 24, 24,7,7,7,7,7,7,5,5,5] } df = pd.DataFrame(d) df['rank']=df['HP'].rank(ascending=False, method='dense') df </code></pre> <p>it looks like:</p> <pre><code> HP N-D unit rank 0 24 C1 UD 1.0 1 24 C2 UD 1.0 2 24 C3 UD 1.0 3 7 Q1 UC 2.0 4 7 Q2 UC 2.0 5 7 Q3 UC 2.0 6 7 D1 UA 2.0 7 7 D2 UA 2.0 8 7 D3 UA 2.0 9 5 E1 UB 3.0 10 5 E2 UB 3.0 11 5 E3 UB 3.0 </code></pre> <p>the 'HP' is a calculated column based on other columns (i won't show it here, but it's necessary in my real dataset)</p> <p>I also tried the method='min' but the outcome looks like this:</p> <pre><code> HP N-D unit rank 0 24 C1 UD 1.0 1 24 C2 UD 1.0 2 24 C3 UD 1.0 3 7 Q1 UC 4.0 4 7 Q2 UC 4.0 5 7 Q3 UC 4.0 6 7 D1 UA 4.0 7 7 D2 UA 4.0 8 7 D3 UA 4.0 9 5 E1 UB 10.0 10 5 E2 UB 10.0 11 5 E3 UB 10.0 </code></pre> <p><strong>Units 'UC' and 'UA' tie for 2nd rank, what i'm looking for is to have the next rank which is unit 'UB' to be '4' instead of '3'. :</strong></p> <pre><code> HP N-D unit rank 0 24 C1 UD 1.0 1 24 C2 UD 1.0 2 24 C3 UD 1.0 3 7 Q1 UC 2.0 4 7 Q2 UC 2.0 5 7 Q3 UC 2.0 6 7 D1 UA 2.0 7 7 D2 UA 2.0 8 7 D3 UA 2.0 9 5 E1 UB 4.0 10 5 E2 UB 4.0 11 5 E3 UB 4.0 </code></pre>
0non-cybersec
Stackexchange
867
1,780
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
349
1,234
Who to talk to professionally for information regarding diets and workouts. Hello Reddit fitness, I have so many things saved from online searches and Reddit posts but how can I truly get a professionals advice and information on what is truly a healthy lifestyle? -what is the difference between a dietitian and a nutritionist and how important are they for finding out my caloric intake for maintenance and gaining information on how to lose fat/gain muscle and healthy bulking/cutting? How to properly track calories and figure out healthy macros. -who can I speak to about what a healthy daily diet would look like to maximize the gains I would make from my daily workout routine? (I do recommended routine every other day, and between 10-15 mile bike ride every other. I plan on adding ppl on the bike days as well for more strength gain) At this point in my life I feel like I have the workouts under control but I am beyond lost in how to make the most of this in the kitchen. Thinking of adding protien shakes just to make sure I'm getting enough protien, but how am I to know if I am or not hahaha, I just really want to find good resources for these things. Thanks and have a great time!
0non-cybersec
Reddit
267
1,204