text:
Q: In a Scrum standup, should the discussion of what was done yesterday be limited to tasks on the board or all work done? I know that Scrum rules in daily standups say that team should only talk about what they did yesterday, what they're doing today, and anything blocking them. Nothing else. But the problem is, sometimes developers spend their day doing work irrelevant to their tasks, and then talk about it in the standup. It's what they did yesterday!
In my experience, I found that it's more effective to talk about tasks on the board, to keep the standup focused, and to keep everyone's focus on their tasks, to review their estimations & track their records daily.
Is it valid to limit the discussion to the tasks on the board?

A: As per the Scrum Guide content on daily standups, the three questions for discussion are:

*

*What did I do yesterday that helped the Development Team meet the Sprint Goal?

*What will I do today to help the Development Team meet the Sprint Goal?

*Do I see any impediment that prevents me or the Development Team from meeting the Sprint Goal?

All of the questions focus around the Sprint Goal, not the tasks that are on the board. Again, per the Scrum Guide, the Sprint Goal is created in Sprint Planning and it defines "an objective that will be met within the Sprint through the implementation of the Product Backlog, and it provides guidance to the Development Team on why it is building the Increment".
Everything that your development team does should, ideally, be helping the team progress toward the Sprint Goal. These may be unplanned activities that aren't on the board that had to be done, or they could be things at a lower level that may have been considered and estimated, but at a lower level than an item on the board.
I would say let your team talk about everything that they did yesterday. If they are talking about things that don't help the team reach the Sprint Goal, then someone should bring this up, especially if there were other things that they could have done that did move the team closer to completing the Sprint Goal.
One exception may be if an individual is supporting multiple Scrum teams. In the meeting, they probably shouldn't talk about everything they did yesterday, but what they did in support of the team that is currently having the standup.
The Sprint Retrospective is a great time to talk about this issue with the team. There are plenty of questions to consider:

*

*Is the team underworked on items related to the Sprint Goal?

*Is there too much unplanned work?

*Where is the unplanned work coming from and who is authorizing it?

*Why are people working on things not on the board?

*Should we be showing more details on the board to tie the things you do to items on the board more easily?

A: No, you should talk about what you did yesterday.
If its not on the board you need to do one of the following:

*

*put it on the board,

*stop doing it

*or change teams.

The most common one, say for unplanned emergency work, is to write up a card and stick it on the board. This ensures that at the end of the sprint you can measure velocity and explain why sprint goals were not achieved.
A team member working on stuff which is not in the sprint is in my view one of the primary reasons for agile adoptions failing. Most commonly this is a developer diverted to fix live issues on another project.
Another annoying thing in sprints is "PM talking about meetings for other projects". In my view the PM is not part of the scrum team, they fill the 'Product Owner' Scrum role and thus there to answer questions, not report progress.


text:
Q: The max function of tuples in Python I have a query I am learning python
tp = ("monkey" , "mouse")
max(tp)

output = mouse
how it is mouse ? why not monkey
I was expecting monkeys will be the answer
I didnt understand any video reference so I am asking here

A: Strings can be compared for ordering and are compared in dictionary order. So "monkey" < "mouse" asks the question "should 'monkey' appear before 'mouse' in the dictionary"? And the answer is yes, because the first two letters are the same and the third letter of "monkey" comes earlier in the alphabet than the third of "mouse".
So when you ask for the "bigger" of the two words using max, you're asking which word should appear later in the dictionary, and that's "mouse".

A: As it seams you are looking for the longest word you can pass a function to max with the keyword key, from which the order will be used instead.
In this case key=len will compare len("monkey") > len("mouse")
>>> tp = ("monkey" , "mouse")
>>> max(tp, key=len)
'monkey'

redpajama_set_name: RedPajamaStackExchange


text:
Q: Lubuntu installation on laptop When I try to install Lubuntu 21.04 I faced below error. I already installed Ubuntu 18. I wish to erase Ubuntu and install Lubuntu.

Sorry for dim jpg image. When it asks to do mannual partitioning I'm not sure what to do.
And how to create EFI system partitioning.
My laptop have only 2gb ram. How to set swap memory for that ?
Pls guide me.

A: I'd suggest trying to follow the Lubuntu manual
The chapter you want is 1.3 Installing Lubuntu
Note: I've used stable in the provided URLs, if you were wanting to read the LTS manual the word stable would have been replaced with lts which currently shows the Lubuntu 20.04 LTS manual; stable refers to the 21.04 manual.
If you have questions following the Lubuntu documentation, then you can ask here, or using Lubuntu's other support options including their discourse/forum.
You can install with swap with Lubuntu 21.04, but for more details I'll provide https://discourse.lubuntu.me/t/swap-and-lubuntu-21-04-hirsute-and-up/2591

A: seeing that you wont to replace every thing when you are manual partitioning click "new partition table" and select gpt not mbr then press next.link on how to make swap https://linuxhandbook.com/increase-swap-ubuntu/


text:
Q: Regex add text after each match in a string javascript I have string containing different size images see below:
let newstr='assets/images/iphoneMoviesImg.png 1x,assets/images/iphoneMoviesImg@2x.png 2x,assets/images/iphoneMoviesImg@3x.png 3x'

What I can to do is prevent the images from caching in javascript.
I am trying to build a regex expression that can match to the image extension mime type and add a unique number after to prevent caching.
Below is a example of the result that I am after:
let newstr='assets/images/iphoneMoviesImg.png?3 1x,assets/images/iphoneMoviesImg@2x.png?3 2x,assets/images/iphoneMoviesImg@3x.png?3 3x'

Any advice would be much appreciated!

A: You could use regex with replace() for this?
UPDATE OP wants to replace multiple mime types.

let newstr='assets/images/iphoneMoviesImg.gif 1x,assets/images/iphoneMoviesImg@2x.png 2x,assets/images/iphoneMoviesImg@3x.jpg 3x';

var res = newstr.replace(/(png)/g, 'png?3');
 res = res.replace(/(jpg)/g, 'jpg?3');
 res = res.replace(/(gif)/g, 'gif?3');

console.log(res);


text:
Q: Elasticsearch: filter on an aggregation Since I couldn't find anything on Google:
Is it possible to filter on an aggregation in elasticsearch (5.2). Im thinking of someting like: Get all objects where SUM(obect.X) = 0.
Sample Data
I have the following document-structure:
[
  {
    "id": 123,
    "value": -12
  },
  {
    "id": 123,
    "value": 6
  },
  {
    "id": 123,
    "value": 6
  },
  {
    "id": 245,
    "value": 7
  },
  {
    "id": 245,
    "value": -2
  }
]

I now want to list all the Ids from the database where the sum of the value is qual to 0.
The following query gives the sum of value for each id
{
  "size": 0,
  "aggs": {
    "agg": {
      "terms": {
        "field": "listingId",
        "size": 1000
      },
      "aggs": {
        "SUM": {
          "sum": {
            "field": "photoCount"
          }
        }
      }
    }
  }
}


text:
Q: How to view docker logs from vscode remote container? I'm currently using vscode's remote containers extension with a .devcontainer.json file that points to my docker-compose.yml file.
Everything works fine and my docker-compose start command gets run (which launches a web server), but I haven't found a way to quickly see the logs from the web server. Has anyone found a way to view the docker log output automatically once vscode connects to the remote container?
I know as an alternative I could remove my container's start command and, after vscode connects, manually open a terminal and start the web server, but I'm hoping there's an easier way.
Thanks in advance!

A: This question is really old and I'm not sure it this option was available at this time but just open the Command Palette (F1) and select/find "Remote-Containers: Show Log".
You see now the log of your container in the terminal.

A: You can open the command palette and search for: Remote Explorer: Focus on containers view. You should see a sidebar of containers, if you right click your container you can view logs.

A: I'm not using remote containers, just local once, so not sure if this applies but for locally running containers, you can go to the "Docker" tab (you need to install the official Microsoft Docker VS Code Plugin) where you can see your running containers. Just right-click on the container you want to see the logs for and select "View Logs":

You'll see a new "Task" appear in the Terminal pane that will show all your docker logs:

A: I use VS Code's builtin terminal to see the live logs of the docker container that is connected with VS Code.
When VS Code is connected to the docker container, you can open the builtin terminal using the View > Terminal menu option.  You should see an existing terminal labeled Dev Containers.

A: Maybe this is too late? But for others, this is how I do it.
First, instead of logging stuff to the stdout, I redirect all of the outputs into one single file and then using the tail command to steam the output to the terminal instead.
For example, I am going Go here:

logFile, err := os.OpenFile(logFileName, os.O_WRONLY|os.O_CREATE, 0755)
if err != nil {
  log.Fatal("Fail to open the log file")
}
logrus.SetOutput(logFile)

Once that's done, I open up my terminal and run my the following command:
$ tail -f {logFileName}

That's one way to do it I guess, but I sure hope VSCode can come up with a better solution.

A: In the Remote Explorer tab you can see all your docker containers. Under "Dev Containers" is the container for the service specified in devcontainer.json; the rest are in "Other Containers." Simply right click on the container you're interested in and click "Show Container Log." You'll see the full output of the command for that service, just like in an interactive terminal - not a docker build log!

Note I am using a local development container and did not test with remote containers but I'm guessing it's the same.


text:
Q: Combinations And Permutations Of A Word Different words are being formed by arranging the letters of the word "SUCCESS".
Number of words in which two C's are together but no two S's are together ?

A: Treat the two Cs as a single letter. Then arrange all non S letters, there are 3 such letters (the Cs are counted as one). Over all $3!$ arrangements.
Now, to make sure no two S are adjacent it'll suffice to put at most one S between any of the existing letters (including the extremities). Since there are 3 letters there are 4 possible locations, out of which 3 locations need to be chosen, total of 4 possibilities. Overall the number of arrangements is $3!*4=24$.

A: You have 7 places to put your letters 1 to 7. In my answer the symbol $*$ means "still not filled place".
First choose the place where you are going to put the two C's. Since they must be together you have got 6 choices :
$$CC*****,*CC****,**CC***,***CC**,****CC*,*****CC$$
One can easily see that, doing a symmetry, the last three cases correspond bijectively to the first three cases. So we now just work on the first three cases.
Now for each choice of a place for CC you have got to put three S's not next to each other. You then easily get the following cases :
$$CCS*S*S,SCCS*S*,SCC*S*S,SCCS**S,S*CCS*S,*SCCS*S $$
And of course the symmetric ones :
$$S*S*SCC,*S*SCCS,S*S*CCS,S**SCC,S*SCC*S,S*SCCS* $$
Finally for each such choice of places for the C's and  the S's you have only two choices left : namely, how to place the remaining letter $U,E$. So that you have on the whole :
$$12\times 2=24\text{ choices.}$$


text:
Q: How to detect that stdout is closed (when telnet session is closed) in my program? I am developing a program on embedded Linux. My program is a deamon and has a log function that outputs the log with printf (stdout output).
So If I open a telnet session on the embedded Linux system and then launch my program I will get the output displayed in the telnet session. I am wondering what will happen to the output if I close the telnet session. Where is the output redirected to?
And is it possible to check if stdout is closed when I close the telnet session? In order to avoid my log function to be executed when the stdout is closed.

A: ftell might be handy here. One can check for the EBADF error and stop any further writes. In C, writing to a file handle that is not open leads to undefined behavior.
I am not sure if closing your telnet session is a problem, because the environment itself might get killed if you are using a shell-like environment. I am not too sure about the behavior there.

A: Daemons should handle SIGHUP, which is the signal the terminal will generate on closing. If you don't handle that, your daemon will terminate with telnet.
And if the fd gets disconnected, the output will be lost. In general for logging you should use the syslog() call.


text:
Q: Errors when compiling Orbotix HelloWorld While I've followed the release instructions for 1.6 b1146 to the letter, I'm still unable to get Orbotix' "HelloWorld" to compile.  I'm getting a lot of "Apple Mach-O Linker Error" messages.  What am I doing wrong?
UPDATE:  Hmmm. Looks like Build | Mach-O Type should be set to "Static Library".  All but one of my error messages went away.
Those macho types get me every time. ;-0
UPDATE 11/18/13:
OK, when using Mach-O type "Static Library" setting, there is one remaining error message:
Command /Applications/Xcode 5.0.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool failed with exit code 1
How can I fix this?
UPDATE LATER 11/18/13:
I see in the release notes for 1.6b1146 a couple of sentences that read:  "The QuickStart App Template has been removed from this release since XCode 5 is not compatible.  Please use the following information to manually set up your project."
I've opened the Orbotix "HelloWorld" project and followed the instructions in the release notes, but I am still getting multiple Mach-0 errors.  I am running it on my iPhone 5s, not the emulator.
Do the quoted sentences above mean that none of the Orbotix sample code in the /trunk/samples directory will work?  Do I need to make my own HelloWorld project somehow by copying and pasting from the Orbotix sample code?

A: Phoebe719, I received word of your problems with the SDK through our customer service department. I'm sorry it took us a while for us to get back to you.
As for your issue, do you happen to be attempting to compile this onto an emulator? I myself have been baffled about the Mach-O linker errors when Xcode decides to not build to a device.
If you are building to an emulator, then I'm sorry, but there is no symbols in the iOS SDK for a mac to connect to a Sphero, and therefore, it just won't work. There is a mac SDK out there, but it is in a beta phase.
If not, then go ahead and leave a comment, and I'll see if we can't further diagnose the issue.

A: Phoebe - I just validated that the Sphero iOS SDK v1.6 Hello World sample compiles and executes on a 5s, 5, and 4s with no changes after downloading the Zip from https://github.com/orbotix/Sphero-iOS-SDK
Please validate that you are using a clean copy of the Hello World sample.


text:
Q: Python Pyplot Scatterplot with USA State markers I am trying to create a scatterplot using Python Pyplot.  I am new to using Python and wanted to know you to include the USA state abbreviations as the markers for my scatterplot where the x and y data has states as a data field. Any ideas?

A: Try this piece of code
import matplotlib.pyplot as plt

x_coords = [0.13, 0.22, 0.39, 0.59, 0.68, 0.74, 0.93]
y_coords = [0.75, 0.34, 0.44, 0.52, 0.80, 0.25, 0.55]
xy_name = ['AK', 'TX', 'CS', 'AH', 'DG', 'PL', 'JK']

fig = plt.figure(figsize=(8,5))
plt.scatter(x_coords, y_coords, marker='s', s=50)

for x, y, z in zip(x_coords, y_coords, xy_name):
    plt.annotate(
        '(%s)' % (z),
        xy=(x, y),
        xytext=(0, -10),
        textcoords='offset points',
        ha='center',
        va='top')

plt.xlim([0,1])
plt.ylim([0,1])
plt.show()

Results in


text:
Q: Umbraco Log table is getting filled with At /keepalive/ping.ashx (Referred by: ): I am getting the following error log entry in every few seconds into one of the website UmbracoLog table...
At /keepalive/ping.ashx (Referred by: ):
Trying to find the solution for the issue for few days without any success.. please see my post in Our Umbraco
http://our.umbraco.org/forum/using/ui-questions/33930-Error-in-umbracoLog-table-At-keepalivepingashx-%28Referred-by-%29?p=0#comment124646

A: So keepalives are generally used to stop the old CMS backend falling foul of the app pool going to sleep after 20 mins or so.
It sounds like something is happening in your solution that is firing every few seconds which is a bit odd.
If you have nopCommerce installed at all? This post here describes the issue you are having and where to disable the keepalive if you need to.
http://www.nopcommerce.com/boards/t/6895/why-getting-pingashx-on-online-customer-module-.aspx


text:
Q: How we save a Huge pyspark dataframe? I have a big pyspark Dataframe which I want to save in myfile (.tsv)  for further use. To do that, I defined the following code:
with open(myfile, "a") as csv_file:
        writer = csv.writer(csv_file, delimiter='\t')
        writer.writerow(["vertex" + "\t" + "id_source" + "\t" + "id_target" + "\t"+ "similarity"])

        for part_id in range(joinDesrdd_df.rdd.getNumPartitions()):
            part_rdd = joinDesrdd_df.rdd.mapPartitionsWithIndex(make_part_filter(part_id), True)
            data_from_part_rdd = part_rdd.collect()
            vertex_list = set()

            for row in data_from_part_rdd:
                writer.writerow([....])

        csv_file.flush()

My code cannot pass this step, It generates an exception:
1.In the workers log:
19/07/22 08:58:57 INFO Worker: Executor app-20190722085320-0000/2 finished with state KILLED exitStatus 143
14: 19/07/22 08:58:57 INFO ExternalShuffleBlockResolver: Application app-20190722085320-0000 removed, cleanupLocalDirs = true
14: 19/07/22 08:58:57 INFO Worker: Cleaning up local directories for application app-20190722085320-0000
 5: 19/07/22 08:58:57 INFO Worker: Executor app-20190722085320-0000/1 finished with state KILLED exitStatus 143
 7: 19/07/22 08:58:57 INFO Worker: Executor app-20190722085320-0000/14 finished with state KILLED exitStatus 143
...

2.in the Job execution log:
Traceback (most recent call last):
  File "/project/6008168/tamouze/RWLastVersion2207/module1.py", line 306, in <module>
    for part_id in range(joinDesrdd_df.rdd.getNumPartitions()):
  File "/cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/spark/2.3.0/python/lib/pyspark.zip/pyspark/sql/dataframe.py", line 88, in rdd
  File "/cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/spark/2.3.0/python/lib/py4j-0.10.6-src.zip/py4j/java_gateway.py", line 1160, in __call__
  File "/cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/spark/2.3.0/python/lib/pyspark.zip/pyspark/sql/utils.py", line 63, in deco
  File "/cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/spark/2.3.0/python/lib/py4j-0.10.6-src.zip/py4j/protocol.py", line 320, in get_return_value
py4j.protocol.Py4JJavaError: An error occurred while calling o528.javaToPython.
: org.apache.spark.sql.catalyst.errors.package$TreeNodeException: execute, tree:
Exchange hashpartitioning(id_source#263, id_target#292, similarity#258, 1024)
+- *(11) HashAggregate(keys=[id_source#263, id_target#292, similarity#258], functions=[], output=[id_source#263, id_target#292, similarity#258])

I don't know why this piece of my code generates the exception. Note that on small data, the execution is ok, but with big data it's not.
Also, please what is the best way to save a pysaprk dataframe for further use?
Update:
I tried to replace the above with loop by the following:
joinDesrdd_df.withColumn("par_id",col('id_source')%50).repartition(50, 'par_id').write.format('parquet').partitionBy("par_id").save("/project/6008168/bib/RWLastVersion2207/randomWalkParquet/candidate.parquet")

I get similar exception:
19/07/22 21:10:18 INFO TaskSetManager: Finished task 653.0 in stage 11.0 (TID 2257) in 216940 ms on 172.16.140.237 (executor 14) (1017/1024)
19/07/22 21:11:32 ERROR FileFormatWriter: Aborting job null.
org.apache.spark.sql.catalyst.errors.package$TreeNodeException: execute, tree:
Exchange hashpartitioning(par_id#328, 50)
+- *(12) HashAggregate(keys=[id_source#263, id_target#292, similarity#258], functions=[], output=[id_source#263, id_target#292, similarity#258, par_id#328])
   +- Exchange hashpartitioning(id_source#263, id_target#292, similarity#258, 1024)
      +- *(11) HashAggregate(keys=[id_source#263, id_target#292, similarity#258], functions=[], output=[id_source#263, id_target#292, similarity#258])
         +- *(11) Project [id_source#263, id_target#292, similarity#258]
            +- *(11) BroadcastHashJoin [instance_target#65], [instance#291], Inner, BuildRight

A: I'd suggest to use the Spark native write functionality:
joinDesrdd_df.write.format('csv').option("header", "true").save("path/to/the/output/csv/folder")

Spark will save each partition of the dataframe as a separate csv file into the path specified. You can control the number of files by the repartition method, which will give you a level of control of how much data each file will contain.
I'd also like to suggest to use ORC or Parquet data format for big datasets, since they are definitely more suited for storage of big datasets.
For example for parquet:
joinDesrdd_df.withColumn("par_id",col('id_source')%50). \
 repartition(50, 'par_id').write.format('parquet'). \
 save("/project/6008168/bib/RWLastVersion2207/randomWalkParquet/candidate.parquet")

To read it back into dataframe:
df = spark.read. \
 parquet("/project/6008168/bib/RWLastVersion2207/randomWalkParquet/candidate.parquet")


text:
Q: Why does a setter not work with a specific selection? Sorry for the poorly worded title but I couldn't figure out how to properly summarize the problem.
I created a chess game where the location is kept by the Board. The pieces do not know their location, with the exception of the King. Any time the King moves, its location is updated with a simple setter-
Gameflow.java
    public static void movePiece(Player player, int pieceSelection, int action) {
        int x = pieceSelection / 10;
        int y = pieceSelection % 10;
        Board board = Board.boardConstructor(); //board is a Singleton
        Piece piece = Board.squares[x][y].getPiece();
        ...
           if (piece.getType().equals(Type.KING)) {
                King king = (King) piece;
                king.setXY(endX, endY);
                System.out.println("King moved to " + king.getX() + king.getY()); //prints old location
            }

King.java
public class King extends Piece {
    ...
    public void setXY(int x, int y) {
        this.x = x;
        this.y = y;
        System.out.println("The King's location is now " + this.x + this.y); //prints new location
    }

The println inside the setter in King.java outputted as expected but the King's location was not being updated elsewhere
I was bamboozled as to why the updated location was not being saved but I nevertheless was able to fix the problem by changing one line-
Gameflow.java
    public static void movePiece(Player player, int pieceSelection, int action) {
            if (piece.getType().equals(Type.KING)) {
                King king = player.getKing(); // <-- changed how I select the King
                king.setXY(endX, endY);
                System.out.println("King moved to " + king.getX() + king.getY()); //prints correctly
            }

Here is my code that copies the pieces and grabs the king via the player
Player.java
   private Player(String name, boolean isWhite) {
        this.name = name;
        this.isWhite = isWhite;
        if (isWhite) {
            team = createPieces(6);
        } else {
            team = createPieces(0);
        }
    }

    public static Piece[] createPieces(int start) {
        Piece[] team = new Piece[16];
        int count = 0;
        int end = start + 2;
        for (int i = start; i < end; i++) {
            for (int j = 0; j < 8; j++) {
                team[count] = Board.squares[i][j].getPiece();
                count++;
            }
        }
        return team;
    }

    public King getKing() {
        Piece theKing = Arrays.stream(team).filter(x -> x.getType() == Type.KING).findFirst()
                .orElse(null);
        return (King) theKing;
    }

My problem is fixed but I am none the wiser. Why did that fix my code? Why was it not working earlier?
Piece is an abstract class, team is an array of the player's pieces.

A: It's hard to say without looking at Board, but I see a number of warning signs: The call to Board.boardConstructor() sounds like it's getting a new board, rather than the existing board. You're almost certainly working with a different instance of a piece in the code. Try replacing your code to get the king with the following:
King king = player.getKing(); // <-- changed how I select the King
System.out.println(Integer.toHexString(System.identityHashCode(piece) + "\t"
    + Integer.toHexString(System.identityHashCode(king)));

if the two hash codes printed differ, that indicates that they're different instances of the piece and the logic elsewhere is to blame.

A: Don Hosek pointed out where my problem was coming from but I still needed to investigate further to determine the why so I plugged his code into both my Board and each Team. I expected to find one set of 32 hash codes being printed twice, but instead the result was 64 distinct hash codes, aka 2 sets of unique values.
After further use of the hash codes, I found that it was the Pieces on the Board that were mutating. They changed only once, before the first move, which gave me a strong clue as to the problem.
As is often the case with the most confusing errors, the answer was exceedingly simple. Originally this was a Java terminal game that I moved to Spring/React and while doing so, I transposed two lines of code involved in the creation of a new Game (initialization of the Board and of the Players). The solution was merely swapping them back.
I don't know how I didn't get a more critical error by creating Players before the Board when all the Pieces are instantiated by the Board, and I'm very, very surprised that this small issue was the only noticeable effect from such a serious bug.


text:
Q: "Couldn't load memtrack module (No such file or directory)" What causes this issue? I have been getting this area ever since I added the Interest Activity, before hand it worked fine, now I'm getting this error in logcat:
2019-04-10 11:51:59.045 4216-4216/? E/memtrack: Couldn't load memtrack module (No such file or directory)
2019-04-10 11:51:59.047 4216-4216/? E/android.os.Debug: failed to load memtrack module: -2

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.sample.foo.simplerssreader">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".InterestActivity"
            android:label="Interests"
            android:parentActivityName=".MainActivity">
        </activity>
        <activity android:name=".ContactActivity"
            android:label="Contact Us"
            android:parentActivityName=".MainActivity">
        </activity>
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>


text:
Q: Cannot connect to SQL Server from python with a specific user I have to users to connect to a SQL Server. On the server, I need to read from SQL Server into python and write from python to SQL Server.
When I login with one one the users, everything goes fine with connection, whether I use Windows authentication or SQL Server authentication, with this code:
SQL Server authentication:
import sqlalchemy
engine = sqlalchemy.create_engine("mssql+pyodbc://myservername/mydatabasename/driver=SQL+Server+Native+Client+11.0?Trusted_Connection = no/UID = sa/PWD = mypassword")
conn = engine.connect()
df.to_sql(name = 'TestTable1', schema='dbo', con = conn)

Windows authentication:
import sqlalchemy
engine = sqlalchemy.create_engine("mssql+pyodbc://myservername/mydatabasename/driver=SQL+Server+Native+Client+11.0?Trusted_Connection = yes")
conn = engine.connect()
df.to_sql(name = 'TestTable1', schema='dbo', con = conn)

but with another user, I got this error:

Data source name too long State:IM010,Native:0,Origin:[Microsoft][ODBC Driver Manager]

Does this error do something with the other user?

A: For every login SQL Server needs credentials setup for Windows authentication or SQL Server authentication. You can test the credentials using SSMS before you use them in the Python program.


text:
Q: Using having clause to select multiple values in my table I have exams (exam_key) that patients (patient_key) had in hospital with date (exam_date). There are several queries I need to perform:

*

*Total amount of studies and patients by year. This is relatively simple and works:

select count(exam_key) as TOTAL_EXAMS, count(distinct(patient_key)) as TOTAL_PATIENTS,
year(procedure_start) as EXAM_YEAR
FROM hospitals
group by year(procedure_start)
order by year(procedure_start)

*Now I need to do the same but only for patients that had >2 exams. Here what I tried

select count(exam_key) as TOTAL_EXAMS, count(distinct(patient_key)) as TOTAL_PATIENTS,
year(procedure_start) as EXAM_YEAR
FROM hospitals
group by year(procedure_start), patient_key having count(exam_key)>2
order by year(procedure_start)

But this will only show each single patient with corresponding amount of studies like that
Total_Patients  Total_studies   YEAR_
1          3            2013
1                     5         2013
How can I group this by sum or count of patient_key having count(exam_key)>2 ?
Because

group by year(procedure_start), count(patient_key having count(exam_key)>2)

doesnt work

A: try this
select EXAM_YEAR, sum(TOTAL_PATIENTS) as TOTAL_PATIENTS, sum(TOTAL_EXAMS) as TOTAL_EXAMS from (
    select count(exam_key) as TOTAL_EXAMS, count(distinct(patient_key)) as TOTAL_PATIENTS,
    year(procedure_start) as EXAM_YEAR
    FROM hospitals
    group by year(procedure_start), patient_key having count(exam_key)>2
)
group by EXAM_YEAR
order by EXAM_YEAR


text:
Q: LuaTeX compilation completed and no errors, yet font doesn't show up I decided to try using some new fonts and LuaLaTeX, and so I downloaded some fonts and installed them using the instructions from the first answer in this post. I put the setup into my preamble and compilation with LuaTeX worked, but what I got was Computer Modern instead of the installed fonts, so I'm not sure what's happening.
I also tried using mkluatexfontdb --force --verbose=-1 -vvv, but what happened was a mkluatexfontdb: command not found error, so I had to do it all manually by linking the correct folder.
Here is the font part of the setup in my preamble:
% Font / LuaLaTeX setup
\RequirePackage{iftex}
\ifpdftex
\ifluatex
    \RequirePackage{fontspec}
    \RequirePackage{unicode-math}
    \unimathsetup{math-style=TeX}
    \RequirePackage[english]{babel}
    \defaultfontfeatures{Ligatures=TeX, Scale=MatchLowercase}
    \setmainfont[
    Path=/usr/share/fonts/opentype/linux-libertine/,
    Extension=.otf,
    BoldFont=LinLibertine_RB,
    ItalicFont=LinLibertine_RI,
    BoltItalicFont=LinLibertine_RBI,
    ]{LinLibertine_R}
    \setsansfont[
    Path=/mnt/c/Users/user/Appdata/Local/Microsoft/Windows/Fonts, % yes I also added Windows fonts to the font dir and it appears when doing fc-list | grep -i <windows font>
    Extension=.otf,
    BoldFont=Kurier-Bold,
    ItalicFont=Kurier-Italic,
    BoldItalicFont=Kurier-BoldItalic,
    ]{Kurier-Regular}
    \setmonofont[
    Path=/mnt/c/Users/user/Appdata/Local/Microsoft/Windows/Fonts,
    Extension=.ttf,
    BoldFont=Inconsolata-Bold,
    ]{Inconsolata-Regular}
\else
% regular times
\RequirePackage[T1]{fontenc}
\RequirePackage{newtxtext}
\RequirePackage[smallerops]{newtxmath}
\fi
\fi

Perhaps there's something in my preamble that I missed, or perhaps it's something else entirely. If someone knows how to solve this problem, it would be great. Thanks!


text:
Q: how to combine two nodes with different properties merge as one node in cypher? how will I combine two nodes with different properties and merge as one node in cypher?
example node 1 has property of name with value of name1 and node 2 has property of classification and value of class1 to be merge as one node,combining the two properties
tnx

A: I'm pretty sure that this is not currently possible dynamically, but if you know what properties you're transferring:
MATCH (a:Label), (b:Label)
WHERE <something about a and b>
SET a.constraint = b.constraint, a.other_prop = b.other_prop
DELETE b // If you want do delete b

Otherwise I'd suggest using Cypher to load the objects, merge the properties in memory, and then make a query to save the result.  I'd suggest checking out the SET clause and the += operator (here which can take a Map (Hash/Dictionary/whatever) and append all of the given properties that way.

A: i think it will be possible
see http://neo4j.com/docs/stable/query-set.html
MATCH (at { name: 'Andres' }),(pn { name: 'Peter' })
SET at = pn
RETURN at, pn

Use += if you don't want to delete the properties of the first node.


text:
Q: no function clause matching in Plug.Conn.put_resp_header/3 Just started studying Elixir/Phoenix and I cant figure out why I'm getting this no function clause matching in Plug.Conn.put_resp_header/3 error.
Here's my code:
  def index(conn, params) do
    page = Todo |> Repo.paginate(params)

    conn
    |> put_status(:ok)
    |> put_resp_header("x-total-count", page.total_entries)
    |> render("index.json", todos: page.entries)
  end

and the trace
[error] #PID<0.457.0> running TodoApp.Endpoint terminated
Server: localhost:4000 (http)
Request: GET /api/todos
** (exit) an exception was raised:
    ** (FunctionClauseError) no function clause matching in Plug.Conn.put_resp_header/3
        (plug) lib/plug/conn.ex:626: Plug.Conn.put_resp_header(%Plug.Conn{adapter: {Plug.Adapters.Cowboy.Conn, :...}, assigns: %{}, before_send: [#Function<1.82124947/1 in Plug.Logger.call/2>], body_params: %{}, cookies: %Plug.Conn.Unfetched{aspect: :cookies}, halted: false, host: "localhost", method: "GET", owner: #PID<0.457.0>, params: %{}, path_info: ["api", "todos"], path_params: %{}, peer: {{127, 0, 0, 1}, 50059}, port: 4000, private: %{TodoApp.Router => {[], %{}}, :phoenix_action => :index, :phoenix_controller => TodoApp.TodoController, :phoenix_endpoint => TodoApp.Endpoint, :phoenix_format => "json", :phoenix_layout => {TodoApp.LayoutView, :app}, :phoenix_pipelines => [:api], :phoenix_router => TodoApp.Router, :phoenix_view => TodoApp.TodoView, :plug_session_fetch => #Function<1.112984571/1 in Plug.Session.fetch_session/1>}, query_params: %{}, query_string: "", remote_ip: {127, 0, 0, 1}, req_cookies: %Plug.Conn.Unfetched{aspect: :cookies}, req_headers: [{"host", "localhost:4000"}, {"connection", "keep-alive"}, {"cache-control", "no-cache"}, {"user-agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36"}, {"postman-token", "d94524ad-4d13-e170-0ac5-021c21337895"}, {"accept", "*/*"}, {"accept-encoding", "gzip, deflate, br"}, {"accept-language", "en-US,en;q=0.9,pt;q=0.8"}], request_path: "/api/todos", resp_body: nil, resp_cookies: %{}, resp_headers: [{"cache-control", "max-age=0, private, must-revalidate"}, {"x-request-id", "1i0cddqagrkiocppi9404phdn4ajd9i7"}], scheme: :http, script_name: [], secret_key_base: "LH/fxSBb227JHpUba0PZAAYwf8N9NQCVmHe0SrnoUIXuHVUhWXeg3voq0H82qEl/", state: :unset, status: nil}, "x-total-count", 2)
        (todo_app) web/controllers/todo_controller.ex:11: TodoApp.TodoController.index/2
        (todo_app) web/controllers/todo_controller.ex:1: TodoApp.TodoController.action/2
        (todo_app) web/controllers/todo_controller.ex:1: TodoApp.TodoController.phoenix_controller_pipeline/2
        (todo_app) lib/todo_app/endpoint.ex:1: TodoApp.Endpoint.instrument/4
        (phoenix) lib/phoenix/router.ex:278: Phoenix.Router.__call__/1
        (todo_app) lib/todo_app/endpoint.ex:1: TodoApp.Endpoint.plug_builder_call/2
        (todo_app) lib/plug/debugger.ex:99: TodoApp.Endpoint."call (overridable 3)"/2
        (todo_app) lib/todo_app/endpoint.ex:1: TodoApp.Endpoint.call/2
        (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
        (cowboy) /Users/fskinner/Git/phoenix/todo_app/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4

I've checked... page.entries has a value of 2 (as you can see on the trace)
Tried changing those pipes to usual Plug.Conn.put_resp_header/3 but no success.
I based that code of the create code generated by phoenix in API mode... Just like this:
  def create(conn, %{"todo" => todo_params}) do
    changeset = Todo.changeset(%Todo{}, todo_params)

    case Repo.insert(changeset) do
      {:ok, todo} ->
        conn
        |> put_status(:created)
        |> put_resp_header("location", todo_path(conn, :show, todo))
        |> render("show.json", todo: todo)
      {:error, changeset} ->
        conn
        |> put_status(:unprocessable_entity)
        |> render(TodoApp.ChangesetView, "error.json", changeset: changeset)
    end
  end

The pagination is working since the endpoint returns correctly when i remove those pipes and only keep that render func

A: Well, it seems I'm just stupid. The problem was that Plug.Conn.put_resp_header/3 expects a string as its last arg and page.total_count was an Integer.
Solved by parsing it via Integer.to_string(page.total_entries)
Final solution was:
  def index(conn, params) do
    page = Todo |> Repo.paginate(params)

    conn
    |> put_status(:ok)
    |> put_resp_header("x-count", Integer.to_string(page.total_entries))
    |> render("index.json", todos: page.entries)
  end


text:
Q: Making model and setting values in typescript I am working on an angular application. I want to send data to post API. My json looks something like this
{
    "name": "julie",
    "id": 1,
    "PersonalDetails": {
        "homeId": 23,
        "homeName": "Julie Home"
    },
    "OfficialDetails": {
        "OfficeId": 45,
        "OfficeAddress": "Near townhall"
    }
}

In my component I want to make this data obviously will be setting values using variable in my component and send it to my post API method. In future I may need to send more model attaching in above structure but different data, so thinking if making interface will work. But I am new to typescript so not able to decide and do it
I just want to know what will be the good approach to make model for this and set values. How to make model/interface and set values?

A: In your case, you need to make the basic interface for your data.
For example.
interface YourData {
  id?: number;
  name?: string;
  PersonalDetails?: PersonalDetails
  OfficialDetails?: OfficialDetails
}

Then, its better to create an interface for each subitem in your data. In your case its, PersonalDetails and OfficialDetails.
interface PersonalDetails {
  homeId?: number;
  homeName?: string;
}

interface OfficialDetails {
  OfficeId?: number;
  OfficeAddress?: string;
}

In future you can extend your interface and make you data flexible.
After successfully-created interface, just cast all values that you need, using the interface. For example:
sendData(payload: YourData): Observable<YourData> {
  return this.http.post<YourData>(payload)
    .pipe(
      ...
    );
}


text:
Q: Bracket on the side of a fraction only over the numerator or denominator I've been trying to put a curly bracket next to the denominator of a fraction, something like this
\frac{1}{a + b} \} = 1

where a + b = 1.
Basically I need to move the bracket down a bit, but v space doesn't seem to work for this.

A: Use mathtools and its \mathrlap macro
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\[
  \frac{1}{a + b \mathrlap{\ \} = 1} }
\]
\end{document}

BTW: Next time please post a full minimal example like above. That makes it s lot easier for others to test your code and not get stumped by some missing package you did not mention.

A: A solution with stacks.  Here, the equation axis remains aligned with the = sign, which may be important in some use cases.
\documentclass{article}
\usepackage{stackengine,amsmath}
\stackMath
\begin{document}
\[
\stackon[-\dp\strutbox]{}{\dfrac{1}{a+b\strut}} \} = 1
\]
\end{document}

Alternately,
\documentclass{article}
\usepackage{stackengine,amsmath}
\stackMath
\begin{document}
\[
\stackon[0pt]{}{\dfrac{1}{\smash{a+b}}} \} = 1
\]
\end{document}

A: A variant of the good previous answer could be using aligned with a matrix as in the figure (for the denominator):

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools}
\begin{document}
\[\begin{aligned}
\frac{1}{a + b} & \begin{matrix}  & \\ \,\}=1\end{matrix}
\end{aligned}\]
\end{document}


text:
Q: How to query and count and count distinct at the same time? SELECT * FROM UserTable limit 100 ORDER BY userID ASC offset 0 ROWS;
SELECT COUNT(*) FROM UserTable;
SELECT COUNT(DISTINCT email) FROM UserTable;

How to combine it all into one query?
Expected output should be something like
totalCount    distinctCount    userID    email ...
100000        1000             1         qwerty@qwerty.com
100000        1000             2         qwerty@qwerty.com
100000        1000             3         abc.abc.com
...

A: You could use a cross join on the count subquery
  SELECT t.totalCount, t.distinctCount, UserTable.*
  FROM UserTable
  cross join (
    SELECT COUNT(*)  totalCount, COUNT(DISTINCT email) as distinctCount
    FROM UserTable
  ) t
  ORDER BY userID ASC limit 100

A: here you are:
    select
(select count(*) from UserTable a) as count,
(select count(DISTINCT quarter) from UserTable b) as distinctCount,
c.* from UserTable as c order by userID ASC limit 100;

A: You're looking for a group by:
Try following query:
SELECT * FROM UserTable limit 100 ORDER BY userID ASC offset 0 ROWS GROUP BY email

A: You could achieve it using subquery Join in MySQL:
SELECT UserTable.*, tc.totalCount, dc.distinctCount
FROM UserTable
JOIN (
    SELECT COUNT(*) as totalCount
    FROM UserTable
) tc
JOIN (
    SELECT COUNT(DISTINCT email) as distinctCunt
    FROM UserTable
) dc
ORDER BY userID ASC
LIMIT 100


text:
Q: Why is my Javascript import in ES6 not working? Unexpected token * im currently trying to implement FilePond in my Project. I've tried to implement it through npm installation, but somehow my Browser constantly throws this error:
Uncaught SyntaxError: Unexpected token *

I'm guessing it has something to with ES6, but I can't figure out how to fix it.
My Javascript code looks like this:

import * as FilePond from 'filepond';
import FilePondPluginImagePreview from 'filepond-plugin-image-preview';

FilePond.registerPlugin(
    FilePondPluginImagePreview()
);

const inputElement = document.querySelector('input[type="file"]');
const pond = FilePond.create( inputElement,{
    allowImagePreview: true,

});

FilePond.setOptions({
    server: 'test/'
});

I've tried to google an answer to this but it seems like I can't find a solution to this one. I've red something about compiling the ES6 code with Bable, but  don't really know..
Thank you for your help! :)

A: If you want to use FilePond in the browser AND you want to use the ES module version you can go for dynamic imports or a script tag with type module. Browser support isn't fantastic.
Another option is to use the UMD version of the library and simply include the script tag as described in the docs.
The third option would be to use Rollup or Webpack with Babel.
Dynamic Imports
<link href="./filepond.css" rel="stylesheet">
<input type="file"/>

<script>
import('./filepond.esm.js').then(FilePond => {
  FilePond.create(document.querySelector('input'));
});
</script>

Type Module
<link href="./filepond.css" rel="stylesheet">
<input type="file"/>

<script type="module" src="./filepond.esm.js"></script>
<script>
document.addEventListener('FilePond:loaded', e => {
    const FilePond = e.detail;
    FilePond.create(document.querySelector('input'));
})
</script>

Some other notes
FilePond.registerPlugin(
    FilePondPluginImagePreview()
);

Remove the (), those are not needed.
const pond = FilePond.create( inputElement,{
    allowImagePreview: true,
});

Plugins are automatically enabled so setting allowImagePreview to true is also not required.


text:
Q: libGD perl and php wrapper output differs I'm currently working on a project that involves a comparison between different
image processing libraries. One of these libraries is libGD. I'm using the perl
wrapper as well as the php wrapper.
My problem now is that the same input image produces completely different output images
depending on which wrapper was used. If I invoke the libGD function via the perl
wrapper the resulting image is roughly 40% larger than the output of the php wrapper.
A difference image made with imagemagick also shows that both images are very different.
The parametrization of both function calls is absolutely identical (quality, resolution, geometry). I also checked if there is more than one version of libGD installed on my system, there is not.
Shouldn't both wrappers produce the same output or am I completely mistaken?

A: Both libs made exactly the same library calls. The problem was that the perl wrapper
should produce truecolor images as a default, he also writes truecolor as the type into the image header. (imagemagicks identify outputs truecolor as type). But in reality it's not
a truecolor but a palette image. When manually set to truecolor the images are 100% identical.
Thanks for your time.


text:
Q: Can not download file from MongoDB gridFS using nodeJS I am using nodeJS and expressJS to upload and download file to gridFS following the below tutorial.
https://ciphertrick.com/2017/02/28/file-upload-with-nodejs-and-gridfs-mongodb/
File upload works fine. But when I try to download I can only see the content of the file on browser (e.g image/text). But I am unable to download the physical file. Any help will be much appreciated. Thanks!
    var express = require('express');
    var app = express();
    var bodyParser = require('body-parser');
    var mongoose = require('mongoose');
    mongoose.connect('mongodb://127.0.0.1/gridfstest');
    var conn = mongoose.connection;
    var multer = require('multer');
    var GridFsStorage = require('multer-gridfs-storage');
    var Grid = require('gridfs-stream');
    Grid.mongo = mongoose.mongo;
    var gfs = Grid(conn.db);

/** Seting up server to accept cross-origin browser requests */
app.use(function(req, res, next) { //allow cross origin requests
    res.setHeader("Access-Control-Allow-Methods", "POST, PUT, OPTIONS, DELETE, GET");
    res.header("Access-Control-Allow-Origin", "http://localhost:3000");
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    res.header("Access-Control-Allow-Credentials", true);
    next();
});

app.use(bodyParser.json());

/** Setting up storage using multer-gridfs-storage */
var storage = GridFsStorage({
    gfs : gfs,
    filename: function (req, file, cb) {
        var datetimestamp = Date.now();
        cb(null, file.fieldname + '-' + datetimestamp + '.' + file.originalname.split('.')[file.originalname.split('.').length -1]);
    },
    /** With gridfs we can store aditional meta-data along with the file */
    metadata: function(req, file, cb) {
        cb(null, { originalname: file.originalname });
    },
    root: 'ctFiles' //root name for collection to store files into
});

var upload = multer({ //multer settings for single upload
    storage: storage
}).single('file');

/** API path that will upload the files */
app.post('/upload', function(req, res) {
    upload(req,res,function(err){
        if(err){
             res.json({error_code:1,err_desc:err});
             return;
        }
         res.json({error_code:0,err_desc:null});
    });
});

app.get('/file/:filename', function(req, res){
    gfs.collection('ctFiles'); //set collection name to lookup into

    /** First check if file exists */
    gfs.files.find({filename: req.params.filename}).toArray(function(err, files){
        if(!files || files.length === 0){
            return res.status(404).json({
                responseCode: 1,
                responseMessage: "error"
            });
        }
        /** create read stream */
        var readstream = gfs.createReadStream({
            filename: files[0].filename,
            root: "ctFiles"
        });
        /** set the proper content type */
        res.set('Content-Type', files[0].contentType)
        /** return response */
        return readstream.pipe(res);
    });
});

app.listen('3002', function(){
    console.log('running on 3002...');
});


text:
Q: How to store same JS function with different parameters in array and call them? I need to use a function like this for multiple times with different ids based on different conditions (e.g. select values). I don't want to write a different function for every id because there will be lots of them in the future.
var getValue = function(id){

    var Element = document.getElementById(id);

    if(Element){
        if(Element.value){
            return " " + Element.value;
        }
        return "";
    }
    return "";
}

I have an array including some other functions:
FunctionList = [ SomeFunction, SomeFunction2 ];

Based on some conditions, I add getValue function with different parameters to this array.
FunctionList.push(getValue(SomeId1));
FunctionList.push(getValue(SomeId2));
FunctionList.push(getValue(SomeOtherId));

In the end, I need to add outputs of my functions (which are strings) to another string.
var updateCode = function(){
    var code = CodeHeader;
    for (var i=0; i<FunctionList.length; i++){
        code += FunctionList[i]();
    }
    return code;
}

But I am unable to use it like this since some items of array are not function names now.
I like pure js solutions, but if it's not possible I can go for jQuery or so.

A: You can use bind to create such a tailored function on the fly:
FunctionList.push(getValue.bind(null, SomeId1));

The first argument (null here) will act as this during function execution.
This differs from what you had:
FunctionList.push(getValue(SomeId1));

...as here you don't push a function, but the result of a function execution. bind however, will not execute the function, but create a new one from the given function.
Alternative
In your example you call the same function with different arguments. If that is always the case, you could also go for an array of only arguments:
argumentList.push(SomeId1); // Not the function, just the argument
// ...etc

And then updateCode would become:
var updateCode = function(){
    var code = CodeHeader;
    for (var i=0; i<argumentList.length; i++){
        code += getValue(argumentList[i]);
    }
    return code;
}

... or shorter by using map:
var updateCode = () => CodeHeader + argumentList.map(getValue).join("");

As in your getValue function, you prefix the returned value with a space, you could omit that prefix, and just use .join(" ") in the above one-liner. The downside is that it would not deal the same way with empty return values.


text:
Q: How to place a control (say, a button) in the main window mannually using .rc resource script Firstly, I am trying to create GUI using pure C++ text. Since my application does not need complex GUI, I want to avoid Visual Studio.
So I have the following code in my .rc file:
#include "resource.h"

IDR_MYMENU MENU
BEGIN
    POPUP "&File"
    BEGIN
        MENUITEM "E&xit", ID_FILE_EXIT
    END
END

EDITTEXT IDC_BY,25,7,25,25,ES_NUMBER

IDI_MYICON ICON "one.ico"

The compiler shows syntax error at the EDITTEXT line. I have the idea that this EDITTEXT should be placed under something, such as a menu, instead of directly in the .rc file. I have read somewhere saying the only way to place a control in a window is to place the control in a dialog box which is then placed in the window. However, from my research, I got the idea that a dialog box is a "new pop-up window" rather than part of the original window. I hope I have explained it well. Thanks in advance for the help.

A: EDITTEXT statement should appear inside of dialog resource block, for details see Resource file reference documentation. You may want to use dialog from default win32 application as a starting point for writing your own resource file.
IDD_ABOUTBOX DIALOGEX 0, 0, 170, 62
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About Win32Project2"
FONT 8, "MS Shell Dlg"
BEGIN
    ICON            IDR_MAINFRAME,IDC_STATIC,14,14,21,20
    LTEXT           "Win32Project2, Version 1.0",IDC_STATIC,42,14,114,8,SS_NOPREFIX
    LTEXT           "Copyright (C) 2017",IDC_STATIC,42,26,114,8
    DEFPUSHBUTTON   "OK",IDOK,113,41,50,14,WS_GROUP
END


text:
Q: HTML Organization Microdata Just On About Us Page Or Front Page Also This is more of a personal preference question than a right/wrong question...
I have an "about us" page that is filled with schema.org microdata.  We have name/address/phone/etc... on our front page, as well.
Is there any point including that microdata on the front page?  It seems like it would be better for search engines to only have 1 page to point to.  At the same time, though, it seems like 1 page should be the front page.

A: I'd put it on both. Let Google figure out the ranking. In the "worst" case, someone searching for your organization will see two Google results with rich snippets.


text:
Q: How to add FK to existingTable? How can I add fk to the field img for table message, that i get the image-name automaticlly from table user ?

A: UPDATE:
If my understanding is correct.  You have UserTable built as Above.
A single user has a SINGLE image.. IF the user changes their Image, you want that tied to each message.
Building on those assumptions MessageTable should have these 3 columns only  Assuming this is where you store your "messages"
id_mesg, fk_userId, MessageText.
Then the following Statement will give you the updated image every time it is run...
SELECT  mt.id_msg, mt.MessageText, ut.img, ut.uname
FROM UessageTable mt
JOIN UserTable ut
    On ut.id_user= mt.fk_userId

Remove the img column and uname column entirely from the message-table..   They are not needed.

A: I dont know if this works in mysql but an idea in sql
 ALTER TABLE message-table ADD CONSTRAINT fk-message-img FOREIGN KEY
 (img)
     REFERENCES user_table(id_user);

A: You can use Alter Table statement over here.
ALTER TABLE message-table ADD CONSTRAINT user_img
FOREIGN KEY ( img ) REFERENCES user-table ( img ) ON DELETE  ON UPDATE ;
for your use-case you can use cascade option which will let the changes flow from user-table to message table
Also If the user to image mapping is 1:1 then you should not be duplicating img in message-table. Rather, just keep the uName of user-table and join on that column while reading.


text:
Q: To what extent $\frac{d}{dx} \int_{-\infty}^{\infty} f(t,x)\, dt = \int_{-\infty}^{\infty}\frac{d}{dx}f(t,x)\, dt$ Assume $\int_{-\infty}^{\infty} f(t,x)\, dt$ exists for every $x \in {\mathbb R}^n$. Then, to what extent, the following equation holds?
$$\frac{d}{dx} \int_{-\infty}^{\infty} f(t,x)\, dt = \int_{-\infty}^{\infty}\frac{d}{dx}f(t,x) \,dt.$$

A: I think this answers your question for the finite case in Theorems 1 and 2. Extending it to the unbounded case is achieved in Theorems 3-5.
Without retyping all the proofs, $f$ and $\frac{d}{dx}f$ need to be continuous, $\int_{-\infty}^{\infty} f$ and $\int_{-\infty}^{\infty} \frac{d}{dx}f$ need to be uniformly convergent.

A: With the Lebesgue integral we have this theorem (Integración de funciones de varias variables):
Let be $(X,\mu)$ a measure space, $J\subset\Bbb R$ an interval.
Exists $g$ integrable s.t. $|f(x,t)|\le g(x)$ for all $t\in J$ and almost all $x\in X$.
Exists $\partial_t f(x,t)$ for all $t\in J$ and almost all $x\in X$.
Exists $h$ integrable s.t. $|\partial_t f(x,t)|\le h(x)$ for all $t\in J$ and almost all $x\in X$.
Then
$$F(t) = \int_X f(x,t)\,d\mu(x)$$
is derivable and
$$F'(t) = \int_X \partial_t f(x,t)\,d\mu(x).$$


text:
Q: "Emulating" HID Gamepad Since we are still struggling with sending and receiving bluetooth data, we want to try a different way, ignoring bluetooth for now.
Is it possible to write a software, which Windows or Linux is recognizing as a Hardware Gamepad for simulating (so we only need to change the input of that tool to bluetooth input later)?
And if it is possible, what do I need to know for achieving that? Thank you!
(We are using C/C++)


text:
Q: Why is my code not returning the false value specified if the condition above is met I am trying to create a LinkedList in C#, and this is the method I wrote to check if an element is present in my LinkedList. It worked as expected, except that it did not return the false value if the condition was not met.
What exactly is valentine doing wrong.
`
 public bool Check(object data)
        {
            Node current = headNode;
            while (current != null)
            {
                if (current.Data.Equals(data))
                {
                    return true;
                }
                current = current.Next;
            }
                return false;

        } `


text:
Q: Serialize property even empty How can I tell to the XmlSerializer to serialize a string property that is empty?
        [XmlElement("description")]
        public string Description
        {
            get;
            set;
        }

A: i did not try it, but "IsNullable" of XmlElementAttribute maybe helps with strings


text:
Q: Create report base one number of records dynamically in SSRS Let's say I have the following data:

In my SSRS report I have a parameter that prompts for MainID.

Now If I put MainID as 1, I should get one report.  If I put MainID as 6, I should get 3 reports.  Is there a way I can generate these reports dynamically using SSRS?  Thanks.

A: I would approach this by creating a report that uses a List control, and has a page break between each item that you use to group by within that List. One report, a different page for each item of interest, SubID in this case.

*

*Create a new report with an empty body.

*Add the Data Source(s), Parameter(s), and Dataset(s) that are needed.

*Add a List object to the body. Drag and drop it into the body from the Toolbox.

*Set the Dataset for the list to the one you are using to return the data you have listed in your question.

*In the Row Groups pane of the Visual Studio report designer, right click on the Details row, and choose Group Properties. On the General page, click the Add button under Group expressions, choose SubID from the Group on dropdown.

*While in the same dialog, go to the Page Breaks page and check the Between each instance of a group option. Click OK.

*Add a Tablix inside the List. This is what will show your data.

*Add some fields to the Tablix. Add Detail and Notes, for no good reason on my part.

*Run the report. If you have setup the data source and data set to properly run and filter base on your parameters, you should see something. Maybe an empty report.

Now (based on the data you provided), if you choose 1 for your MainID parameter, the report will display one page, but if you choose 6, you will get 3 page3, or however many records there are related to the parameter value for MainID in the database.
One report, multiple pages depending on the parameter/data. It's not a 3 different reports solutions, but something that could work for your situation.


text:
Q: Is the participle clause in "the marlin left a blood trail attracting sharks" correct? I'm writing a summary of the novel "The old man and the sea". And I'm trying to use participle clauses (a subject that I'm currently learning).
I've learnt that you can use a participle clause to describe an action that is the result of another action, so I wrote:

Then, having succeeded in his catch and taking his way back. He faced another problem: the marlin left a blood trail attracting sharks.

Is the second sentence correct?  Meaning: "The marlin left a blood trail which attracted sharks"
Also, Doesn't the word "then" in the first sentence sound redundant?

"Then, having succeeded..."

In the original sentence would be "Then, after he have succeeded"

A: Is the participle clause in "the marlin left a blood trail attracting sharks" correct?
There's no grammatical problems with "attracting sharks".
There are a couple of grammatical problems in the larger text, "Then, having succeeded in his catch and taking his way back. He faced another problem: the marlin left a blood trail attracting sharks."
First, "taking" should be "making".
Second, there is a sentence fragment starting with "Then" and ending with "back".
You could correct this text to: "Then, having succeeded in his catch and making his way back, he faced another problem: the marlin left a blood trail attracting sharks."
The word "Then" is not necessary but it could be a useful transition word depending on the prior sentences.  If nearly every sentence begins with "then" then that's not a well written summary, but if the "then" is used occasionally it can be effective.
Finally, I'm not sure it's completely accurate that the fish immediately leaves a trail of blood.  I recall the first shark catches the scent of the dead marlin and follows the trail of that scent, but that's a little different image than a trail of blood.  Therefore there seems to be an inaccuracy in your description, though not in grammar at that point.


text:
Q: 404 file not found error when using microsoft graph api I am getting following error when calling the graph api, https://graph.microsoft.com/v1.0/me/drive/root:/foldername using the access token got through open id connect protocol, but if i use same token to get to https://graph.microsoft.com/v1.0/me API it works, and the folder which i am searching is really exist on one drive for buisness but still i am getting this error, when i run same code after some time, i found that it works fine. what could be the issue. even for this api https://graph.microsoft.com/v1.0/me/drive/root/children i get following error.
    {
  "error": {
    "code": "UnknownError",
    "message": "404 FILE NOT FOUND",
    "innerError": {
      "request-id": "d7cdf434-ead1-445d-b2be-f269a82027eb",
      "date": "2016-07-07T03:38:47"
    }
  }
}

A: In case you end up here using app-only authorization:
As mentioned in this answer  App-only authorization is currently not supported for accessing OneDrive for Business through Microsoft Graph API and will throw 404 FILE NOT FOUND exceptions.
To solve this I used the password grant_type flow to request the token:
POST https://login.microsoftonline.com/{tenantId}.onmicrosoft.com/oauth2/token
Content-Type: application/x-www-form-urlencoded

grant_type=password
&username=<username>
&password=<password>
&client_id=<clientId>
&client_secret=<clientSecret>
&resource=https://graph.microsoft.com

A: This "404 FILE NOT FOUND" error occurs when the user doesn't have Office 365 / OneDrive or has it but hasn't initialized OneDrive (i.e. navigated to https://[domain]-my.sharepoint.com/personal/).
Once the user gets O365/OneDrive and initializes it, you should be able to successfully query https://graph.microsoft.com/v1.0/me/drive/root/children.
You should also be able to query https://graph.microsoft.com/v1.0/me/drive/root:/foldername
If you indeed you were to come across a legitimate case of folder not found, you'd get this error message:
{
    "error": {
        "code": "itemNotFound",
        "message": "The resource could not be found.",
        "innerError": {
            "request-id": "1ce2bd8d-a88f-42ae-affd-ee90f3c1d4fb",
            "date": "2016-07-11T03:17:25"
        }
    }
}


text:
Q: MacOs table with SwiftUI: NSTableView, NSViewControllerRepresentable and Core data update I'm creating a personal bank account app for MacOS.
I want to display a table with transactions. I started using List, but columns were not well aligned.
I changed to NSTableView wrapped in NSViewControllerRepresentable. It's working fine. But when I save the core data, the table is not updating.
Now I want to connect the core data update to the NSTableView update to see the changes in the table.
How to do this?
AccountTransactionTableView:
import Foundation
import SwiftUI
import CoreData
import Cocoa

struct AccountTransactionTableView: NSViewControllerRepresentable {
    typealias NSViewControllerType = AccountTransactionTableViewController

    @State var showSettingsModalView: Bool = false

    let account: BankAccount
    let month: Int
    let year: Int

    init(account: BankAccount, month: Int, year: Int) {
        self.account = account
        self.month = month
        self.year = year
    }

    func makeNSViewController(context: Context) -> AccountTransactionTableViewController {
        return AccountTransactionTableViewController(account: account, month: month, year: year)
    }

    func updateNSViewController(_ nsViewController: AccountTransactionTableViewController, context: Context) {

    }
}

AccountTransactionTableViewController:
class AccountTransactionTableViewController: NSViewController, NSTableViewDelegate, NSTableViewDataSource {
    let account: AbstractAccount
    @FetchRequest<TransactionEntry> private var entries: FetchedResults<TransactionEntry>

    var initialized = false
    let scrollView = NSScrollView()
    let tableView = NSTableView()
    let startDate: Date
    let endDate: Date

    init(account: AbstractAccount, month: Int, year: Int) {
        self.account = account

        self.startDate = DateTool.firstDayOfMonth(year: year, month: month)
        self.endDate = DateTool.endOfMonth(year: year, month: month)

        self._entries = FetchRequest<TransactionEntry>(
            entity: TransactionEntry.entity(),
            sortDescriptors: [NSSortDescriptor(keyPath: \TransactionEntry.transaction!.date, ascending: true)],
            predicate: NSPredicate(format: "account.name == %@ and transaction.date >= %@ and transaction.date <= %@", account.name!, startDate as CVarArg, endDate as CVarArg)
        )

        super.init(nibName: nil, bundle: nil)
    }

    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func loadView() {
        self.view = NSView()
    }

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    override func viewDidLayout() {
        if !initialized {
            initialized = true
            setupView()
            setupTableView()
        }
    }

    func setupView() {
        self.view.translatesAutoresizingMaskIntoConstraints = true
    }

    func setupTableView() {
(...)
    }

    func numberOfRows(in tableView: NSTableView) -> Int {
        return entries.count
    }

    func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? {
        let entry = entries.map { $0 }[row]
        let transactionCell = AccountTransactionCell(entry: entry, account: account, collapsed: false)
        let cell = NSTableCellView()

        let text = NSTextField()
        switch tableColumn!.identifier.rawValue {
        case "date":
            text.stringValue = "\(transactionCell.date)"
        case "category":
            text.stringValue = "\(transactionCell.category)"
        case "details":
            text.stringValue = "\(transactionCell.details)"
        case "debits":
            text.stringValue = "\(transactionCell.debit)"
            text.alignment = .right
        case "credits":
            text.stringValue = "\(transactionCell.credit)"
            text.alignment = .right
        default:
            text.stringValue = "-"
        }

        cell.addSubview(text)
        text.drawsBackground = false
        text.isBordered = false
        text.translatesAutoresizingMaskIntoConstraints = false
        cell.addConstraint(NSLayoutConstraint(item: text, attribute: .left, relatedBy: .equal, toItem: cell, attribute: .left, multiplier: 1, constant: 0))
        cell.addConstraint(NSLayoutConstraint(item: text, attribute: .right, relatedBy: .equal, toItem: cell, attribute: .right, multiplier: 1, constant: 0))
        return cell
    }

    func tableView(_ tableView: NSTableView, rowViewForRow row: Int) -> NSTableRowView? {
        let rowView = NSTableRowView()
        rowView.isEmphasized = false
        return rowView
    }
}

AccountTransactionCell is a formatter struct.
Thanks for your help :-)

A: You must call tableView.reloadData() once the save has settled in Core Data.
Good Explanation here:

https://developer.apple.com/documentation/appkit/nstableview/1528382-reloaddata
A possibility for where you may want to call this is in the function provided for you by the NSViewControllerRepresentable:
func updateNSViewController(_ nsViewController: AccountTransactionTableViewController, context: Context) {
    nsViewController.tableView.reloadData()
}

IMPORTANT: the above will only be called if the Representable contains a reference to the data backing the table (aka the @FetchRequest private var entries lives in your Representable Class instead of the AppKit class.)
If you would like to keep the @FetchRequest property wrapper inside the AppKit ViewController, then you will have to observe the change to the entries var another way that the object can be made aware, or hook into a different event and call reloadData() another way.


text:
Q: Magsafe charger behaving strange I have a Macbook Pro 15 late 2011.
The charger has started to act funky the last few days.
What happens is that I connect it. Light shows as green on the connector and then switches to orange if it needs to be charged.
Then after a few hours the computer just dies while the light on the charger is green. Clicking the battery check on the side shows full battery. But removing the charger and clicking again shows a totally empty battery.
At this point, reconnecting the charger doesn't show any light at all. I have to wait a few minutes connect/disconnect cables a couple of times. Then it starts charging. Then starting the computer again it keeps charging. Then suddenly at a random battery percentage number the light switches to green and just stops charging.
Disconnecting and reconnecting charger doesn't help and no light is shown again. Restarting here seems to help. But it keeps happening.
Resting SMC and/or PRAM doesn't help. The charger, the white square doesn't get hot.
Any ideas?
Battery info:
Battery Information:
Model Information:
  Serial Number:    D8614...
  Manufacturer: SMP
  Device Name:  bq20z451
  Pack Lot Code:    0
  PCB Lot Code: 0
  Firmware Version: 406
  Hardware Revision:    2
  Cell Revision:    158
  Charge Information:
  Charge Remaining (mAh):   5407
  Fully Charged:    No
  Charging: No
  Full Charge Capacity (mAh):   5628
  Health Information:
  Cycle Count:  913
  Condition:    Normal
  Battery Installed:    Yes
  Amperage (mA):    -2648
  Voltage (mV): 11967

A: You are nearing the expected cycle count for a battery. According to Apple, your model of MacBook Pro is expected to last for 1000 cycles. You could try swapping the MagSafe charger, but I suspect that the battery is ready to be replaced.
Apple Support - Determining battery cycle count


text:
Q: Asterisk-Java support for driving DTMF to a MeetMe conference? I have a Java app that accesses Asterisk as a manager via Asterisk-Java.  The app has a dialer interface, which I can use to dial number strings and play single digits to extensions defined in sip.conf.  Now, I am trying to figure out how to drive a digit from this dialer (using A-J PlayDtmfAction) into a MeetMe conference, to enter a PIN as requested by MeetMe.  In my DialPlan, I have an ext-meetme context that supports confRoom 1024...
>[ Context 'ext-meetme' created by 'pbx_config' ]
>  '1024' =>         1. Macro(user-callerid,)                      [pbx_config]
>                    2. Set(MEETME_ROOMNUM=1024)                   [pbx_config]
>                    3. Set(MAX_PARTICIPANTS=2)                    [pbx_config]
>                    4. Set(MEETME_MUSIC=${MOHCLASS})              [pbx_config]
>                    5. Gosub(sub-record-check,s,1(conf,1024,always))
>[pbx_config]
>                    6. GotoIf($["${DIALSTATUS}" = "ANSWER"]?READPIN)
>[pbx_config]
>                    7. Answer()                                   [pbx_config]
>                    8. Wait(1)                                    [pbx_config]
>                    9. Set(PINCOUNT=0)                            [pbx_config]
>     [READPIN]      10. Read(PIN,enter-conf-pin-number,,,,)       [pbx_config]
>
><THIS IS WHERE I WANT TO INJECT A DTMF STRING>
>
>                    11. GotoIf($[x${PIN} = x123]?USER)            [pbx_config]
>                    12. GotoIf($[x${PIN} = x321]?ADMIN)           [pbx_config]
>                    13. Set(PINCOUNT=$[${PINCOUNT}+1])            [pbx_config]
>                    14. GotoIf($[${PINCOUNT}>3]?h)                [pbx_config]
>                    15. Playback(conf-invalidpin)                 [pbx_config]
>                    16. Goto(READPIN)                             [pbx_config]
>     [ADMIN]        17. Set(MEETME_OPTS=aAoTqcIMsr)               [pbx_config]
>                    18. Goto(STARTMEETME,1)                       [pbx_config]
>     [USER]         19. Set(MEETME_OPTS=oTqcIMsr)                 [pbx_config]
>                    20. Goto(STARTMEETME,1)                       [pbx_config]

You can see the spot where I need to play the PIN to MeetMe.  I am not sure what [READPIN] signifies here.  When I turn on Asterisk CLI verbose mode, I can see that I get to number 10 above.  Then a timeout occurs and Asterisk says the user did not enter any digits.
The problem is I cannot define properly to PlayDtmfAction the correct destination channelID to play the digit to.  What works is playing a digit to a real extension like SIP/100-00034bc2.  There is no such channel for MeetMe.  If I query the calling channel's info while at this point of the dialplan, it shows the destination as 1024@from-internal:1.  I try that with PlayDtmfAction but Asterisk returns error.  I have also tried things like 1024@ext-meetme, Local/1024, Local/1024@ext-meetme:1, and many others.
I heard of using AGI, but also read that AGI should not be used for blocking apps like MeetMe.  If I can use AGI I'd love to learn how.
I use a system that is configured by FreePBX, if that matters.  My app is separate from FreePBX.
Any help appreciated and I'll be glad to get any info requested.
Thanks!
Greg in MA


text:
Q: How to get all collection names in MongoDb using C++ There is a great MongoDb C++ Driver. The only thing that makes it hard for newbies like me to use it - is the lack of teeny-weeny examples. For instance, I know there is a method called getCollectionNames, but I'm not sure how to use it. In Python I would do it like this:
db = MongoClient(host, port)[db_name]
colls = db.collection_names()

and I'm done. But I don't feel so comfortable with C++ and can not figure out myself how to convert raw function declarations in documentation to some working code.
So, this is what I've done by now and see that it works:
ConnectionString cs = ConnectionString::parse(uri, errmsg);
DBClientBase * conn(cs.connect(errmsg));

Now I want to make one step further and get all collection names. Please, give some advice.
EDIT
Well, I found a method somewhere in dbclientinterface.h called getCollectionNames. It is defined like so:
std::list<std::string> getCollectionNames( const std::string& db,
                                           const BSON& filter = BSONObj())

But I find this sole declaration without any informative hints completely useless. It is just a sum of letters and no more.
EDIT
I found a solution and I will post it below.

A: This is the solution:
std::string uri = "mongodb://127.0.0.1:27017/mydb";
std::string errmsg;
ConnectionString cs = ConnectionString::parse(uri, errmsg);
DBClientBase * conn(cs.connect(errmsg));
std::list<std::string> colls = conn->getCollectionNames("mydb");
for(std::list<std::string>::iterator it = colls.begin();it != colls.end();++it){
     do_something(*it);
}


text:
Q: A Multi-Sport Tournament for 8 Teams I would like to organize a tournament with 8 teams. Each team will play 4 games. The catch is no team can play the same team twice and no team can play the same sport twice.
Help pls

A: The teams are $A, B,.. G, H$. The match-ups are denoted by the the lines/connections (edges) drawn between the teams (vertices). The four hideous colours - Green, Blue, Yellow and Purple - represent the four sports. Should be easy to interpret.
There are no multi-edges and hence no teams play each other twice. Each vertex has exactly four distinct edges and hence each team plays exactly four distinct sports i.e. no team plays the same sport twice.


text:
Q: python pass self to referenced function I have a function reference that is being called by an object. What I'd like is for that object to pass itself as a parameter to the function as it would normally do for its own functions.
IE I would like to use self.myFoo() instead of self.myFoo(self) in the following sample
Code Sample:
def foo(self):
    print(self.toString())

class Node:
    def __init__(self, myFoo):
        self.myFoo = myFoo

    def run(self):
        self.myFoo()

    def toString(self):
        return "Hello World"

n = Node(foo)
n.run()

A: The problem is that you assigned myFoo to an unbound function and are calling it as though it were bound. If you want to be able to use self.myFoo() you will need to curry the object into the first arg yourself.
from functools import partial

def foo(self):
    print(self.toString())

class Node:
    def __init__(self, myFoo):
        self.myFoo = partial(myFoo, self)

    def run(self):
        self.myFoo()

    def toString(self):
        return "Hello World"

n = Node(foo)
n.run()

Alternatively you could use
self.myFoo = types.MethodType(myFoo, self)

in your __init__(self, myFoo) method, but using partial is more commonly done, and more versatile since you can use it to curry arguments for any sort of function, not just methods.

A: This thread looks like what you are looking for. To bound a method to an object (but not its class) at runtime you can do:
import types
n.foo = types.MethodType(foo, n)

A: foo is a simple function. To make it callable via self.myFoo() you can attach it to the class - not the object. Even Node.myFoo is still an unbound function you can call it via self.myFoo() within your class.
def __init__(self, myFoo):
    Node.myFoo = myFoo


text:
Q: IOS Share Extension NSMutableArray addObject Unrecognized selector sent to instance After clicking post to the share dialog, the Host App(e.g. Safari) hangs up if arrSites variable is currently not empty. I can only store 1 object inside my arrSites variable. How can I addObject to my NSMutableArray variable?
Below is my implemented code and it generates an error in [arrSites addObject:dictSite] line.
- (void)didSelectPost
{
inputItem = self.extensionContext.inputItems.firstObject;

NSItemProvider *urlItemProvider = [[inputItem.userInfo valueForKey:NSExtensionItemAttachmentsKey] objectAtIndex:0];

if ([urlItemProvider hasItemConformingToTypeIdentifier:(__bridge NSString *)kUTTypeURL])
{
    NSLog(@"++++++++++ Attachment is a URL");
    [urlItemProvider loadItemForTypeIdentifier:(__bridge NSString *)kUTTypeURL options:nil completionHandler:^(NSURL *url, NSError *error)
    {
         if (error)
         {
             NSLog(@"Error occured");
         }
         else
         {
             NSMutableArray *arrSites;
             if ([sharedUserDefaults valueForKey:@"SharedExtension"]){
                 arrSites = [sharedUserDefaults objectForKey:@"SharedExtension"];
             }else{
                 arrSites = [[NSMutableArray alloc] init];
             }

             NSDictionary *dictSite = [NSDictionary dictionaryWithObjectsAndKeys:self.contentText, @"Text", url.absoluteString, @"URL",nil];

             [arrSites addObject:dictSite];
             [sharedUserDefaults setObject:arrSites forKey:@"SharedExtension"];
             [sharedUserDefaults synchronize];

             UIAlertController * alert=   [UIAlertController
                                           alertControllerWithTitle:@"Success"
                                           message:@"V7 Posted Successfully."
                                           preferredStyle:UIAlertControllerStyleAlert];
             UIAlertAction* ok = [UIAlertAction
                                  actionWithTitle:@"OK"
                                  style:UIAlertActionStyleDefault
                                  handler:^(UIAlertAction * action)
                                  {
                                      [UIView animateWithDuration:0.20 animations:^
                                       {
                                           self.view.transform = CGAffineTransformMakeTranslation(0, self.view.frame.size.height);
                                       }
                                                       completion:^(BOOL finished)
                                       {
                                           [self.extensionContext completeRequestReturningItems:nil completionHandler:nil];
                                       }];
                                  }];

             [alert addAction:ok];
             [self presentViewController:alert animated:YES completion:nil];
         }
     }];
}
}

A: Without memory allocation you can't add the object to array, use like
// allocate the memory of array in before
NSMutableArray *arrSites = [[NSMutableArray alloc] init];
if ([sharedUserDefaults valueForKey:@"SharedExtension"]){
    [arrSites addObjectsFromArray:[sharedUserDefaults objectForKey:@"SharedExtension"]];
}
[arrSites addObject:dictSite];

A: Most likely the source of the problem is that
arrSites = [sharedUserDefaults objectForKey:@"SharedExtension"];

creates immutable object (NSArray instead of NSMutableArray). You can fix this issue using
arrSites = [[sharedUserDefaults objectForKey:@"SharedExtension"] mutableCopy];

instead.


text:
Q: Run stored procedure with declared variable ms access Private Sub Command1_Click()

    DoCmd.OpenQuery "Pass_through_test", acViewNormal
    Me.Recalc

How would I include a variable that I have declared in SQL Server along with this line? So if my variable would be:
ALTER PROCEDURE [dbo].[Table_one]
    @banana nvarchar(MAX)
AS
    SET NOCOUNT ON;

And in the WHERE Clause of my SQL script I have:
SELECT * FROM Table_one WHERE Table_one.[banana] = @banana

What do I need to add to the VBA so that MS Access executes the procedure through a pass-through with a variable that is equal to @banana.


text:
Q: SQL Server 2014, 'format' is not a recognized built-in function name My database has this table
| Name | Score | Date_time      |
---------------------------------
| A    |  100  | 20200601000000 |
| B    |  120  | 20200615000000 |
| C    |  110  | 20200629000000 |
| B    |  150  | 20200701000000 |
  ...

I want get 'Name' and 'Score' by 'Date_time' week day.
Example, when week day is Monday(= 2), I get two data.
| A    |  100  |
| B    |  120  |

And I tried to use the following sql statement.
select Name, Score
from SCORE_DATA
where
datepart(dw, format(cast(Date_time as bigint),'####-##-## ##:##:##')) = 2

converting
20200601000000 to 2020-06-01 00:00:00 and get week day (dw) and compare is it 2.
But I get an error:

'format' is not a recognized built-in function name.

I can't understand why.
https://learn.microsoft.com/en-us/sql/t-sql/functions/format-transact-sql?view=sql-server-ver15&viewFallbackFrom=sql-server-2014
It explain format function.
Doesn't it apply in SQL Server 2014? What can I do?

A: You should check your compatibility level as below:
SELECT compatibility_level
FROM sys.databases
WHERE name = 'YourDb';
GO

110 is SQL Server 2012
120 is SQL Server 2014
130 is SQL Server 2016
140 is SQL Server 2017
150 is SQL Server 2019
To change it you can use the following script:
ALTER DATABASE YourDb
SET COMPATIBILITY_LEVEL = 120;
GO

FORMAT function require compatibility level >= 110

A: Technically, Gabriele's answer is correct - He is explaining why you're getting the error message you're getting.
However, there is a better way to get your results, that doesn't involve Format.
First thing's first: You should seriously consider converting the [Date_Time] column you have now from (What I guess based on the code in the question is) a string to a proper DateTime.
That will solve not only this specific problem but a bunch of many other problems, some of them you probably have encountered before.
Even if this involves a lot of work it will be worth it in the long run, trust me.
However, considering that's not an option, I would suggest a couple of improvements to your existing code:

*

*Use cast to convert the first 8 chars directly to a date, instead of converting the entire thing to a bigint and then using format and implicit conversion like your code is attempting to do now.

*Use WeekDay instead of dw in the DatePart function. It's just more readable.

*Calculate the week day number based on the @@DateFirst value - because SQL Server does exactly that, meaning if someone changes the date first settings your current code will produce the wrong results.
Having said all that, let's see how that looks like in code.
First, create and populate sample table (Please save us this step in your future questions):
CREATE TABLE SCORE_DATA (
  [Name] varchar(1),
  [Score] int,
  [Date_time] char(14)
);

INSERT INTO SCORE_DATA ([Name], [Score], [Date_time]) VALUES
('A', 100, '20200601000000'),
('B', 120, '20200615000000'),
('C', 110, '20200629000000'),
('B', 150, '20200701000000');

The query (with explanatory comments):
SELECT  [Name]
      , [Score]
FROM SCORE_DATA
      -- using full name for readability
WHERE (DATEPART(WeekDay,
                 -- ISO8601 format is unambiguous and will always be converted correctly
                 CAST(
                   -- A string representation of date in ISO8601 Format: yyyyMMdd
                   LEFT([Date_Time], 8)
                 AS Date) -- You don't need DateTime, just the date...
        -- taking datefirst settings into consideration to get a fixed number
        ) + @@DATEFIRST) % 7 = 2

Results:
Name    Score
A       100
B       120
C       110 -- June 29th 2020 was a Monday too...


text:
Q: small cut in hypercube graph In his notes on spectral graph theory Luca Trevisan writes
"A $k$-dimensional hypercube with $n = 2^k$ is considerably better connected than a grid, although it is still possible to remove a vanishingly small fraction of edges (the edges of a "dimension cut," which are a $1/k = 1/ \log_2 n$ fraction of the total number of edges) and disconnect half of the vertices from the other half"
My question is, what exactly is this dimension cut?  I haven't been able to Google this.

A: I think a dimension cut would be a cut parallel to a coordinate hyperplane.
For example in the $k=3$ case, we could cut parallel to the $yz$-plane.
This would cut the edges joining the following pairs of (previously connected) vertices in the $3$-cube:
000 and 100
001 and 101
010 and 110
011 and 111
This would disconnect the vertices 000, 001, 010, 011 from the other four.

Edited:
Note that we cut $4$ out of $12$ edges, or $\frac13$ of the edges, as predicted for dimension $3$.


text:
Q: Cross-plattform virtual webcam I am looking for a cross-platform way to create a virtual webcam (and microphone) with a static image (and fixed sound - i.e. no sound).
Manycam does something similar, but i want it to be running invisibly in the background or even in-process (in java).
Any ideas which software or project can do this?


text:
Q: SSMS 2017 Changing font size I'm using SSMS 2017 and want to make my font larger in the query window.
When I go to Tools > Options > Environment > Fonts and Colors > and then change the size of my font and press Ok, nothing changes.  The size doesn't get affected in the open query window nor in a new query window.

A: This is working solution tested on ssms v18.4.

In OP's case I think you did not restart your ssms.
Also, as in arrow 4 you will need to know what settings you want to change in order for it to work as expect.
It should be very much the same for your ssms version.
Done.

A: Your issue may be related to an early release.  I am using SSMS 17.4 and following your patch causes the query window font to change as soon as click 'ok'  the changes persist in a new query window and when I close and re-open SSMS.

A: I'm also using SSMS 2017 and also needed to increase the font size. To change the font size in your query window, make sure 'Text Editor' is chosen in the drop-down for 'Show settings for:' when you select Environment>Fonts and Colors. That will affect your query window font size once you select 'OK'.
I'm not sure why the drop-down '[All Text Tool Windows]' doesn't affect the font size but I found that as well.

A: If you requested regarding font in window, which will be opened when you select New Query from database object (e.g. AutoLot), You can change size in  Environment/Fonts and Colors/Text Editor

A: If you don't have a mouse wheel, use the Ctrl key and two fingers on the touchpad: a pinching motion to enlarge/reduce the font in the Query Tab.

A: You must go to Environment font select a new font and size


text:
Q: Why is my Linux OS so much faster than my W10 OS and what can be done about the latter? Surprised not to find a question here along these lines. Hope this is the right place.
I have a dual boot set up on a pretty powerful PC.
One boot up partition has W10, the other Linux Mint 18.3.
Using the Linux OS is an absolute joy: you click something and something happens.  Yes, there can be delays, and I'm nowhere near as comfortable and familiar (yet) with how to do the vast range of essential tasks you need to use a Linux OS for real life.  Usually you can interrupt processes when you see a Cancel button... so you click Cancel... and things, um, stop.
Not so in the ghastly W10 dark side: apps take an age to start up (the bigger the app the worse it is). Processes which are hanging or taking ages to do something show the "spinner" and/or (terrible heart-sinking moment) overlay a sort of "white sheen" ("process not responding"), with a spinner lasting for tens of seconds. Only way to stop is to kill the process, etc, etc ad nauseam.
An example is Gimp2... this takes ages to start up on my W10 system, but in Linux it just, er, starts. Nemo in Linux starts instantaneously, whereas FileExplorer in W10 takes, what, a second or more to display anything.
Unfortunately I have at least 2 apps which I absolutely have to use and which are Windoze-only, so for the forseeable future I'm stuck.
I know about VMs as well... installing a VM with Linux in a W10 OS is fairly straightforward in my experience, but not W10 in a Linux OS. I've wasted so many hours over this kind of nonsense I've more or less given up.
Can anyone say WHY my W10 OS is such a snail? Is there anything I can do to try and make something like, for example, Gimp2 just start up at a more normal speed?

A: About Gimp

*

*There is a bug that on Windows, makes it rescan all the system fonts when it starts. Normally fixed in recent versions, but if you don't want to upgrade you can try this workaround.

*It at least one version, it would also re-register all the plugins (normally it re-registers only the plugins where the executable is newer that their existing registration date). You have to start Gimp in --verbose mode to check messages and see what happens. I have had one case of a totally unrelated executable (wget) ending up in a Gimp plugin directory and being executed on every Gimp startup, hanging it until it timed out.
Of course all this depends on the version you run on Windows.
About Linux-vs-Windows

*

*The Linux filesystems are faster (possibly because they have a simpler security model, among other things)(*)

*Linux system are usually unencumbered by "security" software that check all the file writes and slow I/O even more.

For specialized uses, a bare-bones Windows VM (that doesn't need to run all the security stuff) can be quite fast. I've done that at work, and it turned out to be significantly faster than the native Windows my colleagues were running on the very same PC model, possibly due to: removal of all unnecessary things, disk I/O restricted to the VM file (so less HDD arm movement).
(*) Implicitly acknowledged by Microsoft, who created GVFS to be able to run Git on Windows...

A: Windows 10 is not normally slow (my own, client machines)
Check to make sure you do not have legacy software or legacy Anti Virus installed.  You can remove Anti Virus and run Windows Defender (works very well).
See if you can correct OS errors.  Open cmd.exe with Run as Administrator and run:
dism.exe  /online  /cleanup-image  /restorehealth
Try these and if no concrete results, run a Windows 10 Repair Install from the Microsoft Media Creation Link


text:
Q: How to change the value of let node.js How can i remove the result value from code permanently  after user got that value? {Is it possible} ?
let word = ['idk', 'xd', ' i'];
        const random = Math.floor((Math.random() * word.length));
        const result = word[random];

message.author.send(`${message.author} here ${result}`)
         return message.channel.send (`${message.author} check your DM`);


text:
Q: List doesn't update the UI when change occurs <ListBox x:Name="MainList" HorizontalAlignment="Left" Height="468" Margin="10,10,0,0" VerticalAlignment="Top" Width="100" ItemsSource="{Binding Items,Mode=TwoWay}" DisplayMemberPath="Name"/>

[Serializable()]
public class MYcontainer : INotifyPropertyChanged,ISerializable
{
    private List<MYClass> _items = new List<MYClass>();
    public List<MYClass> Items
    {
        get{ return _items;}
       set { this._items =value;
        OnPropertyChanged("Items");
    }
public event PropertyChangedEventHandler PropertyChanged;
    public void OnPropertyChanged(string propertyName = null)
    {
        var eventHandler = this.PropertyChanged;
        if (eventHandler != null)
            eventHandler(this, new PropertyChangedEventArgs(propertyName));
    }
}

When I add an item to "Items" the UI doesn't update, the binding is working fine, since if I closed the window and opened it again, the new items appear correctly.
What am I doing wrong? I know if I used ObservableCollection it will work fine, but shouldn't it work with List<>? I already have in another window a string[] property and it update fine.

A: If you don't want to ues ObservableCollection you will have to implement INotifyCollectionChanged.
public partial class MainWindow : Window, INotifyCollectionChanged
{

    public event NotifyCollectionChangedEventHandler CollectionChanged;

    public MainWindow()
    {
        InitializeComponent();
    }

    public void NotifyCollectionChanged(NotifyCollectionChangedAction action)
    {
        if (CollectionChanged != null)
        {
            CollectionChanged(this, new NotifyCollectionChangedEventArgs(action));
        }
    }
}

However ObservableCollection does all this for you, adding all the same logic to your List<T> would just create a custom ObservableCollection, I see no point in this when MS has alraedy made this for you

A: It will currently only update if you replace the entire list with a new List<MyClass>. Replacing 1 item won't trigger the OnPropertyChanged event.
Use an ObservableCollection<MyClass> instead of a List<MyClass>. It's built specifically to handle this issue and notifies WPF whenever the items in the collection change.
It's very comparable to list in other respects so the changes to your code should be minimal (Both List and ObservableCollection implement the ICollection<T> interface, so most of the methods are shared).