text:
Q: java.lang.IncompatibleClassChangeError, BM25BooleanQuery Exception in thread "main" java.lang.IncompatibleClassChangeError: Implementing class
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at NVoting.<init>(NVoting.java:143)
    at Main.main(Main.java:8)

on this line:
booleanQuery.add(new BM25BooleanQuery(current_tags[i],
                            "tags",
                            new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_31)),
                            BooleanClause.Occur.SHOULD);

I'm using an implementation of BM25 Okapi retrieval system: http://nlp.uned.es/~jperezi/Lucene-BM25
Can you help me to fix the issue ? I'm using Lucene 3.1
I've also tried Lucene 2.9.4 with no luck.
thanks

A: Either you use different third-party libraries for compilation and execution or some of your third-party libraries are not compatible.
The error may happen if you use one version of a library for compilation and another one (with slightly different API) for execution. Double check all your library versions (do they fit?) and you classpaths.

A: I'm not a Java programmer, so take this answer with caution, but here's the facts as I see them:

*

*The last update date of the BM25 implementation is January 2009 (or perhaps December 2009)

*Lucene 3.1 was released in March this year

*IncompatibleClassChangeError indicates an incompatible change in a dependent class

So I think you'll either need to use the same version of Lucene as the BM25 implementation used when it was built or rebuild it from source (if that's a possibility).
Good luck,


text:
Q: Linux TCP buffer simulation I would like to run simulations on the Linux TCP receive buffer to find out how big my buffer has to be.
Is there any software available to perform such simulation? It would be handy to be able to fill up the buffer to see what happens with my application.
Update: It seems like we are using to big buffers, because we get buffer overruns. Our network is at 1Gbit and ping is only 0,08ms. Our buffer settings look like this:
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.rp_filter = 1
fs.inotify.max_user_watches = 65536
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.rmem_default = 1733248
net.core.wmem_default = 1733248
net.ipv4.tcp_rmem = 4096 1733248 16777216
net.ipv4.tcp_wmem = 4096 1733248 16777216
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_timestamps = 1

A: Check this article. It seems to do a good job describing the optimization process, and it has example code (Java and C) to access / change the sizes. There's also a link to a Linux tool to determine optimum size.
This other article show some things you can access using the /proc/sys file system, which is a nice source for real-time info. It shows how to use it using the command line.

redpajama_set_name: RedPajamaStackExchange


text:
Q: mod_rewrite help - subdirectory turned into subdomain I  had http://example.com/intranet/ which I  had to turn into http://intranet.example.com
Unfortunately, everything was written with the absolute path so its like time clock
So you see my dilemma. everything wants to go to like /intranet/timeclock
I tried some rewrite rules like
    RewriteRule ^/intranet / [R,L]
    RewriteRule ^/intranet/(*.) /$1 [R,L]

And others. No luck. I have looked at the other posts on server fault and tried some of them with no luck either. Andy advice?

A:
RewriteEngine On
RewriteRule ^/intranet/(.*)$ http://intranet.example.com/$1 [R=301,L]


text:
Q: LC Oscillator in Capacitive Divider Mode
Hi,
In oscillator circuit, I have faced such LC topologies where between two capacitors, the wire is grounded as shown above.
What I don't understand is why I should ground it. Clearly at the ground point, the current can take either path A or path B (as in diagram). Now at resonance both path offers zero resistance/reactance. Though path B offers zero resistance in all cases. Assuming my inductor is ideal, why should I allow it to be grounded because if current leaks through path B, it means I am having non zero reactance around the circuit. Lets assume the input impedance of the top amplifier with a gain of $$a$$ is very large.
I though on it a lot, but still I don't  have any convincing answer for this. Can someone please drop some clues here.

A: Your oscillator's (inverting) amplifier is actually a two-port device, whose input signal is amplified with respect to ground. And it provides output power which sinks and sources currents with respect to ground. Like this:

simulate this circuit – Schematic created using CircuitLab
 The amplifier output port delivers power to the C1-L1-C2 network's input (at C1). Similarly, the amplifier input port accepts power from the C1-L1-C2 network.
The network C1-L1-C2 is not just a resonator - it is of the low-pass filter form. In an oscillator circuit, this network is underdamped, so that it has a "resonant" peak. Near this resonant peak, it provides nearly 180 degree phase shift between its input and output. The inverting amplifier provides a little more than 180 degrees to satisfy the condition for oscillation.
It may be possible for this circuit to use a resonator with very little capacitance to ground (for C1 and for C2) and still oscillate. In a breadboard, stray capacitances combined with amplifier input and output capacitances are often enough to start feeble oscillations with a crystal resonator, so that no added capacitors (C1 & C2) are needed. C1 and C2 are often of similar value, especially where the inverting amplifier has similar input and output impedance.

A: The resistor R1 is of primary importance - if the amplifier has a low-resistive voltage output. In this case, you have a feedback circuit which consists of a third-order lowpass: R1-C2 (1st order) connected to L1-C1 (2nd order).
At one single (finite) frequency fo this 3rd-order lowpass produces a phase shift of -180deg which - together with the inverting amplifier - allows a loop phase of zero deg (oscillation condition). That is the reason for grounding C2 and C1. (If the amplifier is a BJT stage, the resistor R1 can be replaced by the finite output resstance at the collector).
If the common node of C1 and C2 would not be at ground, the circuit could never meet the oscillation condition (the parallel LC tank can never produce the required phase shift of -180deg).
To fulfill the second part of the oscillation condition (loop gain of slightly larger than unity) the inverting gain of the amplifier must compensate the damping factor of the lowpass in the feedback path at the frequency fo.

simulate this circuit – Schematic created using CircuitLab


text:
Q: How to extract SOAP header from a WS response using spring-ws and jaxb We're using spring-ws 2.2 on our application to consume web services. We've been happily doing this for quite some time and everything is working fine, except that now I need to access the SOAP header in the response and I just can't find a way to do this.
We are using a WebServiceTemplate (from springs-ws) configured with a Jaxb2Marshaller. The jaxb files are generated from the wsdl using xjc. The header element in my responses look something like this:
   <soapenv:Header>
         <v1:ResponseHeader status="OK">
             <v1:description>test</v1:description>
          </v1:ResponseHeader>
   </soapenv:Header>

In my java class, the code that parses the response looks like this (I've stripped some irrelevant code):
public CalculationData getValues(Integer id) throws IntegrationException {
    WebServiceMessageCallback callback = createCallback(soapAction);

    GetValuesRequest request = toGetValues(id);
    GetValuesResponse response = null;
    try {
        response = (GetValuesResponse) webServiceTemplate.marshalSendAndReceive(request,         callback);
    } catch (SOAPFaultException fault) {
        log.error("Soap fault occurred during getValues " + id);
        throw new IntegrationException(fault);
    }

    CalculationData data = fromGetValues(response);

    return data;
}

Please help me find a solution for extracting the information from the SOAP header out of the response. I must be able to parse the status code which is sent as an attribute.
By the way. I also have a ResponseHeader.java jaxb class which has been generated from the schemas.
Update from final changes:
This is how my handleResponse method looks like after inlining a ClientInterceptor implementation:
@Override
public boolean handleResponse(MessageContext messageContext) throws WebServiceClientException {
    SoapMessage message = (SoapMessage) messageContext.getResponse();
    Iterator<SoapHeaderElement> responseHeaderElements =
            message.getSoapHeader().examineAllHeaderElements();
    SoapHeaderElement header = null;
    if (responseHeaderElements.hasNext()) {
        header = responseHeaderElements.next();
    } else {
        log.error("Error! No ResponseHeader found in response.");
        return false;
    }

    String responseCode = header.getAttributeValue(new QName(STATUS_QNAME));
    responseMsg.put(RESPONSE_MSG_KEY, responseCode);
    return true;
}

I tried getting the ResponseHeader element by QName, but that did not seem to work for some reason. However, I only expect to get one element in the soap header anyhow, is this will work fine.

A: For this use case, the best solution is to use a custom WebServiceMessageExtractor, as described here:
http://veithen.github.io/2015/01/03/spring-ws-extracting-soap-headers-from-responses.html

A: Implement a ClientInterceptor, specifically see handleResponse() method.
In order to access the Soap Headers, convert to a SoapMessage
public final boolean handleResponse(MessageContext messageContext, Object endpoint) throws Exception {
        QName v1ResponseHeaderQName = null;//todo
        QName statusAttrQName = null;//todo
        SoapMessage message = (SoapMessage) messageContext.getResponse();
        Iterator<SoapHeaderElement> matchingHeaders = message.getSoapHeader().examineHeaderElements(v1ResponseHeaderQName);
        String status = matchingHeaders.next().getAttributeValue(statusAttrQName);
}

then call webServiceTemplate.setInterceptors(..)
For some further examples of this stuff see AbstractWsSecurityInterceptor and its subclasses. Be aware however that those interceptors deal with replacing the request message, you just want to read the response message.
Problem is you are dealing with the raw soap message now so you've lost the nice spring marshalling and need to start dealing with namespaces (QNames) and w3c Dom stuff.
In order for the interceptor to pass the header back to the calling code, you could make the interceptor an anonymous inner class that is setup inside your getValues(...) method.
final Map<String,String> headers = new HashMap<>();

template.setInterceptors(new ClientInterceptor[]{new ClientInterceptor() {

        @Override
        public boolean handleRequest(MessageContext messageContext) throws WebServiceClientException {
            return true;
        }

        @Override
        public boolean handleResponse(MessageContext messageContext) throws WebServiceClientException {
            headers.put("foo", "bar");
            return false;
        }

        @Override
        public boolean handleFault(MessageContext messageContext) throws WebServiceClientException {
            return true;
        }

        @Override
        public void afterCompletion(MessageContext messageContext, Exception ex) throws WebServiceClientException {
        }
}});
template.marshalSendAndReceive(....);


text:
Q: i want to merge pdf in laravel trying by package lynX39 But can not complete install
*

*Installing lynx39/lara-pdf-merger (dev-master e952590): Cloning e95259079c

In Git.php line 325:
Failed to clone https://github.com/deltaaskii/lara-pdf-merger.git via https
, ssh protocols, aborting.

*

*https://github.com/deltaaskii/lara-pdf-merger.git
Cloning into '/home/mostafa/Web App/tmc/vendor/lynx39/lara-pdf-merger'...
fatal: unable to access 'https://github.com/deltaaskii/lara-pdf-merger.gi
t/': Could not resolve host: github.com

*git@github.com:deltaaskii/lara-pdf-merger.git
Cloning into '/home/mostafa/Web App/tmc/vendor/lynx39/lara-pdf-merger'...
ssh: Could not resolve hostname github.com: Name or service not known
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

A: Finally I Got Solution By Using anther
https://github.com/jurosh/php-pdf-merge
Package that not depend on Lynx39
"jurosh/pdf-merge": "^2.0"
$pdf = new \Jurosh\PDFMerge\PDFMerger;

// add as many pdfs as you want
$pdf->addPDF('path/to/source/file.pdf', 'all', 'vertical')
  ->addPDF('path/to/source/file1.pdf', 'all')
  ->addPDF('path/to/source/file2.pdf', 'all', 'horizontal');

// call merge, output format `file`
$pdf->merge('file', 'path/to/export/dir/file.pdf');

Tested and Worked Well ....


text:
Q: Placing a JLabel at a specific x,y coordinate on a JPanel I'm trying to place a series of JLabels at specific X and Y coordinates on a JPanel (and set its height and width, too). No matter what I do, each label winds up immediately to the right of the previous label and has the exact same size as all of the others.
Right now, my Jpanel is in a Grid Layout. I've tried Absolute Layout (illegal argument exception results), Free Design (no labels appear), Flow Layout (everything just gets squeezed to the center), and a few others.
Not sure what I need to do to make this work. Can anyone help?  Thanks!
JLabel lbl1 = new JLabel("label 1");
JLabel lbl2 = new JLabel("label 2");
JLabel lbl3 = new JLabel("label 3");
JLabel lbl4 = new JLabel("label 4");
JLabel lbl5 = new JLabel("label 5");

myPanel.add(lbl1);
myPanel.add(lbl2);
myPanel.add(lbl3);
myPanel.add(lbl4);
myPanel.add(lbl5);

lbl1.setLocation(27, 20);
lbl2.setLocation(123, 20);
lbl3.setLocation(273, 20);
lbl4.setLocation(363, 20);
lbl5.setLocation(453, 20);

lbl1.setSize(86, 14);
lbl2.setSize(140, 14);
lbl3.setSize(80, 14);
lbl4.setSize(80, 14);
lbl5.setSize(130, 14);

A: *

*Set the container's layout manager to null by calling setLayout(null).

*Call the Component class's setbounds method for each of the container's children.

*Call the Component class's repaint method.
Note:
Creating containers with absolutely positioned containers can cause problems if the window containing the container is resized.
Refer this link:
http://docs.oracle.com/javase/tutorial/uiswing/layout/none.html

A: Layout managers are used to automatically determine the layout of components in a container. If you want to put components at specific coordinate locations, then you should not use a layout manager at all.
myPanel = new JPanel(null);

or
myPanel.setLayout(null);

A: My advise is to use an IDE like NetBeans with its GUI editor. To inspect the code and because there are many ways:
Setting the layout manager, or for absolute positioning doing a myPanel.setLayout(null), has several influences.
In general, assuming you do your calls in the constructor of a JFrame, you can call pack() to start the layouting.
Then, every layout manager uses its own implementation of add(Component) or add(Component, Constraint). BorderLayout's usage is with add(label, BorderLayout.CENTER) and so on.

A: You have to set your container's Layout to null:
myPanel.setLayout(null);

However is a good advise also to take a look at the Matisse Layout Manager, I guess it is called GroupLayout now. The main problem with absolute positioning is what happens when the window changes its size.

A:     // Best solution!!

import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class Main {

  public static void main(String args[]) {
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    JPanel panel = (JPanel) frame.getContentPane();
    panel.setLayout(null);

    JLabel label = new JLabel("aaa");
    panel.add(label);
    Dimension size = label.getPreferredSize();
    label.setBounds(100, 100, size.width, size.height);

    frame.setSize(300, 200);
    frame.setVisible(true);

  }
}

A: You can use your own method that calling by setSize, setLocation values for directly....! `
As well i show you how to use JProgress Bar
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

class installComp{
    void install(Component comp, int w, int h, int x, int y){
        comp.setSize(w,h);
        comp.setLocation(x,y);
    }
}
class MyFrame extends JFrame{
    int cur_val = 0;
    JButton btn = new JButton("Mouse Over");
    JProgressBar progress = new JProgressBar(0,100);
    MyFrame (){
        installComp comp=new installComp();

        comp.install(btn,150,30,175,20);
        comp.install(progress,400,20,50,70);

        btn.addMouseListener(new MouseAdapter(){
            public void mouseEntered(MouseEvent evt){
                cur_val+=2;
                progress.setValue(cur_val);
                progress.setStringPainted(true);
                progress.setString(null);
            }
        });
        add(btn);
        add(progress);
        setLayout(null);
        setSize(500,150);
        setResizable(false);
        setDefaultCloseOperation(3);
        setLocationRelativeTo(null);
        setVisible(true);
    }
}
class Demo{
    public static void main(String args[]){
        MyFrame f1=new MyFrame();
    }
}


text:
Q: Grails - Parameter in a Quartz job Trigger I have the following quartz job, set via Quartz-plugin:
class UserMonthlyNotificationJob {
static triggers = {
        cron name:'dailyTrigger', cronExpression: " ... "
        cron name:'weeklyTrigger', cronExpression: " ... "
        cron name:'monthlyTrigger', cronExpression: " ... "
}

    def execute(){ ... }
}

I would like to be able to set a parameter in the trigger that would be available in the execute block.
It seems I can not set any variable in a cron trigger, and a custom trigger require to implement the Quartz Trigger interface, which I do not know how to do.
Any help greatly appreciated.

A: Make your job implement StatefulJob, then you'll have access to JobExecutionContext which has a Trigger instance accessor. If you have your own Trigger class, that will be an instance of it.

A: Thank you very much, it did the trick. This is how I ended up using it:
import org.quartz.StatefulJob
import org.quartz.JobExecutionContext

class UserPeriodicalNotificationJob implements StatefulJob{

    static triggers = {
        cron name:'dailyTrigger', cronExpression: ConfigHolder.config.userDailyNotificationJob
        cron name:'weeklyTrigger', cronExpression: ConfigHolder.config.userWeeklyNotificationJob
        cron name:'monthlyTrigger', cronExpression: ConfigHolder.config.userMonthlyNotificationJob
    }

    void execute(JobExecutionContext context){
        def triggerName = context.trigger.key
        try {
            switch (triggerName) {...}
        }
        catch(Exception) {...}
  }
}


text:
Q: Is my function correct from the given instructions? I have created entry2_player helper function but I am looking for somebody that can verify if this is the correct responds to my given instructions below:

This expects a string entry, consisting of a name, space, and an int score.
When entry is "Sam 67", this function:
displays 'malloc() for "Sam 67" ...'
attempts malloc() for a Player:
if malloc() fails, the function displays: 'Failed! Returning NULL'
attempts to convert entry with *n = sscanf(...) to name and score of a
Player variable. If successful, (indicated by *n = 2) displays 'at address: 0x000....' and returns its address.
if entry is not valid, e.g. "Sam45", this function free the allocated memory,
and displays 'Invalid entry string! Returning NULL', and returns NULL.
REF: https://en.cppreference.com/w/c/io/fscanf

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>

// Room for a short name string in Player:
#define NAME_SIZE   10
// Incremental number of memory, in units of pointers, by which to increase
// size of Player pointer array:
#define MALLOC_INCR  5

typedef struct {
    char name[NAME_SIZE] ;
    int  score ;
} Player ;

Player * entry2_Player(char *entry, int *n) {
   char name[10];
   int score;

   printf("\nmalloc() for %s ...", entry);

   Player *pID = (Player *)malloc(sizeof(entry));
   if (pID == NULL){
   printf("Failed! Returning NULL");
   return NULL;
   }

   *n = sscanf(entry, "%s %d", name, &score);
   if (*n !=2){
      printf("Invalid entry string!");
      free(pID);
      return NULL;
   }
   else{
      printf("at address: 0x%p", &n);
      return pID;
      }
   }

In my main function I am required to:

Create a single Player variable, using entry2_Player() with the string "Robin 78" and
display it with show_Player(). Store the Player in the array from part 2. Add a fifth Player
to the array directly from entry2_Player(). Display the Player array with show_Players()

I am looking to see if my return variables in entry2_player are correct in order for me to continue with this next instructions.

A: First, what you're actually doing:
You allocate a block of memory of size of pointer to char. On current systems, this could be 8 bytes. Then you're trying to read two items from the input string entry into the (locally - stack - allocated) variables name and score. If that succeeds, you're returning the 'untouched' allocated block of memory.
What you probably want to do:
Allocate a block of memory of size Player. Without knowing the system specs, sizeof(Player) > sizeof(char*). Then you want to read two items from the input string entry into the fields name and score of the allocated Player object. And if that succeeds, you'll return the 'properly initialized' Player object.
Btw.
printf("at address: 0x%p", &n);

What do you want to present here? n is a pointer, that means it contains the address of an int. The above statement prints the address of the pointer.
I think, the following was the intention:
printf("at address: %p", pID); //%p prints the address in hex format, preceded by '0x'

sizeof entry == sizeof(char*) will not return the length of the string entry, but the number of bytes required to store a pointer to char.
strlen(entry) will give you the length of the string entry.

Based on the comment below, here the formal explanation:
Player * entry2_Player(char *entry, int *n)
{
    printf("\nmalloc() for %s ...", entry);

    //alloc Player object
    Player *pID = malloc(sizeof(Player));
    if (pID == NULL){
        printf("Failed! Returning NULL");
        return NULL;
    }

    //parse entry into the fields of pID
    *n = sscanf(entry, "%s %d", pID->name, &pID->score);
    if (*n !=2){
        printf("Invalid entry string!");
        free(pID);
        return NULL;
    } else {
        printf("at address: %p", pID); //address of allocated memory
        return pID;
    }
}


text:
Q: Get domain UserName for computer that not in domain I hope somebody could help me to solve my problem.
There is some domain, and some shared directory in that domain. User has domain username and password, to get access to that shared directory, but his computer is not in domain most of time. I mean, when he need to connect to that directory he is typing network path (for example "\\fileserver"), than windows asks for username and password, and after writing it he will get the access until restart windows or logout.
So my question is, how can i get domain user name that user uses to connect to network, by using C# code?
I tryed to use CredentialCache.GetCredential, but i think it works only if user connect to shared directory by using NetworkCredentials in C# program. If connection already was before C# program started, it will be empty.
I also tryed Environment.UserName, but since computer is not in domain, it returns only local user name, that different from domain username.
Sorry for my bad english, i hope you could understand my explanation.

A: Have you took a look at the nugget package CredentialManagement ?
I used it already, but couldn't roam credential saved with enterprise persistence
using CredentialManagement;

using (CredentialSet credentials = new CredentialSet())
{
    Debug.Print(credentials.Count.ToString() + " credential(s) found.");
    foreach (Credential credential in credentials)
    {
        Debug.Print(credential.Target); //This is domain/IP of the saved credential.
        Debug.Print(credential.Type.ToString());
        Debug.Print(credential.Username);
        Debug.Print(credential.PersistanceType.ToString());
        Debug.Print(credential.Description);
        Debug.Print(credential.LastWriteTime.ToString());
    }
    Debug.Print("End");
}


text:
Q: WCF web service works on localhost, but not on specific ip i have wcf webservice.It works  on localhost:55077 but when i try to communicate with a spesific ip like 192.168.1.103:80, it does not work... Here are some screen shots...Thanks all ...

A:
It works on localhost:55077

Is it hosted on IIS express ?
Per screenshot and port configured, looks you want to host on IIS server. Modify your endpoint address and host on local IIS.

A: Guys i found an answer :
You can change the ApplicationPoolIdentity from IIS7 -> Application Pools -> Advanced Settings. AdvancedSettings
Under ApplicationPoolIdentity you will find local system. This will make your application run under NT AUTHORITY\SYSTEM, which is an existing login for the database by default.


text:
Q: What do you call a subcategory of a subcategory What do you call a subcategory of a subcategory?
Is there any particular term that can be used or should I use any other words such as group, set, collection etc.?
Edit:
For Example if A is a category, B is a subcategory of A and C is a subcategory of B, what do you call C with respect to A?

A: Informally, a lot of people will use the word/phrase subsubcategory (or sub-sub-category).
I would advise against using it in formal writing (for formal writing use further subcategory as @Chenmunka suggested) but the meaning is completely clear and would not sound unnatural as it is used by many native speakers.

A: TL;DR: "Sub-subcategory" is not a thing.
In both language and taxonomy, there is no special word for the subcategory of another subcategory. There are several reasons for this.
For one, subcategory is a class of things, not a thing, itself. The prefix "sub-" indicates that all of the things in this class also belong to another, broader class of things. It does not infer how broad or narrow the parent class is.
So, grammatically, a subcategory of a subcategory is called... a subcategory.
If you have 15 levels of taxonomy, the 15th child category is still a subcategory. The 14th subcategory is both the child of the 13th subcategory and the parent of the 15th subcategory, and so on all the way up to the primary (or "main") category.
"Sub-sub-sub-(...)subcategory" is not only ugly, it literally makes no sense.
Which is perfect, because the more subcategories you make, the more confusing and bloated your taxonomy will be.
This is called diffuseness, and it defeats the point of categorising: to make sense of things.
So, if you can avoid more than two or three layers of category (primary/main category > parent subcategory > child subcategory), then you should.
It just makes sense.

A: The phrase further subcategory is often used.
This suggests that the process of categorisation is being taken further, to a subcategory within the outer subcategory.

A: I suggest a diagram. Language can only take you so far before it becomes unclear. If you have to describe it in words, use "set" rather than "category".

A: What about: Subordinate Category, Secondary Category, Complementary Category, I think these words could be more meaningful than using sub-category of subcategory.

A: Category - Sub Category - Child Category


text:
Q: Is there a simple way to get scaled unix timestamp in C++ I'm porting some PHP to C++. Some of our database code stores time values as unix time stamps *100
The php contains code that looks a bit like this.
//PHP
static function getTickTime()
{
   return round(microtime(true)*100);
}

I need something like this:
//C++
uint64_t getTickTime()
{
   ptime Jan1st1970(date(1970, 1, 1));
   ptime Now = microsecond_clock::local_time();
   time_duration diff = Now - Jan1st1970;
   return static_cast<uint64_t>(diff.total_seconds()*100);
}

Is something like this sensible? Is there a neater solution?
Is there something nasty in this code that I can't see? (Guess I'm not experienced enough with boost::date_time to know these things)

A: The neatest and most portable solution is to use the time() function, defined in <ctime>, which returns the number of seconds since the Unix epoch.
If you do use boost, you'll want universal_time(), not local_time(), since the epoch is specified in UTC.

A: The solution suggested by dauphic can be modified to something like this
uint64_t getTickTime()
{
  timeval tim;
  gettimeofday(&tim, NULL);
  return tim.tv_sec*100 + tim.tv_usec/10000;
}

I cant think of a neater solution than that.

A: Assuming you're on Unix, include <sys/time.h>
timeval tim;
gettimeofday(&tim, NULL);
return tim.tv_usec;

If on Windows, there's no good way to get microsecond resolution, especially because it uses a different epoch. This sample requires only <windows.h> I believe.
FILETIME tim;
GetSystemTimeAsFileTime(&tim);
ULARGE_INTEGER ms;
ms.LowPart = tim.dwLowDateTime;
ms.HighPart = tim.dwHighDateTime;
return ms.QuadPart * 10 + <nanoseconds from January 1, 1609 to January 1, 1970>; // ms represents how many 100s of nanoseconds


text:
Q: Need help in SMTP lib function The function is being imported using the port number 547 and the gmail is open to less secure applications but while running I get a connection error:

TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

Code:
smtp_server='smtp.gmail.com'
port = 467
frm=input("Enter the sender's email address:   ")
toa=input("Enter the receiver's email address:   ")
msg="Here is a sample of the above converted csv file sent to the gmail"
pssw=input("Enter the password: ")
attach=('Airline_Record.csv')
context = ssl.create_default_context()
with smtplib.SMTP_SSL(smtp_server, port, context=context):
    server.login(frm,pssw)
    server.sendmail(frm, toa, msg, attach)
    print('Mail sent')

A: The SMTP over SSL/TTL protocol was assigned the TCP port number 465. Not 467.

A: still no output.
   smtp_server='smtp.gmail.com'
   port = 465
   frm=input("Enter the sender's email address:   ")
   toa=input("Enter the receiver's email address:   ")
   msg="Here is a sample of the above converted csv file sent to the gmail"
   pssw=input("Enter the password: ")
   attach=('Airline_Record.csv')
   context = ssl.create_default_context()

   with smtplib.SMTP_SSL(smtp_server, port, context=context) as server:
       server.login(frm,pssw)
       server.sendmail(frm, toa, msg, attach)
       print('Mail sent')'


text:
Q: Azure Policy enforce only for new resources I am creating an Azure policy to enforce some naming conventions. I want to enforce this policy only for any new resources being created.  I am planning to use Deny as an Effect.
Will the Deny effect block the existing resources being re-provisioned?
Is there any way to implement this without impacting the re-provisioning of old resources?  As per the document here, it says updating will be prohibited.

A: As mentioned in the link that you provided the policy is applied "When creating or updating a matched resource".
However, you can enforce a policy per resource group.
So, if you have the possiblity to have all the existing resources in one resource group and all the new resources in a second resource group. Then you can get around it by applying the policy only to the second resource group.


text: Q: WEKA SMOreg classifier significance testing I am using the SMOreg classifier in WEKA to determine if there is a predictive relationship between one variable and several other variables.  I am using 10-fold cross-validation to get my results.  My teacher wants me to find the confidence of my findings, but this confuses me because I didn't think that this was possible.  How does one test for significance using the SMOreg classifier in WEKA?


text:
Q: source_dirs doesn't work in .gpr scipt I've inherited an Ada/C++ project and I'm trying to use gprbuild to automate the build process (which was previously done with a set of about 12 .bat files).  I'm totally new to Ada and gprbuild, but have actually made pretty good progress.  I can compile the .exe's that I need, but not the library.  I am not at liberty to completely share the .gpr file, but the relevant parts look like this:
[snip]
for Source_Dirs use (
                    "c_plus_plus_files",
                    "ada_files",
                    "..\another_project\some_other_ada_files",
                    "..\another_project\even_more_ada_files"
                    );
[snip]
for Source_Files use (
   "my_ada_file.ads",
   "another_ada_file.ads",
   "one_more_ada_file.adb",
   "c_plus_plus_file.cpp"
    );
[snip]

When I run "gprbuild -P my_project.gpr" it in turn runs "gcc -c gnat5 one_more_ada_file.adb" and complains that it cannot find a certain file that one_more_ada_file.adb depends on.  The dependency is in ..\another_project\even_more_ada_files, so I would expect it to be found.  But if I copy the dependency into the same folder as one_more_ada_file.adb, the error goes away.
Because of how the VCS is setup and how we're sharing code between two projects, I'd much rather figure out what's wrong with how I'm using "for source_dirs use" than to keep multiple copies of all the ada files.
Again, I'm an Ada/GPS newb, so if I'm leaving out relevant information, please let me know.
Update: It appears that the specific problem isn't that source_dirs isn't doing anything at all, but that it doesn't handle having two source dirs where .ads files in one dir depend on .ads files in the other.  That is, even within my "other" project above, an .ads file in some_other_ada_files that depends on an .ads file in even_more_ada_files doesn't get compiled with the gcc -c -gnat05 command when I run gprbuild (error: the file in even_more_ada_files not found), but it does get compiled if I run the gcc command by hand (or in a .bat script) with two -I flags, one for each directory.

A: When dealing with multiple projects, you should normally create a .gpr-file for each project, and let your projects depend on the other projects as needed.
Thus:
project another_project is
   for Source_Dirs use
      ("some_other_ada_files",
       "even_more_ada_files");
end another_project;

and then:
with "..\another_project\another_project.gpr"

project The_Project is
   for Source_Dirs use
      ("c_plus_plus_files",
       "ada_files");
end The_Project;


text:
Q: Do neutrinos absorb light? I have been reading about neutrinos lately. One thing that I found amazing about these, is that their detection is not so easy.
My question here is, do neutrinos absorb light?

A: Since they are uncharged they cannot interact with photons. In the standard model photons can only couple to charged elementary particles or charged gauge bosons, e.g  charged leptons such as electrons, quarks such as up, down and charged gauge bosons such as W+. Since they cannot couple to photons, they cannot absorb light. Hope this helps.

A: One reason why neutrinos are so hard to detect is that they have no electromagnetic charge so they don't feel the electromagnetic force. This means that they don't absorb light or interact with photons in any way.
There are other particles with no charge - the most common is the neutron. But the neutron feels the strong force. If it gets close enough to a nucleus it will interact with the other neutrons and protons in that nucleus via the strong force. The by-products of this interaction will probably include charged particles such as electrons or alpha particles, or indeed photons, and all of these we can detect quite easily.
Unlike the neutron, the neutrino does not feel the strong force. Apart from gravity (which is insignificant at the atomic scale) it can only interact with other particles via the weak force. As its name suggests, weak force interactions are very rare. So a neutrino hardly ever interacts with other particles, which makes it very hard to detect.


text:
Q: Manually install wordpress locally on windows 10 problem I'm new to wordpress. I try to install wordpress on windows 10 with Mysql8.0, PHP8.1.0, Apache24 and wordpress5.8.2. At first, the installation process is stuck in creating wp-config.php with the error "PHP Fatal error:  Uncaught mysqli_sql_exception: Unknown column 'wp_' in 'field list' in". The wp-config.php is created when i comment the lines 317 to 322 in wp-admin\setup-config.php. I continue to install the wordpress. The next error is:
PHP Fatal error:  Uncaught mysqli_sql_exception: Table 'wordpress.qlj_options' doesn't exist in D:\Program Files\Apache24\htdocs\wordpress\wp-includes\wp-db.php:2056
Stack trace:
#0 D:\Program Files\Apache24\htdocs\wordpress\wp-includes\wp-db.php(2056): mysqli_query(Object(mysqli), 'SELECT option_v...')
#1 D:\Program Files\Apache24\htdocs\wordpress\wp-includes\wp-db.php(1945): wpdb->_do_query('SELECT option_v...')
#2 D:\Program Files\Apache24\htdocs\wordpress\wp-includes\wp-db.php(2581): wpdb->query('SELECT option_v...')
#3 D:\Program Files\Apache24\htdocs\wordpress\wp-includes\functions.php(1734): wpdb->get_var('SELECT option_v...')
#4 D:\Program Files\Apache24\htdocs\wordpress\wp-includes\load.php(752): is_blog_installed()
#5 D:\Program Files\Apache24\htdocs\wordpress\wp-settings.php(159): wp_not_installed()
#6 D:\Program Files\Apache24\htdocs\wordpress\wp-config.php(97): require_once('D:\\Program File...')
#7 D:\Program Files\Apache24\htdocs\wordpress\wp-load.php(50): require_once('D:\\Program File...')
#8 D:\Program Files\Apache24\htdocs\wordpress\wp-admin\install.php(36): require_once('D:\\Program File...')
#9 {main}
  thrown in D:\Program Files\Apache24\htdocs\wordpress\wp-includes\wp-db.php on line 2056

It seems to require database before creating it. I think this error is the same with the first.
Can anyone please help?

A: I am so excited that i installed the wordpress. Here is what i did. First, I manually created all the default tables that wordpress needs in database(you can find the sql in wp-admin/includes/schema.php), then i tried to repair the database using url wp-admin/maint/repair.php. It showed so many deprecated errors and warnings of PHP. So i thought maybe the version of PHP is not right. I tried to use PHP-7.4.27 instead of PHP8 and deleted all the tables created before. Then everything just done.
My English is not very good. I hope you can understand what i'm saying.
enter image description here


text:
Q: ImageMagick problem on Windows 10 with Windows 2 error code I want to make a python script to create a video with moviepy but I have some problems with windows. I tried installing ImageMagick but can not find a convert.exe I do not know why it is. But I am already stuck.
my code:
import moviepy.editor as mp
import os

print("Start")
def create_vertical_video(image_file, music_file, quote):
    # Open image and resize to 9:16 aspect ratio (vertical video)
    if not os.path.isfile(image_file):
        raise ValueError(f"{image_file} is not a valid file path")
    image = mp.ImageClip(image_file).resize(height=1080)

    # Open music file and set to fit the duration of the image
    if not os.path.isfile(music_file):
        raise ValueError(f"{music_file} is not a valid file path")
    music = mp.AudioFileClip(music_file)
    music = music.set_duration(image.duration)

    # Split quote into multiple lines if necessary
    MAX_CHARS_PER_LINE = 25
    lines = []
    current_line = ""
    for word in quote.split():
        if len(current_line) + len(word) <= MAX_CHARS_PER_LINE:
            current_line += word + " "
        else:
            lines.append(current_line.strip())
            current_line = word + " "
    lines.append(current_line.strip())

    # Create text clip for each line
    text_clips = [mp.TextClip(line, fontsize=24, color='white', bg_color='black')
                  .set_pos('center').set_duration(image.duration)
                  for line in lines]

    # Overlay text clips on image
    text_overlay = mp.concatenate_videoclips(text_clips, method='compose')
    final_clip = mp.CompositeVideoClip([image, text_overlay])

    # Add music to final clip
    final_clip = final_clip.set_audio(music)

    # Save video
    final_clip.write_videofile("vertical_video.mp4", fps=24)

create_vertical_video("nature.jpg","music.mp3","Don't be pushed around by the fears in your mind. Be led by the dreams in your heart.")

my error:
[WinError 2] The system cannot find the file specified.

.This error can be due to the fact that ImageMagick is not installed on your computer, or (for Windows users) that you didn't specify the path to the ImageMagick binary in file conf.py, or that the path you specified is incorrect`

A: In ImageMagick v7, the convert.exe program is replaced by magick.exe.
So if your Python script is looking for convert.exe, you must click "Install legacy commands" when installing ImageMagick.


text:
Q: Cordova/PhoneGap - Do apps require internet? I need to develop a phone app that does NOT require internet access to run.
Sorry, I know this is a completely bone head question to ask but NONE of the frameworks I'm looking at seem to clearly state this. Do apps created with this framework require internet for them to work? I think the correct term is "are they native?" but I'm self taught and don't always know my terminology.
Thanks.

A: You can definitely use Cordova/PhoneGap to build an app that works without Internet access.
Apps built with Cordova/PhoneGap are hybrid apps. Think of Cordova/PhoneGap as a technology that gives you a container which lets you build an app using the universal web-based HTML, CSS JavaScript instead of having to code in platform specific APIs.
It's just like a browser but with access to device hardware such as camera, storage, location, etc...
And with services like PhoneGap Build (https://build.phonegap.com/), they will build the app for you, so you don't even need Xcode or Android SDK toolchains.
The app, the end result, that container... is in essence exposing some sort of a connector between the device (the smartphone, tablet, etc...) and your HTML, CSS and JavaScript.


text:
Q: Getting GLib warning on passing struct as arg to G_CALLBACK I am trying to pass a pointer to struct as argument to callback function, but I'm getting this error
(gtk:11156): GLib-GObject-WARNING **: 22:34:21.308: invalid cast from 'GtkEntry' to 'GtkApplication'
(gtk:11156): Gtk-CRITICAL **: 22:34:21.308: gtk_application_window_new: assertion 'GTK_IS_APPLICATION (application)' failed
when executing this code
Appnfile *argptr = (Appnfile*)data;
GtkWidget *window2 = gtk_application_window_new(GTK_APPLICATION(argptr->app1));  //this line has the error

Prototype of the callback function is
static void second_win(GtkEntry *entry, gpointer data);
Declaration of struct and g_signal_connect line are
Appnfile arg;
arg.app1=app;
arg.buff=buffer;
g_signal_connect(name, "activate",G_CALLBACK(second_win),&arg);

Definition of struct is
typedef struct {
    GApplication *app1;
    GtkEntryBuffer *buff;
} Appnfile;

Link to the program is
here
The code worked fine when I passed app as data on a g_signal_connect_swapped function. But on passing the same variable as a struct element I'm getting this warning.

A: Alexander Dmitriev has it right. You're trying to use arg in second_win, but as arg is a struct allocated on the stack, as soon as you return from that function, it ceases to exists. There are two solutions to have arg live long enough:

*

*allocate it on the heap (with malloc, or g_malloc/g_new/g_new0)

*allocate it on the stack in a function you will return from only when arg is no more used

Here's a patch that uses the second solution. You may save it in arg.patch and apply it with git am arg.patch:
From 6c0679485cde31c55c58aa5f54f0a60d4c874d71 Mon Sep 17 00:00:00 2001
From: Luis Menina <liberforce@freeside.fr>
Date: Wed, 27 Feb 2019 10:41:58 +0100
Subject: [PATCH] Create argument list where it will live long enough to be
 accessed

Declaring it on the stack inside a callback will make it be destroyed
when you exit the callback. By declaring it in the stack, in the main
you are sure that the structure has the same lifespan as your
application.
---
 prog_c/gtk_pr_a.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/prog_c/gtk_pr_a.c b/prog_c/gtk_pr_a.c
index fb3b5a2..d11ba7d 100644
--- a/prog_c/gtk_pr_a.c
+++ b/prog_c/gtk_pr_a.c
@@ -80,6 +80,7 @@ static void first_win(GApplication *app, gpointer data){
     GObject *window, *name;
     GError *error =NULL;
     GtkEntryBuffer *buffer;
+    Appnfile *arg = data;

     builder= gtk_builder_new();
     if(gtk_builder_add_from_file( builder, "pr1.ui",&error)==0){
@@ -97,10 +98,9 @@ static void first_win(GApplication *app, gpointer data){
     gtk_widget_show_all(GTK_WIDGET(window));
     g_signal_connect( name, "activate", G_CALLBACK(search_user),buffer);

-    Appnfile arg;
-    arg.app1=app;
-    arg.buff=buffer;
-    g_signal_connect(name, "activate",G_CALLBACK(second_win),&arg);
+    arg->app1=app;
+    arg->buff=buffer;
+    g_signal_connect(name, "activate",G_CALLBACK(second_win), arg);
     g_signal_connect_swapped( name, "activate", G_CALLBACK(gtk_window_close),window);
     g_object_unref(window);
 }
@@ -117,7 +117,10 @@ static void first_win(GApplication *app, gpointer data){
 int main(int argc, char *argv[]){
     GtkApplication *app = gtk_application_new("org.my.app",
                         G_APPLICATION_FLAGS_NONE);
-    g_signal_connect(app, "activate", G_CALLBACK(first_win),NULL);
+    Appnfile arg;
+    memset(&arg, 0, sizeof(arg));
+
+    g_signal_connect(app, "activate", G_CALLBACK(first_win), &arg);
     //g_signal_connect(app, "2win",G_CALLBACK(second_win),NULL);
     int status =g_application_run(G_APPLICATION(app),argc, argv);
     g_object_unref(app);
--
2.17.1


text:
Q: textbox/form saved and reloaded I have a question about textboxes or forms. I don't have any experience with them.
I would like to have a textbox/form where the user can type/copy text too.
There should be a save button and the saved text should be loaded and be editable again.
This isn't an internet application, so I don't need to specify a database of users.
Searching the web got me a lot of partial asp/.net/php solutions. I don't really know much of these.
My question is, would this be possible? And where should I start?
Thanx

A: I would use PHP for this, if you're unfamiliar there are some great learning resources at W3 Schools PHP tutuorial as well as the documentation at PHP.net you'll want to write an HTML form that submits to a php script. In  this script you can save text to a  file using the fwrite() function and load saved text using fopen(). Definitely have a look  through the w3 Schools php guide if you're new to this.


text:
Q: Why are all videos jerky on an Intel 845G graphics controller in 12.04? Currently I am using Lubuntu 12.04 desktop installed on my PC. When I play videos, the videos are really slow. It skips frames
I have following PCI devices installed on the system
Host bridge  : Intel Corporation 82845G/GL[Brookdale-G]/GE/PE DRAM Controller/Host-Hub Interface (rev 03)
VGA compatible controller : Intel Corporation 82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device (rev 03) (prog-if 00 [VGA controller])
xserver-xorg-video-intel and mesa-utils packages are installed. Direct rendering is enabled. It really doesn't matter if it is enabled or not, both the times the videos are slow almost similarly.
While looking for a solution I found a page on intel drivers http://manpages.ubuntu.com/manpages/precise/man4/intel.4.html which deals with Intel graphics drivers.
Is there any way changing the VideoRam to higher value can be helpful? Currently AGP Memory is 128 MB and from the above manpage VideoRam will be set to 8M if AGP >=128MB. 82845G has a AGP memory of 128MB. Is there anyway I can increase VideoRam? I have tried ubuntu with AGP Memory 256MB, where videoRam will be set to 24MB by default, the HD videos are also playing smoothly even though the processor is Intel Celron 1.6Ghz.
Is there anything I can do to increase videoram size? or is this because of something else?

A commentor asked me to attach outputs of dmesg, lsmod, lshw and /var/log/kern.log. Here is the output of those commands http://paste.ubuntu.com/1071664/

A:
Note that the VideoRam setting you mention is only necessary/honored for the i810/815 chipsets; for newer ones, including your i845G, the manpage says:
For the 830M and later, the driver will automatically size  its  memory
allocation  according  to the features it will support.  Therefore, the
VideoRam option, which in the past had been  necessary  to  allow  more
than some small amount of memory to be allocated, is now ignored.

Is there anything I can do to increase videoram size?

Yes, you should be able to increase the AGP aperture size ("graphics memory") in your BIOS (at computer start-up) from 128MB to a larger size. In my experience, that often helps video playback on these old integrated graphics systems.


text:
Q: Adjust Firestore cache size with AngularFire I'm trying to figure out the best way to enable Firestore persistence and adjust the cache size using AngularFire.
Firebase documentation suggest we do it like this:
firebase.firestore().settings({
     cacheSizeBytes: firebase.firestore.CACHE_SIZE_UNLIMITED
});

AngularFire does not mention adjusting such settings, but digging into the code it looks like you can pass an object of type "firebase.firestore.PersistanceSettings" in as such:
AngularFirestoreModule.enablePersistence({
      experimentalForceOwningTab: true,
      synchronizeTabs: true,
}),

However, those are the only two properties allowed in the PersistanceSettings type.
I tried creating a constructor in app.module.ts and doing things according to the Firebase documentation but I'm not even sure if it is working.
export class AppModule {
  constructor() {
    firebase.firestore().settings({
      cacheSizeBytes: firebase.firestore.CACHE_SIZE_UNLIMITED,
    });
  }
}

How do I check what the cache size settings are at run time? Am I doing it right?

A: CACHE_SIZE_UNLIMITED is -1, to be set preferably in app.module.ts:
const settings: firebase.firestore.Settings = {
  cacheSizeBytes: firebase.firestore.CACHE_SIZE_UNLIMITED
};
firebase.firestore().settings(settings);

There doesn't seem to be a method to read the settings... cacheSizeBytes is already known.And one probably cannot change the value of cacheSizeBytes either, once having connected.

A: Searching around the AngularFire documentation, I found their document related to offline storage. It explains how to enable file persistence in your app and also that you can test whether a document is retrieved from cache or Firestore using the fromCache property.

To check whether you are receiving data from the server or the cache, use the fromCache property on the SnapshotMetadata in your snapshot event. If fromCache is true, the data came from the cache and might be stale or incomplete. If fromCache is false, the data is complete and current with the latest updates on the server.

As for setting the cache size for Firestore, it appears that the only way is what you have been trying and it is a variable set in the Firestore instance properties. Here are full samples from the documentation related to setting the cache size and enabling persistence.

A: I was having the same issue but found a way of setting it on GitHub.
import { AngularFirestoreModule, SETTINGS } from '@angular/fire/firestore';

@NgModule({
  imports: [
    AngularFirestoreModule,
    AngularFireAuthModule,
    AngularFireStorageModule,
    AngularFireModule.initializeApp(environment.firebase),
 ],
 providers: [
 {
   provide: SETTINGS,
   useValue: { ignoreUndefinedProperties: true, cacheSizeBytes: 1048576 },
 };
]


text:
Q: Mean of root-sum-square of Suppose that I have several normally-distributed random variables xi, each with its own different variance.  All x's are zero-mean and independent.  If y is the root-sum-square of the xi's, how do I find the mean of y?

A: This will involve application of the Law of the Unconscious Statistician here?  We know that $X_{i} \overset{id}{\thicksim} N(0,\sigma_{i}^{2})$ for $i=1,2,3,...,n$, so the joint probability density function of $X_1, X_2,...X_n$ is given by:
\begin{eqnarray*}
f_{X_{1},X_{2},...,X_{n}}(x_{,1},x_{,2},...x_{,n}) & = & \prod_{i=1}^{n}f_{X_{i}}(x_{i})\\
 & = & \left(\frac{1}{\sqrt{2\pi}}\right)^{n}\prod_{i=1}^{n}\frac{1}{\sigma_{i}}e^{-\frac{x_{i}^{2}}{2\sigma_{i}^{2}}}
\end{eqnarray*}
And by the Law of the Unconscious Statistician, if we set $Y=h(x_{1},x_{2},...,x_{n})=\sqrt{\sum_{i=1}^{n}x_{i}^{2}}$,
then:
\begin{eqnarray*}
E(Y) & = & \int_{-\infty}^{\infty}\int_{-\infty}^{\infty}\cdots\int_{-\infty}^{\infty}h(x_{1},x_{2},...,x_{n})\left(\frac{1}{\sqrt{2\pi}}\right)^{n}\prod_{i=1}^{n}\frac{1}{\sigma_{i}}e^{-\frac{x_{i}^{2}}{2\sigma_{i}^{2}}}dx_{1}dx_{2}\cdots dx_{n}\\
 & = & \left(\frac{1}{\sqrt{2\pi}}\right)^{n}\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}\cdots\int_{-\infty}^{\infty}\sqrt{\sum_{i=1}^{n}x_{i}^{2}}\prod_{i=1}^{n}\frac{1}{\sigma_{i}}e^{-\frac{x_{i}^{2}}{2\sigma_{i}^{2}}}dx_{1}dx_{2}\cdots dx_{n}
\end{eqnarray*}


text:
Q: Lighting App Builder Throw Error Component XXX has an invalid value for property XXX I create an Aura Component "PreviewPage", in this component I call a Visualforce Page in it. I create this component like this video on Youtube: https://www.youtube.com/watch?v=kr4mHEA5dUw, I found I will meet Salesforce Error: Component 'PreviewPage' has an invalid value for property 'PreviewPage'.
Repro Steps:

*

*In org, create two admin users: A and B.

*Admin A in Lead RecordPage then click Edit Page.

*Add 12 "PreviewPage" components.

*Click save and active it.

*Logout User A, use User B login.

*Setup -> Lightning App Builder Find previous RecordPage and click "edit" link.

*Drag a "PreviewPage" components.

*Click Save.

*Throw Salesforce Error: Component 'PreviewPage' has an invalid value for property 'PreviewPage'.

My AuraComponent Code as follow
<aura:component implements="force:appHostable,force:hasRecordId,flexipage:availableForAllPageTypes,forceCommunity:availableForAllPageTypes" controller="PreviewPageController" access="global">
    <aura:attribute access="global" name="previewPage" type="String" />
    <aura:attribute access="global" name="height" type="Integer" />
    <aura:attribute name='url' type="String"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    <lightning:workspaceAPI aura:id="workspace" />
    <iframe src="{!v.url}" width="100%" height="{!v.height + 'px;'}" frameBorder="0" />
</aura:component>

compenent design metadata
<design:component>
    <design:attribute name="previewPage" label="PreviewPage" datasource="apex://PreviewPageList" />
    <design:attribute name="height" label="Height (in pixels)" min="300" max="60000" default="600" />
</design:component>

PreviewPageList source code
global class PreviewPageList extends VisualEditor.DynamicPickList{
global override VisualEditor.DataRow getDefaultValue(){
    String queryStr = 'SELECT Id,Name FROM PreviewPage__c LIMIT 1';
    List<PreviewPage__c> previewPages = Database.query(queryStr);
    VisualEditor.DataRow defaultValue;
    if(previewPages.size() > 0){
        String recordId = String.valueOf(previewPages[0].Id);
        String name = String.valueOf(previewPages[0].Name);
        defaultValue = new VisualEditor.DataRow(name, recordId);
    } else {
        defaultValue = new VisualEditor.DataRow('None', '');
    }
    return defaultValue;
}
global override VisualEditor.DynamicPickListRows getValues() {
    String queryStr = 'SELECT Id,Name FROM PreviewPage__c';
    List<PreviewPage__c> previewPages = Database.query(queryStr);
    VisualEditor.DynamicPickListRows allValues = new VisualEditor.DynamicPickListRows();
    if(previewPages.size() <= 0) {
        allValues.addRow(new VisualEditor.DataRow('None', ''));
        return allValues;
    }
    for(PreviewPage__c page: previewPages){
        String recordId = String.valueOf(page.Id);
        String name = String.valueOf(page.Name);
        allValues.addRow(new VisualEditor.DataRow(name, recordId));
    }
    return allValues;
}

}
I also check this issue Receiving error "Component has an invalid value for property." on App Builder because we meet same error message.
After I change
    String queryStr = 'SELECT Id,Name FROM PreviewPage__c';
    List<PreviewPage__c> previewPages = Database.query(queryStr);

to
List<PreviewPage__c> previewPages = [SELECT Id,Name FROM PreviewPage__c];

this issue resolved.
So I have follow question want to know:

*

*Is there any document in Salesforce tell about can not use
database.query in DynamicPickList class?

*If I do not change login in user to User B, I can not reproduce this
issue. I want to know why after changed login user this
database.query broken? As far as I know they both admin and has same
permission set and profile.


text:
Q: Arabic full text search in RoR I am trying to add full text search capabilities to my RoR app, but facing some issues when it comes to Arabic. AFAIK, there aren't many search engines out there that support arabic stemming, morphology and other advanced full text search. The only thing I found was Lucene with the AraMorph tokenizer.
The acts_as_solr plugin (solr is based on lucene, and this plugin integrates it with Rails) seems to be abandoned, and I can't find any helpful documentation.
I've looked into sphinx, xapian, ferret, and acts_as_searchable but none of them offers advanced arabic search functionality to the best of my knowledge.
Any help would be really appreciated
== Update
I've got suggestions to use sphinx, and I did use it on an earlier project, and it works just fine. However, it does not provide any advanced search capabilities.
for instance, the words: كتاب (book), مكتبة (library), and كاتب (writer) are all derived from the same stem كتب. I want to have the ability to search for "writer" and get results for all words derived from the same stem.
Also, I want the search to take into account common arabic dictation styles. Some use the "hamza" (همزة) and some people don't. Others write words with the letter "taa marboota" (التاء المربوطة) while others use the letter "haa" (الهاء). A good arabic search engine should realize such subtle differences and look for them.
With sphinx you only get what you search for, and the only engine I found to accommodate such matters in the arabic language, was Lucene with AraMorph tokenizer. However, acts_as_solr (the lucene plugin for rails) is abandoned . So my question is: is there any other such tokenizer for any search engine?
KandadaBoggu mentioned sunspot, I'll give that a go, and respond back

A: For Solr use Sunspot and Sunspot Rails.
For Sphinx use Thinking Sphinx
Both gems are excellent and have a large install base. I have used ThinkingSphinx in few projects and I highly recommend it.

A: You should try this by extending Thinking Sphinx options
Read this: http://www.expressionlab.com/2008/11/19/thinking-sphinx-in-arabic-unicode


text:
Q: Check if all keys are present in Map Let there is a map config: Map[String, String].
And there are several keys: "foo", "bar", ...
I need to make sure that all keys are present in config. And if they are present, I need to call a function with values for these keys in the config map:
fun(config("foo"), config("bar"), config(...), ...)

The following is a solution:
val res = Option.when(config.contains("foo") & config.contains("bar") & config.contains(...) & ...)
    ( fun(config("foo"), config("bar"), config(...), ...) )

Or maybe:
val set = Set("foo", "bar", ...)
val res = Option.when(config.view.filterKeys(set).size == set.size)
    ( fun(config("foo"), config("bar"), config(...), ...) )

Both approaches look ugly and ineffective. Is there more concise way to implement the same behavior?

A: Since the set of keys is static, you do not need to do anything too complex.
You just need to attempt to get each key and if all are in call the function and wrap the result in a Some, if not then return a None.
for {
  value1 <- config.get("key1")
  // ...
  valueN <- config.get("keyN")
} yield fun(value1, ..., valueN)

If you have cats, you can do it like.
(
  config.get("key1"),
  // ...
  config.get("keyN")
).mapN(fun(_).tupled)

A: Consider forall in combination with contains
val requiredKeys = List("foo", "bar")

if (requiredKeys forall config.contains) {
  // work with config
} else {
  // handler error
}

or based on Tom Crockett consider keySet approach
val requiredKeys = Set("foo", "bar")

if (requiredKeys subsetOf config.keySet) {
  // work with config
} else {
  // handler error
}

A: if you have your keys as ("foo", "bar", ...).map(config) returns the values, right? then if it contains a None, then not all keys are found. I would start to think along this idea.
Passing elements of a List as parameters to a function with variable arguments helps here, so val args = list.map(config);
then the condition to check if all values are present, and finally
fun(args:_*).
how about that?

A: This is using cats, a very common FP library:
import cats.implicits._

def fun(a: String, b: String, c: String): MyConfigClass = ???

val parsedOpt: Option[MyConfigClass] =
  (config.get("a"), config.get("b"), config.get("c"))
  .mapN(fun)

The mapN method does what you want, it will extact all values if they exist and provide them to fun. For the curious, it relies on the fact that Option is an Applicative.
To show its power, you could also get back a list of missing keys, to know where the issue was:
import cats.data._
def getConfig(key: String): Either[NonEmptyList[String], String] =
config.get(key).toRightNel(s"Key $key not found")

val parsedValidated: Either[NonEmptyList[String], MyConfigClass] =
  (getConfig("a"), getConfig("b"), getConfig("c"))
 .parMapN(fun)

A: The following is a flatMap way:
config.get("key1").flatMap(key1 =>
config.get("key2").flatMap(key2 =>
...
config.get("keyN").flatMap(keyN =>
fun(key1, key2, ..., keyN)
))...)


text:
Q: Why do we need a minimum voltage here? Let's assume we have a circuit like this: (Us should be monopolar but I didn't find something like that).

simulate this circuit – Schematic created using CircuitLab
Negative half wave: D2 is active -> output voltage = -0.7V
positive half wave: D1 is active -> output voltage = ?
Well.. I know that we have 5.7V output here but my problem is that I don't get why we need 5.7V at least here by Uin. I would assume that as we have a source here we don't need any other input. So our U in only controls which output gets active.

A: This looks like an input protection circuit. The diodes prevent the voltage at \$V_{OUT}\$ from being higher than \$V_{DD}+0.7V\$ or being lower than \$-0.7V\$. The resistor is there to limit the current passing through the diodes.


text:
Q: Need matching opening and closed brackets in regular expression with dynamic value in between We have a requirement to enter values like this in a textbox:
((1 OR 2) AND (3)) or (1 AND (2 or 3 AND 4))

The numbers 1,2 and `3 are dynamic in nature based on the number of rows in a grid.
There are three validations that we want to accomplish.

*

*restrict the numbers entered which will be based on the number of rows in a grid;

*should only allow AND and OR text;

*parenthesis should be well formed;

Preferably we need the regular expression in JavaScript so that it can be changed during run time.

A: this pattern (\((?:([1-4]|\s|and|or)|(?1))+\))|(?2) when replaced with nothing should eat up every thing if your text box is valid and leave you with something if it is not.
Demo
Desclaimer:
it will not validate something like ((1 OR 2) AND (3)) or (1 AND (2 or 3 AND )) where the last AND is not followed by an argument, it only checks for balanced brackets.


text:
Q: The method 'fromSnapshot' isn't defined for the type 'Patient' dart flutter trying to load data from firebase to a data table
i got this error :

The method 'fromSnapshot' isn't defined for the type 'Patient'.

This is the function where i have this problem , it show on 'fromSnapshot'
Future loadMoreDataFromStream() async {
    final stream = collection.snapshots();

    stream.listen((snapShot) async {
      await Future.forEach(snapShot.docs, (DocumentSnapshot element) {
        final Patient data = Patient.fromSnapshot(element);
        if (!patients
            .any((element) => element.name == data.name)) {
          patients.add(data);
          addDataGridRow(data);
        }
      });

      updateDataGridDataSource();
    });
  }

and this is the class Patient that I call
class Patient{
  String? name ;
  String? pass ;
  String? image ;
  String? genre ;
  DateTime? birth ;
Patient(this.name, this.pass, this.genre,this.birth,{this.reference});
DocumentReference? reference;
static fromSnapshot(DocumentSnapshot snapshot) {
    Patient _newPatient = Patient.fromJson(snapshot.data()! as Map<String, dynamic>);
    _newPatient.reference = snapshot.reference;
    return _newPatient;}
factory Patient.fromJson(Map<String, dynamic> data) =>
      Patient(
          data['name'],
          data['pass'],
          data['birth'],
          data['genre'],);
Map<String, dynamic> toJson() => _patientToJson(this);
@override
String toString() => 'name $name';
Patient _patientFromJson(Map<String, dynamic> json) {
  return Patient(
    json['name'],
    json['pass'],
    json['birth'],
    json['genre'],
  );}
Map<String, dynamic> _patientToJson(Patient instance) {
  return {
    'name' : instance.name,
    'pass': instance.pass,
    'birth': instance.birth,
    'genre': instance.genre,
  };}}

A: Try adding a method instead:
static Patient fromSnapshot(DocumentSnapshot snapshot) {
    Patient _newPatient = Patient.fromJson(snapshot.data()! as Map<String, dynamic>);
    _newPatient.reference = snapshot.reference;
    return _newPatient;
}

A: Make sure your class looks something like this:
class Patient {
  String id = 'id'; //Add any other variable you want.

  Patient();

  factory Patient.fromSnapshot(DocumentSnapshot snapshot) {
    Patient newPatient = Patient.fromJson(snapshot.data()! as Map<String, dynamic>);
    newPatient.reference = snapshot.reference;
    return newPatient;
  }

}

Or this:
class Patient {
  String id; //Add any other variable you want.

  Patient({required this.id});

  factory Patient.fromSnapshot(DocumentSnapshot snapshot) {
    Patient newPatient = Patient.fromJson(snapshot.data()! as Map<String, dynamic>);
    newPatient.reference = snapshot.reference;
    return newPatient;
  }

}


text:
Q: Proving that any well behaved function f(x) can be presented as Gauss-Hermite series. I've successfully shown that Legendre polynomials are an orthonormal basis for functions.  However, I'm wondering how to proof that all functions f(x) can be written in the form (Gauss-Hermite series):

where $a$ are constants are $e$ are the Legendre polynomials.

A: Firstly note that $\psi_n (x) = \frac{1}{\sqrt{2^n n!}} \frac{1}{\sqrt[4]{\pi}} e^{-\frac12 x^2}e_n(x)$, $n \in \mathbb N$ are all the eigenfunctions of the quantum harmonic oscillator:
$$ - \frac12 \psi_n ''(x) +\frac12 x^2 \psi_n(x) = E_n\psi_n(x), \qquad E_n=n+\frac12. $$
We know that such functions constitute a basis for $L^2(\mathbb R)$, and your result follows for $f \in L^2(\mathbb R)$.


text:
Q: error de NPM a la hora de crear un archivo de react: npm ERR! code ERR_OSSL_PEM_NO_START_LINE no puedo crear un archivo nuevo de react debido a este error:
npm ERR! code ERR_OSSL_PEM_NO_START_LINE
npm ERR! error:0909006C:PEM routines:get_name:no start line
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User\AppData\Roaming\npm-cache_logs\2021-11-09T17_21_50_845Z-debug.log
he probado varias cosas como actualizar el registro, volver a instalar la version de node, sin exito.

A: Buscando varias soluciones en Internet probé algunas de estas:

*

*Prueba npm installcon otro repositorio

*Intente instalar otra versión de node.js

*npm set registry http://registry.npmjs.org/
Si el método anterior aún falla. Puedes probar estos:

*

*Desinstale nodejs de Programas y características con el desinstalador.

*Elimina estos archivos:

*

*C:\Program Files (x86)\Nodejs*

*C:\Program Files\Nodejs*

*C:\Users{User}\AppData\Roaming\npm*

*C:\Users{User}\AppData\Roaming\npm-cache*

*C:\Users{User}.npmrc(y posiblemente verifique eso sin el .prefijo también)*

Reiniciar, por si acaso
Intente también instalar node.js nuevamente
Prueba también npm install al repositorio de destino
Esta información fue encontrada en este sitio


text:
Q: If $\alpha$ is a root of $p(x)$ where $\alpha \in \mathbb{C}$, show that $\vert \alpha \vert \leq \{1, \sum_{i=0}^{n-1} \vert a_i \vert \}$ If $\alpha$ is a root of $p(x)=
x^n+a_{n-1}x^{n-1}+\cdots a_0$ where $\alpha \in \mathbb{C}$, show that $$\vert \alpha \vert \leq \{1, \vert a_0\vert +\vert a_1 \vert + \cdots + \vert a_n\vert\}$$

A: If $|α| \leqslant 1$, it is done. If $|α| > 1$, then$$
|α|^n = |α^n| = \left| \sum_{k = 0}^{n - 1} a_k α^k \right| \leqslant \sum_{k = 0}^{n - 1} |a_k| |α|^k \leqslant |a|^{n - 1} \sum_{k = 0}^{n - 1} |a_k|,
$$
thus$$
|α| \leqslant \sum_{k = 0}^{n - 1} |a_k|.
$$


text:
Q: JAVA : Reading txt and take elements with StringTokenizer i got an error problem! I open my file i read a line and then i take information from the line with StringTokenizer
my code works with one line but when i am trying to read another i got an error any help ?
here is my code
try{

    line = reader.readLine();

        while(line!=null){
            StringTokenizer st = new StringTokenizer(line,"\t");

             timer=st.nextToken("\t");
             int Itimer=Integer.parseInt(timer);
            // System.out.println(Itimer);
             what_to_do=st.nextToken("\t");
            // System.out.print(what_to_do);
             flightnumber=st.nextToken();
        int  Iflightnumber=Integer.parseInt(flightnumber);
            // System.out.print(Iflightnumber);
             departure=st.nextToken("\t");
            // System.out.print(departure);
             flighttime=st.nextToken("\t");

         int Iflighttime=Integer.parseInt(flighttime);
        // System.out.print(Iflighttime);
             Key=new KeyFlight(Iflightnumber,Iflighttime);
             flight=new Flight(Key,true);
             if(what_to_do.equals("insert")){
            // System.out.print("worked");
             if(departure.equals("D")){
                 result=true;
             }else{result=false;}
             flight.setdeparture(result);//8a mporousa na kanw new flight alla gia e3ikonomisi to ekana me seter//
             EV.insert(flight);
            // System.out.println("worked again");

             }else if(what_to_do.equals("cancel")){
                 EV.remove(Key);
                                 }
             else if(what_to_do.equals("update")){
                 EV.UpdateKey(flight, Key);
             }
            line=reader.readLine();

and these are the errors Exception in thread "main" java.util.NoSuchElementException
    at java.util.StringTokenizer.nextToken(Unknown Source)
    at java.util.StringTokenizer.nextToken(Unknown Source)
    at FlightSchedule.loadandStoreFile(FlightSchedule.java:54)
    at FlightSchedule.main(FlightSchedule.java:13)
i wrote instead of last reader.readLine(), line=null and it worked
Code is ok its a StringTokenizer problem
examble of my txt format: 0   insert  370 D   425

A: The problem could be, you are looking for tab "\t" on you're stringTokenizer and maybe the space between youre data is not a tab is just a white space, try better line.split("\s+")


text:
Q: dict.setdefault() is used when value already exists I'm trying to add new keys to the existing dictionary, setting as default value, the value of the previous key.
def check_data(end, start, profile):
    print(profile)

    for day in range((end-start).days+1):
        profile.setdefault(start+datetime.timedelta(day),
           {'expediture':0, 'top-up':0,
           'budget':profile[start+datetime.timedelta(day-1)]['budget'] })

start  = datetime.date(2019,2,1)
end    = datetime.date(2019,2,17)
check_data(end, start, month_data)

output from print(profile):
    {datetime.date(2019, 2, 1): {'expediture': 0, 'top-up': 0, 'budget': 100.0}}

 ---------------------------------------------------------------------------
    KeyError                                  Traceback (most recent call last)
    <ipython-input-4-e44462627692> in <module>
    ----> 1 check_data(end, start, month_data)

    <ipython-input-2-90b936150b04> in check_data(end, start, profile)
         20         profile.setdefault(start+datetime.timedelta(day),
         21                                     {'expediture':0, 'top-up':0,
    ---> 22
       'budget':profile[start+datetime.timedelta(day-1)]['budget'] })
        23
        24 def add_money(profile, topup, date=datetime.date.today()):

       KeyError: datetime.date(2019, 1, 31)

I don't understand why setdefault() tries to set default value to
datetime.date(2019, 2, 1) if this value already exists.
I could fix this problem with if but I'd like to understand how setdefault works and maybe there is alternative solution for this problem.

A: You are misinterpreting the error. A KeyError means you tried to look up a key in a dictionary but that key does not exist. In this case it looks like profile[start+datetime.timedelta(day-1)] is giving you the KeyError and is not related to the setdefault method call.

A: Consider how you would write this code without setdefault (and some minor refactoring for readability):
def check_data(end, start, profile):
    print(profile)

    for day in range((end-start).days+1):
        yesterday = start + datetime.timedelta(day - 1)
        today = start + datetime.timedelta(day)
        profile[today] = {
            'expenditure': 0,
            'top-up': 0,
            'budget': profile[yesterday]['budget']
        }

start  = datetime.date(2019,2,1)
end    = datetime.date(2019,2,17)
check_data(end, start, month_data)

On the first iteration of the loop, you need the value of profile[datetime(2019,1,31)] in order to set the value of profile[datetime(2019,2,1)], but that value was never set.
The only use for setdefault here would be with the key yesterday, assuming you could start with some generic profile. For simplicity, I'll assume that budget is also an integer.
def check_data(end, start, profile):
    print(profile)

    for day in range((end-start).days+1):
        yesterday = start + datetime.timedelta(day - 1)
        today = start + datetime.timedelta(day)
        profile[today] = {
            'expenditure': 0,
            'top-up': 0,
            'budget': profile.setdefault(yesterday, {'budget': 0})['budget']
        }

Now, if profile[yesterday] doesn't already exist, setdefault will execute the equivalent of profile[yesterday] = {'budget': 0} before returning that value.


text:
Q: how to load breeze entity from local storage websql I don't have access to an OData provider just a simple REST api with json and I need to store the data locally (on the mobile device websql) in different tables reflecting the backend model. Following the Edmunds example I have got the entity and the relationships working from the REST api. How can I make it work the same way from the data stored locally. I would like to fetch the data from the local DB and recreate my entities, any advice would be appreciated thanks.

A: After you have queried the data thru the REST api, just export the EntityManager to local storage.  Something like this
     var changesExport = myEntityManager.exportEntities();

     ok(window.localStorage, "this browser supports local storage");
     var stashName = "arbitrary name for storage area"";

     window.localStorage.setItem(stashName, changesExport);

This data can later be reimported into any existing EntityManager, and then queried locally by simply reimporting the data.
     importedData = window.localStorage.getItem(stashName);

     anotherEntityManager.importEntities(importedData);


text:
Q: Inequality Constraint Notation I have always seen inequality constraints for optimization problems written as less than or equal to 0 (such as $Ax\leq0$). However, in a book I was reading, throughout they give inequality constraint as being less than or equal to 0 (for example $\mathcal{W}=\left\{w \mid Vw\leq1\right\}$).
I was wondering if there is a reason to write it this way. I get that $Ax-b\leq0$ is the same as $Ax\leq b$ which you could normalize to $Cx\leq 1$. But is there anything more specific being conveyed by writing it this way?
Link to book (purchase link but may be able to access through academic library): MPC.

A: The standard form of inequality for MPC is $\mathbf{A}\mathbf{x}\le\mathbf{b}$.
In a special case when $\mathbf{b}=\mathbf{0}$, it turns into $\mathbf{A}\mathbf{x}\le\mathbf{0}$.
The case $\mathbf{C}\mathbf{x}\le\mathbf{1}$ is a trivial conversion. Let's assume every $i^{th}$ row of matrix $\mathbf{A}$ is shown by $\mathbf{A}_i$, then
$$\mathbf{C}_i=\frac{\mathbf{A}_i}{b_i}$$
It is possible when no element from $\mathbf{b}$ is equal to zero.


text:
Q: Problem with a function that insert the content of a csv into an array of struct Ok i've a struct that is like this
typedef struct{
    int id;
    char nome;
    char cognome;
    int eta;
    char ruolo;
    squadra team;
    char college;
    int td;
} giocatore;

and i've a function that insert the content of a .csv file into an array.
The problem is that my fscanf don't return nothing and my array is always empty.
My .csv is structured in this way
1   Kyler   Murray  22  QB  Arizona Cardinals   Oklahoma
2   Nick    Bosa    22  DE  San Francisco   Ohio State
3   Quinnen Williams    22  DE  New York Jets   Alabama
4   Clelin  Ferrell 22  DE  Oakland Raiders Clemson

-Declaration of the array
FILE* file_giocatori;
giocatore* lista_giocatori[numero_giocatori];

-Declaration of the function:
void giocatori_in_array(FILE* f, giocatore array_giocatori[]);

-How i call the function:
giocatori_in_array(file_giocatori,*lista_giocatori);

-Function:
void giocatori_in_array(FILE* f, giocatore array[numero_squadre]){
    size_t count = 0;
    while(fscanf(f, "%d,%s,%s,%d,%s,%s,%s\n", &array[count].id, &array[count].nome, &array[count].cognome, &array[count].eta, &array[count].ruolo, &array[count].team.nome, &array[count].college) == 7)
    {
        printf ("%s %s", &array[count].nome, &array[count].cognome);
        count++;
    }
}

The printf don't show me what i swear, seems like my while is blocked at the first cicle

A:
The printf don't show me what i swear

there are several errors in your code producing that unexpected behavior.

In

while(fscanf(f, "%d,%s,%s,%d,%s,%s,%s\n", &array[count].id,
               &array[count].nome, &array[count].cognome,
               &array[count].eta, &array[count].ruolo,
               &array[count].team.nome, &array[count].college) == 7)

and

   printf ("%s %s", &array[count].nome, &array[count].cognome);

you suppose nome and cognome and ruolo and college are array of char but they are only char :

char nome;
char cognome;
...
char ruolo;
...
char college;

so you read/write out of these fields, and you very probably have the same problem for nome in team.
The simple way is to use arrays, for instance ( I use arbitrarily a size of 16 for the strings except rualo which seems to use only 2 characters out of the ending null character)  :
typedef struct{
    int id;
    char nome[16];
    char cognome[16];
    int eta;
    char ruolo[3];
    squadra team;
    char college[16];
    int td;
} giocatore;

and
while(fscanf(f, "%d,%15s,%15s,%d,%2s,%s,%15s\n", &array[count].id,
             array[count].nome, array[count].cognome,
             array[count].eta, array[count].ruolo,
             array[count].team.nome, array[count].college) == 7)

and
printf ("%s %s", array[count].nome, array[count].cognome);

or more probably
printf ("%s %s\n", array[count].nome, array[count].cognome); /* add \n */

and do the same for nome in team (the definition is hidden).
You can also use pointer to char for nome and cognome and ruolo (and the same for nome  in team) :
typedef struct{
    int id;
    char * nome;
    char * cognome;
    int eta;
    char * ruolo;
    squadra team;
    char * college;
    int td;
} giocatore;

and
char nome[16];
char cognome[16];
char ruolo[3];
char college[16];

while(fscanf(f, "%d,%15s,%15s,%d,%2s,%s,%15s\n", &array[count].id, nome,
             cognome, array[count].eta, array[count].ruolo,
             array[count].team.nome, college) == 7) {
  array[count].nome = strdup(nome);
  array[count].cognome = strdup(cognome);
  array[count].ruolo = strdup(ruolo);
  array[count].college = strdup(college);

Do not forget in that case to free the dynamic allocated arrays of char when you remove entry/entries or array to not create memory leaks.

Also having

giocatore* lista_giocatori[numero_giocatori];

the call

giocatori_in_array(file_giocatori,*lista_giocatori);

is invalid because *lista_giocatori is lista_giocatori[0] which is a giocatore but giocatori_in_array  waits for an array of giocatore.
Can be
giocatore lista_giocatori[numero_giocatori];
...
giocatori_in_array(file_giocatori, lista_giocatori);

giocatori_in_array do not receive the size of array so you also have the risk to write out of array in there are more entries in the files than the value of giocatori_in_array.
You also need to know how much entries in the array are set, a way is to return that number rather than to have a void function.

Out of these invalid memory accesses you cannot use fscanf to read several words through a single %s, so you need to read the rest of the line after the ruolo to extract the state and the college, and in case the nome and cognore can be on several words too you cannot use at all fscanf and you have to read all the line then to extract the fields for instance using strtok and strtol to get the number values.
Note the comma/semicolon are missing in your example of csv file to separate the fields. Your fscanf format supposes you use comma, not semicolon as you indicate in a remark of your question.

A proposal can be :
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct {
  char * nome;
} squadra;

typedef struct{
    int id;
    char * nome;
    char * cognome;
    int eta;
    char * ruolo;
    squadra team;
    char * college;
    int td; /* unused */
} giocatore;

size_t giocatori_in_array(FILE* f, size_t sz, giocatore array_giocatori[]);

int main(int argc, char ** argv)
{
  if (argc != 2)
    printf("Usage : %s <csv file>\n", *argv);
  else {
    FILE* file_giocatori = fopen(argv[1], "r");

    if (file_giocatori == NULL)
      fprintf(stderr, "cannot open '%s'\n", argv[1]);
    else {
      const size_t numero_giocatori = 16;
      giocatore lista_giocatori[numero_giocatori];
      size_t n = giocatori_in_array(file_giocatori, numero_giocatori, lista_giocatori);

      fclose(file_giocatori);

      /* debug */
      for (size_t i = 0; i != n; ++i) {
        printf("id:%d nome:'%s' cognome:'%s' eta:%d ruolo:'%s' team:'%s' college:'%s'\n",
               lista_giocatori[i].id,
               lista_giocatori[i].nome,
               lista_giocatori[i].cognome,
               lista_giocatori[i].eta,
               lista_giocatori[i].ruolo,
               lista_giocatori[i].team.nome,
               lista_giocatori[i].college);
      }

      /* free resources */
      for (size_t i = 0; i != n; ++i) {
        free(lista_giocatori[i].nome);
        free(lista_giocatori[i].cognome);
        free(lista_giocatori[i].ruolo);
        free(lista_giocatori[i].team.nome);
        free(lista_giocatori[i].college);
      }
    }
  }

  return 0;
}

size_t giocatori_in_array(FILE* f, size_t sz, giocatore array[])
{
  size_t count = 0;
  char line[256];

  while ((count < sz) && fgets(line, sizeof(line), f)) {
    char * s = strtok(line, ",;");

    if ((s == NULL) || (sscanf(s, "%d", &array[count].id) != 1)) {
      fprintf(stderr, "invalid id line %zu\n", count);
      break;
    }

    if ((s = strtok(NULL, ",;")) == NULL) {
      fprintf(stderr, "invalid nome line %zu\n", count);
      break;
    }
    array[count].nome = strdup(s);

    if ((s = strtok(NULL, ",;")) == NULL) {
      fprintf(stderr, "invalid cognome line %zu\n", count);
      break;
    }
    array[count].cognome = strdup(s);

    if (((s = strtok(NULL, ",;")) == NULL)  || (sscanf(s, "%d", &array[count].eta) != 1)) {
      fprintf(stderr, "invalid eta line %zu\n", count);
      break;
    }

    if ((s = strtok(NULL, ",;")) == NULL) {
      fprintf(stderr, "invalid ruolo line %zu\n", count);
      break;
    }
    array[count].ruolo = strdup(s);

    if ((s = strtok(NULL, ",;")) == NULL) {
      fprintf(stderr, "invalid team nome line %zu\n", count);
      break;
    }
    array[count].team.nome = strdup(s);

    if ((s = strtok(NULL, ",;\n")) == NULL) {
      fprintf(stderr, "invalid college line %zu\n", count);
      break;
    }
    array[count].college = strdup(s);

    count += 1;
  }

  return count;
}

Compilation and execution:
pi@raspberrypi:/tmp $ gcc -pedantic -Wall -Wextra c.c
pi@raspberrypi:/tmp $ cat f.csv
1;Kyler;Murray;22;QB;Arizona Cardinals;Oklahoma
2;Nick;Bosa;22;DE;San Francisco;Ohio State
3;Quinnen;Williams;22;DE;New York Jets;Alabama
4;Clelin;Ferrell;22;DE;Oakland Raiders;Clemson
pi@raspberrypi:/tmp $ ./a.out f.csv
id:1 nome:'Kyler' cognome:'Murray' eta:22 ruolo:'QB' team:'Arizona Cardinals' college:'Oklahoma'
id:2 nome:'Nick' cognome:'Bosa' eta:22 ruolo:'DE' team:'San Francisco' college:'Ohio State'
id:3 nome:'Quinnen' cognome:'Williams' eta:22 ruolo:'DE' team:'New York Jets' college:'Alabama'
id:4 nome:'Clelin' cognome:'Ferrell' eta:22 ruolo:'DE' team:'Oakland Raiders' college:'Clemson'
pi@raspberrypi:/tmp $

Execution under valgrind :
pi@raspberrypi:/tmp $ valgrind ./a.out f.csv
==4207== Memcheck, a memory error detector
==4207== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==4207== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==4207== Command: ./a.out f.csv
==4207==
id:1 nome:'Kyler' cognome:'Murray' eta:22 ruolo:'QB' team:'Arizona Cardinals' college:'Oklahoma'
id:2 nome:'Nick' cognome:'Bosa' eta:22 ruolo:'DE' team:'San Francisco' college:'Ohio State'
id:3 nome:'Quinnen' cognome:'Williams' eta:22 ruolo:'DE' team:'New York Jets' college:'Alabama'
id:4 nome:'Clelin' cognome:'Ferrell' eta:22 ruolo:'DE' team:'Oakland Raiders' college:'Clemson'
==4207==
==4207== HEAP SUMMARY:
==4207==     in use at exit: 0 bytes in 0 blocks
==4207==   total heap usage: 23 allocs, 23 frees, 5,637 bytes allocated
==4207==
==4207== All heap blocks were freed -- no leaks are possible
==4207==
==4207== For counts of detected and suppressed errors, rerun with: -v
==4207== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 6 from 3)
pi@raspberrypi:/tmp $

The proposal accepts both comma and semicolon to separate the columns in the csv file, but it supposes there are no space(s) around the names (if a name has spaces around it they are not removed, you have to do that if needed).
If you do not have strdup :
char * strdup(char * s)
{
    char * r = malloc(strlen(s) + 1);

    strcpy(r, s);
    return r;
}


text:
Q: Should method in data access object (DAO) throw or catch its exception? I have a Java method in data access object. This very simple method inserts two integer values into database.
public void saveHourMin(int hour, int min) throws SQLException{
psInsert.setInt(1, hour);
psInsert.setInt(2, min);
psInsert.executeUpdate();
}

Should this method, or, generally speaking, any DAO method, throw an exception when SQLException is thrown, or should it catch and log the exception, then inform a user via return code? Which is the right approach for an application using Spring?

A: You can't count on the caller to consistently check return codes, you are better off throwing an exception.
If you throw SQLException then that will be messy, you will probably end up with higher layers either adding "throws Exception" on every method, or just eating exceptions. Neither one of those alternatives are good.
The way Spring does it is it supplies an exception translator that takes in the original SQLException and throws a subclass of RuntimeException that includes the original SQLException as a cause and which tries to give as much information about the error as possible, including using vendor error codes to decide which specific subclass to throw.
If you utilize any of Spring's jdbcTemplates then you get the exception translation functionality, so you won't need to include any exception-catching or throwing in your data access objects.
If you don't want to use Spring, you can catch the SQLException inside the DAO and throw a RuntimeException, including the original SQLException as a cause. There is nothing you can do about most SQLExceptions, you just want to fail fast and get the exception logged.

A: I would say no. Catch the SQLException and then throw a RuntimeException or one if descendants. You don't want to pollute your application with data access exceptions. You should not be catching SQLExceptions in the GUI layer for instance. I would not build an application based on return codes either.
By throwing a RuntimeException you don't force the callers to catch it either.

A: I would create a new exception called DAOException, which is NOT a RuntimeException, and force the user of the method to handle such exceptions, with possibly an enum as a member of the DAOException which describes the exception (possibly adding the actual exception inside as an internal exception).
So a thrown exception might look like this:
new DAOException(DAOException.TYPE.SQLE, e)

and the method saveHourMin throws DAOException.
This way if you have all kinds of problems, it's all under the same kind of exception and you don't have to handle different ones.
The reason I suggest using a general exception and not Runtime is because I don't want it to be optional to handle the exception.  Whomever calls this method must be aware of the fact that such a problem may occur and provide the relevant handling (even if that means throwing a new RuntimeException, god forbid, but now it's up to them and it's their decision).  As a general rule of thumb, I would avoid using RuntimeExceptions, because they make the execution path unclear ("someone will probably catch this somewhere up the execution path or it will kill the app, so it's ok to let it go" does not sound to good to me).


text:
Q: return text between two characters My regex is matching a string like between a tab or comma and a colon.

(?<=\t|,)([a-z].*?)(:)

This returns a string: app_open_icon:
I would like the regex to remove the : appended and return app_open_icon only.
How should I chnage this regex to exclude :?

A: Try (?<=\t|,)[a-z].*?(?=:)

const regex = /(?<=\t|,)[a-z].*?(?=:)/;
const text='Lorem ipsum dolor sit amet,app_open_icon:consectetur adipiscing...';
const result = regex.exec(text);
console.log(result);

A: You don't have to use lookarounds, you can use a capture group.
[\t,]([a-z][^:]*):

*

*[\t,] Match either a tab or comma

*( Capture group 1

*

*[a-z][^:]* Match a char in the range a-z and 0+ times any char except :

*) Close group 1

*: Match literally

Regex demo

const regex = /[\t,]([a-z][^:]*):/;
const str = `,app_open_icon:`;
const m = str.match(regex);
if (m) {
  console.log(m[1]);
}

To get a match only using lookarounds, you can turn the matches into lookarounds, and omit the capture group 1:
(?<=[\t,])[a-z][^:]*(?=:)

Regex demo

const regex = /(?<=[\t,])[a-z][^:]*(?=:)/;
const str = `,app_open_icon:`;
const m = str.match(regex);
if (m) {
  console.log(m[0]);
}

A: You already have achived that with your regex.
Positive Lookbehind : (?<=\t|,) check for comma or tab before start of match
First capturing group : ([a-z].*?) captures everything before : and after , or \t
Second capturing group : (:) captures :
Just extract the first captuaring group of your match.
Check regex demo


text:
Q: Is an unprivileged LXC where the host user itself is mapped to 0 less secure of one where one of its subids is mapped to 0, and why? Instead of creating "common" LXC unprivileged containers where all the users are mapped to (unprivileged) subuid/gid of my host user, I'm considering a mapping where my host user itself will be mapped to user 0 (root). They'd be very slim single-app containers.
The reason is that in this way I don't need the rootfs directory subtree, which resides in my user's home, to be namespace-chmod to a different user and I can delete it with a plain rm instead of a namespace one.
Is this kind of LXC less secure than the "common" one, and why is it? What could happen?


text:
Q: Apache 2.18 denied Rails app (with Apache & Passenger) I have a server (ubuntu) which runs some Rails app with Apache & Phusion Passenger.
Every Rails app stopped to work since I upgraded Apache to 2.18.
The server always respond with a 403 status (forbidden) but the public/ directory is not private (I can access via http any .html, .jpg, etc... inside it).
In error.log from Apache there are some entries like:
No matching DirectoryIndex (none) found, and server-generated directory index forbidden by Options directive

Anyone has any idea?
UPDATE:
I managed to solve this issue reinstalling (purge than install) Apache 2.4 and Passenger (and all its dependencies). Running ok with Apache 2.4.18 and Passenger 5.


text:
Q: Asignar valor a una columna en c# mi intención es buscar la columna 11 de mi archivo .csv y dependiendo del string que realize unas cosas u otras. Suelen ser 4 tipos diferentes como pongo en el código por lo tanto si reconoce en un archivo que empieza por F que vaya al if que contenga la f por ejemplo si contiene RECC pues que vaya al if de RECC. Pero al ser booleano no me aclaro como formular esto yo he intentado hacer eso pero no me funciona, alguna propuesta? Gracias de antemano.
Código:
  string root = "C:\\test\\csv\\PR";
        string[] fileEntries = Directory.GetFiles(root);
        DirectoryInfo di = new DirectoryInfo(root);
      //  string valor = "";

                    foreach (var fi in di.GetFiles("*.csv"))
                    {
                        using (TextFieldParser parser = new TextFieldParser(fi.FullName)) // pasamos el path del fichero csv
                        {
                            parser.TextFieldType = FieldType.Delimited;
                            parser.SetDelimiters(";"); // delimitador de csv
                            while (!parser.EndOfData)
                            {
                                //Processing row
                                string[] fields = parser.ReadFields();

                                    foreach (var i in fields[11]){

                                    var recc = fields[11].StartsWith("RECC");
                                    var recp = fields[11].StartsWith("RECP");
                                    var f = fields[11].StartsWith("F");
                                    var c = fields[11].StartsWith("C");

                                    if (i == recc) {
                                    DTO.Cl_LineaAC linea = new DTO.Cl_LineaAC();
                                    linea.documento = fields[0].PadLeft(6, '0');
                                    linea.fechaAsiento = fields[1];
                                    } else if (i == recp){
                                    DTO.Cl_LineaAC linea = new DTO.Cl_LineaAC();
                                    linea.documento = fields[0].PadLeft(6, '0');
                                    linea.fechaAsiento = fields[1];
                                    }else if (i == f){
                                    DTO.Cl_LineaAC linea = new DTO.Cl_LineaAC();
                                    linea.documento = fields[0].PadLeft(6, '0');
                                    linea.fechaAsiento = fields[1];
                                    }else if (i == c){
                                     DTO.Cl_LineaAC linea = new DTO.Cl_LineaAC();
                                    linea.documento = fields[0].PadLeft(6, '0');
                                    linea.fechaAsiento = fields[1];
                                    }else{
                                     DTO.Cl_LineaAC linea = new DTO.Cl_LineaAC();
                                    linea.documento = fields[0].PadLeft(6, '0');
                                    linea.fechaAsiento = fields[1];
                                    }
                                }

                                if (hashDiccionari.ContainsKey(linea.documento) == false)
                                {
                                    List<DTO.Cl_LineaAC> lista = new List<DTO.Cl_LineaAC>();
                                    lista.Add(linea);
                                    hashDiccionari.Add(linea.documento, lista);
                                }
                                else
                                {
                                    List<DTO.Cl_LineaAC> lista = hashDiccionari[linea.documento];
                                    lista.Add(linea);
                                }
                            }
                        }// fin

        }

        LoopAndWritteAC(hashDiccionari);

    }

A: vas por buen camino, sólo que la parte donde sacas tantas variables para comparar, podrías cambiarlo por una estructura de esta manera:
switch (i)
{
    case "RECC":
        break;
    case "RECP":
        break;
    case "F":
        break;
    case "C":
        break;
}

i ya tiene el valor que estás utilizando, así que podemos preguntar directamente si i es igual a cada uno de tus valores buscados, y, dependiendo el caso, hacer algo.
Espero la respuesta te sirva. ¡Saludos!