text:
Q: Is Twitter support OAuth2 Authorization Code Flow? I've been searching through the developer documentation but couldn't found any clue.
Usually there are 2 endpoints provided:

*

*Authorization endpoint, showing login UI and consent screen and provided authorization code.

*Token endpoint, to exchange authorization code provided by Authorization endpoint into access token.

Anyone know what those 2 endpoints?

A: No. Looks like they support oauth2 for client credentials grant only (i.e. application with only). Any user flows seem to be oauth 1?
3-legged, etc.
https://developer.twitter.com/en/docs/basics/authentication/api-reference/token.html

redpajama_set_name: RedPajamaStackExchange


text:
Q: excel Vlookup partial match list to list Forgive the terrible Title. I have a list of values like this
SL- - - - - - -
TP- - - - - - -
AB- - - - - - -
E5- - - - - - -
AD- - - - - - -
XP- - - - - - -
MD- - - - - - -
XH- - - - - - -
MD- - - - - - -
TP-TQ-TR- - - - -
TQ-TN-TJ- - - - -
TH- - - - - - -
XH- - - - - - -

I have an additional list like
SL
XP
XH
TN

I need to validate if any of the two character values in list one exist in list two. so to take for example the final result of the example above would look like
SL- - - - - - -
XP- - - - - - -
XH- - - - - - -
TQ-TN-TJ- - - - -
XH- - - - - - -

A: The asterisk is the wildcard character to use with Vlookup.
With your data in A1:A13, and the text to search for listed from H1, this is the formula I came up with to find the text
=VLOOKUP("*"&H1&"*",$A$1:$A$13,1,FALSE)

Note that this will only give the first one it comes across, so searching for TQ will give TP-TQ-TR- - - - - but not the line below it: TQ-TN-TJ- - - - -

A: Here is the page for vlookup:
https://support.office.com/en-us/article/VLOOKUP-function-0bbc8083-26fe-4963-8ab8-93a18ad188a1
It will explain the syntax of the formula and you will need to use TRUE for the 4th parameter so it will use an approximate match and not an exact match.  It will also turn up a lot of #N/A values.  To get rid of these I would just use a filter on that column.
Let me know if that works. If not explain a little about result you need or what you need it for and I will try to help again.
PS. Sort both columns before hand


text:
Q: 2D Array Memory Allocation Crash in C I seem to be having problems with memory allocation for a 2D array using calloc.
When allocating the 2nd dimension for the array calloc crashes when outside the IDE as a standalone executable, but works perfectly when debugging.  I've gone though everything I can think of and am stumped as to why this happens; especially when it was working fine a couple of days ago.  It seems to be a spontaneous malfunction that won't stop.
The code is in a seperate function of is called multiple times.
O = (double**)calloc(3*cc,sizeof(double*));
for (r = 0; r < 3*cc; r++){
    printf("Row: %d ",r);
    printf("1.Addy: %p ",&O[r]);
    O[r] = (double*)calloc(4,sizeof(double));
    printf("2.Addy: %p\n",&O[r]);
}

I've also tried using different forms of freeing the memory:
for (r = 0; r < 3*c; r++)
        free(O[r]);

&
free(O);

But they just crash at different points.  As well as when the memory is not freed.
This is a screenshot of the memory addresses that it allocates during each call and they all appear to be freed and reused appropriately, but then crash.  If anyone can tell me what's going on that would be the best.


text:
Q: .exe dependency cannot find .dll I am trying to read some proprietary files using a proprietary library. This library comes with a .exe file which, sometime in the middle of the process is called. This file, however, throws the error below.
Unhandled Exception: System.Exception: HarvestCalibration Error: Expecting element 'root' from namespace ''.. Encountered 'None'  with name '', namespace ''.

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'AgLeaderCalibration.dll' or one of its dependencies. The specified module could not be found.
   at HarvestCalibration.Program.buildTable(CalibrationInput config)
   at HarvestCalibration.Program.Main(String[] args)

   at CNHVoyager2.HarvestCalibration.CalibrationShim.get_config()
   at CNHVoyager2.HarvestCalibration.CalibrationShim.CalculateSampleFlow(UInt16 sensor_force, Double moisture_percent)
   at CNHVoyager2.V2_RecordHarvestSummary.CalculateSampleFlow(UInt16 sensor_force, Double moisture_percent)
   at CNHVoyager2.CNHV2DatasetSample.FillHarvestAttributeCollection()
   at CNHVoyager2.CNHV2DatasetSample.get_AttributeCollection()
   at test.Program.CreateProperties(ICNHV2DatasetSample sample) in C:\Users\Joao\leaf\test\Program.cs:line 84
   at test.Program.Convert(String inputCN1) in C:\Users\Joao\leaf\test\Program.cs:line 61
   at test.Program.Main(String[] args) in C:\Users\Joao\leaf\test\Program.cs:line 36

A quick search shows that Expecting element 'root' from namespace ''.. Encountered 'None'  with name '', namespace '' is a problem when reading buffers [1]. However, I think that the library is trying to use the AgLeaderCalibration.dll behind the scenes, which I have the .dll. I've included it in the project in many ways. Referencing, copying it to output directory, etc., to no success.
I do not know C# that much. Maybe this is a very simple problem in the build process? Versioning?
Thanks in advance.

A: I've been in contact with CNH support people, and it turns out you need the Visual C++ Redistributable for Visual Studio 2012 installed: https://www.microsoft.com/en-us/download/details.aspx?id=30679. Make sure you get the 32 bit version (
VSU_4\vcredist_x86.exe)


text:
Q: Bash single command, update command output I get following value from "command1" I need to update this UTC StartDATE and EndDate to ETS in single command. How do I do it.
$>command1
{
    "Jobs": [
        {
            "StartDATE": 1601283799.807,
            "State": "COMPLETED",
            "JobId": "abc123",
            "EndDate": 1601272679.289,

        },
                {
                "StartDATE": 1600211301.064,
                "State": "COMPLETED",
                "JobId": "abc1234",
                "EndDate": 1600211282.846
        },
}

I know I can convert UCT using "date -d @". But how do I update and print in the same line. I need the output like below.
$>command1|command....
{
    "Jobs": [
        {
            "StartDATE": Mon Sep 28 05:03:19 EDT 2020,
            "State": "COMPLETED",
            "JobId": "abc123",
            "EndDate": Mon Sep 28 05:57:59 EDT 2020,

        },
                {
                "StartDATE": Tue Sep 15 19:08:21 EDT 2020,
                "State": "COMPLETED",
                "JobId": "abc1234",
                "EndDate": Tue Sep 15 19:19:02 EDT 2020
        },
}

A: If you don't mind using perl for the purpose: you can use localtime to convert the captured epoch time to human-readable. notice e at the end of the search and replace block.
perl -pe 'BEGIN{$ENV{TZ} = "America/New_York"}; s/([\d.]+)/localtime $1/e if /StartDATE|EndDate/'
{
    "Jobs": [
        {
            "StartDATE": Mon Sep 28 05:03:19 2020,
            "State": "COMPLETED",
            "JobId": "abc123",
            "EndDate": Mon Sep 28 01:57:59 2020,

        },
                {
                "StartDATE": Tue Sep 15 19:08:21 2020,
                "State": "COMPLETED",
                "JobId": "abc1234",
                "EndDate": Tue Sep 15 19:08:02 2020
        },
}


text:
Q: ImageLoader UIL doesn't support scheme(protocol) by default Can someone give me idea how to put path of real device image folder in  imageLoader.getInstance().displayImage(path, imageView, options); . Because i pass the parameter with sd card image path but UniversalImageLoader   E/ImageLoader﹕ UIL doesn't support scheme(protocol) by default [/storage/emulated/0/classnkk_images/1_20150928163482053.png]. You should implement this support yourself (BaseImageDownloader.getStreamFromOtherSource(...))
here is my Logcat
9-30 08:46:28.731  25090-25123/? E/ImageLoader﹕ UIL doesn't support scheme(protocol) by default [/storage/emulated/0/classnkk_images/1_20150928163491042.png]. You should implement this support yourself (BaseImageDownloader.getStreamFromOtherSource(...))
    java.lang.UnsupportedOperationException: UIL doesn't support scheme(protocol) by default [/storage/emulated/0/classnkk_images/1_20150928163491042.png]. You should implement this support yourself (BaseImageDownloader.getStreamFromOtherSource(...))
            at com.nostra13.universalimageloader.core.download.BaseImageDownloader.getStreamFromOtherSource(BaseImageDownloader.java:280)
            at com.nostra13.universalimageloader.core.download.BaseImageDownloader.getStream(BaseImageDownloader.java:99)
            at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.downloadImage(LoadAndDisplayImageTask.java:291)
            at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.tryCacheImageOnDisk(LoadAndDisplayImageTask.java:274)
            at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.tryLoadBitmap(LoadAndDisplayImageTask.java:230)
            at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.run(LoadAndDisplayImageTask.java:136)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:818)
09-30 08:46:28.731  25090-25090/? E/sizeImgElement﹕ = 1_20150928163482053.png = 27021
09-30 08:46:28.740  25090-25090/? E/path﹕ = /storage/emulated/0/classnkk_images/1_20150928163482053.png
09-30 08:46:28.742  25090-25124/? E/ImageLoader﹕ UIL doesn't support scheme(protocol) by default [/storage/emulated/0/classnkk_images/1_20150928163482053.png]. You should implement this support yourself (BaseImageDownloader.getStreamFromOtherSource(...))
    java.lang.UnsupportedOperationException: UIL doesn't support scheme(protocol) by default [/storage/emulated/0/classnkk_images/1_20150928163482053.png]. You should implement this support yourself (BaseImageDownloader.getStreamFromOtherSource(...))
            at com.nostra13.universalimageloader.core.download.BaseImageDownloader.getStreamFromOtherSource(BaseImageDownloader.java:280)
            at com.nostra13.universalimageloader.core.download.BaseImageDownloader.getStream(BaseImageDownloader.java:99)
            at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.downloadImage(LoadAndDisplayImageTask.java:291)
            at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.tryCacheImageOnDisk(LoadAndDisplayImageTask.java:274)
            at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.tryLoadBitmap(LoadAndDisplayImageTask.java:230)
            at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.run(LoadAndDisplayImageTask.java:136)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:818)

A: Use a file:// scheme, as is shown in the documentation.
"file:///mnt/sdcard/image.png" // from SD card


text:
Q: Doing a select and update inside a Mysql event I'm doing a select inside a mysql event, and then trying to update another table with data from that select. But it does not seem to be working.
I'm doing:
BEGIN
select read_pub_id, read_artc_id, count(read_artc_id) as times_read from reads_t GROUP BY read_pub_id, read_artc_id;
update reads_totals set read_total = times_read where pub_id = read_pub_id and artc_id = read_artc_id;
update reads_totals set ts=now(); /*This is for testing*/
END

Only the ts gets updated. Which means the event is working.
Is there a while loop to be added in here, and how? Whats the right way to do this?
My previous question relating to this is here:
https://stackoverflow.com/questions/13110393/doing-a-count-along-with-distinct-to-check-number-of-times-a-post-was-read

A: Did you mean:
UPDATE reads_totals T
SET read_total = (SELECT count(read_artc_id)
                  FROM reads_t R
                  WHERE R.read_pub_id = T.pub_id
                  AND R.read_artc_id = T.artc_id);

This query though will update every row in reads_totals, I'm not sure this is really what you intend.

A:  select read_pub_id, read_artc_id, count(read_artc_id) as times_read from reads_t
 GROUP BY read_pub_id, read_artc_id;
 update reads_totals
 set read_total = (select count(read_artc_id) from reads_t rt
 where pub_id = rt.read_pub_id
 and artc_id = rt.read_artc_id);


text:
Q: What is the Bohr compactification of a topological group and in particular of the real line? How can you define it? I have encountered the Bohr compactification in the context of Loop Quantum Cosmology and Polymer Quantum Mechanics and I cannot succeed understanding it in a straightforward way.
I just got my Master's Degree in Physics and at the moment I do not have an adequate background in topology that can help me to grasp these notions.
Is there a rigorous and understandable way to define the Bohr compactification in general and in particular the Bohr compactification of the real line?
Thank you all.


text:
Q: Creating Folder in Android Custom Rom I'm building an Android custom ROM with an additional logging mechanism for a research project. My customized Android source code contains file logging via PrintWriter(filename). So far it works fine, but now I want to be able to grab its output from a concurrently developed App.
The problem is: When the PrintWriter creates the a new log file, it is created with rw------- permission and so I'm not able to read the file from my App. What would be the best way to make that work?

A: I found the solution by myself. It works with the java methods of the File class, but you have to invoke these after actually creating the file, which is in my opinion not straightforward, because I expected it to work like setting some attributes and then actually creating the file with these specified attributes. Here is an example of setting Read/Write/Execute permissions for everyone for a specific file:
File file = new File("logs/log.txt");
file.createNewFile();
file.setWritable(true, false);
file.setReadable(true, false);
file.setExecutable(true, false);
PrintWriter writer = new PrintWriter(file);


text:
Q: Can Docker Corrupt a Software RAID Setup? I read that software RAID should not be implemented on a machine that also has ESXi virtual machines running. Does this mean that I would want to avoid LVM and or LXC/Docker containers as well on this server?
Thanks

A: Actually, RAID10 is the preferred RAID level for high-performance virtual machines. While it has its shortcoming, I can not see why it should not be used with ESXi or Docker.
Back to original question: docker mainly is a user-space affaire. So it can not corrupt a software or hardware RAID device.
As a side note, I strongly advise you against cheap RAID cards. If you really want to do hardware RAID, buy a card with a DRAM cache and a BBU/NV module.

A: LXC/Docker by design doesn't have anything to do with RAID (any RAID) at all.
Docker/LXC containers are run on the same kernel as the host.
As such I don't think there are any docker related problems.

A: All software running on the machine operates as if the RAID is 1 device. This is why usually the device is /dev/sdc  instead of seeing /dev/sda  and then also /dev/sdb.
If you're using a software RAID vs a RAID card then it's plausible that something on the OS could cause the OS injected RAID to not behave properly.  I know people use them all the time but I highly suggest using a RAID card — even a cheap one if you have too, it's worth of loading this functionality to its own hardware


text:
Q: Handling Socket.io to fail gracefully if the .js files cannot be loaded in with AJAX I've built a simple Node Socket.io file that I'm using to post requests to to update a Perl application hooked up to it.
Example code in my Perl template file:
function start_io_service() {
    socket = io("http://10.5.17.194:5892");
    var current_user = $('#user-name').text();

    console.log(socket); // For Debugging

    // Handler to send back a username to the node application
    socket.on('user-query', function (msg) {
        // Send username
        socket.emit('username', { username: current_user });
    });
}

The Socket.io.js is loaded in using jQuery $getScript so I can handle if the Node server isn't running (which isn't required for 90% of the functionality of the Perl app).
$.getScript( "http://10.5.17.194:5892/socket.io/socket.io.js" )
  .done(function( script, textStatus ) {
  console.log( "It worked" );
})
  .fail(function( jqxhr, settings, exception ) {
  console.log("It didn't"); // This never appears
});

The .fail() method of getScript is completely ignored if the server isn't running when trying to load in the socket.io.js file from the server and I get the following error in my chrome console:
GET http://10.5.17.194:6000/pi/status net::ERR_CONNECTION_REFUSED

Even if I wrap the entire thing in a try and catch block it still doesn't change anything.
All I want is to ensure no errors appear and I get a simple console message instead. (The users of the system wouldn't be happy to see any sort of big red error message and would raise issues constantly).
Please note, if the server is running I get no issues and the app works, it's just handling the scenario that the server isn't running that I'm trying to solve.
Ideas?

A: Because of how getScript() works internally for cross domain scripts, some errors are apparently silent.  It appears that either a DNS failure or a failure to contact the server in the URL is a silent failure that doesn't call either .done() or .fail().
You could implement your own timeout and if either .done() or .fail() was not called within some time period (e.g. a few seconds), then you could consider it a fail.
See this similar question: Handling errors in jQuery.getScript


text:
Q: Grouped bar chart by three column using matplotlib I am trying to display a grouped bar chart by categorical values on columns.
An example data is below.
df = pd.DataFrame({'Type': ['A','A','A','A','A','A','A','A','A','B','B','B','B','B','B','B','B','B'],
                   'Ratio': [3, 3, 3, 5, 5, 5, 7, 7, 7,3, 3, 3, 5, 5, 5, 7, 7, 7],
                   'Method': ['X','Y','Z','X','Y','Z','X','Y','Z','X','Y','Z','X','Y','Z','X','Y','Z'],
                   'Result': [90, 85, 96, 89, 82, 80, 78, 72, 75, 91, 82, 94, 87, 86, 84, 71, 78, 86]})

Values in "Type" column can be on the same chart or two subplot graphs. The Y axis must display the value in "Result" and the legend of the bar chart must display the value in "Method"
Example
My dataset is quite large compared to the example above so a loop or function would be more useful.
My code below is not working as I want.
fig, ax = plt.subplots(figsize=(4,3))

for t in ["A", "B"]:

    df1 = df.loc[df["Type"] == t]

    for r, w in zip([3,5,7], [5, 10, 15]):

        df2 = df1.loc[df1["Ratio"] == r]

        for m, i in zip(["X","Y","Z"], range(3)):

            df3 = df2.loc[df2["Method"] == m]

            label = str(m)
            ax.bar((w+i), df3["Result"], label=label)

plt.savefig("test.svg")

A: import pandas as pd
import matplotlib.pyplot as plt

grouped_A = df[df['Type'] == 'A']
grouped_B = df[df['Type'] == 'B']

fig, ax = plt.subplots(1, 2, figsize=(15, 5))

for r, w in zip([3,5,7], [5, 10, 15]):

    A = grouped_df_A.loc[grouped_df_A["Ratio"] == r]
    B = grouped_df_B.loc[grouped_df_B["Ratio"] == r]

    for m, i in zip(["X","Y","Z"], range(3)):

        methodA = A.loc[A["Method"] == m]
        methodB = B.loc[B["Method"] == m]

        label = str(m)
        ax[0].bar((w+i), methodA["Result"], label=label)
        ax[0].set_title("Type A")

        ax[1].bar((w+i), methodB["Result"], label=label)
        ax[1].set_title("Type B")

plt.show()

A: Consider a subset loop with pandas DataFrame.groupby, then pivoting data with DataFrame.pivot_table, and finally running plot with DataFrame.plot:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

df = pd.DataFrame({
    'Type': ['A','A','A','A','A','A','A','A','A','B','B','B','B','B','B','B','B','B'],
    'Ratio': [3, 3, 3, 5, 5, 5, 7, 7, 7,3, 3, 3, 5, 5, 5, 7, 7, 7],
    'Method': ['X','Y','Z','X','Y','Z','X','Y','Z','X','Y','Z','X','Y','Z','X','Y','Z'],
    'Result': [90, 85, 96, 89, 82, 80, 78, 72, 75, 91, 82, 94, 87, 86, 84, 71, 78, 86]
})

num_types = len(df["Type"].unique())
fig, axes = plt.subplots(figsize=(12,4), ncols=num_types, nrows=1)

# FLATTEN MULTI-DIMENSIONAL ARRAY
axes = np.ravel(axes)

# ITERATE THROUGH TYPE GROUPS
for (g, df), ax in zip(df.groupby("Type"), axes):
    # PIVOT FOR  WIDE DATA FOR BAR CHART
    (
        df.pivot_table(index="Ratio", columns="Method", values="Result", aggfunc="sum")
          .plot(kind="bar", ax=ax, rot=0, title=f"{g} - Bar Chart")
    )

plt.show()
fig.savefig("bar_chart.png")

plt.clf()
plt.close()

A: This should work for multiple types in your Type column creating vertical subplots for each.
item_list = list(df.Type.unique())
fig, ax = plt.subplots(len(item_list), figsize=(12, 8))
for t in range(len(item_list)):
    df1 = df.loc[df["Type"] == item_list[t]]
    for r, w in zip([3,5,7], [5, 10, 15]):

        df2 = df1.loc[df1["Ratio"] == r]

        for m, i in zip(["X","Y","Z"], range(3)):

            df3 = df2.loc[df2["Method"] == m]

            label = str(m)
            ax[t].bar((w+i), df3["Result"], label=label)
            ax[t].set_title(f'Type{item_list[t]}')

Plots:


text:
Q: GKGridGraph find path not working I'm trying to make a turn based game, and each enemy should find a path to player node. I'm using gameplaykit's pathfinding, and every time enemy has to make a turn, I make sure to remove other enemies from that GKGridGraph (so that enemy won't walk on one another) and latter I add that same nodes.
NSMutableArray <GKGridGraphNode *> *walls = [NSMutableArray array];

for(SKNode *mapNode in enemies)
  {
    for(SKNode *node in mapNode.children)
      {
        if((node.position.x != enemy.position.x)||(node.position.y != enemy.position.y))
          {
            GKGridGraphNode *graphNode = [_NewGraph nodeAtGridPosition:
            (vector_int2){(node.position.x-300)/70, (node.position.y-180)/70}];
            [walls addObject:graphNode];
          }
        }
      }
[_NewGraph removeNodes:walls];

GKGridGraphNode* GKenemyNode = [_NewGraph nodeAtGridPosition:(vector_int2)
                         {(enemy.position.x-300)/70, (enemy.position.y-180)/70}];

GKGridGraphNode* GKplayerNode = [_NewGraph nodeAtGridPosition:(vector_int2)
                        {(player.position.x-300)/70,(player.position.y-180)/70}];
NSArray<GKGridGraphNode *> *path = [_NewGraph findPathFromNode:GKenemyNode toNode:GKplayerNode];
[_NewGraph addNodes:walls];

If I comment out lines removeNodes and addNodes everything works fine.
EDIT: Would it be a good idea to every time create new class object that could return generated GKGridGraph, instead of reasigning the same one?

A: Okey, so I found the answer and would like to share with all of you !
After removing nodes I did this (no need to add nodes as I did):
for(GKGridGraphNode *node in walls)
{
  [NewGraph connectNodeToAdjacentNodes:node];
}

NewGraph = nil;

GoodLuck !


text:
Q: Unresolved constraint in bundle and missing requirement osgi.wiring.package = org.quartz)(version>=2.2.0)(!(version>=3.0.0))) I have a Web Application Client Bundle (WAB) with OSGi after a tutorial and I want to use packages from quartz scheduler for a specific task. I'm using also Maven and I put the following dependency:

        org.quartz-scheduler
        quartz
        2.2.1
        compile

        org.quartz-scheduler
        quartz-jobs
        2.2.1
        compile

I've checked in Maven repository and it seems to be everything ok, the packages/jars from the quartz jar are exported in the MANIFEST.MF. At compilation everything is fine but at the runtime I receive this error:
[#|2013-12-11T18:49:07.590+0100|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=64;_ThreadName=Thread-2;|org.osgi.framework.BundleException: Unresolved constraint in bundle employee.identitymanagement.web_client [516]: Unable to resolve 516.0: missing requirement [516.0] osgi.wiring.package; (&(osgi.wiring.package=org.quartz)(version>=2.2.0)(!(version>=3.0.0)))
    at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3826)
    at org.apache.felix.framework.Felix.startBundle(Felix.java:1868)
    at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1175)
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1153)
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.processAllBundles(DirectoryWatcher.java:1146)
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:456)
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:263)
And I'm not sure about the problem......If anyone can help me, I can give more details about it. Thanks in advance!

A: You need to install a bundle into your runtime that exports the package org.quartz.

A: If you're using a feature.xml file you most likely need to add a <bundle></bundle> to the feature in question.  Something similar to (and this assumes you're using apache commons-validator 1.4.1):
<feature name="foo" version="${project.version}-${build.number}">
    <bundle>mvn:org.apache.commons/commons-lang3/${apache.commons.lang.version}</bundle>
    <bundle>mvn:commons-validator/commons-validator/${commons-validator.version}</bundle>
    <bundle>mvn:commons-beanutils/commons-beanutils/1.8.3</bundle>
    <bundle>mvn:commons-digester/commons-digester/1.8.1</bundle>
    <bundle>mvn:commons-logging/commons-logging/1.2</bundle>
    <bundle>mvn:commons-collections/commons-collections/3.2.1</bundle>
</feature>

Hope this helps.
FWIW, I would strongly discourage you from using the <Export-Package> element in the maven-bundle-plugin because overriding the default value of * for this element and adding your missing package will remove all the other packages added automatically by the * - which is almost assuredly NOT what you want.


text:
Q: Can someone help me with this limit? $ \lim_{x \to 0}x^{|\tan x |} \overset{??}{=} 1 ??$
If you consult the graph it is intuitive to think that when $ x \to 0 $ the function tends to $1$. I have tried to lower the exponent with logarithms and apply L'Hospital's rule, but nothing. The only solution I see is to apply infinitesimal equivalents, which I have not tried yet.
Thank you all!

A: $$L=\lim_{x \to 0}x^{|\tan x |} \overset{??}{=} 1 ??$$
Take log
$$\ln L =\lim_{x \to 0}  {\ln x} \,{\tan x}$$
$$\ln L =\lim_{x \to 0} {\ln (1-(x+1))}\, {\tan x}$$
$$\ln L =\lim_{x \to 0}  {-(x+1)} \,{ x}$$
$$\ln L= 0 \implies L=e^0=1$$

A: Hint:
Determine the limit of the logarithm, using that $\tan x\sim_0 x$.


text:
Q: MySQL Join 2 columns from table y into rows of table x Trying to wrap my mind around how to write this SQL query.
Table X has 3 Columns: Year, ID, Value and looks like so
Year   |   ID   |     Value
2013       101        10000
2014       101        11000
2015       101        12000
2013       102        7000
2014       102        8000
2015       102        9000

And table Y has 3 Columns: ID, Curr_Year_Val, Next_Year_Val and looks like this
ID   |  Curr_Year_Val   | Next_Year_Val
101        13000                  14000
102        6000                   5000

I would like to write a select statement to join these two tables together, but maintain the layout of Table X, like so:
Year           |    ID    |    Value
2013               101         10000
2014               101         11000
2015               101         12000
Curr_Year_Val      101         13000
Next_Year_Val      101         14000

Is there a way to achieve this result? I've figured out how to just do a left join to add the columns from table y to table x, but would rather have the columns from table y unpivoted to the rows of table x. Thanks much in advance - this seems like it should be so easy, I've been googling for hours but I'm probably not using the proper terminology for what I'm trying to do in my searches.
Thanks!

A: Uee union
 select  year, id, value
 from tableX
 where id ='101'
 union
 select 'curr_year_val', id, curr_year_val
 from tableY
 where id ='101'
 union
 select 'next_year_val', id, next_year_val
 from tableY
 where id ='101'

A: Sounds like you should use union all:
select year, id, value from x
union all
select 'curr_year_val', id, curr_year_val from y
union all
select 'next_year_val', id, next_year_val from y
order by 2, 1

*

*SQL Fiddle Demo
BTW, other databases would require you to have the same data types for all columns when using union.  This works though with mysql.


text:
Q: Can I verify that a Google Tag Manager id is valid? It looks like, from inspection, that the form of a Google Tag Manager id is "GTM-XXXXXX" where the x's are [A-Z]|d, is this accurate? I need to verify whether the id's being submitted to a CMS are valid.

A: I've just wrote this one for our framework:
/^GTM-[A-Z0-9]{1,7}$/

Tested with 25 GTM container IDs in our account, all passed validation. You can try this expression out here.

A: The format varies. I see various combinations of numbers and letters, some just letters, none just numbers, most 6 characters, and few with 4 characters. There's no clear pattern. They begin with either a letter or number, and end with a letter or number.


text:
Q: Mark paid orders as "Completed" and non paid as "Cancelled" in WooCommerce 3+ Have one small issue with my WooCommerce function , what was supposed to work in way i wanted, but seems that have bugs. I want to mark success paid orders as "Completed" instead of stuck on "Processing" after placed, and non success paid orders to mark as "Cancelled" orders instead stuck at "Payment Pending". This is my bugged function i have:
add_action( 'woocommerce_thankyou', 'wc_auto_complete_paid_order', 20, 1 );
function wc_auto_complete_paid_order( $order_id ) {

    if ( ! $order_id )
        return;

    // Get an instance of the WC_Product object
    $order = wc_get_order( $order_id );

    // No updated status for orders delivered with Bank wire, Cash on delivery and Cheque payment methods.
    if ( in_array( $order->get_payment_method(), array( 'bacs', 'cod', 'cheque', '' ) ) ) {
        return;
        // Updated status to "completed" for paid Orders with all others payment methods
    } elseif ( $order->has_status('processing') ) {
        $order->update_status( 'completed' );
    }
}

A: You can try something like this:
add_action( 'woocommerce_thankyou', 'wc_auto_complete_paid_order' );
function wc_auto_complete_paid_order( $order_id ) {

  if ( ! $order_id ) {
    return;
  }

  $order = wc_get_order( $order_id );

  if( $order->has_status('processing') ) {
    $order->update_status( 'completed' );
  } else {
    $order->update_status( 'cancelled' );
  }

}

The code is untested, I just wrote it down.
Let me know if it helps ;)
Cheers,
Francesco


text:
Q: How to use two AngularJS services with same name from different modules? Supposed I have two modules for AngularJS, e.g. foo and bar, and both of them define a service called baz.
In my application I depend on them by saying:
var app = angular.module('app', [ 'foo', 'bar' ]);

Then I can try to use the baz service in a controller by using
app.controller('blaController', [ '$scope', 'baz', function($scope, baz) {
  // ...
}]);

How can I define which of the two services I'd like to use? Is there something such as a fully-qualified name?

A: The service locator looks services up by name (angularjs guide DI). However "Namespacing" services in AngularJS:

As of today AngularJS doesn't handle namespace collisions for services
  so if you've got 2 different modules with the service named the same
  way and you include both modules in your app, only one service will be
  available.

I guess you can make the fully qualified name "by hand": name the service foo.baz and bar.baz instead of plain baz. It's kind of a self-delusion. Moreover, writing it this way doesn't make namespacing real, but another person that reads the code might think so.

A: When we have two services with the same name, you have to differentiate them while using it in your local module. Let's see some code below to understand how it works,
I have two Util services and need to differentiate them,
angular
  .module('module1', [
  ])
  .service('UtilService', UtilService)
  .service('another.UtilService', UtilService)
  .name;

In the controller file, you can simply inject like below.
export class Controller {
  public static $inject: string[] = ['UtilService', 'another.UtilService'];

constructor(
    private utilService: UtilService,
    private anotherUtilService
  ) {
     console.log(this.utilService) // will print the main util service methods
     console.log(this.anotherUtilService) // will print the another util service
     methods
  }


text:
Q: Top Contributors Plugin with Custom Post Type I am using the plugin Top Contributors. That's very helpful for all blogs. But the problem with this plugin is: it is not integrated with custom post types.
How could I extend the plugin to do that?

A: This plugin hasn't been updated in almost two years, so you should consider finding a new one.
That said, in this cases you have to open1 the plugin files and search for some string related to your issue, e.g., post_type.
You'll find that in the file functions.inc.php, it has two occurrences of:
AND a.post_type = 'post'

Change that to:
AND ( a.post_type = 'post' OR a.post_type = 'YOUR_CPT_SLUG' )

Not sure if that's the only thing that needs to be changed, but now you should be able to further inspect it and locate other parts that need modification.
 1: Software for WordPress Theme and Plugin Development?

A: Best Solution is Top Authors
Its support CPT now. http://wordpress.org/support/topic/custom-post-type-support-2?replies=3#post-3967338


text:
Q: How to create a dependent pick list using custom object in visual force? I need to create a dependent picklist using custom object in Visualforce. My requirement is if I create an object country this is master detail, then state is child & city also. Then I need to show contact details of that particular city.

A: Firt you have to create to custom field .
Click field dependency
Then new controller field and dependent
So that you could add the depent


text:
Q: Prove that we have at least one set with at least $4$ red dots. We have a set of points, some of which are red.  We form sets $A_{1},A_{2},...,A_{68}$ so that each set has exactly $5$ points, of which at least one is red. Moreover, any triplet in the set of points is in exactly one set. Prove that we have at least one set with at least $4$ red dots.
The hint in the book is counting in two ways.

A: Let $N$ be the number of points. Counting triplets in two ways we get ${5\choose 3}\cdot 68 = {N \choose 3}\implies N = 17$.
Let $R$ be the number of red points. Then, counting triplets with no red points we have ${17-R\choose 3}\leq 68\cdot {4\choose 3} \implies R\geq 5$.
At this point, I think that some Pigeonhole Principle argument will work.


text:
Q: Google ads script sendEmail method generating incomplete csv A script that was previously working (using the sendEmail method of MailApp to email an attached csv) is now getting truncated about 300 rows short of what should be in the complete file, and is even getting cut mid-cell at about the same row every time. Sometimes, copy/pasting the code into a new script and manually running will work, but often it still does not.
The report is <400KB and only needs like 3,100 rows, but is only containing about 2,8600.5 (truncated mid-row, mid-cell).
Has anyone experienced this or have any tips?


text:
Q: How to show the Extended Permission Dialog in FB using new Graph API? I used the old rest api for showing the Permission Dialog in Facebook before.
Now, with the new graph API, what can I do? (I'm in IFrame Apps).
I know that I can cheat and popup the permission in a seperate window:
FB.login(function(response) {
                  if (response.session) {
                    if (response.perms) {
                      // user is logged in and granted some permissions.
                      // perms is a comma separated list of granted permissions
                    } else {
                      // user is logged in, but did not grant any permissions
                    }
                  } else {
                    // user is not logged in
                  }
                }, {perms:'offline_access'});

like that..  call the FB.login again (let say I want people to click on a different button and trigger the extended permisison dialog)
However,it looks ugly,and it doesn't look like a dialog.
Is there a way to generate the dialog?   I try to figure out whether FB.ui can help but there is only little information about that.
In addition, I don't think the 'response' callback ever execute.  Neither I click "Don't allow" or "allow", won't trigger any call back.  any idea?
hihih..anyone can help me?

A: You don't need to use javascript or any SDK for this although it would make it easier. You need only to redirect the user to a url like this:
https://graph.facebook.com/oauth/authorize?
    client_id=...&
    redirect_uri=http://www.example.com/callback&
    scope=user_photos,user_videos,publish_stream

You should always redirect the user to the top window either with javascript or the link.
window.top.location = <login_url> or <a href=<login_url> target="_top">Login

If you are using the PHP SDK or the C# SDK you could have the sdk generate the url for you, but the process is the same.
Also, not that the redirect_uri has to be on the same domain as your iFrame application's url. This will cause Facebook to redirect your user outside of Facebook to your website, you then should redirect the user back to the app inside of facebook. For example:

*

*User clicks login

*user goes to Facebook login page

*User clicks allow

*Facebook redirects the user to http://www.example.com/callback

*Your app redirects the user to http://apps.facebook.com/myapp/loggedin

A: Finally. find out the solution from another website.
first. after FB.init( ... );  do that:
FB.provide("UIServer.Methods",
    { 'permissions.request' : { size : {width: 575, height: 300},
    url: 'connect/uiserver.php',
    transform : FB.UIServer.genericTransform }
    } );

Then, whenever you need to call the permssion dialog, do that:
FB.ui({method: "permissions.request", "perms": 'email,offline_access'},
    callBack);

It took me so long to figure out by looking at the FB object and find out there is UIServer with permissions.request  then from that, I keep searching and find this solution.  and FB.ui talks nothing about it.. and FB.provide is not documented.  THANKS facebook.

A: One of the answers suggests a hack in which you call FB.provide() and then FB.ui() to pop up the extended permissions dialog. That solution doesn't work for me, but there is a documented solution now that does. Just call FB.login() to get the permissions you need.
FB.login(function(response){
    if (response.authResponse) {
        alert('success!');
    } else {
        alert('fail!');
    }
    },{scope: 'email'});

Even better, you can ask for extended permissions with the login button.


text:
Q: Vector with specific number of equally spaced values I am familiar with the command:
(-5:0.1:5)

which creates a vector of values, equally spaced by 0.1, from -5 to 5.
However, is there a way to produce a vector of values, equally spaced from -5 to 5 such that there are, say, 100 values in the vector.
(-5:0.1:5) gives a vector with 101 values, however, is there a way to get a vector of 100 values without manually calculating the step size?

A: Yes there is. Use function linspace. See documentation here
linspace(1,10,10)

ans =
 1     2     3     4     5     6     7     8     9    10

also the question is a duplicate of this question


text:
Q: Statically passing arrays to a Vue component I need to statically pass an array to my Vue component, called ajax-table. I can't seem to find a way to do it, so I came up with this:
<ajax-table
    header-names="Code, Name, Description, Type"
    field-names="code, name, description, major_type">
</ajax-table>

Inside the component, I do this:
export default {

    props: [
        'headerNames',
        'fieldNames'
    ],

    data: function () {

        return {
            columnHeaders: [],
            columnFields: []
        }
    },

    created() {
        this.columnHeaders = this.headerNames.split(",").map(x => x.trim());
        this.columnFields = this.fieldNames.split(",").map(x => x.trim());
    }
}

Now, columnHeaders and columnFields contain the header-names and field-names that I passed statically to the component.
My question:
Is there a better way to do this?

A: You should be able to directly pass the array to props using v-bind: directive or : for short:
<ajax-table
    :header-names="['Code', 'Name', 'Description', 'Type']"
    :field-names="['code', 'name', 'description', 'major_type']">
</ajax-table>

Now props headerNames and fieldNames are arrays, which you can use in the component.


text:
Q: Trigger a function when window is only above 1030px - and on Re-size or load How to make this following function trigger only when screen size is only above 1030px? (on re-size and on load) I tried to implement this line of code to it:  var windowWidth = $(window).width(); if(windowWidth <= 1030){} but it didn't work.
    //Change Header On Scroll//
    $(window).scroll(function() {
    var scroll = $(window).scrollTop();

    if (scroll >= 40) {
        $("#headerWrapper").addClass("headerDown");
        $("#logo1").hide();
        $("#logo2").show();
    } else {
        $("#headerWrapper").removeClass("headerDown");
        $("#logo2").hide();
        $("#logo1").show();
        }
    });

A: I would do:
var w = window.innerWidth;
window.onresize = function(){
    w = window.innerWidth;
}

If (w >= 1030) {
    // your code here
}

A: If the conditional you used is if(windowWidth <= 1030) then it will only be true if the window is less than or equal to 1030.
Try this:
$(window).scroll(function() {

    var windowWidth = $(window).width();

    if (windowWidth >= 1030){
        // do yo' thang
    }
}


text:
Q: Extracting numbers from Gmail messages using Google Apps Script I'm trying to extract numbers such as the ones listed below from my Gmail messages using Google Apps Script.
2,495.00
1,594
3,777.23
642.00

This is the code:
function myFunction() {

  var sheet = SpreadsheetApp.getActiveSheet();
  var threads = GmailApp.search('subject:(Transaction) after:2016/7/31 before:2016/8/10');

  for (var i=0; i<threads.length; i++)
  {
    var messages = threads[i].getMessages();
    var tmp;

    for (var j=0; j<messages.length; j++)
    {
      var content = messages[j].getBody();
      var subject = messages[j].getSubject();
      var date = messages[j].getDate();
      Logger.log(content);

      if (content)
      {
        tmp = content.match(/\d+(,\d+)*(\.\d+(e\d+)?)?/);
        var number = (tmp && tmp[j]) ? tmp[j] : 'No number';
        sheet.appendRow([number, subject, date]);
      }
      else
      {
        sheet.appendRow([content, subject, date]);
      }

    }
  }
}

I've been getting mixed results. For some messages this works as intended but for some it completely skips the numbers from the messages. I'm a newbie to JS/GAS and I thought the problem was in the regex but I'm not sure. Any help in this would be appreciated.

A: you are facing two trouble here:
the regex you are using don't look optimised (but neither what you are looking is clear a number like 1,594 should not be found if you are also looking at number that look like that 642.00). Nevertheless you could use a a regex like Shekhar Khairnar proposed in comment or something similar (the gat the end is important as there is more than one number in your mail).
The second trouble is in the line var number = (tmp && tmp[j]) ? tmp[j] : 'No number';. Why is there a jvar in this line? jis reference to the for loop --> number of messages, nothing to do with the occurences in your message.
What I can propose you is something like that:
function myFunction() {

  var sheet = SpreadsheetApp.getActiveSheet();
  var threads = GmailApp.search('test');
  var re = /(?:\d{1,3}[,])*\d{1,3}\.{0,1}\d{1,3}/g;

  for (var i=0; i<threads.length && i<5; i++) // added a condition because I didn't wanted to have too many results
  {
    var messages = threads[i].getMessages();
    var tmp;

    for (var j=0; j<messages.length; j++)
    {
      var content = messages[j].getPlainBody(); //.getBody();
      var subject = messages[j].getSubject();
      var date = messages[j].getDate();
      //Logger.log(content);

      if (content)
      {
        tmp = content.match(re); // /\d+(,\d+)*(\.\d+(e\d+)?)?/);
        var number = tmp || ['No number']; // result of tmp is either null or an array --> if it's null then it will take the value 'no number'
        Logger.log(number);
        sheet.appendRow([number.join(" | "), subject, date]);
      }
      else
      {
        sheet.appendRow([content, subject, date]);
      }

    }
  }
}


text:
Q: Exception in thread "thread-4" java.lang.NullPointerException I'd really appreciate some help with my program
    Exception in thread "Thread-4" java.lang.NullPointerException
    at ServerConnect.replyChoice(BaseStaInstance.java:63)
    at ServerConnect.run(BaseStaInstance.java:45)
    at java.lang.Thread.run(Thread.java:619)

my ServerConnect function looks like :-
class ServerConnect extends Thread {

 Socket skt;
 String sProcessId;
 ServerConnect scnt = null;
 ObjectOutputStream myOutput;
 ObjectInputStream myInput;

 ServerConnect(){}
 ServerConnect(Socket connection, String sProcessNo) {
  this.skt = connection;
  this.sProcessId = sProcessNo;
 }

 public void run() {
  try {
   myInput = new ObjectInputStream(skt.getInputStream());
   ServerConnect scnt = new ServerConnect();

   while(true) {
    try{
     int ownTimeStamp = Global.iTimeStamp;

     Object buf = myInput.readObject();

     //if we got input, print it out and write a message back to the remote client...
     if(buf != null){
 LINE 45-->     **scnt.replyChoice(buf);**

     }

    }catch(ClassNotFoundException e) {
     e.printStackTrace();
    }
   }
  } catch(IOException e) {
   e.printStackTrace();
  }
 }

 void replyChoice(Object buf){

  try{
LINE 63 --> **myOutput = new ObjectOutputStream(skt.getOutputStream());**

  System.out.println("Server read:[ "+buf+" ]");
  myOutput.writeObject("got it");
  myOutput.flush();

  }catch(IOException e){
  e.printStackTrace();
  }
 }
}

Its basically a socket programming and multithreaded application. On executing it on different terminals inorder to have the client and server establish connections, I execute my code. But it throws up the error above on both terminals. Its just got something to do with my declaring the myOutput variable at the wrong place. Could someone help me out.
From the error message, I've highlighted line 63 and line 45 in the piece of code attached.

A: *

*Drop the default constructor

*Make your instance fields (stk and sProrcessId) final

*See how your compiler complains and fix those issues

These instructons help you trading runtime errors like your NPE to compile time errors, which is the best thing you can do. Note: This trick is meant to be used in general.

A: Your object is being initialised with the first constructor, which takes no parameters. As a result, skt is never initialised and is therefore null. When you call skt.getOutputStream(), it throws a null pointer exception because it cannot dereference skt.

A:  ServerConnect(){}
 ServerConnect(Socket connection, String sProcessNo) {
  this.skt = connection;
  this.sProcessId = sProcessNo;
 }

what constructor do you use ? cause skt might be uninitialised
//Edit : oh i see now you use the wrong constructor
   ServerConnect scnt = new ServerConnect();

to
   ServerConnect scnt = new ServerConnect(skt,sProcessId);


text:
Q: Ubuntu 20.04 github, vs-code. https protocol PAT was used git command started to fail today with it was set to use https protocol with personal access token (i double checked it is not expired)
Error:
  An assembly specified in the application dependencies manifest (GitHub.UI.deps.json) was not found:
    package: 'HarfBuzzSharp.NativeAssets.Linux', version: '2.6.1.7'
    path: 'runtimes/linux-x64/native/libHarfBuzzSharp.so'
fatal: helper error (140): Unknown
remote: Repository not found.
fatal: Authentication failed for 'https://github.com/.....git/'

but it used to work just fine yesterday.
Some automatic update had happen yesterday night. What do i do now?

A: Apparently there was a packagin error in a recent release of gcmcore: https://github.com/microsoft/Git-Credential-Manager-Core/issues/528
Downgrade version or download the missing .so files as stated in the link.


text:
Q: How to use updateMany with aggregation pipeline in mongo 3.6 The below query updateMany with aggregation pipeline works in v4.2
db.AlertPreferences.updateMany({},    [
  {
     $match: {
        $expr: {
           $or: [
              { $ne: ["$preferences.MCN-ONE", null] },
              { $ne: ["$preferences.MCN-TWO", null] },
              { $ne: ["$preferences.MCN-THREE", null] }
           ]
        }
     }
  },
  {
     $addFields : {
        preferences: {
           $mergeObjects: [
              { "MCN-ONE": "$preferences.MCN-ONE" },
              { "MCN-TWO": "$preferences.MCN-TWO" },
              { "MCN-THREE": "$preferences.MCN-THREE" }
           ]
        }
     }
  }
])

How to modify this query to run in v3.6 where updateMany with aggregation pipeline feature not available?
//UPDATE
This is the framed query based on suggestions from @prasad_
db.collection.aggregate([
  {
     $match: {
        $expr: {
           $or: [
              { $ne: ["$preferences.MCN-ONE", null] },
              { $ne: ["$preferences.MCN-TWO", null] },
              { $ne: ["$preferences.MCN-THREE", null] }
           ]
        }
     }
  }
]).forEach(doc =>db.preferences.updateOne({ _id: doc._id },      {
     $set : {
        preferences: {
           $mergeObjects: [
              { "MCN-ONE": "$preferences.MCN-ONE" },
              { "MCN-TWO": "$preferences.MCN-TWO" },
              { "MCN-THREE": "$preferences.MCN-THREE" }
           ]
        }
     }
  }))

But it is not updating the documents. Any idea what is wrong?
This is follow up of post .
For example, this is the document
{
"_id" : ObjectId("5d721f5296eaaafd1df263e8"),
"assetId" : "ALL",
"createdTime" : ISODate("2019-09-06T08:56:50.065Z"),
"default" : false,
"lastUpdatedTime" : ISODate("2019-09-06T09:11:35.463Z"),
"platformFleetOrgId" : "A7A33DA4C5CE4DEFBA7E4AFA5CC9D0EE",
"platformPreferenceId" : "F015049C075E4B1E80A1BF52F5EC3A20",
"platformUserId" : "686102DBD5B241D3B2165381CBFD3FC8",
"preferences" : {
    "MCN-TWO" : [
        "ALERTLIST"
    ],
    "MCN-ONE" : [
        "MOBILEPUSH",
        "ALERTLIST",
        "WEBPUSH"
    ],
    "MCN-THREE" : [
        "ALERTLIST"
    ],
    "CCC-ALARM" : [
        "MOBILEPUSH"
    ],
    "SSD-ALARM" : [
        "MOBILEPUSH"
    ],
    "TFT-ALARM" : [
        "MOBILEPUSH",
        "ALERTLIST"
    ],
    "REC-WARN" : []
},
"solutionContext" : "mfm"
}

I am expecting following result after running the query.
{
"_id" : ObjectId("5d721f5296eaaafd1df263e8"),
"assetId" : "ALL",
"createdTime" : ISODate("2019-09-06T08:56:50.065Z"),
"default" : false,
"lastUpdatedTime" : ISODate("2019-09-06T09:11:35.463Z"),
"platformFleetOrgId" : "A7A33DA4C5CE4DEFBA7E4AFA5CC9D0EE",
"platformPreferenceId" : "F015049C075E4B1E80A1BF52F5EC3A20",
"platformUserId" : "686102DBD5B241D3B2165381CBFD3FC8",
"preferences" : {
    "MCN-TWO" : [
        "ALERTLIST"
    ],
    "MCN-ONE" : [
        "MOBILEPUSH",
        "ALERTLIST",
        "WEBPUSH"
    ],
    "MCN-THREE" : [
        "ALERTLIST"
    ]
},
"solutionContext" : "mfm"
}


text:
Q: Declaration of struct variables in other class when obtained by getters I am using Qt 4.5 so do C++. I have a class like this
 class CClass1
    {
         private:
               struct stModelDetails
               {
                      QString name;
                      QString code;
                      ..... // only variables and no functions over here
               };
               QList<stModelDetails> m_ModelDetailsList;

         public:
               QList<stModelDetails> getModelDetailsList();
               ...
    };

In this I have functions that will populate the m_ModelDetailsList;
I have another class say CClassStructureUsage, where I will call the getModelDetailsList() function. Now my need is that I have to traverse the QList and obtain the name, code from each of the stModelDetails.
Now the problem is even the CClass1's header file is included it is not able to identify the type of stModelDetails in CClassStructureUsage. When I get the structure list by
QList<stModelDetails> ModelList = obj->getModelInformationList();

it says stModelDetails : undeclared identifier.
How I can able to fetch the values from the structure? Am I doing anything wrong over here?

A: Since struct stModelDetails is private, it is not visible from outside the class. You should declare it in the public section of your class instead:
class CClass1
{
     private:
           QList<stModelDetails> m_ModelDetailsList;

     public:
           struct stModelDetails
           {
                  QString name;
                  QString code;
                  ..... // only variables and no functions over here
           };

           QList<stModelDetails> getModelDetailsList();
           ...
};

A: You need to use the fully qualified name CClass1::stModelDetails. Now it will tell you it is private :)

A: You've already gotten a couple of suggestions for how to attack your problem directly. I, however, would recommend stepping back for a moment to consider what you're trying to accomplish here. First of all, you've said you only really want the name member of each stModelDetails item. Based on that, I'd start by changing the function to return only that:
QList<QString> GetModelDetailNames();

or, quite possibly:
QVector<QString> GetModelDetailNames();

The former has a couple of good points. First, it reduces the amount of data you need to copy. Second, it keeps client code from having to know more implementation details of CClass1. The latter retains those advantages, and adds a few of its own, primarily avoiding the overhead of a linked list in a situation where you haven't pointed to any reason you'd want to use a linked list (and such reasons are really fairly unusual).
The alternative to that is to figure out why outside code needs access to that much of CClass1's internal data, and whether it doesn't make sense for CClass1 to provide that service directly instead of outside code needing to access its data.

A: The problem is that you declared stModelDetails as a private class. Putting it in the public section should fix your problem.

A: There are two problems:
1. Already mentioned is that you need to move stModelDetails to the public section of your class.
2. Because it is nested, the proper name for it outside of the class is CClass1::stModelDetails.
If you really need access to it from the outside, you may want to consider whether it should be a member of CClass1 or if it should be a stand alone class or struct.  I usually only use nested classes/structs when they are an implementation detail of my class.


text:
Q: Kill all internet explorer's belonging to the current user What's the proper way to shut down all of the instances of internet explorer for the current user using batch commands?  I have this. There can be multiple users logged into the same computer. What am I missing?
taskkill /IM iexplore.exe

A: TASKKILL does support filtering by username, but it's not with the /U switch, as @Wutnaut suggested. Try this:
TASKKILL /FI "USERNAME EQ %USERDOMAIN%\%USERNAME%" /IM IEXPLORE.EXE

The /FI switch allows filtering based on several properties. Here, we're calling the %USERDOMAIN% and %USERNAME% environment variables to get the current user's identity for that filter.
In any case, the filter should not be necessary if you're running from a non-elevated command prompt. Without elevation, you should not be able to control the processes of other users. (This may be dependent on the rights of the current user on the system, and the UAC configuration.)
You may also want to consider adding /T to catch any child processes of Internet Explorer, and/or /F to forcefully terminate everything in case something's hung.
Run TASKKILL /? to get more information about these switches, and proper syntax.