text:
Q: Code Signing a GUI python App for notarization on macos I created a python application using py2app and am able to code sign almost all the binaries using the command
find "${NAME}.app" -iname '*.so' -or -iname '*.dylib'| while read libfile; do codesign -s "${IDENTITY}" --timestamp -o runtime --entitlements entitlements.plist "${libfile}"; done;

However there are some binaries that are located in a directory in a zip file name.app/Contents/Resouces/lib/python37.zip/PIL/.dylibs
The problem is that these binaries don't get signed because they are located in a zip file. I have tried using Finder to unzip them and zip them back up so that I can code sign those binaries, but unzipping and zipping through Finder causes the program to no longer find the files in the zip.
Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'

Current thread 0x000000010bb5ee00 (most recent call first):
Abort trap: 6

Any help would be appreciated.

A: The issue was that finder was zipping the files incorrectly. The root directory was being added to the front of the path for each file which caused the program to not be able to find the paths correctly. I was able to solve this issue by first unzipping the file using finder. Code signing the binaries and then going back into the folder with the unzipped folder "python37" running the command
cd python37
zip -r python37.zip ./*

And then moving the zipped folder out of python37 and into lib.
A resource I used to solve this was if anyone needs more information on their own problem:
https://askubuntu.com/questions/521011/zip-an-archive-without-including-parent-directory#:~:text=Use%20the%20%2Dj%20or%20%2D%2D,relative%20to%20the%20current%20directory
Could not have solved it without Quinn "The Eskimo!" @ Developer Technical Support @ Apple


text:
Q: Terminal.app opens different theme when launching a new shell window So I set Terminal.app to open up with certain defaults.  I like a specific theme (Homebrew) with a default size of 140×50.
However if I click the close icon (red X) to close the window and then go to open up another shell (Terminal), the shell settings go back to the default black text on a white background.
I noticed an oddity that seems to be related to it:  The dock icon of Terminal indicates that after I closed the terminal window, Terminal is still running (even though the shell has been closed).
If I right click on the dock Terminal icon and exit, the dot goes away, indicating that in fact the instance is now no longer running.  Now, when I open a new instance I get my correct settings.
What am I missing here?  It seems as though when my terminal is closing it isn't really closing right.  How can I fix this so it closes right and the actual instance is closed when typing exit from the shell or when I click on the red X?

A: You have set the "On startup, open:" preference in

Preferences > General

which only selects the profile for the new window automatically created when opening Terminal with no other windows restored.
Instead, set the default profile in

Preferences > Profiles

which applies to terminal windows you create after Terminal is open.
Note that when the startup-window profile is the same as the default profile, changing the default will affect the startup-window profile as well. If you change the startup-window profile to something else it will remain as-is if you later change the default profile.

redpajama_set_name: RedPajamaStackExchange


text:
Q: makefile process variable with list of items where one item is a quoted string with spaces Take the following makefile snippet:
VAR_LIST = "item1" "item2" "item 3 that has spaces" "item4"
ARGS = $(addprefix echo ,$(VAR_LIST))

What I am trying to achive is for ARGS to contain:
echo "item1" echo "item2" echo "item 3 that has spaces" echo "item4"
What I can't figure out how to resolve is that functions like addprefix act on  spaces...

A: Not sure whether what you need is easily achievable with make because quoting strings have no effect on make functions that process words: " is a part of a word.
I would use a shell or python script for that.

A: You can do that with the help of gmtt entirely inside GNUmake. It is not as straightforward as in a full programming language, but at least it is portable and independent of external shell flavours and tools.
include gmtt/gmtt.mk

VAR_LIST = "item1" "item2" "item 3 that has spaces" "item4"

# make a prefix-list by splitting at ". This will yield superfluous space
# characters between the items, but we can eliminate them later
prefix-list := $(call chop-str-spc,$(VAR_LIST),A $(-alnum-as-str))
$(info $(prefix-list))

# Now we select the data payload from the prefix-list. Spaces inside items
# are still encoded as $(-spacereplace) characters, which is good as we have
# a normal make list this way
string-list := $(call get-sufx-val,$(prefix-list),A,,100)
$(info $(string-list))

# Using get-sufx-val() is fine, but we can have it even simpler, by dropping
# the prefix, as we have only one in the list anyway:
string-list := $(call drop-prfx,$(prefix-list))

# Now step through the list with a normal for loop, converting $(-spacereplace)
# back to real spaces
$(foreach item,$(string-list),$(if $(strip $(call spc-unmask,$(item))),\
   $(info [$(call spc-unmask,$(item))])))

Output:
$ make
 A¤item1 A¤§ A¤item2 A¤§ A¤item§3§that§has§spaces A¤§ A¤item4
item1 § item2 § item§3§that§has§spaces § item4
[item1]
[item2]
[item 3 that has spaces]
[item4]


text:
Q: How to use the value of a variable in a heredoc function in BASH to run a julia command I am new to BASH and to Julia, and I am trying to do the following steps:

*

*Save a filepath in a variable

*Use this variable in a julia command, which i managed to execute through bash by using a heredoc function

Hard-coded command that works:
cat << "EOF" | julia --project=.
module test
            ARGS=["/path/To/My/Directory"]
            include("nameOfMyProject.jl")
            end
EOF

The problem is, that I want to exchange the hardcoded path with the value of a variable.
I tried:
path="/path/To/My/Directory"
cat << "EOF" | julia --project=.
module test
            ARGS=[$path]
            include("nameOfMyProject.jl")
            end
EOF

However, that does not work. I read i should try to use <<EOF instead of << "EOF" but then I receive this error: syntax: "/" is not a unary operator
I am not sure how to interprete this, since it might actually access the variable and find the "/", but it does work with it if I use "/" in the hard-coded way... so why not there?
I am not sure if my problem lies in the heredoc function or in something with this variable, but I would be grateful for any help!
Solution for this problem:
I am adding this for reference, if someone else has the same problem. The format that does the trick nicely is:
path="/path/To/My/Directory"
julia --project=. <<EOF
module test
            ARGS=["$path"]
            include("nameOfMyProject.jl")
            end
EOF

Thanks to Jetchisel and Jens

A: From the bash manual (emphasis mine):

Here Documents
This type of redirection instructs the shell to read input from the
current source until a line containing only delimiter (with no trailing
blanks) is seen.  All of the lines read up to that point are then used
as the standard input (or file descriptor n if n is specified) for a
command.

   The format of here-documents is:

          [n]<<[-]word
                  here-document
          delimiter

No parameter and variable expansion, command substitution, arithmetic
expansion, or pathname expansion is performed on word.  If any part of
word is quoted, the delimiter is the result of quote removal on word,
and the lines in the here-document are not expanded.  If word is
unquoted, all lines of the here-document are subjected to parameter
expansion, command substitution, and arithmetic expansion, the
character sequence \<newline> is ignored, and \ must be used to quote
the characters \, $, and `.

So all you need is
julia --project=. << EOF
...$FOO...
EOF


text:
Q: Yii Framework:Form builder How do you create a form using the form builder in Yii? What will be its data model?

A:
How to make a form builder in yii framework?

Using Form Builder

The Yii form builder uses a CForm object to represent the specifications needed to describe an HTML form, including which data models are associated with the form, what kind of input fields there are in the form, and how to render the whole form. Developers mainly need to create and configure this CForm object, and then call its rendering method to display the form.

What will be its data model?

Here's an example from the Yii Form Builder page.
public function actionLogin()
{
    $model = new LoginForm;
    $form = new CForm('application.views.site.loginForm', $model);
    if($form->submitted('login') && $form->validate())
        $this->redirect(array('site/index'));
    else
        $this->render('login', array('form'=>$form));
}

The model is defined in the first line of the function.
Here's more model information from the Yii documentation: Creating Model


text:
Q: Qt: Rotating a label with a Pixmap on it I have a label with a pixmap on it
Code looks like this:
Label = new QLabel (dialog, Qt::Widget);
Label -> setGeometry( xPosition, yPosition, 25, 87 );
QPixmap pixmap;
pixmap.load("/home/richter/Dokumente/QDevelop/AnimationTest/ScreenData/rightTire.png", 0, Qt::DiffuseAlphaDither);
Label -> setPixmap(pixmap);
Label -> setAlignment(Qt::AlignCenter);
Label -> show();

what I now want to have is a method like that:
void rotateLabel (int degrees)

I think it's clear what it should do. You enter the degrees and see it rotated by these degrees.

A: Run qtdemo -> Demonstrations -> Embedded Dialogs
It shows how to map a whole dialog to a 3D surface. The same technique allows you to rotate a single label.
Source code is here: http://doc.qt.io/archives/qt-4.7/demos-embeddeddialogs.html

A: Checkout the examples in QMatrix.
You need to override paint event of your QLabel and draw similar to given example.


text:
Q: How to push segue to specific View Controller depending on a selected cell? I have a complicated issue I'd like to explain visually and through code.
Currently, this is how my app is suppose to work visually:

I have a ViewControllerOneclass that contains a UITableView with 9 cells. Any rows selected except rows 2, 6, and 7 will segue to ViewControllerTwo with its own UITableView and number of rows.
If rows 2, 6, or 7 is selected, a push segue will stack another ViewControllerOne onto the existing ViewControllerOne. The reason for doing this is because every row is a category, but rows 2, 6, and 7 also contains sub-categories that looks exactly like ViewControllerOne Main-VC on the left.
Rather than creating another class that contains the exact same code as in Main-VC, I wanted to reuse the ViewControllerOne class.
Now, if any rows in SUB-VC is selected, it will also perform a push segue to ViewControllerTwo.
Since ViewControllerOne and ViewControllerTwo are embedded in a UINavigationController, the issue I'm having is in the 5th step:

*

*I select a row not 2, 6, or 7 in Main-VC, it takes me to ViewControllerTwo (as it should)

*I go back to Main-VC via navigation bar back button and select row 2, 6, or 7 in MAIN-VC, it will take me to SUB-VC (as it should)

*I select a row not 2, 6, or 7 in Sub-VC, it will take me to ViewControllerTwo (as it should)

*I go back to Sub-VC via navigation bar back button on the navigation bar

*I select a row 2, 6, or 7 in Sub-VC, it will push segue and stack another Sub-VC on top of the existing Sub-VC instead of doing a push segue to ViewControllerTwo
I have a Manager class that handles the logic and communicates with ViewControllerOne and ViewControllerTwo to display the data.
import UIKit

enum SubGroupState
{
    case SubGroup1, None, SubGroup2, SubGroup3
}

class Manager: NSObject
{
    public var subGroupState = SubGroupState.None
    public var oldSubGroupState = SubGroupState.None
    public var showSubGroups = Bool()

    override init()
    {
        super.init()
    }

    public func initializeGroupState(row: Int) -> UIViewController
    {
        if showSubGroups == false && oldSubGroupState == .None
        {
            switch row
            {
                case 2:
                    subGroupState = .SubGroup1
                    break

                case 6:
                    subGroupState = .SubGroup2
                    break

                case 7:
                    subGroupState = .SubGroup3
                    break

                default:
                    subGroupState = .None
                    break
            }
        }

        if (subGroupState != .None && oldSubGroupState == .None)
            || (subGroupState == .None && oldSubGroupState != .None)
        {
            showSubGroups = true
        }
        else
        {
            showSubGroups = false
        }

        return initializeGroupVC(row: row)
    }

    fileprivate func initializeGroupVC(row: Int) -> UIViewController
    {
        let storyboard = UIStoryboard(name: "Main",
                                      bundle: nil)

        if showSubGroups == true
            && subGroupState != .None
        {
            guard let viewControllerOne = storyboard.instantiateViewController(withIdentifier: "ViewControllerOne")
                as? ViewControllerOne else {
                return UIViewController()
            }
            viewControllerOne.manager.oldSubGroupState = muscleSubGroupState
            viewControllerOne.manager.showSubGroups = showSubGroups

            return viewControllerOne
        }
        else
        {
            guard let viewControllerTwo = storyboard.instantiateViewController(withIdentifier: "ViewControllerTwo")
                as? ViewControllerTwo else {
                return UIViewController()
            }

            return muscleGroupExercisesVC
        }
    }

}

The purpose of the states is so I can handle displaying the different sub-categories depending on the state of the selected cell.
I create an instance of Manager in ViewControllerOne when the user selects a cell:
extension ViewControllerOne: UITableViewDataSource
{
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
    {
        tableView.deselectRow(at: indexPath,
                              animated: true)

        let viewController = manager.initializeGroupState(row: indexPath.row)
        self.navigationController?.pushViewController(viewController,
                                                      animated: true)
    }
}

class ViewControllerOne: UIViewController
{
    public var manager = Manager()

    ....
}

The issue is in logic handling in the function initializeGroupState, but I've tried other different combinations and I always get the Sub-VC stacked on top of an existing Sub-VC for rows 2, 6, and 7, which obviously corresponds to the subgroup rows in Main-VC, and that's where the issue I'm having a difficult time handling the logic with.
If I am doing this the wrong way, is there a better alternative to what I'm trying to achieve without repeating code?
NOTE: My Storboard only has the Main-VC ViewControllerOne with a segue to ViewControllerTwo. The added Sub-VC ViewControllerOne is there to visually see what I'm trying to do, but does not actually exist in my Storyboard.

A: I think we can keep it simple as posible
class ViewControllerOne: UIViewController, UITableViewDelegate {
  var isSubVC = false

  func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    tableView.deselectRow(at: indexPath, animated: false)

    if self.isSubVC {
      // Push to ViewControllerTwo
    } else {
      // MainVC
      if indexPath.row == 2 || indexPath.row == 6 || indexPath.row == 7 {
        let subVC = self.storyboard?.instantiateViewController(withIdentifier: "ViewControllerOne") as! ViewControllerOne
        subVC.isSubVC = true
        self.navigationController?.pushViewController(subVC, animated: true)
      } else {
        // Push to ViewControllerTwo
      }
    }
  }
}

Here is the code using your manager ideas for navigation without any tests.
enum ViewControllerType {
  case main, subGroup1, subGroup2, subGroup3
}

class Manager {
  public var currentState = ViewControllerType.main

  public func initializeGroupState(row: Int) -> UIViewController {
    if self.currentState == .main {
      // MainVC, should push to SubVC if match condition
      switch row {
      case 2:
        return self.makeSubViewController(state: .subGroup1)
      case 6:
        return self.makeSubViewController(state: .subGroup2)
      case 7:
        return self.makeSubViewController(state: .subGroup3)
      default:
        return self.makeViewControllerTwo()
      }
    } else {
      // Current is SubVC, dont care kind of row, should push to ViewControllerTwo
      return self.makeViewControllerTwo()
    }
  }

  private func makeViewControllerTwo() -> UIViewController {
    let storyboard = UIStoryboard(name: "Main", bundle: nil)
    let vc = storyboard.instantiateViewController(withIdentifier: "ViewControllerTwo")
    return vc
  }

  private func makeSubViewController(state: ViewControllerType) -> UIViewController {
    let storyboard = UIStoryboard(name: "Main", bundle: nil)
    let vc = storyboard.instantiateViewController(withIdentifier: "ViewControllerOne") as! ViewControllerOne
    vc.manager.currentState = state
    return vc
  }
}

A: OK! What's happening here is that you have segues connected to your tableView, and that causes issues when you also push a new view controller in your code.
From the code you've posted here, I think just removing the segues from your storyboard would solve the issue. Doing it in only code as you're already doing in tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) is perfectly fine.
You can delete segues by clicking on them and pressing backspace, view controller can float for themselves in the storyboard without being connected by segues.

A: In Objective-C, but the logic should be the same, that's what I would do:
CustomModel:
@property (nonatomic, strong) NSArray *subdata;
@property (nonatomic, strong) NSString *title;
@property (nonatomic, assing) BOOL isSpecial; //of course wording should be adapted to the real logic and your needs

By default on the init of a CustomModel object, isSpecial is set to NO.
ViewControllers:
@property (nonatomic, strong), NSArray *tableViewDataSource;

The tableViewDataSource of MainViewController should be like this:
- CustomData isSpecial: NO
             subdata = [CustomData11, CustomData12...]
- CustomData isSpecial: NO
             subdata = [CustomData21, CustomData22...]
- CustomData isSpecial: YES
             subdata = [CustomData31, CustomData32...]
- CustomData isSpecial: NO
             subdata = [CustomData41, CustomData42...]
- CustomData isSpecial: NO
             subdata = [CustomData51, CustomData52...]
- CustomData isSpecial: NO
             subdata = [CustomData61, CustomData62...]
- CustomData isSpecial: YES
             subdata = [CustomData71, CustomData72...]
- CustomData isSpecial: YES
             subdata = [CustomData81, CustomData82...]
- CustomData isSpecial: NO
             subdata = [CustomData91, CustomData92...]

Logic for deciding on next viewcontroller:
You can use either Segue or manual instantiation/push, but I'd suggest you keep doing the same method for both of thems
CustomModel *selectedData = tableViewDataSource[indexPath.row]
if ([selectedData isSpecial])
{
    //Go to SubVC, ie. another MainVC
    SubViewController *nextVC = ... //segue.destinationViewController looping on itself or storyboard.instatianteViewController instantiating another MainViewController
    nextVC.data = selectedData.subdata;
}
else
{
    //Go VC2
    ViewController *nextVC = ... //segue.destinationViewController or storyboard.instatianteViewController...
    nextVC.data = selectedData.subdata;
}

A: You can manage you viewcontroller and manager class as below:
class ViewControllerOne: UIViewController, UITableViewDelegate {
    var isSubVC = false

    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        tableView.deselectRow(at: indexPath, animated: false)

        let wireframe = WireFrame()
        let nextVC = wireframe.getNextVC(forView: self)
        self.navigationController?.pushViewController(nextVC, animated: true)
    }
}

class WireFrame {

    func getNextVC (forView view: UIViewController) -> UIViewController {
        if view.isKind(of: ViewControllerOne) {
            return ViewControllerTwo
        } else {
            // MainVC
            if indexPath.row == 2 || indexPath.row == 6 || indexPath.row == 7 {
                let subVC = self.storyboard?.instantiateViewController(withIdentifier: "ViewControllerOne") as! ViewControllerOne
                subVC.isSubVC = true
                return subVC
            } else {
                return ViewControllerTwo
            }
        }
    }
}


text:
Q: What does `init [2]` mean in the COMMAND column of ps? Reading What do the brackets around processes mean? I understand that the executable name is printed.
Linux ps man page:

Sometimes the process args will be unavailable; when this happens, ps will instead print the executable name in brackets.

However with ps -Awwo pid,comm,args I get:
  PID COMMAND         COMMAND
    1 init            init [2]

What does this mean? Does the "executable name" supposed to be init or [2]?
I suppose the executable is of course init - what is [2]? Why is it printed?
(Also, I don't really get why it can't show the full path if it knows the executable name.)

A: Both the comm column and the first word of the args column in the ps output show the name of the executable program if everybody involved follows the default convention. However it is possible to have discrepancies for various reasons.
When a program starts, the command name as shown in the args column is chosen by the parent program that executes the program and passed as an argument (argv[0]). By convention, the parent chooses the base name of the executable (i.e. the path to the executable without the directory part), but this is not enforced. Once the program is running, it can overwrite that string.
Init (at least the traditional Linux SysVinit) overwrites its argv[0] to indicate the current runlevel.
On Linux, the comm column is initially filled in by the kernel to the first 16 characters of the base name of the executable. The process can change the content with the prctl system call.
If the executable is renamed or deleted, neither the comm column nor the args column will reflect this.
ps doesn't display the path to the executable, that's not in its job description. lsof can tell you with lsof -a -p 1 -d txt.
On Linux, you can see this information in files in /proc/PID/:

*

*The process name (comm field) in in /proc/1/stat (second field in parentheses) and /proc/1/status (Name field).

*The path to the executable via /proc/1/exe.

*The arguments (starting with argv[0]) in /proc/1/cmdline (the arguments are separated by null bytes).


text:
Q: sequelize nodejs can i findAll the emails in custom array with 1 findAll? I am working on a project with sequelize and i have a problem:
I need to find all the emails in a custom array like:
const array = ['1234@gmail.com', '14521@gmail.com', '13245@gmail.com']

and findAll users where those array elements with only one action,
Can i do that?
I think some thing like this:
    const array = ['1234@gmail.com', '14521@gmail.com', '13245@gmail.com']
    const users = await db.Users.findAll({ where: {
        [Op.contains]: array
    }}).then(user => res.send(user));

Thanks for your Help!

A: I have got the answer use:
    const array = ['123@gmail.com', '456@gmail.com'];

    const users = await db.Users.findAll({where: {
        Email: array
    }}).then(room => res.send(room));


text:
Q: Rally: Get the bar function Rally has a new functionality "Portfolio Items" in the Track menu.
I like the bars with the percentage inside which you can see at:
"% Done By Story Plan Estimate" or "% Done By Story Count"
How can I use it in my customized app in Rally ?
Can someone give a small example ?
Thx

A: This percentage bar is part of a new App infrastructure that we are building. It probably will be called the App SDK 2.0. It is currently in development and will be released soon. Check the product blog for upcoming details.

*

*Mark


text:
Q: Let $\mu $ be a $\sigma $-finite measure. Show that for any $f\in L_p(\mu)$, $\|f\|_1=\sup\{ \int fg\, d\mu :\|g\|_\infty \leq 1\}$ Let $\mu $ be a $\sigma $-finite measure. Show that for any $f\in L_p(\mu)$, $\|f\|_1=\sup\{ \int fg \, d\mu :\|g\|_\infty \leq 1\}$
I know that Holders inequality implies $\int fg \, d\mu \leq \|f\|_1 \|g\|_\infty$ and for all $\|g\|_\infty \leq 1$, $\int fg \, d\mu \leq \|f\|_1$. But how do I show it's the supremum? My intial idea was to show that there exists a $g$ so that it attains the supremum i.e. $fg=|f|$ but I can't seem to find one.
Any hints please?

A: Let $g=\operatorname{sign}(f)$ then $\|g\|_\infty \leq 1$ and $\int fg d\mu = \int |f| \, d\mu =\|f\|_1$ which implies $\|f\|_1$ is the supremum.


text:
Q: Solace .Net API compiled for AnyCPU Why isn't Solace .Net API targeting AnyCPU? I've compared both SolaceSystems.Solclient.Messaging.dll and SolaceSystems.Solclient.Messaging_64.dll assemblies in Reflector and they are absolutely identical except for one class SolaceNativeAPI which points to libsolclient.dll and libsolclient_64.dll. It seems it would be very easy to convert this class to a non-static, expose common interface ISolaceNativeAPI which would be used instead of SolaceNativeAPI and create a factory that checks current process architecture and returns 32 or 64 bit implementation.
I'd be happy to submit a pull request if Solace code repository was public because it'd make my current work easier.

A: The Solace .NET API does not currently have an 'Any CPU' .NET binary because it was found in the past to slightly degrade performance. The Solace .NET API makes use of a native adapter layer that wraps a native library. To achieve run-time selection of the correct native library (32 or 64-bit) we need to introduce an indirection layer between the .NET API and the native adapter. This was tested in the past but found it degraded API performance by 5% to 10%, which was deemed too high to be released.


text: Q: Image Pixel Analysis in React Native Expo I'm trying to compare one image to another and depending on the similarity, I want to generate a score. The issue I'm running into is finding a way to compare the pixels of each of the images in a React Native and Expo supported way. I've checked out ResembleJS and a ton of other packages that can calculate percentage-wise how close an image is to another, but unfortunately these packages do not work in React Native. Is there any way I can implement this with React Native or can make a node file work effectively with the rest of my React Native project?


text:
Q: MVC3 Intranet Application / IIS Express Not Reading Site.css I first created an MVC3 Intranet web application in Visual Studio 2010 Professional.
It worked just fine.
I then right-clicked on the application and chose "Use IIS Express..."
I also edited the application properties and disabled Anonymous Authentication but enabled Windows Authentication.
Nothing more. This is a bare-bones, default skeleton of an application that I want to start from.
Now when I run, I first get a pop-up window to login with my username and password. This is just as I expect. However, when I log in, the "Home" and "About" pages are not formatted correctly. It looks like IIS Express isn't reading my Site.css file.
How do I fix this?
Thanks,
- Paul

A: The default links for the style sheets typically use the ../../ directory navigation. When you're on a real webserver, those links typically fail 'cause now you're in a different folder setup. An easy way to correct them is to use:
<link href="<%: Url.Content("~/Content/style.css") %>"
      rel="stylesheet" type="text/css" />

The url.content part will rebase the links to the current directory and will link up it's content correctly.
Hope this helps some, and good luck on your project.


text:
Q: How do I display the text in a text area elsewhere in my webpage(blog)? I am making a comments posting form for my blog, but I do not know how to display the text in my page.
So far I have got this:

<form style="margine:0px" method="post" target="view" id="WriteItForm">

Comments

      <textarea id="text_area" cols="20">
   --New Comment--
      </textarea>

There Is Currently No Comments

</form>

It give out an area of text like the one here.
The function of the form is to make it add the text in the textarea to my post when you click the submit button (which I do not know how to do either).
I want it to add some text into the post when you click the button, so that other people can read the comments, and so that I can use them to improve my page.

A: Please go to MDN's 'Learn HTML' page here: https://developer.mozilla.org/en-US/learn/html
There are so many things wrong here I don't even know where to begin.


text:
Q: Determine selected item from "Files" tab from within a custom Teams tab From within a custom Teams tab, can I somehow know what items did the user select in the "Files" tab ?
I'm developing a custom Teams tab (using typescript, react, and sharepoint web parts) which can be added to any channel page (alongside Posts, Files...).
The ideal scenario would be that the user first selects an item in the Files section (eg. a folder), then opens the custom tab, and in there I can know what the selected item is.
Can I somehow achieve this ?
Thanks.


text:
Q: NBSP or Blank Space in XML Layout I have been creating "blank" text views when I want to make a space in my android XML file.
For example, my linear layout activity looks like this:

So that it creates a space between the textview that says "REGISTRATION" and the next text view that says "First Name."
Is there another way of doing this?  I feel like this makes my code sloppy.
Here is my code:
<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/tbl_result"
    android:textColor="#00FF00"
    android:text="Register an Account"
/>
<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/blankspace"

/>
<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textColor="#00FF00"
    android:text="First Name"
/>

<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/first"
/>

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textColor="#00FF00"
    android:text="Last Name"
/>

<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/last"
/>

A: <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/tbl_result"
android:textColor="#00FF00"
android:text="Register an Account"
/>

/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#00FF00"
// set ur margin here instead of putting one view
android:layout_marginTop="30dp"
android:text="First Name"
/>

<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/first"
android:layout_margin
/>

<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/last"
 />


text:
Q: How to query JSON in a Postgres table from an Express REST API I am attempting to query a Postgres db through an Express REST API. One column (json_object_data) includes json, upon which I wish to query on the 'name' key.
It works fine if I enter the query directly into the db console. What's giving me an issue is passing a search term into an HTTP request to an Express route.
FYI, other requests to the Express app (GET, POST, PUT, and DELETE), that do not attempt to query the json column, work fine.
Node Express code:
app.get("/authorsname/:name", async(req, res) => {
    const { author_name } = req.params;
    console.log(req.params);
    try {
        const getAuthors = await pool.query("select json_object_data from \"jason-elwood/authors\".\"authors\" where lower(json_object_data ->> 'name') like lower($1%)", [author_name]);
        res.json(getAuthors);
        console.log(req.params);
    } catch (error) {
           console.error(error.message);
    }
});

Sample json (from the json_object_data column):
{
    "name": "Jason Elwood",
    "personal_name": "Jason Elwood",
    "last_modified": {"type": "/type/datetime", "value": "2008-08-20T17:57:31.650087"},
    "key": "/authors/OL1000204A",
    "birth_date": "1982",
    "type": {"key": "/type/author"},
    "revision": 2
}

http GET request:
http://localhost:3000/authorsname/jason

Result:
server is listening on port 3000
{ name: 'jason' }
node:events:371
      throw er; // Unhandled 'error' event
      ^

error: unable to bind
    at Parser.parseErrorMessage (/Users/jasonelwood/Development/OpenbookAPIs/node_modules/pg-protocol/dist/parser.js:287:98)
    at Parser.handlePacket (/Users/jasonelwood/Development/OpenbookAPIs/node_modules/pg-protocol/dist/parser.js:126:29)
    at Parser.parse (/Users/jasonelwood/Development/OpenbookAPIs/node_modules/pg-protocol/dist/parser.js:39:38)
    at Socket.<anonymous> (/Users/jasonelwood/Development/OpenbookAPIs/node_modules/pg-protocol/dist/index.js:11:42)
    at Socket.emit (node:events:394:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:199:23)
Emitted 'error' event on BoundPool instance at:
    at Client.idleListener (/Users/jasonelwood/Development/OpenbookAPIs/node_modules/pg-pool/index.js:57:10)
    at Client.emit (node:events:394:28)
    at Client._handleErrorEvent (/Users/jasonelwood/Development/OpenbookAPIs/node_modules/pg/lib/client.js:319:10)
    at Client._handleErrorMessage (/Users/jasonelwood/Development/OpenbookAPIs/node_modules/pg/lib/client.js:330:12)
    at Connection.emit (node:events:394:28)
    at /Users/jasonelwood/Development/OpenbookAPIs/node_modules/pg/lib/connection.js:114:12
    at Parser.parse (/Users/jasonelwood/Development/OpenbookAPIs/node_modules/pg-protocol/dist/parser.js:40:17)
    at Socket.<anonymous> (/Users/jasonelwood/Development/OpenbookAPIs/node_modules/pg-protocol/dist/index.js:11:42)
    at Socket.emit (node:events:394:28)
    at addChunk (node:internal/streams/readable:315:12) {
  length: 92,
  severity: 'FATAL',
  code: 'XX000',
  detail: 'cannot get parse message ""',
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'pool_proto_modules.c',
  line: '1414',
  routine: undefined,
  client: Client {
    _events: [Object: null prototype] { error: [Function (anonymous)] },
    _eventsCount: 1,
    _maxListeners: undefined,
    connectionParameters: ConnectionParameters {
      user: 'omitted',
      database: 'omitted',
      port: 5432,
      host: 'omitted',
      binary: false,
      options: undefined,
      ssl: false,
      client_encoding: '',
      replication: undefined,
      isDomainSocket: false,
      application_name: undefined,
      fallback_application_name: undefined,
      statement_timeout: false,
      idle_in_transaction_session_timeout: false,
      query_timeout: false,
      connect_timeout: 0
    },
    user: 'omitted',
    database: 'omitted',
    port: 5432,
    host: 'omitted',
    replication: undefined,
    _Promise: [Function: Promise],
    _types: TypeOverrides {
      _types: {
        getTypeParser: [Function: getTypeParser],
        setTypeParser: [Function: setTypeParser],
        arrayParser: { create: [Function: create] },
        builtins: {
          BOOL: 16,
          BYTEA: 17,
          CHAR: 18,
          INT8: 20,
          INT2: 21,
          INT4: 23,
          REGPROC: 24,
          TEXT: 25,
          OID: 26,
          TID: 27,
          XID: 28,
          CID: 29,
          JSON: 114,
          XML: 142,
          PG_NODE_TREE: 194,
          SMGR: 210,
          PATH: 602,
          POLYGON: 604,
          CIDR: 650,
          FLOAT4: 700,
          FLOAT8: 701,
          ABSTIME: 702,
          RELTIME: 703,
          TINTERVAL: 704,
          CIRCLE: 718,
          MACADDR8: 774,
          MONEY: 790,
          MACADDR: 829,
          INET: 869,
          ACLITEM: 1033,
          BPCHAR: 1042,
          VARCHAR: 1043,
          DATE: 1082,
          TIME: 1083,
          TIMESTAMP: 1114,
          TIMESTAMPTZ: 1184,
          INTERVAL: 1186,
          TIMETZ: 1266,
          BIT: 1560,
          VARBIT: 1562,
          NUMERIC: 1700,
          REFCURSOR: 1790,
          REGPROCEDURE: 2202,
          REGOPER: 2203,
          REGOPERATOR: 2204,
          REGCLASS: 2205,
          REGTYPE: 2206,
          UUID: 2950,
          TXID_SNAPSHOT: 2970,
          PG_LSN: 3220,
          PG_NDISTINCT: 3361,
          PG_DEPENDENCIES: 3402,
          TSVECTOR: 3614,
          TSQUERY: 3615,
          GTSVECTOR: 3642,
          REGCONFIG: 3734,
          REGDICTIONARY: 3769,
          JSONB: 3802,
          REGNAMESPACE: 4089,
          REGROLE: 4096
        }
      },
      text: {},
      binary: {}
    },
    _ending: true,
    _connecting: false,
    _connected: true,
    _connectionError: false,
    _queryable: false,
    connection: Connection {
      _events: [Object: null prototype] {
        newListener: [Function (anonymous)],
        connect: [Function (anonymous)],
        sslconnect: [Function (anonymous)],
        authenticationCleartextPassword: [Function: bound _handleAuthCleartextPassword],
        authenticationMD5Password: [Function: bound _handleAuthMD5Password],
        authenticationSASL: [Function: bound _handleAuthSASL],
        authenticationSASLContinue: [Function: bound _handleAuthSASLContinue],
        authenticationSASLFinal: [Function: bound _handleAuthSASLFinal],
        backendKeyData: [Function: bound _handleBackendKeyData],
        error: [Function: bound _handleErrorEvent],
        errorMessage: [Function: bound _handleErrorMessage],
        readyForQuery: [Function: bound _handleReadyForQuery],
        notice: [Function: bound _handleNotice],
        rowDescription: [Function: bound _handleRowDescription],
        dataRow: [Function: bound _handleDataRow],
        portalSuspended: [Function: bound _handlePortalSuspended],
        emptyQuery: [Function: bound _handleEmptyQuery],
        commandComplete: [Function: bound _handleCommandComplete],
        parseComplete: [Function: bound _handleParseComplete],
        copyInResponse: [Function: bound _handleCopyInResponse],
        copyData: [Function: bound _handleCopyData],
        notification: [Function: bound _handleNotification],
        end: [
          [Function: bound onceWrapper] {
            listener: [Function (anonymous)]
          },
          [Function: bound onceWrapper] {
            listener: [Function (anonymous)]
          },
          [Function: bound onceWrapper] {
            listener: [Function (anonymous)]
          }
        ]
      },
      _eventsCount: 23,
      _maxListeners: undefined,
      stream: <ref *1> Socket {
        connecting: false,
        _hadError: false,
        _parent: null,
        _host: 'db.bit.io',
        _readableState: ReadableState {
          objectMode: false,
          highWaterMark: 16384,
          buffer: BufferList { head: null, tail: null, length: 0 },
          length: 0,
          pipes: [],
          flowing: true,
          ended: false,
          endEmitted: false,
          reading: false,
          constructed: true,
          sync: false,
          needReadable: true,
          emittedReadable: false,
          readableListening: false,
          resumeScheduled: false,
          errorEmitted: false,
          emitClose: false,
          autoDestroy: true,
          destroyed: true,
          errored: null,
          closed: true,
          closeEmitted: false,
          defaultEncoding: 'utf8',
          awaitDrainWriters: null,
          multiAwaitDrain: false,
          readingMore: false,
          dataEmitted: true,
          decoder: null,
          encoding: null,
          [Symbol(kPaused)]: false
        },
        _events: [Object: null prototype] {
          end: [
            [Function: onReadableStreamEnd],
            [Function (anonymous)],
            [Function (anonymous)]
          ],
          error: [Function: reportStreamError],
          close: [Function (anonymous)],
          data: [Function (anonymous)]
        },
        _eventsCount: 4,
        _maxListeners: undefined,
        _writableState: <ref *2> WritableState {
          objectMode: false,
          highWaterMark: 16384,
          finalCalled: false,
          needDrain: false,
          ending: false,
          ended: false,
          finished: false,
          destroyed: true,
          decodeStrings: false,
          defaultEncoding: 'utf8',
          length: 0,
          writing: false,
          corked: 0,
          sync: false,
          bufferProcessing: false,
          onwrite: [Function: bound onwrite],
          writecb: null,
          writelen: 0,
          afterWriteTickInfo: {
            count: 1,
            cb: [Function (anonymous)],
            stream: [Circular *1],
            state: [Circular *2]
          },
          buffered: [],
          bufferedIndex: 0,
          allBuffers: true,
          allNoop: true,
          pendingcb: 1,
          constructed: true,
          prefinished: false,
          errorEmitted: false,
          emitClose: false,
          autoDestroy: true,
          errored: null,
          closed: true,
          closeEmitted: false,
          [Symbol(kOnFinished)]: []
        },
        allowHalfOpen: false,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: null,
        _server: null,
        [Symbol(async_id_symbol)]: 22,
        [Symbol(kHandle)]: null,
        [Symbol(kSetNoDelay)]: true,
        [Symbol(lastWriteQueueSize)]: 0,
        [Symbol(timeout)]: null,
        [Symbol(kBuffer)]: null,
        [Symbol(kBufferCb)]: null,
        [Symbol(kBufferGen)]: null,
        [Symbol(kCapture)]: false,
        [Symbol(kBytesRead)]: 784,
        [Symbol(kBytesWritten)]: 297
      },
      _keepAlive: false,
      _keepAliveInitialDelayMillis: 0,
      lastBuffer: false,
      parsedStatements: {},
      ssl: false,
      _ending: true,
      _emitMessage: false,
      _connecting: true,
      [Symbol(kCapture)]: false
    },
    queryQueue: [],
    binary: false,
    processID: -1631365830,
    secretKey: -1498717443,
    ssl: false,
    _connectionTimeoutMillis: 0,
    _connectionCallback: null,
    release: [Function (anonymous)],
    activeQuery: null,
    readyForQuery: true,
    hasExecuted: true,
    _poolUseCount: 1,
    [Symbol(kCapture)]: false
  }
}
[nodemon] app crashed - waiting for file changes before starting...

The same request directly in the db console (which produces a successful response):
select json_object_data from "jason-elwood/authors"."authors" where lower(json_object_data ->> 'name') like lower('jason%');

My guess is it's something to do with the structure of the query, particularly the way I'm including the request parameter in my request string. I've tried wrapping the entire request in single quotes and not escaping the table name like so:
const getAuthors = await pool.query('select json_object_data from "jason-elwood/authors"."authors" where lower(json_object_data ->> "name") like lower($1%)', [author_name]);

but it still produces an error.
Any help on this is greatly appreciated.
Thank you!

A: At least % should be added to a passed value because you use query parameters:
const getAuthors = await pool
  .query("select json_object_data from \"jason-elwood/authors\".\"authors\" where json_object_data ->> 'name' ilike $1", [`${author_name}%`]);
res.json(getAuthors);

And you can use ilike instead of like to avoid using lower for both sides of the operation.

A: So for anyone else coming to this in the future, the issue was how I was structuring the parameters when adding them to the query string. Because I'm using a LIKE operator, it needs to be formatted like this:
['%' + req.params.name + '%']

for reasons that are obvious to me now after banging my head on my desk for several hours. (Or what I had originally, which would be ['%' + author_name + '%']).  So the final query looks like this:
const getAuthors = await pool.query("select json_object_data from \"jason-elwood/authors\".\"authors\" where lower(json_object_data ->> 'name') like lower($1)", ['%' + req.params.name + '%']);

I can breath again. :)


text:
Q: What affects OpenVPN speeds? From my understanding the dh key is used to transfer keys when the connection is made. Which encryption affects OpenVPN speeds? AES256, RSA4096? Ect.

A: OpenVPN establishes a TLS connection to transport packets, so the answer to this would be the same as TLS.
RSA and DH is only done once at the start of connection, so while they greatly affect initial connection creation, they don't take part in further encryption during the session. So the only encryption that's relevant in long running connection is AES, which is really fast in modern processors that supports hardware accelerated AES, and is usually fast enough that it's not going to be the bottleneck even in processors that doesn't support AES acceleration or when AES acceleration is not used.
Probably the main determinants of OpenVPN speed is:

*

*the network bandwidth and latency between the VPN terminators

*whether you use TCP or UDP as the transport. For the purpose of OpenVPN, UDP usually performs better because missing packets would not delay the delivery of other unrelated packets

*the processing capacity of the VPN terminator hardware is usually not the main bottleneck, unless you're connecting multiple medium or large networks


text:
Q: Get value that from another defaultdict and update the original dict Basically, I am trying to extract the values from one dictionary and update the value in another dictionary. I have four lists as follows:
a = [1,1,2,3,4,5]
b = [0,3,0,5,6,0]
c = [2,3,4,5,6,5]
d = [20,30,40,50,60,70]

So I use a defaultdict to store key,value pairs for a,b like:
one = defaultdict(list)
for k, v in zip(a, b):
    one[k].append(v)

two = defaultdict(list)
for k, v in zip(c, d):
  two[k].append(v)

Essentially, b is linked to c so I am trying to extract the values in the two dictionary and then update
the values in the one dictionary
So in the end one would look like {1: 30, 3: 50, 4: 60}
This is my code:
three = defaultdict(list)
for k, v in one.items():
  if v in two.keys():
    newvalue = two[v].values()
    three[k].append(newvalue)

But I am now getting an error at line if v in two.keys(): as unhashable type: 'list'. I'm so lost, all
I want to do is use the values from one dictionary and then use those values to find the keys (which are the values
from the other table) and then get those corressponding values.

A: You are creating a dictionary of list in the beginning:
one = defaultdict(list)
for k, v in zip(a, b):
    one[k].append(v)

[output] : defaultdict(list, {1: [0, 3], 2: [0], 3: [5], 4: [6], 5: [0]})

two = defaultdict(list)
for k, v in zip(c, d):
    two[k].append(v)

[output] : defaultdict(list, {2: [20], 3: [30], 4: [40], 5: [50, 70], 6: [60]})

Therefore when calling k,v in one.items(), you are getting a key and a list.
Simply switch to iterate through the list , and you should be good to go
three = defaultdict(list)
for k, v in one.items():
    for value in v:
        if value in two.keys():
            newvalue = two[value]
            three[k].append(newvalue)

However I'm getting this output :
defaultdict(list, {1: [[30]], 3: [[50, 70]], 4: [[60]]})

Which sounds reasonable to me, but it is not your expected one, can you please explain ?
Let's try know with dic comprehension
output = { k : two[v_2] for k,v in one.items() for v_2 in v}

[output] : {1: [30], 2: [], 3: [50, 70], 4: [60], 5: []}

Request to sum :
Of course, multiple ways of doing it , the quickest is again with dict_comprehension and sum
output_sum = {k: sum(v) for k,v in output.items()}


text:
Q: How to rebuild a TListView but keep the scroll information? In TListView there is a bug: when you are in vsReport mode with GroupView set and try to insert a item, it is displayed last in the group not where you inserted. The problem is debated here. There are a few answers but none of them work. So, I think the only solution is to rebuild the entire list every time you insert a item. It's not simple but I think I can do it. But there is a big problem. If the scroll window is in the middle of the list and I rebuild the list, it send me back to the begining. It is possible to keep somehow the scroll information ?
I tried this:
procedure TNutrientsForm.Button2Click(Sender: TObject);
var ix,iy:Integer;
begin
 ix:= NList.ViewOrigin.X;
 iy:= NList.ViewOrigin.Y;
 NList.Items.BeginUpdate;
 RefreshList;
 NList.Scroll(ix, iy);
 NList.Items.EndUpdate;
end;

... but in vsReport mode you can only scroll in multiple of row height, so it does not position me exactly where it is supposed to.
Anyway, if you have an answer too for the problem in the link above, you can post it there and I will be verry happy. I worked for 3 days on this and I have not found a solution. That question is 9 years old. Maybe we can try again.

A: How to move inserted items to the correct position?
There's actually no need to rebuild list view to workaround the original issue. It's the problem of the Windows list view control (it can be reproduced even when inserting items in a raw API way by using the LVM_INSERTITEM message, for example).
Luckily, Delphi list view item objects are holding correct index values (of the intended placement in the control), so what remains is reordering the items in the Windows control by them. And that can be done by custom sorting. For example you can write a helper method like this:
type
  TListViewHelper = class helper for TListView
  public
    function FixItemsOrder: Boolean;
  end;

function FixComparer(lParam1, lParam2, lParamSort: LPARAM): Integer; stdcall;
begin
  Result := TListItem(lParam1).Index - TListItem(lParam2).Index;
end;

function TListViewHelper.FixItemsOrder: Boolean;
begin
  Result := Boolean(SendMessage(Handle, LVM_SORTITEMS, 0, LPARAM(@FixComparer)));
end;

And whenever you insert an item (or multiple items), call such method:
var
  ListItem: TListItem;
begin
  ListView1.Items.BeginUpdate;
  try
    ListItem := ListView1.Items.Insert(0);
    ListItem.Caption := 'Item 1';
    ListItem.GroupID := 0;

    ListItem := ListView1.Items.Insert(0);
    ListItem.Caption := 'Item 2';
    ListItem.GroupID := 0;

    ListItem := ListView1.Items.Insert(0);
    ListItem.Caption := 'Item 3';
    ListItem.GroupID := 0;

    ListView1.FixItemsOrder;
  finally
    ListView1.Items.EndUpdate;
  end;
end;


text:
Q: using the "freehand" construction tool I am drawing hydro features with the freehand tool. Does anyone know how to delete vertices (i.e. back up) in ArcMap 10 while drawing with freehand in the construction tools? I was just curious if there was a way to do this without having to go ahead and complete the polygon and then go back and edit the vertices post completion. Thanks!

A: I frequently use ctrl-z (Undo) to delete the last few vertices, which isn't clearly identified in the shortcut list.  That should let you 'back up' a few steps.


text:
Q: Most efficient data structure for Prim-Jarnik's algorithm What is the most efficient data structure among these there:

*

*Edge list

*Adjacency list

*Adjacency matrix

for executing Prim-Jarnik's algorithm and why?

A: By edge list I suppose you mean the list of all edges in a graph G ? Then that is the slowest of the three since you would need to traverse the entire list each time you are at a vertice u just to know which (u, v) pairs are in G. Adjacency matrix is somewhat faster than that, but still slow since you will need to traverse an entire row of the matrix to find the adjacent vertices and the respective edge weights. But if you have a dense graph, the adjacency matrix is just like an adjacency list. Adjacency list is the faster one supposing a not so dense graph such that traversing the list isn't more costly than directly accessing each column in the matrix row.
Said that, the key issue in Prim's algorithm is not actually this. To achieve its described computational complexity, you need to use a priority queue (and this is the part you should be concerned).


text:
Q: Get internet speed of User with GWT I want to get internet download & upload speedof user  in my GWT web application,programmatically.
After done much research ,I couldn't find a way to do it in GWT.
Is there a way to get internet speed of the user in GWT?

A: It seems there is a no straight way to do it in GWT.You can find many ways in Js or Jquery
In the same way,Take one image and upload it to server through RPC.Note RPC start time and and the note the time in RPC end(first line of onSuccess).By calculating the elapsed time with size of image ,you may get the upload time.And same for the download also.
P.S:  I did'nt try it.Just an idea.

A: Run your GWT web application and inspect the web page(right click mouse and choose inspect element) Then choose net or network from that then click upload or download and check how much time it took to upload and download file.


text:
Q: Floats are not clearing Divs on my header are overlapping unless I set a specific width, which I can't do. I've tried several different methods of clearing floats now, with no luck.
Here is my jsfiddle https://jsfiddle.net/q0oc27t8/
And here is my navigation code:
.nav {
    border-bottom: 3px solid #496278;
    border: 1px dotted red;
    bottom: 3px;
    font-size: 1.1vw;
    font-weight: bold;
    padding: 0 0.8vw 0 0.8vw;
    text-align: center;
}

What's the best way to go around this?

A: The float are not your problem, all the text is absolutely positioned. This means that those elements are pulled out of the document flow and no longer wrap/stack correctly.
Instead of using position: absolute try using a little padding and margin to position each .header-element.

A: It's not your floats. It's that your .inner elements are absolutely positioned. Because of that they are taken out of the flow and your .header-elements have no size except for their padding.
It looks like you are trying to vertically and horizontally center those elements. You could use the table and table-cell display properties instead.
Relevant code:
.header-element {
    height: 100%;
    float: left;
    display:table;
    position:relative;
}

.header-element .inner {
    display:table-cell;
    vertical-align:middle;
    text-align:center;
}

Full code below:

    body {
        background: gray;
    }
    /* ------ */
    /* Header */
    /* ------ */
    #header {
        width: 100%;
        height: 4vw;
        background: white;
        font-family: "fira-sans-2";
        /* Shadow */
        -webkit-box-shadow: 0px 7px 13px -4px rgba(110,110,110,1);
        -moz-box-shadow: 0px 7px 13px -4px rgba(110,110,110,1);
        box-shadow: 0px 7px 13px -4px rgba(110,110,110,1);
    }

    .header-element {
        height: 100%;
        float: left;
        display:table;
        position:relative;
    }

    .header-element .inner {
        display:table-cell;
        vertical-align:middle;
        text-align:center;
    }

    /* Logo */
    .logo {
        width: 3vw;
        font-weight: bold;
        margin-right: 1vw;
    }

    .nav {
        border-bottom: 3px solid #496278;
        border: 1px dotted red;
        bottom: 3px;
        font-size: 1.1vw;
        font-weight: bold;
        padding: 0 0.8vw 0 0.8vw;
        text-align: center;
    }

    .nav .inner {
        margin-top: 3px;
    }

    /* No select */
    .noselect {
    cursor: default;
    -webkit-touch-callout: none;
      -webkit-user-select: none;
       -khtml-user-select: none;
         -moz-user-select: none;
          -ms-user-select: none;
              user-select: none;
    }

            T

            Map

            Discover

            Bucket

            Plans

A: The problem with the position: absolute you used, it easy overlaps and in your case you don't need it.
If you change to this, you'll have a good start
.header-element .inner {
    display: inline-block;
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
}

Code snippet

    body {
        background: gray;
    }
    /* ------ */
    /* Header */
    /* ------ */
    #header {
        width: 100%;
        height: 4vw;
        background: white;
        font-family: "fira-sans-2";
        /* Shadow */
        -webkit-box-shadow: 0px 7px 13px -4px rgba(110,110,110,1);
        -moz-box-shadow: 0px 7px 13px -4px rgba(110,110,110,1);
        box-shadow: 0px 7px 13px -4px rgba(110,110,110,1);
    }

    .header-element {
        height: 100%;
        float: left;
        position: relative;
    }

    .header-element .inner {
        display: inline-block;
        position: relative;
        top: 50%;
        left: 50%;
        transform: translate(-50%,-50%);
    }

    /* Logo */
    .logo {
        width: 3vw;
        font-weight: bold;
        margin-right: 1vw;
    }

    .nav {
        border-bottom: 3px solid #496278;
        border: 1px dotted red;
        bottom: 3px;
        font-size: 1.1vw;
        font-weight: bold;
        padding: 0 0.8vw 0 0.8vw;
        text-align: center;
    }

    /* No select */
    .noselect {
    cursor: default;
    -webkit-touch-callout: none;
      -webkit-user-select: none;
       -khtml-user-select: none;
         -moz-user-select: none;
          -ms-user-select: none;
              user-select: none;
    }

            T

            Map

            Discover

            Bucket

            Plans


text:
Q: Typescript error when using React defaultProps with connect I'm trying to add defaultProps to MyComponent, then wire that up to redux. To do that, I'm using Partial<MyComponentProps> as defaultPropss type. However, Typescript is complaining

Property type bar is optional in Partial<MyComponentProps>, but required in { bar: number }.

I'd like to figure out why this is happening, and what a good solution is.
Here's the code:
interface MyComponentProps {
  foo: string;
  bar: number;
}

class MyComponent extends React.PureComponent<MyComponentProps, void> {
  public static defaultProps: Partial<MyComponentProps> = {
    foo: "hello"
  };

  public render() {
    return null;
  }
}

function mapStateToProps(state: any) {
  return {
    bar: 7
  };
}

connect(mapStateToProps)(MyComponent);

Typescript is complaining in the MyComponent part of connect(mapStateToProps)(MyComponent);
Casting defaultProps to MyComponentProps, or having mapStateToProps(state: any): Partial<MyComponentProps> both work, but this seems like something that should work out of the box. defaultProps is an official React pattern.


text:
Q: I'm getting JSON output as just []. The same php script gives correct json data when I run it on localhost I'm getting JSON output as just [] when I run it in localhost. But
The same php script gives correct JSON data when I run it on localhost it out puts as
[
   {"NAME":"RUDRESH","EMAIL":"Rudra@yahoo.com","PHONE":"1233333",
     "PASSWORD":"abcabc","CONFIRM":"abcabc"}
]

localhost.php

$hostname = "localhost";
$username = "root";
$password="";
$db_name = "register";

//PDO is a extension which  defines a lightweight, consistent interface for     accessing databases in PHP.
$db = new PDO("mysql:host=$hostname;dbname=$db_name", $username, $password);

//here prepare the query for analyzing, prepared statements use less   resources and thus run faster
$row=$db->prepare('select * from reg');

$row->execute();//execute the query
$json_data=array();//create the array
foreach($row as $rec)//foreach loop
{

    $json_array['NAME']=$rec['NAME'];
    $json_array['EMAIL']=$rec['EMAIL'];
    $json_array['PHONE']=$rec['PHONE'];
    $json_array['PASSWORD']=$rec['PASSWORD'];
    $json_array['CONFIRM']=$rec['CONFIRM'];
    //here pushing the values in to an array
    array_push($json_data,$json_array);
}

//built in PHP function to encode the data in to JSON format
echo json_encode($json_data);
?>

ftp.php
<?php
$hostname = "mysql.hostinger.in";
$username = "u456344325_rudra";
$password="databasechris596";
$db_name = "u456344325_regis";

//PDO is a extension which  defines a lightweight, consistent interface for    accessing databases in PHP.
 $db = new PDO("mysql:host=$hostname;dbname=$db_name", $username,$password);
//here prepare the query for analyzing, prepared statements use less resources and thus run faster
$row=$db->prepare('select * from reg');

$row->execute();//execute the query
$json_data=array();//create the array
foreach($row as $rec)//foreach loop
{

    $json_array['NAME']=$rec['NAME'];
    $json_array['EMAIL']=$rec['EMAIL'];
    $json_array['PHONE']=$rec['PHONE'];
    $json_array['PASSWORD']=$rec['PASSWORD'];
    $json_array['CONFIRM']=$rec['CONFIRM'];
    //here pushing the values in to an array
    array_push($json_data,$json_array);
}

//built in PHP function to encode the data in to JSON format
echo json_encode($json_data);
?>

A: The reason it is returning [] is probably because MySQL wasn't able to fetch any results, thus your loop did not run and hence the empty array.
There is no problem with your PHP code & the problem probably lies in your database.
Please make sure that your connection strings are correct and that your databases have the appropriate results to be fetched ( your table is not empty ).
EDIT:
What I meant by connection strings
This is the connection string for your local server correct?
$hostname = "localhost";
$username = "root";
$password="";
$db_name = "register";

And this is the connection string for your web server
$hostname = "mysql.hostinger.in";
$username = "u456344325_rudra";
$password="databasechris596";
$db_name = "u456344325_regis";

You can try executing a simple query to see if you're able to fetch ANY results at all from your database.
Also, you should echo out any errors that MySQL catches while running the query, it will let you know where the error is coming from.


text:
Q: Not able to use function variables ? Error expression must have class type Hey i want to use the function wolves variable in the storyline and im trying to do this :
"\nYou awake on a beach to the sound of"<< Wolves().name; " starving and blood hungry,"
        "\nThere is a Rock on the ground.  You pick it up";
        inventory.push_back("Rock");

But Wolves().name;  there is an error as mentioned in the title.  Why cant i do this?
Here is the code for the function Wolves:
void Wolves()
{
    string name = "Wolves";
    int health = 20;
    hitPoints() +1;
}

A: You can't access variables defined in a function from outside the function in C++, but you can change it to a class:
class Wolves {
  public:
    string name;
    // ...

    Wolves(); // Constructor
    //...
}

To access it you can use
Wolves wolve;
wolve.name = "whateverName"; // or set it in the constructor
cout << wolve.name << endl;

A: What you did in there is create local variables within the function.  Once the function exits, they no longer exist.  What you want to do is make a Wolves class and create public member variables to do what you want.  For an example,
class Wolves {
    public:
        string name;
        int health;

        Wolves(string name, int a);
}

Then on the main function,
Wolves w("Bob", 20);
cout << "The name is: " << w.name << endl;

Will output "The name is: Bob"
void functions don't really do anything unless you pass the value in by reference.  If you want to alter the object via void function, you should do something like
void Wolves(Wolves & wolfToChange)
{
    wolfToChange.name = "Bob";
}

and that will directly alter the object.

A: You declared "name" as a local variable in a function called Wolves(), but the code that you were referring to expects the function Wolves() to return an object that has an accessible member name. That is why the compiler is complaining.
The way you wrote the code suggests that Wolves should be a class or struct, not a function.


text:
Q: How to call a Vimeo API in php? I am trying to run this API(https://developer.vimeo.com/api/reference/videos#get_video). My goal is to call the API and print out the result, because after I run the the code, nothing is printed from the API call. Appreciate if anyone can help me. Thanks :
FYI, these are my code:
<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
      <?php
      require ("vendor/autoload.php");
  use Vimeo\Vimeo;
  $client = new Vimeo("{client_id}", "{client_secret}", "{access_token}");

   $video_id ="447518879";
   $response = $client->request("/videos/$video_id");
   //var_dump($response['body']);

   if($response['status'] === 200){
     echo json_encode($response['body']['message']);
   }
  else {
      echo json_encode($response['body']['error']);
  }

       ?>
  </body>
</html>

A: according to Vimeo API for PHP. the response it's an array with have body, header and status. Vimeo API PHP

to access the body. put this in your code:
var_dump($response['body']);

if you wanna print as a JSON in your page:
echo json_encode($response['body']);

I tested this script bellow in here. and it's working fine:
require 'vendor/autoload.php';
$client = new Vimeo("{client_id}", "{client_secret}", "{access_token}");
$video_id = "451686900";
$response = $client->request("/videos/$video_id");

print_r($response);


text:
Q: Faster relay? 5, 12 or 24V? I'm in a pursuit of finding the fastest PCB relay there is and there is a Chinese manufacturer that produces DPDT PCB relays that are rated 5V, 12V and 24V.
Which of these would have the fastest switching time? Can you conclude that without doing a measurement? (cause, you know, the shipping takes like 3 weeks or so...)
I'd argue that higher voltage rated relays would contain more windings, therefore would take more time to magnetize up to the switching point.
P.S. knowing the "problem-solving mentality" of the SO folk, I do not want to switch to a SS-Relay or transistor, I am building a highly useless thing called a relay CPU :)
Edit1: thank you for all the comments. Usually, cheap chinese manufacturers don't provide useful datasheets at all. And buying more expensive relays can get really expensive quite fast. But still, thank you all for infos :)

A: We know that ampere-turns is constant for the same force, so the number of turns n must be proportional to the reciprocal of the nominal coil current. The inductance is proportional to n^2.
We can also see that coil power is generally constant for a given design of relay, across coil voltage ratings. So the coil resistance must increase with the nominal voltage squared.
The effect of the inductance is a time constant L/R. Since L and R both increase with the square of nominal coil voltage rating, there is no first order effect on the inductance-delayed rise of force. Of course there is inertia in the moving parts and the delay due to the mechanical parts moving will not change with coil voltage rating.
If you look at data sheets from reputable makers such as Panasonic you will see the same max/nominal operate times stated across coil voltages.
For those who want to get an intuitive feel for this, the wire is thinner, there are more turns, and it fills about the same volume on the bobbin.

The release time is generally stated to be lower than the operate time, but take care that this is usually specified without a flyback diode- which will greatly increase the release time.


text:
Q: Extracting peaks from DEM and creating 5 m elevation buffer around each peak in ArcGIS Desktop?
I have a DEM available and would like to identify all the peaks that are likely to be bare rock. I want to be able to isolate these areas and create a 5m elevation buffer around them to represent the non-productive forest. I have used tools like fill but find the output to be to large/general and would like to get more specific..

In summary, I want to find and extract each peak in the DEM to turn it into a polygon out to the closed contour that encompasses the peak. Ideally like the picture attached.

A: WORKFLOW:
import arcpy
from arcpy.sa import *
from arcpy import env
env.overwriteOutput = True
height=0.5
DEM=arcpy.Raster("dem")
invert=8848.1-DEM
shallow = Fill(invert,0.95*height)
deep = Fill(shallow)
big=Con(deep>shallow,1)
outRgnGrp = RegionGroup (big, "EIGHT")
outZmin = ZonalStatistics(outRgnGrp, "VALUE", invert,"MINIMUM")
AOI=Con((outZmin+height)>invert,outRgnGrp)

pGons=r"..\SCRATCH.gdb\pgons"
peaks=r"..\peaks.shp"
arcpy.RasterToPolygon_conversion(AOI, pGons)
arcpy.Sort_management(pGons, peaks, sort_field="Shape_Area DESCENDING")
arcpy.DeleteIdentical_management(peaks, fields="gridcode")

OUTPUT:

NOTE: I presented workflow as a script, just to make it look shorter. In reality it is just a sequence of existing tools placed in order. You'll need to replace 3 lines, height assignment and output feature classes to make it work.

A: If you're willing/able to step away from Arc, the GRASS addon module r.geomorphon will extract the summits for you - in fact, it's the major use case example in the documentation: https://grass.osgeo.org/grass72/manuals/addons/r.geomorphon.html


text:
Q: How reliable is AUTO_INCREMENT in a transaction? I am planning on using auto-incremented user IDs on my website. As user data will be split across several tables, I was wondering, how reliable are auto-incremented values in transactions, i.e. when inserting some initial values into tables in a transaction upon registration, is it safe to just let the auto-incrementor set the IDs in all the tables or should it just insert into one table, get the inserted ID in a separate query and use it in the subsequent insertions, resulting in higher database load just for user creation?

A: The auto increment field gets reserved everytime you are attempting to insert something. The insert more or less proceeds in 2 steps:
1: reserve the next available auto-increment key
2: perform the insert with this reserved key
Now, if the transaction rolls back, the only thing that can never be rolled back is the auto-increment reservation, resulting in gaps in the auto-increment column. Because of this, if you are trying to predict 100% what the auto increment will be, it is impossible to do so. There is no other issue with auto_increment that i know of, and in almost all cases, it is more reliable to rely on mysql's features than to try to do something manually.

A: If your insertions happen under very controlled conditions, like there are no concurrent transactions, and nothing is ever rolled back, you might be safe. Otherwise, the answer could depend on what storage engine you are using. You should expect auto_increment to result in gaps in the numbering at least if you are using InnoDB.
More generally, every DB I know has the chance of gaps in auto_increment (or the equivalent) values. The reason is that if it were not so, any transaction inserting a new row would have to block all other insertions to that table. This is because a second row can't be inserted when it's not possible to know what the next value will be if the first transaction hasn't yet committed or rolled back. If you allow gaps, then you just assume the first transaction will commit, and if it happens to rollback, you have a gap, but that's not a problem.
If your concern is high load for a user creation operation, you might be able to make things snappier by implementing the function as a stored procedure; this way you can avoid round-tripping back to the application for each query.


text:
Q: How to make multiple objects in Three.js? I need to make multiple objects fall from the top.
I have tried to duplicate code but it did not work.
HERE is my code:
```var renderer = new THREE.WebGLRenderer({canvas: document.getElementById('myCanvas'), antialias: true});
      renderer.setClearColor(0x00ff00);
      renderer.setClearColor( 0xffffff, 0);
      renderer.setPixelRatio(window.devicePixelRatio);
      renderer.setSize(window.innerWidth, window.innerHeight);
      // CAMERA!
      var camera = new THREE.PerspectiveCamera(35, window.innerWidth / window.innerHeight, 0.1, 3000);
      // SCENE!
      var scene = new THREE.Scene();
      // LIGHTS!
      var light = new THREE.AmbientLight(0xffffff, 0.5)
      scene.add(light);

      var light1 = new THREE.PointLight(0xffffff, 0.5)
      scene.add(light1);
      // TYPE OF 3D SHAPE!
      var geometry = new THREE.BoxGeometry( 100, 100, 20 );

      geometry.applyMatrix( new THREE.Matrix4().makeRotationZ( Math.PI / 4 ) );
      geometry.applyMatrix( new THREE.Matrix4().makeScale( .6, 0.9, .6 ) );       // MATERIALs!
      var material = new THREE.MeshLambertMaterial({color: 0xF3FFE2});
      var mesh = new THREE.Mesh(geometry, material);
      var mesh1 = new THREE.Mesh(geometry, material);
      mesh.position.set(100, 500, -1000);
      mesh1.position.set(200, 500, -1000);

      scene.add(mesh);
      scene.add(mesh1);

      // RENDER LOOP
      color = '0x'+(Math.random()*0xFFFFFF<<0).toString(16);
      requestAnimationFrame(render);
      function render() {
        move = Math.floor((Math.random() * 2) + 1);
        mesh.translateZ(-10)
        mesh.translateY(-10)
        if (move == 1){
        mesh.material.color.setHex(color);
        }
        mesh.rotation.x += 0.005; //MOVE SHAPE
        mesh.rotation.y += 0.1;
        renderer.render(scene, camera);
        requestAnimationFrame(render);
        scene.add(mesh)
      }```

I want to make many objects to fall from the sky. How can I do this with three.js because it did not appear?
I am a beginner to three.js so kindly help me! Note: not javascript beginner
Please Help Thanks in Advance! (i have been stuck on this)

A: The following live example is an enhanced version of your code. The basic idea is to use an array to manage individual objects in your scene:
for ( var i = 0; i < count; i ++ ) {

    var mesh = new THREE.Mesh(geometry, material);

    scene.add(mesh);
    objects.push(mesh);

    // initial individual transformation

    mesh.position.set(- 1000 + Math.random() * 2000, 2000 * Math.random(), -1000 + Math.random() * 2000 );
    mesh.rotation.x += Math.PI * Math.random();
    mesh.rotation.y += Math.PI * Math.random();

}

You then use the same approach to update these objects in your animation loop.
Demo: https://jsfiddle.net/6bzfLag2/1/
However, be aware that this approach requires one draw call per object so it is not very performant for a large amount of objects. You should consider to use InstancedMesh which was recently introduced in the engine. Study the following example to see how you can use it to transform individual objects but render them with a single draw call.
https://threejs.org/examples/webgl_instancing_suzanne
three.js R110


text:
Q: Clarification on Interface concept interface A
{
    public void printValue();
}

public class Test
{
    public static void main (String[] args)
    {
        A a1 = new A() {
            public void printValue()
            {
                System.out.println("A");
            }
        };
        a1.printValue();
    }
}

We cannot create an instance of an interface, but what is new A() doing in this code? I have seen this type of code used mostly with Comparators. Please explain.

A: new A() {} is an instantiation of an anonymous class that implements interface A.
It is a short-cut that can be useful if you need an instance of a class that implements an interface only in one place, so you don't want to define a normal class. This way you define the class at the same place it is being used.
In your code sample, it doesn't seem very useful, but usually it is used by passing the anonymous class instance to some method that accepts a parameter of the type of the interface.

A: new A() in below is where you are instantiating a concrete class (which we say anonymous) which implements the interface A
 A a1 = new A() {
  public void printValue(){
  System.out.println("A");
  }
 };

A: In your code, interface A is used as an Anonymous class. You can use them if you need to use a local class only once. it's more over same as lambda expressions.
Read more: http://docs.oracle.com/javase/tutorial/java/javaOO/anonymousclasses.html
Read about lambda expression: http://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html


text:
Q: Determining North and South pole of magnet If I have an irregularly shaped magnetic material and want to find which way is the north and south. How do I do it?
And more importantly, why are the north and south poles of a magnet situated where they are?

A: The easiest way to determine the polarity of a magnet is to set the magnet on a flat surface so one of its ends is next to a compass. Then, check which end of the compass needle is pointing at the magnet. If it's the North end, it's pointing at the South pole of the magnet. If it's the South end, it's pointing at the North pole of the magnet. If you don't have a compass, then you can create one, by finding a string with enough length to tie it around the magnet and suspend it, away from you, and you have to make sure that the magnet can rotate freely. then it will start rotating, When it stops spinning, the end that is pointing North is the North pole of the magnet. but if you will not be able to tie a string around your magnet then, here is the third way,
Fill a cup, bowl, or small dish with water, (which is enough amount of Styrofoam to float freely. The Styrofoam should be small enough to place in your water dish and a large enough to hold your magnet, then you put your irregular magnet on the styrofoam, and the part that points north it is the north pole.
For the second question, it can be determined to calculate the Net Dipole Moment of the magnet, which is defined as the vector sum of the magnetic moment of the electron and each other particle which is electrically charged and is in motion. for example, if you have a soloneoid, and there is a current through it in anticlockwise direction then that end of the solenoid behaves as the North Pole and rear end as the South Pole and the reverse.
hope that was helpful.

A: The answer to Question 1:
Just hang the magnet by a thread. After some time, it will align itself w.r.t earth's magnetic field.
Part of the magnet which is in the direction of North will be the North - Pole of the magnet.
The Answer to Question 2:
It's direction of current or tiny atoms/molecules (their magnetic dipole moments) decides where north and south pole of magnet should be situated. But they will be always in opposite directions.

A: A typical magnetic material is made up of magnetic domains. These are regions of the material where all the electron spins are aligned to give the domain an overall magnetic moment. Typically these domains will be around 10 microns in size.
The total magnetic field of the chunk of iron, or whatever, is the sum of the individual fields of all the domains within it. In the unmagnetised state the domains are randomly aligned so their fields cancel out. When you magnetise the iron you are changing the alignment of the domains so they are partially aligned. This makes their fields reinforce instead of cancelling so we get an overall macroscopic magnetic field.
So to understand the field of an irregularly shaped piece of iron you need to consider the domains within it and add up their magnetic fields. In effect it's like making up your shape by gluing together lots of tiny bar magnets. An individual magnetic domain has a dipole field and in a bar magnet these fields sum to give a total field that is also approximately dipolar. However for some random shape the total field is going to be more complicated so it can't simply be described as a dipole.
The North and South poles we associate with magnets are the two directions in a dipolar field, so a randomly shaped magnet doesn't necessarily have distinct North and South poles. When you are far enough away from the magnet the field will usually look approximately dipolar, with distinct poles, but as you get closer to the magnet the field will become more complex.
I have written a related answer in What happens to the poles of a bar magnet if it isn't completely broken in two, but only partially broken? and you might be interested to read that as it also talks about irregularly shaped magnets.


text:
Q: how to use a batfch file to log in to a router and then send commands to the router I am attempting to write a batch file to open a telnet session , connect to router ,enter username and password and finally send a command to the router, I have two different routers I am attempting this with . one of them a netgear i can successfully unlock telnet on the router (it is locked by default and once unlocked ,reverts after reboot) open telnet session and connect to the router.to unlock telnet i have a program telnetenable.exe which is stored in c:/
echo off
echo c:/telnetenable.exe ipaddress username password
telnet ipaddress

but cant send a command to the router once at this point ,at which i have an open connection to the router and can enter cmd manually which is adslctl configure --snr x
but i would like to incorporate it into the batch file.
on the second router a speedstream 4200 telnet is not locked and i can open the telnet session and connect to router but cant enter username or password after which i want to be able to send a cmd.
echo off
telnet ipaddress

gets me as far as username request. can anyone help me with either of these problems.
many thanks.

A: Search for this free tool.  Windows telnet can't be scripted.
Telnet Scripting Tool v.1.0 by Albert Yale


text:
Q: Как связать телеграмм бот и кибербезопасность? Мне нужно написать проект, у меня есть почти готовый, но нужно какой-то продукт. Телеграмм ботов я могу писать, любых, но нужна именно тема кибербезопасности, если взять какой-то другой телеграмм бот и под него сделать проект, то это нужно все сначала. Необязательно, конечно, телеграмм ботов, но это самое лёгкое и быстрое. Я думал насчёт каких-то команд, связанных с рекомендациями по кибербезопасности, но лучше тогда сделать какую-то распечатку. Что думаете?

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

A: Можно сделать бота, который будет проверять файлы на наличие вирусов, отправляя их на VirusTotal, например. Ты ему скармливаешь файл или ссылку, а он дает ответ на наличие или отсутствие вредоносов.

A: Напиши бота, который будет хэшировать твое сообщение разными хэшами, можно и самописными, чтобы точно никто не вскрыл))


text:
Q: Calculating Covariance from data So wikipedia says that covariance is:
$$
E[(X_i - \mu_i)(X_j - \mu_j)^T] \text{ for all i,j in the covariance matrix}
$$
Right now, I have my code set up so that I multiply (dot product) my $i$ data columns minus the average for that column by the $j$ data columns minus the average for that column...and I get a nice $d\times d$ matrix (where $d = \text{ data feature count (or # of columns)}$).
My question is: is that the covariance matrix? Can someone please confirm?
Or do I have to do something extra-- the $E[...]$ part of the wikipedia definition is throwing me off--does it mean that I need to do something more?
(also I got a covariance value of 116 at the $0,0$ location, with a mean of $13$ for that column vector...so I am not sure if that is correct...)
Update
In the comment below someone mentioned that I could estimate expectation by dividing the resulting $d \times d$ matrix by $d-1$.  Why would one do  that?
And also, numpy does not seem to implement the expectation step...does that mean it is correct to skip it on finite feature data generated from observation?