text:
Q: Definition of limit of a function at infinity I looked at some rigorous definitions of limit of a function at infinity (in real analysis). The one I found most often is this:
Why Open Interval In Formal Definition Of Limit At Infinity
I will assume the +∞ case below.
I haven't been able to figure out why is it required that the function be defined in an interval (a,∞).
Won't it be sufficient just to say that for any c∈ℝ, there exists m∈ℝ, m>c such that the function is defined at m (the domain of the function has no upper bound)?
Such definition will be less restrictive and can directly define limit of a sequence. Is there something wrong with that definition?

A: You can do that too, but the concept it produces is usually not the one we pragmatically want.
Intuitively we'd like, by analogy with the finite case, to say that $L$ is the limit iff: For every $\varepsilon>0$ all we have to do to guarantee $|f(x)-L|<\varepsilon$ is to choose $x$ sufficiently close to $\infty$ (that is, large enough).
With your proposal it wouldn't be sufficient to make $x$ large enough; we would additionally need to avoid $x$s where $f$ is not defined.
Dealing with this is usually enough extra work, for so little practical gain, that it is not the favored way of doing things and is not what the short ordinary notation gets to be used for. But again, your limit concept is available when you need it; you just need to specify something like $\lim\limits _{x \to\infty, x\in A}$ where $A$ is the upwards unbounded set you're interested in.


text:
Q: Menu bar and toolbar of few applications are very tiny in ubuntu 20.04 I have recently installed Ubuntu 20.04 on Asus g531gu laptop.
Few applications such as Mendeley and team-viewer have very tiny toolbar and menu bars. I have tried to increase font in setting but to no avail. Below is the screenshot of mendeley desktop application. The Font which is encircled is so tiny it's difficult to read. How do I fix this.

Some one kindly suggest some fix for this porblem. it has been 18 days.

A: I had the same issue recently on my main rig.  Couldn't find any answers anywhere so I resorted to a fresh install (had originally been a 19.04 install, upgraded later to 19.10, then eventually to 20.04).
The issue hasn't resurfaced on this machine since, but this morning I rebooted the media centre to find the same problem... so I've been back to searching for solutions (incidentially, it was also originally a 19.04 install, so my initial thoughts were that something had gone awry through the upgrades).
As it turns out, it's a bug affecting Nvidia users, so most likely is what's affecting your laptop (nice unit btw).
I found my answer here: Ubuntu 20.04 interface font too small after restart, even with high scaling factor

Bug report here: Shell text is too small in mutter 3.36.4-0ubuntu0.20.04.2
I hope this helps.

A: The problem is with high def displays. So, what I simply did was to decrease the resolution from 1920X1080 to 1600X900 now the font is fine with all apps.

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to troubleshoot this Google Map V2 logcat Greeting!
Thank you in advance for viewing my question. I want to run Google Map in emulator (Eclipse), but every time I run the AVD, it says that "application has stopped". What happen exactly? How can I troubleshoot it? I have searched for solutions, but all I found can't solve it. Here is copy of my logcat.
09-06 06:00:01.089: I/ProcessStatsService(380): Prepared write state in 73ms
09-06 06:00:15.499: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:15.499: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:15.499: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:15.499: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:15.509: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:15.509: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:15.509: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:15.509: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:15.509: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:15.519: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:15.519: E/SoundPool(380): error loading /system/media/audio/ui/KeypressStandard.ogg
09-06 06:00:15.519: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressStandard.ogg
09-06 06:00:15.519: E/SoundPool(380): error loading /system/media/audio/ui/KeypressSpacebar.ogg
09-06 06:00:15.519: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressSpacebar.ogg
09-06 06:00:15.519: E/SoundPool(380): error loading /system/media/audio/ui/KeypressDelete.ogg
09-06 06:00:15.519: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressDelete.ogg
09-06 06:00:15.519: E/SoundPool(380): error loading /system/media/audio/ui/KeypressReturn.ogg
09-06 06:00:15.519: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressReturn.ogg
09-06 06:00:15.519: E/SoundPool(380): error loading /system/media/audio/ui/KeypressInvalid.ogg
09-06 06:00:15.519: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressInvalid.ogg
09-06 06:00:15.519: W/AudioService(380): onLoadSoundEffects(), Error -1 while loading samples
09-06 06:00:15.539: I/ActivityManager(380): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=ca.sfu.cmpt276.bfraser/.MainActivity} from pid 620
09-06 06:00:15.609: D/gralloc(49): Registering a buffer in the process that created it. This may cause memory ordering problems.
09-06 06:00:15.609: E/libEGL(49): called unimplemented OpenGL ES API
09-06 06:00:15.609: E/libEGL(49): called unimplemented OpenGL ES API
09-06 06:00:15.619: E/libEGL(49): called unimplemented OpenGL ES API
09-06 06:00:15.619: E/libEGL(49): called unimplemented OpenGL ES API
09-06 06:00:15.619: E/SurfaceFlinger(49): glCheckFramebufferStatusOES error -889700262
09-06 06:00:15.619: E/SurfaceFlinger(49): got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot
09-06 06:00:15.619: E/libEGL(49): called unimplemented OpenGL ES API
09-06 06:00:15.619: E/libEGL(49): called unimplemented OpenGL ES API
09-06 06:00:15.619: W/WindowManager(380): Screenshot failure taking screenshot for (246x410) to layer 21005
09-06 06:00:15.729: I/Choreographer(620): Skipped 54 frames!  The application may be doing too much work on its main thread.
09-06 06:00:15.889: D/dalvikvm(1252): Not late-enabling CheckJNI (already on)
09-06 06:00:15.889: I/ActivityManager(380): Start proc ca.sfu.cmpt276.bfraser for activity ca.sfu.cmpt276.bfraser/.MainActivity: pid=1252 uid=10058 gids={50058, 3003, 1028, 1015}
09-06 06:00:16.689: D/AndroidRuntime(1252): Shutting down VM
09-06 06:00:16.689: W/dalvikvm(1252): threadid=1: thread exiting with uncaught exception (group=0xb3ab3ba8)
09-06 06:00:16.709: E/AndroidRuntime(1252): FATAL EXCEPTION: main
09-06 06:00:16.709: E/AndroidRuntime(1252): Process: ca.sfu.cmpt276.bfraser, PID: 1252
09-06 06:00:16.709: E/AndroidRuntime(1252): java.lang.RuntimeException: Unable to start activity ComponentInfo{ca.sfu.cmpt276.bfraser/ca.sfu.cmpt276.bfraser.MainActivity}: android.view.InflateException: Binary XML file line #22: Error inflating class fragment
09-06 06:00:16.709: E/AndroidRuntime(1252):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at android.app.ActivityThread.access$800(ActivityThread.java:135)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at android.os.Handler.dispatchMessage(Handler.java:102)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at android.os.Looper.loop(Looper.java:136)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at android.app.ActivityThread.main(ActivityThread.java:5017)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at java.lang.reflect.Method.invokeNative(Native Method)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at java.lang.reflect.Method.invoke(Method.java:515)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at dalvik.system.NativeStart.main(Native Method)
09-06 06:00:16.709: E/AndroidRuntime(1252): Caused by: android.view.InflateException: Binary XML file line #22: Error inflating class fragment
09-06 06:00:16.709: E/AndroidRuntime(1252):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:713)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at android.app.Activity.setContentView(Activity.java:1929)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at ca.sfu.cmpt276.bfraser.MainActivity.onCreate(MainActivity.java:24)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at android.app.Activity.performCreate(Activity.java:5231)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
09-06 06:00:16.709: E/AndroidRuntime(1252):     ... 11 more
09-06 06:00:16.709: E/AndroidRuntime(1252): Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value.  Expected 5089000 but found 0.  You must have the following declaration within the <application> element:     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
09-06 06:00:16.709: E/AndroidRuntime(1252):     at com.google.android.gms.common.GooglePlayServicesUtil.A(Unknown Source)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at com.google.android.gms.maps.internal.u.I(Unknown Source)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at com.google.android.gms.maps.internal.u.H(Unknown Source)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at com.google.android.gms.maps.MapFragment$b.jz(Unknown Source)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at com.google.android.gms.maps.MapFragment$b.a(Unknown Source)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at com.google.android.gms.dynamic.a.a(Unknown Source)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at com.google.android.gms.dynamic.a.onInflate(Unknown Source)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at android.app.Activity.onCreateView(Activity.java:4785)
09-06 06:00:16.709: E/AndroidRuntime(1252):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:689)
09-06 06:00:16.709: E/AndroidRuntime(1252):     ... 21 more
09-06 06:00:16.719: W/ActivityManager(380):   Force finishing activity ca.sfu.cmpt276.bfraser/.MainActivity
09-06 06:00:17.029: I/WindowManager(380): Screenshot max retries 4 of Token{b4292878 ActivityRecord{b3f8dc40 u0 ca.sfu.cmpt276.bfraser/.MainActivity t5 f}} appWin=Window{b4418de8 u0 Starting ca.sfu.cmpt276.bfraser} drawState=4
09-06 06:00:17.029: W/WindowManager(380): Screenshot failure taking screenshot for (480x800) to layer 21010
09-06 06:00:17.559: W/ActivityManager(380): Activity pause timeout for ActivityRecord{b3f8dc40 u0 ca.sfu.cmpt276.bfraser/.MainActivity t5 f}
09-06 06:00:18.049: I/ActivityManager(380): Killing 1156:com.svox.pico/u0a40 (adj 15): empty for 5152s
09-06 06:00:18.619: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:18.619: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:18.619: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:18.619: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:18.619: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:18.619: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:18.639: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:18.669: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:18.669: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:18.669: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:18.669: E/SoundPool(380): error loading /system/media/audio/ui/KeypressStandard.ogg
09-06 06:00:18.669: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressStandard.ogg
09-06 06:00:18.669: E/SoundPool(380): error loading /system/media/audio/ui/KeypressSpacebar.ogg
09-06 06:00:18.669: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressSpacebar.ogg
09-06 06:00:18.679: E/SoundPool(380): error loading /system/media/audio/ui/KeypressDelete.ogg
09-06 06:00:18.679: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressDelete.ogg
09-06 06:00:18.679: E/SoundPool(380): error loading /system/media/audio/ui/KeypressReturn.ogg
09-06 06:00:18.679: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressReturn.ogg
09-06 06:00:18.679: E/SoundPool(380): error loading /system/media/audio/ui/KeypressInvalid.ogg
09-06 06:00:18.679: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressInvalid.ogg
09-06 06:00:18.679: W/AudioService(380): onLoadSoundEffects(), Error -1 while loading samples
09-06 06:00:18.739: I/Process(1252): Sending signal. PID: 1252 SIG: 9
09-06 06:00:18.769: I/ActivityManager(380): Process ca.sfu.cmpt276.bfraser (pid 1252) has died.
09-06 06:00:18.859: I/Choreographer(380): Skipped 32 frames!  The application may be doing too much work on its main thread.
09-06 06:00:19.309: W/InputMethodManagerService(380): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@b3d7fee0 attribute=null, token = android.os.BinderProxy@b42a02e0
: E/(): Device disconnected

A: your AndroidManifest file is not well configured
Insert  element to include API key as a child of the
<meta-data android:name="com.google.android.maps.v2.API_KEY"
android:value="--- your API Key here ---"/>

Remember to replace value with your own API Key.
Please notice that you have to use debug API Key for your debug then later switch to release key
Add permission and uses-permission of MAPS_RECEIVE.
<permission
android:name="com.example.yourpackage.MAPS_RECEIVE"
android:protectionLevel="signature"></permission> <uses-permission
android:name="com.example.androidmapsv2.permission.MAPS_RECEIVE"/>

Then Add uses-permission:
<uses-permission
android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

this optional
<uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION"/>

Specify uses-feature of OpenGL ES 2:
<uses-feature android:glEsVersion="0x00020000"
android:required="true"/>


text:
Q: How to create admin ajax function for my contact form I am quite new to php, my website theme uses admin ajax to send enquiry form but there is no corresponding functions in admin-ajax.php. I want to know how create them. page which uses the contact form has this code
if ( isset( $cs_post_request_form_option ) && $cs_post_request_form_option == 'on' ) {
                    cs_user_conatct_form( $organizerID );
                }
                ?>

and on functions page i have the code for  cs_user_conatct_form() which is
if(!function_exists('cs_user_conatct_form')){
function cs_user_conatct_form( $organizerID = ''){
    $user_contact_form  = get_the_author_meta( 'user_contact_form', $organizerID );
    if( $user_contact_form == '1') {
    ?>

<?php esc_html_e('enquire now','directory');?>

            <form id="frm_request" name="frm_request" method="post" novalidate>

<input type="text" placeholder="<?php _e('Name','directory');?>" name="<?php _e('request name','directory');?>" id="request_name" />

<input type="text" placeholder="<?php _e('Email','directory');?>" name="<?php _e('request email','directory');?>" id="request_email">

<input type="text" placeholder="<?php _e('Phone No','directory');?>" name="<?php _e('request number','directory');?>" id="request_number">

<textarea placeholder="<?php _e('Message','directory');?>" name="<?php _e('request message','directory');?>" id="request_message" ></textarea>

                                <input type="checkbox" id="checkbox2" checked="checked" name="<?php _e('term condtions check','directory');?>">

                        <input type="hidden" name="user_id" value="<?php echo intval( $organizerID );?>" />
                        <input type="hidden" name="action" value="cs_add_request" />
                        <input type="button" value="<?php _e('Submit','directory');?>" class="cs-bgcolor" onclick="cs_request_submission('<?php echo admin_url('admin-ajax.php')?>', '<?php echo get_template_directory_uri()?>',<?php $("#frm_request")[0].reset();?>);">

           </form>

    <?php
    }
}

}
and on .js i have following code
    function cs_request_submission(admin_url,theme_url){
    'use strict';
    jQuery(".request-message-type").hide();
    jQuery("#request-loading").html("");
    jQuery(".request-message-type").html('');
    jQuery.ajax({
        type:"POST",
        url: admin_url,
        dataType: "json",
        data:jQuery('#frm_request').serialize(),
        success:function(response){
            if (response.type == 'success' ) {
                jQuery("#request-loading").html('');
                jQuery(".request-message-type").html(response.message);
                jQuery(".request-message-type").show();
                jQuery("#request_name").val('');
                jQuery("#request_email").val('');
                jQuery("#request_number").val('');
                jQuery("#request_message").val('');
                jQuery('#checkbox2').attr('checked', false); // Unchecks it
                jQuery("#frm_request").slideUp();

            } else {
                jQuery("#request-loading").html('');
                jQuery(".request-message-type").html(response.message);
                jQuery(".request-message-type").show();
            }
        }
    });
    return false;
}

I want to know how to create an admin-ajax function and how to send the page url like mydomain.com/adenquiry/postname on which the form is available.

A: The easiest way for me was to create a plugin. The plugin has code to handle the AJAX request. DO NOT add code to admin-ajax.php!
The Wordpress Codex has a great tutorial on how to do this. That's definitely the place to start.


text:
Q: Windows 10 Universal App - Geofence Background task not being triggered I'm trying to create a Windows UAP (C#) to constantly log location data in a background task, for now all I'm trying to do is start the background task off of a geofence trigger.
I've followed a lot of guides for how to do this, I've added the entry point in the Package.appxmanifest to "BackgroundTask.LocationBackgroundTask" and selected the location property.
I'm then registering the task using the following:
var result = await BackgroundExecutionManager.RequestAccessAsync();
var builder = new BackgroundTaskBuilder();
builder.Name = BackgroundTaskName;
builder.TaskEntryPoint = BackgroundTaskEntryPoint;
builder.SetTrigger(new LocationTrigger(LocationTriggerType.Geofence));
var geofenceTask = builder.Register();

I use the following code to verify if the background task is registered and it returns true to indicate that the task is registered:
public bool IsTaskRegistered()
{
    var Registered = false;
    var entry = BackgroundTaskRegistration.AllTasks.FirstOrDefault(keyval => keyval.Value.Name == BackgroundTaskName);
    if (entry.Value != null)
        Registered = true;
    return Registered;
}

The problem I'm having is that the Run method in the background task is just not getting triggered.
To verify the background task itself is all good, I swapped out the trigger type for  builder.SetTrigger(new SystemTrigger(SystemTriggerType.PowerStateChange, true)); (and updated the Package.appxmanifest to have the system event property). This then worked fine as the background task was triggered as I'd expect when I unplugged the power source from my laptop.
The other thing to note is that when debugging I don't see the background task under the Lifecycle Events whereas I do when testing with the SystemTrigger.
The problem does therefore seem to be specific to the geofence triggering. I'm starting to pull my hair out a bit over this so would be grateful for any suggestions.


text:
Q: Как мне получить доступ к локальному виртуальному серверу на телефоне? Имеется: компьютер с виртуальной машиной (ip 192.168.0.14), роутер DIR-615, сайт в виртуальной машине (ip-host 192.168.174.1 ip-guest 192.168.174.133)
Реализовано: доступ к сайту с компьютера по DNS имени default.dev. Т.е. с компа я ввожу DNS default.dev и у меня в браузере отображается сайт, находящийся в виртуалке.
Соображения: Я так понимаю, что в моем роутере надо произвести настройку а-ля виртуальный сервер, для перенаправления запроса на комп, но в интернете данной информации никак найти не могу (или, как вариант, это я слишком тупой, ятобы понять что, где, куда и зачем)
Требуется: "расшарить" сайт из виртуалки на всю локальную сеть. Т.е., например, я ввожу название локального сайта на телефоне "default.dev", запрос идет через роутер к компу, который перенаправляет запрос на виртуалку.

A: Телефон ничего не "знает" о домене default.dev.
Насколько я понял из описания, default.dev - это доменное имя виртуального компьютера с ip 192.168.174.133.
Если вы настроите подключение виртуалки в сеть методом моста (Bridge в настройках сетевого подключения виртуальной машины) и автоматическое получение IP-адреса, то гостевая операционка сможет получить ip-адрес от роутера.
Тогда ваш телефон, роутер, реальный компьютер и виртуальная машина будут все в одной сети и телефон сможет разрешить имя default.dev в ip-адрес с помощью роутера.
Готов помочь, задавайте вопросы.
В свою очередь мои вопросы:

*

*Какие ОС установлены на реальном компьютере и гостевой машинке?

*Какая прошивка на DIR-615? Родная или кастомная? Какая версия прошивки? Если кастомная, то какая?

A: bind на виртуалку поставить и настроить, и заставить роутер его указывать в качестве DNS для всех устройств в сети?
Про то как виртуалку выставить в сеть бриджом - уже выше написали.

A: У вас есть только один внешний IP на всю домашнюю сеть — тот, что выдал провайдер проводного интернета вашему роутеру. И даже этот адрес может меняться время от времени. Поэтому надо решить несколько подзадач:

*

*чтобы виртуалка имела свой адрес во внутренней сети.

*динамический маппинг домена во внешнем мире на адрес вашего роутера

*проброс порта в роутере на виртуалку

Первое делается через bridged network в настройках виртуалки.
Второе можно сделать через публичные сервисы DNS. Например freedns.afraid.org см. Dynamic DNS: у вас будет "секретная ссылка", которую вы можете по крону "пинговать" чтобы домен всегда смотрел на актуальный адрес.
Третье есть в настройках роутера.

A: Вам нужно белый айпи, так же поставить сайт на данный айпи, потом в днс у провайдера если не ошибаюсь прописывать данные, чтобы домен привязался к данному айпи.
Если же у вас денвер или тому подобное, тогда сайт у вас прописан в настройках ос.
В данном файле прописывается.
https://ru.wikipedia.org/wiki/Hosts

A: Насколько мне известно, нельзя подставить телефону DNS-сервера и уж точно файл hosts из роутера.
В таком случае существует несколько решений:

*

*Прорутить телефон и отредактировать /etc/hosts

*(сложнее) Поднять локальные DNS и прописать их в настройках телефона

*Поднимать каждый отдельный виртуальный хост или приложение на своем порту (это нормальная практика для отладки, выглядит лучше, чем модифицирование хостов или поднятие локального DNS-сервера) и просто обращаться по локальному айпишнишку.

A: Вам нужно поместить на айпишник вашего компьютера внутри роутера, сайт, в денвере будет вида, home\192.168.0.41\www\  тогда все кто пользуется роутером, будут его видеть по адресу 192.168.0.41.


text:
Q: Что такое энтерпрайз(Enterprise) в контексте программирования? Иногда встречаю понятие энтерпрайз программирование или энтерпрайз код.
Какое этому понятию можно дать определение ? И почему часто это употребляется как что-то негативное?
P.S. Понимаю что вопрос не зависит от языка, но ответ интересует относительно .Net платформы.

A: Всякие сервисы, базы данных и их интеграции между собой. Чаще всего это инфраструктура организаций, всякие CRMы, 1Сы и прочее. Нелюбимо творческими программистами за то, что это b2b, которым нельзя похвастаться перед друзьями, а Ъ-программисты ругают "галерных" программистов, что работа эта не творческая, рутинная, а исполнители - бестолковые и неквалифицированные, которые не могут в бородатые стартапы. Ну и так как этими системами клиентов не завлекают, то там гнездятся тонны легаси-кода.
Можно сказать, что зависит от языка. В подавляющем большинстве случаев это Java и .NET.

A: Если в лоб:
Постройка дома/дачи-это обычные проекты, хоть и бывают сложные
Строительство МКД на 1000+ квартир по ГОСТу в 70-100+ лет эксплуатации это Энтерпрайз.
По моим наблюдениям, Энтерпрайз решение должно обладать следующими характеристиками:
1) широкий масштаб разработки (международная компания или хотя бы специалисты из разных городов и областей, разные направления специалистов, часто решение находится на стыке научных изысканий)
2) большое количество пользователей (от 1 млн пользователей примерно)
3) решение, которое охватывает целую отрасль и более (т е находится в топе среди подобных решений в рамках мира или хотя бы большой страны/группы стран)
4) решение стабильное, отказоустойчивое, предсказуемое и требующее минимум изменений с течением долгого времени эксплуатации (т е даже спустя десятилетия, данное решение будет оптимальным решением вне зависимости от смены технологий, подходов и прочих как внешних, так и внутренних условий)
Почему негативное? Это субъективно-код получается неубиваемый, живучий и местами сложно понимаемый. Здесь нужно терпение и быстро результат нельзя получить, равно как и все новомодное встраивается очень медленно в виду сложности решения.

A: Enterprise-разработка – это промышленная разработка программного обеспечения, которая характеризуется:

*

*большими и сложными проектами

*длительным сроком разработки (множественные релизы, несущие новый функционал)

*разработку ведет команда (часто большая)

Главные приоритеты промышленной разработки:

*

*надежность

*предсказуемость

*интеграция с другими enterprise системами в рамках предприятия или отрасли

*безопасность, защищенность

*гибкость

В промышленной разработке широко применяются всевозможные стандарты и формализованные процессы. Например, Agile.
Противоположностью промышленной является "кустарная" разработка, которая характеризуется:

*

*небольшими разовыми заказами (без сопровождения и развития)

*небольшой командой (часто – один разработчик)

Приоритетами "кустарной" разработки являются:

*

*скорость разработки

*качественный дизайн и юзабилити

*быстрое удовлетворение сиюминутных желаний клиента

В отличие от "кустарной" промышленную разработку часто (и возможно заслуженно) критикуют за:

*

*устаревшие технологии (legacy code)

*узкую специализацию разработчиков

*бюрократию и долгие сроки (в первую очередь из-за большого количества согласований)

*низкую эффективность (из-за необходимости следовать стандартам и процессам)

*подавление творчества


text:
Q: Prove or disprove: if x is a non-zero rational number and y is an irrational number, then y/x is irrational. I saw solutions for power relation between x and y, I need a solution for division between x and y.

A: By contradiction.  If $x = p/q$ and $y/x = r/s$, then $y = (qr)/(ps)$.  You should say why this last ratio is not undefined.


text:
Q: Simulating traffic on Flask app with Curl Command I have a flask app that I'm trying to do a simple curl command against it to simulate traffic. However, whenever I try to do the curl command against the IP/port:
curl 0.0.0.0:5050
My pointer just moves down the screen and nothing happens. I eventually have to CTRL + C to close out of it. Any thoughts on how to keep the app open and try and ping it to simulate traffic?

A: It seems that you are using the same terminal window for both the running of the Flask-server and the curl command. That won't work, because the terminal is busy working the Flask-server. Simple solution would be to open a new terminal window and commission your curl command in that one.


text:
Q: All Users Visible to External Users in myapps.microsoft.com Azure AD We have an Azure Active Directory Enterprise Application which we have invited users to use. We can invite any email address and they can sign up, then they can go to myapps.microsoft.com and see the app, this is all working great.
However, one problem is on the right side of the myapps.microsoft.com (aka https://account.activedirectory.windowsazure.com/r#/applications) on the right hand side there's a group icon:

I click on this groups icon and then All Users, I can see every single user inside our instance of Azure AD, how can I prevent this?

A: You can enable Guest user permissions are limited from portal.azure.com -> Azure Active Directory -> User settings -> External collaboration settings. This should prevent guests from seeing other users. If this is not enabled, guests can see a full user list at e.g. portal.azure.com.


text:
Q: Ramifications in Galois closures of number fields Let $K/\mathbb{Q}$ be a finite Galois extension, and $L/K$ an infinite Galois extension such that the Galois group $ \operatorname{Gal}(L/K) $ is isomorphic to a closed subgroup of $ \operatorname{GL}_{d}(\mathbb{Z}_{p}) $ for some positive integer $ d $ where $\mathbb{Z}_{p}$ is the ring of $p$-adic integers. Suppose that $L/\mathbb{Q}$ is not Galois, and let $M$ denote the Galois closure of $L/\mathbb{Q}$.
My question is the following:

*

*Is the ramification index of the Galois extension $M/L$ finite for any prime ideal of $L$?

*Is the Galois group $ \operatorname{Gal}(M/L) $ isomorphic to a closed subgroup of $ \operatorname{GL}_{m}(\mathbb{Z}_{p}) $ for some positive integer $ m $?

For example, if $M/L$ is finite, then the answer to the above question is Yes. I don't know if $M/L$ is always finite.

A: The answer to 1 is negative, but 2 is true (see below).
Here is a counterexample to 1 (as well as to finiteness of $L \to M$).
Example. Let $K = \mathbf Q(i)$ and let $L = K\big(\pmb\mu_{2^\infty},\sqrt[2^\infty]{2+i}\big)$ be the smallest Galois extension containing all $2^n$-th roots of $2+i$ for all $n \geq 1$ (where $\pmb\mu_m \subseteq \bar{\mathbf Q}$ denotes the $m$-th roots of unity). Note that $K \to L$ is Galois with group
\begin{align*}
\operatorname{Gal}(L/K) \stackrel\sim\to&\ \mathbf{Aff}(\mathbf Z_2) = \left\{\begin{pmatrix}a & b \\ 0 & 1\end{pmatrix} \in \operatorname{GL}_2(\mathbf Z_2)\ \Bigg|\ a \in \mathbf Z_2^\times, b \in \mathbf Z_2\right\},\\
\left(\begin{array}{rl}\zeta_{2^n}\!\!\!\! & \mapsto \zeta_{2^n}^a \\ \sqrt[2^n]{2+i}\!\!\!\! & \mapsto \zeta_{2^n}^b\sqrt[2^n]{2+i} \end{array}\right) \mathrel{\unicode{x21a4}}&\ \!\begin{pmatrix}a & b \\ 0 & 1\end{pmatrix}.
\end{align*}
(This isomorphism probably depends on a choice of compatible primitive $2^n$-th roots of unity $\zeta_{2^n}$, in the sense that that $\zeta_{2^n}^{2^m} = \zeta_{2^{n-m}}$ for all $n \geq m \geq 0$. There is probably a version possible with $b \in \mathbf Z_2(1)$ if you don't want to make such a choice.)
Then the Galois closure $M$ of $\mathbf Q \to L$ is given by further adjoining $\sqrt[2^n]{2-i}$ for all $n$. This has infinite ramification index over the prime $(2-i) \subseteq \mathcal O_K$. Since $(2-i)$ is unramified in $L$, that means that $L \to M$ still has infinite ramification index over any prime above $(2-i)$. $\square$
Remark. The answer to 2 is positive, and in fact $\operatorname{Gal}(M/\mathbf Q)$ is a closed subgroup of $\operatorname{GL}_{d \cdot [K:\mathbf Q]}(\mathbf Z_p)$. Indeed, if $G = \operatorname{Gal}(\bar{\mathbf Q}/\mathbf Q)$ and $H = \operatorname{Gal}(\bar{\mathbf Q}/K)$, then $H \subseteq G$ is a finite index closed subgroup (i.e. open subgroup), and by assumption we have a map
$$\rho \colon H \to \operatorname{GL}_d(\mathbf Z_p)$$
whose kernel is $\operatorname{Gal}(\bar{\mathbf Q}/L)$. Viewing $\rho$ as a representation of $H$ on the module $A = \mathbf Z_p^d$ gives an induced representation (some authors call this the coinduced representation)
$$B := \operatorname{Ind}_G^H(A) = \left\{\phi \in \operatorname{Map}_{\text{cts}}(G,A)\ \big|\ \phi(hg) = h\phi(g) \text{ for all } g \in G, h \in H\right\},$$
where $g \in G$ acts on $\phi \colon G \to A$ via $(g\phi)(\sigma) = \phi(\sigma g)$. For $a \in A$ and $\sigma \in G$, note that the function $\phi_{a,\sigma} \colon G \to A$ given by
$$g \mapsto \begin{cases} (g\sigma^{-1})a, & g\sigma^{-1} \in H, \\ 0, & \text{else}. \end{cases}$$
is in $B$. Since $[G:H] = [K:\mathbf Q]$ is finite, we see that $B$ is again a finite free $\mathbf Z_p$-module. Write $\tau \colon G \to \operatorname{Aut}(B)$ for the corresponding group homomorphism. Here is a well-known lemma:
Lemma. Let $H \subseteq G$ be an open subgroup of a profinite group $G$, let $\rho \colon H \to \operatorname{Aut}(A)$ be a continuous representation on a (topologically) finitely generated profinite abelian group $A$, and let $\tau \colon G \to \operatorname{Aut}(B)$ be its induced representation. Then $\tau$ is continuous, and $\ker(\tau) = \bigcap_{\sigma \in G} \sigma\ker(\rho)\sigma^{-1}$.
Proof. For the second statement, write $U = \ker(\rho)$. Then $g \in \ker(\tau)$ means that for all $\phi \in \operatorname{Ind}_G^H(A)$ and all $\sigma \in G$, we have $\phi(\sigma g) = \phi(\sigma)$. Applying this to $\phi_{a,\sigma}$ for $a \in A \setminus \{0\}$ shows that $\sigma g \sigma^{-1}$ is in $H$ and fixes $a$. Running over all $a$ shows that $\sigma g \sigma^{-1} \in U$, so $g \in \bigcap_{\sigma \in G} \sigma U \sigma^{-1}$ since $\sigma \in G$ was arbitrary. Conversely, if $g \in \bigcap_{\sigma \in G} \sigma U \sigma^{-1}$ and $\sigma \in G$, then $g = \sigma^{-1}h\sigma$ for $h \in U$, so $\sigma g = h\sigma$, hence $\phi(\sigma g) = \phi(h \sigma) = h\phi(\sigma) = \phi(\sigma)$ for all $\phi \in \operatorname{Ind}_G^H(A)$. This proves the second claim.
For the first statement, note that the subgroups $\ker(\operatorname{Aut}(B) \twoheadrightarrow \operatorname{Aut}(B/nB))$ form a basis of open neighbourhoods of $1$ in $\operatorname{Aut}(B)$, so it suffices to show that $G_n := \ker(G \to \operatorname{Aut}(B/nB))$ is open for all $n \geq 1$. Since $\operatorname{Ind}_G^H(A/nA) = B/nB$, applying the first statement to $A/nA$ shows that
$$G_n = \bigcap_{\sigma \in G} \sigma H_n \sigma^{-1},$$
where $H_n = \ker(H \to \operatorname{Aut}(A/nA))$ is open in $H$ by assumption, hence open in $G$ as well. This intersection can be carried out over a (finite) set of coset representatives for $G/H$, so we conclude that $G_n$ is open. $\square$
Thus, the induced representation $\operatorname{Gal}(\bar{\mathbf Q}/\mathbf Q) \to \operatorname{Aut}(B) = \operatorname{GL}_{d \cdot [K:\mathbf Q]}(\mathbf Z_p)$ is a continuous homomorphism whose kernel corresponds to the Galois closure $\mathbf Q \to M$ of $\mathbf Q \to L$, hence gives a continuous injection
$$\operatorname{Gal}(M/\mathbf Q) \hookrightarrow \operatorname{GL}_m(\mathbf Z_p).$$
Such a map is automatically closed since everything is profinite, and $\operatorname{Gal}(M/L)$ is in turn a closed subgroup of $\operatorname{Gal}(M/\mathbf Q)$. $\square$


text:
Q: Project Euler Problem - 1 does not return the value I expected I did not learn loops using for yet, so I solved this problem using while but I can't find the issue with my problem, sum should be 233168 apparently, and I am getting 234168 I simply cannot identify where I missed it.
Question: If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.
package net.projecteuler;

public class Problem01 {
    public static void main(String[] args) {

        int n, sum;
        boolean notFinished = true;
        n = 0;
        sum = 0;

        while(notFinished) {
            if(n % 3 == 0 || n % 5 == 0) {
                sum = (sum + n);
            }
            n = (n + 1);
            if(n > 1000) {
                notFinished = !true;
            }
        }
        System.out.print("A soma dos números é " + sum);
    }
}

A: Your condition is wrong. The problem statement is (bolding for emphasis):

Find the sum of all the multiples of 3 or 5 below 1000.

Whereas your program also sums 1000 itself, which is divisible by 5. If you change the condition n > 1000 to n >= 1000, you'll get the correct answer.
Side note: You should really look into for loops. That would be a much better fit for this challenge.

A: Your condition is wrong. The while loop runs one too many times, because you are comparing n > 1000 instead of n >= 1000.
With that being said, you can also improve your loop. The boolean variable is not needed, as you can straight up check the condition in the while statement, like this - while (n < 1000).
In addition, if you are going to use your boolean variable, I would probably not set it to false by saying isFinished = !true, but by doing isFinished = false or isFinished = !isFinished.

A: Certainly your issue is with the if condition. It should be n >= 1000
Also you can simplify your algo like this. An alternative solution to your question.
public class Main {
    public static void main(String[] args) {
        System.out.println(sum(1000, 3, 5));
    }

    private static int sum(int i, int a, int b) {
        i = --i;
        int c = a * b;
        int k1 = i / a;
        int k2 = i / b;
        int k3 = i / c;

        return (k1 * (a + (k1 * a)))/2 + (k2 * (b + (k2 * b)))/2 - (k3 * (c + (k3 * c)))/2;
    }
}

Note this only works if a and b are prime numbers. If a and b are not prime, then c should be LCM of a and b
int c = lcm(a,b)


text:
Q: How do I query JIRA to find issue attributes at a specified date? I have to export reports listing some attributes of JIRA issues at a specified date.
So my query would be:
project = "XXX" AND fixVersion was "10.14.0.0" ON '2016-12-12 11:00'

And the result set would provide the status (mandatory) and other attributes (such as assignee) at the specified date.
For the moment, the result set provides me with the status at the current date, and not at the specified date.
How can I achieve that?
Any help really appreciated

A: It's not possible by default: JIRA always returns current/most recent values of the fields.
Though, there are workarounds:

*

*You can programmatically run JQL query, expanding changelog items. Analyzing each change, you can find out value of interested field for the given date. Here is an example.

*If you know some schedule of your reports (e.g. each Monday), you can configure cron job and periodically export issues for later processing.

Here are some related questions in Atlassian community:

*

*How do I get a snapshot of issues on a particular day using JQL (rest)?

*Snapshot of jira issues statuses on the specific date

*eazyBI - Snapshot of JIRA issues statuses on the specific dates


text:
Q: How to move project files of Android Studio from one computer to another. I have already published my app on google playstore and I want to update it I have switched to my new computer and I want to run my old android studio project. My app is already published on Playstore and I want to update it. Updating an app requires keys (Keystore.jks) file. How can I create a new version of my existing app on my new computer to update it?

A: Get the project started on the new machine (either manually copying or creating and cloning git repository).
Once you add it to the new machine. Just create the new APK referencing the new path for Keystore file (make sure you use the same Keystore from the old device, store in some location, and reference it in the local.properties file)

A: Do you copy all file of project in old computer to new computer? Or do you use git?
If you want upgrade app, you upgrade version of app in pubspec.yaml file, and change file key.properties in folder android, in this file, your input correct path to your keystore.jks in new computer.
And last, run flutter build appbundle


text:
Q: Not able to find the pages after running Node server on Ubuntu I am not able to get the pages even if my node server is also running.Please take a look on the below snap shot.

After running the server when i typed the ip address and port number i.e-8888 in browser's address bar the pages are not coming.It is showing the message This webpage is not available ERR_CONNECTION_RESET.Please help me to resolve this.

A: I guess you did not have the make tools available when you installed your mongodb library. I suggest you do
sudo apt-get install gcc make build-essential

and run
rm -rf node_modules
npm cache clean
npm install

OR just npm update
npm update

Edit 1
In the file node_modules/mongoose/node_modules/mongodb/node_modules/bson/ext/index.js, change the line
bson = require('../build/Release/bson');

to
bson = require('bson');

A: You never specified exactly which URL you're trying to access. It should be
http://127.0.0.1:8888

Note that there's a colon between the IP and the port, not a dash.
To confirm that the browser actually reaches the server check if there's any output in the console when you hit Enter after typing in the URL in the browser.


text:
Q: HTML IF IE 8 and lower and IF NOT IE 8 and lower Is my syntax correct below?
<!--[if lt IE 9]>
<script type="text/javascript" src="{"/js/photo_carousel_ie.js"}"></script>
<![endif]-->
<!--[if gte IE 9]>
<script type="text/javascript" src="{"/js/photo_carousel.js"}"></script>
<![endif]-->

What I am trying to do is, if IE 8 and lower user ie js file, if any other browser except IE 8 and lower, use the regular js file.

A: No, your script tags need to be valid html tags and having the curly braces are not valid.  Your code should look like this
<!--[if lt IE 9]>
<script type="text/javascript" src="/js/photo_carousel_ie.js"></script>
<![endif]-->
<!--[if gte IE 9]>
<script type="text/javascript" src="/js/photo_carousel.js"></script>
<![endif]-->

You can refer to this question/response for more information:
Need conditional statement to only load script if not IE8 or before and not mobile device

A: Only IE browsers read html comments. So to target other browsers, like Chrome and Firefox, you need to put your comments like below. This way, IE browsers will read the comments, but the code is readable by the other browsers.
<!--[if lt IE 9]>
    <script type="text/javascript" src="/js/photo_carousel_ie.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
    <script type="text/javascript" src="/js/photo_carousel.js"></script>
<!--<![endif]-->

A: <!--[if lt IE 9]>
  <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script>
  <script src="//s3.amazonaws.com/nwapi/nwmatcher/nwmatcher-1.2.5-min.js"></script>
  <script src="//html5base.googlecode.com/svn-history/r38/trunk/js/selectivizr-1.0.3b.js"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.1.0/respond.min.js"></script>
<![endif]-->


text:
Q: Seeding mongodb using node error nodejs, express, mongoose project
trying to seed the database
mongo acivated but I get the error when I run the following:
$ node product-seeder.js
(node:2810) UnhandledPromiseRejectionWarning: Error: Invalid schema, expected mongodb or mongodb+srv
at module.exports (/Users/MXD/Sites/adx/hosted/ShoppingCartwithNodeJSExpressAuthentic/shopping-cart/node_modules/mongodb/lib/url_parser.js:15:21)
at Promise (/Users/MXD/Sites/adx/hosted/ShoppingCartwithNodeJSExpressAuthentic/shopping-cart/node_modules/mongoose/lib/connection.js:330:5)
at new Promise (<anonymous>)
at NativeConnection.Connection.openUri (/Users/MXD/Sites/adx/hosted/ShoppingCartwithNodeJSExpressAuthentic/shopping-cart/node_modules/mongoose/lib/connection.js:329:17)
at Mongoose.connect (/Users/MXD/Sites/adx/hosted/ShoppingCartwithNodeJSExpressAuthentic/shopping-cart/node_modules/mongoose/lib/index.js:206:15)
at Object.<anonymous> (/Users/MXD/Sites/adx/hosted/ShoppingCartwithNodeJSExpressAuthentic/shopping-cart/seed/product-seeder.js:5:10)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
at Function.Module.runMain (module.js:701:10)
at startup (bootstrap_node.js:193:16)
at bootstrap_node.js:617:3

product-seeder.js
var Product = require('../models/product');

var mongoose = require('mongoose');

mongoose.connect('localhost:27017/shopping');

var products = [
    new Product({
      imagePath: 'images/black_tee_flagship_p_symbol_right_340x380.png',
      title: 'Black Tee White P',
      description: 'P on chest [white], symbols on sleeve',
      price: 28
    }),
    new Product({
      imagePath: 'images/white_tee_purple_eye_pocket_340x380.png',
      title: 'White Tee Purple Eye',
      description: 'Embroidered Purple Eye',
      price: 28
    }),
    new Product({
      imagePath: 'images/black_tee_gold_dual_p_center_340x380.png',
      title: 'Black Tee Gold 2Ps',
      description: 'Black Tee 2Ps on Chest [gold]',
      price: 28
    }),
    new Product({
      imagePath: 'images/white_tee_p_symbol_popular_text_340x380.png',
      title: 'White Tee Purple P',
      description: 'P Logo + POPULAR underneath',
      price: 28
    }),
    new Product({
      imagePath: 'images/black_tee_blue_dual_p_symbol_right_dual_p_left_340x380.png',
      title: 'Black Tee Blue 2Ps',
      description: '2Ps on chest, symbols + 2ps on sleeve',
      price: 28
    }),
    new Product({
      imagePath: 'images/white_tee_popular_blackboxed_center_340x380.png',
      title: 'White Tee POPULAR',
      description: 'POPULAR on chest [white on black]',
      price: 28
    })
];

var done = 0;

for (var i = 0; i < products.length; i++) {
    products[i].save(function(err, result) {
        done++;
        if (done === products.length) {
            exit();
        }
    });
}

function exit() {
    mongoose.disconnect();
}

A: Your connection string is in need of updating: It is missing a URL schema.
Your connection string needs to be this:
mongoose.connect('mongodb://localhost/shopping');

Since 27017 is the default port for MongoDB, you can leave it out.
More infos


text:
Q: multiple devise authentication realms in a rails application: which is the setting that allows for that? I've a simple rails application; it has a devise authentication mechanism. Then i've added activeadmin, that brings its devise based authentication mechanism.
There are other question and answers about merging the two models. This question is about which is the setting that makes the two authentication realms distinct.
Example. I perform login in the admin page:
localhost:3000/admin

Here the user model is AdminUser.
then i try to move to a regular (non active-admin) page:
localhost:3000/documents

Here the user model is User.
here, if I test the current_user variable, it is nil and not an instance of AdminUser. That is: the two authentication areas (i used the word realm but I don't know if it is correct) are kept distinct.
I've searched in the activeamdin initializer, but i couldn't find a setting that contains the information of creating a distinct 'authentication realm'.
Update 1 (and possible answer):
They are not distinct.
If i test the current_admin_user, it contains and AdminUser instance.

A: you have two models User and AdminUser associated with two separate DB tables, right?
do you have separate AA and User model routes inside routes.rb?
finally, you have to set devise settings for User < AR::Base model (AA user model already shipped with activeadmin gem)
in this case, authentications through User and AdminUser models will be separated according to routes you set giving you 'realms' you asked for..
or i didn't get the question...
current_admin_user helper gives you AdminUser instance
current_mega_super_user helper would give you MegaSuperUser instance (by default)


text:
Q: Exiting a Thread in Python I'm trying to write a program that crawls through a website and download all the videos it has. I'm facing a problem that the number of threads continuously increases even after the downloading of individual videos are done.
Here is the code for the individual Worker object, which is queued and then joined later. This is the only part of the code at which I generate a Thread. What I don't understand is how there can be remaining threads if given the object, I implement the self.stop() function and the while loop breaks.
class Worker(Thread):
def __init__(self, thread_pool):
    Thread.__init__(self)
    self.tasks = thread_pool.tasks
    self.tasks_info = thread_pool.tasks_info
    self.daemon = True
    self._is_running=True

    self.start()
def stop(self):
    self._is_running = False
def run(self):
    while self._is_running:
        func, args, kargs = self.tasks.get()
        try: func(*args, **kargs)
        except Exception:
            print("\nError: Threadpool error.")
            sys.exit(1)

        self.tasks_info['num_tasks_complete'] += 1
        self.tasks.task_done()
        self.stop()

I've used the thread functions to check which threads are alive, and it turns out that it is indeed mostly the worker functions as well as other objects called Thread(SockThread) and _MainThread, which I do not know how to close.
Please advise on 1. why the Worker thread is not ending and 2. how to get rid of the Thread(SockThread) as well as the _MainThread.
Thank you!
edit 1
class ThreadPool:
def __init__(self, name, num_threads, num_tasks):

    self.tasks = Queue(num_threads)

    self.num_threads=num_threads
    self.tasks_info = {
        'name': name,
        'num_tasks': num_tasks,
        'num_tasks_complete': 0
    }
    for _ in range(num_threads):
        Worker(self)
    print(threading.active_count)

def add_task(self, func, *args, **kwargs):
    self.tasks.put((func, args, kwargs))
def wait_completion(self):
    print("at the beginning of wait_completion:")
    print(threading.active_count())

A: By looking at your code it looks like you have initialized the thread which calls the run() method for processing. After that you're even using the start method which is not the proper way. Your code should be as follows:
from threading import Event
class Worker(Thread):
    def __init__(self, thread_pool):
       self.tasks = thread_pool.tasks
       self.tasks_info = thread_pool.tasks_info
       self.exit = Event()
       super(Thread,self).__init__()

   def shutdown(self):
       self.exit.set()

   def run(self):
       while not self.exit.is_set():
          func, args, kargs = self.tasks.get()
          try:
              func(*args, **kargs)
          except Exception:
              print("\nError: Threadpool error.")
              # use shutdown method for error
              self.shutdown()
              sys.exit(1)

          self.tasks_info['num_tasks_complete'] += 1
          self.tasks.task_done()
          self.shutdown()


text:
Q: Are all primes in a PAP-3? Van der Corput [1] proved that there are infinitely many arithmetic progressions of primes of length 3 (PAP-3).  (Green & Tao [2] famously extended this theorem to length $k$.)
But taking this in a different direction, are all odd primes in a PAP-3?  That is, for every prime $p>2$, is there a $k$ such that $p+k$ and $p+2k$ are prime?
Unsurprisingly, the first 100,000 primes have this property; the largest value of $k$ needed is just 1584 (see [4] and also [5] where this is greatly extended).  Heuristically, you'd expect a given prime to be in
$$\int_2^\infty\frac{a\ dx}{\log(x\log x)}=+\infty$$
different PAP-3s, and there are no small prime obstructions, so the conclusion seems reasonable.  On the other hand, it seems to involve Goldbach-like (or better, Sophie Germaine-like) additive patterns in the primes: in essence, we're looking for prime $q$, $2q-n$ for a fixed odd $n$, so I don't imagine this has been resolved.
Basically, I'm just looking for more information on this problem.  Surely it's been posed before, but does it have a common name and/or citation?  Have any partial results been proved?  Perhaps this is a consequence of a well-known conjecture?
[1] A. G. van der Corput (1939). "Über Summen von Primzahlen und Primzahlquadraten", Mathematische Annalen 116, pp. 1-50.
[2] Ben Green and Terence Tao (2008). "The primes contain arbitrarily long arithmetic progressions", Annals of Mathematics 167, pp. 481–547. http://arxiv.org/abs/math/0404188
[3] Amarnath Murthy, http://oeis.org/A084704
[4] Giovanni Teofilatto, http://oeis.org/A120627
[5] Charles R Greathouse IV, https://oeis.org/A190423

A: This question is extremely close to this one
Covering the primes by 3-term APs ?
though not exactly the same.
For much the same reasons as described in the answer given there, the answer to your question is almost certainly yes, but a proof is beyond current technology, exactly as you suggest. I'm not aware that the problem has a specific name.
To show that 3 belongs to a 3PAP is of course trivial: it belongs to 3,5,7 or 3,7,11. Showing that there are infinitely many such 3PAPs is, as you point out, a problem of the same level as difficulty as the Sophie Germain primes conjecture or the twin primes conjecture.
For a general p, I find it extremely unlikely that you could show that there is a k > 0 such that p + k, p + 2k are both prime without showing that there are infinitely many. Proving this for even one value of p would be a huge advance.
I think you could show that almost all primes p do have this property using the Hardy-Littlewood circle method.


text:
Q: How to achieve a custom layout with next page title shown half, indicating the user of next page as shown in android FIRST PAGE
[/IMG]
SECOND PAGE
[/IMG]
I want show my two pages like this, When loading first page the second page title should be shown indicating the user about a second page. How can I achieve this?, I can put  two tabs or viewpager with view pager indicator, i want that functionality but actually what I ask here is the view that is marked the image, the next tab to display half of its title indicating the user of next page.
Thanks in advance..

A: I strongly advise you to use a library, instead creating the widget yourself.
That said, this library suit your requirements. It's really easy to implement it:
PagerSlidingTabStrip tabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
tabs.setViewPager(yourViewPager);

You can found a complete implementation here

A: You can directly use ViewPager with PagerTabStrip provided in android support-v4 library.
 Download android Support-V4 library here
Then extract the android Support-V4 jar and paste into your project libs Folder.
Right click and Add to build path.
Now use View pager with PagerTabStrip in your Main layout as:
main.xml
<?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <android.support.v4.view.ViewPager
        android:id="@+id/viewpage"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/pagetab"
         >

        <android.support.v4.view.PagerTabStrip
        android:id="@+id/pagetab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="#333333"
        android:background="#ffffff"
        android:layout_gravity="top"/>

    </android.support.v4.view.ViewPager>

</RelativeLayout>

Now populate the ViewPager using Adapter in Main Class .see here
Now you can Achieve What you want.


text:
Q: Yii2. Вход и регистрация на одной странице На странице есть две кнопки: вход и регистрация. При нажатии по каждой выскакивает соответствующее модальное окно. Как в данной ситуации объединить две модели в одной view?

A: Так же как делали бы с одной, добавляете вторую модель, переименовываете и отвравляете на представление, к примеру вот так:
public function actionLogin()
{
    if (!\Yii::$app->user->isGuest) {
        return $this->goHome();
    }

    $loginModel = new LoginForm();
    $signupModel = new SignupForm();
    if ($loginModel->load(Yii::$app->request->post()) && $loginModel->login()) {
        //Ваша логика
        return $this->goBack();
    } else {
        return $this->render('login', [
            'loginModel' => $loginModel,
            'signupModel' => $signupModel
        ]);
    }
}

При самбите /login данные будут идти в этот же метод, при signup будет идти на метод signup, там ничего менять не надо, но это абстрактный пример, т.к. не вижу вашего кода могу предположить что он похож на стандартный.


text:
Q: Saving multiple pandas DataFrames to SQLite in a single transaction I am on working on an application that works with several dozen pandas DataFrames in memory and I am using SQLite as an application file format. Currently, I am essentially saving each DataFrame like this:
import pandas as pd
import sqlite3

df1 = pd.DataFrame(data=data1)
df2 = pd.DataFrame(data=data2)
df3 = pd.DataFrame(data=data3)

my_dfs = {
    "Table1": df1,
    "Table2": df2,
    "Table3": df3,
}
with sqlite3.connect("my_db.sqlite") as my_db:
    for table_name, df in my_dfs.items():
        df.to_sql(table_name, my_db, if_exists="replace")

However, for the several dozen DataFrames I have, this iterating-over-my-collection-of-tables-and-using-.to_sql() is getting REALLY slow.
I have just spent a half-hour doing various internet/SO searches for things like "bulk save pandas dataframe tables to sqlite" and "save list of dataframes to sqlite tables" but I am not seeing anything. Is there someway of doing this efficiently in a single transaction to my database?
Currently, it takes around 5-6 mins to save all my tables to the database! Yikes!
Thanks for any input people can offer.


text:
Q: Hyperlinks don't copy from Excel to Excel when using Data Connection I'm an end user who hosts a public Excel 2010 Workbook (without macros, so other users can feel safe) which contains all of the individual player stats for the Madden NFL Mobile game by EA Sports.
I've also created a non-public Macro-Enabled 2010 Workbook which I use to automate the extraction all of the relevant data from a 3rd party website and reparse all of that data into a spreadsheet layout I desire.
My first column of the Macro-Enabled Workbook contains the player's name with a hyperlink to that player's webpage on that 3rd party website, and the macro creates that hyperlink for me just fine.
When I use a Data Connection to automate the syncing of the data from the Macro Book to the Non-Macro Book, everything copies fine, except for the player's name which is only in plain text (no hyperlink).
I also tried to make that first column an excel hyperlink formula (instead of VBA's hyperlink function), but the formula won't transfer via the data connection either.
Is there something I can edit maybe inside of the Data Connection file (.odc) to accomplish my goal?
My only other workaround so far is to add 2 extra hidden columns containing the text link and player name, and then mucking around with the destination Table to make the first column a pre-defined excel HYPERLINK formula to convert the two columns back into a hyperlink.
Any ideas?

A: Nevermind, I decided to just use a powershell script and batch file to do all of my copy/pasting, and skipping the whole Data Connection thing all together.
My "TransferMaddenData.ps1" PowerShell Code:
    $path = "C:\Users\Grego\Desktop\MaddenData.xlsm"
    $Excel = New-Object -ComObject excel.application
    $Excel.visible = $false
    $Workbook = $Excel.Workbooks.open($path)
    $Worksheet = $Workbook.WorkSheets.item("DataOutput")
    $Rows = $Worksheet.UsedRange.Rows.Count
    $Rows += 1
    $Cells = "A3:BD" + $Rows
    $Worksheet.activate()
    $range = $WorkSheet.Range($Cells)
    $range.Copy() | out-null

    $path = "C:\Users\Grego\Desktop\Madden1.xlsm"
    $Workbook2 = $Excel.Workbooks.open($path)
    $Worksheet = $Workbook2.Worksheets.item("Raw Data")
    $range = $Worksheet.Range("A3")
    $Worksheet.Paste($range)

    $Workbook2.Save()
    $Workbook.Close()
    $Excel.Quit()
    Remove-Variable -Name excel
    [gc]::collect()
    [gc]::WaitForPendingFinalizers()

This is my "FixMadden.bat" batch file:
    @echo off
    color 1F
    echo.

    C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "C:\Users\Grego\Desktop\TransferMaddenData.ps1"

    :EOF
    echo Waiting seconds
    timeout /t 10 /nobreak > NUL

Hope this maybe helps someone else someday!


text:
Q: Do SQL Server updates happen one row at a time? I was just told that SQL Server updates are executed one row at a time. So if 100 rows were updated, a trigger would also be executed 100 times.
Is this accurate? Does this also mean that Inserted pseudo table only holds one row at a time?

A: No this is not correct.   If a single UPDATE affects multiple rows, a TRIGGER on that table would only fire once, and the virtual tables inserted and deleted would contain all the rows that were affected by the UPDATE.


text:
Q: Timepart Constraint Format? I have a field in my proc sql statement to extract the time from a datetime field.
timepart(submit_time) format time10. as time

This returns time perfectly as expected.
18AUG18:11:13:10 returns 11:13:10.
However I need to create a case statement and cannot determine how to format the value properly for the constraint. E.g. When comparing a date I would use > '18AUG2018'd. What would be the equivalent for a timepart?
attempting something like this
case when timepart(submit_time) format time10. > 10:00:00 then 1 else 0 end as time_flag

sas doesn't like the format in the case statement as well.

A: Use the letter T for TIME.
 case when timepart(submit_time) < '12:00't then 'MORNING'
      else 'AFTERNOON'  end as AM_PM

The value in the quotes needs to be something that the TIME informat can read.  Just like the quoted value for a date literal needs to work with the DATE informat.  Use suffix of DT for DATETIME.
 where submit_time >= '01JAN2021:00:00'dt


text:
Q: Not bind data after refresh the website in nopcommerce 4.3 I bind products data in nopcommerce customer form admin panel in dropdownlist. Now, first I add the product and after that open the customer form at that time product binds properly in dropdownlist, while again I add the product and then open the customer form at that time new product is not been shown in dropdownlist. If I want to see that newly product in dropdownlist then I want to restart the website.
Now by debug I analysis that after one time run the customer form that products data is coming from cache, so its not showing that newly product in dropdownlist. I also check that how nopcommerce bind vendor list in customer form, but in that if newly vendor is not added then vendor list is showing from cache while if any newly vendor add then at that time newly vendor is also showing in dropdownlist without restart the website.
For more clear, lets see the code
CustomerController
public virtual IActionResult Create()
{
    if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers))
        return AccessDeniedView();

    //prepare model
    var model = _customerModelFactory.PrepareCustomerModel(new CustomerModel(), null);

    return View(model);
}

CustomerModelFactory
public virtual CustomerModel PrepareCustomerModel(CustomerModel model, Customer customer, bool excludeProperties = false)
{
    ......

    //prepare available product

    _baseAdminModelFactory.PrepareProduct(model.AvailableProducts,
        defaultItemText: _localizationService.GetResource("Admin.Customers.Customers.Fields.Wastage.None"));

    return model;
}

BaseAdminModelFactory
public virtual void PrepareProduct(IList<SelectListItem> items, bool withSpecialDefaultItem = true, string defaultItemText = null)
{
    if (items == null)
        throw new ArgumentNullException(nameof(items));

    //prepare available products
    var availableProductItems = GetProductList();
    foreach (var productItem in availableProductItems)
    {
        items.Add(productItem);
    }

    //insert special item for the default value
    PrepareDefaultItem(items, withSpecialDefaultItem, defaultItemText);
}

ProductMasterService
public virtual IPagedList<ProductMaster> GetAllProduct(
            int pageIndex = 0, int pageSize = int.MaxValue)
{
    var query = _productMasterRepository.Table;

    query = from ct in query
            select ct;

    query = query.Distinct().OrderByDescending(a => a.Id);

    var product = new PagedList<ProductMaster>(query, pageIndex, pageSize);

    return product;
}

A: If you insert a new product using IProductService.InsertProduct(Product product) nopCommerce updates the collection cache, otherwise after inserting use IEventPublisher.EntityInserted(product). This method fires updating a cache by CacheEventConsumer


text:
Q: Fontawesome 6 throwing errors in Vue 3 I'm trying to upgrade from fontawesome 5 to 6 in my vue 3 project but when I try to load an icon, it throws these errors:
Vue warn]: Unhandled error during execution of render function
  at <FontAwesomeIcon class="icon" icon= Array(2) >
  at <Benefits>
  at <App>
warn @ app.js:29973
app.js:30153 Uncaught TypeError: Cannot read properties of undefined (reading 'icon')
    at Proxy.render (app.js:12923:26)
    at renderComponentRoot (app.js:23853:44)
    at ReactiveEffect.componentUpdateFn [as fn] (app.js:27701:57)
    at ReactiveEffect.run (app.js:22221:29)
    at setupRenderEffect (app.js:27827:9)
    at mountComponent (app.js:27610:9)
    at processComponent (app.js:27568:17)
    at patch (app.js:27169:21)
    at mountChildren (app.js:27356:13)
    at mountElement (app.js:27265:17)
app.js:29973 [Vue warn]: Unhandled error during execution of mounted hook
  at <SvgProgressLine>
  at <App>
warn @ app.js:29973
2app.js:35773 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'getTotalLength')
    at app.js:35773:29
    at callWithErrorHandling (app.js:30090:22)
    at callWithAsyncErrorHandling (app.js:30099:21)
    at Array.hook.__weh.hook.__weh (app.js:25359:29)
    at flushPostFlushCbs (app.js:30288:47)
    at flushJobs (app.js:30333:9)

I have followed the docs and installed these versions in packages.json:
"@fortawesome/fontawesome-svg-core": "^1.3.0-beta3",
"@fortawesome/free-brands-svg-icons": "^6.0.0-beta3",
"@fortawesome/free-regular-svg-icons": "^6.0.0-beta3",
"@fortawesome/free-solid-svg-icons": "^6.0.0-beta3",
"@fortawesome/vue-fontawesome": "^2.0.6",

They are imported in app.js like so:
import {library} from '@fortawesome/fontawesome-svg-core'
import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome'
import {faEnvelope, faCog, faGlobe, faServer, faKey, faSearch, faWrench, faCommentDollar, faHandsHelping, faChartBar, faExclamationTriangle, faLandmark, faUserCheck} from '@fortawesome/free-solid-svg-icons'

library.add(faEnvelope, faCog, faGlobe, faServer, faKey, faSearch, faWrench, faCommentDollar, faHandsHelping, faChartBar, faExclamationTriangle, faLandmark, faUserCheck);

createApp(app)
    .component('fa', FontAwesomeIcon)
    .use(VueSmoothScroll)
    .use(i18n)
    .mount("#app");

And displayed in the vue file like so:
<fa class="icon" :icon="[ 'fa', 'landmark' ]"></fa>

What am I doing wrong?

A: Looks like Vue 3 is not supported yet:
https://fontawesome.com/v6/docs/web/use-with/vue/troubleshoot#using-vue-3


text:
Q: Cannot bind to a specific IPv4 address when making outbound TCP connections, to hostnames that resolve to both IPv4 and IPv6 addresses I just spent about 6 hours trying to figure this out, and I now believe CentOS/Linux is unable to bind to a specific virtual IPv4 address when connecting to a hostname that has an IPv6 address.  This is a problem on servers that have multiple IP addresses.
I am using Centos 6 (Linux kernel 2.6.32-573.12.1.el6.x86_64)
To reproduce this big:

*

*Find a Linux machine with at least a /29 IPv4 public address space, and an IPv6 public IP.

*Alias at least one additional IPv4 to the main interface (eth0 or otherwise). For this example, I will say 30.0.0.1 as the machine's primary eth0 IPv4 address, and 30.0.0.2 is an alias bound to eth0:2 on a network of 30.0.0.0/29.

*Find a hostname that has both IPv4 and IPv6 addresses.  For example, www.microsoft.com.

*telnet -b 30.0.0.2 www.microsoft.com 80 (This tests making an outbound connection using a specific ipv4 address)

*The IPv4 request connects successfully after unsuccessfully trying the hostname's IPv6 addresses, but the TCP connection actually initiates from the machine's main IP (30.0.0.1), not the IP you want (30.0.0.2).  Netstat says otherwise, but it is WRONG.  If you connect to a hostname that you own and can view its logs, the connection comes from the main IP (30.0.0.1) not the IP you want (30.0.0.2).

*Try another domain that does not have an IPv6 address, like: telnet -b 30.0.0.2 serverfault.com. It works.  It makes the connection from the IP you want.

This is a problem, because certain programs, like mail (exim), need to use certain IPs when making outbound TCP requests, which is not necessarily the main machine's IP.  Certain clients/programs on the machine rely on ACLs or reverse DNS to match up correctly when making outbound TCP connections.
So if anyone else is noticing the same weird problem where their program cannot bind to the correct interface when making outgoing connections, this is probably why.
This problem only effects IPv4 connections.  IPv6 connections correctly bind to whatever outgoing IP you have on the machine.
This is not an issue with telnet.  I tested this problem using my mail server (exim) too, and got similar results.  It makes IPv4 connections from the wrong IP if the target hostname has an IPv6 address.
Maybe someone has a solution to this strange problem, but at this time, I think it may be a Linux networking bug.
Ps- If someone wonders why not just make an IPv6 connection if the hostname resolves to an IPv6 address...sometimes the IPv6 address is down or the connection cannot establish, then it reverts to its IPv4 address.

A: You can trust netstat to give you correct information about the IP addresses (at least as long as -n is used).
If the endpoints of a TCP connection disagree on which IP addresses are in use, it means there is a NAT somewhere between the two.
From the additional information provided in the comments we learned that in this particular case a superfluous iptables rule -A POSTROUTING -j MASQUERADE was the cause of the problem.


text:
Q: Comparison of AUCs if dichotomous variable differs Can the function roc.test only be used to compare ROC-curves in cases were the dependent (dichotomous) variable is the same for both ROC-Curves (roc1 and roc2) or can it also be used if there are two different dependent variables?
RocI <- roc(dat$I, dat$SIDI.F, ci = TRUE)
RocO <- roc(dat$O, dat$SIDI.F, ci = TRUE)

roc.test(RocI, RocO, method=c("bootstrap"), alternative = c("greater"),
         paired=NULL, reuse.auc=T, boot.n=2000, boot.stratified=TRUE,
         parallel=FALSE, conf.level=0.95)

This is how the data looks like:
   ID I A SIDI.F
1   1 0 0     50
2   2 1 1     13
3   3 1 1     13
4   4 0 0     12
5   5 0 0     13
6   6 0 0     15
7   7 0 0     23
8   8 0 0     34

A: From the roc.test documentation:

This function compares two correlated (or paired) or uncorrelated (unpaired) ROC curves.

So yes, you can use this function if your ROC curves are built from different variables.
Make sure to set paired=FALSE explicitly, just to be sure to use the unpaired tests (although this would likely be detected correctly if you set it to NULL as you did).


text:
Q: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1598] Cannot dlopen some GPU libraries How should I fix this in CentOS 7?
[jalal@goku ~]$ pip freeze | grep tensorflow
tensorflow-estimator==2.2.0
tensorflow-gpu==2.2.0
[jalal@goku ~]$ python
Python 3.8.5 (default, Mar 31 2021, 02:37:07)
[GCC 7.3.1 20180303 (Red Hat 7.3.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))
2021-06-07 23:50:07.811271: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2021-06-07 23:50:07.867796: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties:
pciBusID: 0000:05:00.0 name: GeForce GTX 1080 Ti computeCapability: 6.1
coreClock: 1.6705GHz coreCount: 28 deviceMemorySize: 10.92GiB deviceMemoryBandwidth: 451.17GiB/s
2021-06-07 23:50:07.869403: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 1 with properties:
pciBusID: 0000:06:00.0 name: GeForce GTX 1080 Ti computeCapability: 6.1
coreClock: 1.6705GHz coreCount: 28 deviceMemorySize: 10.92GiB deviceMemoryBandwidth: 451.17GiB/s
2021-06-07 23:50:07.870136: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcudart.so.10.1'; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-10.0/lib64:
2021-06-07 23:50:07.874249: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10
2021-06-07 23:50:07.877819: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10
2021-06-07 23:50:07.878745: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10
2021-06-07 23:50:07.882687: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10
2021-06-07 23:50:07.884788: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10
2021-06-07 23:50:07.890952: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7
2021-06-07 23:50:07.891011: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1598] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
Num GPUs Available:  0

This is despite having two GPUs:

[jalal@goku ~]$ lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.9.2009 (Core)
Release:    7.9.2009
Codename:   Core

also,
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130

I tried the following as suggested by https://github.com/tensorflow/tensorflow/issues/38194#issuecomment-629801937 and didn't work:
[jalal@goku djrn]$ ls /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudart.so.10.2
lrwxrwxrwx. 1 root root 20 Sep 21  2020 /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudart.so.10.2 -> libcudart.so.10.2.89
[jalal@goku djrn]$ sudo ln -s /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudart.so.10.2 /usr/lib/x86_64-linux-gnu/libcudart.so.10.1
[sudo] password for jalal:
ln: failed to create symbolic link '/usr/lib/x86_64-linux-gnu/libcudart.so.10.1': No such file or directory

since:
ls: cannot access /usr/lib/x86_64-linux-gnu: No such file or directory

To be specific, I need tensforflow to work with CUDA 10.2, I am fine with any version of tensorflow (preference is tensorflow 2+), however couldn't find a version that works with CUDA 10.2. https://www.tensorflow.org/install/source#tested_build_configurations
Also, based on this, my CUDA version is 10.2 which is different from both nvidia-smi and nvcc --version versions:
$ stat /usr/local/cuda
  File: '/usr/local/cuda' -> '/usr/local/cuda-10.2'
  Size: 20          Blocks: 0          IO Block: 4096   symbolic link
Device: fd00h/64768d    Inode: 67157410    Links: 1
Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
Context: unconfined_u:object_r:usr_t:s0
Access: 2021-05-20 10:43:06.864530636 -0400
Modify: 2020-09-21 09:39:18.559883390 -0400
Change: 2020-09-21 09:39:18.559883390 -0400
 Birth: -

P.S.: I have made my virtual environment using python venv command and don't want to use conda or pyenv.
P.P.S.: I did this soft link and still doesn't work:
(djrn) [jalal@goku djrn]$ sudo ln -s /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudart.so.10.2 /usr/lib/libcudart.so.10.1
[sudo] password for jalal:
(djrn) [jalal@goku djrn]$ ls /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudart.so.10.2
lrwxrwxrwx. 1 root root 20 Sep 21  2020 /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudart.so.10.2 -> libcudart.so.10.2.89
(djrn) [jalal@goku djrn]$ python
Python 3.8.5 (default, Mar 31 2021, 02:37:07)
[GCC 7.3.1 20180303 (Red Hat 7.3.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))
2021-06-08 01:40:39.152040: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2021-06-08 01:40:39.401399: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties:
pciBusID: 0000:05:00.0 name: GeForce GTX 1080 Ti computeCapability: 6.1
coreClock: 1.6705GHz coreCount: 28 deviceMemorySize: 10.92GiB deviceMemoryBandwidth: 451.17GiB/s
2021-06-08 01:40:39.403106: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 1 with properties:
pciBusID: 0000:06:00.0 name: GeForce GTX 1080 Ti computeCapability: 6.1
coreClock: 1.6705GHz coreCount: 28 deviceMemorySize: 10.92GiB deviceMemoryBandwidth: 451.17GiB/s
2021-06-08 01:40:39.403438: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcudart.so.10.1'; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-10.0/lib64:
2021-06-08 01:40:39.406985: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10
2021-06-08 01:40:39.410320: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10
2021-06-08 01:40:39.410912: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10
2021-06-08 01:40:39.414628: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10
2021-06-08 01:40:39.416297: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10
2021-06-08 01:40:39.422208: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7
2021-06-08 01:40:39.422260: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1598] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
Num GPUs Available:  0
>>>

A: Credits to jonno_FTW
$ sudo ln -s /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudart.so.10.2 /usr/lib/x86_64-linux-gnu/libcudart.so.10.1
$ export LD_LIBRARY_PATH=/usr/lib

solved the problem. Now I see the following as output:
(djrn) [jalal@goku djrn]$ python
Python 3.8.5 (default, Mar 31 2021, 02:37:07)
[GCC 7.3.1 20180303 (Red Hat 7.3.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))
2021-06-08 01:45:59.138197: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2021-06-08 01:45:59.191833: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties:
pciBusID: 0000:05:00.0 name: GeForce GTX 1080 Ti computeCapability: 6.1
coreClock: 1.6705GHz coreCount: 28 deviceMemorySize: 10.92GiB deviceMemoryBandwidth: 451.17GiB/s
2021-06-08 01:45:59.193773: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 1 with properties:
pciBusID: 0000:06:00.0 name: GeForce GTX 1080 Ti computeCapability: 6.1
coreClock: 1.6705GHz coreCount: 28 deviceMemorySize: 10.92GiB deviceMemoryBandwidth: 451.17GiB/s
2021-06-08 01:45:59.194216: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1
2021-06-08 01:45:59.197372: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10
2021-06-08 01:45:59.200555: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10
2021-06-08 01:45:59.201078: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10
2021-06-08 01:45:59.204664: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10
2021-06-08 01:45:59.206295: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10
2021-06-08 01:45:59.212072: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7
2021-06-08 01:45:59.217509: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0, 1
Num GPUs Available:  2


text:
Q: Summing values based on matching another column I have the following setup: Rank names in column A and Rank values in column C (some data in between).
Based on min and max rank I need to find the average value (I2 on the image).
My best attempt is in I3 but I have a feeling that this can be done in a nicer way.

Any help would be much appreciated.

A: You can use XLOOKUP to return the values for both of the ranks, then average the result array. Like this:
=AVERAGE(XLOOKUP($F$2:$G$2,$A$2:$A$6,$C$2:$C$6))

Adjust your ranges appropriately.

A: If you do not have Microsoft 365 Apps, you could try =AVERAGE(VLOOKUP($F2:$G2,$A$2:$C$6,3,FALSE)) formula.

The Averageif or Averageifs functions seem not be suitable.


text:
Q: Reference for solving linear operator equations I'm interested in solving an equation of the form
$$ Ax = b $$
for some bounded linear operator $A: H_1 \mapsto H_2$ where $H_1, H_2$ are some Hilbert spaces.
I've seen in this math.SE post in particular, the claim that

the solution set should always be the kernel plus a particular solution.

Where does this claim come from?
I am also interested to learn in general about how operators in Hilbert spaces are introduced. Is any book on functional analysis good for this purpose?

A: Let's prove it. Suppose $k$ is in the kernel of $A$ and $x_0$ is a specific solution, so that $Ax_0=b$. We have
$$A(x_0+k)=Ax_0+Ak=Ax_0=b.$$
Conversely, suppose that $x_0$ and $y_0$ are two solutions. Then
$$A(x_0-y_0)=0$$
implying that $x_0-y_0=:k$ is in the kernel. Therefore any two solutions differ by an element of the kernel.


text:
Q: In page anchors with spaces in the title I have a page with some
 tags. Notice that the name attribute has a space in it. I want to use an anchor so that I can jump to the heading. I thought that if I added %20 to replace the spaces it would work, but no.
I am currently swamped, so would prefer not to edit the source and redeploy with each header having an ID or title with hyphens instead of spaces.

Foo

I read through the spec here, but couldn't find an answer. I also could not find an answer via Google or SO.
http://www.w3.org/TR/html4/struct/links.html
Is there a way to do this?

A: That's not how anchor tags work.  You can jump to a name of an anchor tag, or an id of any element.  You can never jump to a title attribute, unfortunately.  You would need to modify the html, which you don't want to do, or include javascript to accomplish what you are asking.
Edit: Standards have always said id attributes cannot include spaces, including HTML5, which says this:

HTML5 gets rid of the additional restrictions on the id attribute. The
  only requirements left — apart from being unique in the document — are
  that the value must contain at least one character (can't be empty),
  and that it can't contain any space characters.

A: Here's the W3C spec https://www.w3.org/TR/REC-html40-971218/types.html#h-6.2

ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

No spaces.

A: Anchors point to name or id attributes. It won't find your title attribute.
Use
 and it should work, but ideally you shouldn't have spaces there.

A: The destination anchor should be defined by an id attribute, and it must not contain a space. (HTML5 removes all other constraints but disallows a space and an empty value. Older HTML versions are much more restrictive.) So:

Foo

Alternatively, you could use an a element with name attribute, but this is clumsy and outdated (and forbidden in HTML5, though it still works, properly used):

Foo

You can use the name attribute on a few elements only, not e.g. in h1, and only in a elements does it have the meaning of acting as a destination anchor.
The title attribute can be used on any element (at least as per HTML5), but it is merely an advisory title and has nothing to do with linking.
The construct  denotes an empty a element, a usability nightmare, and does not actually work (it is taken just as a start tag of an element), except in XHTML when served with an XML document type, which you are most probably not doing. So just don't use the "self-closing" syntax except for elements with empty declared content, if at all.

A: There /is/ a way to have an anchor with a space in its name without violating the HTML specification. Use . The specification makes it clear that you can use percent-encoding when using  with the name attribute. However, when using id, you should not percent-encode the attribute, and since spaces are disallowed in the id attribute, the only option is to use  instead.
More information: https://blog.markasoftware.com/post/spaces-in-anchor-names/


text:
Q: Getting error In python3 scapy Module .... Packet Sniffer I'm building a sniffing tool using python-3.7 and I got that error when I was trying to use the scapy_http module.
It works fine in python-2.x. The object type is packet[scapy.Raw].load
Code:
#!usr/bin/env python
import scapy.all as scapy
from scapy.layers import http

def sniff(interface):
    scapy.sniff(iface=interface, store=False, prn=process_sniffed_packet)
    #store=Flase(does not store the output in memory)
    #prn= call another  function after one packet or any data is sniffed is sniffed

def process_sniffed_packet(packet):
    if packet.haslayer(http.HTTPRequest):
        if packet.haslayer(scapy.Raw):
            load = packet[scapy.Raw].load
            if "username" in load:
                print(load)
sniff("eth0")

ERROR:
 File "packet_sniffer.py", line 16, in <module>
    sniff("eth0")
  File "packet_sniffer.py", line 6, in sniff
    scapy.sniff(iface=interface, store=False, prn=process_sniffed_packet)
  File "/usr/local/lib/python3.8/site-packages/scapy/sendrecv.py", line 1036, in sniff
    sniffer._run(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/scapy/sendrecv.py", line 989, in _run
    session.on_packet_received(p)
  File "/usr/local/lib/python3.8/site-packages/scapy/sessions.py", line 82, in on_packet_received
    result = self.prn(pkt)
  File "packet_sniffer.py", line 14, in process_sniffed_packet
    if "username" in load:
****TypeError: a bytes-like object is required, not 'str'****

A: packet[scapy.Raw].load uses load from the scapy.packet.Raw class. You are asking python to determine if a string is inside of a bytes object, which is a type error as it says. It's easy to replicate this error:
>>> if "word" in b"word":
...     pass
...
Traceback (most recent call last):
  File "<console>", line 1, in <module>
TypeError: a bytes-like object is required, not 'str'

Try using if "username" in str(load): or if b"username" in load: on line 14 instead so there isn't a type mismatch.

Note: Class hierarchies are confused because of your use of import scapy.all as scapy, so scapy.Raw is the same as scapy.Packet.Raw in your snippet.


text:
Q: to prove infinity norm is indeed norm to prove infinity norm of a function which is equal to supremum of absolute value of that function, is indeed a norm.
I have a clue to check for the three axioms of norm.
but tell me hoe to proceed

A: $1$: $\|f\|_\infty=0\iff f(x)=0$
$$
\begin{align}
\sup_x|f(x)|=0
&\implies0\le|f(x)|\le0\\
&\implies f(x)=0
\end{align}
$$
The other direction is self-explanatory.
$2$: $\|af\|_\infty=|a|\|f\|_\infty$
$$
\begin{align}
\|af\|_\infty
&=\sup_x|af(x)|\\
&=|a|\sup_x|f(x)|\\
&=|a|\|f\|_\infty
\end{align}
$$
$3$: $\|f+g\|_\infty\le\|f\|_\infty+\|g\|_\infty$
$$
\begin{align}
\|f+g\|_\infty
&=\sup_{\substack{x,y\\x=y}}|f(x)+g(y)|\\
&\le\sup_{\substack{x,y\\x=y}}|f(x)|+|g(y)|\\
&\le\sup_{x,y}|f(x)|+|g(y)|\\
&=\|f\|_\infty+\|g\|_\infty
\end{align}
$$


text:
Q: Cakephp 2.3.9 custom message in model validation not working I am doing model validation in my admin panel login so there is only two fields username and password. Validation is working but custom message which I have written in my model is not shown.
Model
public $validate = array(
    'username' => array(
        'required' => array(
            'rule' => array('notEmpty'),
            'message' => 'Please Enter Your Username'
        )
    ),
    'password' => array(
        'required' => array(
            'rule' => array ('notEmpty'),
            'message' => 'Please Enter Your Password'
        )
    )
);

Controller
function login(){
    $this->layout = 'admin_login';

    if ($this->request->is('post')) {
        if ($this->Auth->login()) {
            return $this->redirect($this->Auth->redirect());
        }
        $this->Session->setFlash(__('Invalid username or password, try again'));
    }
}

View
echo $this->Form->create('Admin',array('autocomplete'=>"off"));

echo '
';
echo $this->Form->input('username' , array('label' => '', 'placeholder' =>'Enter your username','div' => false));
echo $this->Form->input('password' , array('label' => '', 'value' =>'', 'div' => false,'placeholder'=>'Enter Your Password'));
echo '
';
echo '
';

echo $this->Form->end(__('Login' ,true));

I have already tried a few things like which is mentioned in this link, but it's not working for me.
CakePHP : Validation message not displaying

A: That looks like a message from the browser and not CakePHP.
CakePHP now adds a required attribute which modern browsers can use to trigger an error.
You can do one of three things here:
One: Set up your form to leave validation to the server:
 $this->Form->create(array('novalidate'=>true));

Two: Set a custom validation message in the browser: http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#dom-cva-setcustomvalidity
Three: tolerate it

A: You get that message because the "username" field is flagged as "required". Maybe you've not defined it in the Form->input() function, but the "required" flag has been automatically added from the Model (due to your validation rules). As timstermatic said, it's a browser validation message caused by the required attribute.
To solve this issue (and show the CakePHP validation message) you've to force for avoiding the addition of the "required" flag on your field:
$this->Form->input('username', array('required' => FALSE));

This will override the Model automatic additions. Happy coding ;)
*Edited => It's important to clarify that the inline override removes only the required flag on the field: you'll take advantage of the Model validation anyway (just because if an empty field is sent to the server, it will not pass the validation rule you entered.

A: keep this code it will bypass the html5 validation and add your custom validations
view
echo $this->form->create('Post',array('action'=>'add'));
echo $this->form->input('title');
echo $this->form->input('body');
echo $this->form->submit('Save Post',array('formnovalidate'=>true));
echo $this->form->end();//Creates ending form tag
Model
var $validate=array(
'title'=>array(
'title_must_not_be_empty'=>array('rule'=>'notEmpty','message'=>'Please enter a title),
'title_must_be_unique'=>array('rule'=>'isUnique','message'=>'Title name already exists')
),
'body'=>array(
'body_must_not_be_empty'=>array(
'rule'=>'notEmpty',
'message'=>'Please enter body'
)
)
);
This will work just the way you want


text:
Q: Filtering using LINQ.Dynamic over Null properties throw an exception I am using Linq.Dynamic, I have a List of Tier(string Matricule,string Nom..) although some Tiers have no Matricule, but when run the LINQ where over the Matricule property, System.NullReferenceException: Object reference not set to an instance of an object is throwed?
here is the detail of the code:
public class Tier
{
    public string Matricule{get;set;}
    public string Nom{get;set;}
    public string Prenom{get;set;}
}

public class FilterByPredicate
    {
        public BindingList<T> Filter(string propName,string propValue,bool fromFirst)
            {

                var predicateString = fromFirst
                                ? "{0}.ToString().ToUpper().StartsWith(@{1})"
                                : "{0}ToString().ToUpper().Contains(@{1})";

                return new BindingList<T>(_list.Where(string.Format(predicateString, propName, 0), propValue.ToUpper()).ToList());
            }

     }

in other part of my code i call..
    FilterByPredicate fbp = new FilterByPredicate(costumersList>);
    textBox1_Changed+=
    {
       tiersBindingSource.DataSource =fbp .Filter("Matricule", textBox1.Text,true);// exception throwed

//but this work fine-> var q = from c in costumersList where c.Matricule.ToUpper().StartsWith(textBox1.Text) select c;
    };

A: I have found the solution after read the docs, corresponding to "Get started" page, simply compare to null like that:
 public BindingList<T> Filter(string propName,string propValue,bool fromFirst)
            {

                var predicateString = fromFirst
                                ? "{0} != null and {0}.ToString().ToUpper().StartsWith(@{1})"
                                : "{0} != null and {0}.ToString().ToUpper().Contains(@{1})";

                return new BindingList<T>(_list.Where(string.Format(predicateString, propName, 0), propValue.ToUpper()).ToList());
            }