text
stringlengths
36
35k
label
class label
2 classes
source
stringclasses
3 values
tokens_length
int64
128
4.1k
text_length
int64
36
35k
How can I use [Author Year] like new ACM Style?. <p>I'm use the TeX ACM Style in my thesis:</p> <pre><code>\bibliographystyle{acm} \bibliography{Anderson_EQM} </code></pre> <p>And cite references using <code>\cite{}</code>, but it's different of the new ACM style:</p> <p><strong>[Number]</strong> instead <strong>[Author Year]</strong></p> <p>How can I use [Author Year] like ACM Style?</p> <p>Thanks</p> <hr> <p>Obs.: In ACM examples, the cite and reference styles are:</p> <blockquote> <p>TYPICAL REFERENCES IN NEW ACM REFERENCE FORMAT</p> <p>A paginated journal article [Abril and Plant 2007], an enumerated journal article [Cohen et al. 2007], a reference to an entire issue [Cohen 1996], a monograph (whole book) [Kosiur 2001], a monograph/whole book in a series (see 2a in spec. document) [Harel 1979], a divisible-book such as an anthology or...</p> </blockquote> <p>REFERENCES</p> <blockquote> <p>Rafal Ablamowicz and Bertfried Fauser. 2007. CLIFFORD: a Maple 11 Package for Clifford Algebra Computations, version 11. (2007). Retrieved February 28, 2008 from <a href="http://math.tntech.edu/rafal/cliff11/index.html" rel="nofollow">http://math.tntech.edu/rafal/cliff11/index.html</a></p> <p>Patricia S. Abril and Robert Plant. 2007. The patent holder’s dilemma: Buy, sell, or troll? Commun. ACM 50, 1 (Jan. 2007), 36–44. DOI:<a href="http://dx.doi.org/10.1145/1188913.1188915" rel="nofollow">http://dx.doi.org/10.1145/1188913.1188915</a></p> </blockquote>
0non-cybersec
Stackexchange
542
1,497
Radeon DVI errors filling logs. <p>These error just fill my logs: </p> <pre><code>[316094.848311] [drm:radeon_dvi_detect] *ERROR* DVI-I-1: probed a monitor but no|invalid EDID [316104.895726] [drm:drm_edid_block_valid] *ERROR* EDID checksum is invalid, remainder is 128 [316104.898492] Raw EDID: [316104.901300] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316104.904245] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316104.907191] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316104.910137] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316104.912948] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316104.915620] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316104.918152] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316104.920589] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316104.951274] [drm:drm_edid_block_valid] *ERROR* EDID checksum is invalid, remainder is 128 [316104.953906] Raw EDID: [316104.956597] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316104.959421] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316104.962250] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316104.965081] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316104.967907] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316104.970590] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316104.973136] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316104.975625] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316105.006315] [drm:drm_edid_block_valid] *ERROR* EDID checksum is invalid, remainder is 128 [316105.008953] Raw EDID: [316105.011641] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316105.014475] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316105.017310] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316105.020144] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316105.022982] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316105.025683] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316105.028234] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316105.030689] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316105.061394] [drm:drm_edid_block_valid] *ERROR* EDID checksum is invalid, remainder is 128 [316105.064038] Raw EDID: [316105.066736] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316105.069589] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316105.072429] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316105.075263] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316105.078103] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316105.080804] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316105.083339] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316105.085794] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [316105.088272] radeon 0000:0c:01.0: DVI-I-1: EDID block 0 invalid. [316105.088275] [drm:radeon_dvi_detect] *ERROR* DVI-I-1: probed a monitor but no|invalid EDID </code></pre> <p>Is there aything I can do to suppress them or tell the driver to probing the monitor or disable DVI port?</p> <p>I'm running Debian 7 with only a cli as a LAMP server. THere is no GDM nor GUI nor anything like that.</p>
0non-cybersec
Stackexchange
1,220
3,362
invalid conversion from ‘const type*’ to ‘type*’. <p>I want to store through the constructor of a class a pointer to an object of another class. What is the correct way to do that?</p> <p>If I substitute <code>MyClass1* ptr</code> with <code>const MyClass1* ptr</code> there is no error, but in this case I think that i cannot change <code>ptr</code> anymore. What is the correct way to achieve what i want?</p> <p>example.cpp</p> <pre><code>class MyClass1{ public: int a; int b; }; class MyClass2{ MyClass1* ptr; public: MyClass2(const MyClass1&amp; obj){ptr = &amp;obj;}; }; int main(int argc, char* argv[]){ MyClass1 object1; object1.a = object1.b = 0; MyClass2 object2(object1); return 0; } </code></pre> <p>Compile it through <code>g++ -o example example.cpp</code> give me this error</p> <blockquote> <p>example.cpp: In constructor ‘MyClass2::MyClass2(const MyClass1&amp;)’:</p> <p>example.cpp:10:37: error: invalid conversion from ‘const MyClass1*’ to ‘MyClass1*’ [-fpermissive]</p> <p>MyClass2(const MyClass1&amp; obj){ptr = &amp;obj;};</p> </blockquote>
0non-cybersec
Stackexchange
397
1,122
Do SAS coding &quot;best practices&quot; exist?. <p>At work, we develop a lot of our applications in SAS, from start to finish. One of the problems with this approach is that SAS is a very verbose language with very few language constructs; there is limited support for variables, very limited support for basic functions, and no such thing as classes. They have a concept called "macros" which essentially text substitution; you define a macro, and on invocation, it simply drops in the content of the macro.</p> <p>My question is, is anyone familiar with "best coding practices" for use in developing SAS applications? Are there software design patterns for SAS? I've gone through Code Complete, and some of what he writes is applicable to SAS, but much of it is not, as the concepts don't exist in SAS. Can anyone give recommendations for writing maintainable, well-designed SAS code?</p>
0non-cybersec
Stackexchange
199
893
The Anakin Moxie in Darth Vader. So I’ve been on a Star Wars kick since TROS and Clone Wars. I recently rewatched the original trilogy and I just want to shout out all of Darth Vader’s one liners that make me think of Anakin and are awesome. There’s that classic line from Anakin in Revenge of the Sith where in the beginning he says “this is where the fun begins” which is cocky and funny Anakin. But rewatching the original we get awesome cocky lines from Vader like “All too easy” - Vader thinking he trapped Luke “Apology Accepted” - Killing one of the admirals “I find your lack of faith disturbing” - literally choking a commander who called the force an ancient religion “Perhaps I can find new ways to motivate them” - Vader getting the new Death Star back on schedule And then my favorite “Don’t choke on your aspirations commander” Just these lines are so Anakin I love hearing them even after his transformation. It adds so much to the Anakin/Darth Vader arc for me
0non-cybersec
Reddit
254
984
Get size of volume on Windows. <p>I'm writing a library to extract information about physical disks, partitions, and volumes on a Windows system (XP or later).</p> <p>I'm trying to get the capacity of a volume. Here are the approaches I know about and the reason each fails:</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa364937.aspx" rel="nofollow"><code>GetDiskFreeSpaceEx</code></a> -- Affected by user quota.</li> <li><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa365171.aspx" rel="nofollow"><code>IOCTL_DISK_GET_DRIVE_GEOMETRY_EX</code></a> -- Gets size of entire physical disk, even when invoked using a volume handle.</li> <li><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa365194.aspx" rel="nofollow"><code>IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS</code></a> -- Doesn't account for RAID overhead.</li> <li><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa365178.aspx" rel="nofollow"><code>IOCTL_DISK_GET_LENGTH_INFO</code></a> -- Fails with access denied. (Actually, it requires <code>GENERIC_READ</code> access, unlike all other queries, and <code>GENERIC_READ</code> requires administrator access.)</li> <li><a href="http://msdn.microsoft.com/en-us/library/aa363469.aspx" rel="nofollow"><code>IOCTL_STORAGE_READ_CAPACITY</code></a> -- Not available on XP, also shares the drawbacks of <code>IOCTL_DISK_GET_LENGTH_INFO</code> and <code>IOCTL_DISK_GET_DRIVE_GEOMETRY_EX</code></li> <li><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa364573%28v=vs.85%29.aspx" rel="nofollow"><code>FSCTL_GET_VOLUME_BITMAP</code></a> + <code>GetFreeDiskSpace</code> for cluster size -- Requires <code>GENERIC_READ</code> (admin access) and gives the size of the data area of the filesystem, not the entire volume.</li> <li><a href="http://msdn.microsoft.com/en-us/library/aa365179%28v=vs.85%29.aspx" rel="nofollow"><code>IOCTL_DISK_GET_PARTITION_INFO</code></a> -- Requires <code>GENERIC_READ</code> (admin access) and also failed on a USB-attached disk (possibly using superfloppy partitioning)</li> </ul> <p>Oddly, the number of clusters from <code>FSCTL_GET_VOLUME_BITMAP</code> and WMI's <code>CIM_LogicalDisk.Size</code> property agree, and both are 4096 bytes smaller than the value from <code>IOCTL_DISK_GET_LENGTH_INFO</code>.</p> <p>What is the correct way to get volume capacity? Since all the other queries work without administrator access, I'm looking for a least-privilege solution for this too.</p>
0non-cybersec
Stackexchange
847
2,518
Rewarded Video Ad in Admob - Mediation not Working. <p>From my Admob, I have setup the mediation for Flurry and Vungle. When I request an Ad I am always getting the error as provided in the Logcat.</p> <pre><code>Could not instantiate mediation adapter: com.google.ads.mediation.flurry.FlurryAdapter. MediationAdapter is not a MediationRewardedVideoAdAdapter: com.vungle.mediation.VungleInterstitialAdapter </code></pre> <p><a href="https://developers.google.com/android/reference/com/google/android/gms/ads/reward/RewardedVideoAd" rel="noreferrer">Code Reference</a></p> <h2>Gradle</h2> <pre><code>dependencies { compile files('libs/FlurryAnalytics-6.2.0.jar') compile files('libs/FlurryAds-6.2.0.jar') compile files('libs/flurryAndroidDFPandAdMobMediationAdapter-5.0.0.r1.jar') compile files('libs/dagger-1.2.2.jar') compile files('libs/javax.inject-1.jar') compile files('libs/nineoldandroids-2.4.0.jar') compile files('libs/vungle-publisher-adaptive-id-3.3.4.jar') compile files('libs/VungleAdapter.jar') compile 'com.android.support:multidex:1.0.0' compile 'com.google.android.gms:play-services-ads:8.3.+' compile 'com.google.android.gms:play-services-analytics:8.3.+' compile 'com.google.android.gms:play-services-appindexing:8.3.+' compile 'com.google.android.gms:play-services-appinvite:8.3.+' compile 'com.google.android.gms:play-services-games:8.3.+' compile 'com.google.android.gms:play-services-identity:8.3.+' compile 'com.google.android.gms:play-services-plus:8.3.+' compile project(':BaseGameUtils') compile project(':facebook-android-sdk-4.8.1') compile files('libs/AudienceNetwork.jar') compile files('libs/FacebookAdapter.jar') } </code></pre> <h2>Admob Setup</h2> <p>I have setup the adunit in Admob with the Adtype as Interstitial like shown below<a href="https://i.stack.imgur.com/28naF.png" rel="noreferrer"><img src="https://i.stack.imgur.com/28naF.png" alt="enter image description here"></a></p> <h2>Code</h2> <pre><code>@Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); MultiDex.install(this); } @Override protected void onPause() { super.onPause(); if(rewardedVideoAd!= null) rewardedVideoAd.pause(); socialShareType=null; } @Override protected void onResume() { super.onResume(); if(rewardedVideoAd!=null) rewardedVideoAd.resume(); // Refresh the state of the +1 button each time we receive focus. if(canShowGPlus1() &amp;&amp; plusOneButton!=null) { plusOneButton.initialize("https://developers.google.com/+", PLUS_ONE_REQUEST_CODE); // plusOneButton.initialize("https://play.google.com/store/apps/details?id=com.game.puzzle.game.ballmania.android", PLUS_ONE_REQUEST_CODE); } } @Override public void onDestroy() { if(rewardedVideoAd!=null) rewardedVideoAd.destroy(); super.onDestroy(); accessTokenTracker.stopTracking(); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); rateMe(); getActualScreenSize(); // Initialize the SDK before executing any other operations, // especially, if you're using Facebook UI elements. FacebookSdk.sdkInitialize(getApplicationContext()); callbackManager = CallbackManager.Factory.create(); shareDialog = new ShareDialog(this); LoginManager.getInstance().registerCallback(callbackManager, new FacebookCallback&lt;LoginResult&gt;() { @Override public void onSuccess(LoginResult loginResult) { // App code System.out.println("FacebookCallback : Success"); //fbShareNow(); } @Override public void onCancel() { // App code System.out.println("FacebookCallback : Cancel"); } @Override public void onError(FacebookException exception) { // App code System.out.println("FacebookCallback : Erroe"); } }); accessTokenTracker = new AccessTokenTracker() { @Override protected void onCurrentAccessTokenChanged(AccessToken oldAccessToken, AccessToken newAccessToken) { currentAccessToken=newAccessToken; } }; currentAccessToken = AccessToken.getCurrentAccessToken(); c=AndroidLauncher.this; bld = new AlertDialog.Builder(this); AndroidApplicationConfiguration config = new AndroidApplicationConfiguration(); //initialize(new MainGame(this), config); // Create the layout layout = new RelativeLayout(this); // Do the stuff that initialize() would do for you requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); AdView admobView = createAdView(); layout.addView(admobView); View gameView = initializeForView(new MainGame(this), config); layout.addView(gameView); showGPlus1(150, 150, 150, 150); setContentView(layout); if (isAppInstalledFromGooglePlay()) { iabSetup(); }else{ Arrays.fill(gemPurchased, Boolean.FALSE); } initializeGameServices(); alarmSetup(); setInterestial(); setRewardedVideo(); //getHash(); } private void setRewardedVideo() { rewardedVideoAd = MobileAds.getRewardedVideoAdInstance(this); rewardedVideoAd.setUserId("userId"); AdRequest adRequest = new AdRequest.Builder().build(); rewardedVideoAd.loadAd(AD_UNIT_ID_REWARDED_VIDEO_AD, adRequest); rewardedVideoAd.setRewardedVideoAdListener(new RewardedVideoAdListener() { @Override public void onRewardedVideoAdLoaded() { System.out.println("onRewardedVideoAdLoaded()"); if (rewardedVideoAd.isLoaded()) { rewardedVideoAd.show(); } } @Override public void onRewardedVideoAdOpened() { System.out.println("onRewardedVideoAdOpened()"); } @Override public void onRewardedVideoStarted() { System.out.println("onRewardedVideoStarted()"); } @Override public void onRewardedVideoAdClosed() { System.out.println("onRewardedVideoAdClosed()"); } @Override public void onRewarded(RewardItem rewardItem) { System.out.println("onRewarded()"); } @Override public void onRewardedVideoAdLeftApplication() { System.out.println("onRewardedVideoAdLeftApplication()"); } @Override public void onRewardedVideoAdFailedToLoad(int i) { System.out.println("onRewardedVideoAdFailedToLoad()"); } }); } </code></pre> <h2>Logcat:</h2> <pre><code>01-31 19:38:05.795 6634-6634/com.game.puzzle.game.ballmania.android I/dalvikvm﹕ Could not find method android.security.NetworkSecurityPolicy.getInstance, referenced from method com.google.android.gms.ads.internal.t.e.a 01-31 19:38:06.085 6634-6735/com.game.puzzle.game.ballmania.android D/dalvikvm﹕ DexOpt: --- BEGIN 'ads1706048048.jar' (bootstrap=0) --- 01-31 19:38:06.285 6634-6735/com.game.puzzle.game.ballmania.android D/dalvikvm﹕ DexOpt: --- END 'ads1706048048.jar' (success) --- 01-31 19:38:06.285 6634-6735/com.game.puzzle.game.ballmania.android D/dalvikvm﹕ DEX prep '/data/data/com.game.puzzle.game.ballmania.android/cache/ads1706048048.jar': unzip in 0ms, rewrite 207ms 01-31 19:38:13.165 6634-6634/com.game.puzzle.game.ballmania.android I/Ads﹕ Starting ad request. 01-31 19:38:13.175 6634-6634/com.game.puzzle.game.ballmania.android I/Ads﹕ Use AdRequest.Builder.addTestDevice("B6155B00A6A175A4D29AE13C0F0FBD7B") to get test ads on this device. 01-31 19:38:16.665 6634-7074/com.game.puzzle.game.ballmania.android W/Ads﹕ Could not instantiate mediation adapter: com.google.ads.mediation.flurry.FlurryAdapter. null 01-31 19:38:16.715 6634-7074/com.game.puzzle.game.ballmania.android W/Ads﹕ Fail to instantiate adapter com.google.ads.mediation.flurry.FlurryAdapter android.os.RemoteException at com.google.android.gms.internal.zzev.zzah(Unknown Source) at com.google.android.gms.internal.zzev.zzaf(Unknown Source) at com.google.android.gms.internal.zzew$zza.onTransact(Unknown Source) at android.os.Binder.transact(Binder.java:347) at com.google.android.gms.ads.internal.l.a.d.a(SourceFile:94) at com.google.android.gms.ads.internal.reward.c.b(SourceFile:194) at com.google.android.gms.ads.internal.reward.mediation.h.a(SourceFile:53) at com.google.android.gms.ads.internal.util.b.run(SourceFile:19) at com.google.android.gms.ads.internal.util.r.call(SourceFile:52) at com.google.android.gms.ads.internal.util.s.run(SourceFile:75) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390) at java.util.concurrent.FutureTask.run(FutureTask.java:234) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) at java.lang.Thread.run(Thread.java:841) 01-31 19:38:16.745 6634-7075/com.game.puzzle.game.ballmania.android W/Ads﹕ MediationAdapter is not a MediationRewardedVideoAdAdapter: com.vungle.mediation.VungleInterstitialAdapter 01-31 19:38:16.745 6634-7075/com.game.puzzle.game.ballmania.android W/Ads﹕ Fail to check if adapter is initialized. android.os.RemoteException at com.google.android.gms.internal.zzfd.isInitialized(Unknown Source) at com.google.android.gms.internal.zzex$zza.onTransact(Unknown Source) at android.os.Binder.transact(Binder.java:347) at com.google.android.gms.ads.internal.l.a.g.g(SourceFile:621) at com.google.android.gms.ads.internal.reward.mediation.a.a(SourceFile:83) at com.google.android.gms.ads.internal.util.b.run(SourceFile:19) at com.google.android.gms.ads.internal.util.r.call(SourceFile:52) at com.google.android.gms.ads.internal.util.s.run(SourceFile:75) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390) at java.util.concurrent.FutureTask.run(FutureTask.java:234) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) at java.lang.Thread.run(Thread.java:841) 01-31 19:38:16.745 6634-6634/com.game.puzzle.game.ballmania.android W/Ads﹕ Failed to load ad: 3 </code></pre>
0non-cybersec
Stackexchange
3,441
10,926
Server - Lightweight GUI for 20.04 - only need browser, copy files, and see terminal windows. <p>I've looked at a LOT of articles and suggestions, and tried a few options, but i'm super confused as there is a lot of conflicting and constantly changing advice.</p> <p>We are moving from windows server 2016 to Ubuntu, due to this transition we need to limit the amount of change, mainly moving from a GUI to command line. The server will need RabbitMq, and run C# dotnet core console apps (10 microservices that all use Rabbitmq to communicate)</p> <p>We need an extremely light weight gui that has a browser so we can download file/see rabbitmq management screen, and ability to have multiple terminal windows running so we can see the output of each microservice We will also need to copy and paste files for new releases</p> <p>Currently these microservices are EXE files on windows, and an app called restartOnCrash keeps them running, we need a similar scenario so we can have these console apps running and detect if they are not (and something will need to make sure they are running, not sure what options there are here)</p> <p>As we all get use to the linux environments, we will remove the GUI, but for now we need one so the transition is less risky and more familiar for everyone</p> <p>When there are system issues, we look at RabbitMQ ingestion rates, queue sizes, and each microservice console app to determine where the issue is, so we need to retain this visibility and workflow.</p> <p>Can anyone suggest a lightweight GUI that is low on system resources to do the above?</p>
0non-cybersec
Stackexchange
378
1,600
How to remove the already opened popup in jquery mobile. <p>I googled and search SO but can't find anything relates to me.</p> <p><a href="http://jsfiddle.net/aravinth/Ad22d/90/" rel="noreferrer">http://jsfiddle.net/aravinth/Ad22d/90/</a> </p> <p>In this fiddle, cloned the table rows using <strong><code>ADD ROW</code></strong> in that table row click <strong>Add Expenses</strong> shows the <code>popup</code> it is also cloned when click the <code>PLUS icon</code>...</p> <p>My problem starts here now i click the <code>first row add expense button</code>, <strong>3 rows cloned</strong> in popup then click the <code>second row add expenses</code> it shows three rows but i need to <code>show only one column</code> (that is default one)...</p> <p>Please suggest some idea...Thank You </p>
0non-cybersec
Stackexchange
247
799
Is Ubuntu Live the Right Solution for Me?. <p>I am in charge of imaging many Ubuntu machines on a weekly basis for the company that I work at. Each time I image a machine with 14.04 I have to install certificates so the machines can access our network and additionally install about 10 packages to bind the machine to our domain. </p> <p>It takes a lot of time to do this and even after scripting the process I still want to be as efficient as possible. I have been investigating the 'Ubuntu Live' procedure but have not been successful the past few weeks.</p> <p>I have been following this guide: <a href="https://help.ubuntu.com/community/LiveCDCustomizationFromScratch" rel="nofollow">https://help.ubuntu.com/community/LiveCDCustomizationFromScratch</a></p> <p><strong>- Can anyone give me any insight into the 'Ubuntu Live' process?<br> - Has anyone had to install many files/packages into certain directories for many machines?<br> - How would you go about this project?</strong></p> <p>Thanks for reading. You guys have been a great resource to me:D </p> <p><strong>Update: I found the solution that I was looking for! Remastersys allowed me to put the correct files in the correct location and then clone the entire environment to an iso and image that to any computer!! I followed this guide; <a href="http://linuxhalwa.blogspot.com/2013/01/how-to-create-ubuntu-live-cddvd-using.html" rel="nofollow">http://linuxhalwa.blogspot.com/2013/01/how-to-create-ubuntu-live-cddvd-using.html</a></strong></p>
0non-cybersec
Stackexchange
414
1,520
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
Why fingerprint scanner doesn&#39;t work after reboot on Mi phones?. <p>When I first experienced this I ignored it. But after some days I noticed that I <em>had</em> to unlock it by pattern lock or password everytime I restart the phone and <em>after</em> unlocking by pattern/password, I was able to use fingerprint.</p> <p>Why is this so? I am not sure that every Android device has the same issue. Is this a security feature? If yes, why? I mean if this is a security feature the phone must be unlocked by fingerprint, as pattern or password can be guessed after some attempts (especially patterns). </p> <p>There are some threads (see <a href="https://www.google.co.in/amp/s/forum.xda-developers.com/mi-5s/help/fingerprint-scanner-doesnt-reboot-t3551025/amp/" rel="nofollow noreferrer">this</a> and <a href="http://en.miui.com/thread-373403-1-1.html" rel="nofollow noreferrer">this</a>), but they doesn't seem to be very informative.</p>
0non-cybersec
Stackexchange
283
945
How to perform partial update with Spring data mongoDB(MongoOperations). <p>In my database I have a document that looks like this </p> <pre><code>{ "_id" : ObjectId("5864ddd8e38112fd70b89893"), "_class" : "com.apic.models.UserReg", "name" : "Bijay", "email" : "[email protected]", "psd" : "16d932a5a3da90cc6afd831016b5a6821f0badf7e2c624159205924433613c3a", "activationToken" : "fe8376ea2dbdf61ebc0f11a2361d741ba3178362d5bf876cf47e6a126bc5b39c", "verified" : false } </code></pre> <p>I also have a bean that looks like this </p> <pre><code>public class User { @Id private int id; private String name; private String email; // getter/setter methods } </code></pre> <p>So when I try to call <code>save()</code> method of <code>MongoOperations</code>, it replaces all missing properties like psd, verified and activationToken. </p> <pre><code>mongoOperations.save(user, COLLECTION); </code></pre> <p>Is there any way where I can update only the existing properties in my models class and leave others as it is?</p>
0non-cybersec
Stackexchange
395
1,059
Show that for every integer $n$, $n^3 - n$ is divisible by 3 using modular arithmetic. <p><strong>Problem</strong>:</p> <p>Show that for every integer $n$, $n^3 - n$ is divisible by 3 using modular arithmetic</p> <p>I was also given a hint: </p> <p>$$n \equiv 0 \pmod3\\n \equiv 1 \pmod3\\n \equiv 2 \pmod3$$</p> <p>But I'm still not sure how that relates to the question. </p>
0non-cybersec
Stackexchange
139
382
Passing options to template function in thor. <p>I am looking for a way to pass options to the ERB templating engine in thors template action.</p> <p>I stumbled upon the bundler cli source where thors template action is being used like this:</p> <pre><code>opts = {:name =&gt; name, :constant_name =&gt; constant_name, :constant_array =&gt; constant_array, :author_name =&gt; author_name, :author_email =&gt; author_email } template(File.join("newgem/Gemfile.tt"), File.join(target, "Gemfile"), opts) </code></pre> <p>But when I add options like this in my thor tasks they are not found by ERB, i can only use arguments and functions in my thor class to set variables in the template.</p> <p>I have no clue how binding works in ruby, maybe there is a way to pass a scope through binding to ERB. </p>
0non-cybersec
Stackexchange
253
848
Algebraic extension and integral element. <p>I'm doing the exercise of Algebraic curves by Fulton and I'm stucked in this problem</p> <p>Let $R$ be a domain with quotient field $K$, and let $L$ be a finite algebraic extension of $K$. </p> <p>(a) For any $v\in L$, show that there is a nonzero $a\in R$ such that $av$ is integral over $R.$ </p> <p>(b) Show that there is a basis $v_1,..., v_n$ for $L$ over $K$ (as a vector space) such that each $v_i$ is integral over $R$.</p> <p>If you can give me a sketch of the proof or a Hint i will be very grateful!</p> <p>Thanks !</p>
0non-cybersec
Stackexchange
206
581
Auditd in a PCI-DSS-compliant Linux cluster. <p>I'm familiar with some of the more common ways of configuring a Linux server to be compliant with <a href="https://www.pcisecuritystandards.org/documents/PCI_DSS_v3-2.pdf" rel="nofollow noreferrer">PCI-DSS 3.2</a>, at least to the requirements of <a href="https://www.pcisecuritystandards.org/documents/PCI-DSS-v3_2-SAQ-A.pdf" rel="nofollow noreferrer">SAQ A</a>. A common concern is requirement 8.5 which requires that:</p> <blockquote> <p>Generic user IDs and accounts are disabled or removed</p> </blockquote> <p>This includes the root user, which obviously cannot be disabled, so a "compensating control" (in the terminology of PCI-DSS) is needed. A <a href="https://serverfault.com/questions/470755/log-all-commands-run-by-admins-on-production-servers">common recipe</a> is some variant of the following:</p> <ul> <li>disable logins as root;</li> <li>require logins by <code>ssh</code> to use an SSH key;</li> <li>use <code>sudo</code> to get root;</li> <li>install <code>pam_loginuid</code> to record the login user ID once users have root; and</li> <li>install and configure <code>auditd</code> to record root actions and the login user ID.</li> </ul> <p>However in case I'm dealing with today, it's not a single machine I'm securing: it's a small cluster (currently with 10 machines), and it's really, really useful to be able to <code>ssh</code> (and <code>scp</code> files) between the machines. Having to do that as a non-root user would be a real pain: almost always the file you need is only readable to root and needs to be put some place only root can write to.</p> <p>What I'd like to do is allow <code>ssh</code> as root between the machines, using a SSH key present on the servers. This is <a href="https://serverfault.com/questions/189574/allow-root-login-from-one-ip-address-only">easy enough</a> in <code>/etc/ssh/sshd_config</code> with a <code>PermitRootLogin</code> command in a <code>Match Address</code> block. I'm not too concerned about the security implications of allowing someone who has compromised one machine to gain control of the whole cluster: the machines are similar enough that if they manage to compromise one, they can probably use the same process to access the rest.</p> <p>However if I do this, I loose the ability to track who is running what command, as the no login UID is no longer attached to the process when I <code>ssh</code> to another machine. A compensating control in PCI-DSS needs to "meet the intent and rigor of the original PCI DSS requirement", and the intent of requirement 8.5 is stated as being to make it possible "to trace system access and activities to an individual". Without preserving the login UID, we're no longer providing a compensating control for allowing the root user to exist.</p> <p>What I'm hoping to find is way of passing loginuid from server to server when login in as root, probably by putting it into the environment. I don't mind that this requires implicitly trusting the originating server: it already is. Can anyone suggest a means of doing this? Or failing that, another way of tracing sysadmin activity as root to a particular user, while allowing easy <code>ssh</code> and <code>scp</code> between machines? </p>
0non-cybersec
Stackexchange
921
3,275
TIFU by listening to my dick instead of the voice of reason.. TLDR: I'd planned to hook up with my FWB at her house, her parents were meant to be out, her Dad wasn't, went along with it, no one knew I was there, Dad walked in on us, mirror fell on top of me. &#x200B; So yeah, this happened a little while ago but thought I'd share this tale of woe today. So this girl and I, I'll call her Kate, had been hooking up for about a month, but had never had sex because Kate didn't want to have sex unless it was outside of a car, where all the hookups had taken place prior to this. At this point we were both still in high school and lived with our parents and it was tricky to find the time and a free house and whatnot. But then, one weekend, Kate's parents were planning on taking a trip away for a few days, leaving us plenty of time to do the deed. So she had been out that night and I picked her up and basically we were planning on going back to hers and whatnot. Everything was going swimmingly but then just as we were about to get home, her Dad calls her saying he felt ill and had just gotten back home. This was obviously a big problem. I parked down the road from her house and we discussed our options. 1: We could just abandon ship and go home. 2: We just hook up in the car instead. or 3: We wait for Kate's Dad to go to sleep or go out to the shops or something along those lines. Normally option 2 would have been our go, but we had been anticipating this for ages and we really wanted to so we decided on option 3. She left to go inside and scope the scene and let me know when I could sneak in whilst I staked it out in the car. While waiting I was texting my best mate about what was going on and his advice was a resounding "DON'T FUCKING DO IT", but what did he know hey. Well he knew better than me apparently. Shortly after our conversation ended Kate texted me saying her Dad was out to get dinner and I should take this opportunity to sneak in. Perfecto. So I snuck in and we got into bed together. Initially the plan was just to wait it out til he was certainly asleep, but we ended up saying fuck that and just went straight to it. Thing is, we had a safety net, if he was returning home we'd hear his car parking on the street, as well as, most importantly, the front light would turn on as he approached the front porch. All the lights were off in the house, we were sneaky, nothing could go wrong. What we didn't predict was the power outage that hit just after I had gotten into the house. Unbeknownst to us, our safety net was gone. And thus everything went to shit. Kate was on top of me when he burst into the house. We fucking panicked, her Dad went straight to her room, as there was an obvious commotion going on in there. As he walked in, she jumped off of me, damn near broke my dick and scrambled to get the sheets over her. Meanwhile I had no idea what to do so I just rolled off of the bed and hoped to get out of sight. Unfortunately Kate has a floor mirror that I happened to bump into. It then immediately fell on me and I tried to catch it with my legs and arms and heard the glass break. So there her Dad was, his naked daughter trying to cover herself up, and on the other side of the bed two butt naked legs and two arms desperately trying to keep a mirror from falling onto the floor and smashing to a million pieces. Needless to say, my best friend was very smug afterwards.
0non-cybersec
Reddit
824
3,436
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
As Samsung is removing the headphone jack from its devices, on line at the time, it might be time for them to fix a Bluetooth bug that has been plaguing its Galaxy series for years.... The use case is easy : have a smartwatch/band always connected to your Galaxy phone through Bluetooth and no matter how good your Bluetooth headphones are, they will most likely sound like crap. I've had it on my S8, S8+, Note 8 and Note 9 with my Moto 360 Sport, MiBand and now Huawei Watch 2 but I've read people reporting it as far as the Galaxy S6. Had it on my Plantronics Beats Pro 2, Sennheiser HD4.50 and now Sony WH-1000M3. No matter what I do (including messing around with the Bluetooth settings from the Developer Options...that get reset all the time anyway), Bluetooth quality will drop from time to time to 2003 96kbps mp3. Quality is fine when no Bluetooth devices is connected or when using another Android phone in the same use case. [You can read about it here for instance.](https://forum.xda-developers.com/galaxy-s8+/help/bluetooth-audio-bad-quality-t3622984/page4) But there are many other posts online. &#x200B; It might be Android Wear related as well but... 1. I definitely had it with only a MiBand connected and I've read reports of similar issues with Tizen products ([Gear S3](https://www.reddit.com/r/GearS3/comments/7r1303/poor_bluetooth_streaming_quality_s8_when/)) 2. With these phones now costing 1000€ and such a push from the industry to go "all Bluetooth", I'd expect this issue to be fixed by now. Especially since other manufacturers are not affected (definitely had no issue on my OP6T recently). &#x200B; Beware of this issue before purchasing a Note 10.
0non-cybersec
Reddit
451
1,691
Set half of the filters of a layer as not trainable keras/tensorflow. <p>I'm trying to train a model suggested by <a href="https://arxiv.org/ftp/arxiv/papers/1705/1705.04748.pdf" rel="nofollow noreferrer">this</a> research paper where I set half of the filters of a convolution layer to Gabor filters and the rest are random weights which are initialized by default. Normally, if I have to set a layer as not trainable, I set the <code>trainable</code> attribute as <code>False</code>. But here I have to freeze only half of the filters of a layer and I have no idea how to do so. Any help would be really appreciated. I'm using Keras with Tensorflow backend.</p>
0non-cybersec
Stackexchange
180
664
jQuery Waypoints Fire Once. <p>I am using <a href="http://imakewebthings.com/jquery-waypoints" rel="nofollow noreferrer">http://imakewebthings.com/jquery-waypoints</a> and I need to do some action when the user scrolls down to the area with the class <code>div1</code>. However, I need it only fire once and not every time the user scrolls to that location. — <strong>only once</strong></p> <pre><code>$('.div1').waypoint(function(direction) { alert(CARRY OUT MY ACTION); }); </code></pre> <p>This needs to only happen on the first scroll to that section — up or down.</p>
0non-cybersec
Stackexchange
182
580
expect_not_equal in pkg:testthat. <p>I want to test that two values are <em>not</em> equal using 'testthat'. I can test equality using something like</p> <pre><code>expect_that(x, equals(y)) </code></pre> <p>But, what if I expect them to not be equal? I could use</p> <pre><code>expect_false(x == y) </code></pre> <p>Is this the right way to do it or is there something like</p> <pre><code>expect_that(x, not_equals(y)) </code></pre>
0non-cybersec
Stackexchange
163
441
How many primitive roots does $334$ have?. <p>Clearly $334 = 2 \times 167$. So it is of the form $2p^k$ which implies primitive roots $\bmod 334$ exits but the question is how many?</p> <p>The formula $\phi(\phi(n))$ requires $n$ to be prime. If we use it for $334$ which is composite, we get $\phi(\phi(334)) = 82$.</p> <p>So can we conclude that there are $82$ primitive roots $\bmod 334$?</p>
0non-cybersec
Stackexchange
132
398
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 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
lxd with own br0 Network is Unreachable in centos conteiner. <p>When I run lxd init I choose this setting. </p> <pre><code>Would you like to create a new network bridge (yes/no)? no </code></pre> <p>because I created my own br0 in /etc/network/interfaces</p> <pre><code>source /etc/network/interfaces.d/* auto lo iface lo inet loopback auto br0 iface br0 inet static address x.x.50.2 netmask 255.255.252.0 broadcast x.x.x.255 network x.x.x.0 gateway x.x.53.254 dns-nameservers 8.8.8.8 bridge_ports eth0 bridge_stp off bridge_fd 0 bridge_maxwait 0 iface eth0 inet manual </code></pre> <p>Then I launch lxd centos and run</p> <pre><code> lxc config device add first eth0 nic nictype=bridged parent=br0 lxc config device set first eth0 ipv4.address x.x.51.2 lxc config device set first eth0 security.mac_filtering true </code></pre> <p>and change configuration in</p> <pre><code> /var/lib/lxd/containers/second/rootfs/etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 BOOTPROTO=none ONBOOT=yes HOSTNAME=LXC_NAME NM_CONTROLLED=no TYPE=Ethernet IPADDR=x.x.51.2 NETMASK=255.255.255.255 GATEWAY=x.x.53.254 DNS1=8.8.8.8 DNS2=x.x.x.x MTU= DHCP_HOSTNAME=x.x.50.2 </code></pre> <p>When I try ping 8.8.8.8 I get Connection: Network is Unreachable</p> <p>/etc/resolv.conf</p> <pre><code> nameserver 8.8.8.8 search lxd nameserver x.x.x.x </code></pre> <p>What am I doing wrong I cannot figure out, maybe I'm missing some conception?</p>
0non-cybersec
Stackexchange
605
1,500
Error in cordova When type &quot;cordova build android&quot;. <p>When i do the cordova build android in cmd, it gives an error:</p> <pre><code>C:\workspace\two&gt;cordova build android ANDROID_HOME=C:\Program Files\Android\android-sdk JAVA_HOME=C:\Program Files\Java\jdk1.8.0_77 Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configur ation failure takes precedence. java.lang.IllegalStateException: buildToolsVersion is not specified. at com.google.common.base.Preconditions.checkState(Preconditions.java:17 6) at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.jav a:599) at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:566) at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:563) at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.ja va:55) at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.ja va:47) at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:562) at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:559) at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.d ispatch(BroadcastDispatch.java:93) at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.d ispatch(BroadcastDispatch.java:82) at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(Abstract BroadcastDispatch.java:44) at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatc h.java:79) at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatc h.java:30) at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocat ionHandler.invoke(ProxyDispatchAdapter.java:93) at com.sun.proxy.$Proxy11.afterEvaluate(Unknown Source) at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfte rEvaluate(LifecycleProjectEvaluator.java:67) at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(L ifecycleProjectEvaluator.java:61) at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj ect.java:529) at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj ect.java:90) at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(Task PathProjectEvaluator.java:42) at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuil dConfigurer.java:35) at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLa uncher.java:125) at org.gradle.internal.Factories$1.create(Factories.java:22) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(Defaul tBuildOperationExecutor.java:90) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(Defaul tBuildOperationExecutor.java:52) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(Default GradleLauncher.java:122) at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGra dleLauncher.java:32) at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradl eLauncher.java:99) at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradl eLauncher.java:93) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(Defaul tBuildOperationExecutor.java:90) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(Defaul tBuildOperationExecutor.java:62) at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradle Launcher.java:93) at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLaun cher.java:82) at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildCon troller.run(InProcessBuildActionExecuter.java:94) at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(Exe cuteBuildActionRunner.java:28) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildA ctionRunner.java:35) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce ssBuildActionExecuter.java:43) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce ssBuildActionExecuter.java:28) at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(Contin uousBuildActionExecuter.java:81) at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(Contin uousBuildActionExecuter.java:46) at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBu ild.java:52) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(Build CommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed( DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute( WatchForDisconnection.java:37) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed( DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute (ResetDeprecationLogger.java:26) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed( DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon. execute(RequestStopIfSingleUsedDaemon.java:34) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed( DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(Forw ardClientInput.java:74) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(Forw ardClientInput.java:72) at org.gradle.util.Swapper.swap(Swapper.java:38) at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(For wardClientInput.java:72) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed( DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute( DaemonHealthTracker.java:47) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed( DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClien t.java:60) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(Build CommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed( DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBu ild(EstablishBuildEnvironment.java:72) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(Build CommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed( DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(Hin tGCAfterBuild.java:41) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed( DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1. run(StartBuildOrRespondWithBusy.java:50) at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(Daemon StateCoordinator.java:246) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures. onExecute(ExecutorPolicy.java:54) at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableE xecutorImpl.java:40) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor. java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor .java:617) at java.lang.Thread.run(Thread.java:745) FAILURE: Build failed with an exception. * Where: Script 'C:\workspace\two\platforms\android\CordovaLib\cordova.gradle' line: 64 * What went wrong: A problem occurred evaluating root project 'android'. &gt; No installed build tools found. Please install the Android build tools version 19.1.0 or higher. BUILD FAILED * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Total time: 3.089 secs Error: Error code 1 for command: cmd with args: /s,/c,"C:\workspace\two\platform s\android\gradlew cdvBuildDebug -b C:\workspace\two\platforms\android\build.grad le -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true" </code></pre> <p>my SDK is complete and path is correct</p> <p><a href="https://i.stack.imgur.com/xZvRm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/xZvRm.png" alt="enter image desciption here"></a></p> <p>Cordova Version <code>6.1.1</code> Cordova Platform ls for Android <code>5.1.1</code></p>
0non-cybersec
Stackexchange
2,727
8,765
Show that there exists no sequence of complex polynomials which converges uniformly to $\frac{1}{z^2}$ on the annulus $1&lt;|z|&lt;2$.. <blockquote> <p>Show that there exists no sequence of complex polynomials which converges uniformly to <span class="math-container">$\frac{1}{z^2}$</span> on the annulus <span class="math-container">$1&lt;|z|&lt;2$</span>.</p> </blockquote> <p>Suppose there exists a sequence of complex polynomials <span class="math-container">$f_n(z)=a_0^{(n)}+a_1^{(n)} z+a_2^{(n)} z^2+\cdots +a_n^{(n)}z^n$</span> which converge uniformly to <span class="math-container">$\frac{1}{z^2}$</span> where <span class="math-container">$a_n^{(n)}\neq 0$</span></p> <p>Then <span class="math-container">$\sup_{1&lt;|z|&lt;2}|f_n(z)-\frac{1}{z^2}|&lt;\epsilon $</span> <span class="math-container">$\forall \epsilon&gt;0\to (\ast)$</span>.</p> <p>Now note that at <span class="math-container">$1&lt;|z|&lt;2 ,|z|^n\to \infty$</span></p> <p>Thus <span class="math-container">$|f_n(z)|\to \infty $</span> as <span class="math-container">$n\to \infty $</span> making <span class="math-container">$f_n(z) $</span> unbounded but <span class="math-container">$\frac{1}{z^2}$</span> is bounded in <span class="math-container">$1&lt;|z|&lt;2$</span>.</p> <p>Thus <span class="math-container">$(\ast) $</span> cant hold <span class="math-container">$\forall \epsilon&gt;0$</span>.</p> <p>Thus no such sequence of polynomial exists.</p>
0non-cybersec
Stackexchange
535
1,451
Has anyone read/debunked Yessenin-Volpin–Hennix “Beware of the G&#246;del-Wette paradox”?. <p>A student recently asked me about the status of a 2001 arXiv post, <a href="http://arxiv.org/abs/math/0110094">Beware of the Gödel-Wette paradox!</a>, by Alexander Yessenin-Volpin (aka Esenin-Volpin and several other transliterations) and Catherine Christer Hennix.</p> <p>It claims to give a counter-example to Gödel’s second incompleteness theorem, which of course sets off the crackpot alarm. However, at least Yesenin-Volpin has done enough other serious and thought-provoking work (albeit more philosophy-of-maths than straight-up mathematics) that I am uncomfortable dismissing the paper without some consideration. I presume it either has an error, or works in a non-standard meta-mathematical setting, or in some other way does something weaker than it seems to claim; but it would be nice to substantiate this suspicion and find out which of these is the case.</p> <p>Has anyone read this paper carefully, and discussed/debunked it?</p>
0non-cybersec
Stackexchange
285
1,044
Expected Value: $E[aX]=aE[X]$. <p>Let $X$ be a random variable on [0,$ \infty $] and $a \in R$ .</p> <p>We can prove</p> <p>$E[aX] = \int_0^{+\infty} a*x f(x) dx = a\int_0^{+\infty} x f(x) dx = a E[X]$</p> <p>I have $Y = aX$ then $E[Y]=aE[X]$</p> <p>The expression below should give $aE[X]$ but I'm doing an error and I can't identify it. Please can someone explain me what is it.</p> <p>Here are the steps:</p> <p>$Y= aX \leftrightarrow dy= a\ dx$ </p> <p>$x=0 \rightarrow y= 0$, $x=\infty \ y=\infty$</p> <p>$E[Y]= \int_0^{+\infty} y Pr(Y=y) dy= \int_0^{+\infty} a*x*pr(aX=ax)*a*dx$</p> <p>$ = \int_0^{+\infty} a^2*x*pr(X=x)*dx = a^2* E[X]$</p>
0non-cybersec
Stackexchange
328
658
parpic problem (indentation). <p>I like to use parpic to insert in the beginning of a paragraph some photo of scientist --- mainly eps files. Unfortunately some times, it indents the whole paragraph. Is this a know bug or the result of a clash between packages? I do not believe to the second proposition since in the same text it is not systematic. </p> <p>I add an example</p> <p><a href="https://i.stack.imgur.com/5uPil.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5uPil.png" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
161
547
Help! My boyfriend's cock STINKS!!!. So I (22) have been dating this guy (24) for about 6 months now and everything is going great. He's smart, dependable, and we have a lot of common interests. Overall, he seems like the perfect guy. One problem: HIS DICK SMELLS FUCKING PUTRID! I know he washes, we've showered together and he's generally a very clean guy. He says he's been tested and I believe him, so I doubt that is the cause of the stench. It's getting to be a real problem. I used to be able to deal with it, but lately every time I give him oral I've had to stop because I feared I would vomit from the smell. Help me Reddit! What do I do about my boyfriends stinky cock???
0non-cybersec
Reddit
198
698
error in phpMyAdmin. <p>I was create Database (products) table Items with tow columns (id,name) and I added values to this columns then this errors display </p> <pre><code>Warning in .\libraries\DisplayResults.php#869 A non-numeric value encountered Backtrace .\libraries\DisplayResults.php#4933: PMA\libraries\DisplayResults-&gt;_getTableNavigation( integer 0, integer 0, boolean false, string '', ) .\libraries\DisplayResults.php#4378: PMA\libraries\DisplayResults-&gt;_getPlacedTableNavigations( integer 0, integer 0, string 'top_direction_dropdown', boolean false, string '', ) .\libraries\sql.lib.php#1685: PMA\libraries\DisplayResults-&gt;getTable( , array, array, boolean false, ) .\libraries\sql.lib.php#1976: PMA_getHtmlForSqlQueryResultsTable( , string './themes/pmahomme/img/', NULL, array, boolean true, integer 1, integer 1, NULL, , array, ) .\libraries\sql.lib.php#2199: PMA_getQueryResponseForResultsReturned( , array, string 'products', string 'items', NULL, NULL, , string './themes/pmahomme/img/', integer 1, integer 1, NULL, NULL, NULL, NULL, NULL, string 'SELECT * FROM `items`', NULL, ) .\libraries\sql.lib.php#2061: PMA_executeQueryAndGetQueryResponse( array, boolean true, string 'products', string 'items', NULL, NULL, NULL, NULL, NULL, NULL, string '', string './themes/pmahomme/img/', NULL, NULL, NULL, string 'SELECT * FROM `items`', NULL, NULL, ) .\sql.php#221: PMA_executeQueryAndSendQueryResponse( array, boolean true, string 'products', string 'items', NULL, NULL, NULL, NULL, NULL, NULL, string '', string './themes/pmahomme/img/', NULL, NULL, NULL, string 'SELECT * FROM `items`', NULL, NULL, ) </code></pre>
0non-cybersec
Stackexchange
594
1,647
Is the order of evaluation with comma operator &amp; assignment in C predictable?. <p>Recently cppcheck raised an error in some C code, that has the structure:</p> <pre><code>((void)(value_prev = value), value = new_value()) </code></pre> <p>In most cases this can be split onto 2 lines, however there are some cases this is useful to have in a single statement.</p> <p>In practice I found this works with popular compilers (GCC/Clang/MSVC), which don't give any warnings <em>(even with warning levels set to their highest)</em>.</p> <hr> <p>Example code:</p> <pre><code>#include &lt;stdio.h&gt; int get_next(int i); int main() { int i = 0, i_prev = 10; do { printf("%d\n", i); } while ((void)(i_prev = i), (i = get_next(i)) != 10); } </code></pre> <p>CppCheck 1.73 <em>(latest at time of writing)</em> gives an error with this code:</p> <pre><code>(error) Expression '(void)(i_prev=i),(i=get_next(i))!=10' depends on order of evaluation of side effects` </code></pre> <p>While the code could be changed to quiet the warning, is the order really undefined?</p>
0non-cybersec
Stackexchange
364
1,105
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
Socket.io SSL error. <p>I'm trying to secure my web-site</p> <p>Everything was ok until I've finally installed SSL certificate (from CloudFlare, not a self-signed one)</p> <p>So the problem is: when I'm opening my site via HTTP - everything works perfectly, but when I'm opening it via https - site is losing connection to the host (it's needed to work)</p> <p>In console I can see: </p> <blockquote> <p>socket.io-1.4.5.js:1 GET <a href="https://188.226.131.219:8080/socket.io/?EIO=3&amp;transport=polling&amp;t=LlI-URk" rel="nofollow noreferrer">https://188.226.131.219:8080/socket.io/?EIO=3&amp;transport=polling&amp;t=LlI-URk</a> net::ERR_CONNECTION_CLOSED</p> </blockquote> <p>If I understood correctly here is a problem with ports. Using HTTP port 80 is ok and using https port 443 has problems. Is there any way to swap ports?</p>
0non-cybersec
Stackexchange
292
844
Cannot login to goodreads.com using Tor. <p>I am using the latest version of the Tor Browser Bundle. I have created an account for <a href="http://www.goodreads.com/" rel="nofollow">Goodreades</a>. After the account creation I was automatically logged in and was able to use the site. Today I tried to login again, but the screen just refreshes and nothing happens. At first I thought I had forgotten my password, but even after a password reset I was not able to login. I suppose this is a more general issue, then related to Goodreads. What settings should I change in order to be able to login?</p>
0non-cybersec
Stackexchange
147
602
Am I solving this question correctly?. <p>How can I evaluate the following term: $$\left((\{a,b\}\cup\{b,a\})\times(\{b,a\}\cap\{a,b\})\right)\setminus \left((\{b,a\}\setminus\{a,b\})\cup(\{a,b\}\times\{b,a\})\right)$$</p> <p>You can see the notes to my approach in this picture. Am I solving it correctly? <img src="https://i.stack.imgur.com/2xAwH.jpg" alt="enter image description here"></p>
0non-cybersec
Stackexchange
145
395
Linux returns “No space left on device” while copying data to a non-full USB flash drive. <p>I'm trying to copy a file to a USB flash drive. The drive does not have a write-protect switch.</p> <p><code>df</code> gives the following:</p> <pre><code>$ df -h . Filesystem Size Used Avail Use% Mounted on /dev/sde1 1.9G 622M 1.3G 33% /media/lindenb/803C-078D </code></pre> <p><code>df -i</code> produces strange output to me (0 everywhere)</p> <pre><code>$ df -i . Filesystem Inodes IUsed IFree IUse% Mounted on /dev/sde1 0 0 0 - /media/lindenb/803C-078D </code></pre> <p>Number of files on the drive:</p> <pre><code>$ find . |wc -l 170 </code></pre> <p>But when I try to copy a file, I get this:</p> <pre><code>$ mv ~/file.txt ./ mv: cannot create regular file ‘./file.txt’: No space left on device </code></pre> <p>How can I fix this ?</p>
0non-cybersec
Stackexchange
331
888
Putting a Virtual Machine Between the Users and the Gateway. <p>Hello fellow superusers,</p> <p>I was thinking of installing Pepperspot (which is the dual stack IPv6/IPv4 version of Chillispot, which is essentially an appliance that authenticates people with a captive portal and does some accounting) on a virtual machine to act as a network access controller for a 100 Mb/s gateway. What I'm installing on this virtual appliance is really quite irrelevant. What I would like to know from you folks is what are the hardware requirements for a server to be able to pass 100 Mb/s through a virtual machine? pfSense recommends at least a Pentium 3 and a lot of RAM for 100 Mb/s connection, but how much slowdown should I expect because of virtualization? Should I not be trying this through a virtual machine? Has anyone run a large amount of bandwidth through a virtual machine before?</p> <p>I've left out my motivation for doing this for the sake of brevity, but let me know if this would help answer my question.</p> <p>P.S. I apologize if this is in the wrong Stack Exchange, I though it would be most appropriate to post here (instead of Server Fault) because it was related to hardware and did not involve any complex networking.</p>
0non-cybersec
Stackexchange
292
1,242
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 click on button element when nested inside of Div&#39;s?. <p>I have a <code>button</code> nested inside of 3 <code>div</code>'s. The innermost <code>div</code> where the <code>button</code> is nested has a higher <code>z-index</code> of all the other <code>div</code>'s. Still cannot click the <code>button</code>. What am I doing wrong?</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-css lang-css prettyprint-override"><code>* { font-family: 'Raleway', sans-serif; } #main { background: url('../image/bg2.jpg'); background-size: cover; background-position: center; height: 720px; width: 2000px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; margin-top: -50px; position: relative; z-index: -50; } #content { z-index: -25; } #content h3 { font-size: 8rem; color: #fff; } #button { z-index: 99999!important; } .submain h3 { display: inline; padding: 25px; }</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!--Main--&gt; &lt;div id="main"&gt; &lt;div id="content"&gt; &lt;h3&gt;&lt;i class="fa fa-cogs" aria-hidden="true"&gt;&lt;/i&gt;DNS&lt;sup&gt;2&lt;/sup&gt;&lt;/a&gt;&lt;/h3&gt; &lt;div id="button"&gt; &lt;button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample"&gt;Learn More&lt;/button&gt; &lt;/div&gt; &lt;div class="collapse" id="collapseExample"&gt; &lt;div class="card card-block"&gt; Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras molestie dignissim lacus id tempus. Donec malesuada efficitur ultricies. Vestibulum nec lobortis est, quis efficitur nunc. Proin finibus, massa in pharetra tempus, velit ante dictum massa, eget porttitor arcu tellus eu orci. Quisque vitae ante lacus. In tortor purus, tristique nec felis ac, accumsan malesuada risus. Nam consectetur eget lacus vel condimentum. Donec in nisl volutpat, cursus arcu ac, mattis neque. Pellentesque metus nisi, maximus eget metus sed, tincidunt euismod nisl. Quisque sed ipsum imperdiet, semper quam ac, varius leo. &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;</code></pre> </div> </div> </p>
0non-cybersec
Stackexchange
916
2,465
Challenging RTMP stream. <p>I can't figure out how to download this RTMP stream. I got all the info here extracted from Firefox:</p> <pre><code> netstreambasepath=http://streamin.to/embed-stx1jx4ysd5a-828x480.html id=vplayer file=85/1612548173_n.flv?h=3kipfvn55tuzcg3h5eksbdvhzmsxwlhpsbk7m2ab3ybz34efqrdxpbba7ozq streamer=rtmp://95.211.214.98:1935/vod?h=3kipfvn55tuzcg3h5eksbdvhzmsxwlhpsbk7m2ab3ybz34efqrdxpbba7ozq skin=http://streamin.to/player/skin.zip duration=6173 controlbar.position=over volume=0 mute=true </code></pre> <p>I'm trying to use rtmpsrv following: </p> <p><a href="https://superuser.com/questions/528818/how-can-i-download-stream-videos-with-rtmp-protocol-from-harvard-extension-mor">How can I download stream videos with rtmp protocol? From Harvard Extension, more specifically</a></p> <p>I've tried :</p> <pre><code>rtmpdump.exe -r "rtmp://95.211.214.98:1935/" -y "85/1612548173_n.flv?h=3kipfvn55tuzcg3h5eksbdvhzmsxwlhpsbk7m2ab3ybz34efqrdxpbba7ozq" RTMPDump v2.3 (c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL WARNING: You haven't specified an output file (-o filename), using stdout Connecting ... INFO: Connected... ERROR: RTMP_ReadPacket, failed to read RTMP packet header </code></pre> <p>and</p> <pre><code>rtmpdump.exe -r "rtmp://95.211.214.98:1935/vod?h=3kipfvn55tuzcg3h5eksbdvhzmsxwlhpsbk7m2ab3ybz34efqrdxpbba7ozq" RTMPDump v2.3 (c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL ERROR: You must specify a playpath (--playpath) or url (-r "rtmp://host[:port]/playpath") containing a playpath </code></pre> <p>and</p> <pre><code>rtmpdump.exe -t "rtmp://95.211.214.98:1935/vod?h=3kipfvn55tuzcg3h5eksbdvhzmsxwlhpsbk7m2ab3ybz34efqrdxpbba7ozq" RTMPDump v2.3 (c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL ERROR: You must specify a hostname (--host) or url (-r "rtmp://host[:port]/playpath") containing a hostname </code></pre> <p>What am I missing here?</p>
1cybersec
Stackexchange
836
2,007
How to solve $ \tan (m \theta) + \cos(n \theta) =0$. <p>$$ \tan (2m \theta) + \cos(2n \theta) =0 $$</p> <p>I am trying to solve this trigonometric equation of theta to get a general solution. </p> <p>I tried this question by using the substitutions $t_1= \tan(n\theta)$ and $t_2= \tan(m \theta)$.</p> <p>But i was not able to get a good answer.</p> <p>Any ideas ?</p>
0non-cybersec
Stackexchange
148
372
pvmove to smaller drive?. <p>I am running on CentOS 7, lvm, with an XFS formatted root drive. As originally set up, the server had a single large root volume that contained both the OS and the data. The data has now grown, and I would like to move it off to a separate drive. This is simple enough, but at the end of the process it will leave a fairly large root drive almost empty. As this is a VM (proxmox server), and I would like to free up the host drive space, I want to "shrink" the root drive. So far the best procedure I have come up with is the following:</p> <ol> <li>Add a new, smaller, physical drive to the drive group </li> <li>Use <code>pvmove</code> to move the extents from the old drive to the new drive </li> <li>Remove the old physical volume and discard the image</li> </ol> <p>The problem I am having is with step 2: based on my knowledge, it will fail because there are fewer physical extents available on the new volume than are used on the old volume. I could move only a portion of the extents, but how do I know which ones actually contain the data? How can I best accomplish this?</p>
0non-cybersec
Stackexchange
297
1,116
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
BTC-E API and determining volume for any time interval. <p>I've been logging data from BTC-E for a couple of months now and am writing my own charting app for personal use. I've been stumped for a while now on what the difference between "vol" and "vol_cur" is and how to determine the volume for any given interval I want (1min, 60min, 2month, etc):</p> <p><a href="https://btc-e.com/api/2/ltc_usd/ticker" rel="nofollow">https://btc-e.com/api/2/ltc_usd/ticker</a></p> <pre><code>{"ticker":{"high":11.976,"low":11.35,"avg":11.663,"vol":2147898.06418,"vol_cur":184074.26807,"last":11.35,"buy":11.35,"sell":11.32,"updated":1396883318,"server_time":1396883319}} </code></pre> <p>Subtracting the "vol" values from the end of my interval to the start sometimes yields negative numbers:</p> <pre><code>id | timestamp_open | timestamp_close | open | close | high | low | volume ----+---------------------+---------------------+----------+---------+----------+----------+-------------- 2 | 2014-02-15 18:00:00 | 2014-02-15 18:30:00 | 16.05385 | 15.9761 | 16.0675 | 15.9761 | -62044.90371 3 | 2014-02-15 18:30:00 | 2014-02-15 19:00:00 | 15.9761 | 16.049 | 16.05385 | 15.94642 | -40416.73599 4 | 2014-02-15 19:00:00 | 2014-02-15 19:30:00 | 15.94652 | 16.002 | 16.05385 | 15.935 | 32560.39743 5 | 2014-02-15 19:30:00 | 2014-02-15 20:00:00 | 16.002 | 16.05 | 16.05 | 16 | 31619.54125 6 | 2014-02-15 20:00:00 | 2014-02-15 20:30:00 | 16.03175 | 15.999 | 16.0532 | 15.9 | -10595.7155 7 | 2014-02-15 20:30:00 | 2014-02-15 21:00:00 | 15.999 | 15.997 | 15.999 | 15.94 | 61109.18234 8 | 2014-02-15 21:00:00 | 2014-02-15 21:30:00 | 15.997 | 16.132 | 16.25 | 15.997 | -33001.28287 </code></pre> <p>The price did not close down so it is not representative of volume indicative of selling; how do I properly calculate the volume for an interval?</p>
0non-cybersec
Stackexchange
735
1,901
Create dashed intersections with labels using pgfplots and tikz. <p><strong>Problem:</strong></p> <p>I have several minor issues that I can not seem to be able to solve.</p> <ol> <li>Add and position labels to x/y-axis</li> <li>Add dashed intersections</li> <li>Show x/y-axis numbers for -1 and 1</li> </ol> <p><strong>Minimal Working Example (MWE):</strong></p> <pre><code>\documentclass{article} \usepackage{pgfplots} \usepackage{tikz} \begin{document} \begin{tikzpicture} \begin{axis}[% axis on top = true, domain = -13:7, samples = 150, xmin=-13, xmax=7, ymin=-13, ymax=7, minor x tick num=4, minor y tick num=4, axis lines = middle, xtick distance = 5, xticklabel style = {font=\footnotesize}, yticklabel style = {font=\footnotesize}, xlabel = $x$, ylabel = $y$ ] \addplot[very thick, blue] {2*abs(\x-1)-3*abs(\x+2)} node[pos=-.7,left] {\footnotesize $y=|2x-1|-3|x+2|$}; \addplot[thick, red, dashed] (x,4); \end{axis} \end{tikzpicture} \end{document} </code></pre> <p><strong>Current output:</strong></p> <p><a href="https://i.stack.imgur.com/HBpfG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HBpfG.png" alt="enter image description here"></a></p> <p><strong>Desired output:</strong></p> <p><a href="https://i.stack.imgur.com/7dFtI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7dFtI.png" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
565
1,625
How to install the dynamic content compression component of IIS (both 6 and 7) non interactively?. <p>Any of the following goes as non interactive for me:</p> <ul> <li>Command line silent installation</li> <li>Script file</li> <li>Code (.NET, C, VB, whatever)</li> </ul> <p>Thanks.</p> <p><strong>EDIT</strong></p> <p>I'd like to stress, that I wish to install the module responsible for the dynamic content compression. This is different from configuring the dynamic content compression after the respective module has already been installed.</p>
0non-cybersec
Stackexchange
152
552
select only prefered dns servers on dhcp. <p>I am connecting to a number of wi-fi networks via the network-manager-applet</p> <p>For debugging purposes, I want to select my dns providers, so that no other dnd provider other than the ones selected is active.</p> <p>So I edited <code>/etc/dhcp/dhclient.conf</code>, adding the line</p> <pre><code>supersede domain-name-servers 8.8.8.8, 8.8.4.4; </code></pre> <p>And, sure enough, all ipv4 dns servers disappeared, except for those two</p> <p>Running <code>systemd-resolve --status</code>, I see</p> <pre><code>Link 3 (wlp1s0) Current Scopes: DNS LLMNR setting: yes MulticastDNS setting: no DNSSEC setting: no DNSSEC supported: no DNS Servers: 8.8.8.8 8.8.4.4 2804:14c:11:672:201:6:2:20 2804:14c:10:672:201:6:2:193 </code></pre> <p>However, two things still worry me. The DNS Servers still include some v6 addresses that I have not been able to purge or replace, and <code>systemd-resolve --status</code> has a heading called DNSSEC NTA, with a lot of address-looking entries that I dont know the meaning of</p> <pre><code> DNSSEC NTA: 10.in-addr.arpa 16.172.in-addr.arpa 168.192.in-addr.arpa 17.172.in-addr.arpa 18.172.in-addr.arpa 19.172.in-addr.arpa 20.172.in-addr.arpa 21.172.in-addr.arpa 22.172.in-addr.arpa 23.172.in-addr.arpa 24.172.in-addr.arpa 25.172.in-addr.arpa 26.172.in-addr.arpa 27.172.in-addr.arpa 28.172.in-addr.arpa 29.172.in-addr.arpa 30.172.in-addr.arpa 31.172.in-addr.arpa corp d.f.ip6.arpa home </code></pre> <p>My question: how do I make sure that the OS (and firefox, if there is any difference there) uses only the dns servers I specify?</p> <p>OBS: I dont need a method that actually changes configurations. A temporary change that does not get undone by the OS for 10 minutes or so would do just as well. </p> <p>Also, I am not sure I am looking in the right place. Is my interpretation of the output of <code>systemd-resolve --status</code> correct?</p>
0non-cybersec
Stackexchange
763
2,403
Do load balancers flood?. <p>I am reading about load balancing.</p> <p>I understand the idea that load balancers transfer the load among several slave servers of any given app. However very few literature that I can find talks about what happens when the load balancers themselves start struggling with the huge amount of requests, to the point that the "simple" task of load balancing (distribute requests among slaves) becomes an impossible undertaking.</p> <p>Take for example this picture where you see 3 Load Balancers (LB) and some slave servers.</p> <p><a href="https://i.stack.imgur.com/DyLBE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/DyLBE.png" alt="enter image description here"></a> <strong>Figure 1:</strong> Clients know one IP to which they connect, one load balancer is behind that IP and will have to handle all those requests, thus that first load balancer is the bottleneck (and the internet connection).</p> <p>What happens when the first load balancer starts struggling? If I add a new load balancer to side with the first one, I must add even another one so that the clients only need to know one IP. So the dilema continues: I still have only one load balancer receiving all my requests...!</p> <p><a href="https://i.imgur.com/yHBbJM3.png" rel="noreferrer"><img src="https://i.imgur.com/yHBbJM3.png" alt="enter image description here"></a> <strong>Figure 2:</strong> I added one load balancer, but for having clients to know just one IP I had to add another one to centralize the incoming connections, thus ending up with the same bottleneck.</p> <p>Moreover, my internet connection will also reach its limit of clients it can handle so I probably will want to have my load balancers in remote places to avoid flooding my internet connection. However if I distribute my load balancers, and want to keep my clients knowing just one single IP they have to connect, I still need to have one central load balancer behind that IP carrying all the traffic once again...</p> <p>How do real world companies like Google and Facebook handle these issues? Can this be done without giving the clients multiple IPs and expect them to choose one at random avoiding every client to connect to the same load balancer, thus flooding us?</p>
0non-cybersec
Stackexchange
564
2,269
Inject Serilog&#39;s ILogger interface in ASP .NET Core Web API Controller. <p>All the examples I can find about using Serilog in an ASP .NET Core Web Application use Microsoft's <code>ILogger&lt;T&gt;</code> interface instead of using Serilog's <code>ILogger</code> interface.</p> <p>How do I make it so that Serilog's ILogger can be injected via constructor, instead?</p> <pre><code>using Serilog; public class HomeController : Controller { ILogger logger; public HomeController(ILogger logger) { this.logger = logger; } public IActionResult Index() { this.logger.Information("Index was called"); return View(); } } </code></pre>
0non-cybersec
Stackexchange
209
689
Getting write permission for /snap. <p>How can I get the write permission for the files residing under <code>/snap</code> directory which is created by snap v.2.44?<br /> I cannot do that even with root access and also there isn't any group named <code>snap</code> in <code>/etc/group</code> to enable me to add my user to it to gain any special privilege.<br /> Also when I want to <code>chmod</code> the files I get this error :</p> <pre><code>Read-only filesystem </code></pre>
0non-cybersec
Stackexchange
139
482
Can someone walk me through the simplest way of installing WorldEdit?. I don't really play MC often, but every now and then I get the urge to login and build something. It's been a long time since I used WorldEdit but it's incredibly useful. Now when I've tried to go back to it wants me to install some mod manager which I don't need (Forge), which I did try to do, except it doesn't work (the console flashes up with some sort of error before vanishing). Dropping the WorldEdit .jar into the mods folder doesn't work either. What's the best way to get WorldEdit installed? Preferably with minimal extraneous I don't need.
0non-cybersec
Reddit
149
627
Pre-commit hook for Git when Hudson build has failed. <p>I'm trying to figure out how to write a pre-commit hook for <code>Git</code> that checks the status of my <code>Hudson</code> build. If the previous build failed, it should disallow anyone from committing without first writing a specific line, e.g. "fixed build."</p> <p><strong>EDIT:</strong></p> <p>The first answerer has provided one side of the coin: the Hudson API.</p> <p>I now need the other side. <strong>How do I write the pre-commit hook in <code>Git</code>?</strong></p>
0non-cybersec
Stackexchange
162
542
How to preserve lenghts to use with \includegraphics scaling, when calculating them with pgf. <p>This question is related to my earlier question here: <a href="https://tex.stackexchange.com/questions/122299/how-to-define-a-macro-that-uses-image-width-and-height-to-define-a-variable-for">How to define a macro that uses image width and height to define a variable for later use</a> . There you can find a full MWE of the problematic code. Which I skip here for sake of brevity. </p> <p>I use a mixture of <code>\newlength</code>, <code>\setlength</code> and <code>\pgfmathsetmacro</code> to calculate the optimal height for two figures I want to plot. The code works fine and the resulting images are displayed correclty. <strong>However</strong>, I get the error message:</p> <pre><code>ERROR: Illegal unit of measure (pt inserted). </code></pre> <p>when using the calculated height (here <code>\finalheight</code>) for: </p> <pre><code>\includegraphics[height=\finalheight] . </code></pre> <p>My guess is that using e.g.</p> <pre><code>\pgfmathsetmacro{\finalheight}{\effwidth/\sumratio} , </code></pre> <p>I change a length that has a physical unit, to a mere number. Is that right? However I had a problem using <code>\setlength</code> to calculate ratios, which is why I started to use <code>\pgfmathsetmacro</code> in the first place. Does someone know a clean way to perform the calculation below such that the results <code>\finalheight</code> has a unit?</p> <pre><code>\newlength\firstheight% \newlength\firstwidth% \newlength\secondheight% \newlength\secondwidth% \def\firstim{\includegraphics{pathToImage}}% \def\secondim{\includegraphics{pathToImage}}% \setlength{\firstheight}{\heightof{\firstim}}% \setlength{\firstwidth}{\widthof{\firstim}}% \pgfmathsetmacro{\firstratio}{\firstwidth/\firstheight}% \setlength{\secondheight}{\heightof{\secondim}}% \setlength{\secondwidth}{\widthof{\secondim}}% \pgfmathsetmacro{\secondratio}{\secondwidth/\secondheight}% \pgfmathsetmacro{\gapspace}{0.5cm}% \pgfmathsetmacro{\effwidth}{\textwidth-\gapspace}% \pgfmathsetmacro{\sumratio}{\firstratio+\secondratio}% \pgfmathsetmacro{\finalheight}{\effwidth/\sumratio}% </code></pre>
0non-cybersec
Stackexchange
672
2,193
Status bar turns white and does not show content behind it. <p>I am trying out AppCompat on Marshmallow. And I want to have a transparent status bar however it turns white. I've tried a couple solutions but they didn't work for me (<a href="https://stackoverflow.com/questions/28289477/transparent-status-bar-not-working-with-windowtranslucentnavigation-false">Transparent status bar not working with windowTranslucentNavigation=&quot;false&quot;</a>, <a href="https://stackoverflow.com/questions/27856603/lollipop-draw-behind-statusbar-with-its-color-set-to-transparent">Lollipop : draw behind statusBar with its color set to transparent</a>). Here's related code.</p> <p>My styles.xml </p> <pre><code>&lt;style name="Bacon" parent="Theme.Bacon"/&gt; &lt;style name="Theme.Bacon" parent="Theme.AppCompat.Light.NoActionBar"&gt; &lt;item name="colorPrimary"&gt;@color/theme_primary&lt;/item&gt; &lt;item name="colorPrimaryDark"&gt;@color/theme_primary_dark&lt;/item&gt; &lt;item name="colorAccent"&gt;@color/theme_accent&lt;/item&gt; &lt;item name="windowActionBar"&gt;false&lt;/item&gt; &lt;item name="windowActionBarOverlay"&gt;true&lt;/item&gt; &lt;item name="windowNoTitle"&gt;true&lt;/item&gt; &lt;item name="android:windowBackground"&gt;@color/background_material_light&lt;/item&gt; &lt;/style&gt; &lt;style name="Theme.Bacon.Detail" parent="Bacon"/&gt; </code></pre> <p>v21</p> <pre><code>&lt;style name="Bacon" parent="Theme.Bacon"&gt; &lt;item name="android:windowDrawsSystemBarBackgrounds"&gt;true&lt;/item&gt; &lt;/style&gt; &lt;style name="Theme.Bacon.Detail" parent="Bacon"&gt; &lt;item name="android:statusBarColor"&gt;@android:color/transparent&lt;/item&gt; &lt;/style&gt; </code></pre> <p>Activity</p> <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"&gt; &lt;android.support.v4.view.ViewPager android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" /&gt; &lt;/FrameLayout&gt; </code></pre> <p>Fragment</p> <pre><code>&lt;android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"&gt; &lt;android.support.design.widget.AppBarLayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="192dp" android:fitsSystemWindows="true" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"&gt; &lt;android.support.design.widget.CollapsingToolbarLayout android:id="@+id/collapsing_toolbar" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" app:contentScrim="?attr/colorPrimary" app:expandedTitleMarginBottom="32dp" app:expandedTitleMarginEnd="64dp" app:expandedTitleMarginStart="48dp" app:layout_scrollFlags="scroll|exitUntilCollapsed" app:statusBarScrim="@color/black_trans80"&gt; &lt;ImageView android:id="@+id/photo" android:layout_width="match_parent" android:layout_height="match_parent" android:contentDescription="@string/photo" android:fitsSystemWindows="true" android:scaleType="centerCrop" app:layout_collapseMode="parallax" /&gt; &lt;android.support.v7.widget.Toolbar android:id="@+id/anim_toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" app:layout_collapseMode="pin" app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /&gt; &lt;/android.support.design.widget.CollapsingToolbarLayout&gt; &lt;/android.support.design.widget.AppBarLayout&gt; </code></pre> <p><a href="https://i.stack.imgur.com/U6OEI.png" rel="noreferrer"><img src="https://i.stack.imgur.com/U6OEI.png" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
1,394
4,227
set or peg bivariate distribution values using matplotlib. <p>I've <code>animated</code> a <code>bivariate</code> <code>gaussian</code> <code>distribution</code> using <code>matplotlib</code>. I've calculated this <code>distribution</code> by adjusting the <code>COV</code> <code>matrix</code> to account for specific variables. I can provide greater detail on this process but essentially each <code>scatter</code> point covers a specific displacement that is easily identifiable. My question or problem I'm having is trying to set/fix/peg areas that isn't covered by <code>the distribution</code>. You can see the values oscillating around by the variation in colour. </p> <p>Question: Is it possible to set or peg these <em>neutral</em> areas to a specific value and therefore colour. Specifically, the <code>coordinates</code> that aren't covered by <code>xy</code> values should not change <code>contour</code> values. They should be fixed as <code>0.5</code>. </p> <pre><code>import numpy as np import pandas as pd import matplotlib.pyplot as plt import scipy.stats as sts from matplotlib.animation import FuncAnimation DATA_LIMITS = [-100, 100] def datalimits(*data): return DATA_LIMITS # dmin - spad, dmax + spad def rot(theta): theta = np.deg2rad(theta) return np.array([ [np.cos(theta), -np.sin(theta)], [np.sin(theta), np.cos(theta)] ]) def getcov(radius=1, scale=1, theta=0): cov = np.array([ [radius*(scale + 1), 0], [0, radius/(scale + 1)] ]) r = rot(theta) return r @ cov @ r.T def mvpdf(x, y, xlim, ylim, radius=1, velocity=0, scale=0, theta=0): X,Y = np.meshgrid(np.linspace(*xlim), np.linspace(*ylim)) XY = np.stack([X, Y], 2) x,y = rot(theta) @ (velocity/2, 0) + (x, y) cov = getcov(radius=radius, scale=scale, theta=theta) PDF = sts.multivariate_normal([x, y], cov).pdf(XY) return X, Y, PDF def mvpdfs(xs, ys, xlim, ylim, radius=None, velocity=None, scale=None, theta=None): PDFs = [] for i,(x,y) in enumerate(zip(xs,ys)): kwargs = { 'xlim': xlim, 'ylim': ylim } X, Y, PDF = mvpdf(x, y,**kwargs) PDFs.append(PDF) return X, Y, np.sum(PDFs, axis=0) fig, ax = plt.subplots(figsize = (10,4)) ax.set_xlim(DATA_LIMITS) ax.set_ylim(DATA_LIMITS) line_a, = ax.plot([], [], '.', c='red', alpha = 0.5, markersize=5, animated=True) line_b, = ax.plot([], [], '.', c='blue', alpha = 0.5, markersize=5, animated=True) cfs = None def plotmvs(tdf, xlim=None, ylim=None, fig=fig, ax=ax): global cfs if cfs: for tp in cfs.collections: tp.remove() df = tdf[1] if xlim is None: xlim = datalimits(df['X']) if ylim is None: ylim = datalimits(df['Y']) PDFs = [] for (group, gdf), group_line in zip(df.groupby('group'), (line_a, line_b)): # Update the scatter line data group_line.set_data(*gdf[['X','Y']].values.T) kwargs = { 'xlim': xlim, 'ylim': ylim } X, Y, PDF = mvpdfs(gdf['X'].values, gdf['Y'].values, **kwargs) PDFs.append(PDF) PDF = PDFs[0] - PDFs[1] normPDF = PDF - PDF.min() normPDF = normPDF / normPDF.max() cfs = ax.contourf(X, Y, normPDF, levels=10, cmap='viridis', alpha = 0.8) return cfs.collections + [line_a, line_b] n = 10 time = range(n) d = ({ 'A1_Y' : [10,20,15,20,25,40,50,60,61,65], 'A1_X' : [15,10,15,20,25,25,30,40,60,61], 'A2_Y' : [10,13,17,10,20,24,29,30,33,40], 'A2_X' : [10,13,15,17,18,19,20,21,26,30], 'A3_Y' : [11,12,15,17,19,20,22,25,27,30], 'A3_X' : [15,18,20,21,22,28,30,32,35,40], 'A4_Y' : [15,20,15,20,25,40,50,60,61,65], 'A4_X' : [16,20,15,30,45,30,40,10,11,15], 'B1_Y' : [18,10,11,13,18,10,30,40,31,45], 'B1_X' : [17,20,15,10,25,20,10,12,14,25], 'B2_Y' : [13,10,14,20,21,12,30,20,11,35], 'B2_X' : [12,20,16,22,15,20,10,20,16,15], 'B3_Y' : [15,20,15,20,25,10,20,10,15,25], 'B3_X' : [18,15,13,20,21,10,20,10,11,15], 'B4_Y' : [19,12,15,18,14,19,13,12,11,18], 'B4_X' : [20,10,12,18,17,15,13,14,19,13], }) tuples = [((t, k.split('_')[0][0], int(k.split('_')[0][1:]), k.split('_')[1]), v[i]) for k,v in d.items() for i,t in enumerate(time)] df = pd.Series(dict(tuples)).unstack(-1) df.index.names = ['time', 'group', 'id'] interval_ms = 200 delay_ms = 1000 ani = FuncAnimation(fig, plotmvs, frames=df.groupby('time'), blit=True, interval=interval_ms, repeat_delay=delay_ms) plt.show() </code></pre>
0non-cybersec
Stackexchange
1,869
4,567
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
Finding the third vertex of a right isosceles triangle. <p>Okay so, here is what I was stuck on:</p> <p>Two vertices of isosceles right triangle ABC are located at A(2,2) and B(5,2), where segment AB is a leg of the triangle.<br> Find the coordinates of C.<br> Find the coordinates of a different C.<br> How many different locations are there for C.</p> <p>I've tried everything, but I just don't know how to go about this. . . </p> <p>Could someone please point me in the right direction???</p>
0non-cybersec
Stackexchange
150
499
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
SK Telecom T1 vs. Invictus Gaming / Rift Rivals 2019 - LCK-LPL-LMS-VCS Group Stage / Post-Match Discussion. ###RIFT RIVALS 2019 LCK-LPL-LMS [Official page](https://lolesports.com/en_US/rift-rivals) | [Leaguepedia](https://lol.gamepedia.com/Rift_Rivals_2019/LCK-LPL-LMS) | [Liquipedia](https://liquipedia.net/leagueoflegends/Rift_Rivals/LCK-LPL-LMS/2019) | [Eventvods.com](https://eventvods.com/featured/lol?utm_source=reddit&utm_medium=subreddit&utm_campaign=post_match_threads) | [New to LoL](http://lol.gamepedia.com/New_To_League/Welcome) --- ###SK Telecom T1 0-1 Invictus Gaming **SKT** | [Leaguepedia](https://lol.gamepedia.com/SK_Telecom_T1) | [Liquipedia](http://liquipedia.net/leagueoflegends/SK_Telecom_T1) | [Website](http://www.sksports.net/T1/main.asp) | [Twitter](http://twitter.com/#!/sktelecom_t1) | [Facebook](https://www.facebook.com/SKsports.T1/) | [YouTube](https://www.youtube.com/user/SKTTeam1st) **IG** | [Leaguepedia](https://lol.gamepedia.com/Invictus_Gaming) | [Liquipedia](http://liquipedia.net/leagueoflegends/Invictus_Gaming) | [Website](http://www.igaming.com.cn/index.php) | [Twitter](http://twitter.com/#!/invgaming) | [Facebook](https://www.facebook.com/InvictusGaming.Official) | [Subreddit](http://reddit.com/r/InvictusGaming) --- ###MATCH 1: SKT vs. IG [**Winner: Invictus Gaming** in 42m](https://i.imgur.com/ow7ia9z.jpg) [Game Breakdown](https://i.imgur.com/vFQvn3W.jpg) ||Bans 1|Bans 2|[G](#mt-gold)|[K](#mt-kills)|[T](#mt-towers)|D/B| |:--|:--:|:--:|:--:|:--:|:--:|:--:| |**SKT**|[irelia](#c-irelia) [xayah](#c-xayah) [yuumi](#c-yuumi)|[leblanc](#c-leblanc) [reksai](#c-reksai)|72.5k|12|6|[M](#mt-mountain)^1 [H](#mt-herald)^2 [O](#mt-ocean)^3 [C](#mt-cloud)^4 [M](#mt-mountain)^7 [E](#mt-elder)^8 | |**IG**|[karma](#c-karma) [tahmkench](#c-tahmkench) [sejuani](#c-sejuani)|[jayce](#c-jayce) [aatrox](#c-aatrox)|83.7k|19|11|[O](#mt-ocean)^5 [B](#mt-barons)^6 [B](#mt-barons)^9 [E](#mt-elder)^10 | |**SKT**|12-19-22|[vs](#mt-kills)|19-12-36|**IG**| |--:|--:|:--:|:--|:--| |Khan [camille](#c-camille) ^3|0-6-6|TOP|3-4-4|^1 [neeko](#c-neeko) TheShy| |Clid [lee sin](#c-leesin) ^3|3-3-5|JNG|3-3-4|^3 [sylas](#c-sylas) Ning| |Faker [azir](#c-azir) ^2|7-3-3|MID|7-2-8|^4 [taliyah](#c-taliyah) Rookie| |Teddy [kalista](#c-kalista) ^2|1-2-3|BOT|6-1-7|^2 [kaisa](#c-kaisa) JackeyLove| |Mata [nautilus](#c-nautilus) ^1|1-5-5|SUP|0-2-13|^1 [lux](#c-lux) Baolan| --- We're recruiting! If you're interested in making Post-Match Threads, please [click here to apply](https://docs.google.com/forms/d/e/1FAIpQLSdhGkc_x4zt7984I3gcXeKqPbyqWexT75IfdT5Qv9jbLezxtg/viewform?usp=sf_link). [This thread was created by the Post-Match Team](https://postmatch.team).
0non-cybersec
Reddit
1,264
2,825
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
Show that the following operator is not a surjection.. <blockquote> <p><em>"Take $X=C([0,1])$ with the uniform norm, $\|f\|=\sup_{x\in[0,1]}|f(x)|$, and define the operator $T:X\to X$ by, $$T(f)(x)=f(x)-\int_0^1f(s)ds$$ Show that $T$ is not a surjection"</em>.</p> </blockquote> <p>Here is what I have done:</p> <p>Saying that $T$ is <strong>not</strong> a surjection means that $\exists\, g\in X:\nexists f\in X:Tf=g$</p> <p>So we consider,</p> <p>$$T(f)(x)=f(x)-\int_0^1f(s)ds=g(x)$$</p> <p>$$\implies\int_0^1f(x)dx-\int_0^1\int_0^1f(s)ds\,dx=\int_0^1g(x)dx$$</p> <p>$$\implies0=\int_0^1g(x)dx$$</p> <p>In the solutions I have, it says that two functions are equal if we obtain the same value after evaluating their integrals over the interval. Is this enough to show that $T$ is not a surjection? I am not entirely convinced.</p> <p>Clearly the only $g\in X$ for which this holds is $g=0$, the zero function in $X$. But since $g\in X$ was arbitrary, and not every $g\in C([0,1])$ satisfies $\int_0^1g(x)dx=0$, $T$ is not a surjection?</p> <p>Is my thinking here correct?</p>
0non-cybersec
Stackexchange
458
1,093
Return list of all values that match criteria. <p>I am trying to help my boss set up an Excel sheet but I am not too familiar. </p> <p>I am looking to list all values of a cell that match a criteria.</p> <pre><code>Sheet 1 A B 1 Adam 4 2 Dave 4 3 Steve 3 4 Ryan 4 </code></pre> <p>What I want is to return a list of all names with values in column B that equal 4.</p> <p>So the result would look like this:</p> <pre><code> A B 1 RESULTS Adam Dave Ryan </code></pre> <p>Any help would be greatly appreciated, thank you.</p>
0non-cybersec
Stackexchange
190
580
Redefine smart key mappings in vim&#39;s Latex-suite plugin. <p>When using the Latex-suite plugin in vim, typing <code>...</code> expands to either <code>\ldots</code> or <code>\cdots</code> (see section <a href="http://vim-latex.sourceforge.net/documentation/latex-suite.html#smart-keys" rel="nofollow">3.9 Smart Key Mappings</a> of the latex-suite manual). I am using a lot the <em>amsmath</em> package that provides <code>\dots</code>, and I'd like to make <code>...</code> expand to just <code>\dots</code>.</p> <p>I tried putting</p> <pre><code>:call IMAP('...', '\dots','tex') </code></pre> <p>in <code>$VIM/after/ftplugin/tex_macros.vim</code> but it does nothing.</p> <p>How can I make <code>...</code> expand to <code>\dots</code>?</p> <p>Moreover, is there any way to do the above <em>only</em> if the <em>amsmath</em> package is detected? </p>
0non-cybersec
Stackexchange
304
861
Vectors in align environment with additional split. <p>I want to do the following: Some vectors (using <code>pmatrix</code>) aligned in an <code>align</code> environment but with a single equation number (using <code>split</code>):</p> <pre><code>\documentclass[11pt]{article} \usepackage{amsmath} \begin{document} \begin{align} \begin{split} {\bf a} &amp;= \begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix} \, , &amp;{\bf b} &amp;= \begin{pmatrix} -\tfrac{\sqrt{2}}{3} \\ -\sqrt{\tfrac{2}{3}} \\ \tfrac{1}{3} \end{pmatrix} \, , \\ {\bf c} &amp;= \begin{pmatrix} -\tfrac{2\sqrt{2}}{3} \\ 0 \\ -\tfrac{1}{3} \end{pmatrix} \, , &amp;{\bf d} &amp;= \begin{pmatrix} -\tfrac{\sqrt{2}}{3} \\ \sqrt{\tfrac{2}{3}} \\ \tfrac{1}{3} \end{pmatrix} \, . \end{split} \end{align} \end{document} </code></pre> <p>I get error message like Extra alignment tab has been changed to \cr. }$\hfill \endtemplate. Using <code>eqnarray</code> it works. Why is that and is it possible to use align instead?</p>
0non-cybersec
Stackexchange
374
987
Determine values of coefficients of a linear homogeneous second-order ODE. <blockquote> <p>Let $y''+ay'+by=0$.</p> <p>1) Find values of $a,b$ such that all the solutions are bounded on $\mathbb{R}$.</p> <p>2) Find values of $a,b$ such that there exists a solution which is not bounded, and which attains the value $0$ infinite number of times (that is - there are infinitely many points $x_0$ such that $y(x_0)=0$).</p> <p>3) Find a necessary and a sufficient condition on $a,b$ values so that one of the basis vectors of the solution vector space will have the property $$\lim_{x\to\infty}\left(y(x)\exp\left({\frac{ax}{2}}\right ) \right )=0$$ while the second basis vector will have the property $$\lim_{x\to-\infty}\left(y(x)\exp\left({\frac{ax}{2}}\right ) \right )=0$$</p> </blockquote> <p>My attempt:</p> <p>1) None, because the solutions are always proportional to $e^{\lambda x}$ which is not bounded.</p> <p>2) All the values of $a,b$ for which the roots of the equation $\lambda^2+a\lambda+b=0$ are complex ($a^2-4b&lt;0$). In this case the solution has the form $e^{\alpha x}\cos(\beta x)$ which has infinitely many intersections with the $x$-axis. Also, these solutions are not bounded due to the $e^{\alpha x}$ factor.</p> <p>3) Can't really find. Any suggestions?</p>
0non-cybersec
Stackexchange
439
1,322
Debian installation USB boots to GRUBv2 rather than GUI. <p>I have downloaded the Debian 8 AMD x64 iso and have attempted to make a bootable USB using Rufus on my PC and I have also tried this using UNetbootin on Ubuntu.</p> <p>I was expecting a graphical user interface to install the OS as I had on my virtual machine but instead I get a command line interface labelled GRUBv2.</p> <p>The laptop BIOS will boot to USB and has done before for the Ubuntu install so unsure how to get Debian to install via GUI.</p> <p>How to fix?</p>
0non-cybersec
Stackexchange
147
537
Property &#39;virtual&#39; does not exist on type &#39;typeof Schema&#39;. <p>I am trying to change_id from mongoose schema to 'id' like is shown here <a href="https://stackoverflow.com/questions/7034848/mongodb-output-id-instead-of-id?utm_medium=organic&amp;utm_source=google_rich_qa&amp;utm_campaign=google_rich_qa">MongoDB: output &#39;id&#39; instead of &#39;_id&#39;</a></p> <p>Duplicate the ID field.</p> <pre><code>Schema.virtual('id').get(function(){ return this._id.toHexString(); }); // Ensure virtual fields are serialised. Schema.set('toJSON', { virtuals: true }); </code></pre> <p>I am using typescript and Schema does not seem to have a 'virtual' method nor a 'set' method, and keyword 'this' is not bound in this context either. Who knows their typescript equivalents?</p>
0non-cybersec
Stackexchange
265
800
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
Output random number between 30-35 using Random.seed(), &#39;for&#39; and multiplication in Python. <p>I am new to programming. I had an assignment to write a code that will output a random number between 30 and 35. This code needs to use <code>random.seed()</code>, a <code>for</code> statement and a multiplication. I understand that the <code>random.seed([x])</code> generates an initial value that could be used in the proceeding section of the code. However, I can't figure out how to proceed after obtaining the value of the random:</p> <pre><code>import random random.seed(70) print(random.random()) # This returns a value of 0.909769237923872 </code></pre> <p>How do I use this value to generate a random value between 30 and 35?</p> <p>Note: Without the specific directions above, I have been able to write two codes that function as desired, so please I am not looking for alternative ways of writing the code. </p>
0non-cybersec
Stackexchange
246
930
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 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 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
Today I discovered TVGameLauncher. Recently I've found myself reaching for the big screen to play my games, the frustration of switching the main display around in windows when I wanna game, then switching audio source to HDMI has always been a little tedious. Then the ball ache of switching the "main" display back to the monitor once finished to browse. Steam big picture is great, but I only play single players on the TV and so it's not exactly frustration free. A little Google turned up TVGameLauncher, which creates a shortcut on your desktop which once clicked changes the audio source to your choosing and launch's the game on the monitor you initially asked it too, all automagically! All you need to do is drop an executable either on the one time bit, or the "create shortcut on desktop" bit for something you always want launching on the display of your choosing. So far I've only tried Witcher 3 (GOG), but it worked perfect. It also works with steam games, and is VAC safe. http://sourceforge.net/projects/tvgamelauncher/
0non-cybersec
Reddit
239
1,046
We need to talk about Dany (and her eyebrows). People of Westeros, The Free Cities, The Summer Islands, and beyond, hear me. Many of you complain about Dany’s eyebrows, but I want to defend their honor. As a natural blonde, my eyebrows are darker than my head of hair. This is very common for people with fair hair. But I don’t mean to draw a fallacy—you may say that just because something is natural doesn’t make it good. True. But let me show you something. Please look [here](http://25.media.tumblr.com/tumblr_maylg4VEGA1qg6ri4o1_400.jpg) and [here](http://www.beautyrsvp.com/wp-content/uploads/2012/10/Gucci.jpg) and [here](http://livesofstyle.com/thelastword/wp-content/uploads/2012/10/brow1.jpg) at these photos of light blonde women with matched eyebrows. The look has been popular in high fashion for a couple years now. It is known. To me, the effect is slightly nightmarish. Eyebrows define our eyes, enhance expression, and divide the forehead. Not only do I think the GOT stylists have it accurate with Dany, I think they have it right. A bleached brow would disservice her gorgeous eyes and bone structure. Please discuss. Edit: Because some people have asked, I think every few days I see people getting all plucky about this (indulge me the pun) in threads. In fact, I don't think I've seen a single photo of Emilia that doesn't have some eyebrow raising (there I go again) hair and brow comments.
0non-cybersec
Reddit
386
1,420
Is it necessary to link to all landing pages from the homepage?. <p>What I am wanting to do is build quite a few landing pages targeting specific keywords from google search. These pages will give a brief explanation of what we do and how we can help them with what they are looking for. Along with that, they will have a signup form. </p> <p>My question is where should these go in the site structure? Should the homepage link to all of them somehow? Or should the homepage link to some 'features' page or 'sitemap' page that then links to all of the landing pages? Or maybe the pages don't need to be linked from the homepage at all and can just be included in the sitemap. I feel that the last option probably isn't the best idea.</p> <p>EDIT: Quite a few is around 50 - 100. I plan on getting uses to the page by targeting niche ketwords and probably some adwords traffic as well. However I don't know if they need to be linked to somewhere in my site.</p>
0non-cybersec
Stackexchange
239
971
$x^{3}+ax^2+bx+c$ has all roots negative real numbers and a&lt;3. Establish an inequality between only b and c. <blockquote> <p>A cubic equation <span class="math-container">$x^{3}+ax^2+bx+c$</span> has all negative real roots and <span class="math-container">$a, b, c\in R$</span> with <span class="math-container">$a&lt;3.$</span></p> <p>Prove that <span class="math-container">$b+c&lt;4.$</span></p> </blockquote> <p>My attempt :</p> <p>Let the cubic be <span class="math-container">$f(x)$</span></p> <p>Plotting graph we see that ,</p> <p><span class="math-container">$f(x\geq 0)&gt;0$</span>.</p> <p>So we can see that a relation between <span class="math-container">$a, b, c$</span> can be established by putting <span class="math-container">$x=1$</span>, so,</p> <p><span class="math-container">$1+a+b+c&gt; 0$</span>.</p> <p>So <span class="math-container">$b+c&gt;-4$</span>.</p> <p>Also by using <em>Vieta's Formula</em> we get <span class="math-container">$a, b, c &gt; 0$</span>.</p> <p>Now I'm uncertain how to proceed, any help will be appreciated. This is a problem of a maths olympiad. Thanks.</p>
0non-cybersec
Stackexchange
429
1,114
Properties of Quasi-Coherent Modules. <p>Let $X=\mathrm{Spec}\,A$ be an affine scheme and $M$ an $A$-module. Show that the following two conditions are equivalent: </p> <p>(a) $\tilde{M}$ is a locally free $\mathcal{O}_{X}$-module of finite type.</p> <p>(b) $M$ is a finitely generated projective $A$-module. </p> <p>How would one prove this equivalence? Any help would be valuable!</p> <p>Also, it seems that one could find projective $A$-modules $M$ such that $\tilde{M}$ is not locally free, if we remove the condition of finite generation on $M$. What would be a good example of this? I thought something along the lines of the following: $\mathfrak{m}=k^{(J)}$ is a projective ideal where $k$ is a field and $J$ is an infinite indexing set. Set $A=k^{(J)}$, $X=\mathrm{Spec}\,A$. Then it seems we could find some $\mathfrak{\tilde{m}}$ that is not a locally free $\mathcal{O}_{X}$-module.</p>
0non-cybersec
Stackexchange
268
902
install php-mcrypt Centos 6. <p>I'm trying for a few days now to install php-mcrypt on Centos 6 64bit, but I get this error</p> <pre><code>[root@cimpan tmp]# yum install php-mcrypt Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mi.mirror.garr.it * epel: mirror.switch.ch * extras: mi.mirror.garr.it * rpmforge: mirror.crazynetwork.it * updates: mi.mirror.garr.it Setting up Install Process Resolving Dependencies --&gt; Running transaction check ---&gt; Package php-mcrypt.x86_64 0:5.3.3-3.el6 will be installed --&gt; Processing Dependency: php(zend-abi) = 20090626 for package: php-mcrypt-5.3.3- 3.el6.x86_64 --&gt; Processing Dependency: php(api) = 20090626 for package: php-mcrypt-5.3.3-3.el6.x86_64 --&gt; Finished Dependency Resolution Error: Package: php-mcrypt-5.3.3-3.el6.x86_64 (epel) Requires: php(zend-abi) = 20090626 Installed: php-common-5.4.28-1.el6.remi.x86_64 (@remi) php(zend-abi) = 20100525-x86-64 Available: php-common-5.3.3-26.el6.x86_64 (base) php(zend-abi) = 20090626 Available: php-common-5.3.3-27.el6_5.x86_64 (updates) php(zend-abi) = 20090626 Error: Package: php-mcrypt-5.3.3-3.el6.x86_64 (epel) Requires: php(api) = 20090626 Installed: php-common-5.4.28-1.el6.remi.x86_64 (@remi) php(api) = 20100412-x86-64 Available: php-common-5.3.3-26.el6.x86_64 (base) php(api) = 20090626 Available: php-common-5.3.3-27.el6_5.x86_64 (updates) php(api) = 20090626 You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest [root@cimpan tmp]# rpm -qa | grep epel epel-release-6-8.noarch </code></pre> <p>Epel release version seems to be ok too. Tried <code>yum clean all</code> but no luck either. It may be broken because I've updated PHP to 5.4.28?</p> <p>(P.S.: pretty new to server management)</p>
0non-cybersec
Stackexchange
759
1,994
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
18.10 upgrade issue. <p>I have two different PCs, each multi-boot, with Ubuntu 18.04 as one of the operating systems on each. When I run the 18.10 upgrade on either machine, it appears to be fully processing the upgrade, but when I reboot, it still says I'm on 18.04. I've tried it both thru the GUI and thru the terminal, same result. What gives? Oddly, the report seems to show a completed upgrade, but under System>Details, it still says it's the last version (see screenshot).</p> <p>dave@BigBoy:~$ ubuntu-report show</p> <p>{ "Version": "18.10", "OEM": { "Vendor": "To Be Filled By O.E.M.",</p> <p>"Product": "To Be Filled By O.E.M." },</p> <p>"BIOS": { "Vendor": "American Megatrends Inc.",</p> <p>"Version": "P1.30" },</p> <p>"CPU": { "OpMode": "32-bit, 64-bit",</p> <pre><code>"CPUs": "4", "Threads": "1", "Cores": "4", "Sockets": "1", "Vendor": "AuthenticAMD", "Family": "16", "Model": "4", "Stepping": "3", "Name": "AMD Phenom(tm) II X4 955 Processor", "Virtualization": "AMD-V" </code></pre> <p>},</p> <p>"Arch": "amd64", "GPU": [</p> <p>{ "Vendor": "10de", "Model": "1244" }</p> <p>], "RAM": 32.9, "Disks": [ 240.1, 2000.4, 2000.4, 320.1, 0, 0, 0, 0, 0, 0, 0, 15.6 ],</p> <p>"Partitions": [ 19.5, 1, 15.2 ],</p> <p>"Screens": [</p> <p>{ "Size": "598mmx336mm", "Resolution": "1920x1080", "Frequency": "60.00" }</p> <p>], "Autologin": true, "LivePatch": false, "Session": { "DE": "Unity:Unity7:ubuntu", "Name": "unity", "Type": "x11" },</p> <p>"Language": "en_US",</p> <p>"Timezone": "America/New_York",</p> <p>"Upgrade": {</p> <p>"From": "18.04",</p> <pre><code>"InstallMedia": "Ubuntu 14.04.3 LTS \"Trusty Tahr\" - Beta amd64 (20150805)", "Type": "GTK", "ThirdPartySources": false, "Stages": { "0": "start", "6": "PREPARE", "22": "MODIFY_SOURCES", "75": "FETCH", "193": "INSTALL", "199": "INSTALL", "356": "INSTALL", "15163": "POSTUPGRADE", "15370": "CLEANUP", "20526": "REBOOT" } </code></pre> <p>}</p> <p>dave@BigBoy:~$ ubuntu-report show | grep Version</p> <p>"Version": "18.10",</p> <pre><code>"Version": "P1.30" </code></pre> <p><a href="https://i.stack.imgur.com/nzgop.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nzgop.png" alt="screenshot of system&gt;details after upgrade"></a></p> <p>During the upgrade process, I did note some oddities toward the end (I often leave the terminal window open, and monitor it), where it would begin some process, hesitate, then come back with an error message about "no swap area available", when in fact I have about 8GB set aside specifically for swap. That happened 4 or 5 times, near the end of the process. After that, the upgrade finally acted as if it was finished and asked for a restart, but on rebooting and seeing that "18.04" still showing, I wasn't so sure everything had finished properly -- or if it had chickened out and reverted me to 18.04.</p>
0non-cybersec
Stackexchange
1,210
3,065
Statistics Poisson Distribution. <p>Suppose that the number of eggs laid by a certain insect has a Poisson distribution with mean λ. The probability that any one of the eggs hatches is p. Assume that the eggs hatch independently of one another. Let Y denote the number of eggs which hatch. I am trying to find E(Y), Var(Y), and P(Y=1).</p> <p>Let N denote the number of eggs, then E(Y)=EE(Y|N)=E(N)p=λp. Is this right first off?</p> <p>Then for the variance, Var(Y) would equal λp also correct?</p> <p>And for P(Y=1), would this just equal p?</p> <p>Thanks for any help!</p> <p>Where would I find the proof? I'm new to this site.</p>
0non-cybersec
Stackexchange
208
639
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
Thread 1: EXC_BREAKPOINT (code=EXC_i386_BPT, subcode=0x0) error. <p>I have an iPad app I am making, but it crashes on startup even though there are no errors or warnings, the output doesn't output anything besides "(lldb)", and it marks a pointer.</p> <p>This is the image of the post build crash.</p> <p><img src="https://i.stack.imgur.com/sVXYD.png" alt="Image Of Crash"></p> <p>And here is the code:</p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { /* UIImage *myImage = [UIImage imageNamed:@"de_dust2.png"]; myImageView = [[UIImageView alloc] initWithImage:myImage]; myScrollView.contentSize = CGSizeMake(myImageView.frame.size.width, myImageView.frame.size.height); myScrollView.maximumZoomScale = 4.0; myScrollView.minimumZoomScale = 0.75; myScrollView.clipsToBounds = YES; myScrollView.delegate = self; // [myScrollView addSubview:myImageView];*/ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; self.window.rootViewController = self.viewController; [self.window makeKeyAndVisible]; [self.viewController setRed:1]; [self.viewController setGreen:0]; [self.viewController setBlue:0]; [self.viewController setAlpha:1]; [self.viewController checkRotation]; return YES; } </code></pre> <p>I now also noticed that the error was given at the <code>[self.window makeKeyAndVisible];</code> line.</p>
0non-cybersec
Stackexchange
498
1,642
Algorithm for best subset of items. <p>I have a matrix M with size NxN where each position M(i,j) is an integer representing the relationship between item i and j. If i and j are the same item then the positions M(i,j) and M(j,i) are 0.</p> <p>What I'd need is to regroup these N items in subgroups of 5 elements each one. The value of each group would be &#931;(M(i,j) for each i, j in the group).<br> And I would need to maximize the total value of all groups.</p> <p>I studied lots of algorithms more than 15 years ago and I forgot the most of them, and nowadays are lots of new algorithms, so I'm a bit lost trying to find the best one for these case.</p> <p>A friend told me to investigate Clustering algorithms but they have lots of different versions and specializations, so I don't know which one to look at first.</p> <p>And just one more thing, besides this algorithm to maximize each group, would I need an algorithm to maximize the total value of all groups, discarding the non optimal selections? I remember algorithms that made this but I don't even remember their name.</p>
0non-cybersec
Stackexchange
288
1,093
Why am I getting an &quot;execv(file, args)&quot; error when using execl()?. <p>I am trying to use execl() to execute a new program but it keeps returning an execv() error saying that arg2 must not be empty.</p> <pre><code>if pid == 0: print("This is a child process") print("Using exec to another program") os.execl("example_prg_02.py") </code></pre> <p>Why would this be the case when using execl()? Does execl() require args too?</p>
0non-cybersec
Stackexchange
145
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
IPTables rule for neither of two interfaces. <p>I'm using IPtables and I have a doubt that I can't find. I want to apply a rule in the PREROUTING of the nat table. The rule is supposed to execute a chain but I want it to be executed for every interfaces except for two of them. I can't use wildcards because I need all of the other interfaces regardless their name (say I can't have it).</p> <p>I have applied this rule:</p> <pre><code>iptables -t nat -A PREROUTING -j my_chain ! -i eth0 </code></pre> <p>That results into this:</p> <pre><code>Chain PREROUTING (policy ACCEPT 19 packets, 3008 bytes) pkts bytes target prot opt in out source destination 10 1538 my_chain all -- !eth0 * 0.0.0.0/0 0.0.0.0/0 </code></pre> <p>But I need something like this:</p> <pre><code>Chain PREROUTING (policy ACCEPT 19 packets, 3008 bytes) pkts bytes target prot opt in out source destination 10 1538 my_chain all -- !(eth0 or tun0) * 0.0.0.0/0 0.0.0.0/0 </code></pre> <p>The thing is it can not be in two different rules because one of this two interfaces will enter into the other's interface rule. I also tried something like:</p> <pre><code>iptables -t nat -A PREROUTING -j my_chain ! -i eth0 ! -i tun0 </code></pre> <p>But it returns: <code>multiple -i flags not allowed</code></p> <p>Bassically I need a way to implement that <code>or</code> in the interface condition or <code>!eth0 and !tun0</code> (logical equivalent).</p> <p>I'm using debian with iptables v1.4.21.</p> <p>Thanks for your help!</p>
0non-cybersec
Stackexchange
529
1,584
Prove that the sequence is convergent and find its limit.. <p>Prove the sequence:$$y(n) = (y(n-1) + 2y(n-2))/3 \text{ for } n &gt; 2 \text{ and }y(1)&lt;y(2)$$ is convergent and find it's limit.</p> <p><strong>My progress so far</strong></p> <p>So far, I have been able to prove that that the sequence in monotonically increasing by proving $y(3)&gt;y(1)$, then $y(4)&gt;y(3)$ and I proved the rest by PMI.</p> <p>If we prove that the sequence is bounded above, by Monotone Convergence theorem, the sequence shall be convergent. I haven't been able to prove it though.</p> <p>Also, once we prove that the limit exists, how do we find it. Generally, we are able to do so by putting 'limit' on the defined sequence(After proving that the limit exists) and then we'd get a value. However, it isn't working here.</p>
0non-cybersec
Stackexchange
259
817
Homestead installation. <p>I could not figure out where I made a mistake here. My command <code>vagrant up</code> replies with the following lines</p> <pre><code>$ vagrant up Check your Homestead.yaml file, the path to your private key does not exist. Check your Homestead.yaml file, the path to your private key does not exist. </code></pre> <p><a href="https://i.stack.imgur.com/AlJuQ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/AlJuQ.png" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
156
502
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
Algorithms: Find the best table to play (standing gambler problem). <p><em><strong>Preface</em></strong></p> <p>This is not code golf. I'm looking at an interesting problem and hoping to solicit comments and suggestions from my peers. This question is not about <a href="http://en.wikipedia.org/wiki/Card_counting">card counting</a> (exclusively), rather, it is about determining the best table to engage based on observation. Assume if you will some kind of brain implant that makes worst case time / space complexity (on any given architecture) portable to the human mind. Yes, this is quite subjective. Assume a <a href="http://en.wikipedia.org/wiki/Playing_card#French">French deck</a> without the use of wild cards.</p> <p><em><strong>Background</em></strong></p> <p>I recently visited a casino and saw more bystanders than players per table, and wondered what selection process turned bystanders into betting players, given that most bystanders had funds to play (chips in hand).</p> <p><em><strong>Scenario</em></strong></p> <p>You enter a casino. You see n tables playing a variant of <a href="http://en.wikipedia.org/wiki/Blackjack">Blackjack</a>, with y of them playing <a href="http://en.wikipedia.org/wiki/Pontoon_%28game%29">Pontoon</a>. Each table plays with an indeterminate amount of card decks, in an effort to obfuscate the <a href="http://en.wikipedia.org/wiki/Casino_game#House_advantage">house advantage</a>.</p> <p>Each table has a varying minimum bet. You have Z currency on your person. You want to find the table where:</p> <ul> <li>The least amount of card decks are in use</li> <li>The minimum bet is higher than a table using more decks, but you want to maximize the amount of games you can play with Z.</li> <li>Net losses, per player are lowest (I realize that this is, in most answers, considered to be incidental noise, but it could illustrate a broken shuffler)</li> </ul> <p><em><strong>Problem</em></strong></p> <p>You can magically observe every table. You have X rounds to sample, in order to base your decision. For this purpose, every player takes no more than 30 seconds to play.</p> <p>What algorithm(s) would you use to solve this problem, and what is their worst case complexity? Do you:</p> <ul> <li>Play Pontoon or Blackjack ?</li> <li>What table do you select ?</li> <li>How many rounds do you need to observe (what is the value of X), given that the casino can use no more than 8 decks of cards for either game? Each table has between 2 and 6 players.</li> <li>How long did you stand around while finding a table?</li> </ul> <p>I'm calling this the "<strong>standing gambler problem</strong>" for lack of a better term. Please feel free to refine it.</p> <p><em><strong>Additional</em></strong></p> <p>Where would this be useful if not in a casino?</p> <p><em><strong>Final</em></strong></p> <p>I'm not looking for a magic gambling bullet. I just noticed a problem which became a bone that my brain simply won't stop chewing. I'm especially interested in applications way beyond visiting a casino.</p>
0non-cybersec
Stackexchange
860
3,066
&quot;symlink&quot; data to new database. <p>I am just trying to figure some ways to do manage archiving of some/most of our Application data within the database and wondering if something like this would be possible:</p> <ol> <li>Archive anything with a status of resolved, and a data updated over 3 years</li> <li>Move MOST, but not all that data to the archive database, and replace the values within the current production database with a “SymLink” that points to the archived database?</li> </ol> <p>Here is a simplified example:</p> <pre><code>####################################################################################################### ### Active_Prod ### ####################################################################################################### # ALIASAPPTYPE ALIASAPPREASON PZINSKEY PZPVSTREAM # # App_Type_1234 New Enrollee 132387Something6357997 &lt;SYMLINKED to Archive_Prod.pzpvstream&gt; # # # # # ####################################################################################################### ### Archive_Prod ### ####################################################################################################### # ALIASAPPTYPE ALIASAPPREASON PZINSKEY PZPVSTREAM # # App_Type_1234 New Enrollee 132387Something6357997 [BLOB Data] # ####################################################################################################### </code></pre> <p>So the query for <code>select * from Active_Prod</code> would return the following results:</p> <pre><code>ALIASAPPTYPE ALIASAPPREASON PZINSKEY PZPVSTREAM App_Type_1234 New Enrollee 132387Something6357997 [BLOB Data] </code></pre> <p>We would not be concerned with updating or inserting data as the <code>Archive_Prod</code> database would be set to read only anyway. My thinking here is we could drastically reduce the <code>Active</code> DB2 instance by archiving most of the date (The bulk of the data resides in the BLOB anyway), but keep the “Key” fields in the “Active” database for speedier lookups. But by creating a symlink of the data, we can improve the performance of PEGA, and improve the backup/restore times by dramatically reducing the overall size of the database.</p>
0non-cybersec
Stackexchange
587
2,744
Ghandhan statement on Characteristic of Fifth power of number $(n \cdot n \cdot n \cdot n \cdot n)$. <p>I have identified few unique characteristics of fifth power of a number i.e. $n \cdot n \cdot n \cdot n \cdot n$. Below are the 2 Characteristics.</p> <h2>For any integer number N,</h2> <ol> <li>Last digit of $N$ and its last digit of fifth power $N \cdot N \cdot N \cdot N \cdot N$ are same. </li> <li>Value of $(N\cdot N\cdot N\cdot N \cdot N) - N$ is always divisible by $30$. </li> </ol> <p>Few Examples below, </p> <ul> <li><p>$N = 2$,</p> <p>$$(N\cdot N\cdot N\cdot N \cdot N) = 32$$</p> <p>$$\left(\frac{(N\cdot N\cdot N\cdot N \cdot N)-N}{30}\right) = 1$$ </p></li> <li><p>$N = 4$</p> <p>$$(N\cdot N\cdot N\cdot N \cdot N) = 1024$$ </p> <p>$$\left(\frac{(N\cdot N\cdot N\cdot N \cdot N)-N)}{30}\right) = 34$$</p></li> </ul> <p>If this findings are not valid please defend this statement with your examples.</p>
0non-cybersec
Stackexchange
372
935
Share an external module between lazy loaded modules in angular2. <p>My app has components that use a heavy-weight external package (ag-grid, about 1MB) that is provided as an angular2 module (<code>AgGridModule</code>). I would like to load the package only when the components using it are required, so my <code>ContentModule</code> and all of its submodules are lazy loaded. The whole structure looks like this:</p> <p><a href="https://i.stack.imgur.com/w9GFj.png"><img src="https://i.stack.imgur.com/w9GFj.png" alt="enter image description here"></a></p> <p>However, when I import <code>AgGridModule</code> into both <code>Submodule1</code> and <code>Submodule3</code>, it ends up being included into compiled JS twice, making both 1.chunk.js and 3.chunk.js large. I tried importing it into <code>ContentModule</code>, but then the submodules do not recognize the components that are included in <code>AgGridModule</code>, even if I list them in the <code>exports</code> property of <code>ContentModule</code>.</p> <pre><code>@NgModule({ imports: [ ContentRoutingModule, SomeOtherModule, AgGridModule.withComponents([]) ], exports: [ // this is the component from AgGridModule that I use AgGridNg2 ] }) export class ContentModule { } </code></pre> <p>Is there a way to share a module between lazy loaded modules, or to expose some components of an imported module to lazy loaded children?</p> <p>UPD: Creating a shared module and importing it into submodules does not help, there are still two chunks with about 1MB each: <a href="https://i.stack.imgur.com/mUjvm.png"><img src="https://i.stack.imgur.com/mUjvm.png" alt="enter image description here"></a></p> <p>UPD2: I solved the problem temporarily by merging Submodule1 and Submodule3 into a single module.</p>
0non-cybersec
Stackexchange
524
1,802
Find minimum and maximum values of a function. <p>I have a function and I would like to find its maximum and minimum values. My function is this:</p> <pre><code>def function(x, y): exp = (math.pow(x, 2) + math.pow(y, 2)) * -1 return math.exp(exp) * math.cos(x * y) * math.sin(x * y) </code></pre> <p>I have an interval for x [-1, 1] and y [-1, 1]. I would like to find a way, limited to this interval, to discover the max and min values of this function.</p>
0non-cybersec
Stackexchange
159
469
Not able to connect to network inside docker container. <p>I have a CentOS 7 host on which I am running Docker. When I do a ping from my host to 8.8.8.8, ping was successful whereas same inside a docker container is not working.</p> <p>From Host</p> <pre><code>[root@linux1 ~]# ping 8.8.8.8 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=47 time=31.5 ms 64 bytes from 8.8.8.8: icmp_seq=2 ttl=47 time=31.6 ms ^C --- 8.8.8.8 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 31.592/31.617/31.643/0.179 ms </code></pre> <p>From Docker Container (I am using basic ubuntu image):</p> <pre><code>[root@linux1 ~]# docker run ubuntu ping 8.8.8.8 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. From 172.17.0.1 icmp_seq=1 Destination Host Unreachable From 172.17.0.1 icmp_seq=2 Destination Host Unreachable From 172.17.0.1 icmp_seq=3 Destination Host Unreachable From 172.17.0.1 icmp_seq=4 Destination Host Unreachable ^C --- 8.8.8.8 ping statistics --- 6 packets transmitted, 0 received, +4 errors, 100% packet loss, time 5000ms pipe 4 </code></pre> <p>Any suggestions would be helpful. Thanks</p>
0non-cybersec
Stackexchange
455
1,184