text:
Q: How do I destroy my multimeters? During a task that involves current measurement in the mA and µA range, I managed to blow up the fuses of 3 DMMs. The DMMs were an old Voltcraft DMM from the 1990's, a PeakTech 2025 (similar to the 2025A) and a Voltcraft VC175 [German], all in the range below 100€. In all 3 cases it was the lower current fuse (500 mA/600 mA/2 A), not the high current fuse (10 A). I have bought a bunch of new fuses and replaced them, that's not a big deal.
However, I'd like to figure out why and how the fuses blew up in all 3 DMMs. And maybe, just for fun, do that again for demonstration purposes and the sake of learning as suggested in this similar case.
This was the measuring task, calculating ß of a transistor:

simulate this circuit – Schematic created using CircuitLab
Here's what I believe could help:

*

*the DMM was already connected to the circuit, but turned off initially

*I turned on (and output) the power supply before I turned on the DMM

*the power supply is a 5 A supply. I usually work with an 1 A limit (still enough to blow a 600 mA fuse, though) and I'll lower that next time

*I usually work with 12 and 5 V. I doubt it could have been set to 30 V (maximum).

*in order to get to a reasonable setting on the DMM like mA, I need to turn the switch through a bunch of other positions like R and µA. This may vary per instrument

*because I was measuring ohms before, the red cable might have been in the wrong socket (like V instead of mA), but certainly not in the 10 A socket.

*some of the DMMs have an auto power-off, and in order to turn it on again, I turn the switch back to OFF and then on again

*The potentiometer R may have had extreme values like 0 Ohm or 10 kOhm

*Other than that, I'm pretty confident that the connections of the components were ok. It was reviewed.

Well, you might say: why don't you just repeat the experiment and see in which position the fuse blows? Answers: a) The fuses are not easily regardable but hidden inside the DMM housing. I would need to check after each position. b) They are no longer simple wires in glass. They are filled with white material.
My question is: given the assumption that the wiring was according the diagram, just the socket at the instrument might have been the wrong one, which DMM switch position would blow up the fuse? As I don't see a short circuit path in the diagram, could the voltage of the internal batteries of the DMM have blown the fuse?
If you like, maybe you can add a few best practices for working in a circuit with DMMs that turn off. Should I always disconnect the cables while I turn the switch? Sounds like much overhead.


text:
Q: Trying to render text on matplotlib plots with LaTex font and getting the error "[Errno 13] Permission denied: 'latex'" Problem
I am trying to follow the Text rendering with LaTeX matplotlib documentation in order to have the font of my plots (including axis) in Jupyter Notebook be in LaTex. I am hoping to run this example code provided in the documentation:
import numpy as np
import matplotlib.pyplot as plt

plt.rcParams['text.usetex'] = True

t = np.linspace(0.0, 1.0, 100)
s = np.cos(4 * np.pi * t) + 2

fig, ax = plt.subplots(figsize=(6, 4), tight_layout=True)
ax.plot(t, s)

ax.set_xlabel(r'\textbf{time (s)}')
ax.set_ylabel('\\textit{Velocity (\N{DEGREE SIGN}/sec)}', fontsize=16)
ax.set_title(r'\TeX\ is Number $\displaystyle\sum_{n=1}^\infty'
             r'\frac{-e^{i\pi}}{2^n}$!', fontsize=16, color='r')

When I try running this in VS code, I get the following error:

--------------------------------------------------------------------------- PermissionError                           Traceback (most recent call
last) File
~/.local/lib/python3.8/site-packages/IPython/core/formatters.py:339,
in BaseFormatter.call(self, obj)
337     pass
338 else:
--> 339     return printer(obj)
340 # Finally look for special method names
341 method = get_real_method(obj, self.print_method)
File
~/.local/lib/python3.8/site-packages/IPython/core/pylabtools.py:151,
in print_figure(fig, fmt, bbox_inches, base64, **kwargs)
148     from matplotlib.backend_bases import FigureCanvasBase
149     FigureCanvasBase(fig)
--> 151 fig.canvas.print_figure(bytes_io, **kw)
152 data = bytes_io.getvalue()
153 if fmt == 'svg':
File
~/.local/lib/python3.8/site-packages/matplotlib-3.5.2-py3.8-linux-x86_64.egg/matplotlib/backend_bases.py:2295,
in FigureCanvasBase.print_figure(self, filename, dpi, facecolor,
edgecolor, orientation, format, bbox_inches, pad_inches,
bbox_extra_artists, backend, **kwargs)    2289     renderer =
_get_renderer(    2290         self.figure,    2291         functools.partial(    2292             print_method,
orientation=orientation)    2293     )    2294     with
getattr(renderer, "_draw_disabled", nullcontext)():
-> 2295         self.figure.draw(renderer)    2297 if bbox_inches: ...    1703         err_msg = os.strerror(errno_num)
-> 1704     raise child_exception_type(errno_num, err_msg, err_filename)    1705 raise child_exception_type(err_msg)
PermissionError: [Errno 13] Permission denied: 'latex' <Figure size
432x288 with 1 Axes>

What I have tried
The first thing I did was make sure I had all of the correct installations the documentation listed, and I chose MikTex as my LaTex installation. It was installed within the AppData folder and the directory where 'latex.exe' can be found is on my system path according to the path in my Environment Variables and appears if I print the path using os.environ within my notebook.
I also tried checking for similar questions on here. The only one I found to be having the same issue is here and is unsolved. I also tried following the advice given on that question and it is still giving me the same error. plt.rc command also does not work.

A: I also had a similar problem before, although not specifically with latex in matplotlib. What I found was that sometimes packages get installed only for the administrator of the PC, and then permissions get denied. I found two solutions:

*

*Run your jupyter notebook via Anaconda Prompt by right clicking on the prompt and running as administrator; or

*Delete everything an reinstall all packages for the whole PC and not only the administrator.

I hope that helps!

redpajama_set_name: RedPajamaStackExchange


text:
Q: SQLite random database connection crash I am programming a database export solution to convert a database. It is exporting and processing some hundred gigabytes of data in a multithreaded environment. All threads work in their own environment with own connections, but for orchestrating the export uses a sqlite "lookup" database that is used by all threads to distribute work and encode a specific field to a new id. This happens quite rarely (once every 50k rows exported) so it should not really slow the process even if locks are used.
For some reason about every 10-15min this lookup database throws an exception "could not open database" with errorcode 14. The exception randomly occurs on any of the ExecuteReader() methods.  I tried to lock all methods accessing this database but still it crashes every 10-15min. Why? Actually when I just press on Resume in debugging mode everything works again, seems to be a temporary problem.
ExecuteLookup() is called by "main" exporting thread repeatedly.
DBQueryLookupDb() is called by any of the worker threads. (Something like INSERT INTO progress ...)
// using Microsoft.Data.Sqlite

  private long ExecuteLookup(string value)
        {
            lock (this)
            {
                using (var cmd = GetSelectLookupCmd()) // "SELECT id,original FROM lookup_id WHERE original = @original", parameter is added, tried to re-use this command but same problem
                {
                    cmd.Parameters["@original"].Value = value;
                    using (var res = cmd.ExecuteReader())
                    {
                        if (res.Read())
                        {
                            return res.GetInt64(0);
                        }
                    }
                }
                using (var cmd = GetInsertLookupCmd()) // INSERT INTO ...;SELECT last_insert_rowid();
                {

                    cmd.Parameters["@original"].Value = value;
                    using (var res = cmd.ExecuteReader())
                    {

                        if (res.Read())
                        {
                            return res.GetInt64(0);
                        }
                        else { throw new Exception("Unexpected fail on lookup insert"); }
                    }
                }
            }
        }
        public void DBQueryLookupDb(string sql)
        {
            lock (this)
            {
                using (SqliteCommand c = new SqliteCommand())
                {
                    c.Connection = lookupDb;
                    c.CommandType = System.Data.CommandType.Text;
                    c.CommandText = sql;
                    c.ExecuteNonQuery();
                }
            }

        }

A: "PRAGMA JOURNAL_MODE ='PERSIST'" resolves the problem. TRUNCATE may work too. It may be a sync problem coming from the network drive (Sqlite deletes the journal and immediatley creates a new one before the network drive is ready again)


text:
Q: "overload resolution ambiguity" when function parameter is marked "NonNull" Here are my Kotlin (Version 1.3.61) + Java(1.8.0_201) code that failed to compile:
Maven:
<dependency>
    <groupId>com.google.code.findbugs</groupId>
    <artifactId>jsr305</artifactId>
    <version>2.0.1</version>
</dependency>

Test.Kt:
fun main(args: Array<String>) {
    Point().setX(1)
}

Point.java:
import javax.annotation.Nonnull;

public class Point {
    public void setX(int x) {
    }

    public void setX(@Nonnull Integer x) {
    }
}

Failed to compile due to the following error:
Error:(2, 13) Kotlin: Overload resolution ambiguity:
public open fun setX(@Nonnull x: Int): Unit defined in Point
public open fun setX(x: Int): Unit defined in Point

If I removed the @NonNull annotation in the second setX function, then this demo could compile. I thought Java annotation was only extra metadata and would not affect the code itself, so I had no idea why the ambiguity arose here.
Also, I run javap -s Point.class and found out that they had same output:
public void setX(java.lang.Integer);
    descriptor: (Ljava/lang/Integer;)V

Can someone help to explain what is going on here? Thanks in advance.

A: From kotlin in action

sometimes Java code contains information about nullability, expressed
  using annotations. When this information is present in the code,
  Kotlin uses it. Thus @Nullable String in Java is seen as String? by
  Kotlin, and @NotNull String is just String. The interesting
  question is what happens when the annotations aren't present. In that case, the
  Java type becomes a platform type in Kotlin.
When you use Java declarations from Kotlin, Java primitive types
  become non-null types (not platform types), because they can't hold
  null values.

in your case first method has a java primitve type as parameter and because primitives can't be null kotlin translates it to
setX(x: Int)

and since second method contains @Nonnull annotation, kotlin uses this information and hence it translates the method to
setX(x: Int)

so as you can see for kotlin they are two different methods with exact same signature, hence the ambiguity.


text:
Q: align ! missing } inserted I am trying to typeset the following equation in the align-evoirement
\begin{align}
t_2'                &= t_2 + \frac{L/C} \\
t_1'                &= t_1 + \frac{L + v\Delta t\cos\theta}{c} \\
t_2' - t_1'         &= (t_2-t_1) + \frac{L-L-v\Delta t\cos\theta}{C} \\
\Delta t'           &= \Delta t - \frac{v\Delta t \cos \theta}{c} \\
\Delta t'           &= \Delta t \left(1-\frac{v\cos\theta}{c}\right) \\
\frac{1}{\nu}       &= \frac{1}{\nu_0 \sqrt{1-\frac{v^2}{c^2}}}~\left(1-\frac{v\cos \theta {c}\right) \\
\nu                 &= \nu_0\frac{ \sqrt{1-\dfrac{v^2}{c^2}}}{1-\dfrac{v\cos \theta }{c}}
\end{align}

But when I tried this I got the following message:
[45]
! Missing } inserted.
<inserted text>
}
l.938 \end{align}

?

I copied the equations in Matcha (without the &), where it was perfectly working... I tried some things, but those did not seem to work...
Does anybody know what I did wrong?

A: At two occasions you write \frac{..} without the mandatary second argument. You must write \frac{...}{...} instead.
\documentclass{article}

\usepackage{mathtools}

\begin{document}

\begin{align}
t_2'                &= t_2 + \frac{L}{C} \\
t_1'                &= t_1 + \frac{L + v\Delta t\cos\theta}{c} \\
t_2' - t_1'         &= (t_2-t_1) + \frac{L-L-v\Delta t\cos\theta}{C} \\
\Delta t'           &= \Delta t - \frac{v\Delta t \cos \theta}{c} \\
\Delta t'           &= \Delta t \left(1-\frac{v\cos\theta}{c}\right) \\
\frac{1}{\nu}       &= \frac{1}{\nu_0 \sqrt{1-\frac{v^2}{c^2}}}~\left(1-\frac{v\cos \theta}{c}\right) \\
\nu                 &= \nu_0\frac{ \sqrt{1-\dfrac{v^2}{c^2}}}{1-\dfrac{v\cos \theta }{c}}
\end{align}

\end{document}


text:
Q: Not able to get the overflow feature for actionbar in android What i am trying to do ::

What is happening ::

My code::
actionbar_sort_menu.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >

    <item
        android:id="@+id/searchID"
        android:icon="@drawable/ic_action_search"
        android:showAsAction="ifRoom|withText"
        android:title="Search"/>
    <item
        android:id="@+id/featuredID"
        android:icon="@drawable/ic_action_featured"
        android:showAsAction="ifRoom|withText"
        android:title="Featured"/>
    <item
        android:id="@+id/dealsID"
        android:icon="@drawable/ic_action_deal"
        android:showAsAction="ifRoom|withText"
        android:title="Deals"
        />
    <item
        android:id="@+id/inviteID"
        android:icon="@drawable/ic_action_share"
        android:showAsAction="ifRoom|withText"
        android:title="Invite or Share"/>

</menu>

Manifest code::
<application
        android:name="com.myApp.utilities.AppController"
        android:configChanges="orientation|keyboardHidden"
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

Theme i am using::
android:Theme.Holo

Support library ::
android-support-v4.jar

{EDIT}
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:yourapp="http://schemas.android.com/apk/res-auto"  >

    <item
        android:id="@+id/searchID"
        android:icon="@drawable/ic_action_search"
        yourapp:showAsAction="never"
        android:title="Search"/>
    <item
        android:id="@+id/featuredID"
        android:icon="@drawable/ic_action_featured"
        yourapp:showAsAction="never"
        android:title="Featured"/>
    <item
        android:id="@+id/dealsID"
        android:icon="@drawable/ic_action_deal"
        yourapp:showAsAction="never"
        android:title="Deals"
        />
    <item
        android:id="@+id/inviteID"
        android:icon="@drawable/ic_action_share"
        yourapp:showAsAction="never"
        android:title="Invite or Share"/>

</menu>

error i am getting
No resource identifier found for attribute 'showAsAction' in package com.myApp

A: Since you are using Support library you need to have your own namespace prefix
 <menu xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:yourapp="http://schemas.android.com/apk/res-auto" >

Then change this
  android:showAsAction="ifRoom|withText"

to
  yourapp:showAsAction="ifRoom|withText"

Note : If there is not enough space to display items in the actionbar it will appear in the overflow menu. If you have room for few items it appears on the actionbar and the rest in overflow.
Edit:
yourapp:showAsAction="never"

From the docs
http://developer.android.com/guide/topics/resources/menu-resource.html
 never  Never place this item in the Action Bar.

A: *

*Well This was just a workaround to get the answer as below

*Since i am not having the device to test for the solution to test
Raghunandan answer

*I still believe Raghunandan answer holds good & also sharing what i
came to do

Reason for me to test on mobile because:: "device has a menu-button, the overflow-icon won't show."

Code::
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    ft = getFragmentManager().beginTransaction();

    switch(item.getItemId()) {
    case R.id.descriptionID:
        onItemChangeBackground(1);

        Fragment fragContents = FrgBufDetails.newInstance(buf_off_id);
        ft.replace(R.id.content_frame, fragContents);
        ft.addToBackStack(null);
        ft.commit();

        return true;
    case R.id.MapID:
        onItemChangeBackground(2);

        Fragment fragMap = FrgBufLocation.newInstance(buf_off_id);
        ft.replace(R.id.content_frame, fragMap);
        ft.addToBackStack(null);
        ft.commit();

        return true;
    case R.id.galleryID:
        onItemChangeBackground(3);

        Fragment fragGallery = FrgBufGallery.newInstance(buf_off_id);
        ft.replace(R.id.content_frame, fragGallery);
        ft.addToBackStack(null);
        ft.commit();

        return true;
    case R.id.inviteID:
        onItemChangeBackground(4);

        View title = (View) getActivity()
                    .findViewById(R.id.inviteID);

        //Creating the instance of PopupMenu
        PopupMenu popup = new PopupMenu(getActivity(), title);
        //Inflating the Popup using xml file
        popup.getMenuInflater().inflate(R.menu.actionbar_sort_menu, popup.getMenu());
        popup.show();//showing popup menu

        return true;
    }
    return super.onOptionsItemSelected(item);
}


text:
Q: upload to ftp asp.net Is it possible to upload a file directly into an ftp account folder with ASP.NET ?
E.g. I click on browse, select a file to upload and when I click "upload" button, It should save it directly to the folder on another web server located at somewhere else other then the server that is being used to upload.

A: As I understand your question, you want to upload the file to another remote server (so it's not another server sitting on the same network as your web server)? In that case you can do a couple of different things. The easiest way is perhaps to start by making a regular file upload you your server, and then have your server send the file via FTP to the other remote server:
string fileName = Path.Combine("<path on your server", FileUpload1.FileName);
FileUpload1.SaveAs(fileName);
using(System.Net.WebClient webClient = new System.Net.WebClient())
{
    webClient.UploadFile(
        New Uri("ftp://remoteserver/remotepath/" + FileUpload1.FileName),
        localFile);
}

...or it might work doing it in one step:
using(System.Net.WebClient webClient = new System.Net.WebClient())
{
    webClient.UploadData(
        New Uri("ftp://remoteserver/remotepath/" + FileUpload1.FileName),
        FileUpload1.FileBytes);
}

(I din't try this code out, so there could be some errors in it...)
Update: I noticed that I was wrong in assuming that the UploadXXX methods of WebClient were static...

A: You can use the WebClient class to store the uploaded file to FTP (without saving it as a file on the server). Something like this:
string name = Path.GetFileName(UploadControl.FileName);
byte[] data = UploadControl.FileBytes;

using (WebClient client = new WebClient()) {
   client.UploadData("ftp://my.ftp.server.com/myfolder/" + name, data);
}

A:     /// <summary>
    /// Example call : if (FtpUpload(FileUploadControl1, "ftp.my.com/somePathDir", @"user", "pass!", "domain"))
    /// </summary>
    /// <param name="file"></param>
    /// <param name="ftpServer"></param>
    /// <param name="username"></param>
    /// <param name="ftpPass"></param>
    /// <returns></returns>
    private bool FtpUpload(FileUpload file, string ftpServer, string username, string ftpPass, string domainName = "")
    {
        // ftp://domain\user:password@ftpserver/url-path
        // If you are a member of a domain, then "ftp://domain-name\username:password@url-path" may fail because the backslash (\) is sent in as a literal character and Internet Explorer incorrectly looks for a file instead of parsing a Web address. Changing the backslash (\) in the domain-name\username to domainname%5Cusername works correctly.

        try
        {
            string ftpAddres;
            if (domainName != string.Empty)
                ftpAddres = "ftp://" + domainName + @"%5C" + username + ":" + ftpPass + "@" + ftpServer + "/" + file.FileName;
            else
                ftpAddres = "ftp://" + username + ":" + ftpPass + "@" + ftpServer + "/" + file.FileName;

            using (var webClient = new System.Net.WebClient())
            {
                webClient.UploadData(new Uri(ftpAddres), file.FileBytes);
            }

        }
        catch (Exception e)
        {
            throw new Exception(e.Message, e);
        }
        return true;
    }

A: You cannot upload it to an FTP directly from your HTML form. However, you can upload it to your ASP.NET application and then upload it to the FTP from there using FtpWebRequest.

A: EDIT
First off the @ sign is there to flag the string as a literal. it saves you having to escape characters like backslashes. e.g.
string path = "Z:\\Path\\To\\File.txt";
string path = @"Z:\Path\To\File.txt";

Secondly, if you only have FTP Access to the other server, then you can take, the FileUpload.FileBytes Property of the FileUpload control. That will give you a byte[] of the file contents.
From this you use the System.Net.FtpWebRequest & System.Net.FtpWebResponse to upload your file to the FTP Account.
Theres some sample code here in VB.NET but it should be easy enough for you to figure out
http://www.programmingforums.org/thread15954.html
ORIG
The file upload control will provide you with the File on your webserver.
It would be up to you, to copy/save that file then from the webserver to whatever server
you're FTP is hosted on.
Do you have a UNC Path/Mapped Drive shared out on your other server that you can save to.
The FileUpload Control has a .SaveAs() method so it's just a simple matter of
if (FileUpload1.HasFile)
try
{
    FileUpload1.SaveAs(@"Z:\Path\On\Other\Server\" + FileUpload1.FileName);
}


text:
Q: Uninstall eclipse 3.8 which was already on my computer I downloaded eclipse luna v4.4 and extracted the files in my home folder
Then I tried to run it from the terminal by typing eclipse and got an error "eclipse is not installed".
I typed "sudo apt install eclipse-platform", I got a message that this will use up about disk space, i confirmed and eclipse was installed.
When i typed eclipse it started eclipse 3.8 which i believe was waiting 'dormant' in my machine.
So it appears that I have only installed an older version of eclipse and not v4.4.
Although I can ran eclipse 4.4 I don't like the idea of having two different eclipse version on my machine. Plus I can't run v4.4 from terminal.
Please help

A: You installed eclipse from the repository after downloading a newer one.
Remove the apt installed one :
sudo apt remove eclipse-platform

Check the answer  here to be able to start eclipse from command line.

A: You've made the same mistake that I made yesterday when installing Eclipse on my computer.
Here are the steps you need to take:

*

*Remove the eclipse software which you currently have installed (package name eclipse-platform on my computer): sudo apt-get purge eclipse-platform

*Return to the extracted Luna folder.

*Here's the step where you originally made the mistake: you need to run eclipse with ./eclipse, not with eclipse. That tells it to run eclipse in the current directory. Otherwise it searches the PATH variable, doesn't find eclipse and tells you that eclipse is not installed.

Explanation (if you are interested in the reason why ...)
Ubuntu frequently packages many applications in their repositories, but it happens that the versions are outdated. This is why the Ubuntu version of eclipse is 3.8 while the latest now is 4.6 (Neon).
To avoid this, application developers frequently bundle their applications in an archive file. When you extract this archive file, it does not install it for the whole system, but rather you (the user)  only. This is why the PATH variable is not updated to reflect it.
If you want instructions on how to update the PATH, just leave a comment.

A: I installed eclipse and tested these commands I found on the Internet.
The following commands should uninstall and purge eclipse
sudo apt-get autoremove eclipse*
rm -r ~/.eclipse/

May the Source be with you.


text:
Q: Compute the mean for the $f(x)=\dfrac {3}{2}\sqrt {x-1},\;1 \leq x \leq 2$ using probability distribution. How I compute the mean for the $$f(x)=\dfrac {3}{2}\sqrt {x-1},\;1 \leq x \leq 2$$ using  probability distribution.
My attempt$$\mu_x=E(X)=\int_{-\infty}^{\infty}xf(x)dx\\= \int\limits_{1}^{2}\,x\cdot\dfrac {3}{2}\sqrt {x-1}\;dx\\= \dfrac {3}{2} \left [ \int\limits_1^2x\sqrt {x-1}\,dx \right]$$
Now, don't understand what to do.  Thanks in advance.

A: Now, use integration by parts formula$$\displaystyle\int u\; dv=u\;v-\int v\;du\\\text{Let }u=x,\;\;dv=\sqrt{x-1} \; dx\\du=dx,\;\;v=\dfrac{2}{3}(x-1)^{3/2}\\ = \dfrac{3}{2} \left[x\cdot\dfrac{2}{3}(x-1)^{3/2} - \int \dfrac{2}{3}(x-1)^{3/2} \,dx\right]^2_1\\ =\left[ \dfrac{3}{2} \left[x\cdot\dfrac{2}{3}(x-1)^{3/2} - \dfrac{2}{3}×\dfrac{2}{5} (x-1)^{5/2} \,\right]\right]^2_1\\= \left[x(x-1)^{3/2} - \dfrac{2}{5} (x-1)^{5/2}\right]^2_1\\ = 2- \dfrac{2}{5}\\\mu=\dfrac{8}{5} = 1.6 $$
go there for better explanation on probability distribution.


text:
Q: user module - node js i have a question regarding defining objects in modules.
lets say i have a module:
/*---obj----*/
function A (param){
this.parm=param;
function func(){
//do somthing
 }
}
exports.func=func;

/*---file.js----*/
obj=require('obj');

function fileFunc(A){
A.func();//with out this line it works fine
A.param=2;
 }
}

for some reason it does not recognize the function in the object A. it recognizes the object A and its different vars, but when it comes to executing the function it gives the msg:
     TypeError: Object # has no method 'func'
i tried also to export the function in A by:
     exports.A.func=A.func
or
     exports.func=func
neither works..
does someone have a clue?
thanx
matti

A: The function you defined inside of A is local only to that function. What you want is
function A(param) {
  this.param = param;
}

A.func = function() {
  // do something
};

But if you are treating A as a constructor then you'll want to put that function in A's prototype
A.prototype.func = function() {
  // do something
};


text:
Q: Como encontrar la ventana que desencadeno un evento en tkinter? Estoy tratando de ejecutar una función callback con el evento  de cierre: self.toplevel_1.bind ('<Destroy>', lambda: self.close_windows (3)) , pero  Destroyse aplica a todos los widgets descendientes de Toplevel por lo que en la función vinculada tengo que encontrar a Toplevel para solo referirla a ella y no a los demas widget descendientes, leí que deberia usar  event.widget pero no se como deberia implementarlo . Muchas gracias por cualquier ayuda que me puedan brindar.
from tkinter import *

class A (Frame):
    def __init__(self,master, **kwargs):
        super().__init__(master, **kwargs)
        self.master = master
        self._open_1 = False
        self._open_2 = False
        self.btn = Button(self, text='create winoows', command= self.create)
        self.btn .pack()

    def create(self):
        if self._open_1 is False:
            self.w1 = Toplevel(self.master)
            self.w1 .title('window 1')
            self.w1 .bind('<Destroy>',lambda f: self.close_windows(1))

        if self._open_2 is False:
            self.w2 = Toplevel(self.master)
            self.w2 .title('window 2')
            self.w2 .bind('<Destroy>',lambda f: self.close_windows(2))

        self._open_1 = True
        self._open_2 = True

    def close_windows(self,  number, event=None):
        if number is 1:
            event.widget.destroy()
            self._open_1 = False

        if number is 2: pass #......

root = Tk()
a = A(root)
a .pack()
root .mainloop()

Cabe resaltar que 'WM_DELETE_WINDOW' no entraría al caso porque la ventana no tiene el gestor de ventanas.

A: No estoy del todo seguro de qué pretendes, pero el problema está en que el parámetro event de tu callback nunca es asignado en la invocación, y por tanto tiene el valor None que le das por defecto.
La razón de eso está aquí:
self.w1.bind('<Destroy>', lambda f: self.close_windows(1))

La función bind espera dos parámetros. El primero es el evento y el segundo es una función que, cuando sea invocada por tk, recibirá como parámetro un evento. En tu caso esa función es la lambda y el parámetro que recibe (al que has llamado f) sería el evento en cuestión. Pero como ves no estás usando f para nada. Basta pasárselo como segundo parámetro a close_windows().
Reescribiendo entonces esa línea (y aprovechando para cambiar f por un nombre más significativo) quedaría así:
self.w1.bind('<Destroy>', lambda event: self.close_windows(1, event))

Código completo
El código completo quedaría como sigue. He aprovechado también para cambiar tus if number is 1  por if number == 1, y el if self._open_1 is False por if not self._open_1, que es lo correcto (mira esta pregunta para saber por qué no debe usarse is para comparaciones).
from tkinter import *

class A (Frame):
    def __init__(self,master, **kwargs):
        super().__init__(master, **kwargs)
        self.master = master
        self._open_1 = False
        self._open_2 = False
        self.btn = Button(self, text='create winoows', command= self.create)
        self.btn.pack()

    def create(self):
        if not self._open_1:
            self.w1 = Toplevel(self.master)
            self.w1.title('window 1')
            self.w1.bind('<Destroy>', lambda event: self.close_windows(1, event))

        if not self._open_2:
            self.w2 = Toplevel(self.master)
            self.w2.title('window 2')
            self.w2.bind('<Destroy>', lambda event: self.close_windows(2, event))

        self._open_1 = True
        self._open_2 = True

    def close_windows(self, number, event=None):
        if number == 1:
            self._open_1 = False
            event.widget.destroy()
            print("DEBUG: Close 1", event)

        if number == 2:
           self._open_2 = False
           event.widget.destroy()
           print("DEBUG: Close 2", event)

root = Tk()
a = A(root)
a.pack()
root.mainloop()

Bonus
El código se puede refactorizar para que use listas de ventanas y de booleanos, en lugar de las variables _open_1, _open_2, w1, w2. De este modo es más generalizable y fácilmente puedes hacer que se creeen y manejen cualquier número de ventanas.
Esta sería la versión con listas:
from tkinter import Toplevel
from tkinter import *

class A (Frame):
    def __init__(self, master, nwindows=2, **kwargs):
        super().__init__(master, **kwargs)
        self.master = master

        # Preparamos la lista de booleanos y la de windows
        self._open = [False] * nwindows
        self.windows = [None] * nwindows

        self.btn = Button(self, text='create windows', command= self.create)
        self.btn.pack()

    def create(self):
        # Crear mediante un bucle las ventanas que no estén creadas
        for i in range(len(self._open)):
            if not self._open[i]:
                w = Toplevel(self.master, width=300)
                w.title(f'window {i+1}')
                w.bind('<Destroy>',
                        lambda event, number=i: self.close_windows(number, event))
                # Actualizar las listas
                self.windows[i] = w
                self._open[i] = True

    def close_windows(self, number, event=None):
        # Como medida de seguridad, aunque esto no debería ocurrir
        # verifico si la ventana ya estaba cerrada
        if not self._open[number]:
            return
        # La cierro y actualizo la lista
        self._open[number] = False
        event.widget.destroy()
        print(f"DEBUG: Close {number}")

root = Tk()
a = A(root, nwindows=4)  # Probamos con 4 ventanas
a.pack()
root.mainloop()

Observa que en esta implementación no necesitarías usar event.widget para cerrar la ventana correcta. Podrías hacer self.windows[number].destroy().


text:
Q: Multiple Conditional Statement Execution in Ruby The following statements need to be evaluated if their content is not nil and submitted.  The receiving end does not accept nil values.
  :customer => {
    if !@transaction.name.nil? :first_name => @transaction.nome,
    if !@transaction.last_name.nil? :last_name => @transaction.last_name,
    if !@transaction.nation_id.nil? :country_name => @transaction.nation.name
    },

Without the condition a simple statement :first_name => @transaction.nome, is properly evaluated and the syntax with brackets and commas is proper.  However, the introduction of the condition creates blanks in cases of nil values and generates a syntax error unexpected '}'.
How can this be overcome?

A: One way is to build the hash:
h = {}
if @transaction.name      !=nil then h[:first_name]   = @transaction.name        end
if @transaction.last_name !=nil then h[:last_name]    = @transaction.last_name   end
if @transaction.nation_id !=nil then h[:country_name] = @transaction.nation.name end
:customer => h

If you know that your items are always truthy or nil, never falesy, then this is shorter:
if @transaction.name      then h[:first_name]   = @transaction.name        end
if @transaction.last_name then h[:last_name]    = @transaction.last_name   end
if @transaction.nation_id then h[:country_name] = @transaction.nation.name end

A: You can simply add the values and later filter them out. Will save you from all those checks:
:customer => {
    :first_name => @transaction.nome,
    :last_name => @transaction.last_name,
    :country_name => @transaction.nation.try(:name)
 }.reject{ |_, v| v.nil? }

A: You could kill some duplication by adding a small lambda
customer: {}.tap { |h|
  conditional_store = -> key, value { h.store(key, value) unless value.nil? }
  conditional_store[:firstName,    @transaction.name]
  conditional_store[:last_name,    @transaction.last_name]
  conditional_store[:country_name, @transaction.nation.name]
}


text:
Q: Can I have two django projects sharing the same authentication model? I have two very related sites, would like users using each to only to have to login once.
Either two apps under one django project serving different domains? Is this possible?
or
is there some way to share the authentication between two separate django projects?
Cheers
Asim

A: There are lots of ways you can solve this problem. Here are some things to look into. I'm ordering based on my preference, if you've got some questions, or more specificity to your question, it could change.

*

*Use the same database.

*Make one site an OpenID provider for the other

*Use Django's MultiDB functionality (NOTE! You can't Foreign Key between databases, so don't try if you don't really get the implications of this)


text:
Q: Storing fields from a non entity parent I have a class which I don't want it to be stored on the database, basically it is used for receiving such info from a http request.
class Address {
    private String address;
    private String postCode;

    // + getters and setters

}

Bear in mind that this class is not an entity.
Now I'd like to create an entity by inheriting from it.
@Entity
class StorableAddress extends Address {
   // id and a few more fields.
}

When I save a StorableAddress it doesn't save any field from Address (address and postCode). Is there a solution for that or do I have to copy all the fields?

A: Short answer - you should copy values and not use inheritance.
What you are describing is a DTO pattern.
In order to avoid boilerplate code when working with DTOs, you can use tools like MapStruct


text:
Q: Is programming for Android completely different from programming for iPhone? I have made apps for iPhone, but want to also code for the Android but want to know if it is first worth my time, second worth my having to learn another language, and third worth the effort in the sense that am I going to make a profit from this. Also if in any way Android code is similar, then will it be hard to bring the iOS (Xcode) files, or copy and paste my iOS code into the Android code.

A: It's a most definite no. As iPhone Guy pointed out, there's a major difference in the languages both platforms require. iPhone uses Objective-C whereas the Android is based on Java (don't know if it's Mobile Edition or "regular" though). In addition, it's a completely different set of APIs. iPhone uses a modified form of Cocoa called Cocoa Touch whereas the Android makes uses of Google's SDK for it. In answer to your question, you won't be able to copy/paste your code between the languages. Your Objective-C code won't compile to Java and vice versa.

A: Yes -- programming on the iPhone uses Objective-C while programming for Android is in Java.  Although they use similar concepts, the two languages are different.
I was a Java programmer before switching to Objective C.  Personally I like Objective C better than Java, but that's just a personal opinion ;)


text:
Q: Are there Decorators / Macros / Annotations in AS 3? I'm looking for the equivalent of Python decorators / Lisp macros / Java annotations (yes, I know that these are not necessarily equivalent themselves) in Actionscript. Tools that provide similar features would also be great (I'm using the Flex Builder plugin for Eclipse on Linux).
I'm writing a Flex application and here's what I want to accomplish:
I have encapsulated various sets of remote functionality in separate classes (this is sometimes called "Messaging Gateways" or "Remote Proxies"), where each method mirrors a method on the server, like so:
class UserManagementService extends MyHttpService {
  //...
  private final _urlBase:String = "http://example.com/services/users"
  //...

  public function usrGet(ix:int):User
  {
     url = urlBase + "/get";
     mp:Dictionary = new Dictionary();
     mp["ix"] = ix;
     result:User = this._service.varSend(url, this.sEncodeParams(mp), Class("User"));
     return result;
  }
  //...
}

Since I have the parameters and the return type of the remote function already in the function declaration, it would be nice to just add the URL suffix, like this (Python-inspired pseudocode):
@remotify("/get")
public function usrGet(ix:int):User { }

Now, wouldn't that be neat? ;-)

A: You can add what is called "metadata" in ActionScript like so:
[Remotify(prop="value")]

More information is here:
http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postId=11907


text:
Q: Convert int[] into ArrayList What is best way recopying int[] array elements into ArrayList?
I need to do this fast so what would be the fastest way?

A: With Guava, you don't need to bother with the Integer[]:
int[] array;
List<Integer> list = Ints.asList(array);

and if you want an ArrayList, that's just
List<Integer> list = Lists.newArrayList(Ints.asList(array));

(Disclosure: I contribute to Guava.)
Otherwise, if all you have is an int[], you have to do it the old-fashioned way:
int[] array;
List<Integer> list = new ArrayList<>(array.length);
for (int val : array) {
  list.add(val);
}

A: I'll provide an alternate answer as well, depending on how the List is used this could perform better (creation is faster, and only the actually used ints are converted, but they are always converted not just the first time, so repeated get of the same element is worse). Create a simple wrapper list around the array:
final int[] array = {1, 2, 3};
List list = new AbstractList<Integer>() {

     public Integer get(int index) {
       return array[index];
     }

     public Integer set(int index, Integer value) {
       //or just throw new UnsupportedOperationException("..."); if not needed
       Integer old = array[index];
       array[index] = value;
       return old;
     }

     public int size() {
       return array.length;
     }
};

or in a method creating it for you:
static List<Integer> asList(final int[] array) {
  return new AbstractList<Integer>() { ...
             };
}

A: ArrayList is not the best storage for primitives such as int. ArrayList stores objects not primitives. There are libraries out there for Lists with primitives.
If you really want to store all primitive int as anInteger object you will have to convert them one by one using Integer.valueOf(...) (so you don't create extra Integer instances when not needed).
While you can do this:
List<Integer> list = Arrays.asList(1, 2, 3);

You cannot do this:
int[] i = { 1, 2, 3 };
List<Integer> list = Arrays.asList(i); // this will get you List<int[]>

as an array is actually an object as well an treated as such in var-args when using primitives such as int. Object arrays works though:
List<Object> list = Arrays.asList(new Object[2]);

So something along the lines of:
int[] array = { 1, 2, 3 };
ArrayList<Integer> list = new ArrayList<Integer>(array.length);
for (int i = 0; i < array.length; i++)
  list.add(Integer.valueOf(array[i]));

A: Use Arrays#asList(T... a) to create "a fixed-size list backed by the specified array. (Changes to the returned list "write through" to the array.)"
Integer[] intArray = {1, 2, 3, 42}; // cannot use int[] here
List<Integer> intList = Arrays.asList(intArray);

Alternatively, to decouple the two data structures:
List<Integer> intList = new ArrayList<Integer>(intArray.length);

for (int i=0; i<intArray.length; i++)
{
    intList.add(intArray[i]);
}

Or even more tersely:
List<Integer> intList = new ArrayList<Integer>(Arrays.asList(intArray));


text:
Q: Angular 2.0 Dart with Transformer and Router Running into an weird issue when I use Angular 2.0 Dart.  Basically I'm trying to use Router and using pub serve to transform it to JS using the angular transformer. However I get the following error
Cannot find reflection information on RouteRegistry
    at dart.wrapException (http://localhost:8080/main.dart.js:2834:17)
    at NoReflectionCapabilities.dart.NoReflectionCapabilities.factory$1 (http://localhost:8080/main.dart.js:31991:17)
    at Reflector.dart.Reflector.factory$1 (http://localhost:8080/main.dart.js:15565:46)
    at Binding.dart.Binding.resolve$0 (http://localhost:8080/main.dart.js:13499:41)
    at dart.resolveBindings (http://localhost:8080/main.dart.js:13766:90)
    at dart.Injector.static.Injector_resolve (http://localhost:8080/main.dart.js:13898:63)
    at bootstrap_closure.dart.bootstrap_closure.call$0 (http://localhost:8080/main.dart.js:9374:37)
    at dart._rootRun (http://localhost:8080/main.dart.js:20637:16)
    at _ZoneDelegate.dart._ZoneDelegate.run$2 (http://localhost:8080/main.dart.js:22730:41)
    at NgZone.dart.NgZone._run$4 (http://localhost:8080/main.dart.js:5098:24)

But removing the transformer
- angular2:
    entry_points: web/main.dart

I can see my app and navigate through the routes properly, however the downside is that my Dart2JS file is now 2.8megs

A: Currently as of Alpha 28, this is not supported. Alpha 30 will have this fixed.
https://github.com/angular/angular/issues/1950

A: You could add "mirror_mode: verbose" to the angular2 transformer.

A: Does RouteRegistry come from a different package? If so make sure the angular transformer has also been added to that package (it doesn't have to specify any entry points). The new angular transformer works a lot differently than the old one and it is required on all packages, not just the application package.


text:
Q: Combine two directives together I'd like to use the given model-data by the formControlName-directive with my own directive.
<input type="text"
       formControlName="endDate"
       my-directive>

Is there a way to access the formControl-value in the directive? In a component it's very easy using ControlValueAccessors...

A: Just create a matching input and you will get the value passed:
@Directive({
  selector: '[my-directive]'
})
class MyDirective {
  @Input() formControlName:String;

  ngOnChanges() {
    console.log(this.formControlName);
  }
}


text:
Q: Combinatorics - My teacher and I Problem: Suppose that after I wrote this problem, my teacher thought he could be more clever than I could, so he wrote his own problem. Suppose that both of our problems are in the set of 12 problems you are currently working on. If you sat down at your computer this morning and randomly loaded 4 of the 12 problems, what is the probability that both this problem and my teacher's problem were among the four you loaded?
I got $\frac{\dbinom{12}{2}}{\dbinom{12}{4}}=2/15,$ because we are choosing 4 out of the 12, but we want to have 2 out of the 12 (meaning there are 2 of our desired outcomes). This is incorrect. Help?

A: The numerator shouldn't be the "number of things you want to have" if that even makes sense. It should be the total number of choices, given that you have the things you want to have.
So, if you want $2$ specific problems to appear, and you're choosing $4$ problems total, then you need to choose the other $2$ problems that appear, out of the $10$ that you haven't already chosen. That means there are $\binom{10}{2}$ options in the numerator, giving $\binom{10}{2}/\binom{12}{4} = \frac1{11}$ as the final answer.


text:
Q: Solutions to cubic and higher degree functions If $u = ax^2+a_2x+a_3$ is a quadratic polynomial then there exists a solution to $w=v^2$ where $w=cu+c_2$ and $v = bx+b_2$, which can be easily shown to be true.
For instance when $u=x^2+x+1$, $w=4u-3$, and $v=2x+1$.
What if $u=ax^3+a_2x^2+a_3x+a_4$, $v=bx^2+b_2x+b_3$, and $w=cu^2+c_2u+c_3$? Is there always a solution to $w=v^3$? It is true in some cases, but seems uncertain in others.
What about the more general question where $u$ is a degree $n$ polynomial, $v$ is a degree $n-1$ polynomial and $w$ is a degree $n-1$ polynomial in terms of $u$? Does there always exist a solution to $w=v^n$?


text:
Q: check if we are in a view context from within a model method In my User model I am overriding the id like this
class User < ApplicationRecord
    def id
        return "something"
    end
end

However I would like this to be overridden only if we are in a view context, otherwise if we call it from a controller or a model then I would like to return the "main" id
Is this possible ?


text:
Q: Required class not working on select in template wizard I am using template wizard form plugin.
The select gets its options values dynamically appended on the page load event. I have added required class to select, when I click next button without filling any values in all textboxes and keeping select default (0), all the default validation

"This feild is required."

of this plugin appears on the top of all textboxes but does not work for select (category field).
HTML:
<form class="form-horizontal" id="form" onsubmit="return validateform()" method='post' action="./?action=savebookdetails" class="wizard-big">

Book Details

    <fieldset>
        ... ...

            ISBN *

                <input name="isbn" id="isbn" value="<?php if($result != '') echo $result->isbn; ?>" type="text" class="form-control only-numbers required" maxlength="11">

            Category *

                <select class="form-control required" onchange="fetchsubcategories(this.value)" id="category" name="category">
                    <option value="0">Select</option>
                </select>

    </fieldset>
</form>

In jQuery:
$("#wizard").steps();
$("#form").steps({
    bodyTag: "fieldset",
    onStepChanging: function(event, currentIndex, newIndex) {
        if (currentIndex > newIndex) {
            return true;
        }
        var form = $(this);
        if (currentIndex < newIndex) {
            $(".body:eq(" + newIndex + ") label.error", form).remove();
            $(".body:eq(" + newIndex + ") .error", form).removeClass("error");
        }
        form.validate().settings.ignore = ":disabled,:hidden";
        return form.valid();
    },
    onStepChanged: function(event, currentIndex, priorIndex) {
        if (currentIndex === 2 && priorIndex === 3) {
            $(this).steps("previous");
        }
    },
    onFinishing: function(event, currentIndex) {
        var form = $(this);
        form.validate().settings.ignore = ":disabled";
        return form.valid();
    },
    onFinished: function(event, currentIndex) {
        var form = $(this);
        form.submit();
    },
    onCanceled: function(event) {
        window.history.go(-1);
    }
}).validate({
    errorPlacement: function(error, element) {
        element.before(error);
    }
});

A: <option value="0">Select</option>

remove 0 from value in select first option
New Code
<option value="">Select</option>

A: Form validation with out using jquery.validaiton plugin. You should set class name same for all field.
For example:
<input class="form-control amount validate_form" name="amount[]" type="text">

please enter amount.

<button type="submit" id="fees_stream_submit" class="btn btn-primary">Submit


text:
Q: HOW to `AS IF()` statement query mariaDB? How can I create an alias in my query
SELECT
  LAST_DAY(CURRENT_DATE()) AS IF(LAST_DAY(CURRENT_DATE())=31,'31','X')

A:
Databases, tables, indexes, columns, aliases, views, stored
routines, triggers, events, variables, partitions, tablespaces,
savepoints, labels, users, roles, are collectively known as
identifiers, and have certain rules for naming.

(source: https://mariadb.com/kb/en/identifier-names/ )
The answer to your question is that you cannot have a dynamic alias because an alias is an identifier. An identifier can only have 1 name, and not a choice of names.
EDIT: When using something like Dynamic Columns you still have only 1 column name, see DBFIDDLE


text:
Q: Creating a pkcs#7 object in C with external digital signature I am using a smart card device used to sign pdf document. I already know how to sign the pdf using itext.
I have a 20 byte sha-1 hash, 256 byte signature (rsa encrypted by smart card private key) and a public key (.cer certificate)
Is there a way to create a pkcs#7 binary object in C, using a free library such as cryptlib?

A: You seem to want to generate a PKCS#7 / CMS (cryptographic message syntax) signature using a pre-calculated signature.
This is - to my surprise - possible but for a very big IF. That IF is that the CMS message doesn't contain any additional meta data that needs to be signed. In the badly phrased words of the CMS RFC:

...

When the signedAttrs field is absent, only the octets comprising the

value of the SignedData encapContentInfo eContent OCTET STRING (e.g.,
the contents of a file) are input to the message digest calculation.
This has the advantage that the length of the content being signed
need not be known in advance of the signature generation process.

...

You can exclude the signedAtrrs in for instance OpenSSL using the  -noattr command line option. Unfortunately I did not find a direct way to include the signature value itself, but this is very likely to be possible using the C API of OpenSSL - and as OpenSSL is Open Source, it would of course be possible to amend this problem if it isn't.

Notes:

*

*A good hack would be to create a signature over a zero byte value using a different key when performing CMS, then look up that value (by binary search or by parsing the ASN.1 CMS structures) and then replace that signature with the one you've generated;

*CryptLib and SHA-1 are only useful when you are planning to travel back in time. I strongly recommend to use well maintained libraries and - of course - secure hash.


text:
Q: How to concatenate Ogg with JS? In my webapp user can download OGG (vorbis), but I found that for example VLC show one file duration as 35 seconds but play it for ten minutes.
Currently I build a file for downloading with:
const blob = new Blob(listOfChunksBlobs, {'type': 'audio/ogg'});

With xdd I checked the start of the OGG - but I do not see how I can alter anything here:
00000000: 4f67 6753 0002 0000 0000 0000 0000 0000  OggS............
00000010: 0000 0000 0000 5664 269e 011e 0176 6f72  ......Vd&....vor
00000020: 6269 7300 0000 0001 2256 0000 0000 0000  bis....."V......
00000030: 058a 0000 0000 0000 a901 4f67 6753 0000  ..........OggS..
00000040: 0000 0000 0000 0000 0000 0000 0100 0000  ................
00000050: 5096 ab47 0e16 ffff ffff ffff ffff ffff  P..G............
00000060: ffff c503 766f 7262 6973 0600 0000 6666  ....vorbis....ff
00000070: 6d70 6567 0000 0000 0105 766f 7262 6973  mpeg......vorbis
00000080: 2242 4356 0100 4000 0018 4210 2a05 ad63  "BCV..@...B.*..c
00000090: 8e3a c815 218c 19a2 a042 ca29 c71d 42d0  .:..!....B.)..B.
000000a0: 21a3 2443 883a c635 c718 6347 b964 8a42  !.$C.:.5..cG.d.B
000000b0: c981 d090 5500 0040 0000 a41c 5750 7249  ....U..@....WPrI
000000c0: 2de7 9c73 a318 57cc 71e8 20e7 9c73 e520  -..s..W.q. ..s.
000000d0: 67cc 7109 25e7 9c73 8e39 e792 728e 31e7  g.q.%..s.9..r.1.
000000e0: 9c73 a318 570e 7229 2de7 9c73 8114 478a  .s..W.r)-..s..G.
000000f0: 71a7 18e7 9c73 a41c 478a 71a8 18e7 9c73  q....s..G.q....s
00000100: 6d31 b792 72ce 39e7 9c73 e620 8752 72ae  m1..r.9..s. .Rr.
00000110: 35e7 9c73 a418 670e 720b 25e7 9c73 c620  5..s..g.r.%..s.
00000120: 67cc 71eb 20e7 9c73 8c35 b7d4 72ce 39e7  g.q. ..s.5..r.9.
00000130: 9c73 ce39 e79c 73ce 39e7 9c73 8c31 e79c  .s.9..s.9..s.1..
00000140: 73ce 39e7 9c73 6e31 e716 73ae 39e7 9c73  s.9..sn1..s.9..s
00000150: ce39 e71c 73ce 39e7 9c73 2034 6415 0090  .9..s.9..s 4d...
00000160: 0000 a0a1 288a e228 0e10 1ab2 0a00 c800  ....(..(........
00000170: 0010 4071 1447 9114 4bb1 1ccb d124 0d08  ..@q.G..K....$..
00000180: 0d59 0500 0001 0008 0000 a048 86a4 488a  .Y.........H..H.
00000190: a558 8e66 699e 267a a228 9aa2 2aab b269  .X.fi.&z.(..*..i
000001a0: cab2 2ccb b2eb ba2e 101a b20a 0048 0000  ..,..........H..
000001b0: 5051 14c5 7014 0708 0d59 0500 6400 0008  PQ..p....Y..d...
000001c0: 6028 8aa3 388e e458 92a5 599e 0784 86ac  `(..8..X..Y.....
000001d0: 0200 8000 0004 0000 500c 47b1 144d f124  ........P.G..M.$
000001e0: cff2 3ccf f33c cff3 3ccf f33c cff3 3ccf  ..<..<..<..<..<.
000001f0: f33c cff3 3c0d 080d 5905 0020 0000 0082  .<..<...Y.. ....
00000200: 2864 1803 4243 5601 0040 0000 0821 1a19  (d..BCV..@...!..
00000210: 439d 5212 5c0a 1642 1c11 431d 42ce 43a9  C.R.\..B..C.B.C.
00000220: a583 e029 8525 63d2 53ac 4108 217c ef3d  ...).%c.S.A.!|.=
00000230: f7de 7bef 81d0 9055 0000 1000 0061 1438  ..{....U.....a.8
00000240: 8881 c724 0821 8462 1427 4471 a620 0821  ...$.!.b.'Dq. .!
00000250: 84e5 2458 ca79 e824 08dd 8310 42b8 9c7b  ..$X.y.$....B..{
00000260: cbb9 f7de 7b20 3464 1500 0008 00c0 2084  ....{ 4d...... .
00000270: 1042 0821 8410 4208 29a4 9452 4829 a698  .B.!..B.)..RH)..
00000280: 628a 29c7 1c73 cc31 c720 830c 32e8 a093  b.)..s.1. ..2...
00000290: 4e3a c9a4 924e 3aca 24a3 8e52 6b29 b514  N:...N:.$..Rk)..
000002a0: 534c b1e5 1663 adb5 d69c 73af 4129 638c  SL...c....s.A)c.
000002b0: 31c6 1863 8c31 c618 638c 31c6 1823 080d  1..c.1..c.1..#..
000002c0: 5905 0080 0000 1006 1964 9041 0821 8414  Y........d.A.!..
000002d0: 5248 29a6 9872 cc31 c71c 0342 4356 0100  RH)..r.1...BCV..
000002e0: 8000 0002 0000 001c 4552 2447 7224 4792  ........ER$Gr$G.
000002f0: 24c9 922c 4993 3ccb b33c cbb3 3c4d d444  $..,I.<..<..<M.D
00000300: 4d15 55d5 556d d7f6 6d5f f66d dfd5 65df  M.U.Um..m_.m..e.
00000310: f665 dbd5 655d 9665 ddb5 6d5d d65d 5dd7  .e..e].e..m].]].
00000320: 755d d775 5dd7 755d d775 5dd7 755d d781  u].u].u].u].u]..
00000330: d090 5500 8004 0080 8ee4 388e e438 8ee4  ..U.......8..8..
00000340: 488e a448 0a10 1ab2 0a00 9001 0010 0080  H..H............
00000350: a338 8ae3 488e e458 8e25 5992 2669 9667  .8..H..X.%Y.&i.g
00000360: 7996 a779 9aa8 891e 101a b20a 0000 0400  y..y............
00000370: 1000 0000 0000 80a2 288a a338 8e24 5996  ........(..8.$Y.
00000380: a669 9ea7 7aa2 289a aaaa 8aa6 a9aa aa6a  .i..z.(........j
00000390: 9aa6 699a a669 9aa6 699a a669 9aa6 699a  ..i..i..i..i..i.
000003a0: a669 9aa6 699a a669 9aa6 699a a669 9aa6  .i..i..i..i..i..
000003b0: 6902 a121 ab00 0009 0000 1dc7 711c 4771  i..!........q.Gq
000003c0: 1cc7 7124 4792 2420 3464 1500 2003 0020  ..q$G.$ 4d.. ..
000003d0: 0000 4351 1c45 722c c792 344b b33c cbd3  ..CQ.Er,..4K.<..
000003e0: 44cf f45c 5136 7553 576d 2034 6415 0000  D..\Q6uSWm 4d...
000003f0: 0800 2000 0000 0000 00c7 733c c773 3cc9  .. .......s<.s<.
00000400: 933c cb73 3cc7 933c 49d3 344d d334 4dd3  .<.s<..<I.4M.4M.
00000410: 344d d334 4dd3 344d d334 4dd3 344d d334  4M.4M.4M.4M.4M.4
00000420: 4dd3 344d d334 4dd3 344d d334 4dd3 344d  M.4M.4M.4M.4M.4M
00000430: d334 4d03 4243 5602 0064 0000 1093 904a  .4M.BCV..d.....J
00000440: 4eb1 5746 29c6 24b4 5e2a a414 93d4 7ba8  N.WF).$.^*....{.
00000450: 9862 4c3a eda9 4206 2907 b987 4a21 a5a0  .bL:..B.)...J!..
00000460: d3de 32a5 9052 0c7b a798 42c8 18ea a183  ..2..R.{..B.....
00000470: 9031 85b0 d7da 73cf bdf7 1e08 0d59 1100  .1....s......Y..
00000480: 4401 0000 c620 c610 63c8 3126 2583 1231  D.... ..c.1&%..1
00000490: c724 6452 22e7 9c94 4e4a 26a5 a456 5acc  .$dR"...NJ&..VZ.
000004a0: a484 984a 8b91 734e 4a27 2593 525a 0ba9  ...J..sNJ'%.RZ..
000004b0: 6592 4a6b 25a6 0200 0002 1c00 0002 2c84  e.Jk%.........,.
000004c0: 4243 5604 0051 0000 8831 4829 a414 524a  BCV..Q...1H)..RJ
000004d0: 31a7 9843 4a29 c794 6348 29e5 9c72 4e39  1..CJ)..cH)..rN9
000004e0: c798 7410 2ae7 1874 0e4a a494 728e 39a7  ..t.*..t.J..r.9.
000004f0: 9c73 1232 0795 730e 4226 9d00 0080 0007  .s.2..s.B&......
00000500: 0080 000b a1d0 9015 0140 9c00 0080 9073  .........@.....s
00000510: 8a31 0811 6310 4209 2985 5052 aa9c 93d2  .1..c.B.).PR....
00000520: 4149 a983 9252 49a9 c592 528c 9573 523a  AI...RI...R..sR:
00000530: 0929 7512 522a 29c5 5852 8a2d a454 6369  .)u.R*).XR.-.Tci
00000540: 2dd7 d252 8d2d c69c 5b8c bd86 9462 2da9  -..R.-..[....b-.
00000550: d55a 5aab b9c5 5873 8b35 f7c8 394a 9d94  .ZZ...Xs.5..9J..
00000560: d63a 29ad a5d6 6a4d add5 da49 692d a4d6  .:)...jM...Ii-..
00000570: 6269 2dc6 d662 cd29 c69c 3329 ad85 9662  bi-..b.)..3)...b
00000580: 2ba9 c5d8 62cb 35b5 9873 692d d714 63cf  +...b.5..si-..c.
00000590: 29c6 9e6b acb9 c79c 8330 add5 9c5a cb39  )..k.....0...Z.9

A: The root of the problem is because of the same serial of my every ogg, for example result from ogginfo:
Note: Stream 1 has serial number 0, which is legal but may cause problems with some tools.
New logical stream (#1, serial: 00000000): type vorbis
Vorbis headers parsed for stream 1, information follows...
Version: 0
Vendor: ffmpeg
Channels: 1
Rate: 22050

Nominal bitrate: 35.333000 kb/s
Upper bitrate not set
Lower bitrate not set
Vorbis stream 1:
    Total data length: 2048 bytes
    Playback length: 0m:00.415s
    Average bitrate: 39.435345 kb/s
Logical stream 1 ended

For correct Ogg concatenation we must have unique serial per every file with correct crc. I did not found existing JS snippets for that (please feel free to comment/answer with your JS), only C code for a few hundreds of lines that you can use on the backend or compile to WASM (230K for generated JS and 59K for the wasm file) - or I hope that somebody will rewrite it to JS - I have no knowledge of C.
Original message from Ralph Giles in Ogg mailing list:

Note if both files have the same serial number, it's impossible to
  find the points where they were concatentated by bisection, and most
  tools will assume they've found all the sections and calculate an
  incorrect duration. They can still be played individually because
  there  is not concatenation boundary to find in the individual case.
If ogginfo shows the same serial (00000000) for both of your input
  streams, that's likely the problem. Muxers are supposed to use a
  random  serial number to make conflicts unlikely. You can fix them by
  rewriting  the serial number so there's no conflict. Basically, you
  change the  serialno field in each ogg page header and then update the
  crc.

UPDATE: This is the gif with serials 11111111 and 22222222 - I think that if we get Oggs from the same source in the same format (for example AWS Polly) - maybe it will be much simpler to alter hardcoded positions for serial and crc32.
UPDATE: Yes set unique serial for every Ogg chunk (to all "pages" of that chunk) and set correct CRC32 (again for all pages of every Ogg), see the documentation of Ogg and Wikipedia page; also see this answer about how to build CRC32. And do not forget that all hexes must be 8 characters long, so const hex = crc.toString(16).padStart(8, '0')


text:
Q: Proof that continuous functions are Riemann-integrable using only the classical definition with Riemann Sums and Partition mesh Using only the classical definition which is below (and not Darboux etc) show that a continuous function over a closed interval is Riemann-integrable. That is, if a function $f$ is continuous on an interval $[a,b]$, then its definite integral over $[a,b]$ exists.
The Definite Integral as a Limit of Riemann Sums :
We say that a number $I$ is the definite integral of $f$ over $[a,b]$ if I is the limit of the Riemann sums, if the following condition is satisfied:
For any $\epsilon>0$, there exists a $\delta>0$ such that for every partition $P=\{x_0,x_1,...,x_n\}$ of $[a,b]$ with the mesh $||P||:=\max\limits_{1\leq i\leq n}(x_{i}-x_{i-1})<\delta$ and any choice of $\xi_k$ in $[x_{k−1},x_k]$, we have
    $$\left| \sum_{k=1}^n f(\xi_k) \Delta x_k - I \ \right| \lt \epsilon$$.
Any help is greatly needed and appreciated, as it is fine if I use Darboux but am stuck using just this definition.  Thanks in advance


text:
Q: C++ non-static data member initializers, just a little bit confused I am a little bit confused about why the following code does what it does:
class Base
{
public:
    Base() = default;
    Base(const Base &) =delete;
    Base &operator=(const Base &) = delete;
    Base(const char*) {}
};

class Holder
{
public:
    Holder() = default;
private:
    // Base b = Base();
    Base b2 = {};
};

int main()
{
    Holder h;
}

in this incarnation, it compiles, however if I un-comment Base b = Base(); it gives the following error:
main.cpp:15:17: error: use of deleted function 'Base::Base(const Base&)'
   Base b = Base();
                 ^
main.cpp:5:6: note: declared here
      Base(const Base &) =delete;
      ^

and I am just unable to find in the standard why it tries to call the copy constructor for the Base b = Base() initializer, and why doesn't it call for the Base b2 = {} ... or is this just one of those little obscurities that is hidden in a few words in a paragraph somewhere?
Can you please give a (short) explanation why this happens?
(coliru: http://coliru.stacked-crooked.com/a/c02ba0293eab2ce5 )

A: That's because, conceptually, that line constructs from Base(), which requires a copy/move constructor. The probable reason why you weren't aware of this, is because that expression generally triggers copy elision: a standard optimization. It's one of those C++ gotcha's.

(31.3) — when a temporary class object that has not been bound to a
  reference (12.2) would be copied/moved to a class object with the same
  cv-unqualified type, the copy/move operation can be omitted by
  constructing the temporary object directly into the target of the
  omitted copy/move.

As for why Base b2 = {} works, see

(3.4) — Otherwise, if the initializer list has no elements and T is a
  class type with a default constructor, the object is
  value-initialized.

You could just do Base b;.

A: T object = {arg1, arg2, ...}; is syntax for list initialization. There is no copying involved.
T object = T() is not list initialization. The right hand operand constructs a value-initialized temporary, and object is move- or copy-initialized from it. The move and copy can be elided, but the type must be movable or copyable, otherwise this is not allowed.

A: The true reason is because you forget keyword "explicit", you should change the code
Base(const Base &) =delete;

To:
explicit Base(const Base &) = delete;

Let me explain the reason, In class "Holder", Base b = Base() will:

*

*Base() will generate a temporary object by calling constructor "Base()"

*However, constructor "Base(const Base&)" has a single parameter and without keyword "explicit", this will make code:

Base obj = value;
become
Base obj(value);
Therefore, just add keyword "explicit" will solve this problem.  ^_^


text:
Q: Dynamic switching between bound views in AngularJS I am quite new to AngularJS and I am currently trying to figure out how to best approach this functionality:
I am looking for a way where I have something along the lines of I am a text, and when the user clicks on it, it becomes editable (eg. <input type="text">) until the element loses focus, at which point it should flip back to its original ... with the new value. Furthermore, this is likely not static text but bound to a model.
I am thinking this should be doable with directives, but I've hit a road block along the line as to how such a directive would actually work.
app.directive('editable', function() {
    return function(scope, element, attrs) {
        element.bind('click', function () {
            // something.
        });
    }
})

Can anyone provide me with guidance or a solution to this?
Thanks in advance,
- Manny

A: How i did this was to create a directive that could be applied to any html element. It hides the standard element and shows a text field when you click in it. Then it changes it back to the origninal element when you move away from the field.
More details here
and here is the companion fiddle
http://jsfiddle.net/cmyworld/6gMXL/
You can use it like

      <editable model="heading" on-delete="" defaultval="Default val">


text:
Q: How to develop for Samsung, Panasonic and LG Smart tv app? I need to code the front-end development for a smart tv application that will work for Samsung, LG and Panasonic.
I read that Samsung has its own SDK for Eclipse and an emulator but I am not sure if developing it with Samsung SDK will work on the other two platforms, do you know if there is a way to develop it that works for all three platforms?

A: There is platform difference for all the three platforms but there is framework called the TAL framework with which you can create Universal application.
Refer to BBC talframework http://fmtvp.github.io/tal/getting-started/introducing-tal.html
but i doubt that samsung QA team may not allow it.

A: Mostly smart tv app are based on HTML5, Jquery, so you can build same interface for all the apps and can modify jquery according to platform(LG, Samsung, etc).

A: you can use this TV SDK http://www.inio.tv/ (I am member of team who develop this...) or some other multiplatform TV framework.
If you have some questions I can answer


text:
Q: How to interprete OpenCover console output I want to use OpenCover with gitlab ci which allows to extrace a single value from the build output to show a coverage figure.
I get the following output from opencover
  Visited Classes 132 of 310 (42.58)
  Visited Methods 876 of 2679 (32.7)
  Visited Points 7044 of 21918 (32.14)
  Visited Branches 2168 of 9670 (22.42)

  ==== Alternative Results (includes all methods
     including those without corresponding source) ====
  Alternative Visited Classes 148 of 332 (44.58)
  Alternative Visited Methods 1043 of 3150 (33.11)

I haven't found a source describing how I should interpret these values. So far I assume this.

*

*Classes - The classes which are covered at least a little

*Methods - The methods which are covered at least a little

*Points - The lines of code which are covered

*Branches - The compiled lines which are covered (but that is just a wild guess)

*Alternative results - Well, I suppose this includes third party classes / methods that are covered (I haven't tweaked my filter yet). But as this value is only slighly higher than original value, I guess this would exclude all framework classes.
So basically my question is
a) am I right about my guesses and if not, what is the right explanation.
b) what's the best value to choose for an overall coverage result?
For now I would use Visited Points because (if I am right about my guess) this will tell me the level of my source code lines which are covered.

A: These numbers are just a quick summary of the coverage. For full details you should use the data that is emitted in the XML that is outputted as part of the operation. For best results use ReportGenerator (as recommended) to get a detailed HTML report.


text:
Q: Ideals of a characteristic ideal We say $\frak{h}$ is a characteristic ideal of a lie algebra $\frak{g}$ if $[\frak{h},\frak{g}]\subset\frak{h}$, and $D(\frak{h})\subset\frak{h}$ for every derivation $D\in Der(\frak{g})$.
The theorem states that if $\frak{h}$ is a characteristic ideal of a lie algebra $\frak{g}$, then every ideal of $\frak{h}$ is also an ideal in $\frak{g}$. Essentially, if we let $\frak{a}$ be an ideal in $\frak{h}$, we want to show that $[\frak{a},\frak{g}]\subset \frak{a}$, but I don't know what derivation $D\in Der(\frak{g})$ should be used?

A: If I am right, then let $x \in \mathfrak{g}$, $a\in\mathfrak{a}$, $\operatorname{ad}_x \colon \mathfrak{h}\rightarrow\mathfrak{h}$ defined by $\operatorname{ad}_x(h)=[x,h]$ is a derivation (Jacobi). This implies that $\operatorname{ad}_x(a)=[x,a]\in \mathfrak{a}$ since $\mathfrak{a}$ is a characteristic ideal of $\mathfrak{h}$. This implies that $\mathfrak{a}$ is an ideal of $\mathfrak{g}$.


text:
Q: Initializer used when loading nodes from SKS file I am creating a subclass of SKSpriteNode e.g. Player and label a SKSpriteNode in my *.sks file with the custom class Player. In the *.swift I am loading the node using: self.childNode(withName: "myNodesName"). Well, this works fine, but I also want to modify the constructor used for this procedure.
Which constructor  of SKSpriteNode is used if I access a SKSpriteNode in my *.swift file from its *.sks using
self.childNode(withName: "myNodesName") as? Player

?

A: What constructor gets called?
When a node is created from an sks file, SpriteKit does use this initializer
init?(coder aDecoder: NSCoder)

How can you implement that into Player?
You have a Player class. You can implement the constructor this way
class Player: SKSpriteNode {
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
}


text:
Q: Cakephp HABTM relation i have theses tables
article , article_currency, currency in database
and i made HABTM between article and currency like this
var $hasAndBelongsToMany = array('currency'=>array('className' => 'currency','joinTable'=>'article_currency','foreignKey' => 'articleid','associationForeignKey' => 'CurrencyID'));

var $hasAndBelongsToMany = array('articlemodel'=>array('className' => 'articlemodel','joinTable'=>'article_currency','foreignKey' => 'CurrencyID','associationForeignKey' => 'ArticleID'));

and here cake genrate the model ArticleCurrency for me
when i try to change its name using with  to 'article_currency'
is give me this error
Database table article_currencies for model article_currency was not found.
how i can solve this

A: Table names are plural by convention: articles, currencies, articles_currencies
http://book.cakephp.org/view/24/Model-and-Database-Conventions


text:
Q: if - else does not work in laravel framework blade templating My question is, I have page as Laravel blade template.
If user  logged in, my page should be extended from a master layout.
If user did not login, my page should be extended from another master layout.
But my if- else statement does not working
 <?php
 if (Auth::check()){?>
 @extends('layouts.outside');
 <?php } else{ ?>
     @extends('layouts.admin');
 <?php }?>

I also tried blade if-else version as follows:
@if (Auth::check())
 @extends('layouts.outside')
@else
 @extends('layouts.admin')
@endif

It did not work too. Every time wheter the statement true or false the block in if and else statement works one after. As there is no if else.
I mean every time it calls layouts.outside one time one and just bottom of it the same page is loaded  again with layouts.outside, whether not matter if the user logged in or not.
Thanks

A: @extends(Auth::user() ? 'layouts.outside' : 'layouts.admin');

A: <?php
if (Auth::check()){
Blade::extends('layouts.outside');
<?php } else
extends('layouts.admin');
}?>

You are missing a { at the else
also why that php tag remove it
     <?php
        if (Auth::check()){
        Blade::extends('layouts.outside');
        } else{
        extends('layouts.admin');
        }
     ?>


text:
Q: VueJS unknow custom element VueStripeCheckout This question has be answered already in many places. But none of them is works for me.
I installed Vue stripe checkout component in my project.
npm install vue-stripe-checkout --save

Then in the mainJS
import VueStripeCheckout from 'vue-stripe-checkout';

Vue.use(VueStripeCheckout, 'publishable-key-here');

Then inside my component
<vue-stripe-checkout
      ref="checkoutRef"
      :image="image"
      :name="name"
      :description="description"
      :currency="currency"
      :amount="amount"
      :allow-remember-me="false"
      @done="done"
      @opened="opened"
      @closed="closed"
      @canceled="canceled"
    ></vue-stripe-checkout>

I can't figureout why this could happen? Is this a bug in that libray or my code?

A: since the component is seemingly not globally registered you can do it yourself
// in global.js

import VueStripeCheckout from 'vue-stripe-checkout'
Vue.use(VueStripeCheckout, 'publishable-key-here')

// global registration
Vue.component('vue-stripe-checkout',VueStripeCheckout)

Alernatively you could import it on a component level
// in somecomponent.vue

import VueStripeCheckout from 'vue-stripe-checkout'

export default {
  components: {
   'vue-stripe-checkout': VueStripeCheckout

   // or just - then you'll have to use it like <VueStripeCheckout>
   // VueStripeCheckout
  }
  ,props:[...]
  ,mounted()

in any case - checkout the doc for components-registration

Edit: having had a look at the source of the vue-stripe-checkout  install fn which is invoked by Vue.use - have you tried simply camelCase instead of snake-case:
<VueStripeCheckout
  ref="checkoutRef"
  :image="image"


text:
Q: Can I make The Shape of Form linear on C#? is there a way to make form shape linear
i I could make it as circle
i used a GraphicsPath
       GraphicsPath path = new GraphicsPath();
        RectangleF rec = new RectangleF(0, 0, 100, 150);
        path.AddEllipse(rec);
        this.Region = new Region(path);

but when i try to make it as line i try this code
         GraphicsPath path = new GraphicsPath();
        path.AddLine(0,0,200,200);
        Cursor.Position = new Point(200, 200);
        this.Region = new Region(path);

but Nothing happened the form looks like disappear
So Can Someone help me please


text:
Q: Making Open Street Maps Transparent in Leaflet Info:
I have a local Open Street Maps Server which is serving tiles for Michigan, Indiana, Ohio, Illinois, and West Virginia. I also have a geoserver set up serving a wms layer containing states. Because I only have several states served in Open Street Maps, OSM does not show state borders, which is why I have a WMS layer.
The Problem:
I wanted to layer OSM over top of my WMS layer and make it transparent so that the state lines will show through from the WMS layer.
Code:
var map;
var feature;

function load_map() {

     map = new L.Map('map', {
            zoomControl: true,
            center: [0, 0],
            zoom: 3
     });

    var osmUrl = 'http://my_server/osm_tiles/{z}/{x}/{y}.png',
    osmAttribution = 'Map data © 2012 OpenStreetMap contributors',
    osm = new L.TileLayer(osmUrl, {
            maxZoom: 18,
            attribution: osmAttribution,
            transparent: true
    });

    var states = L.tileLayer.wms('http://my_server:8080/geoserver/Indigital/wms', {
            format: 'image/png',
            transparent: false,
            layers: 'Indigital:states'
    });

    var overlays = {
            "States:WMS": states,
            "OSM": osm,
    };

    var layerControl = L.control.layers(null, overlays);
    map.addControl(layerControl);

A: This is more correctly an issue with your tile server config, and not with your leaflet code. You need to change the layer styling of your OSM tiles so that there is no background-color in the tiles generated.
Your technology may differ, but I have used Mapnik to render transparent tiles, and in the XML style sheet, I notice this bit at the top, where it defines the overall "map" style it's going to render against..
<?xml version="1.0" encoding="utf-8"?>
<Map background-color="rgba(0,0,0,0)" srs="+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378137 +b=6378137 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs">

</Map>

Notice the background-color="rgba(0,0,0,0)" attribute. It instructs the renderer to prepare transparent images. The first three 0's are for Red, Green, and Blue, respectively, and the last 0 is for the alpha value (i.e. level of opacity). At 255, you'll have a fully-opaque background color. At 0, you will have a 100% transparent background in areas where your layers are not representing features. Make sense?
..however, if you insist on trying to solve this client-side with Leaflet/JavaScript, you can play around with the order of the layers and their "opacity" values. Start with something like this and then tweak it as necessary:
osm.opacity = .5;
states.opacity = .5;

But I'd bet you will discover this won't look very good/professional, as both layers will appear watered down and smeared together.

A: You can set the opacity of a tileLayer via the opacity option:
TileLayer.options.opacity


text:
Q: Gitlab CI Failed: NPM command not found I have been playing around Gitlabl CI but for some reason I can't get my tests to "passed". It always says npm: command not found
My Gitlab CI config looks like this:
image: node:latest
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
  paths:
    - node_modules/

before_script:
  - npm install
  - npm install eslint -g
  - npm install eslint-plugin-react -g
  - npm install babel-eslint -g

test:lint:
  script:
    - eslint src/*

I keep getting the error below and I have No Idea why:

By the way, Im NOT using the gitlab shared runner. Not sure if that contributes to the problem but just to make sure, the machine that has my gitlab runner has all the necessary packages to run nodejs.
Your help is greatly appreciated
Best regards,

A: The image tag specifies a docker image, hence you must specify the executor of your runner to be docker. Did you perhaps set it to be something else, like shell, when you created the runner?

A: You can use like below:-
stages:
          - build
          - deploy

deploy-prod:
          image: node:12.13.0-alpine
          stage: deploy
          script:
            - npm i -g firebase-tools

A: I have same problem.
Gitlab-runner use user of 'gitlab-runner' default when it starts. So the user have not root access.
ps aux|grep gitlab-runner

*

*copy the shell of running

*change user:
run /usr/bin/gitlab-runner run --working-directory /home/gitlab-runner --config /etc/gitlab-runner/config.toml --service gitlab-runner --syslog --user root in bash.

*gitlab-ci runner test

*pass!

*kill old pid

*nohup /usr/bin/gitlab-runner run --working-directory /home/gitlab-runner --config /etc/gitlab-runner/config.toml --service gitlab-runner --syslog --user root
ps: gitlab-runner -u root also change user.

A: Your cli is taking ssh executer by default. You probably need docker. Try adding tag in your yml script.
 tags: [ <your docker image name> ]

A: This helped me:
n=$(which node);n=${n%/bin/node}; chmod -R 755 $n/bin/*; sudo cp -r $n/{bin,lib,share} /usr/local

A: In my case, there are two gitlab-runner. There is no node enviroment in the specific Runner.Then I stopped the wrong one


text:
Q: Get Post Analytics with Linkedin API v2 Recently, I am working on Linkedin API v2 and I have some problems with

*

*Get posts of a certain company

*Get analytics of a certain post

I was able to get company statistics by using https://api.linkedin.com/v2/organizationPageStatistics?q=organization&organization={organization URN}
But I can't find any API to get the above info.
Please help me to resolve above problem.
Thanks in advance for any advices.

A: You can use the Share API
you can retrieve the posts of a company with the Find Shares by Owner:

GET
  https://api.linkedin.com/v2/shares?q=owners&owners={URN}&sharesPerOwner=100

{
    "activity": "urn:li:activity:12345657",
    "content": {
        "contentEntities": [
            {
                "entity": "urn:li:article:0",
                "entityLocation": "https://www.example.com/content.html",
                "thumbnails": [
                    {
                        "imageSpecificContent": {},
                        "resolvedUrl": "https://www.example.com/image.jpg"
                    }
                ]
            }
        ],
        "description": "content description",
        "title": "Test Share with Content"
    },
    "created": {
        "actor": "urn:li:person:A8xe03Qt10",
        "time": 1471967236000
    },
    "distribution": {
        "linkedInDistributionTarget": {}
    },
    "id": "6173878065928642560",
    "lastModified": {
        "actor": "urn:li:person:A8xe03Qt10",
        "time": 1471967237000
    },
    "owner": "urn:li:organization:1000",
    "text": {
        "text": "Test Share!"
    } }

And about the analytics you can use the Retrieve a Summary of Social Actions API:

GET
  https://api.linkedin.com/v2/socialActions/{shareUrn|ugcPostUrn|commentUrn}

{
    "commentsSummary": {
        "totalFirstLevelComments": 4,
        "aggregatedTotalComments": 9
    },
    "$URN": "urn:li:activity:6296748651834277888",
    "likesSummary": {
        "likedByCurrentUser": false,
        "totalLikes": 226
    }
}

Hope this help

A: Actually linkedin doesn't provide such API like facebook or twitter.
They still lack the APIs for detailed situations. You need to scrape data from linkedin to get further information other than those of standard linkedin API.


text:
Q: Anchor tag helper not generating correct route with area name MVC Core 3.1 I have anchor tag in my asp.net mvc core application as below
School

And configured route as
app.UseEndpoints(endpoints =>
        {
            endpoints.MapControllerRoute(
                name: "default",
                pattern: "{controller=Account}/{action=SignIn}/{id?}");

            endpoints.MapControllerRoute(
            name: "MyArea",
            pattern: "{area:exists}/{controller=Home}/{action=Index}/{id?}");
        });

Above anchor tag is generating url as - https://localhost:44391/School/Index?area=Admin
However we expect it should be as - https://localhost:44391/Admin/School/Index
If I enter correct url in browser, it is working fine but not sure whats wrong with anchor tag syntax.
Can you please guide if I am missing anything?


text:
Q: Java Process getting killed without logging I have a long running Java process running in CentOs Machine. I have both info and
error logs set-up properly. The process ran for longer time (18+ hours) and disappeared
all of a sudden. There is no trace of error/exception (OutOfMemoryError/ OutOfDiskSpace  Error). How to figure out what has really happened, as in why and how the process got killed?
These are the OS details.
CentOS release 5.11 (Final)
Kernel \r on an \m

Are there any standard system logs or commands to figure out? This job is running in a servlet in Tomcat. Tomcat is also going down mysteriously.

A: Your process is mostly likely killed because the system runs out of memory. When it happens it first tries to kill short-running processes instead of long running ones. OOM Killer is unlikely to be logged in your application logs.
Check dmesg and try to find there info about killing <java_pid>.
Here is how "badness" of a task to kill determined in Linux https://www.kernel.org/doc/gorman/html/understand/understand016.html#toc21 :
badness_for_task = total_vm_for_task / (sqrt(cpu_time_in_seconds) *
sqrt(sqrt(cpu_time_in_minutes)))

Kernel steps through all running tasks.


text:
Q: Definition of Convergence a.s. in Counting probability If we have probability space [0,1], P(A)=|A|, we have
$$Xn=n^{1/p}*1_{[0,1/n]}$$ Show that Xn converges almost surely. (p denoting any p norm here)
So i proved Xn converges in probability to 0 since $P(|Xn|>\epsilon)<1/n$ so approches to 0 right? Then If Xn converges a.s., it has to converge to 0 a.s. However, the answer says Xn converges a.s. with no explanation; but Xn can contain infinitely many 0's and $n^{1/p}$'s. So how would it converge a.s. to 0?

A: For any $\omega$ except 0, for $n>1/\omega$ you have $X_n(\omega)=0$.


text:
Q: Msbuild cannot specify configuration when invoked from another program I am using Visual Studio 2017 working with C++.
I can build a release binary with msbuild /p:configuration=release on the command line. When attempting to build from another process using system( "msbuild C:\\Users\\Chili\\Desktop\\Projects\\TestHarness\\TestHarness.sln /p:configuation=release" ), it builds a Debug binary.
When building from the command line using msbuild C:\\Users\\Chili\\Desktop\\Projects\\TestHarness\\TestHarness.sln /p:configuation=release (from a different working directory), I also get the Debug exe. I also tried changing working directory and then invoking from my process with msbuild /p:configuration=release, but it only gives Debug binary. Furthermore, I noticed that from the command line msbuild /p:configuration=invalid will give an error, whereas msbuild /p:configuration=invalid from my process will not give any error (again, builds debug). However, I do know that the command line arguments are reaching msbuild, because if I try for example msbuild /invalid:configuration=invalid from my process, I do get an error about the switch.
EDIT
In fact, it seems to be ignoring /p /property -property switches altogether, since I can do /property:bad=food and it doesn't bat an eye.
Does anybody know what is causing this discrepancy between invoking from command line and invoking from process?


text:
Q: How does protected view of word document protect my computer from virus? How does protected view of word document protect my computer from virus?
Here MS Word 2013 claims:

I already open the document file, virus should attack my computer, but here it says protected view will keep computer from virus.

A: The warning keeps the document from fully opening (no editing or printing) so that if the document is untrusted (you do not know its source) you can delete the document.
If the document is trusted (you know the source), you can click on Enable Edit and proceed normally.
It is not true virus protection - that is not its job. It is just a warning in the event an untrusted document comes to you. If the document contains a virus, and you open it, your computer would get the virus. Your on-board antivirus (Windows Defender for example) should catch this.


text:
Q: types of user in android application I'm currently making an offline application for android. Is it possible to have two types of users - admin and nonAdmin? The admin is the one who will add data to the application while the nonAdmin will just view data from the application.
If it is possible, how can I update the data of the nonAdmin if the admin had added new data to the application?

A: Sure, this is possible. What kind of data do you want to add?
To get started use two buttons "Admin" and "User" in your first view which is shown when the application is started.
"Admin" starts the AdminActivity to add data. This could be stored in Key-Value pairs, an SQLiteDatabase or directly to the internal storage - depending on what kind of data you want to add.
"User" starts a read-only perspective of your application, showing the data added by the admin.