text:
Q: How to find all and replace all on blogspot html editor? on blogspot html editor code I search for specific code using ctrl+F shortcut, but I want to replace all the results with other code
How to do that, please?

A: HTML is basically just text.
As such, you can use any 'text editor' you want and just copy the source code into the HTML editor once you are done.
A good tool I'm using on Windows is Notepad++, which has support for syntax highlighting, auto completion features and, to get back to your question, it supports searching/replacing with a variety of options, including by using regular expressions.

A: Use the shortcut  CTRL + SHIFT + F  to  find and replace on Blogger Editor


text:
Q: How do I wrap the zsh completion list with a fixed line of text before and after? Specifically, I'd like to arrange for all completion lists (under the :completion:* context) to be preceded and followed by a fixed string (say "ABC" for the moment) on its own line.
I have tried a variety of approaches, and I'm able to get the preceding line but not the following one. The best approaches are

*

*Use the array comppostfunc in _main_complete. Including a function that uses _message -r to print out the line. But comppostfun is executed at the end of _main_complete but apparently before the list is created, giving the string at the beginning not the end.

*Create new completers -- a clone of _complete that returns 1 and a completer that just does _message. The idea being that the _message completer comes last.
This works to a point but again the string comes at the beginning of the completion list.

*Adapt 1 or 2 by playing with the tag-order style to put messages at the end. This does not work.

*Create a variant of the _complete completer that does its normal action (_normal in one case) and ends with a _message. Again this does both but always puts the message first. Playing with tag-order does not change this.
I feel I'm missing something. For instance, is there a way to specify a completer style in which the output of several completers is concatenated? Why doesn't doing several actions within a completer produce the completion list in order? How to get tag-order style to put the _message output at the end?

A: The tag-order style does not change the order of the output. What you need to use is the group-order style. In addition, your beginning and end messages will need to have different group-names. See http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Standard-Styles for more info.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Scala anorm running query to postgreSQL with set role command I need to execute query in PostgreSQL using anorm. In order to handle authorization I have to set role along with query. My query is as follows.
set role myuser; select country from country_list
This works fine when executed directly in postgress. But when tried via anorm gives me no result found exception PSQLException: No results were returned by the query.
But this is working fine when set role command is removed.
Code working fine
import anorm.SqlParser._
SQL("select country from country_list").as(str("name").*)

Code throwing exception
import anorm.SqlParser._
SQL("set role myuser; select country from country_list").as(str("name").*)

Exception
org.postgresql.util.PSQLException: No results were returned by the query.
        at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:115)
        at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
        at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
        at anorm.Sql.$anonfun$resultSet$2(Anorm.scala:78)

A: Did you try by running the 2 queries one after the other? Usually libraries like Anorm expect one query at a time.
SQL("set role myuser").execute()
SQL("select country from country_list").as(str("name").*)


text:
Q: Filtering a data frame by values in a column using wildcards From this post I was made aware you can filter data out of a data frame based on a value using data frame indexing.
e.g.:
studentdata[studentdata$Drink == 'water',]

How would I perform the same task but filter for e.g. water_cold and water_hot?
This does not work
studentdata[studentdata$Drink == 'water*',]

A: You can use str_detect from stringr as such:
library(tidyr)

studentdata %>%
    filter(str_detect(Drink, "water"))


text:
Q: AngularJS - Changing the URL used in $resource.query method I'm using AngularJS to integrate with a REST service which has already been built.
The REST API uses the following form for queries:
http://the.site/person/search/smith%20male (this searches for people called smith who are male)
I'm aware that this form isn't the best and will be ultimately getting the API changed to use a URL parameter.
Currently I'm just defining a resource inside my controller:
$scope.Summary = $resource("http://the.site/person/search");
this.Summary.query({ terms : 'smith male' });

but that generates URL's of the form /person/Search?terms=smith%20male
Is there a way to modify or override the URL used? I'm more familiar with Backbone where I was able to provide a url() function in my which generated the correct form of URL.

A: $scope.Summary = $resource("http://the.site/person/search/:terms");
this.Summary.query({ terms : 'smith male' });


text:
Q: "confer" ("cf.") vs "see also" I used to think that "confer" ("cf.") is to be used to refer to another source discussing the same issue, or making the same argument etc. But it seems some (many?) people use it instead of "see also", so that the additional source discusses something else that is merely related.
So, which should I use when? Also, are there other, similar expressions used in academic writing which I might want to consider?

A: comment reposted as an answer, extracted and edited for brevity from https://en.wikipedia.org/wiki/Citation_signal :
Signals that indicate support:
[no signal] - a simple citation of another source.
'e.g' (exempli gratia) = 'for example'.
'accord' is used to introduce other supporting sources to follow up previous citations.
'see' indicates that the cited authority clearly supports, but does not directly state, the proposition.
'see also' indicates additional material that supports the proposition, less directly than 'see' or 'accord'.
'cf.' (Latin 'confer') = 'compare': points to a different proposition, but one sufficiently analogous to lend support.
There are other signals which suggest that cited sources contain background material, or contradiction.


text:
Q: How to convert a byte array to pdf I am building an app that modifies a word 2010 document and it should be downloaded as pdf.I write a code to convert word to pdf but it is converting the document I upload not the modified word. How can I convert modified word to PDF.Below is the function which  is not converting modified word.
 protected void btnUpload_Click(object sender, EventArgs e)
        {
        if (FileUploadControl.HasFile)

            {
                string fileNameFromUser = FileUploadControl.FileName;
                var fiFileName = new System.IO.FileInfo(fileNameFromUser);

                using (MemoryStream ms = new MemoryStream())
                {
                    ms.Write(FileUploadControl.FileBytes, 0, FileUploadControl.FileBytes.Length);

                    using (WordprocessingDocument sDoc = WordprocessingDocument.Open(ms, true))
                    {

                    }
                    lblMessage.Text = "Dokumenti u ngarkua me sukses!";
                    Session["ByteArray"] = FileUploadControl.FileBytes;
                    Session["fileNameFromUser"] = fileNameFromUser;
                }

        }
        byte[] byteArray = (byte[])(Session["ByteArray"]);
        if (byteArray != null)
        {
            try
            {
                using (MemoryStream ms = new MemoryStream())
                {
                    ms.Write(byteArray, 0, byteArray.Length);
                    using (WordprocessingDocument wDoc = WordprocessingDocument.Open(ms, true))
                    {
                        var body = wDoc.MainDocumentPart.Document.Body;
                        var lastParagraf = body.Elements<Paragraph>().LastOrDefault();
                        var newParagraf = new Paragraph(

                            new Run(
                                new Text("Perdoruesi:" + " " + User.Identity.Name)));

                        var newParagraf2 = new Paragraph(

                           new Run(
                               new Text("Data dhe ora:" + " " + DateTime.Now.ToString())));

                        var newParagraf3 = new Paragraph(

                           new Run(
                               new Text("Kodi unik:" + " " + randomstring(14))));

                        var newParagraf4 = new Paragraph(

                          new Run(
                              new Text("Shifra:" )));

                        lastParagraf.InsertAfterSelf(newParagraf);
                        lastParagraf.InsertAfterSelf(newParagraf2);
                        lastParagraf.InsertAfterSelf(newParagraf3);
                        lastParagraf.InsertAfterSelf(newParagraf4);
                    }
                    Session["ByteArray"] = ms.ToArray();
                    lblMessage.Text = "U ngarkua dhe u vulos dokumenti!";

                    Guid pdfFileGuid = Guid.NewGuid();

                    var filePath = Path.GetTempFileName();
                    FileUploadControl.SaveAs(filePath);
                    var appWord = new Microsoft.Office.Interop.Word.Application();
                    var wordDoc = appWord.Documents.Open(filePath);
                    var convertedFilePath = Path.GetTempFileName();
                    wordDoc.ExportAsFixedFormat(convertedFilePath, Microsoft.Office.Interop.Word.WdExportFormat.wdExportFormatPDF);
                    Response.Clear();
                    Response.AddHeader("content-disposition", "attachment; filename=Converted.Pdf");
                    Response.AddHeader("content-type", "application/pdf");
                    Response.TransmitFile(convertedFilePath);
                    File.Delete(filePath);
                    File.Delete(convertedFilePath);
                }
            }
            catch (Exception ex)
            {
                lblMessage.Text = "ERROR:" + ex.Message.ToString();
            }
        }
        else
        {
            lblMessage.Text = "Nuk e keni zgjedhur dokumentin apo formati i dokumentit nuk pershtatet!";
        }
    }

A: Currently, here you load the data from the FileUploadControl into session:
Session["ByteArray"] = FileUploadControl.FileBytes;

You then load the data from session into a MemoryStream that you use to open the document for editing:
    byte[] byteArray = (byte[])(Session["ByteArray"]);
    if (byteArray != null)
    {
        try
        {
            using (MemoryStream ms = new MemoryStream())
            {
                ms.Write(byteArray, 0, byteArray.Length);
                using (WordprocessingDocument wDoc = WordprocessingDocument.Open(ms, true))

At the end of this, after your edits, you copy the updated content back to session:
            lastParagraf.InsertAfterSelf(newParagraf3);
            lastParagraf.InsertAfterSelf(newParagraf4);
        }
        Session["ByteArray"] = ms.ToArray();

but; that's the last time we see session used; you then write the uploaded file to a temporary file, and use that to perform Word automation:
var filePath = Path.GetTempFileName();
FileUploadControl.SaveAs(filePath);
var appWord = new Microsoft.Office.Interop.Word.Application();
var wordDoc = appWord.Documents.Open(filePath);

So yes: this will convert the original file as uploaded, because FileUploadControl is unrelated to the changes you made. Instead, perhaps try:
var filePath = Path.GetTempFileName();
File.WriteAllBytes(filePath, (byte[])Session["ByteArray"]);
var appWord = new Microsoft.Office.Interop.Word.Application();
var wordDoc = appWord.Documents.Open(filePath);

This should then include the changes.

Additional side observations:

*

*Word automation is unsupported and not recommended on web-servers; if it works for you: great, but just be aware that if it suddenly breaks you'll be on your own

*be careful that you're not leaving files scattered on disk, or lots of open Word instances / files; basically: check you're not "leaking" (appWord, wordDoc, filePath, convertedFilePath etc - all probably need some finally love)

*putting Word files into session-state (Session) probably isn't a good or necessary idea; I would recommend just using a local byte[] or similar throughout in this method, and remove Session["ByteArray"] completely


text:
Q: Connect bluetooth scanner to Xamarin.Forms App I want to listen to a bluetooth barcode scanner input events in my Xamarin.Forms app targetted for iOS, Android and UWP.
I found a few GitHub like bluetoothLE, on how to list BLE devices with Xamarin for iOS or Android (it also says it is compatible with UWP), and some hints as to how to register to input, but I couldn't get it to work...
So I was thinking if there was a way to register to ALREADY PAIRED items (which are paired at OS level, before launching the app) and hook up to input events? Does anyone have some suggestions?


text:
Q: How can I replace multiple line breaks with a single ? I am replacing all occurances of \n with the
 tag, but for some reason the text entered has many \n in a row, so I need to combine them.
Basically, if more than 1 \n occur together, replace it with just a single
 tag.
Can someone help me with this?

A: This will replace any sequence of carriage-returns (\r) and/or linefeeds (\n) with a single
:
string formatted = Regex.Replace(original, @"[\r\n]+", "
");

If you only want to replace sequences of two or more items then the simplistic answer is to use the {2,} quantifier (which means "at least two repetitions") instead of + (which means "at least one repetition"):
string formatted = Regex.Replace(original, @"[\r\n]{2,}", "
");

Note that the expression above will treat the common CR+LF combination as a sequence of two items. It's probable that you'll want to treat CR+LF as a single item instead, in which case the expression becomes slightly more complicated:
string formatted = Regex.Replace(original, @"(?:\r\n|\r(?!\n)|(?<!\r)\n){2,}", "
");

A: Use the following code:
str = Regex.Replace(str, @"[\r\n]+", "
");

It could well be faster to call the normal Replace method multiple times and not use a Regex at all, like this:
int oldLength;
do {
    oldLength = str.Length;
    str = str.Replace('\r', '\n');
    str = str.Replace("\n\n", "\n");
} while(str.Length != oldLength);

str = str.Replace("\n", "
");

A: Note that string.Replace() is much faster than using RegEx:
string result = oldString.Replace("\n\n","\n");
result = result .Replace("\n","
");


text:
Q: How to prove this statement about the Fibonacci Sequence using induction? I need to show that for the terms of the fibonnaci sequence, where $n \ge 1$, $a_{n-1} \times a_{n+1} = a_n^2 + (-1)^n$
And the formula to calculate fibonacci numbers where $n \ge 1$ is $a_n = a_{n-1} + a_{n-2}$
I've tried subbing in just about everything starting with the left side, then I tried the right side. I can't get it to work through induction. Which side should I start with? And what should I be substituting to make it equal to the otherside?

A: After covering any base cases, you can do the following:
\begin{eqnarray}
a_{n-1} \color{blue}{a_{n+1}}
&=& a_{n-1}\color{blue}{(a_n+a_{n-1})} \tag{by definition of $a_{n+1}$}\\
&=& a_{n} a_{n-1} + \color{red}{a_{n-1}^2}\tag{distributing $a_{n-1}$}\\
&=& a_{n} a_{n-1} + \color{red}{a_{n-2} a_n - (-1)^{n-1}} \tag{induction hypothesis}\\
&=& a_n\color{blue}{(a_{n-1} + a_{n-2})} - (-1)^{n-1} \tag{factoring out $a_n$}\\
&=& a_n \color{blue}{a_n} - (-1)^{n-1} \tag{by definition of $a_n$}\\
&=& a_n^2 + (-1)^n
\end{eqnarray}


text:
Q: Should one create a new git branch for each issue? As developers, when we are assigned a task, we have two options:
Create one volatile branch for each issue:

*

*Pull master;

*make changes;

*push changes to new remote branch;

*wait for somebody to merge it to master.

or
Use one permanent branch per version:

*

*Merge master to version branch;

*make changes;

*push changes to remote;

*wait for somebody to merge version with master.

Which of these two options is preferable and why?

A:
Use one permanent dev branch per user

Can it happen, that whoever manages your project comes in and decides that another feature is more important, or that you need to fix a bug first? Then one branch per developer is doomed to fail. Or you complete two features and suddenly the feature you completed first is cancelled?
You need one branch per feature. Because priorities change.

A: The common strategy is this: You have a company wide development branch. Any change, you create a branch from development, make your changes, when everything is done you merge the latest version of the development branch into your code so a reviewer won't have any merge problems, you push your branch for review, apply changes due to the review, until it is accepted, and then you merge. You can tag the merged development branch, and most places will remove the new branch once it is merged.

A: It sounds like technical discipline challenges more than management ones.

Mo' branches, mo' problems!

*

*Keep the repository as simple as possible

*

*more branches = greater complexity

*Sharing reveals conflicts sooner

*Make small, incremental changes

*Commit often

*

*No less than every day

*Ideally many times daily

*Pull before any push


text:
Q: Magento2 Migrate Orders History and Product Catalog Including Media I have installed magento 2.2.6 . i want to migrate to magento 2.3.0
for that i have fresh installed magento 2.3.0 on new link.
now is there any way i can migrate all orders histories and product catalog to my new fresh intalled magento.


text:
Q: Create splash screen in the same Activity I need to show splash layout file until operation is completed and than change to main layout.
Here is an example .
@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash_screen);
    //Here app is copying files or something other it doesn't mater.
        RelativeLayout panel = new RelativeLayout(this);
    //Here is creating of main layout

        setContentView(panel);

I need to show splash screen while operations are performing (between two methods setContentView) And than I need to set main layout,
I have tried to do in this way but it shows only black screen and only than shows main layout (panel).
Where is the problem ?
Thx for help in advance.

A: You can do something like this, if you're not doing heavy stuff precisely on  setContentView(R.layout.main)
public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.splash);

    handler = new Handler();

    new AsyncTask<Void, Void, Void>() {

    @Override
    protected Void doInBackground(Void... params) {
            //Do some heavy stuff
            return null;
        }

        @Override
        public void onPostExecute(Void result){
            handler.post(new Runnable(){
                 @Override
                 public void run(){
                     setContentView(R.layout.main);
                 }
            });
        }
   }.execute();
}

EDIT   You can check this True SplashScreen

A: Here is a sample taken from my project:
Layout page, you can customize the progress bar as you want:
`
<ProgressBar
    android:id="@+id/inquiry_progress"
    style="?android:attr/progressBarStyleLarge"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:layout_gravity="center"
    android:visibility="gone"
    android:indeterminateDrawable="@drawable/loading_progress"></ProgressBar>

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:layout_gravity="center_horizontal|center_vertical"
    android:id="@+id/panel_inquiry"
>
   .....

</FrameLayout>

`
Java source code:
private ProgressBar progressBar;
private FrameLayout inquiryFrame;
inquiryFrame=(FrameLayout)findViewById(R.id.panel_inquiry);
progressBar=(ProgressBar)findViewById(R.id.inquiry_progress);
In order to show the splash screen/do work in background
private void callService() {
    progressBar.setVisibility(View.VISIBLE);
    inquiryFrame.setVisibility(View.GONE);
    new ServerReqAsync().execute(this
            , ServiceConstants.getRequestList());

}

When background job completed, just view the activity default layout
progressBar.setVisibility(View.GONE);
inquiryFrame.setVisibility(View.VISIBLE);
Thanks


text:
Q: Manipulating abstract class as template parameter I am trying to implement various sparse matrix formats and manipulate them but I came across a problem which I can't find an answer for.
I have a template class Vector (a math vector) and an abstract template class called Matrix from which all my various matrix formats derive from.
I am trying to create a Vector of Matrix (a tensor) but I can't manage to do so without getting errors. At first, I realised that the following code would not work because a Matrix cannot be instantiated:
Vector<Matrix<double>> tensor;

So I found out here that putting pointers to Matrices would do the job:
Vector<Matrix<double>*> tensor;

However, when I try to manipulate it whith polymorphism, I get compilation errors. For example I am trying to code the following function:
void foo(Vector<Matrix<double>*> &tensor) {//do something}

And I want to be able to use it with a Vector of B, a derived class of Matrix:
Vector<B<double>*> b;
foo(b);

This gives me the following compilation error:
error: could not convert 'b' from 'Vector<B<double>*>' to 'Vector<Matrix<double>*>'

How can I solve this issue?
Thank you for your time !


text:
Q: Removing User icon from Twitter's Embedded Timelines Has anyone had any success in removing the icon for the embedded timelines widget?
I've googled and cant find anyone that has...
https://dev.twitter.com/docs/embedded-timelines


text:
Q: Como detectar se um artigo do Wordpress foi carregado em uma lightbox? Eu estou criando um site de notícias, estou usando o Wordpress como CMS e estou usando um plugin JQuery (Magnific Popup) para abrir os artigos em uma lightbox.
Fiz o single.php sem o cabeçalho e sem o rodapé, já que não vai precisar, pois a lightbox abre em cima da home do meu site. Então eu queria que quando o usuário clicasse no "Artigo" na home do site, ele abrisse em uma lightbox, e quando ele acessasse o "Artigo" pelo link direto, mostrasse o artigo como uma página normal, com cabeçalho e rodapé.

A: Em vez de usar o single, crie um arquivo somente para o Lightbox.
Deixe o single padrão e o outro arquivo sem cabeçalho e sem o rodapé.


text:
Q: How to filter or otherwise remove periodic noise from an image? We are taking mostly-empty images of a system with a slow, low-noise CCD. Many of our images look like the following, where the object of interest is the bright streak, while a clear repeating pattern is visible in the empty pixels

Our goal is to identify the bright features, which is generally easy, and to quantify the total charge in each one. Obviously the readout noise is going to broaden our estimate of the total charge, so we want to "subtract out" the periodic component. Given how regular the pattern is, it seems like it ought to be relatively straightforward to find a "template" for the noise and filter it out.
What kind of filter or other technique is most appropriate for removing this kind of periodic signal from an image?


text:
Q: Change number of occurrences in list I have a list of lists. The last item in each list is the QTY. What I need to do is change this list so that if the first 3 items are already in the list, add 1 to the qty item in the list. Here is what I have so far, but after 1 becomes 2, now its not matching.
x = [[1,2,3,1], ['x', 'y', 'z',1], ['a', 'bv', 'sdf',1], ['x', 'y', 'z',1], ['x', 'y', 'z',1]]

new_list = []
for item in x:
    if item not in new_list:
        new_list.append(item)
    else:
        index = new_list.index(item)
        qty = new_list[index][3]
        qty += 1
        item[3] = qty
        new_list[index] = item

print(new_list)

Output of the above code:
[[1, 2, 3, 1], ['x', 'y', 'z', 2], ['a', 'bv', 'sdf', 1], ['x', 'y', 'z', 1]]

What the output needs to look like:
[[1, 2, 3, 1], ['x', 'y', 'z', 3], ['a', 'bv', 'sdf', 1]]

Thanks

A: I had the same idea as @thebjorn, but he was quicker. Here is another implementation:
import collections

x = [[1,2,3,1], ['x', 'y', 'z',1], ['a', 'bv', 'sdf',1], ['x', 'y', 'z',1], ['x', 'y', 'z',1]]

summary = collections.defaultdict(int)
for a,b,c,qty in x:
    summary[(a,b,c)] += qty
result = [[*k, v] for k, v in summary.items()]

print(result)
# [[1, 2, 3, 1], ['x', 'y', 'z', 3], ['a', 'bv', 'sdf', 1]]

A: You can use a dict to keep track of the count:
x = [[1,2,3,1],
     ['x', 'y', 'z',1],
     ['a', 'bv', 'sdf',1],
     ['x', 'y', 'z',1],
     ['x', 'y', 'z',1]]

count = {}
for item in x:
    key = tuple(item[:3])  # dict keys can't be lists
    if key in count:
        count[key] += item[3]
    else:
        count[key] = item[3]

new_list = [list(key) + [val] for key, val in count.items()]

print(new_list)

which outputs:
c:\srv\tmp> py -3.10 listoccur.py
[[1, 2, 3, 1], ['x', 'y', 'z', 3], ['a', 'bv', 'sdf', 1]]


text:
Q: Outlook Trust Center / Macro Settings greyed out Since the last automated update of Office 2019 ( to Microsoft® Outlook® 2019 MSO (Version 2209 Build 16.0.15629.20196) 32-bit) I cannot run my personal macros anymore.
The options in the dialog are greyed out
Outlook Macro Settings
But this is a personal PC which is not a member of a windows domain and there are no Office 2016 Group Policies present on my Computer.
After a lot of reserach I tried:

*

*Starting Outlook as Administrator

*Manually setting Computer\HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Office\16.0\Outlook\Security\adminsecuritymode and Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Outlook\Security\Level

but nothing helps. Btw its also greyed out in Word and Excel. Before the silent update last night it was working fine for years
Can anyone help?
Thanks,
Wolfgang
Windows 10 21H1

A: It's suggested that you could change the GPO as Max Meng mentioned in this thread: macro settings greyed out.

A: In case someone else runs into the same issue:
I was able to figure out what was going on. Basically, I am using 2 Microsoft 365 accounts. One from my company and one from one of my customers. The customer one has strict settings set in Microsoft 365 to disable Macros. The one from my company does not have those restrictions.
I was not aware that you can set/overrule local Office settings with Microsft 365 account settings.
Anyway, every time I opened a customer SharePoint document - my active account in Office changed to my customer's 365 account. When I (re)started Outlook, Excel or Word macros were disabled and the settings greyed out. What I had to do was change the active account in the Office Program (you can do this in Word or Excel but not Outlook - at least I couldn't find a way) and then restart the application. All good. Macros settings are enabled again and you can change them.
Very annoying. I don't understand how Microsoft justifies changing those settings on foreign computers (which are not part of the Windows Domain) just by logging in to Microsoft 365.
It took me many frustrating hours to figure that out.
Hope it helps someone else


text:
Q: How to set focus on dropdown list, using javascript, php I am unable to set focus to my php page dc-test.php (this is a frames page: topFrame and botFrame) dropdown list, which has 2 dropdown lists and are dependent.
These dropdown lists values are populated from a table.
Unable to set focus for the first dropdown and later after the reload for the second dependent dropdown list. Pl see my code below, need your help ! Sorry if i am repeating this question on this forum, because I was unable to find the right answer.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <?php
    $dbservertype='mysql';
    $servername='localhost';
    $dbusername='aaa';
    $dbpassword='234!@';
    $dbname='test';

    connecttodb($servername,$dbname,$dbusername,$dbpassword);
    function connecttodb($servername,$dbname,$dbuser,$dbpassword)
    {
    global $link;
    $link=mysql_connect ("$servername","$dbuser","$dbpassword");
    if(!$link){die("Could not connect to MySQL");}
    mysql_select_db("$dbname",$link) or die ("could not open db".mysql_error());
    }
    // End of DB connection

    @$cat=$_GET['cat'];
    if(strlen($cat) > 0 and !is_numeric($cat)){
    echo "Data Error";
    exit;
    }

    $quer2=mysql_query("SELECT DISTINCT Ac_desc, Ac_code FROM ACMAST order by Ac_desc");

    /////// Second drop down list we will check if category is selected else we will display all the subcategory/////
    if(isset($cat) and strlen($cat) > 0){
    $quer=mysql_query("SELECT DISTINCT Add1 FROM ACMAST where Ac_code=$cat order by   Add1");
    }

    echo "<form name='f1'>";
    echo "
";
    echo "
";
    echo "    .	";
    echo "     Customer	";
    echo "    <select name='cat' onchange=\"reload(this.form);        showUser(this.value);\">
    <option value=''>Select Name</option>";
    while($noticia2 = mysql_fetch_array($quer2)) {
    if($noticia2['Ac_code']==@$cat){echo "<option selected value='$noticia2[Ac_code]'>$noticia2[Ac_desc]</option>"."
";}
    else{echo  "<option value='$noticia2[Ac_code]'>$noticia2[Ac_desc]</option>";}
    }
    echo "</select>";

    echo "	";
    echo "    Address	";
    echo "     <select name='subcat'>";
    while($noticia = mysql_fetch_array($quer)) {
    echo  "<option value='$noticia[Add1]'>$noticia[Add1]</option>";
    }
    echo "</select>";
    echo "	";
    echo "
";
    echo "
";
    ?>

A: The "topFrame" is completely out of scope here:
function firstfield()
{
document.topFrame.cat.focus();
}

Do this instead:
Give the form field an id:
echo "    <select name='cat' id='cat' onchange=\"reload(this.form); showUser(this.value);\">

Change firstfield to this:
function firstfield()
{
document.getElementById('cat').focus();
}

And, on an unrelated note: make your life easier and start using jQuery. :)


text:
Q: Rails 4 Bootstrap Doesn't Load I'm really at a breaking point so I hope someone can help me here.
I have followed this documentation (as well as 8 tutorials) https://github.com/twbs/bootstrap-rubygem#a-ruby-on-rails
After doing this and attempting to add a navbar from the components/examples pages on the getbootstrap website to my appliaction.html.erb file I do see the text load on my page but I never get any CSS applied to the page.
It's simply not working and I'm at my wits end trying to figure it out.
UPDATE
I have https://github.com/KR0SIV/learning-bootstrap
Application.css.scss
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
 * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any styles
 * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
 * file per style scope.
 *
 *= require_tree .
 *= require_self
 */
@import "bootstrap-sprockets";
@import "bootstrap";

Then just to see if it would work I simply added the Nav bar from the examples to my projects application.html.erb file
<!DOCTYPE html>

  <title>LearningBootstrap</title>

      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        Toggle navigation

      </button>
      Brand

Link (current)

Link

          Dropdown

Action

Another action

Something else here

Separated link

One more separated link

      <form class="navbar-form navbar-left" role="search">

          <input type="text" class="form-control" placeholder="Search">

        <button type="submit" class="btn btn-default">Submit</button>
      </form>

Link

          Dropdown

Action

Another action

Something else here

Separated link

<%= yield %>

A: So first of all. You have multiple application stylesheets in your project. application.css and application.css.scss. Remove the application.css and rename the other one into application.scss.
Than remove the following lines:
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
 * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any styles
 * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
 * file per style scope.
 *
 *= require_tree .
 *= require_self
 */

The Bootstrap gem README writes:

Then, remove all the *= require and *= require_tree statements from
  the Sass file. Instead, use @import to import Sass files.
Do not use *= require in Sass or your other stylesheets will not be
  able to access the Bootstrap mixins and variables.

And this is probably your problem here since you said that it didn't find a sass variable.
To import all your other CSS files, add the following line blow the bootstrap imports:
@import '**/*';

This will add all CSS files recursively.
Of course do you have to add the stylesheet to your HTML template.
Just use the default one of Rails:
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>

Important! Bootstrap 4 is still in development and currently just an Alpha version. I would recommend you to use Bootstrap 3 for production apps. But if it's just for learning it's perfectly fine.
And I wouldn't recommend you to use third-party gems like twitter-bootstrap-rails if there are official gems available.


text:
Q: Cannot find index.html file in existing website files I had purchased a Wordpress web template and a designer worked on it and then uploaded it to the site.
The site needs to be modified and I figured I could do it myself. I downloaded all the files uploaded but cannot find any folders containing the index.html file.
I see a index.php file in every folder. What folder do I pull up to edit in order to change details on the homepage of the website?

A: index.php has equivalent functionality to index.html, except that it can contain PHP script. Look in those files. It will contain the HTML you are looking for.


text:
Q: Send notification to users when product is created in OctoberCMS? I have a plugin that creates a product and I want to send a notification email to all users when a new product has been created, how do i approach this?

A: You could use Events
Fire an event when the product is created and Listen to the respective event to send notification mail to the users.
Event::fire('product.create', [$product]);

Register the listener within the boot method of the plugin
public function boot()
{
    Event::listen('product.create', function ($product) {

       // Send Mail to subscribed users

    });
}


text: Q: Ubuntu Installation Control Panel Ubuntu appears in my software center but it doesn't appear in my control center, therefore I can't open it. I've tried all the basic stuff like rebooting and reinstalling but nothing works. (I'm using an hp laptop btw, I don't know if that affects anything)


text:
Q: Limit dynamically added columns to table Please take a look at this fiddle example. I'm adding new columns using AJAX on click. Is there a way to count the columns of the table and limit the number of new columns to 6? Could anyone give me suggestions?
jQuery:
$(function () {
var ajaxfunction = function(){
        $('.area').on("click","button", function(){
        var source = $(this).data('feed');

        $.ajax({
    url: source,
    success: function (data) {

        $(data.query.results.json.json).each(function (index, item) {
         var title = item.title,
          year = item.year,
          job = item.Job,
          education = item.Education,
          background = item.Background,
          ingredient = item.Ingredient;
         $('#header').after(''+title+'	')
         $('#ingredient').after(''+ingredient+'	')
         $('#year').after(''+year+'	')
         $('#background').after(''+background+'	')
         $('#education').after(''+education+'	')
         $('#job').after(''+job+'	')

        });
        $('#toptable').stickyTableHeaders(); //Fixed Header Plugin
     },
    });

  });

 }
ajaxfunction();

});

HTML

    <button>Class B</button>
    <button>Class C</button>
    <button>Class D</button>

     -

     Ingredient

     Year

     Background

     Education

     Job

A: Get Column Count (If you start using colspans this will need to change to reflect that):
var colcount = $("#toptable").find("tr:first th").length; or
var colcount = $("tr:first th", "#toptable").length; or
var colcount = $("#toptable tr:first th").length;
Limit the number of columns (tested and working):
$('.area').on("click","button", function(){
      var colspan = $("#toptable tr:first th").length;
        alert("Current number of Columns = " + colspan);
        if(colspan > 6)
        {
            alert("Too Many Columns");
            return false;
        }
    var source = $(this).data('feed');
    //the rest of your code
});

See this working Fiddle
NOTE: Because you are adding columns on an Ajax Success result, the column count is only true at the time of the click event. This means that the column count could be more once the Ajax Response arrives. You need to either cancel the request if there is an Ajax call in progress, or redesign so that you're not making so many HTTP calls (which is bad practice anyway, something like 68% of all performance improvements on the web are found in reducing HTTP calls.)


text:
Q: SharePoint 2016 : Is there any React Taxanomy Picker Control that can be used in a SharePoint FrameWork WebPart (React) I have to implement a SharePoint Form with Taxomomy Fields in a SharePoint FrameWork WebPart (React).
Is there any React Taxanomy Picker Control I can use ?
Regards,
Arioule

A: GDPR ActivityHub has one implemented. You can find it here https://github.com/SharePoint/sp-dev-gdpr-activity-hub/blob/master/GDPRStarterKit/src/components/SPTaxonomyPicker.tsx


text:
Q: Unable to get property 'map' of undefined or null reference I'm writing the obligatory blog website using Angular2.  My site has a BlogIndex component and a BlogService as shown below.
The first time BlogIndex is loaded it works fine.  However if I attempt to navigate to different component my app crashes with the error message shown below.
BlogIndex.ngOnDestroy is fired when I attempt to navigate away from BlogIndex.
ngOnInit of the component being navigated to is executed.
A second call to BlogIndex.updateIndex is not made when I attempt to navigate away... however if I remove the line of code in the method my app does not crash.
Error Message:
Unable to get property 'map' of undefined or null reference

Stack trace:
TypeError: Unable to get property 'map' of undefined or null reference
at Tree.prototype.pathFromRoot (eval code:30:50)
at _findUrlSegment (eval code:79:5)
at _findStartingNode (eval code:90:9)
at link (eval code:14:5)
at Router.prototype.createUrlTree (eval code:133:9)
at RouterLink.prototype._updateTargetUrlAndHref (eval code:42:9)
at Anonymous function (eval code:17:81)
at Anonymous function (eval code:122:87)
at ZoneDelegate.prototype.invokeTask (http://localhost:61560/lib/zone.js/dist/zone.js:354:18)
at onInvokeTask (eval code:36:25)

App crashes here (I'm not sure what this is)
SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {
    try {
        fn.call(this._context, value);
    }
    catch (err) {
        this.unsubscribe();
        throw err; // crashes here
    }
};

BlogIndex.ts (some code removed)
export class BlogIndex implements OnInit, OnDestroy {

    constructor(private blogService: BlogService, private sessionService: SessionService) {
        this.ImageRoot = sessionService.ImageRoot;

    }

    ngOnInit()
    {

        this.updateIndex();
    }

    ngOnDestroy()
    {

    }

    updateIndex()
    {
        // this line causes the error
        this.blogService.GetContentItems(this.sessionService.CurrentSite.ID, this.sessionService.CurrentMenuID, this.sessionService.CurrentGroupID)
            .subscribe((x: ContentItem[]) => {
                this.ContentItems = x;
            });

    }
}

BlogService.ts (some code removed)
@Injectable()
export class BlogService {
    private serviceURL: string;

    constructor(private http: Http) {

    }

    GetContentItems(siteID: number, menuID: number, groupID: number): Observable<ContentItem[]> {
        let url = this.serviceURL + 'GetContentItems?siteID=' + siteID.toString() + '&menuID=' + menuID.toString() + '&groupID=' + groupID;
        return this.http.get(url)
            .map(response => this.extractData(response))
            .catch(this.handleError);
    }

    private extractData(res: Response) {
        if (res.status < 200 || res.status >= 300) {
            throw new Error('Bad response status: ' + res.status);
        }
        let body = res.json();
        return body || [];
    }

    private handleError(error: any) {
        let errorMsg = error.message || 'Server error';
        console.error(errorMsg);
        return Observable.throw(errorMsg);
    }
}

*Note:  I posted a question with this same error message earlier this week.  I included code that I thought was the source of the error however it was incorrect.  I've positively identified the offending line of code as marked above.
Update:
I changed my component and service to use a promise instead of observable and I get the exact same error:
BlogIndex:
this.blogService.GetContentItems(this.sessionService.CurrentSite.ID, this.sessionService.CurrentMenuID, this.sessionService.CurrentGroupID)
        .then((x: ContentItem[]) => {
            this.ContentItems = x;
        });

BlogService:
GetContentItems(siteID: number, menuID: number, groupID: number): Promise<ContentItem[]> {
    let url = this.serviceURL + 'GetContentItems?siteID=' + siteID.toString() + '&menuID=' + menuID.toString() + '&groupID=' + groupID;
    return this.http.get(url).toPromise()
        .then(response => this.extractData(response))
        .catch(this.handleError);
}


text:
Q: Issue with Queueable that invokes a flow In an attempt to reduce the number of SOQL queries being used within a trigger, I'm looking at moving some logic that doesn't need to be done real-time into a Queueable.  In one instance, I have an invokable flow that creates an Invoice record.  It looks like the Queueable is able to call the flow, and the flow completes without throwing an error.  However, the flow doesn't appear to create the new Invoice record.  Following is the code within the Queueable:
public void execute(QueueableContext context) {

    System.debug('Beginning execute()');

    Flow.Interview.Invoice_and_Invoice_Line_Create_AutoLaunch flow;

    try {
        System.debug('order: ' + order);
        Map< String, Order__c > parms = new Map< String, Order__c >{ 'Order_Source_For_Invoice' => order };
        flow = new Flow.Interview.Invoice_and_Invoice_Line_Create_AutoLaunch( parms );
        flow.start();
    }
    catch(Exception e) {
        System.debug('Error "' + e.getMessage());
        System.debug(e.getStackTraceString());
    }
    finally {
        System.debug('Exit execute()');
    }

}

When the flow is called directly within the Trigger using the same code, it works fine.
Is calling a flow from within a Queueable not possible?


text:
Q: Problem about Inverse Function Theorem In my lecture notes about Inverse Function Theorem it said

There is no need to have an Inverse Function Theorem for functions $F
: \mathbb R^n → \mathbb R^m$. If we only require $F$ and $F^{-1}$ to be continuous (not necessarily differentiable), then we can still conclude m = n."

Does it mean that for $F: \mathbb R^n → \mathbb R^m$ which has an inverse function $F^{-1}:\mathbb R^m → \mathbb R^n$, says $F$ is differentiable at $a\in \mathbb R^n$ and $F^{-1}$ is differentiable at $b=F(a)\in \mathbb R^m$,then $m$ must be equal to $n$? Why is it true?

A: The Inverse Function Theorem requires a continuously differentiable function.
Your assumption is true. The Invariance of Domain Theorem says that $F$ cannot be bijective and continuous if $m\neq n$.


text:
Q: Developing universal in Xcode 6+ I have Xcode 6 installed and I'm trying to develop an universal app. Before Xcode 6, you had to create 2 separate Storyboards for iPad and iPhone and you could set it in the Deployment Info.
How to manage storyboard without using Autolayout and size class ?

A: If you don't want to use auto-layout and size classes, uncheck the corresponding checkboxes while in storyboard's "File Inspector" utility view (⌘ + ⌥ + 1):


text:
Q: Login failed invalid key error when using Facebook SDK on device I have gone through these links
Login failed invalid key error with Facebook SDK
and
http://sean.lyn.ch/2011/07/android-the-facebook-sdk-sso-and-you/
but i could not understand what hash key exactly is???
where is that used in my application??
and in the tutorials he says we need to add this key hash to the Facebook application...in my case i have a Facebook web application, is that enough or should i definitely create an application for mobile on Facebook???

A: The best place to start is the official tutorial.
This part is explain there in Step 5: Add your app's signature to the Facebook App Settings:

Facebook requires an additional layer of security for mobile apps in
  the form of an application signature. You need to put your Android
  application signature into your Facebook app settings.

Just follow their instructions, it's all pretty easy and straight forward.


text:
Q: SMTP injection and adding a new header I understand the basic smtp injection operation, but what if i need to add a specific headers during the injection.
As an example how can I add a new Header like "organization" during the SMTP injection?

A: If you are talking about the raw SMTP protocol, what you send after the DATA command is a whole email message consisting of headers and the body, so just include any header you wish in the payload.
You probably need to be more specific in your question. Example code, programming language used, libraries, environment, etc.


text:
Q: c# (3.5) use TableAdapters to read/write null DateTime values to a database I am connecting to a database using VS2008 DataSets. One of the Tables within the database contains a DateTime Column that allows nulls (i.e. Type: DateTime?)
MSDN Datasets categorically states:

The Nullable or Nullable structure is not currently supported in the DataSet.

However on the MSDN site for TableAdapters states that TableAdaters CAN support Nullable Types:

The TableAdapters support nullable types Nullable(Of T) and T?. For more information on nullable types ... For more information on nullable types in C#, see Using Nullable Types (C# Programming Guide).

I'm confused!
In the DataSet Designer I have set the offending Column's property to 'AllowDBNull=True' but whenever I run a TableAdapter Query that returns a null DateTime (SELECT * FROM UDF) I get the following Exception: "ArguementOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime."
One idea I had was to change the type of the Column to System.Object to correctly handle the null values and then I can do the conversions in my own code, however, I still get the same exception being raised.
This question suggests how to deal with the nulls once the query has returned, however I can't get the query to return.
How can I modify the TableAdapter and/or Dataset to allow me to run a query on the Table that can deal with the nulls in the database?

A: The solution I found was to use the TO_CHAR() Oracle function and tell the Table Adapter to expect a string value
SELECT to_char(NULL_DATE_FIELD,'dd/mm/yyyy HH24:MI:SS') FROM *

This means that there is some conversion that needs to happen in the using code. Not ideal though!


text:
Q: How can I reference a javascript object through a property's onclick method? I am creating a Javascript object like so:
function pager(elementId) {
    this.totalPages = 5;
    this.currentPage = 1;

    var nextPageImage = document.createElement("img");
    nextPageImage.src = "img/next.png";

    nextPageImage.onclick = function(){
        if (this.currentPage+1 <= this.totalPages)
        {
            this.currentPage +=1;
        }
    }

    document.getElementById(elementId).appendChild(nextPageImage);
}

I create an instance of the object by passing in the id of a div on the page:
myPager = new pager('pagerDiv');

The problem is that the 'this' inside the onclick function refers to the image itself and not the pager object. I can reference the pager objct by using 'myPager' but that is not very practical.
How can I reference the object from within the image onclick function?

A: Create a local variable which represents "this" and then use that:
function pager(elementId) {
    this.totalPages = 5;
    this.currentPage = 1;
    var th = this;

    var nextPageImage = document.createElement("img");
    nextPageImage.src = "img/next.png";

    nextPageImage.onclick = function(){
        if (th.currentPage+1 <= th.totalPages)
        {
            th.currentPage +=1;
        }
    }

    document.getElementById(elementId).appendChild(nextPageImage);
}


text:
Q: Get only parent items ids of nestedsortable plugin I am using nestedsortable plugin https://github.com/ilikenwf/nestedSortable
I am trying to get only the parent items id or class and append to an input text field, not as serialized data or as array just with plain data with comma separated. Here is my code
var ns = jQuery('.sortable').nestedSortable({
                forcePlaceholderSize: true,
                handle: 'div',
                helper: 'clone',
                items: 'li',
                opacity: .6,
                placeholder: 'placeholder',
                revert: 250,
                tabSize: 30,
                tolerance: 'pointer',
                toleranceElement: '> div',
                maxLevels: 4,
                expandOnHover: 700,
                startCollapsed: false,
                update: function(event, ui) {
                    var arr = jQuery(this).nestedSortable('toArray');
                    var i, n;
                    var attrs = [];
            for (i = 0, n = arr.length; i < n; i++) {
                attrs.push(jQuery('#' + arr[i]).attr('class')+',');
            }
            jQuery("#sortedelements").val(attrs);

            }
        });


text:
Q: What is the different between d/dx and dz/dx in Calculus? The area of calculus that I'm questioning the difference between d/dx and dz/dx is when evaluating tangent planes and using Fx, Fy, and Fz for linear approximations.
For example, if the question asks us to evaluate the equation of a tangent plane given an equation (in R3) and a point, the first step would be to find the Fx, Fy, and Fz so we could plug it into the plane equation Fx(x-x0) + Fy(y-y0) + Fz(z-z0) = 0. Here is where my question comes in. When evaluating Fx, for example, would we use dz/dx or d/dx? What exactly is the difference between the two?
For the previous problems that I've done, they are all questions asking us to find the equation of a tangent line on a plane, and I simply used d/dx instead of dz/dx. Is this different for when evaluating the tangent plane for a 3d figure?

A: There are two cases :
The plane is defined by an implicit expression of the form
$$F(x,y,z)=0$$
In this case, the tangent plane at the point $ (x_0,y_0,z_0) $ will have the equation you wrote :
$$F_x(x-x_0)+F_y(y-y_0)+F_z(z-z_0)=0$$
with
$$F_x=\frac{\partial F}{\partial x}(x_0,y_0,z_0)$$
and so on for $ F_y $ and $ F_z$.
The second case is when the plane is defined by an explicit expression of the form
$$z=f(x,y)$$
or
$$G(x,y,z)=z-f(x,y)=0$$
in this case, the equation of the tangent plane will be
$$G_x(x-x_0)+G_y(y-y_0)+G_z(z-z_0)=$$
or
$$z-z_0=\frac{\partial f}{\partial x}(x_0,y_0)(x-x_0)+\frac{\partial f}{\partial y}(x_0,y_0)(y-y_0)$$
$$=\frac{\partial z}{\partial x}(x_0,y_0)(x-x_0)+\frac{\partial z}{\partial y}(x_0,y_0)(y-y_0)$$


text:
Q: Is it well-defined to import an identifier starting with `_[a-z0-9]` with `using` into global namespace? The entire question fits in the title.
C++14 [global.names] says that

Each name that begins with an underscore is reserved to the implementation for use as a name in the global namespace.

But it's not entirely clear to me if following
namespace N
{
    void _foo() {}
}

using N::_foo;

breaks the rule or not.

A: Isn't it obvious? Your code puts a name that begins with an underscore into the global namespace, where such names are reserved for use by the implementation. Don't do that. If the implementation has _foo in the global namespace this will produce conflicts.


text:
Q: Converting pyqt4 .py file for use I designed a GUI and converted the .ui file to .py file, and I found a lot of wierd gibberish. Is there anyway that anyone can help me to convert this syntax to regular python so I can actually pass functions to buttons and such. I have been playing it around with for the past day and have accomplished a little.
from PyQt4 import QtCore, QtGui

try:
    _fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
    _fromUtf8 = lambda s: s

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(929, 597)
        MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "Intex | Server Monitor System", None, QtGui.QApplication.UnicodeUTF8))
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.plottab = QtGui.QTabWidget(self.centralwidget)
        self.plottab.setGeometry(QtCore.QRect(20, 10, 661, 511))
        self.plottab.setObjectName(_fromUtf8("plottab"))
        self.juliet = QtGui.QWidget()
        self.juliet.setObjectName(_fromUtf8("juliet"))
        self.label_2 = QtGui.QLabel(self.juliet)
        self.label_2.setGeometry(QtCore.QRect(20, 10, 111, 16))
        self.label_2.setText(QtGui.QApplication.translate("MainWindow", "Performance Monitor", None, QtGui.QApplication.UnicodeUTF8))
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.scrollArea_2 = QtGui.QScrollArea(self.juliet)
        self.scrollArea_2.setGeometry(QtCore.QRect(20, 30, 241, 221))
        self.scrollArea_2.setWidgetResizable(True)
        self.scrollArea_2.setObjectName(_fromUtf8("scrollArea_2"))
        self.scrollAreaWidgetContents_2 = QtGui.QWidget()
        self.scrollAreaWidgetContents_2.setGeometry(QtCore.QRect(0, 0, 237, 217))
        self.scrollAreaWidgetContents_2.setObjectName(_fromUtf8("scrollAreaWidgetContents_2"))
        self.scrollArea_2.setWidget(self.scrollAreaWidgetContents_2)
        self.label_13 = QtGui.QLabel(self.juliet)
        self.label_13.setGeometry(QtCore.QRect(330, 10, 111, 16))
        self.label_13.setText(QtGui.QApplication.translate("MainWindow", "Server Load Monitor", None, QtGui.QApplication.UnicodeUTF8))
        self.label_13.setObjectName(_fromUtf8("label_13"))
        self.scrollArea_10 = QtGui.QScrollArea(self.juliet)
        self.scrollArea_10.setGeometry(QtCore.QRect(330, 30, 241, 221))
        self.scrollArea_10.setWidgetResizable(True)
        self.scrollArea_10.setObjectName(_fromUtf8("scrollArea_10"))
        self.scrollAreaWidgetContents_10 = QtGui.QWidget()
        self.scrollAreaWidgetContents_10.setGeometry(QtCore.QRect(0, 0, 237, 217))
        self.scrollAreaWidgetContents_10.setObjectName(_fromUtf8("scrollAreaWidgetContents_10"))
        self.scrollArea_10.setWidget(self.scrollAreaWidgetContents_10)
        self.label_16 = QtGui.QLabel(self.juliet)
        self.label_16.setGeometry(QtCore.QRect(20, 270, 171, 16))
        self.label_16.setText(QtGui.QApplication.translate("MainWindow", "Incoming IP Adresses/Users", None, QtGui.QApplication.UnicodeUTF8))
        self.label_16.setObjectName(_fromUtf8("label_16"))
        self.scrollArea_13 = QtGui.QScrollArea(self.juliet)
        self.scrollArea_13.setGeometry(QtCore.QRect(20, 290, 241, 181))
        self.scrollArea_13.setWidgetResizable(True)
        self.scrollArea_13.setObjectName(_fromUtf8("scrollArea_13"))
        self.scrollAreaWidgetContents_13 = QtGui.QWidget()
        self.scrollAreaWidgetContents_13.setGeometry(QtCore.QRect(0, 0, 237, 177))
        self.scrollAreaWidgetContents_13.setObjectName(_fromUtf8("scrollAreaWidgetContents_13"))
        self.scrollArea_13.setWidget(self.scrollAreaWidgetContents_13)
        self.plottab.addTab(self.juliet, _fromUtf8(""))
        self.newjulietleft = QtGui.QWidget()
        self.newjulietleft.setObjectName(_fromUtf8("newjulietleft"))
        self.scrollArea = QtGui.QScrollArea(self.newjulietleft)
        self.scrollArea.setGeometry(QtCore.QRect(20, 30, 241, 221))
        self.scrollArea.setWidgetResizable(True)
        self.scrollArea.setObjectName(_fromUtf8("scrollArea"))
        self.scrollAreaWidgetContents = QtGui.QWidget()
        self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 237, 217))
        self.scrollAreaWidgetContents.setObjectName(_fromUtf8("scrollAreaWidgetContents"))
        self.scrollArea.setWidget(self.scrollAreaWidgetContents)
        self.label = QtGui.QLabel(self.newjulietleft)
        self.label.setGeometry(QtCore.QRect(20, 10, 111, 16))
        self.label.setText(QtGui.QApplication.translate("MainWindow", "Performance Monitor", None, QtGui.QApplication.UnicodeUTF8))
        self.label.setObjectName(_fromUtf8("label"))
        self.label_12 = QtGui.QLabel(self.newjulietleft)
        self.label_12.setGeometry(QtCore.QRect(330, 10, 111, 16))
        self.label_12.setText(QtGui.QApplication.translate("MainWindow", "Server Load Monitor", None, QtGui.QApplication.UnicodeUTF8))
        self.label_12.setObjectName(_fromUtf8("label_12"))
        self.scrollArea_9 = QtGui.QScrollArea(self.newjulietleft)
        self.scrollArea_9.setGeometry(QtCore.QRect(330, 30, 241, 221))
        self.scrollArea_9.setWidgetResizable(True)
        self.scrollArea_9.setObjectName(_fromUtf8("scrollArea_9"))
        self.scrollAreaWidgetContents_9 = QtGui.QWidget()
        self.scrollAreaWidgetContents_9.setGeometry(QtCore.QRect(0, 0, 237, 217))
        self.scrollAreaWidgetContents_9.setObjectName(_fromUtf8("scrollAreaWidgetContents_9"))
        self.scrollArea_9.setWidget(self.scrollAreaWidgetContents_9)
        self.label_15 = QtGui.QLabel(self.newjulietleft)
        self.label_15.setGeometry(QtCore.QRect(20, 270, 171, 16))
        self.label_15.setText(QtGui.QApplication.translate("MainWindow", "Incoming IP Adresses/Users", None, QtGui.QApplication.UnicodeUTF8))
        self.label_15.setObjectName(_fromUtf8("label_15"))
        self.scrollArea_12 = QtGui.QScrollArea(self.newjulietleft)
        self.scrollArea_12.setGeometry(QtCore.QRect(20, 290, 241, 181))
        self.scrollArea_12.setWidgetResizable(True)
        self.scrollArea_12.setObjectName(_fromUtf8("scrollArea_12"))
        self.scrollAreaWidgetContents_12 = QtGui.QWidget()
        self.scrollAreaWidgetContents_12.setGeometry(QtCore.QRect(0, 0, 237, 177))
        self.scrollAreaWidgetContents_12.setObjectName(_fromUtf8("scrollAreaWidgetContents_12"))
        self.scrollArea_12.setWidget(self.scrollAreaWidgetContents_12)
        self.plottab.addTab(self.newjulietleft, _fromUtf8(""))
        self.custom = QtGui.QWidget()
        self.custom.setObjectName(_fromUtf8("custom"))
        self.comboBox = QtGui.QComboBox(self.custom)
        self.comboBox.setGeometry(QtCore.QRect(20, 30, 74, 22))
        self.comboBox.setObjectName(_fromUtf8("comboBox"))
        self.comboBox.addItem(_fromUtf8(""))
        self.comboBox.setItemText(0, QtGui.QApplication.translate("MainWindow", "Hulk", None, QtGui.QApplication.UnicodeUTF8))
        self.comboBox.addItem(_fromUtf8(""))
        self.comboBox.setItemText(1, QtGui.QApplication.translate("MainWindow", "Superman", None, QtGui.QApplication.UnicodeUTF8))
        self.comboBox.addItem(_fromUtf8(""))
        self.comboBox.setItemText(2, QtGui.QApplication.translate("MainWindow", "Karma", None, QtGui.QApplication.UnicodeUTF8))
        self.comboBox.addItem(_fromUtf8(""))
        self.comboBox.setItemText(3, QtGui.QApplication.translate("MainWindow", "wdl", None, QtGui.QApplication.UnicodeUTF8))
        self.comboBox.addItem(_fromUtf8(""))
        self.comboBox.setItemText(4, QtGui.QApplication.translate("MainWindow", "Pong", None, QtGui.QApplication.UnicodeUTF8))
        self.label_3 = QtGui.QLabel(self.custom)
        self.label_3.setGeometry(QtCore.QRect(20, 10, 71, 16))
        self.label_3.setText(QtGui.QApplication.translate("MainWindow", "Select Server", None, QtGui.QApplication.UnicodeUTF8))
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.scrollArea_7 = QtGui.QScrollArea(self.custom)
        self.scrollArea_7.setGeometry(QtCore.QRect(20, 100, 241, 221))
        self.scrollArea_7.setWidgetResizable(True)
        self.scrollArea_7.setObjectName(_fromUtf8("scrollArea_7"))
        self.scrollAreaWidgetContents_7 = QtGui.QWidget()
        self.scrollAreaWidgetContents_7.setGeometry(QtCore.QRect(0, 0, 237, 217))
        self.scrollAreaWidgetContents_7.setObjectName(_fromUtf8("scrollAreaWidgetContents_7"))
        self.scrollArea_7.setWidget(self.scrollAreaWidgetContents_7)
        self.label_10 = QtGui.QLabel(self.custom)
        self.label_10.setGeometry(QtCore.QRect(20, 80, 111, 16))
        self.label_10.setText(QtGui.QApplication.translate("MainWindow", "Performance Monitor", None, QtGui.QApplication.UnicodeUTF8))
        self.label_10.setObjectName(_fromUtf8("label_10"))
        self.scrollArea_8 = QtGui.QScrollArea(self.custom)
        self.scrollArea_8.setGeometry(QtCore.QRect(360, 100, 241, 221))
        self.scrollArea_8.setWidgetResizable(True)
        self.scrollArea_8.setObjectName(_fromUtf8("scrollArea_8"))
        self.scrollAreaWidgetContents_8 = QtGui.QWidget()
        self.scrollAreaWidgetContents_8.setGeometry(QtCore.QRect(0, 0, 237, 217))
        self.scrollAreaWidgetContents_8.setObjectName(_fromUtf8("scrollAreaWidgetContents_8"))
        self.scrollArea_8.setWidget(self.scrollAreaWidgetContents_8)
        self.label_11 = QtGui.QLabel(self.custom)
        self.label_11.setGeometry(QtCore.QRect(360, 80, 111, 16))
        self.label_11.setText(QtGui.QApplication.translate("MainWindow", "Server Load Monitor", None, QtGui.QApplication.UnicodeUTF8))
        self.label_11.setObjectName(_fromUtf8("label_11"))
        self.label_14 = QtGui.QLabel(self.custom)
        self.label_14.setGeometry(QtCore.QRect(20, 340, 171, 16))
        self.label_14.setText(QtGui.QApplication.translate("MainWindow", "Incoming IP Adresses/Users", None, QtGui.QApplication.UnicodeUTF8))
        self.label_14.setObjectName(_fromUtf8("label_14"))
        self.scrollArea_11 = QtGui.QScrollArea(self.custom)
        self.scrollArea_11.setGeometry(QtCore.QRect(20, 360, 241, 111))
        self.scrollArea_11.setWidgetResizable(True)
        self.scrollArea_11.setObjectName(_fromUtf8("scrollArea_11"))
        self.scrollAreaWidgetContents_11 = QtGui.QWidget()
        self.scrollAreaWidgetContents_11.setGeometry(QtCore.QRect(0, 0, 237, 107))
        self.scrollAreaWidgetContents_11.setObjectName(_fromUtf8("scrollAreaWidgetContents_11"))
        self.scrollArea_11.setWidget(self.scrollAreaWidgetContents_11)
        self.plottab.addTab(self.custom, _fromUtf8(""))
        self.tab = QtGui.QWidget()
        self.tab.setObjectName(_fromUtf8("tab"))
        self.plottab.addTab(self.tab, _fromUtf8(""))
        self.pushButton = QtGui.QPushButton(self.centralwidget)
        self.pushButton.setGeometry(QtCore.QRect(510, 530, 75, 23))
        self.pushButton.setText(QtGui.QApplication.translate("MainWindow", "Refresh", None, QtGui.QApplication.UnicodeUTF8))
        self.pushButton.setObjectName(_fromUtf8("pushButton"))
        self.pushButton_2 = QtGui.QPushButton(self.centralwidget)
        self.pushButton_2.setGeometry(QtCore.QRect(600, 530, 75, 23))
        self.pushButton_2.setText(QtGui.QApplication.translate("MainWindow", "Exit", None, QtGui.QApplication.UnicodeUTF8))
        self.pushButton_2.setObjectName(_fromUtf8("pushButton_2"))
        self.progressBar = QtGui.QProgressBar(self.centralwidget)
        self.progressBar.setGeometry(QtCore.QRect(20, 530, 118, 23))
        self.progressBar.setProperty("value", 24)
        self.progressBar.setObjectName(_fromUtf8("progressBar"))
        self.scrollArea_3 = QtGui.QScrollArea(self.centralwidget)
        self.scrollArea_3.setGeometry(QtCore.QRect(710, 30, 191, 80))
        self.scrollArea_3.setWidgetResizable(True)
        self.scrollArea_3.setObjectName(_fromUtf8("scrollArea_3"))
        self.scrollAreaWidgetContents_3 = QtGui.QWidget()
        self.scrollAreaWidgetContents_3.setGeometry(QtCore.QRect(0, 0, 187, 76))
        self.scrollAreaWidgetContents_3.setObjectName(_fromUtf8("scrollAreaWidgetContents_3"))
        self.scrollArea_3.setWidget(self.scrollAreaWidgetContents_3)
        self.label_17 = QtGui.QLabel(self.centralwidget)
        self.label_17.setGeometry(QtCore.QRect(710, 10, 171, 16))
        self.label_17.setText(QtGui.QApplication.translate("MainWindow", "Alerts", None, QtGui.QApplication.UnicodeUTF8))
        self.label_17.setObjectName(_fromUtf8("label_17"))
        self.label_4 = QtGui.QLabel(self.centralwidget)
        self.label_4.setGeometry(QtCore.QRect(710, 130, 46, 13))
        self.label_4.setText(QtGui.QApplication.translate("MainWindow", "Plots", None, QtGui.QApplication.UnicodeUTF8))
        self.label_4.setObjectName(_fromUtf8("label_4"))
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 929, 18))
        self.menubar.setObjectName(_fromUtf8("menubar"))
        self.menuFile = QtGui.QMenu(self.menubar)
        self.menuFile.setTitle(QtGui.QApplication.translate("MainWindow", "File", None, QtGui.QApplication.UnicodeUTF8))
        self.menuFile.setObjectName(_fromUtf8("menuFile"))
        self.menuEdit = QtGui.QMenu(self.menubar)
        self.menuEdit.setTitle(QtGui.QApplication.translate("MainWindow", "Edit", None, QtGui.QApplication.UnicodeUTF8))
        self.menuEdit.setObjectName(_fromUtf8("menuEdit"))
        self.menuAbout = QtGui.QMenu(self.menubar)
        self.menuAbout.setTitle(QtGui.QApplication.translate("MainWindow", "Help", None, QtGui.QApplication.UnicodeUTF8))
        self.menuAbout.setObjectName(_fromUtf8("menuAbout"))
        self.menuView = QtGui.QMenu(self.menubar)
        self.menuView.setTitle(QtGui.QApplication.translate("MainWindow", "View", None, QtGui.QApplication.UnicodeUTF8))
        self.menuView.setObjectName(_fromUtf8("menuView"))
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName(_fromUtf8("statusbar"))
        MainWindow.setStatusBar(self.statusbar)
        self.actionSave_Data = QtGui.QAction(MainWindow)
        self.actionSave_Data.setEnabled(False)
        self.actionSave_Data.setText(QtGui.QApplication.translate("MainWindow", "Save Data ", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSave_Data.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+S", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSave_Data.setObjectName(_fromUtf8("actionSave_Data"))
        self.actionPrint = QtGui.QAction(MainWindow)
        self.actionPrint.setText(QtGui.QApplication.translate("MainWindow", "Print            ", None, QtGui.QApplication.UnicodeUTF8))
        self.actionPrint.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+P", None, QtGui.QApplication.UnicodeUTF8))
        self.actionPrint.setObjectName(_fromUtf8("actionPrint"))
        self.actionExit = QtGui.QAction(MainWindow)
        self.actionExit.setText(QtGui.QApplication.translate("MainWindow", "Exit", None, QtGui.QApplication.UnicodeUTF8))
        self.actionExit.setObjectName(_fromUtf8("actionExit"))
        self.actionExit_2 = QtGui.QAction(MainWindow)
        self.actionExit_2.setText(QtGui.QApplication.translate("MainWindow", "Refresh", None, QtGui.QApplication.UnicodeUTF8))
        self.actionExit_2.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+R", None, QtGui.QApplication.UnicodeUTF8))
        self.actionExit_2.setObjectName(_fromUtf8("actionExit_2"))
        self.actionExit_3 = QtGui.QAction(MainWindow)
        self.actionExit_3.setText(QtGui.QApplication.translate("MainWindow", "Exit", None, QtGui.QApplication.UnicodeUTF8))
        self.actionExit_3.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+E", None, QtGui.QApplication.UnicodeUTF8))
        self.actionExit_3.setObjectName(_fromUtf8("actionExit_3"))
        self.actionCopy = QtGui.QAction(MainWindow)
        self.actionCopy.setText(QtGui.QApplication.translate("MainWindow", "Copy", None, QtGui.QApplication.UnicodeUTF8))
        self.actionCopy.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+C", None, QtGui.QApplication.UnicodeUTF8))
        self.actionCopy.setObjectName(_fromUtf8("actionCopy"))
        self.actionCut = QtGui.QAction(MainWindow)
        self.actionCut.setText(QtGui.QApplication.translate("MainWindow", "Cut", None, QtGui.QApplication.UnicodeUTF8))
        self.actionCut.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+Shift+C", None, QtGui.QApplication.UnicodeUTF8))
        self.actionCut.setObjectName(_fromUtf8("actionCut"))
        self.actionPaste = QtGui.QAction(MainWindow)
        self.actionPaste.setText(QtGui.QApplication.translate("MainWindow", "Paste", None, QtGui.QApplication.UnicodeUTF8))
        self.actionPaste.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+P", None, QtGui.QApplication.UnicodeUTF8))
        self.actionPaste.setObjectName(_fromUtf8("actionPaste"))
        self.actionContact_Us = QtGui.QAction(MainWindow)
        self.actionContact_Us.setText(QtGui.QApplication.translate("MainWindow", "Contact Us", None, QtGui.QApplication.UnicodeUTF8))
        self.actionContact_Us.setObjectName(_fromUtf8("actionContact_Us"))
        self.actionAbout = QtGui.QAction(MainWindow)
        self.actionAbout.setText(QtGui.QApplication.translate("MainWindow", "About", None, QtGui.QApplication.UnicodeUTF8))
        self.actionAbout.setObjectName(_fromUtf8("actionAbout"))
        self.actionDocumentation = QtGui.QAction(MainWindow)
        self.actionDocumentation.setText(QtGui.QApplication.translate("MainWindow", "Documentation", None, QtGui.QApplication.UnicodeUTF8))
        self.actionDocumentation.setObjectName(_fromUtf8("actionDocumentation"))
        self.actionPython_Interpreter = QtGui.QAction(MainWindow)
        self.actionPython_Interpreter.setText(QtGui.QApplication.translate("MainWindow", "Python Interpreter", None, QtGui.QApplication.UnicodeUTF8))
        self.actionPython_Interpreter.setObjectName(_fromUtf8("actionPython_Interpreter"))
        self.menuFile.addAction(self.actionSave_Data)
        self.menuFile.addAction(self.actionPrint)
        self.menuFile.addAction(self.actionExit_2)
        self.menuFile.addSeparator()
        self.menuFile.addAction(self.actionExit_3)
        self.menuEdit.addAction(self.actionCopy)
        self.menuEdit.addAction(self.actionCut)
        self.menuEdit.addAction(self.actionPaste)
        self.menuAbout.addAction(self.actionContact_Us)
        self.menuAbout.addSeparator()
        self.menuAbout.addAction(self.actionAbout)
        self.menuAbout.addSeparator()
        self.menuAbout.addAction(self.actionDocumentation)
        self.menuView.addAction(self.actionPython_Interpreter)
        self.menubar.addAction(self.menuFile.menuAction())
        self.menubar.addAction(self.menuEdit.menuAction())
        self.menubar.addAction(self.menuView.menuAction())
        self.menubar.addAction(self.menuAbout.menuAction())

        self.retranslateUi(MainWindow)
        self.plottab.setCurrentIndex(0)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        self.plottab.setTabText(self.plottab.indexOf(self.juliet), QtGui.QApplication.translate("MainWindow", "Juliet", None, QtGui.QApplication.UnicodeUTF8))
        self.plottab.setTabText(self.plottab.indexOf(self.newjulietleft), QtGui.QApplication.translate("MainWindow", "Newjulietleft", None, QtGui.QApplication.UnicodeUTF8))
        self.plottab.setTabText(self.plottab.indexOf(self.custom), QtGui.QApplication.translate("MainWindow", "Custom", None, QtGui.QApplication.UnicodeUTF8))
        self.plottab.setTabText(self.plottab.indexOf(self.tab), QtGui.QApplication.translate("MainWindow", "Overall Analasys", None, QtGui.QApplication.UnicodeUTF8)

)

A: You shouldn't change this file. It is a generated file.
What you have to do is create a new class that inherits from Ui_MainWindow.
Create a new module and do something like this:
import sys
from PyQt4 import QtCore, QtGui
import your_generated_module

class MyMain(QtGui.QMainWindow, your_generated_module.Ui_MainWindow):
    def __init__(self, parent=None):
        super(MyMain, self).__init__(parent)
        self.setupUi(self)
        # example of an event - pushbutton
        self.connect(self.pushButton,
                     QtCore.SIGNAL("clicked()"),
                     self.test_print)

    def test_print():
        print "It worked!"

def main():
   app = QtGui.QApplication(sys.argv)
   main_window = MyMain()
   main_window.show()
   app.exec_()

if __name__ == '__main__':
   main()

Now, if you run this code you you'll see your main window. Clicking the pushButton will print "It worked!" at the standard output (console).


text:
Q: What is PostgreSQL Array Column equivalent in Synapse SQL? I have a table in PostgreSQL that has array column like abc_id varchar[](1) and it has data in it like {A,B,C}.
I want to create that table in Synapse SQL how can I create array columns is it possible?

A: There is no explicit array type ibn Synapse SQL. We consider the array type data as complex type. As mentioned in the comment, consider using JSON as the main base.
The below image will explain the scheme of array and nested structure.

The following code block is the sample JSON example of implementing nested structures, which is a complex type and acceptable in Synapse SQL.
{
    "id": "66532691-ab20-11ea-8b1d-936b3ec64e54",
    "context": {
        "data": {
            "eventTime": "2020-06-10T13:43:34.553Z",
            "samplingRate": "100.0",
            "isSynthetic": "false"
        },
        "session": {
            "isFirst": "false",
            "id": "38619c14-7a23-4687-8268-95862c5326b1"
        },
        "custom": {
            "dimensions": [
                {
                    "customerInfo": {
                        "ProfileType": "ExpertUser",
                        "RoomName": "",
                        "CustomerName": "diamond",
                        "UserName": "XXXX@yahoo.com"
                    }
                },
                {
                    "customerInfo": {
                        "ProfileType": "Novice",
                        "RoomName": "",
                        "CustomerName": "topaz",
                        "UserName": "XXXX@outlook.com"
                    }
                }
            ]
        }
    }
}


text:
Q: Flutter : Can't load Assets (Audio file particularly) I am trying to load audio files and play them. But Visual Studio codes open a file named 'asset_bundle.dart' showing this piece of code -
if (asset == null)
      throw FlutterError('Unable to load asset: $key');
    return asset;
  }

Here's my pubspec.yaml file -
dependencies:
  flutter:
    sdk: flutter
  audioplayers: 0.15.1

assets:
    - assets/audio/

Here's my code -
import 'package:audioplayers/audio_cache.dart';

void playSound(String audioPath) {
    AudioCache audioCache = new AudioCache(prefix: 'assets/audio');
    audioCache.play(audioPath);
  }

playSound('swoosh.wav');

And the asset folder added in 'pubspec.yaml' lies in the same folder as 'pubspec.yaml' and also it contains 'swoosh.wav' file.
I have tried 'flutter run' command.
Please Help me.


text:
Q: gSOAP C++: Create a custom SOAP:Header without WSDL definition Here is a target: build client app using N wsdl's and when some SOAP requests launched - add some specific SOAP:Header ( session tokens and client data as usual )
Here we got a few limitations:

*

*Wsdl's provided by services cannot be modified

*Generated gSOAP code
also cannot be modified (IOW generated code contain dummy
SOAP_ENV_Header )

*Wsdl's provided by services DO NOT contain any
headers definition ( and by the by it looks reasonable
Adding SOAP implicit headers to WSDL
)

So here is the question: How to add custom generated XML into SOAP:Header field in requests ?
ps. Frankly speaking I got one solution resolving this question via gsoap plugin's but I think its a bit "ugly-hacky" and really appreciate more beautiful and elegant solution

A: Ok, here is proper solution to do it:
Add #import "header.h" to typemap.dat:
      [
      #import "header.h"
      ]

The content of the SOAP_ENV__Header struct in header.h is user-defined, typically with members that are pointers and member names qualified:
struct SOAP_ENV__Header
{
   type *prefix__name;
};

If you want "arbitrary" headers, then use DOM:
#import "dom.h"
struct SOAP_ENV__Header
{
   xsd__anyType *dom;
};

when using DOM object in custom SOAP headers - don't forget to pass "-d" option in soapcpp2 execution - otherwise there will be compilation/linking problems.


text:
Q: How does the new edition of the Fantastic Beasts book differ from the old one? In 2016, the publisher Scholastic has pulled the English versions of the book Fantastic Beasts and Where to Find Them (by Newt Scamander) from the stores, and promised to publish a new version in 2017.  The new book is now published.
What are the most significant differences between the old and the new version?  (Besides the new one being more expensive because it's only available in hardcover at first, I mean.)

I suspect there are probably some differences, because why else would the publisher pull the previous version?
Note that I am not asking about the screenplay book of the film by the same name, because that's a different book entirely.  The cover images above are only for illustration.

A: The most significant differences are a new foreword by Newt and adding six new creatures.
The old version and the new version aren't that much different. The main differences are that a new longer foreword by Newt, referencing events from the movie, was added in, as well as adding six creatures native to America (the Thunderbird, the Horned Serpent, the Wampus, the Hidebehind, the Hodag, and the Snallygaster).
The other differences are far more minor.
Some of the other differences, like Harry and Ron's doodles being removed or small details being changed are far less important or significant.
Overall, if you have the old book, you don't need the new one unless you're a hardcore fan.
The really significant differences are the foreword and the new creatures, which together add up to 1390 new words worth of content, to give an idea on how much has really been added. However, in the new version 730 words of content were removed (Dumbledore's foreword and Ron and Harry's doodles). If this is the first time buying a Fantastic Beasts and Where to Find Them textbook, this may be information to keep in mind in order to choose the one with the extra content you'd prefer. All figures are sourced from the Rowling Library (from an article that was just pointed out to me was written by ibid from this website).

A: Things changed:

*

*Newt is no longer said to have graduated Hogwarts.

2001 Upon graduation from Hogwarts School of Witchcraft and Wizardry, Mr. Scamander joined the Ministry of Magic in the Department for the regulation and Control of Magical Creatures.
2017 Upon leaving Hogwarts School of Witchcraft and Wizardry, Mr. Scamander joined the Ministry of Magic in the Department for the regulation and Control of Magical Creatures.

*Fantastic Beasts is now in its 2nd edition, not 52nd edition.

2001 during which he collected information for his worldwide best-seller Fantastic Beasts and Where to Find Them, now in its fifty-second edition.
2017 during which he collected information for his worldwide best-seller Fantastic Beasts and Where to Find Them.
2001 The rest is publishing history: Fantastic Beasts is now in its fifty-second edition.
2017 The rest is publishing history.
2001 Seventy-five species are described in the following pages, but I do not doubt that some time this year yet another will be discovered, necessitating a fifty-third revised edition of Fantastic Beasts and Where to Find Them.
2017 Eighty-one species are described in the following pages, but I do not doubt that more will be discovered, necessitating another revised edition of Fantastic Beasts and Where to Find Them.

Things added:

*

*A new foreword from Newt to tie-in with the movie (660 words)

*6 new beasts to tie-in with the movie (1,734 words)

*New illustrations (not from Rowling)
Things Removed:

*

*Dumbledore's foreword (572 words)

*Harry and Ron's doodles

*JK Rowling's illustrations
Other minor changes:

*

*The number of beasts mentioned in the intro has increased by six to match added contents.

2001 Seventy-five species are described in the following pages,
2017 Eighty-one species are described in the following pages,

*The about the author has been moved to the back of the book.

*The capitalization was tweaked in the MoM classification system blurb.

The Department for the Regulation and Control of Magical Creatures gives classifications to all known beasts, beings, and spirits.

See also an article I wrote for TheRowlingLibrary, "What was changed in the new Fantastic Beasts book and what it means for canon".


text:
Q: Obtain any 3-manifold from repeating surgeries on knots in $S^3$ In Witten's "QFT and Jones Polynomials" paper, page 383, it states that: "It is a not too deep result that every 3-manifold can be obtained from or reduced to $S^3$ (or any other desired 3-manifold) by repeated surgeries on knots.
What are the methods to show this? In the simplest intuitive level?
I understand this may be a relevant post, but I hope there are better illuminations. Thanks.
p.s. I am a QM/QFT theorist trying to understand the topology better.

A: The question of which closed, orientable 3-manifolds can be obtained as surgery along a link in $S^3$ appears at the very end of Bing's paper Necessary and Sufficient Conditions that a 3-Manifold Be $S^3$.
The affirmative answer to Bing's question is generally attributed to Lickorish and Wallace. Both worked independently and also used different methods. A treatment of Lickorish's work is given in Sam Nead's answer above, so this answer is meant to highlight Andrew Wallace's paper, Modifications and Cobounding Manifolds.
Relevant to this discussion, Section 5 of that paper culminates in Theorem 6. Wallace's perspective is to consider cobordisms between two manifolds. Restricting to the case of 3-manifolds he is able to show that any closed orientable 3-manifold can be obtained from repeated used of a specific type of cobordism that can be understood as a Dehn surgery on one component of a link in $S^3$.

A: This is really an extended comment. Firstly, as pointed out by Neil Hoffman, the result was proved by Wallace two years before Lickorish, and Lickorish was well aware of this (Wallace's paper is cited in Lickorish's). I really can't understand why Lickorish's name is attached to this result at all. Lickorish's reasonable claim was that his argument was more elementary than Wallace's. Indeed, this is true, since Lickorish's entire paper is eight pages (Wallace's is 28), BUT Lickorish (as suggested in my comment re Sam Nead's answer) does NOT prove that a finite number of Dehn twists suffice (that result is proved in a 1964 paper - two years after, and if you look at the math review, the reviewer is not so sure that it is really proved). Of course, had Lickorish been aware of Dehn's work, his 1962 paper would be down to around two pages. So, another (somewhat complicated) example of Arnold's principle at work.

A: Math Reviews says of the paper "A type of homology-preserving surgery on 3-manifolds", J. London Math. Soc. 17 (1978), 183–185 by Norris Weaver:
"Let $M$ be a 3-manifold and let $T \subset {\rm int}\,M$ be a tame submanifold homeomorphic to $S^1\times D^2$. Let $g: \partial T \to \partial T$ be an orientation-preserving homeomorphism, and let $n$ be an integer. Glue $T$ or $M - {\rm int}\, T$ by $g^n$ to obtain a manifold $M_1$. Call this construction an $n$th power surgery. The following result is obtained. Theorem: If $n\equiv 0 \, ({\rm mod}\,6)$ and $0\leq n\leq 36$, then $H^1(M_1:\mathbb{Z}_n) \cong H^1(M:\mathbb{Z}_n)$. If $n \not\equiv 0\,({\rm mod}\,6)$ then every closed, orientable 3-manifold can be obtained from $S^3$ by successively performing a finite number of $n$th power surgeries."

A: This is a result of Lickorish, in his paper "A representation of orientable combinatorial 3-manifolds".  The paper is only eleven pages, and is very readable.  In his proof, Lickorish rediscovers some ideas first investigated by Max Dehn 40 years earlier.
Lickorish's theorem was unexpected at the time; I don't think that Witten's remark is really justified...
Here is a very sketchy overview of Lickorish's proof.
The first step is to note that every closed, connected, orientable three-manifold $M$ has a Heegaard splitting.  That is, you can get $M$ by gluing together a pair of handlebodies.  (That this is true for combinatorial manifolds is an easy exercise.  That all three-manifolds are combinatorial is a very difficult theorem.)
The second step is to prove that any orientation-preserving homeomorphism of a closed surface is isotopic to a product of Dehn twists.  This requires proving that you can get from any (non-separating) curve to any other by a chain of curves, with each pair meeting exactly once.
The third step is to relate Dehn twists to a special case of Dehn surgeries - this is probably the most "three-dimensional" part of the proof.
Since the three-sphere has a Heegaard splitting in every genus, the theorem will follow.
Other references include Rolfsen's book (I think) and the book by Prasolov and Sossinsky (definitely).


text:
Q: Can the wp_posts table have the same slug (post_name) in multiple statuses (post_status)? I'm using function get_posts to retrieve a set of post objects that are my custom post type (CPT).  I am counting on being able to programmatically flip these posts between status "publish", "pending" and "draft".
Before I go through the trouble of detecting and "fixing" potential duplicates -- is it even something I have to worry about?  Is there any scenario where the same CPT post_name can reside in the wp_posts table in more than one (row) of differing post_status:  publish, pending or draft?
(edit)  After some experimentation I found that when inserting a post of status "pending", it ignores the post_name parameter - so that ends up being blank in the database.  And yes, it will allow many rows in the wp_posts table with the same post_name of '' (blank).  I'm sure there's a good reason for this but it is not what I expected that's for sure.

A: No, multiple posts with the same CPT and post name (slug) are not possible. Someone can work hard and ruin the DB by writing into it some illegal values, but that should not be something you think of when writing your code.
Posts in their initial state are not true posts, they are just place holders, therefor while your observation is valid, it is not really relevant for usual usage pattern of wordpress API, unless once again your aim is to break things.


text:
Q: GraphQl get Product collection I have created Rest API for getting product collection for learning purpose , I wanted to convert it in GraphQl Api.
My question is below code valid for GraphQl or there is something else? My rest APi code:
<?php
namespace Kanika\Myapi\Model;

use Magento\Framework\Exception\InputException;
class Productapi implements \Kanika\Myapi\Api\ProductapiInterface
{

     protected $_productCollection;
     public function __construct(
             \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $_productCollection
        ) {

            $this->_productCollection = $_productCollection;
        }
     public function getlist($category_ids,$is_featured,$special_price,$brands,$product_type,$page=1,$pagesize=10){
        $collection = $this->_productCollection->create();
        $collection->addAttributeToSelect('name');
        $collection->addAttributeToSelect('price');
        if(!empty($category_ids)){
            $collection->addCategoriesFilter(['in' =>[$category_ids]]);
        }
        if($is_featured==1){
            $collection->addAttributeToFilter('is_featuredproduct', array('eq' => 1));
        }
        if($special_price==1){
            $todayDate = date('m/d/y');
            $tomorrow = mktime(0, 0, 0, date('m'), date('d')+1, date('y'));
            $tomorrowDate = date('m/d/y', $tomorrow);

            $collection->addAttributeToFilter('special_from_date', array('date' => true, 'to' => $todayDate))
                ->addAttributeToFilter(
                        'special_to_date', array('or'=> array(
                        0 => array('date' => true, 'from' => $tomorrowDate),
                        1 => array('is' => new \Zend_Db_Expr('null')))
                        ), 'left'
                    );
        }
        if($product_type=='bundle'){ // bundle | simple | configruable
            $collection->addAttributeToFilter('type_id','bundle');
        }
        $collection->addAttributeToFilter('visibility', \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH);
        $collection->addAttributeToFilter('status',\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
        $data=[];
        $collection->setPageSize($pagesize)->setCurPage($page)->load();
        foreach ($collection as $product) {
           $data[] = [
                'id'=>$product->getId(),
                'sku'=>$product->getSku(),
                'name'=>$product->getName(),
                'brand'=>$product->getBrand(),
                'price'=>$product->getPrice(),
                'special_price'=>$product->getSpecialPrice(),
                'product_type'=>$product->getTypeId()
           ];
        }
        $pagination=[
            'current_page'=>$page,
            'last_page'=>$collection->getLastPageNumber(),
            #'total_product'=>$collection->count()
        ];
        return [
            'items'=>$data,
            'pagination'=>$pagination
        ];
    }
}

A: You have to create schema.graphqls and resolver class to implement this graphql and some changes too. create a resolver class with graphql exception handling & some part of above code would definitely work.


text:
Q: Clean language: append number in end of file, fwritei doesn't work I'm trying to write function that receive [String] which are names of files, String which is the name of the files directory and *f. The function will append to each file an integer in the end.
Here is what I got so far:
import StdEnv
import StdFile
import FileManipulation

appendNumInEndOfVmFiles :: [String] String *f -> String
appendNumInEndOfVmFiles [] dirname w = "finished"
appendNumInEndOfVmFiles [x:xs] dirname w
# path = dirname +++ "\\\\" +++ x
# (ok,file,files) = fopen path FAppendText w
# file = fwritei 12 file
# (ok2,_) = fclose file w
= appendNumInEndOfVmFiles xs dirname w

Start w
// 1. Receive name of directory from the user.
# (io,w) = stdio w                                  // open stdio
# io = fwrites "Enter name of directory:\n" io      // ask for name
# (name,io) = freadline io                          // read in name
# name = name % (0, size name - 2)                  // remove \n from name
# (ok,w) = fclose io w                              // close stdio
| not ok = abort "Couldn't close stdio"             // abort in case of         failure

// 2. Get a list of all file names in that directory.
# (dir,w) = getDirectoryContents (RelativePath [PathDown name]) w
# fileList = getNamesOfFilesInDirectory (getEntriesList dir)

= appendNumInEndOfVmFiles (getVmFiles fileList) name w

Assume that getVmFiles is defined in my FileManipulation.dcl file and in the context of this problem name is "myDir" and file list is ["hello.vm","Wiki.vm"]
For some reason, even that I got "finished" message on the screen, the files aren't modified. No matter what kind of integer I give to fopen, even if its FWriteText or FWriteData its still doing nothing... also even if I'm using fwritec or fwrites with characters nothing happened.
What I'm missing here? Thanks a lot!

A:
For some reason, even that I got "finished" message on the screen, the files aren't modified.

This is due to lazy evaluation. In appendNumInEndOfVmFiles, the result of fclose is not used, so fclose is not evaluated. Because of this, fwritei does not need to be evaluated either. You can fix this by adding a guard on ok2:
# (ok2,_) = fclose file w
| not ok2 = abort "fclose failed\n"
= appendNumInEndOfVmFiles xs dirname w

However, the typical way to do this would be to rewrite the function to return a *f instead of a String, so that this unique value is not lost. As long as the result is used, then, the fwritei is evaluated. You can potentially make the *f argument strict (i.e. add a ! in front). This would make sure that it is evaluated before entering the function, so that all lingering file closes have been performed.

There are some more issues with your code:

*

*Here, w is used twice, which is illegal because it is of a strict type. You should use (ok2,w) in the guard to continue with the same environment.
# (ok2,_) = fclose file w
= appendNumInEndOfVmFiles xs dirname w

*The appendNumInEndOfVmFiles needs to have a type context | FileSystem f to resolve overloading of fopen and fclose.

Lastly:

... even if its FWriteText or FWriteData ...

Just so you know: the difference would be that the first would write the integer in an ASCII representation whereas the second would write it binary as 4 or 8 bytes (depending on the bitwidth of your system).


text:
Q: How to add support for google home app to my smart bulb? We have built a smart bulb which we want to control using the Google Assistant as well(apart from our Android and iOS apps). I searched for this and figured out that we need to implement Google Weave protocol on our bulbs for it to be controllable via Google Assistant.
What I don't understand is how can I add this to Home app so that users can add it as smart bulb to Home app and control via Google Assistant?

A: You can make the link between home and your system via api.ai
The key concepts are here. This site creates JSON files which are loaded into the Google Actions API. Once approved you have a keyword or phrase which when said into Google home opens interactions with your system via webhooks.

A: For anyone facing the same problem, found my answer here: https://developers.google.com/actions/smarthome/
At the time I posted my question, this page either did not exist or I did not find it.
This page points to sample implementation for smart home device. Here is the link to github repo: https://github.com/actions-on-google/actionssdk-smart-home-nodejs It also has detailed instructions on how to run the code.
To summarize, we need provide following actions.json(which points to our server which fulfills 3 intents SYNC, QUERY and EXECUTE) file as our Action Package.
{
  "actions": [{
    "name": "actions.devices",
    "deviceControl": {
    },
    "fulfillment": {
      "conversationName": "automation"
    }
  }],
  "conversations": {
    "automation" :
    {
      "name": "automation",
      "url": "https://<our server which provides fulfillment for SYNC, QUERY and EXECURE intents>"
    }
  }
}


text:
Q: Synonym of Synonym Is a synonym of a synonym a synonym of the first word?
For example: A synonym of Charisma is Personality. A synonym of Personality is Character.
Therefore, can we assume that Charisma and Character are synonyms of each other...?
Is the above a good example of when this in-direct synonym example proves to be correct?

A: Are charisma and character synonyms?
Charisma means being full of character, so in some sentences yes, but that is entirely coincidental of your reasoning.
Is every synonym of a word's synonym also a synonym of the first word?
No. This is because not every word has the same meaning, and many words have multiple meanings. Even if a word has 15 different synonyms, not all of those words hold exactly the same meaning. However, in certain contexts, many words are interchangeable with one another.
Example: Anger and rage are synonyms, they have almost the same meaning... until anger is being used as a verb. "You anger me." makes sense but "You rage me." does not. Rage has a different forn for that function, "enrage".
Because words may have considerable overlap and contextual interchangeability, we categorize them as synonyms of each other for their individual similarities. Because not every word has exactly the same meaning, they don't perfectly overlap with the same group of words. While a synonym of a synonym may also be a direct synonym of the first word, it would likely already be listed as such in a thesaurus if it were.