Mic not working properly

I have a samsung notebook 3 with Ubuntu 20 running in it I actually use zoom but from past 2 days iam facing this problem where if I unmute myself and say something my voice is so meek that the receiver can’t even get what iam saying I reinstalled zoom I restarted the machine but it’s the same somebody please help even the earphones iam using I plug them and find the same issue with mic

8 – Multisite doesn’t properly work

I tried to install a second site on a multi-site installation, following the instructions on Set up a multisite.

I am using WAMP Stack. The steps I have followed are the following.

  • I installed Drupal Core 8.9.x
  • I configured the directory alias on the Apache server
  • I renamed /sites/exmaple.sites.php to sites.php and added the $sites['localhost.sa'] = 'localhost.sa'; line
  • I copied the example.setting.php file from /site/default to the directory for the second site

The installation of the second site has been successful. The front page loads, but any link redirects to the main site, not the second site.

The Apache virtual host configuration file contains the following lines.

<VirtualHost *:80>

  ServerName localhost

  ServerAlias localhost

  DocumentRoot "${INSTALL_DIR}/www"
  <Directory "${INSTALL_DIR}/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>

The Apache directory alias is defined as follows.

Alias /sa "C:wamp64wwwdrupal8portal/"

<Directory "C:wamp64wwwdrupal8portal/">
    Options Indexes FollowSymLinks MultiViews
  AllowOverride all
  <ifDefine APACHE24>
        Require local
    </ifDefine>
    <ifDefine !APACHE24>
        Order Deny,Allow
    Deny from all
    Allow from localhost ::1 127.0.0.1
    </ifDefine>
</Directory>

plotting – Exported plot range of PNG not displayed properly

   I am tring to export the plotted graphics as PNG, but it's range is not coming properly:

   px = Plot[Sin[x], {x, -15, 15}, Frame -> True, 
  ImagePadding -> {{30, 15}, {0, 10}}, ImageSize -> 300, 
  FrameStyle -> Thickness[.003], 
  FrameTicksStyle -> 
  Directive[Black, FontSize -> Scaled[.015], Thickness[.003]], 
  FrameTicks -> linearFrameTicks, PlotRange -> {{-10, 10}, All}];
    py = Plot[Sin[2 x], {x, -15, 15}, Frame -> True, 
    ImagePadding -> {{30, 15}, {20, 0}}, ImageSize -> 300, 
    FrameStyle -> Thickness[.003], 
    FrameTicksStyle -> 
   Directive[Black, FontSize -> Scaled[.015], Thickness[.003]], 
    FrameTicks -> linearFrameTicks, PlotRange -> {{-10, 10}, All}];
     pz = Column[{px, py}, Spacings -> 0]
   Export["pz.png", 
     Import[Export["pz.pdf", pz, ImageSize -> 290, 
     ImageResolution -> 1000]], ImageResolution -> 1000];
     SystemOpen["pz.png"]
          [![plot][1]][1]


            [1]: https://i.stack.imgur.com/QE2XA.png

sharepoint server – Creating a new document in a Modern library doesn’t work properly

I was hoping someone could point me in the right direction on a strange problem. In our SharePoint 2019 system we recently installed when you go to a library and click New Document and select a content type with an associated Word template we named “Blank Document”, Word is not launched. Instead a new item called “Document” is automatically created in the Modern library called “Document” but with no extension. When you open the “document” you see what looks like binary but there is a enough readable text to indicate that it is the “blank Document” template. After downloading the item and adding .the docx extension I was able to confirm that it was indeed the “blank document” template.

Here’s the funny part if in the library you switch to Classic mode, everything works fine. So I was wondering whether Modern actually supports the ability to create a document from a template. If does support it what issue could be stopping if from working given it works in Classic? I should point out the above behavior described above is not localized to one just library but happens in every library in our system.

android tv – Pagination is not working properly inside TV app

I added pagination for TV app, but every time new page added, list is not starting where it was but it is starting from beginning with new page elements which is ok. how can i resume list where it was and add new page elements without reloading from beginning?

Here is my adapter:

    private var items = mutableListOf<MovieData>()

    override fun isImmediateNotifySupported(): Boolean = true

    override fun size(): Int = items.size

    override fun get(position: Int): Any = items(position)
    
    fun addAll(data: List<MovieData>) {
        items = data.toMutableList()
        notifyChanged()
    }

    fun loadItems(data: List<MovieData>) {
        items.addAll(data)
        notifyChanged()
    }
}

Here is my presenter


    override fun onCreateViewHolder(parent: ViewGroup?): ViewHolder {
        val videoClubCardView = VideoClubCardView(context)

        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)
            videoClubCardView.background.alpha = 0
        else
            videoClubCardView.setBackgroundColor(Color.TRANSPARENT)

        videoClubCardView.isFocusable = true
        videoClubCardView.isFocusableInTouchMode = true

        return ViewHolder(videoClubCardView)
    }

    override fun onBindViewHolder(viewHolder: Presenter.ViewHolder?, item: Any?) {
        if (item is MovieData)
            (viewHolder as ViewHolder).videoClubCardView.setObject(item)
    }

    override fun onUnbindViewHolder(viewHolder: Presenter.ViewHolder?) {
    }

    inner class ViewHolder(val videoClubCardView: VideoClubCardView) : Presenter.ViewHolder(videoClubCardView)
}

Here is pagination

            OnChildViewHolderSelectedListener() {
            override fun onChildViewHolderSelected(
                parent: RecyclerView,
                child: RecyclerView.ViewHolder,
                position: Int,
                subposition: Int
            ) {
                super.onChildViewHolderSelected(parent, child, position, subposition)
                if (position != RecyclerView.NO_POSITION) {
                    parent.layoutManager?.let { layoutManager ->
                        if (position > layoutManager.itemCount - 1 - THRESHOLD && loading) {
                            counter++
                            loading = false
                            videoClubVM.loadMovieList(
                                2,
                                "0",
                                1,
                                "0",
                                "0",
                                "0",
                                "-1",
                                "-1",
                                "-1",
                                "-1",
                                "-1",
                                18,
                                counter,
                                "0",
                                "0",
                                "",
                                "0"
                            )
                        }
                    }
                }
            }
        })

videoClubVM.movieList.observe(this, {
            if (it.movies!!.isNotEmpty() && it.movies != null) {
                loadMovies(it.movies!!)
                loading = true
            }
        })

private fun loadMovies(list: List<MovieData>) {
        if (adapter.size() == 0) {
            adapter.addAll(list)
        } else adapter.loadItems(list)
        index = adapter.size()
        gridViewPresenter.onBindViewHolder(gridViewHolder, adapter)
    }

I have seen some related issues but none of them worked properly for my app

architecture – Properly testing UI presenters without duplicating tests of subcomponents

I am writing the embedded firmware for an effect pedal. The pedal’s ui consists of a few knobs
a few buttons and a few leds and it consists of various control modes each corresponding to a seperate effect. So each mode changes the meaning of the knobs, the buttons and led indications.

This is implemented as a sum type of “presenters”. Each presenter is injected with the corresponding effect model and the buttons + leds drivers. Each presenter has it’s own set of shortcuts and button controls. Each presenter owns the corresponding view and event emitter.

I am trying to figure out how to write integration tests for these presenters. What I currently do is pinpoint the high – level button events required for each presenter. Then define a state machine using the high-level events and define the appropriate model/view interactions for each transition. Then I use model-based testing to test that the implemented state machine properly calls everything.

I independently test the high-level event emitter which produces the events for the state machine.

I find this helps a lot with properly testing the interactions since writing the model-based tests for the state machine using high-level events is much more expressive than using the buttons driver directly.

So as a summary each presenter basically just delegates to the event emitter and passes the events from the event emitter to the state machine (called controller in the code) which controls the model and view.

A final presenter may look like this:

    void delay_presenter::update()
    {
        button_event_emitter_.poll();

        bool exit_event = button_event_emitter_.test_and_clear_exit_event();
        bool tap_event = button_event_emitter_.test_and_clear_tap_button_event();
        std::optional<button_event> enable_event = button_event_emitter_.test_and_clear_enable_button_event();

        bool alternative_modified = alternative_modifed_event_emitter_.poll();

        if (exit_event)
            controller_.handle_exit_event();

        if (tap_event)
            controller_.handle_tap_button_event();

        if (enable_event)
            controller_.handle_enable_button_event(*enable_event);

        if (alternative_modified)
            controller_.handle_alternative_modified_event();

        controller_.handle_switch_position(gpios_.switch_position());

        model_.set_inputs(inputs_);

        view_.update();
    }

I am in conflict in how to properly test these presenters without duplicating the test suit of the underlying controller objects but in a more verbose way. It seems that if I don’t want to couple the presenter’s tests to the underlying implementation, I will have to basically merge the event emitters’ and controller’s test suits together which makes the model-based testing much more verbose and complex. In fact it’s often the case that I would have to use the event emitter object itself in the test suit too.

I think this leads to a more general problem on how one should test a component that basically just wires together other subcomponents that are heavily tested themselves and were built in a bottom-up approach.

One solution is to just make sure that the component wires the subcomponents together properly. In that case I would have to mock the controller and event emitters and make sure calls are delegate as appropriate. This would be the Mockist-approach to this problem. I can’t think of any way of doing it without basically duplicating the actual code and making a very fragile test that will break with any future refactoring of the presenter. Maybe this is a good thing in this case since any change to the emitter + controller architecture would probably need a redesign of the test themselves anyway.

Another is to perhaps just write a few sanity check tests with a limited number of user scenarios. This won’t be a complete test as it is with the model-based approach used on the controller state-machine object. I can’t see this helping much in the case of a larger refactoring.

Going further how should one implement the final end-to-end test that actually checks all presenters? It seems one would have to either just check a very limited subset of use cases or do intrusive mock-based tests checking presenter destruction and creation.

Any thoughts?

plotting – How to properly write multiline text with LaTeX symbol in a frame and with background

I wanted to include a number of text-box with background color white inside a plot. The text inside the box will also have LaTex expressions as well as multiple lines.

Is there any way to include multiline text (including LaTeX symbol) inside a plot?

In addition I want to set frame and background color for the box.
I am currently using Epilog and Prolog to include such text.

  ListLinePlot(
  Table({k, 
  PDF(BinomialDistribution(50, p), k)}, {p, {0.3, 0.5, 0.8}}, {k, 0,50}), 
  Filling -> Axis, 
  FillingStyle -> Automatic,
  (**Option-1**)
  Epilog -> Text(Style(ToExpression("\text{E}_{x} \n text2", TeXForm, HoldForm),Bold),{30, 0.13}),
  (**Option-2**)
  Prolog -> {Inset(Framed( "E_{x}ntext2" , RoundingRadius -> 5,Background -> White), {45, 0.13})}
  (**Option-3**)
(*Prolog -> {Inset(Framed( MaTeX("E_{x}\n text2" ) , RoundingRadius -> 5,Background ->White),{45,0.13})}*)
   )

Option-1 fails writing E_{x} as well as breaking line.
Option-2 fails writing E_{x} but breaks line.
Option-3 is the one I wanted but it fails in breaking line.

Is there any way to achieve this.

Moreover I also wanted to ask, what should one do if one has to include say more that two text boxes?

How to properly focus using a Macro reverse ring?

Fourth question from me about this topic.

I’m trying to digitize a large number of family slide films with a modified slide projector by taking photos of the slides (I replaced the original yellow light bulb by a cheap cool white 50W LED).

I’m using a Nikon D5000 with a 55-200mm lens that I reversed using a reverse ring.

I’m able to get quite decent shots (in manual mode of course) however my focusing process can really be improved I think

  • When looking through the built-in viewfinder I only see blurry colors
  • When watching the live view with the camera screen I can’t see anything very sharp (but still better than the viewfinder).
  • When plugging the camera to my computer and using DigiCamControl to check the live view it’s also quite blurry

Only once I take the shot I can see a clearer picture. So when I set up everything to digitize some slides I always have to guess where’s the sharpest point, take several pictures and compare them to see which one is at the end the sharpest one.

Is there any way I can improve that? I really would like to be able to see through the built-in viewfinder directly to determine the exact sharpest spot.

Thanks for your answers

theme development – How to properly use AWS SES for a contact form?

Overall Goal: To have my contact form send me the details to my personal email

How do I want to achieve it?: Not using any plugins

Issue: When I use my custom PHPMailer function located in the functions.php, the console tells me that there is a

POST http://websitename.test/wp-admin/admin-ajax.php 500 (Internal Server Error) …………………. jquery.js?ver=1.12.4-wp:formatted:4206

I am using Laragon for my local server. Whenever I comment out my custom function that uses PHPMailer, Laragon “catches” the email. But whenever I add the custom function back in, it gives me with the error above.

Here is my custom PHPMailer function:

add_action('phpmailer_init', 'custom_mailer');
/**
 * Overrides the default PHPMailer to use STMP with AWS SES
 * 
 */
function custom_mailer(PHPMailer $phpmailer) 
{
    $phpmailer->isSMTP();
    $phpmailer->SMTPAuth = true;        
    $phpmailer->Username = 'USERNAME';
    $phpmailer->Password = 'PASSWORD';
    $phpmailer->Host = 'email-smtp.ca-central-1.amazonaws.com';
    $phpmailer->SetFrom('fname.lname@gmail.com', 'FName LName');
    $phpmailer->Port = 587;
    $phpmailer->SMTPSecure = 'tls';
}

The Username, Password, and SetFrom are of course changed here to keep them secure. I assure you that the username and password are exactly the same from the credentials given in the AWS SES Console.

The jQuery in my contact form is:

(function($){
    $('#enquiry').submit( function(event) {
        event.preventDefault();

        var endpoint = '<?php echo admin_url('admin-ajax.php'); ?>';
        var form = $('#enquiry').serialize();

        var formData = new FormData;

        formData.append('action', 'enquiry');
        formData.append('nonce', '<?php echo wp_create_nonce('ajax-nonce'); ?>');
        formData.append('enquiry', form);

        $.ajax(endpoint, {
            type: 'POST',
            data: formData,
            processData: false,
            contentType: false,
        
            success: function() {
                $('#enquiry').fadeOut(200);
                $('#success_message').text('Thank you for your enquiry!').show();
                $('#enquiry').trigger('reset');
            },

            error: function(error) {
                 alert(error.responseJSON);
                 $('#enquiry').trigger('reset');
            }
        });
    });
})(jQuery)

And the PHP code that deals with the POST/AJAX is:

/** 
 * AJAX for Contact Us Form 
 * 
 * */
add_action('wp_ajax_enquiry', 'enquiry_form');
add_action('wp_ajax_nopriv_enquiry', 'enquiry_form');

/**
 * Enquiry Form Function
 */
function enquiry_form()
{
    if (!wp_verify_nonce($_POST('nonce'), 'ajax-nonce')){
        wp_send_json_error('Nonce is incorrect', 401);
        die();
    }

    $formdata = ();

    wp_parse_str($_POST('enquiry'), $formdata);

    // Admin Email
    $admin_email = get_option('admin_email');

    // Email Headers
    $headers() = 'Content-Type: text/html; charset=UTF-8';
    $headers() = 'From: websitename.com <' . $admin_email . '>';
    $headers() = 'Reply-to:' . $formdata('email');
    
    // Who are we sending the email to?
    $send_to = $admin_email;

    // Subject
    $subject = "Enquiry from " . $formdata('fname') . " " . $formdata('lname');

    // Message
    $message = '';
    
    foreach ($formdata as $index => $field) {
        $message .= '<strong>' . $index . '</strong>: ' . $field . '<br/>';
    }

    try {
        if (wp_mail($send_to, $subject, $message, $headers)) {
            wp_send_json_success('Email Sent!');
        } else {
            wp_send_json_error('Email Error');
        }
    } catch (Exception $error) {
        wp_send_json_error($error->getMessage());
    }
    wp_send_json_success($data);
}

Please Advise.

javascript – window.print() – does not work properly on TABLE HEAD ()

I have a script function that able to print the HTML content using window.print(), and it works fine to some other Dev elements. But, when it comes to my table element the header text was not showing up and it should look empty.

enter image description here

Anyway, I was using the latest version of Google Chrome. Is this a bugs on chrome??? Please, I need your help.