text:
Q: Xamarin android fill listview async with progressbar How to fill a ListView async in Xamarin.Android on the activity's onCreate?
I know how to call an async method upon button click and add a progress bar, but how to do the same with the onCreate method?
What I need is to open the activity and show a progressbar while a list of 20.000 items is loading.
In Eclipse Java I used to call the AsyncTask (onpreexecute ... doinbackgroud ...onpostexecute) but in Xamarin I can't figure out how to do this.
Any help or tutorial on this?
I tried this way by using the method that @Yuri provided but still not working:
 async protected override void OnCreate(Bundle savedInstanceState)
    {
        base.OnCreate(savedInstanceState);
        SetContentView(Resource.Layout.PulledItemsList);
        ActionBar.SetDisplayHomeAsUpEnabled(true);
        ActionBar.Title = "Catalog";
        _activity = this;

        //display your activity indicator and start spin
        ProgressDialog progressdialog = new ProgressDialog(this);
        progressdialog.SetCancelable(false);
        progressdialog.Indeterminate = true;
        progressdialog.SetMessage("Loading...");
        progressdialog.SetProgressStyle(ProgressDialogStyle.Spinner);
        progressdialog.Show();
        await Task.Run(() =>
        {
            fillListView();
        })
           .ContinueWith((t) =>
         {
             RunOnUiThread(() =>
                        {
                            progressdialog.Hide();
                            progressdialog.Dismiss();
                        });
         });
 }

and this method:
 async protected override void OnCreate(Bundle savedInstanceState)
    {
        base.OnCreate(savedInstanceState);
        SetContentView(Resource.Layout.PulledItemsList);
        ActionBar.SetDisplayHomeAsUpEnabled(true);
        ActionBar.Title = "Catalog";
        _activity = this;
        //display your activity indicator and start spin
        ProgressDialog progressdialog = new ProgressDialog(this);
        progressdialog.SetCancelable(false);
        progressdialog.Indeterminate = true;
        progressdialog.SetMessage("Loading...");
        progressdialog.SetProgressStyle(ProgressDialogStyle.Spinner);
        progressdialog.Show();

        await Task.Run(() =>
        {
            RunOnUiThread(() =>
            {
              fillListView();
            });
        });

         progressdialog.Hide();
         progressdialog.Dismiss();

        //disable indicator, list loaded
    }

and fillListView() function is :
 private void fillListView()
    {
        var listview = FindViewById<ListView>(Resource.Id.listview);
        List<oneimg_twolbl> ItemObjectList = new List<oneimg_twolbl>();
        oneimg_twolbl ItemObject = new oneimg_twolbl(0, "", "");
        List<Items> Itemlist = Items.SelectFromItems();
        if (Itemlist.Count == 0)
        {
            Toast.MakeText(this, GetString(Resource.String.NoItems), ToastLength.Long);
        }
        foreach (Items current_item in Itemlist)
        {
            ItemObject = new oneimg_twolbl(Resource.Drawable.StockQty, current_item.ItemBarcode.ToString().Trim(), current_item.DisplayField.ToString().Trim(), current_item.ItemNum);
            ItemObjectList.Add(ItemObject);
        }
        adapter = new PulledItemList_Adapter(this, ItemObjectList);
        listview.Adapter = adapter;

        listview.ItemClick += delegate (object sender, AdapterView.ItemClickEventArgs args)
        {
            Intent i = new Intent(this, typeof(ManageItemsActivity));
            oneimg_twolbl clicked_Item = adapter.GetItem_bypos(args.Position);
            Items selected_Item = Items.SelectWhereFromItems(clicked_Item.Id);
            i.PutExtra("parameter1", ManageItemsActivity.EDITMODE);
            i.PutExtra("parameter2", selected_Item.ItemCode);
            i.PutExtra("parameter3", selected_Item.ItemNum);
            i.PutExtra("Displayfield", selected_Item.DisplayField);
            StartActivity(i);
        };
    }

adapter class:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;

namespace SocrateMobile.Droid.Adapter
{
class PulledItemList_Adapter : BaseAdapter<oneimg_twolbl>
{
    private Activity context;
    private List<oneimg_twolbl> AllItemList;

    public PulledItemList_Adapter(Activity context, List<oneimg_twolbl> AllItemList)
    {
        this.AllItemList = AllItemList;
        this.context = context;
    }
    public oneimg_twolbl GetItem_bypos(int position)
    {
        return AllItemList[position];
    }
    public override oneimg_twolbl this[int position]
    {
        get { return AllItemList[position]; }
    }

    public override int Count
    {
        get { return AllItemList.Count; }
    }

    public override long GetItemId(int position)
    {
        return position;
    }

    public override View GetView(int position, View convertView, ViewGroup parent)
    {
        Holder_oneimg_twolbl holder = null;
        var view = convertView;

        if (view != null)
            holder = view.Tag as Holder_oneimg_twolbl;

        if (holder == null)
        {
            holder = new Holder_oneimg_twolbl();
            view = context.LayoutInflater.Inflate(Resource.Layout.oneimg_twolbl, null);
            holder.Text = view.FindViewById<TextView>(Resource.Id.text_list4_view);
            holder.Text2 = view.FindViewById<TextView>(Resource.Id.text_list4_view2);
            holder.Image = view.FindViewById<ImageView>(Resource.Id.image_list4_view);
            view.Tag = holder;
        }

        var current_item = AllItemList[position];

        holder.Text.Text = current_item.FirstTxt;
        holder.Text2.Text = current_item.SecondTxt;
        holder.Image.SetImageResource(current_item.FirstImg);
        holder.holderId = current_item.Id;

        if (!holder.Image.HasOnClickListeners)
        {
            holder.Image.Click += delegate
            {
                PulledItemListActivity Itemlistactivity = new                PulledItemListActivity();
                Itemlistactivity.QtyImageClick(holder.holderId);
            };
        }

        return view;
    }

    public class Holder_oneimg_twolbl : Java.Lang.Object
    {
        public TextView Text { get; set; }
        public TextView Text2 { get; set; }
        public ImageView Image { get; set; }

        public int holderId { get; set; }
    }
}
}

A: Based on your code here is how to do what you need:
In OnCreate call
        await Task.Run(() =>
        {
            fillListView();
        });

You fill listview function will look like below. I had to comment out some of your code and added Delay for testing. You can restore your code but keep in mind that you need to set up adapter BEFORE you put object to it. Then it will update your screen while spinner is working. If you don't need that then you don't have to call NotifyDataSetChanges.
private void fillListView()
        {
            var listview = FindViewById<ListView>(Resource.Id.listView1);
            List<oneimg_twolbl> ItemObjectList = new List<oneimg_twolbl>();

            //oneimg_twolbl ItemObject = new oneimg_twolbl(0, "", "");

            //List<Items> Itemlist = Items.SelectFromItems();
            //if (Itemlist.Count == 0)
            //{
            //    Toast.MakeText(this, "No items", ToastLength.Long);
            //}
            //foreach (Items current_item in Itemlist)
            //{
            //    ItemObject = new oneimg_twolbl(Resource.Drawable.Icon, current_item.ItemBarcode.ToString().Trim(), current_item.DisplayField.ToString().Trim(), current_item.ItemNum);
            //    ItemObjectList.Add(ItemObject);
            //}

            var adapter = new PulledItemList_Adapter(this, ItemObjectList);
            listview.Adapter = adapter;
            for (int i = 0; i < 10; i++)
            {
                RunOnUiThread(() =>
                {
                    ItemObjectList.Add(new oneimg_twolbl(i, i.ToString(), i.ToString()));
                    adapter.NotifyDataSetChanged();
                });
                Task.Delay(500).Wait();
            }

            listview.ItemClick += delegate (object sender, AdapterView.ItemClickEventArgs args)
            {
                //Intent i = new Intent(this, typeof(ManageItemsActivity));
                //oneimg_twolbl clicked_Item = adapter.GetItem_bypos(args.Position);
                //Items selected_Item = Items.SelectWhereFromItems(clicked_Item.Id);
                //i.PutExtra("parameter1", ManageItemsActivity.EDITMODE);
                //i.PutExtra("parameter2", selected_Item.ItemCode);
                //i.PutExtra("parameter3", selected_Item.ItemNum);
                //i.PutExtra("Displayfield", selected_Item.DisplayField);
                //StartActivity(i);
            };
        }


text:
Q: Speeding up admin-ajax.php I'm currently playing around with AJAX forms, but I've noticed that admin-ajax.php is quite slow.  If I simply return the word 'test', it takes around 1400ms.
I'm assuming it's because it's loading WordPress core which might slow it down a bit.
I've added the form handling as a plugin, hoping that might help speed things up over adding it to functions.php
/*
Plugin Name: Form test
*/
add_action( 'wp_ajax_form_test', 'form_test' );//logged in
add_action( 'wp_ajax_nopriv_form_test', 'form_test' );//not logged in

function form_test(){
   echo 'test';
   die();
}

Then I've gone to /wp-admin/admin-ajax.php?action=form_test
Is there anything I can do to speed this up a bit?

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to track all user activity on my website (like Chrome DevTools) I would like to know how I get all information of user activity who visit my website (with JavaScript), for example:

*

*where user clicked on my website

*all network calls on my website

*all errors on his console

I want to access all information of Chrome's DevTool or browser just like dev tools do of client who visit my website.
JavaScript:
performance.memory.jsHeapSizeLimit
performance.memory.usedJSHeapSize

Any JSON of combined output may be -- with user knowing it.


text:
Q: How to create dynamic size columns in C# .net 4.0 using TableLayout in WinForms I want two rows and first row has two columns. But I do not found any property by which I can set size of column. I place toolbar in first row and first column. I want to hide it progemmatically. So, how to design UI by using TableLayout?

A: Use the ColumnStyles property:
        tableLayoutPanel1.ColumnStyles[0].Width = 0;

Not so sure that makes sense, every control in the colum will get hidden and the other columns will grow proportionally.  Hiding a control is otherwise simple, just set its Visible property to false.


text:
Q: Why does OkHttp silently replace ws:// or wss:// schemes? I've been attempting to use OkHttp WebSockets with a wss:// URL on Android to no avail. When I pass a URL with wss:// scheme it's replaced with https://. It then, of course fails.
Does anyone have any advice on how to proceed. Is there a better websocket library out there? Here is the service I'm working on.
class WebsocketService(private val okHttpClient: OkHttpClient) :
WebSocketListener() {

private lateinit var webSocket: WebSocket
private lateinit var serverListener: ServerListener

fun connect(listener: ServerListener) {
    this.serverListener = listener

    val request = Request.Builder().url(SOCKET_URL).build()

    okHttpClient.newWebSocket(request, this)
}

override fun onOpen(webSocket: WebSocket?, response: Response?) {
    super.onOpen(webSocket, response)
    Timber.e("On Open %s", response.toString())
}

override fun onFailure(webSocket: WebSocket?, t: Throwable?, response: Response?) {
    super.onFailure(webSocket, t, response)
    Timber.e("On Failure %s", response.toString())
}

override fun onClosing(webSocket: WebSocket?, code: Int, reason: String?) {
    super.onClosing(webSocket, code, reason)
    Timber.e("On Closing %s", reason)
}

override fun onMessage(webSocket: WebSocket?, text: String?) {
    super.onMessage(webSocket, text)
    Timber.e("On Message %s", text)
}

override fun onMessage(webSocket: WebSocket?, bytes: ByteString?) {
    super.onMessage(webSocket, bytes)
    Timber.e("On Message Bytes %s", bytes)
}

override fun onClosed(webSocket: WebSocket?, code: Int, reason: String?) {
    super.onClosed(webSocket, code, reason)
    Timber.e("On Closed %s", reason)
}

enum class ConnectionStatus {
    DISCONNECTED,
    CONNECTED
}

interface ServerListener {
    fun onNewMessage(message: String)
    fun onStatusChange(status: ConnectionStatus)
}
}

A: The HttpUrl class OkHttp uses to model URLs only models the http: and https: schemes. But this is not likely to be the reason your web socket is failing. The scheme change is intended as an implementation detail inside OkHttp and shouldn't impact behavior.


text:
Q: ssh with command loses tab-completion I have a handy alias as follows:
sshpass -p "the_password" ssh -o StrictHostKeyChecking=no root@192.168.0.123

That will give me a quick way to login to a remote device, and get a command prompt which has tab completion.
But the first thing I then ALWAYS do, is cd to a different directory. Consequently I want to add that as a command to the end of the line, like this:
sshpass -p "the_password" ssh -o StrictHostKeyChecking=no root@192.168.0.123 'cd /tmp/Data/fx'

But if I do that then I don't get a prompt at all! It just sits there doing nothing. Next, I tried to make it give me a command prompt, by using this:
sshpass -p "the_password" ssh -o StrictHostKeyChecking=no root@192.168.0.123 'cd /tmp/Data/fx; /bin/bash -i'

That nearly works.
I have changed to the right directory, and I have a command prompt. But, I don't have any tab-completion, and the up-arrow doesn't show me the most recent commands.
What am I missing?

A: When you run /bin/bash -i you are launching another instance of the shell.  Therefore it's normal that you don't have access to your previous history.


text:
Q: Segfault for this very basic program Look at this very basic shell code:
mov     rax, 1      ; syscall write
mov     rdi, 1      ; fd=1 (stdout)

; push this string on stack: 'hello wd', '\n', 0
push    0x000000000000A
mov     rcx, 'hello wd'
push    rcx
mov     rsi,rsp     ; rsi points on string
mov     rdx,10      ; string size

syscall

This shell code just prints a string on stdout.
It works fine, the message is displayed, but i have a segfault after message priting.
Here is how i am compiling it:
nasm -f elf64 s2.asm
objcopy -O binary --only-section=.text s2.o s2.bin
gcc s2.o -m64 -nostartfiles

There is what i see if i launch ./a.out
hello wd
Segmentation Fault

I just want to understand what is wrong
Thanks


text:
Q: Spring Boot & Hibernate Validation's ConstraintMappingContributor The hibernate validations documentation describes how to create ConstraintMappingContributors here.
It states:

You then need to specify the fully-qualified class name of the
  contributor implementation in META-INF/validation.xml, using the
  property key hibernate.validator.constraint_mapping_contributors. You
  can specify several contributors by separating them with a comma.

Given I have many of these, what would be the most appropriate way to auto-discover these i.e. via @Component and add them dynamically at runtime to the ConstrainMappingConfiguration during Spring Boot startup.
For example.. if a developer creates a new ConstraintMappingContributor, it should be picked up and added automatically when spring boot starts, requiring no other file changes.

A: This is what I came up with, seems to be working for me.
package...
import org.hibernate.validator.spi.cfg.ConstraintMappingContributor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

@Configuration
public class ValidationConfiguration {

    private final List<ConstraintMappingContributor> contributors;
    public ValidationConfiguration(Optional<List<ConstraintMappingContributor>> contributors) {
        this.contributors = contributors.orElseGet(ArrayList::new);
    }

    @Bean
    public LocalValidatorFactoryBean validatorFactory() {
        return new ValidatorFactoryBean(this.contributors);
    }
}

package...
import org.hibernate.validator.HibernateValidatorConfiguration;
import org.hibernate.validator.internal.cfg.context.DefaultConstraintMapping;
import org.hibernate.validator.spi.cfg.ConstraintMappingContributor;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;

import javax.validation.Configuration;
import java.util.List;

public class ValidatorFactoryBean extends LocalValidatorFactoryBean {

    private final List<ConstraintMappingContributor> contributors;

    ValidatorFactoryBean(List<ConstraintMappingContributor> contributors) {
        this.contributors = contributors;
    }

    @Override
    protected void postProcessConfiguration(Configuration<?> cfg) {
        if (cfg instanceof HibernateValidatorConfiguration) {
            HibernateValidatorConfiguration configuration = (HibernateValidatorConfiguration) cfg;
            this.contributors.forEach(contributor -> contributor.createConstraintMappings(() -> {
                DefaultConstraintMapping mapping = new DefaultConstraintMapping();
                configuration.addMapping(mapping);
                return mapping;
            }));
        }
    }
}

I invoke it like this...
if(SpringValidatorAdapter.class.isInstance(this.validatorFactory)){
    SpringValidatorAdapter.class.cast(this.validatorFactory).validate(entity, errors);
}


text:
Q: Typo3 Neos HTML to PDF I got problem when trying to create PDF file. Is there any other way to create pdf beside using FPDF? Because i'm struggling to include the class from fpdf into the backend.
require_once(dirname(__FILE__).'/fpdf17/fpdf.php');
$pdf = new \Backend\Controller\fpdf17\FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();

But this code is not working, got problem with the require.
And i also try with TCPDF but it's not working.
The error for TCPDF is i'm stuck on TCPDF Examples page.
This is the code https://gist.github.com/anonymous/d346ff2d6fb9d1852925
Anyhelp would be much appreciated, thanks!

A: Got the answer
when trying to call the TCPDF class :
use this :
$pdf = new \TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
instead of :
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);


text:
Q: How to get all the Services from Startup.cs How do I obtain all the services after StartupClass has run?
We have a Startup Configure Services class which
runs multiple dependency injection.
 serviceCollection.AddScoped<IDepartmentRepository, DepartmentRepository>();
 serviceCollection.AddScoped<IDepartmentAppService, DepartmentAppService>();

Team is using Xunit Test Project and wants to grab all the Service collection list for Xunit.
Need services from this below:
new WebHostBuilder()
            .UseContentRoot("C:\\Test\\Test.WebAPI")
            .UseEnvironment("Development")
            .UseConfiguration(new ConfigurationBuilder()
                .SetBasePath("C:\\Test\\Test.WebAPI")
                .AddJsonFile("appsettings.json")
                .Build()).UseStartup<Startup>());

A: Services in ServiceCollection are represented by the ServiceDescriptor class. You can get a list of all service descriptors by chaining a ConfigureTestServices method to your WebHostBuilder (you have to install Microsoft.AspNetCore.TestHost package)
using Microsoft.AspNetCore.TestHost;

....

IWebHost CreateWebHost(out ServiceDescriptor[] allServices)
{
    ServiceDescriptor[] grabbedServices = null;

    var host = new WebHostBuilder()
        // ... other stuff ...
        .UseStartup<Startup>()
        // add the following call:
        .ConfigureTestServices(services => {
            // copy all service descriptors
            grabbedServices = services.ToArray();
        })
        // build the host now to trigger the above chain
        .Build();

    allServices = grabbedServices;
    return host;
}

It is then convenient to use like this:
[Fact]
public void TestSomething()
{
    // arrange

    var host = CreateWebHost(out var services);
    // ... do something with the services

    // act
    // assert
}

The reason we have to use ConfigureTestServices (and not ConfigureServices) is that ConfigureServices is always invoked before the methods in the Startup class, whereas ConfigureTestServices is invoked afterward.
UPDATE
Of course, it's also possible to just store the reference to ServiceCollection in a variable/field, and enumerate the services whenever necessary.

A: So I understood your question that you want to test you services and have problems with loading them in test project.
I'd say you don't need to. In unit tests every time you test a single service. This service you instantiate directly:
var target= new ServiceToTest();

So you reference your testED project from your test project. In case your implementation is internal, add to your testED project an AssemblyInfo.cs file and put the following inside:
[assembly: InternalsVisibleTo("MyTestProject")]

Whenever you test your MyServiceToTest1, in case it has a dependecy to MyServiceTest2, you don't have to load or instantiate MyServiceTest2. Instead you mock it, e.g. with moq.


text:
Q: What would cause the caching of server variables? I am having issues with server variables (like the page URL) being cached so that when you go to a new page, the variable that contains the server URL doesn't actually change.
I am able to fix it in my .htaccess file with this code:
<IfModule mod_headers.c>
    Header set Cache-Control "no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires 0
</IfModule>

<FilesMatch "\.(css|flv|gif|htm|html|ico|jpe|jpeg|jpg|js|mp3|mp4|png|pdf|swf|txt)$">
    <IfModule mod_expires.c>
        ExpiresActive Off
    </IfModule>
    <IfModule mod_headers.c>
        FileETag None
        Header unset ETag
        Header unset Pragma
        Header unset Cache-Control
        Header unset Last-Modified
        Header set Pragma "no-cache"
        Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
        Header set Expires "Thu, 1 Jan 1970 00:00:00 GMT"
    </IfModule>
</FilesMatch>

So, I know the fix, but I need to know what is causing it because it's a WordPress site (and no, it's not being caused by plugins, I tested with a fresh WP install) and therefore my .htaccess file gets periodically overwritten by WordPress.
So I would like to know how to fix it on the server side, rather than using the .htaccess file. Would it be in the PHP variables? Or apache settings?
I called the webhost (godaddy) and the guy had no idea.
Thanks!

A: WordPress 5.6 added application passwords.
It wants to add this to .htaccess:
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
I would try:

*

*chmod 600 .htaccess

*add_filter('wp_is_application_passwords_available', '__return_false');
Best wishes,
Mitchell


text:
Q: Multiple html pages v/s Single html page I'm trying to create a website for a small project. The first page you reach after launching it in a browser window is a landing page that provides means to pick one of multiple options.
E.g. Pick what you'd like to access -
1.
2.
3.
4. and so on
I'm using basic html, css and javascript to work on this, since those are the ones I'm somewhat familiar with. That being said, I'm open to learning something else if it makes the job much easier.
But at the moment, my problem is I have designed an html page for the inital landing page and when the user picks an option, I'm thinking of using links to transfer him to a new webpage.
Should there be a separate html page for each of these options, given that each may be a little different, but not majorly.
I'm sorry, I tried looking online for a solution but I'm not sure how I can word my search terms. Also, the only other thing I found on stack overflow was How to display multiple html pages using single index.html
Any help or guidance would be most appreciated. Thanks!

A: From easy to code perspective: (Not Recommended)
Obviously you can repeat the same HTML structure in all your pages and just change the center content in each page. Then you have to link your sub pages (1,2,3,4...) using normal anchor tags .
Pros:

*

*Easy to create.

*Requires no / less technical expertise

Cons:

*

*Difficult to make changes to header and footer.

----------
From easy to maintenance perspective: (Good Option)
In case you want to have a common header and footer for all pages, then I would recommend creating a single page with following structure
Header
(1,2,3,4) <-Links
BODY CONTENT
FOOTER

Then on click of the links (1,2,3, etc.,) fetch the content from 1.html and inject it to the body of this index.html.
So as a result you are avoiding the need to repeat header and footer in multiple pages and you will adhere to DRY principle (DON'T REPEAT YOURSELF).
Pros:

*

*Elegant way to implement.

*Easy to make changes to the header/
footer.

Cons:
Requires technical knowledge to use AJAX based content fetching and substitution in the parent page.
----------
From easy to maintain & manage content: (Best Option)
You can think about using CMS systems to maintain your simple website more efficiently.
Pros:

*

*Easy to Manage content

*Easy to make changes

*User friendly Rich text content editing features.

*Easy way to link all pages

*Easy to use Out of Box dynamic features (to generate your links 1, 2,3, etc.,)

Note: You would need a web server to host your website.

A: Have you considered how you will deal with different screen sizes? How about phones? Will your images and format resize?
Would it be helpful to have a system that takes care of this for you?
It's called Bootstrap - perhaps you've heard some of the hubbub.
Take a look at these tutorials for building a single-page, multiple-section, Bootstrap website (currently the hottest type of site) and if one of them will work for you, follow that tutorial. It should take less than an hour. Then, update the information/images with your own and you're a long way down the road.
Personal - Demo here - Tutorial here
Artsy/Creative - Demo here - Tutorial here
Company - Demo here - Tutorial here
Basic Template Layouts
Then, if you want more, search YouTube for additional Bootstrap video tutorials.


text:
Q: what is the largest open set contained in {${x|f(x)=g(x)} $}? Consider $f : \mathbb{R} \rightarrow \mathbb{R}$ defined by $f(x) = {x}^{1/3}$. let g(x) = $\sum_{n=0}^{∞} a_n(x − 3/2)^n$  where $a_n=  \frac {{f}^{(n)}(3/2)}{n!}$ for $n≥0$. what is the largest open set contained in  {${x|f(x)=g(x)} $}?
my answer : i think largest open set will be $(-3/2,0) \cup (0,3/2)$   ...
is its correct or not ? pliz tell me
or give me any hints or if u have time pliz tell me the solution  i would be more thankful..

A: Complex analysis fact: power series converge up to the nearest singularity of the function. In the case of your series, we have a singularity at $x = 0$ and the radius of convergence will be $3/2$...
Alternatively, you can calculate explicitly the coefficients of the series, check the radius of convergence and prove that converges to $f$ applying Taylor.


text:
Q: Python Apache beam streaming to Bigquery is getting failed I am trying to write Apache beam output to Bigquery Table but its getting failed with InsertError as below.Please help.
Code:
import logging
import apache_beam as beam
from mongodbio import ReadFromMongo

TABLE_SCHEMA = ('clause_type:STRING, count:INTEGER')

def transform_doc(document):
    data={str(document['clause_type']):int(document['count'])}
    return data

def run():
    connection_string = 'mongodb://localhost:27017'
    with beam.Pipeline(runner='DirectRunner') as pipeline:
        (pipeline
        | 'read' >> ReadFromMongo(connection_string, 'new', 'Data',
          query={}, fields=['count','clause_type'])
        | 'transform' >>
          beam.Map(transform_doc).with_output_types(str)
        | 'save' >> beam.io.WriteToBigQuery('<table_name>',schema=TABLE_SCHEMA,create_disposition=beam.io.BigQueryDisposition.CREATE_IF_NEEDED,write_disposition=beam.io.BigQueryDisposition.WRITE_APPEND))

 if __name__ == '__main__':
    logging.getLogger().setLevel(logging.DEBUG)
    run()

Error:
  index: <index number>>, <InsertErrorsValueListEntry
  errors: [<ErrorProto
  debugInfo: u'generic::not_found: no such field.'
  location: u'fiscal year'
  message: u'no such field.'
  reason: u'invalid'>]


text:
Q: Azure Application insight not working from UWP device I have setup the application insights for my app, I can see all the data when I am running my app from the PC, when I am debugging the app running on device, I still see the data in the VS output window and can see "Data from Debug session telemetry" option in Visual studio, but the data from the device is not showing up at app insight portal. Any idea, what might be wrong?

A: Things to check:

*

*does your UWP app allow outbound network calls?  depending on the template/version you started with, the UWP app might not be allowed to send outbound data at all, preventing data from being sent to appinsights.

*is it going out at all?  use fiddler or something similar (including the extra work to enable it to see traffic from UWP apps, and allow it to decode https)  look for outbound calls to dc.services.visualstudio.com

*if it is going out, is it being accepted/succeeding?  or are the calls failing?

*if it is going out, is it using the ikey you expect? so that the data is actually going to the same app you're looking at on the portal
As others have commented, if you want a newer SDK, the hockeyapp.uwp nuget package also allows you to send data to application insights.


text:
Q: Misconception of what superkey or Boyce Codd Normal form is At 9:34 in this video the speaker says that all 3 functional dependencies are in Boyce Codd Normal Form. I don't believe it because clearly GPA can't determine the SSN, sName, address and all other attributes in the student table. Either I'm confused about the definition of Boyce Codd Normal Form or what a super key is? Does it only have to be able to uniquly identify certain attributes, not all attributes in the schema? For example GPA does determine priority (which is on the right side of the functional dependency) but not everything else.
For example if I had the relation R(A,B,C,D) and the FDs A->B would we say A is a superkey for B but I thought a super key is for the whole table? To add to my confusion I know for BCNF it can be a (primary) key but you can only have on primary key for the table. Ugh my brain hurts.

A: "... the speaker says that all 3 functional dependencies are in Boyce Codd Normal Form."
To be in BC normal form is a property that can be had by RELATIONS (relation variables, more specifically, or relation schemas, if that term suits you better), not by functional dependencies.  If you find someone talking so sloppily of normalization theory, leave and move onto more accurate explanations.
Whether or not a relation variable is indeed in BC normal form, depends on which functional dependencies are supposed to hold in it.  That is why it is utter nonsense to say that functional dependencies are or are not in BC normal form.
"I don't believe it because clearly GPA can't determine the SSN, sName, address and all other attributes in the student table. Either I'm confused about the definition of Boyce Codd Normal Form or what a super key is? Does it only have to be able to uniquly identify certain attributes, not all attributes in the schema?"
An irreducible candidate key is that set (not necessarily unique) of attributes of the relation schema that is guaranteed to have unique combinations of attribute values in whatever relation values could validly appear in the relation variable in the database.
In your (A,B,C,D) example, if A->B is the only FD that holds, then the only candidate key is {A,C,D}.
"For example if I had the relation R(A,B,C,D) and the FDs A->B would we say A is a superkey for B"
It is sloppy and confusing to talk of A as being the "key" for B in such a case.  People who pretend to be teaching others ought to know this, and people who don't, ought not engage in any teaching until they do know this.  It would be better to talk of A as the "determinant" for B in such contexts.  The term "key" in the context of relational database design has a very well-defined and precise meaning, and using the same term for other meanings merely confuses people.  As evidenced by your question.
"but I thought a super key is for the whole table?"
Yes you thought right.
Back to your (A,B,C,D) example.  If we were to split that design into (A,B) and (A,C,D), then we would have a relation schema -the (A,B) one- of which we can say that "{A} is a key" in that schema.
That is actually precisely what the FD A->B means : if you take the projection -of the relation value that would appear in the database in the (A,B,C,D) schema- over the attributes {A,B}, then you should be getting a relation in which no A value appears twice (if it did, then that A value would correspond to >1 distinct B value, meaning that A could not possibly be a determinant for B after all).
"To add to my confusion I know for BCNF it can be a (primary) key but ..."
Now you are being sloppy yourself.  What does "it" refer to ?


text:
Q: How can I get the full benefit of precompiled headers while using ccache? My project sometimes benefits from ccache, so I have long been using ccache.  I'm now adding precompiled headers.  Some sources suggest that the two are incompatible and that one must choose between them.  But I find in ccache's documentation that it does support PCH on some level:  https://ccache.samba.org/manual.html#_precompiled_headers
Indeed, when I try using ccache to build a .o file while using Clang's -include-pch option, I see that ccache is succeeding at caching the .o.  The first compilation attempt takes 1.5 s, and a second takes only 0.05 s (because ccache has done its job).
The trouble is that if I run this same compilation command with clang++ instead of with /usr/lib/ccache/clang++, it takes 0.5 s...  unless I leave off the -include-pch part, in which case it takes about 1.5 s.  It seems that ccache may be causing my PCH to be ignored, or something.
I've followed the instructions (from the link above).  As specified there, my ccache.conf looks like this:
sloppiness=pch_defines,time_macros

And I've tried every reasonable combination of #include, -include, -include-pch, and -fpch-preprocess I could think of.  Compilation always takes 1.5 s and then 0.05 s, when it should take 0.5 s, and then 0.05 s.
Is it possible to make this work, or do I have to choose between ccache and PCH after all?


text:
Q: Quais as diferenças entre Tipos Genéricos em C# e em Java? Eu estudei Java há bastante tempo e estou bem familiarizado com o funcionamento de tipos genéricos nessa linguagem: sei que só existem em tempo de compilação, que sofrem type erasure ao final da mesma (de modo que no tempo de execução essas informações não estão disponíveis), e tenho uma certa noção das dificuldades ao se aplicar polimorfismo em tipos genéricos.
Agora estou aprendendo C#, e reparei que embora essa linguagem use notação semelhante (Tipo<TipoGenerico>) a semântica não parece ser a mesma. Por exemplo, ao ver essa pergunta entendi que o runtime do C# guarda a informação dos tipos genéricos em vez de descartá-la, diferentemente do Java, isso está correto? Além disso, nunca vi um exemplo em C# que utilizasse "coringas" (wildcards) como Tipo<? extends TipoGenerico>. Isso é possível (ou mesmo necessário) nessa linguagem?
Por fim, C# suporta métodos individuais (e não somente classes) genéricos? Se sim, qual a sintaxe equivalente dessa construção em Java:
public <T> void metodo(T parametro1, List<T> parametro2) {

Se houver algum detalhe adicional que mereça destaque, ou talvez algum material de referência para aprender mais, também será bem-vindo.

A: Comparação C# vs Java

C# guarda a informação dos tipos genéricos em vez de descartá-la, diferentemente do Java, isso está correto

Sim, no C# não ocorre a Type Erasure que ocorre em Java. No java, internamente, o compilador descarta o fato de que é MinhaClasseEspecifica e trata como Object, fazendo os casts necessários para a sua classe específica.
Já no C#, o compilador JIT (Just-In-Time) internamente constrói uma classe específica com o tipo T utilizado. Se você utiliza um objeto Tipo<string>, por exemplo, internamente ele cria uma classe onde todos os T são string.
Do ponto de vista de desempenho, o que o C# está fazendo é mais performático, pois não precisa de casts pra lá e pra cá.
Segundo o próprio Anders Hejlsberg :

Por exemplo, com generics em Java, você na verdade não obtém a eficiência em execução que eu comentei, porque quando você compila uma classe genérica em Java, o compilador retira o parâmetro do tipo e substitui tudo por Object.
...
O IL e os metadados contém informações adicionais de que existe um type parameter, claro, mas em princípio, um tipo genérico compila da mesma forma que qualquer outro tipo compilaria. Em tempo de execução, quando sua aplicaçao faz a primeira referencia para um List<int>, por exemplo, o sistema olha se alguém já pediu um List<int>. Se ninguém o fez, ele alimenta o JIT com o IL e os metadados para o tipo List<T> e o argumento do tipo int. O JITer produz o código nativo específico para aquele tipo no momento que é necessário. Em Runtime.

Fonte: http://www.artima.com/intv/generics2.html
(Tradução Livre)
Wildcards / Type Constraints em Generics

Além disso, nunca vi um exemplo em C# que utilizasse "coringas" (wildcards) como Tipo<? extends TipoGenerico>

Em C# seria assim:
class Classe<T> where T : TipoEspecifico

Existem vários Type Constraints, siga o link para ver. (Está em inglês)
Métodos Genéricos

Por fim, C# suporta métodos individuais (e não somente classes) genéricos? Se sim, qual a sintaxe equivalente dessa construção em Java:

Basicamente troque o <T> de lugar
T FazerAlgoComT<T>(T obj) { ... }

Lembrando que você pode usar os Type Constraints (where blablabla) nos métodos também.

A:
Além disso, nunca vi um exemplo em C# que utilizasse "coringas"
  (wildcards) como Tipo<? extends TipoGenerico>. Isso é possível (ou
  mesmo necessário) nessa linguagem?

Sim, é possível limitar o parâmetro genérico a um tipo especifico da seguinte forma:
public class MinhaClasse<TEntidade> where TEntidade : MinhaClassePai{}

Por fim, C# suporta métodos individuais (e não somente classes)
  genéricos? Se sim, qual a sintaxe equivalente dessa construção em
  Java:

Você pode utilizar métodos genéricos desde que os parâmetros genéricos estejam presentes na Classe ou no método, como no exemplo abaixo:
public TEntidade MeuMetodo<TEntidade>(TEntidade meuObjeto){}

Caso você não queira definir o parâmetro genérico em seu método, você pode utilizar o da classe:
 public class MinhaClasse<TEntidade> where TEntidade : MinhaClassePai
{
    public TEntidade MeuMetodo(TEntidade meuObjeto){}
}

Quanto a sua primeira questão, @ConradClark a respondeu de forma clara e objetiva.

A: As perguntas foram respondidas nas duas respostas postadas até agora. Vou acrescentar algo extra que ainda não foi dito.
Em C# a concretização do tipo ocorre em runtime e não em tempo de compilação como é o caso  do C++, por exemplo. Em C++ o compilador gera uma implementação concreta sempre que um tipo diferente for utilizado.
Uma das coisas que se reclama muito em C++ é que se o código utilizar muitos tipos concretos com um template você terá uma enorme code bloat porque cada tipo concreto gerará um código diferente da classe ou método gabaritado. Java não sofre deste problema porque no fundo tudo é object e então só há uma implementação concreta para este tipo.
O código distribuído do C# funciona mais ou menos da mesma forma que o Java. A concretização da implementação só ocorrerá na memória. Já é um ganho, mas ainda teria um trambolho de implementações duplicadas na memória. Note que o CLR, a máquina virtual do .NET, entende o código genérico que o compilador emite. A JVM não sabe fazer isto.
Mas o CLR é mais esperto que isto. Ela cria implementações concretas para cada tipo por valor, as chamadas structs - que o Java, ainda não tem, e por isto os tipos primitivos precisam ser encaixotados - mas para os tipos por referência só uma instância disto é criada para segurar uma referência qualquer. Afinal todas estas implementações concretas precisam ser criadas por causa da diferença semântica de valor ou referência e por causa do tamanho do dado. Os tipos por referência funcionam todos de forma idêntica e o tamanho é sempre o tamanho do ponteiro, então não tem motivo para existir uma instância da implementação para cada tipo por referência.
Em C++ não é possível fazer o mesmo porque o template é mais flexível e cada implementação pode ser diferente, inclusive tendo comportamentos especializados.
Outro ponto que foi falado é sobre o polimorfismo. Alguns consideram até mesmo que a genericidade permite dispensar o polimorfismo se a linguagem for talhada para isto. Veja isto:
T Metodo<T>(T obj) where T : TipoPai {
    return obj.ChamaAlgo(); //Qual "ChamaAlgo()" será executado?
}

O método ChamaAlgo() a ser chamado será aquele dependente do tipo de obj. E este tipo pode ser TipoPai ou pode ser TipoFilho1, TipoFilho2, TipoNeto, etc., ou seja qualquer tipo descendente de TipoPai. Note que ChamarAlgo() não precisaria ser virtual para isto funcionar nesta linguagem hipotética.
Outro aspecto que deve ser falado é que um dos motivos que os wildcards do Java foram introduzidos era permitir co e contra variância de tipos no uso dele. Em C# isto é obtido na declaração do tipo com in e out.
class exemplo<out T> //covariante

class exemplo<in T>  //contravariante

Coloquei no GitHub para referência futura.

A: Do meu ponto de vista, a principal diferença é que, em Java, você pode entender que o propósito das classes genéricas é somente de fornecer um certo nível de segurança no momento da compilação, "garantindo" até certo ponto que o seu programa não vai gerar uma exceção relacionada à incompatibilidade de tipos em tempo de execução. Ao mesmo tempo, isso alavanca o reuso de código.
Em outras linguagens, como C#, poderíamos entender que o propósito é gerar variações "concretas" de classes a partir de uma classe base.
Além disso, algumas comparações realizadas em outras respostas não são exatamente "justas". Sobre o desempenho, por exemplo, em Java você não ganha ou perde praticamente nada em desempenho ao usar uma classe genérica. A diferença será que, ao não usar genéricos você precisa fazer casts explícitos.
Em tese, Java seria sempre mais "lento" nesse ponto, no sentido de que não possui essa otimização específica. A única forma de otimização seria replicar o código em classes não genéricas. Mas se for para fazer uma comparação entre as linguagens, vários outros critérios deveriam ser considerados. Por exemplo, fato de não haver esse tipo específico de otimização não significa que, só para efeito de exemplo, o cast do Java possa ser mais rápido do que a chamada direta em C#.
Um trade-off que foi mencionado apenas implicitamente em outras linguagens, é que o Java não consome mais memória para as classes genéricas. Não creio ser um ponto muito delicado, mas o C# vai consumir mais memória proporcionalmente ao número de classes genéricas que você implementar.
Por fim, um dos grandes entraves para qualquer evolução nesse ponto na linguagem Java é que em geral há uma grande preocupação com compatibilidade. É uma decisão de projeto que não agrada muita gente, mas manter o código em runtime inalterado economizou muito dinheiro às empresas que não precisaram reescrever aplicações para adaptá-las às novas versões da Máquina Virtual Java.


text:
Q: Git push success but files not updated in website I am using Git ( GUI GitKraken)  with cPanel.
In cPanel public_html/web I have git repository created using commands:
mkdir ~/web

cd web

git init

git config receive.denyCurrentBranch updateInstead

Now in my laptop, i cloned via GitKraken to www directory of xammp localhost server.
Idea is to make changes in site locally and push those chnages to live site via Git.
Everything was working fine last night, but today remote server files are not updating(showing pushed changes).
Git says its been pushed successfully to origin, but files are not updating.
Note: I have 3 branches in my Local Repo:

*

*master,

*version2. 1,

*version2. 2,

and i am pushing these to master branch of remote repo.

A: From your comment I see there are two Solutions for your Problem:

*

*Merge your local branch 'version2.2' to the master branch and push it to remote. Fetch & Pull it on your remote System.

*Push your local branch 'version2.2' to the remote with git push -u origin version2.2
After that you have to create and checkout the local branch on your remote System and pull the changes,the local branch "version2.2" also have to track the remote branch remote branch 'version2.2'. All of this you can do with this command: git checkout --track origin/version2.2
You are able to do all of these steps in gitkraken too (without using the command line)


text:
Q: Exceptions - what is "exceptional"? I've read that exceptions shouldn't be used for directing the flow of your application but should be used to recover the application to a stable state when something "exceptional" happens, for example, when you fail to connect to a database.
An example of where an exception shouldn't be used would be a user providing an incorrect login. It wouldn't be an exception since it's expected that that will happen.
I'm not sure whether the following case is exceptional or not:
I'm currently designing a simple blog. A "post" is assigned to just one "category". In my posts table I have a category_id field with a foreign key constraint.
Now, I'm using Laravel so if I try to delete a category that currently has posts in it, I believe it should throw an \Illuminate\Database\QueryException because of the foreign key constraint. Therefore should I rely on this and write code like:
try {
    $category->delete();
}
catch (\Illuminate\Database\QueryException $e) {
    // Tell the user that they can't delete the category because there are posts assigned to it
}

or since I know how I want my blog to work, should I use:
if ($category->posts->isEmpty()) {
    $category->delete();
}
else {
    // Tell the user they can't delete...
}

Any advice would be appreciated. Thanks!

A: It is very opinion based, so i'll give you my opinion:
Exceptions are powerfull, because you can attach a lot of information with it - and you can send them "up the callstack" without having hundrets of methods checking the return value of any call and returning whatever to their own caller.
This allows you to easily handle an error at the desired layer in the callstack.
A Method should return, what is the result of the call (even if it's void). If the call fails for any reason, there should be no return value.
Errors should not be transported by returnvalues, but with exceptions.
Imagine a function doing db-queries: KeyAlreadyExistsException, InvalidSyntaxException and NullPointerException - most likely you want to handle this "errors" at very different parts in your code.
(One is a code-error, one is a query-error, one is a logical-error)
Example one, easy "handling":
try{
  method1(1);
}catch (Exception $e){
  //Handle all but NullpointerExceptions here.
}
---
method1($s){
  try{
    method2($s+2);
  } catch (NullPointerException $e){
    //only deal with NPEs here, others bubble up the call stack.
  }
}
---
method2($s){
  //Some Exception here.
}

Example two - you see the required "nesting", and the stack-depth is only 2 here.
 $result = method1(1);
 if ($result === 1){
   //all good
 }else{
  //Handle all but NullpointerExceptions here.
 }
 ---
 method1($s){
   $result = method2($s+2);
   if ($result === 1){
     return $result;
   }else{
     if ($result === "NullPointerException"){
       //do something
     }
 }

method2($s){
  //Exception here.
}

Especially for maintainance, Exceptions have huge advantages: If you add a new "Exception" - the worstcase will be an unhandled exception, but code execution will break.
If you add new "return errors", you need to make sure, that every Caller is aware of these new errors:
function getUsername($id){
   // -1 = id not found
   $name = doQuery(...);
   if (id not found) return -1;
   else return $name;
}

vs
function getUsername($id){
   $name = doQuery(...);
   if (id not found) throw new IdNotFoundException(...);
   return $name;
}

Now consider the handling in both cases:
if (getUsername(4)=== -1) { //error } else { //use it }

vs
try{
  $name = getUsername(4);
  //use it
}catch (IdNotFoundException $e){
   //error
}

And now, you add the return code -2: First way would assume the username to be -2, until the error code is implemented. Second way (Another Exception) would cause the execution to stop with an unhandled exception somewhere way up in the callstack.
Dealing with return values (of any kind) for error-transportation is error prone and errors might vanish somewhere, turning into a "wrong" interpreted result.
Using exceptions is safer: You either have a return value to use, or a (handled or unhandled) exception, but no "wrong values" due to autocasts etc.


text:
Q: Flutter Textformfield error message shifted down the next widget I have an issue with my textformfield. Whenever the error message shows, it shifted down the next widget below...
I try to search how to give a placement for the error text to no take a placement that does not exist when it is not shown, but I didn't find the solution.
Here are the screenshot and the code of the issue.

class AuthForm extends StatefulWidget {
  final bool isPassword;
  final IconData prefixIcon;
  final String hintText;
  late bool isPasswordVisible = isPassword;
  final bool isCalendar;
  final TextEditingController controller;
  final bool isDropDown;
  final bool isPhone;
  final String? Function(String?)? validator;

  AuthForm({Key? key, this.isPassword = false, required this.prefixIcon, required this.hintText,
    this.isCalendar = false, required this.controller, this.isDropDown = false, this.isPhone = false, required this.validator}) : super(key: key);

  @override
  State<AuthForm> createState() => _AuthFormState();
}

class _AuthFormState extends State<AuthForm> {

  @override
  void initState() {
    super.initState();
    if (widget.isPhone){
      getCountryCode();
    }
  }

  start () async {
    await CountryCodes.init();
  }
  Locale? getCountryCode () {
    start();
    final Locale? deviceLocale = CountryCodes.getDeviceLocale();
    final CountryDetails details = CountryCodes.detailsForLocale();
    return deviceLocale;
  }

  DateTime selectedDate = DateTime(2000,1);
  Future<void> _selectDate(BuildContext context) async {
    final DateTime? picked = await showDatePicker(
        context: context,
        initialDate: selectedDate,
        firstDate: DateTime(1950, 1),
        lastDate: DateTime.now());
    if (picked != null && picked != selectedDate) {
      setState(() {
        selectedDate = picked;
      });
    }
  }

  @override
  Widget build(BuildContext context) {
    return widget.isDropDown ? const DropDownBar() :
    SizedBox(
      width: 70.w,
      child: TextFormField(
          validator: widget.validator,
          keyboardType: widget.isPhone ? TextInputType.phone : TextInputType.text,
          inputFormatters: [DialCodeFormatter()],
          controller: widget.controller,
          textAlign: TextAlign.center,
          obscureText: widget.isPasswordVisible,
          style: Theme.of(context).textTheme.bodyText2,
          decoration: InputDecoration(
            contentPadding: EdgeInsets.fromLTRB(0, 2.3.h, 0, 0),
            hintText : widget.hintText,
            hintStyle: Theme.of(context).textTheme.bodyText1,
            enabledBorder: UnderlineInputBorder(
              borderSide: BorderSide(
                color: Theme.of(context).splashColor,
                width: 0.13.w,
              ),
            ),
            errorStyle: Theme.of(context).textTheme.headline6,
            prefixIcon: Container(
              width: 0,
              alignment: const Alignment(-0.99, 0.5),
              child: Icon(
                widget.prefixIcon,
                color: Theme.of(context).primaryColor,
                size: 6.w,
              ),
            ),
            suffixIcon: Visibility(
              visible: widget.isPassword,
              //Maintain the space where the widget is even if it is hid
              maintainAnimation: true,
              maintainState: true,
              maintainSize: true,
              child: InkWell(
                highlightColor : Colors.transparent,
                splashColor: Colors.transparent,
                child: Container(
                  width: 0,
                  alignment: const Alignment(0.99, 0.5),
                  child: Icon(
                    widget.isPasswordVisible ? Icons.visibility : Icons.visibility_off,
                    color: Theme.of(context).primaryColor,
                    size: 6.w,
                  ),
                ),
                onTap: () {
                  setState(() {
                    widget.isPasswordVisible = !widget.isPasswordVisible;
                  });
                },
              ),
            ),
          ),
          onTap: () async {
            if (widget.isCalendar){
              //Dismiss the keyboard
              FocusScope.of(context).requestFocus(FocusNode());
              //Call the calendar
              await _selectDate(context);
              widget.controller.text = DateFormat('dd-MM-yyyy').format(selectedDate);
            }
          }
      ),
    );
  }
}

Login Page
@override
  Widget build(BuildContext context) {
    return BlocListener<InternetCubit, InternetState>(
      listener: (context, state) {
        if (state is InternetDisconnected) {
          showAlertBox(context);
        }
      },
    child: Form(
      key: _formkey,
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          SizedBox(
            height: 6.h,
          ),
          Text(
            "Flexmes",
            style: Theme.of(context).textTheme.headline1,
          ),
          SizedBox(
            height: 8.h,
          ),
          AuthForm(
            prefixIcon: Icons.email_outlined,
            hintText: "Email",
            controller: emailController,
            nextFocusNode: passwordNode,
            validator: MultiValidator([
              RequiredValidator(errorText: 'Email is required'),
              EmailValidator(errorText: 'Enter a valid email address'),
            ]),
          ),
          SizedBox(
            height: 3.h,
          ),
          AuthForm(
            isPassword: true,
            prefixIcon: Icons.lock_rounded,
            hintText: "Password",
            controller: passwordController,
            currentFocusNode: passwordNode,
            validator: MultiValidator([
              RequiredValidator(errorText: 'Password is required'),
              MinLengthValidator(6, errorText: 'Password must be at least 6 digits long'),
              PatternValidator(r'(?=.*?[#?!@$%^&*-])', errorText: 'Passwords must have at least one special character')
            ]),
          ),
          SizedBox(
            height: 4.5.h,
          ),
          SizedBox(
            width: 70.w,
            child: Row(
              mainAxisAlignment: MainAxisAlignment.start,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                CustomCheckbox(
                  iconColor: Colors.black,
                  activeColor: const Color.fromARGB(255, 3, 218, 197),
                ),
                SizedBox(
                  width: 3.w,
                ),
                Text(
                  "Remember me",
                  style: Theme.of(context).textTheme.bodyText2,
                )
              ],
            ),
          ),
          SizedBox(
            height: 4.5.h,

          ),
          AuthButton(
            text: "Log In",
            onPressed: (){
              if (isInternetDisconnected(context)){
                showAlertBox(context);
              } else{
                if (_formkey.currentState!.validate()){
                  AuthenticationAPI(auth: FirebaseAuth.instance).signInWithEmail(emailController.text, passwordController.text);
                  //return navigation
                }

              }
            }
          ),
          SizedBox(
            height: 3.2.h,
          ),
          ClickableText(
            text: "Forgot Password ?",
            onPressed: () {
              if (isInternetDisconnected(context)){
                showAlertBox(context);
              } else{
                //return navigation
              }
            },
          ),
          SizedBox(
            height: 3.2.h,
          ),
          const AuthDivider(
            text: "OR",
          ),
          SizedBox(
            height: 2.h,
          ),
          SizedBox(
            width: 70.w,
            child: Row(
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                ClickableImage(
                  imagePath: "assets/images/icon/Facebook.png",
                  width: 23.w,
                  onPressed: () {
                    null;
                  },
                ),
                ClickableImage(
                  imagePath: "assets/images/icon/Instagram.png",
                  width: 23.w,
                  onPressed: () {
                    null;
                  },
                ),
                ClickableImage(
                  imagePath: "assets/images/icon/Tiktok.png",
                  width: 23.w,
                  onPressed: () {
                    null;
                  },
                ),
              ],
            ),
          ),
          SizedBox(
            height: 4.h,
          ),
          SizedBox(
            width: 70.w,
            child: Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Text(
                  "Don't have an account ? ",
                  style: Theme.of(context).textTheme.bodyText2,
                ),
                ClickableText(
                  text: 'Sign up Now !',
                  onPressed: () {
                    if (isInternetDisconnected(context)){
                      showAlertBox(context);
                    } else{
                      Navigator.of(context).pushNamed("/signup1");
                    }
                  },
                ),
              ],
            ),
          ),
        ],
      ),
    ),
);
  }
}

Thanks for your suggestion,
Chris

A: try wrapping textformfield with container and giving it height and width

A: Try wrapping TextFormField with container and give it height and width.


text:
Q: using guice with servlet-api 3.1 I'm trying Guice 3.0 in my test web project. I've registered GuiceFilter and GuiceServletContextListener in web.xml. Than I've created and registered a servlet within ServletModule:
public class MyModule extends AbstractModule {

    @Override
    protected void configure() {
        install(new ServletModule() {
            @Override
            protected void configureServlets() {
                serve("/enter").with(Dispatcher.class);
            }
        });
        bind(Logger.class).toInstance(Logger.getLogger("myLogger"));
    }
}

Dispather is called as expected, but when it forwards to JSP page I get an error:
request.getRequestDispatcher("/persons.jsp").forward(request, response);
    org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: [56] in the generated java file: [C:\Users\user\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\work\Catalina\localhost\web1\org\apache\jsp\persons_jsp.java]
The method getDispatcherType() is undefined for the type HttpServletRequest

Stacktrace:
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:199)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:450)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:361)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    servlets.Dispatcher.showPersons(Dispatcher.java:81)
    servlets.Dispatcher.process(Dispatcher.java:50)
    servlets.Dispatcher.doGet(Dispatcher.java:86)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
    com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
    com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
    com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
    com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
    com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)

I believe this is due to incapability of servlet-api 3.1 used by Tomcat 8.0 and servlet-api 2.5 used by guice.
Is there any solution to this problem without downgrading my app server to servlet-api 2.5?
Tomcat's docs say that latest version that used 2.5 was Tomcat 6.
Update:
As it turns out servlet-api is declared in guice-servlet as "provided" dependency. All I had to do is declare my dependencies properly to omit this lib. My current configuration using ivy:
<ivy-module version="2.0">
    <info organisation="myorg" module="mymodule"/>
    <dependencies defaultconfmapping="*->default">
        <dependency org="com.google.inject" name="guice" rev="3.0"/>
        <dependency org="org.hibernate" name="hibernate-core" rev="4.3.8.Final"/>
        <dependency org="com.google.inject.extensions" name="guice-servlet" rev="3.0"/>
    </dependencies>
</ivy-module>


text:
Q: d'Alembert Lagrangian for second rank tensors
Consider the Lorentz scalar Lagrange density
  $$\mathcal{L}=\eta^{\mu\nu}\partial_\mu T^{\alpha\beta}\partial_\nu T_{\alpha\beta}$$
  for a second rank tensor whose contravariant and covariant components are $T^{\alpha\beta}$, $T_{\alpha\beta}$ respectively. By varying with respect to each component $T^{\alpha\beta}$ separately, show that the set of generalized Euler-Lagrange equations for $\mathcal{L}$ give the set of equations of motion
  $$\square^2T^{\alpha\beta}=0, \quad \text{for } \alpha,\beta=0,1,2,3.$$

In the previous statement, we have that $\eta^{\mu\nu}$ is the metric tensor defined as
$$\eta^{\mu\nu}\left\{
\begin{array}{ccl}
1 &\text{if}& \nu=\mu=0, \\
-1 &\text{if}& \nu=\mu=1,2,3, \\
1 &\text{if}& \nu\neq\mu, \\
\end{array}
\right. $$
and $\partial_\mu$ is the $4-$gradient given by
$$\partial_\mu=\frac{\partial }{\partial x^\mu}.$$
Firstly, we can express the Lagrange density as
$$\mathcal{L}=\eta^{\mu\nu}\partial_\mu T^{\alpha\beta}\partial_\nu T_{\alpha\beta}=\eta^{\mu\nu}\eta^{\alpha\rho}\eta^{\beta\sigma}\partial_\mu T_{\rho\sigma}\partial_\nu T_{\alpha\beta}.$$
We want to find an expression of the Euler-Lagrange equations
$$\frac{\partial \mathcal{L}}{\partial T_{\alpha\beta}}-\partial_\mu \left(\frac{\partial \mathcal{L}}{\partial (\partial_\mu T_{\alpha\beta})}\right)=0, \quad \text{ for } \alpha,\beta=0,1,2,3,$$
in terms of our Lagrange density. Observe that, since $\mathcal{L}$ does not depend explicitly on $T_{\alpha\beta}$ (the dependance is on their derivatives), the first term is zero. On the other hand,
$$\frac{\partial \mathcal{L}}{\partial (\partial_\mu T_{\alpha\beta})}=\frac{\partial }{\partial (\partial_\mu T_{\alpha\beta})}\left(\partial_\mu T_{\rho\sigma}\partial_\nu T_{\alpha\beta}\right)=\frac{\partial(\partial_\mu T_{\rho\sigma})}{\partial(\partial_\mu T_{\alpha\beta})}\partial_\nu T_{\alpha\beta}+\frac{\partial(\partial_\nu T_{\alpha\beta})}{\partial(\partial_\mu T_{\alpha\beta})}\partial_\mu T_{\rho\sigma}.$$
However, I do not know how to proceed from here because this index notation still confuses me. The result should be $2\partial^\mu T^{\alpha\beta}$ and, if I arrive to that point, I know how to conclude the problem.
Can anyone explain to me how these derivatives give the right answer? I insist that this is the first time I encounter the sum Einstein convention. Thank you in advance.

A: Having said that this is not the way I would carry out a variation, you are almost there. Take $\partial_{\alpha}T_{\mu \nu}=T_{\mu \nu,\alpha}$, then
$$
\frac{\partial \mathcal{L}}{\partial T_{\mu \nu,\alpha}}=\eta^{\rho \sigma}\eta^{\lambda \beta} \eta^{\tau \gamma} \frac{\partial }{\partial T_{\mu \nu,\alpha}} (T_{\lambda \tau,\rho}T_{\beta \gamma,\sigma})=\eta^{\rho \sigma}\eta^{\lambda \beta} \eta^{\tau \gamma} (\delta^{\mu}_{\lambda}\delta^{\nu}_{\tau}\delta^{\alpha}_{\rho}T_{\beta \gamma,\sigma}+\delta^{\mu}_{\beta}\delta^{\nu}_{\gamma}\delta^{\alpha}_{\sigma}T_{\lambda \tau,\rho})
$$
if you use that $\eta$ is symmetric in its indeces, you can change the index name of one term in the parenthesis so as to add it to the other and get
$$
\frac{\partial \mathcal{L}}{\partial T_{\mu \nu,\alpha}}=2\eta^{\mu \beta}\eta^{\nu \gamma}\eta^{\alpha \sigma}T_{\beta \gamma,\sigma}
$$
then
$$
0=\partial_{\alpha}\frac{\partial \mathcal{L}}{\partial T_{\mu \nu,\alpha}}=2\eta^{\mu \beta}\eta^{\nu \gamma}\eta^{\alpha \sigma}\partial_{\alpha}\partial_{\sigma}T_{\beta \gamma}=2\eta^{\mu \beta}\eta^{\nu \gamma} \square (T_{\beta \gamma}).
$$
Let me remark a few things: first this derivation is completely general so that you can take any metric $g$ in place of $\eta$, second when you use indeces try not to repeat those in formulas when making substitution like you did in the calculation of $\frac{\partial \mathcal{L}}{\partial T_{\mu \nu,\alpha}}$ since when you use Einstein convention (i.e. repeated indeces are summed over) then
$$
\frac{\partial T_{\mu \nu,\alpha}}{\partial T_{\mu \nu,\alpha}} = \sum_{\mu,\nu,\alpha =0}^3\delta^{\mu}_{\mu}\delta^{\nu}_{\nu}\delta^{\alpha}_{\alpha}=4\cdot 4\cdot 4=64.
$$
In general a good way to check the notational correctedness of your formula is to ensure that to each free index (i.e. not repeated index) in the left hand side there is the same free index in the right hand side.


text:
Q: "The system is running in low-graphic mode" issue on ubuntu 16.04 after booting This morning I booted my Ubuntu partition through Grub as normal, but instead of going to the log in screen, it showed the black page with error message "The system is running in low-graphic mode". I haven't installed anything yesterday so this is unexpected.
I have tried various things to solve it following what people suggested but nothing seemed to work:
some info on the system:
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:    16.04
Codename:   xenial
eric@eric-ThinkPad-P50s:~$ sudo lshw -C display
[sudo] password for eric:
*-display UNCLAIMED
   description: VGA compatible controller
   product: Skylake GT2 [HD Graphics 520]
   vendor: Intel Corporation
   physical id: 2
   bus info: pci@0000:00:02.0
   version: 07
   width: 64 bits
   clock: 33MHz
   capabilities: pciexpress msi pm vga_controller bus_master cap_list
   configuration: latency=0
   resources: memory:f0000000-f0ffffff memory:e0000000-efffffff
ioport:e000(size=64) memory:c0000-dffff
*-display UNCLAIMED
   description: 3D controller
   product: GM108GLM [Quadro K620M / Quadro M500M]
   vendor: NVIDIA Corporation
   physical id: 0
   bus info: pci@0000:06:00.0
   version: a2
   width: 64 bits
   clock: 33MHz
   capabilities: pm msi pciexpress cap_list
   configuration: latency=0
   resources: memory:f1000000-f1ffffff memory:c0000000-cfffffff
memory:d0000000-d1ffffff ioport:d000(size=128)

To get to a terminal, I logged into the safemode, and failsafeX, but using CTRL+ALT+F1 did not bring me to the terminal. After I click on failsafeX, I got brought back to the menu where I could choose, "resume", which I did, and I ended up logging as a guest.
Then from the terminal, I tried:
sudo apt-get update
sudo apt-get upgrade

rebooted, issue still there
Then I tried
sudo apt-get install nvidia-current - More stable/tested version
sudo apt-get install nvidia-current-updates - More up-to-date version

same.
I also tried:
sudo apt-get -d install --reinstall gdm
sudo apt-get remove --purge gdm
sudo apt-get install gdm
sudo reboot

Same issue still there.
Help would be much appreciated because I am out of options
Cheers
E.

A: I apparently solved it by installing:
https://01.org/linuxgraphics/downloads/intel-graphics-update-tool-linux-os-v2.0.2
it requires to install gdebi
https://01.org/linuxgraphics/documentation/running-update-tool-using-gdebi
after update and reboot, the error disappeared.
E.


text:
Q: Make all command returns error when installing prover9 I am trying to install the automated theorem prover prover9 on Ubuntu 20.10. So I went to this page and downloaded the file "LADR-2009-11A.tar.gz". Then, I followed the instructions on this page and executed the lines
zcat LADR-2009-11A.tar.gz | tar xvf -
cd LADR-2009-11A
make all

Unfortunately, the third line results in an error: "undefined reference to round" (I think).
The full output message is here:
     ~/Downloads/LADR-2009-11A$ make all
  cd ladr         && make lib
make[1]: Entering directory '/home/utente/Downloads/LADR-2009-11A/ladr'
make libladr.a
make[2]: Entering directory '/home/utente/Downloads/LADR-2009-11A/ladr'
make[2]: 'libladr.a' is up to date.
make[2]: Leaving directory '/home/utente/Downloads/LADR-2009-11A/ladr'
make[1]: Leaving directory '/home/utente/Downloads/LADR-2009-11A/ladr'
cd mace4.src    && make all
make[1]: Entering directory '/home/utente/Downloads/LADR-2009-11A/mace4.src'
cd ../ladr && make libladr.a
make[2]: Entering directory '/home/utente/Downloads/LADR-2009-11A/ladr'
make[2]: 'libladr.a' is up to date.
make[2]: Leaving directory '/home/utente/Downloads/LADR-2009-11A/ladr'
make clean
make[2]: Entering directory '/home/utente/Downloads/LADR-2009-11A/mace4.src'
/bin/rm -f *.o
make[2]: Leaving directory '/home/utente/Downloads/LADR-2009-11A/mace4.src'
make libmace4.a
make[2]: Entering directory '/home/utente/Downloads/LADR-2009-11A/mace4.src'
gcc  -O -Wall   -c -o estack.o estack.c
gcc  -O -Wall   -c -o util.o util.c
gcc  -O -Wall   -c -o print.o print.c
print.c: In function 'p_model':
print.c:114:6: warning: format not a string literal and no format arguments [-Wformat-security]
  114 |      printf(s2);
      |      ^~~~~~
print.c:119:8: warning: format not a string literal and no format arguments [-Wformat-security]
  119 |        printf(s3);
      |        ^~~~~~
print.c:137:4: warning: format not a string literal and no format arguments [-Wformat-security]
  137 |    printf(s2);
      |    ^~~~~~
print.c:145:8: warning: format not a string literal and no format arguments [-Wformat-security]
  145 |        printf(s3);
      |        ^~~~~~
gcc  -O -Wall   -c -o syms.o syms.c
gcc  -O -Wall   -c -o ground.o ground.c
gcc  -O -Wall   -c -o arithmetic.o arithmetic.c
gcc  -O -Wall   -c -o select.o select.c
select.c: In function 'select_concentric_band':
select.c:236:5: warning: type of 'min_id' defaults to 'int' [-Wimplicit-int]
  236 | int select_concentric_band(min_id, max_id, max_constrained)
      |     ^~~~~~~~~~~~~~~~~~~~~~
select.c:236:5: warning: type of 'max_id' defaults to 'int' [-Wimplicit-int]
select.c:236:5: warning: type of 'max_constrained' defaults to 'int' [-Wimplicit-int]
gcc  -O -Wall   -c -o propagate.o propagate.c
gcc  -O -Wall   -c -o mstate.o mstate.c
gcc  -O -Wall   -c -o negpropindex.o negpropindex.c
gcc  -O -Wall   -c -o negprop.o negprop.c
gcc  -O -Wall   -c -o ordercells.o ordercells.c
gcc  -O -Wall   -c -o commandline.o commandline.c
gcc  -O -Wall   -c -o msearch.o msearch.c
msearch.c: In function 'next_domain_size':
msearch.c:850:5: warning: type of 'n' defaults to 'int' [-Wimplicit-int]
  850 | int next_domain_size(n)
      |     ^~~~~~~~~~~~~~~~
ar rs libmace4.a estack.o util.o print.o syms.o ground.o arithmetic.o select.o propagate.o mstate.o negpropindex.o negprop.o ordercells.o commandline.o msearch.o
make[2]: Leaving directory '/home/utente/Downloads/LADR-2009-11A/mace4.src'
gcc  -O -Wall   -c -o mace4.o mace4.c
mace4.c: In function 'init_attrs':
mace4.c:36:7: warning: variable 'id' set but not used [-Wunused-but-set-variable]
   36 |   int id;
      |       ^~
gcc  -O -Wall -o mace4 mace4.o libmace4.a ../ladr/libladr.a
/bin/mv mace4 ../bin
make[1]: Leaving directory '/home/utente/Downloads/LADR-2009-11A/mace4.src'
cd provers.src  && make all
make[1]: Entering directory '/home/utente/Downloads/LADR-2009-11A/provers.src'
cd ../ladr && make libladr
make[2]: Entering directory '/home/utente/Downloads/LADR-2009-11A/ladr'
make libladr.a
make[3]: Entering directory '/home/utente/Downloads/LADR-2009-11A/ladr'
make[3]: 'libladr.a' is up to date.
make[3]: Leaving directory '/home/utente/Downloads/LADR-2009-11A/ladr'
make[2]: Leaving directory '/home/utente/Downloads/LADR-2009-11A/ladr'
make clean
make[2]: Entering directory '/home/utente/Downloads/LADR-2009-11A/provers.src'
/bin/rm -f *.o
make[2]: Leaving directory '/home/utente/Downloads/LADR-2009-11A/provers.src'
cd ../mace4.src && make libmace4
make[2]: Entering directory '/home/utente/Downloads/LADR-2009-11A/mace4.src'
make libmace4.a
make[3]: Entering directory '/home/utente/Downloads/LADR-2009-11A/mace4.src'
make[3]: 'libmace4.a' is up to date.
make[3]: Leaving directory '/home/utente/Downloads/LADR-2009-11A/mace4.src'
make[2]: Leaving directory '/home/utente/Downloads/LADR-2009-11A/mace4.src'
make clean
make[2]: Entering directory '/home/utente/Downloads/LADR-2009-11A/provers.src'
/bin/rm -f *.o
make[2]: Leaving directory '/home/utente/Downloads/LADR-2009-11A/provers.src'
gcc  -O -Wall   -c -o prover9.o prover9.c
gcc  -O -Wall   -c -o index_lits.o index_lits.c
gcc  -O -Wall   -c -o forward_subsume.o forward_subsume.c
gcc  -O -Wall   -c -o demodulate.o demodulate.c
gcc  -O -Wall   -c -o pred_elim.o pred_elim.c
gcc  -O -Wall   -c -o unfold.o unfold.c
gcc  -O -Wall   -c -o semantics.o semantics.c
gcc  -O -Wall   -c -o giv_select.o giv_select.c
gcc  -O -Wall   -c -o white_black.o white_black.c
gcc  -O -Wall   -c -o actions.o actions.c
gcc  -O -Wall   -c -o search.o search.c
gcc  -O -Wall   -c -o utilities.o utilities.c
gcc  -O -Wall   -c -o provers.o provers.c
gcc  -O -Wall   -c -o foffer.o foffer.c
gcc  -O -Wall -lm -o prover9 prover9.o index_lits.o forward_subsume.o demodulate.o pred_elim.o unfold.o semantics.o giv_select.o white_black.o actions.o search.o utilities.o provers.o foffer.o ../ladr/libladr.a
/usr/bin/ld: search.o: in function `search':
search.c:(.text+0x66ef): undefined reference to `round'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:66: prover9] Error 1
make[1]: Leaving directory '/home/utente/Downloads/LADR-2009-11A/provers.src'
make: *** [Makefile:7: all] Error 2

I searched and searched, but I am but a humble user. I would be very grateful if somebody could tell me how to solve the error.

A: This doesn't have anything to do with make.  Your code is not safe, and the compiler is warning you about it.  Instead of what you have you should be writing:
printf("%s", s2);

etc.  If you really don't want to do that, you'll have to specifically disable that warning (by adding -Wall you've requested all warnings).
Oh, I see you're worried about the error at the end:
search.c:(.text+0x66ef): undefined reference to `round'

that's because your link line is wrong: you've added -lm at the start of the line.  It needs to be at the end; this:
gcc  -O -Wall -lm -o prover9 prover9.o ... ../ladr/libladr.a

should instead be:
gcc  -O -Wall -o prover9 prover9.o ... ../ladr/libladr.a -lm

Without seeing the makefile rules and variables we can't say how to do this.


text:
Q: InteractiveViewer class in flutter is not defined I was reading about InteractiveViewer from here https://api.flutter.dev/flutter/widgets/InteractiveViewer-class.html
But when I tried to use InteractiveViewer in my code It gave me an error :-
The method 'InteractiveViewer' isn't defined for the type 'MyHomeState'.
Try correcting the name to the name of an existing method, or defining a method named
'InteractiveViewer'.dartundefined_method

My flutter code is below:-
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  static const String _title = "InteractiveViewer Sample";

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: _title,
      home: Scaffold(
        appBar: AppBar(
          title: const Text(_title),
        ),
        body: MystateLessWidget(),
      ),
    );
  }
}

class MystateLessWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(child: MyHome());
  }
}

class MyHome extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return MyHomeState();
  }
}

class MyHomeState extends State<MyHome> {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: InteractiveViewer(
        boundaryMargin: EdgeInsets.all(20.0),
        minScale: 0.1,
        maxScale: 1.6,
        child: Container(
          decoration: BoxDecoration(
            gradient: LinearGradient(
              begin: Alignment.topCenter,
              end: Alignment.bottomCenter,
              colors: <Color>[Colors.orange, Colors.red],
              stops: <double>[0.0, 1.0],
            ),
          ),
        ),
      ),
    );
  }
}

My flutter version is Flutter 1.17.5
and dart version is  Dart 2.8.4
Can you please tell me what is the problem here.

A: The problem is that you are using an old version of flutter.
InteractiveViewer was released in 1.20 version of Flutter
So you need to upgrade your flutter, To upgrade you can use the following command in the command-prompt:-
flutter upgrade

This command gets the most recent version of the Flutter SDK that's available on your current Flutter channel.


text:
Q: Easy Admin: How to customize a field template in the form view? I need to customize a form view field (edit form field) in EasyAdmin bundle. Here's how it's done in the list view:
 - { property: 'images', template: 'custom_template.html.twig'}
How to implement the same thing in the form view (edit mode)? Custom templates don't work for the form view (edit view). So I made a custom field type
- { property: 'images', type: 'App\Form\Type\MyImagesType'}
but don't know how to implement a custom template to it.
class MyImagesType extends CollectionType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
    $form->add($key, FileType::class, ['multiple'=>true, 'required'=>false]);
 }
}

I want to integrate dopzone.js in my form by inserting the script:
<script src="./public/dropzone.js"></script>
<form action="{{ oneup_uploader_endpoint('gallery') }}" class="dropzone" style="width:200px; height:200px; border:4px dashed black">
</form>

A: EasyAdmin relies on Symfony's Form component for anything related to edit/new views. That means that the simple mechanism used in list/show/search to customize the rendering of each property is not available.
As explained in https://symfony.com/doc/master/bundles/EasyAdminBundle/book/edit-new-configuration.html#advanced-design-configuration the alternative is either to override the default templates or create your own form theme.
Hopefully Symfony will make this simpler soon when this proposal is approved and merged: https://github.com/symfony/symfony/issues/29651

A: like this:
# config/packages/easy_admin.yaml
easy_admin:
    entities:
        Customer:
            class: App\Entity\Customer
            form:  # <-- 'form' is applied to both 'new' and 'edit' views
                fields:
                    - 'id'
                    - { property: 'email', type: 'email', label: 'Contact' }
                    # ...
    # ...

check the documentation, its very easy
https://symfony.com/doc/master/bundles/EasyAdminBundle/book/edit-new-configuration.html#the-special-form-view


text:
Q: How do I provide this function's different props based on button's click event? I am attempting to reuse a function to open a modal in Ionic 4. These both work, while separate, but would prefer to combine based on their independent arguments to change the title in the modal that appears.
This does not compile, but shows what I am essentially trying to achieve:
async openModal(edit, add) {
    const modal = await this.modalController.create({
        component: ModalComponent,
        componentProps: {
            if (edit) {
                'title': 'Edit Firehouse'
            else if (add) {
                'title': 'Add Firehouse'
            },
            'firehouseShow': true
        }
    });
    return await modal.present();
}

Here is what is currently in place and does compile even with the error:

'Duplicate function implementation.'

async openModal(edit) {
    const modal = await this.modalController.create({
        component: ModalComponent,
        componentProps: {
            'title': 'Edit Firehouse',
            'firehouseShow': true
        }
    });
    return await modal.present();
}

async openModal(add) {
    const modal = await this.modalController.create({
        component: ModalComponent,
        componentProps: {
            'title': 'AddFirehouse',
            'firehouseShow': true
        }
    });
    return await modal.present();
}

These functions are being called via Angular button click event:
<ion-button (click)="openModal(edit)">Edit</ion-button>
<ion-button (click)="openModal(add)">Add</ion-button>

I would prefer to reuse this function, especially since it's only being called on a single page (at a time). It does however dynamically change what is displayed within the modal and what data is populated, or not populated per click event. For instance the 'add' click event will not retrieve any data, but the 'edit' would.

A: The second one wouldn't work too even duplicated function issue had been solved because both function do the same thing.
Consinder passing the componentProps as parameter.
async openModal(componentProps) {
    const modal = await this.modalController.create({
        component: ModalComponent,
        componentProps
    });
    return await modal.present();
}

And when call a function :
openModal({
 'title': 'Edit Firehouse',
 'firehouseShow': true
})
// or
openModal({
 'title': 'Add Firehouse',
 'firehouseShow': true
})

Update
If you want to get only title as parameter, set a title when create an object.
async openModal(title) {
    const modal = await this.modalController.create({
        component: ModalComponent,
        componentProps : {
          'title': title,
          'firehouseShow': true
      }
    });
    return await modal.present();
}

And then:
openModal('Edit Firehouse')
// or
openModal('Add Firehouse')


text:
Q: how to say something have been hidden in view of people/ scientists When it comes to saying the fact or something have been hidden from views or eyes, what do you say? not from mind. I need some phrase or words used scientifically.
For instance:

The importance of some microorganisms in water has been neglected.

A: I see a few different possibilities here. If the meaning is that something is very easy to notice, but the scientists were focused on something else, you could say something like:

Their first attempts at prairie restorations failed because they ignored the importance of the humble ant in the ecosystem.
Their first attempts at prairie restorations failed because they did not realize/recognize the importance of the humble ant in the ecosystem.

There is a phrase that I think might be useful to you for this type of situation. It is "hiding in plain sight". That is something that you should be able to see, but don't notice because you aren't looking for it. For example:

A new species of spider was just discovered in Central Park in New York City. Usually new species are found in unexplored places, but in this case the spider was hiding in plain sight.


text:
Q: Xamarin.Forms.Droid Resource, Ambiguous Terms/ Build Action's Randomly Changing Missing Resources I'm having issue's with missing resources on builds.
I found why The Rescource.Designer.cs is set to Build to => Compile.
Now If I set it to Android Resource 1 of 2 things happen
Scenario 1:
I get a Ambiguous Error on Debug for
    TabLayoutResource = Resource.Layout.Tabbar;
    ToolbarResource = Resource.Layout.Toolbar;

Resource' is an ambiguous reference between
  'Xamarin.Forms.Platform.Android.Resource' and
  'Plugin.FirebasePushNotification.Resource'

If I Delete bin/obj And Rebuild Then The Build action for Designer is back to => Compile
Scnario 2 I get the Following Error

Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Aapt.targets(3,3):
  Error APT1045: invalid resource directory name:
  MyPath/obj/Release/res/ resource.designer.cs " resource.designer.cs".
  (APT1045)

If anyone can help me with this, There next to no information I can find in regards to these
If I resolve the Ambiguous issue It cant find the Toolbar or Tabbar

A: To solve the Ambiguous error you might want to try use a full name of the class, like:
TabLayoutResource = Xamarin.Forms.Platform.Android.Resource.Layout.Tabbar;

or aliases:
using AndroidRs = Xamarin.Forms.Platform.Android.Resource;
...
TabLayoutResource = AndroidRs.Layout.Tabbar;

Also you can refer to official doc for more options


text:
Q: Flow of my spark streaming program Small question about the flow of my spark streaming program.
I have this function :
def parse(msg: String): Seq[String]

Which actually split a "good" message into multiple strings, and, if the string is "bad", returns an empty Seq.
I'm reading the messages from a kafka topic, and I want to send the results of the parsing into two different topics:
If the message is "good", send the result of the parsing to the topic "good_msg_topic"
If the message is "bad", send the "bad" message to the topic "bad_msg_topic"
To achieve that, I did this :
stream.foreachRDD(rdd => {
  val res = rdd.map(msg => msg.value() -> parse(msg.value()))

  res.foreach(pair => {
    if (pair._2.isEmpty) {
      producer.send(junkTopic, pair._1)
    } else {
      pair._2.foreach(m => producer.send(splitTopic, m))
    }
  })
})

However, I feel like this is not optimal. Using a Map Object to associate the original message to the result may slow down the process...
I'm beginning with Spark and Scala, so I think one could do better.
Any idea on how I could improve that ? Changing the signature of the parse function if also possible if you think it's better.
Thank you

A: I wouldn't be too concerned regarding performance if you haven't already measured this and found a bottleneck.
One thing I can think of which might make this code clearer is to use an ADT to describe the result type:
sealed trait Result
case class GoodResult(seq: Seq[String]) extends Result
case class BadResult(original: String) extends Result

Have parse return Result
def parse(s: String): Result

And then use map on DStream instead of RDD:
stream
.map(msg => parse(msg.value())
.foreachRDD { rdd =>
   rdd.foreach { result =>
     result match {
       case GoodResult(seq) => seq.foreach(value => producer.send(splitTopic, value))
       case BadResult(original) => producer.send(junkTopic, original)
     }
   }
}


text:
Q: Linux - importing "." or "::" within the root PATH I am looking into Miscellaneous Config and I am researching roots PATH.
I am told that "." and "::" should be removed from the path as it is a security threat.
I have the following example output of the PATH command: /usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java7_64/jre/bin:/usr/java7_64/bin:/opt/IBM/xlC/13.1.3/bin
If this output was to contain "::" or "." how would it look like withinin the above path so I can have an idea on how it will be structured as I am not sure.
Really appreciate the help on this one.


text:
Q: Accessibility tools return the error "A referral was returned by the server" Whenever I try to run the onscreen keyboard (or any other of Windows' "ease-of-access" utilities), I get the error message A referral was returned by the server, then Windows asks me if I want to delete the (supposedly) broken shortcut.
They used to work, and even now, they sometimes do work, but usually do not. I have not noticed any obvious patterns of when they do work or what might have changed between the time(s) that they do and do not work.
Researching the problem has been fruitless because the (relatively) few pages that mention the error usually end up with just wild guesses, some unrelated discussion of other third-party software, and always end up without a solution.
What could be the problem, and how can it be fixed?

A: Solution
I had this problem for a few months and eventually figured it out with a bit of testing. It turns out the problem occurs if the Cryptographic service is not running. Simply run the Cryptographic service, and the ease-of-access tools will run just fine.
Technical Explanation
Security
So why do the accessibility tools require the Cryptographic service? It's because the accessibility tools are required to be accessible at any point in the system since they provide functionality to allow people to, well, access the system. Therefore, they would not be of much use if they were unavailable in restricted, elevated-privilege areas such as the login screen or UAC dialog.
Because they need to be available everywhere, including restricted areas, they must also be secure to prevent opening an attack vector which can be exploited to take advantage of the restricted areas. To do that, Windows must validate the program by checking its digital signature. To do this, it requires the Cryptographic service.
One might think that it should not need to do this when running in the regular, user-mode areas on the desktop and such, but trying to run it unconditionally in user-mode and trying to validate only in elevated areas would unnecessarily complicate it, which in turn creates more possibility of vulnerabilities. As such, Windows always validates the accessibility tools when run, and therefore always needs the Cryptographic service.
Programming Defect
(Of course it could be argued that it should run the service if it's not already running. Good design practice would dictate that programs always check for dependencies, install or run them if not available, and return an appropriate message if they cannot. If they had done that, then this problem wouldn't have occurred because it would automatically run the Cryptographic service and/or give an error that makes it clear exactly what the problem is as opposed to such a cryptic message.)
Other Symptoms
Also, note that if the Cryptographic service is not running, you may experience other security-related issues such as running things elevated not displaying the UAC dialog. For example, clicking the System protection link in My Computer may show the wait-cursor for a moment, then nothing happens and now clicking anywhere in the My Computer window causes Windows to ding (i.e., it is disabled). This is because consent.exe tries to run in order to show the UAC prompt, but without the Cryptographic service running, it cannot perform its task and just hangs. To fix it, you need to open the Task Manager and kill consent.exe. You will get an Incorrect function error message, and My Computer once again becomes enabled. (You still need to run the Cryptographic service to get it to actually work.)


text:
Q: SVN update a working copy when parents are updated I have two SVN branches and I plan to partially copy the first working copy to another. I did this:

*

*Libs /home/user/projects/libs/{lib1, lib2, lib3}

*Core /home/user/projects/Apps/{libs,core}

    svn copy --parents /home/user/projects/libs/lib1/* /home/user/projects/Apps/libs/1
    svn copy --parents /home/user/projects/libs/lib2/* /home/user/projects/Apps/libs/2
    svn copy --parents /home/user/projects/libs/lib3/* /home/user/projects/Apps/libs/3

The question:
My peers are still working on /home/user/projects/libs/lib1, and when this repository is updated with new codes, I want my /home/user/projects/Apps/libs also updated. Is there any way to do that "automatically"?
I tried to do with the same svn copy command, and of course it fails with:
svn: Path '/home/user/projects/Apps/libs/1' already exists

A: I can only think on merge: svn help merge

A: No, it won't be updated automatically.
You may consider using svn:externals instead


text:
Q: Alternative to Copy Features in ModelBuilder to display a result I have created a model that takes in a raster, converts it to a point shapefile, then extracts a set of points based on location, then further selects a set of points based on a SQL expression. I tried to run it once but it was taking absolutely forever. I would have thought this step to be akin to 'Export Data' in the regular window. Is this the right method? Current model creation below.
The goal of this procedure is to find a region of high density crops in a selected country. I will eventually need to determine the coordinate footprint of the area so I can export that information to fine tune a forecast model to focus on that particular area.

A: Use the Select tool

Extracts features from an input feature class or input feature layer,
  typically using a select or Structured Query Language (SQL) expression
  and stores them in an output feature class.


text:
Q: Como Capturar esse array Eu estou tentando fazer uma API.
Esse é o meu código:
require('conexao/conexao.php');

$jsonObj= array();

$query="SELECT * FROM filmes";
$sql = mysql_query($query)or die(mysql_error());

while($data = mysql_fetch_assoc($sql))
{
    $row[] = $data;
    header("Content-type:application/json");
    array_push($jsonObj,$row);

}

Estou tentando pegar os dados da API com o código abaixo, porém não me retorna nada:
$url = "http://fimhd.com.br/api.php";
$captura = file_get_contents($url);

$json = json_decode($captura);

var_dump($json);

A: É necessário que você imprima o conteúdo na tela. Para isso você terá que utilizar duas funções: json_encode e echo.
O array_push servirá apenas para adicionar o resultado da variável $row no array $jsonObj, mas ele não é responsável pela impressão.
Segue código de exemplo.
<?php

require('conexao/conexao.php');

$jsonObj= array();

$sql = mysql_query("SELECT * FROM filmes") or die(mysql_error());

while($data = mysql_fetch_assoc($sql))
{
    $row[] = $data;
    array_push($jsonObj,$row);
}

header("Content-type:application/json");
echo json_encode($jsonObj);

O json_encode servirá para transformar o array $jsonObj para uma string no formato json e o echo será para imprimir essa string na tela.


text:
Q: Special cookies to login by WebRequest method in C# I try this code to get a cookie from a website
CookieCollection cookies = new CookieCollection();
CookieContainer cooki = new CookieContainer();
HttpWebRequest request = (HttpWebRequest) WebRequest.Create(weburl.Text);
request.CookieContainer = cooki;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader read = new StreamReader(response.GetResponseStream());
request.CookieContainer = cooki;
request.CookieContainer.Add(cookies);
cookies = response.Cookies;

if(response.Cookies != null &&  response.Cookies.Count != 0)
{
    foreach(Cookie c in response.Cookies)
        listBox2.Items.Add(c.ToString());

}
else
        listBox2.Items.Add("No Cookies");

But when i try this for a website like http://www.cloob.com nothing happens.
I try this site by webbrowser in C# and tried this code
string cooki = webbrowser1.Document.Cookie.tostring();

and I got a lot of information like this:

Cookie=LMOT=1343810524; IdM=no;
  __utma=204761026.19745671.1343776441.1343805546.1343810526.4; __utmz=204761026.1343776441.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); CR=%7B%22online_count%22:%5B%7B%22count%22:8059,%22status%22:%22available%22%7D,%7B%22count%22:%221204%22,%22status%22:%22invisible%22%7D,%7B%22count%22:%2276%22,%22status%22:%22busy%22%7D%5D%7D;
  m_id=1343781310_7982757; LCCT=1343809271; __utmb=204761026;
  __utmc=204761026

Now how can I get this by webrequest?

A: While your code is a little redundant redundant I don't see anything wrong with it. It works for me when I tested it against http://www.google.com/. http://www.cloob.com might possibly be setting cookies in javascript, which would explain why you can see the cookies in a WebBrowser object but not with a WebRequest.


text:
Q: PHP and XML attributes follow up how can i get the attribute values for seconds using php:
<yt:duration seconds='12445'/>

this is what i have done so far:
        $xmlstr  = file_get_contents($xml);
    $xml_content = new SimpleXMLElement($xmlstr);
    echo $xml_content->xpath('//yt:duration')->attributes;
    print_r($xml_content->xpath('//yt:duration'));
    echo $xml_content->xpath('//yt:duration')->attributes()->seconds;

which displays these messages:
Notice: Trying to get property of non-object in C:\xampp\htdocs\ytm\xmlTest.php on line 22
Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [seconds] => 12445 ) ) )
Notice: Trying to get property of non-object in C:\xampp\htdocs\ytm\xmlTest.php on line 24

Notice: Trying to get property of non-object in C:\xampp\htdocs\ytm\xmlTest.php on line 24

A: This:
$xml_content->xpath('//yt:duration')

Returns an array (as your print_r() will tell you). You'll have to grab the first element (at index 0) in order to work with the SimpleXMLElement that corresponds to the <yt:duration> node:
$list = $xml_content->xpath('//yt:duration');
$node = $list[0];

Then, you can get the attibutes with attributes():
$attributes = $node->attributes();
echo $attributes['seconds']; // Not 100% sure on this, might be $attributes->seconds