text:
Q: Change in roles for Jon Ericson (leaving SE) It's a bit surreal to be writing this post—not many people can say they left their dream job twice. Today is my last day as an employee of Stack Overflow. I'll be joining College Confidential as their Community Product and Operations Manager doing many of the same things I've been doing here but with a very different community. To the degree I'm ready for this challenge, it's because of the amazing experience I've had with this community.
When I worked as a programmer at JPL, my first dream job, I was an avid reader of Joel on Software. Joel described software developers who were masters of their craft and companies that treated them accordingly. While I was treated quite well, I looked enviously at programmers who got private offices and didn't have to fight for better computers. After I was hired at Stack Exchange I didn't have to envy anymore. The company has always supported me and given me everything I need to excel.
Joel's legacy won't, I think, be comfortable chairs or adjustable desks, however. Stack Overflow has given us a far greater gift: global collaboration. Where else can you use the small chunks of time between meetings and such to help someone who lives who-knows-where solve their programming problems? And better than that, your answer can help other people you will never know for years to come. (Upvote notifications on old answers encourage me more than you can imagine.) In my childhood, this was literally the stuff of science fiction.
Obviously we've still a long way to go before we achieve an online utopia. As long as I've been a community manager, I've struggled with what the title means. The goal, however, has always been clear: guide people in the community toward a better future. I've developed skills in data analysis, behavioral psychology, event planning, survey design, user interviews, specifications, podcasting and, most importantly, written communication so that by any means available I can be an influence for the good of the community.
I've learned so much from my colleagues over the years. It's impossible for me to imagine a more talented, caring, thoughtful and encouraging group of people to work with. Let me put it this way: I look forward to meetings. (I plan to continue hosting the Unicorn Meta Zoo podcast just so that I can interview my friends here at the company.) Stack Overflow has an amazing future thanks to the hard work of the Community Product team and the unsung heroes who are the Community Managers.
I made this decision in December and it's not correlated with the recent CM team changes. These are just an unfortunate coincidence.
Now I'm not leaving Stack Overflow and Stack Exchange entirely. I still plan to be a user of the sites and to apply to get my moderator diamond back. ;-) I think I come back to the community with a new perspective, ready to help in any way I can. I believe in the Q&A format as a means to pass along information and there is no better place to see that than the Stack Exchange network.

A: For all intents and purposes, I am no longer using SE (any of the sites, in any form) but I saw this and wanted you to know from someone who had a negative interaction with you roughly 80% of the time (I'm not going to link, the posts are easy to find):
I really do appreciate the tone and professionalism you showed during all those interactions
More than any other CM or employee, you were the one I saw most take our ire & I always respected the honest way you responded. Thank you for all the work you did.

A: I remember one time, when I was getting training of sorts to be a counselor for a youth organization, we were asked to provide examples of a leader, of any kind, who we looked up to and could aspire to be like.
My example was Jon Ericson.
Of course, nobody had any clue what I was talking about. None of the other people there had ever heard of the network, let alone individual staff members. But to me, over the past several years, Jon has been one of the people that I actively aspire to emulate.
You have a way of communicating in such a clear manner that I'm simply in envy. People respect your words because you use them so effectively, and allow you to lead them. That takes real talent.
When I was just getting started as a moderator, you were one of the most helpful resources available. The wealth of information that you have and the manner in which you are able to communicate it is simply astounding... and it doesn't hurt that you were the one who did the button-pushing of actually giving me the diamond ;)
It is unfortunate that things have come to the point where you are forced to write that "...leadership within the company neither understood community management nor was willing to learn...", and that things are now in the state where they are. But this is a step forward for you, and I wish you good luck in your future roles.

:יְבָרֶכְךָ ה' וְיִשְׁמְרֶךָ
  :יָאֵר ה' פָּנָיו אֵלֶיךָ וִיחֻנֶּךָּ
  :יִשָּׂא ה' פָּנָיו אֵלֶיךָ וְיָשֵׂם לְךָ שָׁלוֹם
May God bless you and protect you.
  May God shine his face upon you and be gracious to you.
  May God lift his face to you and grant you peace.
The "Priestly Blessing", Bamidbar / Numbers 6:23-27; my own translation

A: Thank you for everything Mr. Jon, especially for Meta. We're sorry to see you go as a CM but we wish you all the best and hope to see you around on the network.

A: Safe travels, Jon.
You'll be missed, even if we haven't heard much from you in the recent past.
I'm not sure what to think about your thoughts about coming back for a diamond, but it's certain that you know best.
It could be considered a glimmer of hope, although without additional clarity about what's going on around here that's something that is hard to hold on.
Thanks for all your work during these years.

A: I worked with Jon for a long time. He joined the company 6 and a half years ago, but I had already been working with him for a lot longer than that. Even though we didn't really know each other or particularly even care to know more about the people behind the names in those days... We had been working together since the very beginnings of Stack Overflow, since those UserVoice days. Jon shaped these sites in innumerable ways, influenced more people than we can ever know.
Jon, you've been an inspiration to me. Your writing is invariably thoughtful and well-researched; you draw from a wealth of knowledge and a breadth of experience that I can only dream of one day obtaining. While others babble, you pause and reflect; when you speak, it is invariably to say something worth hearing. I looked forward to every meeting you were involved in; you enriched every conversation.
But what I will miss most is your patience and humility. Even in the face of chaos and overt disrespect, I have never known you to react in anger or to lash out. You are not one to let either pride nor fear get in the way of saying what needs to be said... Whether those words be many or none at all. I envy this, and wherever our respective paths take us next I aspire to continue learning from the example that you have set here, faithfully, for so many years.
Thank you Jon.
Further reading: Please welcome Jon Ericson, Community Manager

A: All paths come to an end and this time your new journey starts Jon! Hopefully, in this new adventure, you will feel reward and appreciation as always and you would be able to help more people with your time and great work!
Good luck in the next stage!

A: Best of luck, Jon. I do hope that you get your diamond(s) back (I forget how many you had before you got all of them on the CM team). It's been a while since we've overlapped in TL, but I always remember you having insightful perspectives (even if I didn't totally agree with them) on community and moderation. I'm glad you're sticking around as a user and hope to still see you around in the mod chat from time to time.

A: I'm new to this community. Thanks Jon for taking efforts to make this community a big one.

A: Good luck Jon. Since the events of September/October (moderator resignations, the gofundme to prevent defamation etc) I was hoping that you, or a colleague within the community team, would have been given the chance to fix the mistakes made when leadership of the company decided to rush in to the role of community management with disastrous results.
You obviously had the skills and understanding to do so, but were not given the chance. I'm glad to see that you have set up your next opportunity, wish you well, and am sure that your role and talents will be better appreciated than they have been in the past few months.

A: In some sense¹ I feel like some sites have lost you twice too! Once when your activity (e.g. on the Biblical Hermeneutics where we both moderated) dropped precipitously when you picked up the CM role, and now again.
You did good work Jon, and appreciate the thought and care you put into all your actions. I wish you the best in upcoming endeavors.
¹ Thankfully not in the most personal sense as my first version suggested. I stand grateful for the correction on that point.

A: Jon, you helped us on some of the more...subjective...sites handle some of the most challenging interpersonal issues in our communities with patient, calm and measured dialogue, helping us see the best in others where we maybe only saw the overt trolling, as well as supporting us in rapidly removing those that did turn out to be malicious and cruel, or downright obscene.
You helped us grow, as sites, as teams and as people.
With you gone, SE/SO is almost out of reasons for me to remain :-(
Your next employer is a very lucky company! I hope your new role is as much fun as your last one!

A: Thank you Jon for all the work you've spent making Stack Overflow a better place for all developers.
I really appreciate your effort in developing SO Documentation – answering everyone's queries and analysing the successes and failures of the project. Though, unfortunately, the project wasn't realised.
Of course, thank you for always listening to suggestions from users, not to mention adopting my idea of a "Documentation User" badge which I fondly remember.
Best of luck in your future endeavours.

A: I very much appreciate your open announcement. As so often, you come over refreshingly clear. Factual, yet from the bottom of your heart!
And by being so transparent you saved us (and the moderators here) the potential drama and endless speculations about "why is Jon leaving, right now..."
Thank you for your countless efforts to work with the user community.
I wish you all the best for your future, albeit I am less optimistic about the future of the communities here, and the company running the servers.

A: I hope the new job is also a dream job, Jon. Best of luck with it. It'll be odd to see you still around as a normal user.
Thank you for all you've done for the communities.

A: Hi Jon,
I have always loved hearing your insights, and the times I got to interact with you on a more direct level were memorably joyful.
Based on your blog post, and this, I am in some way looking forward to hearing your voice joining the chorus of community. Your posts have always been so inspirational and thoughtful.
More and more it seems there is a deep set issue with the decisions being made at Stack Overflow. That pains me, and it pains me to see the collateral damage reach people I admire.
I hope that your newfound location appreciates you as much as the community here does. Regardless of how this plays out, we will always appreciate the work you did here.
I wish you the best Jon, and I genuinely hope to see you around :)
-Travis

A: College Confidential is a good site and it will be even better with you on board. (I can't help but wonder what factors might have led you to this decision, but of course it's up to you how much or how little you want to share.)

Update: Here is an excerpt of the Jan 17, 2020 blog post Jon published called "Why I left Stack Overflow":

In September and October, a series of events demonstrated that leadership within the company neither understood community management nor was willing to learn. In retrospect, that's likely been the case for years, but the community team has traditionally been given discretion when it comes to community relations. The double-edged sword of attention meant more resources have been going to community-related projects, but also leadership has asserted more control. Unfortunately, their decisions repeatedly violated my standards for healthy community management. By November I was actively looking for a new job.

Thank you, Jon, for sharing your story with us.

A: It is sad to see another high quality member leaving. Congrats on being able to move to a new position that you can enjoy. Thanks for all your hard work here and I wish you well on your future endeavors.

A: I do not know you, nor any of the CM/moderator team from SE. I'm just a regular SO programmer who from time to time look at the meta site, without writing. Just into that 99% of users.
I just wanted to say that you looked like a good guy and a great professional. I'd bet I'm speaking on behalf of that 99%, as well.
Good luck in life Jon.

A:
I made this decision in December and it's not correlated with the recent CM team changes. These are just an unfortunate coincidence.

I wish you well. I'm glad it doesn't have to do with the recent changes.
It's just a shame to be losing yet another person that has invested into the community. And so soon after the others.
But again, I wish you well. I hope your new job becomes your new dream job.


text:
Q: aws-sdk delete_object deletes entire bucket contents? Learning the ropes of AWS S3 and the sdk.  Trying to use in in my Rails app via the aws-sdk gem.  I was following this post:
Remove entire object directory tree using AWS-SDK
Luckily for me that I was playing around in my staging bucket.  I created a folder test and uploaded an example.jpg image.  From the rails console I ran (note the lack of {} brackets):
s3.delete_object(bucket: 'mystagingbucket', key: '/test/example.jpg')
=> #<struct Aws::S3::Types::DeleteObjectOutput delete_marker=true, version_id=nil, request_charged=nil>

then I go back into the web console to find my entire bucket empty.  All my previously uploaded files, static assets, etc. all gone.
So I realize that I should turn versioning on and try this again to duplicate the issue.  After some Googling I see the docs show the {} brackets.
Now I get:
s3.delete_object({bucket: 'mystagingbucket', key: '/test/example.jpg'})
=> #<struct Aws::S3::Types::DeleteObjectOutput delete_marker=true, version_id="blohAaXlnG2.RERnj_JT3zvQmAr8io48", request_charged=nil>

except that nothing happens and the file is not deleted.  I have done some more Googling and I now see that it can take up to a few hours to see your files actually deleted so I will check back on the recent delete issues.
As for the bucket contents getting erased am I missing something here?

redpajama_set_name: RedPajamaStackExchange


text:
Q: NSdate range total removing weekends Swift Im making a works holiday/vacation day booking app.
I have an extension that works out the total number of days between 2 NSDates, it works great, but I do not know how to remove all weekend days from the total.
Can you help please?
extension NSDate {
    func numberOfDaysUntilDateTime(toDateTime: NSDate, inTimeZone     timeZone: NSTimeZone? = nil) -> Int {
        let calendar = NSCalendar.currentCalendar()
        if let timeZone = timeZone {
            calendar.timeZone = timeZone
        }
        var startDate: NSDate?, endDate: NSDate?
        calendar.rangeOfUnit(.Day, startDate: &startDate, interval: nil, forDate: self)
        calendar.rangeOfUnit(.Day, startDate: &endDate, interval: nil, forDate: toDateTime)
        let difference = calendar.components(.Day, fromDate: startDate!, toDate: endDate!, options: [])
        return difference.day
    }
}

A: I found this. It works out the number of weekend days between 2 NSDates
func numberOfWeekendsBeetweenDates(startDate startDate:NSDate,endDate:NSDate)->Int{
    var count = 0
    let oneDay = NSDateComponents()
    oneDay.day = 1;
    // Using a Gregorian calendar.
    let calendar = NSCalendar.currentCalendar()
    var currentDate = startDate;
    // Iterate from fromDate until toDate
    while (currentDate.compare(endDate) != .OrderedDescending) {
       let dateComponents = calendar.components(.Weekday, fromDate: currentDate)
        if (dateComponents.weekday == 1 || dateComponents.weekday == 7 ) {
            count++;
        }
        // "Increment" currentDate by one day.
        currentDate = calendar.dateByAddingComponents(oneDay, toDate: currentDate, options: [])!
    }
    return count
}


text:
Q: change Insert At Front linked list to Insert At Back linked list in C Language hello , to day i'm want to change Insert At Front linked list to Insert At Back linked list,i'm not sure Insert At Back code but Insert At Front code not have bug .

problem list is function void insert_at_back(LN **hptr, int d) in code
  second.

how to from : C program to insert node at the end of Singly Linked List
this is Insert At Front linked list code (NOT have bug)
    #include<stdio.h>
    #include<stdlib.h>

    struct listnode {
      int data;
      struct listnode *next;
    };

    typedef struct listnode LN;

    void insert_at_front(LN **hptr, int d);
    void print(LN *head);
    int sum(LN *head);

    int main(){
      LN *head;
      head = NULL;
      int d;
      printf("Enter data: ");
      do{
        scanf("%d", &d);
        if(d > 0){
            insert_at_front(&head,d);
        }
      }while(d > 0);
        printf("=");
        print(head);
        printf("\n=%d", sum(head));
      return 0;
    }

    void insert_at_front(LN **hptr, int d){

        LN* newNode= (LN*)malloc(sizeof(LN));
        newNode->data = d;
        newNode->next= *hptr;
        *hptr = newNode;
    }

    void print(LN *head){
        while(head !=NULL){
            printf("%d ",head->data);
            head = head->next;
        }
    }

    int sum(LN *head){
        int temp=0;
        while(head !=NULL){
            temp+=head->data;
            head = head->next;
        }
        return temp;
    }

This is Insert At Back linked list code (it have problem or bug)
#include<stdio.h>
#include<stdlib.h>

struct listnode {
  int data;
  struct listnode *next;
};

typedef struct listnode LN;

void insert_at_back(LN **hptr, int d);
void print(LN *head);
int sum(LN *head);

int main(){
  LN *head;
  head = NULL;
  int d;
  printf("Enter data: ");
  do{
    scanf("%d", &d);
    if(d > 0){
        insert_at_back(&head,d);
    }
  }while(d > 0);
    printf("=");
    print(head);
    printf("\n=%d", sum(head));
  return 0;
}

void insert_at_back(LN **hptr, int d){
    LN* head = *hptr;
    LN* newNode = (LN*)malloc(sizeof(LN));
    if(newNode==NULL){
        printf("Unable to allocate memory\n");
    }else{
        newNode->data = d;
        newNode->next= NULL;
        while(head->data!= NULL){
            head=head->next;
        }
        head->next=newNode;
    }
}

void print(LN *head){
    while(head !=NULL){
        printf("%d ",head->data);
        head = head->next;
    }
}

int sum(LN *head){
    int temp=0;
    while(head !=NULL){
        temp+=head->data;
        head = head->next;
    }
    return temp;
}

Thank you for answer ,i'm sorry if u not understand.
i'm newbie
ihm

A: There are few of problems in your insert_at_back() function.
First problem:
while(head->data!= NULL){

This should be :
while(head->next!= NULL){

Second problem:
Not checking for head pointer NULL in insert_at_back() function.
Third problem:
Not initializing the hptr in insert_at_back() function.
Your insert_at_back() should be:
void insert_at_back(LN **hptr, int d){
    LN* head = *hptr;
    LN* newNode = malloc(sizeof(LN));
    if(newNode==NULL){
        printf("Unable to allocate memory\n");
    }else{
        newNode->data = d;
        newNode->next= NULL;
        if (head != NULL) {
            while(head->next!= NULL){
                head=head->next;
            }
            head->next=newNode;
        }
        else
            *hptr = newNode;
   }
}

Last but not least - do not typecast malloc result.


text:
Q: how to compare 2 dependent variables What is the correct way to compare correlation between 2 dependent variables in R?
Thanks
Edit:
Here is the edited question and apologize for not asking this correctly before:
I acquired 2 measures from 2 different experiments and I want to know whether these 2 measures are correlated.
The problem is Measure 1 is confounded by some other covariates. So, I went ahead and did multiple regression and found the coefficient of my main effect. Since this is an estimate it has a mean with a deviation.
I could do cor(mean(parameter_estimate, Measure_2)) but I need to know if this correlation is significant. Is this right as I dont incorporate the spread of the estimate (variance)? My guess is the mean may be significant but with the standard error of the estimate, the correlation may become insignificant.
Thank you for your help
Regards

A: As @Harald Thomson mentioned, this is easy using the cor(x,y) function.  Here is an example in R.
dat <- data.frame(x1 = rnorm(20, 10, 5), x2 = rnorm(20, 10, 5))
cor(dat$x1, dat$x2)

>[1] 0.2856422

Therefore, a positive correlation exists of 0.29.  This can easily be modified in a larger data.frame.
"Correct" can be interrupted in many different ways under many different assumptions.  A more specific question would help determine what correlation you are looking for.


text:
Q: Importing Text File For Conways Game Of Life I am trying to import a text file to use as a board in Conway's game of life,  I have 2 functions,  one to read the file,  the pretty print,  to print the board out so it's user friendly.  Can someone spot where I am going wrong? This is for python 2.7.
def read_game_board(game_file):
    board = open('grid0.txt')
    game_file = board.readlines()
    return

def pretty_print(b):
    pretty_len = len(b)
    for x in range(0, pretty_len):
        for y in range(pretty_len):
            print [x][y]
        print '/n'

def main(name_of_file):
    b = read_game_board(board)
    run_game()

This is what the text file looks like:
----------
----------
---xx-----
---xx-----
----------
----------
----------
----------
----------
----------


text:
Q: Set app level proxy I'm trying to create some sort of SDK that we intercept each request from my app regardless of which HTTP client it's using (be it native HttpURLConnection, OkHttp, Retrofit etc.). And including traffic from third-party libraries like Firebase Analytics etc.
I need to intercept and check few parameters then decide whether to allow or block current request.
I don't want to use any Custom VPN as it has some side effects like showing system level Notification and all traffic from the user device.
Is it possible to capture all requests by setting app level proxy?
If possible, How to achieve it in code?

A: You can use Retrofit
The retrofit will save your development time, And also you can keep your code in developer friendly. Retrofit has given almost all the API's to make a server call and to receive a response. internally they also use GSON to do the parsing. you can go through this link you will get more info Alos you can see the difference with other libs

A: You could give a try to implement a custom VPN with https://developer.android.com/reference/android/net/VpnService. With this you should be able to control which traffic is allowed to access the internet and which not. As you wrote, that you'll create an SDK, the implementors should know the side effects of VPNs in apps (ongoing system notification, every traffic is routet through that VPN, etc.)


text:
Q: How to update all records as quickly as possible? I need to update all the records with the same value. And I don't want to do it with iteration over objects since that takes about 2 seconds for over 2000 objects. Basically I have all users locally and I receive the users id's from the server. I now want to set property 'requested' to false except for the users return from the server-
How it is done now (which is totally wrong!):
Iterating thru all users (about 2000 of them) and correcting their requested value.
NSFetchRequest * allUsers = [[NSFetchRequest alloc] init];
[allUsers setEntity:[NSEntityDescription entityForName:@"User" inManagedObjectContext:context]];
NSArray *users = [context executeFetchRequest:allUsers error:&error];

NSArray *userIDs = [JSON objectForKey:@"users_ids"];
for (User *user in users) {
    if ([userIDs containsObject:user.userID]) {
        user.requested = [NSNumber numberWithBool:YES];
    } else {
        user.requested = [NSNumber numberWithBool:NO];
    }
    user.requested = [NSNumber numberWithBool:NO];
}
[context save:nil];

My idea how to do it:
Set requested=false for every object with a sql-like one statement. Going thru id's returned by the server (20 on average) and setting requested=true for those.
// UPDATE users SET requested = false WHERE 1=1

NSArray *userIDs = [JSON objectForKey:@"users_ids"];
for (int i = 0; i < [userIDs count]; i++) {
    User *user = [User userWithServerID:[userIDs[i] integerValue] usingManagedObjectContext:context];
    user.requested = [NSNumber numberWithBool:YES];
}
[context save:nil];

So how could I update all the records with one "query" ? Or does anyone have any better idea how to implement this (more performance efficient way of doing the iteration perhaps) ?
Putting this in the background thread is a solution (perhaps), but I would still like to optimise it first before putting it in the background thread.
Thank you!

A: You would still have to fetch all the objects but you can do it all in one line.
[[fetchedResultsController fetchedObjects] makeObjectsPerformSelector:@selector(setYourValue:) withObject:[NSNumber numberWithBool:YES]];

Or just cycle the array
NSArray *objects = [context executeFetchRequest:allRequest error:&error];
[objects setValue:[NSNumber numberWithBool:YES] forKey:@"user_ids"];
//now save your changes back.
[context save:&error];


text:
Q: Xcode errors with libgcrypt In my program, I originally added json-c to it and had some missing dependencies related to libgcrypt. Now, I am getting these errors for libgcrypt that do not make any sense to me. Has anyone seen these before or are able to tell what in the world I did wrong?
CompileC /Users/jordan/Library/Developer/Xcode/DerivedData/PianoLounge-ajgojrzszrergafgvyuliphwxcpg/Build/Intermediates/PianoLounge.build/Debug/PianoLounge.build/Objects-normal/x86_64/mpih-add1-4D47DD99C77BE382.o PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S normal x86_64 assembler-with-cpp com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/jordan/Projects/Cocoa/PianoLounge
    setenv LANG en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x assembler-with-cpp -arch x86_64 -fmessage-length=0 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wshorten-64-to-32 -Wno-newline-eof -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -fasm-blocks -Wdeprecated-declarations -mmacosx-version-min=10.6 -g -Wno-sign-conversion -iquote /Users/jordan/Library/Developer/Xcode/DerivedData/PianoLounge-ajgojrzszrergafgvyuliphwxcpg/Build/Intermediates/PianoLounge.build/Debug/PianoLounge.build/PianoLounge-generated-files.hmap -I/Users/jordan/Library/Developer/Xcode/DerivedData/PianoLounge-ajgojrzszrergafgvyuliphwxcpg/Build/Intermediates/PianoLounge.build/Debug/PianoLounge.build/PianoLounge-own-target-headers.hmap -I/Users/jordan/Library/Developer/Xcode/DerivedData/PianoLounge-ajgojrzszrergafgvyuliphwxcpg/Build/Intermediates/PianoLounge.build/Debug/PianoLounge.build/PianoLounge-all-target-headers.hmap -iquote /Users/jordan/Library/Developer/Xcode/DerivedData/PianoLounge-ajgojrzszrergafgvyuliphwxcpg/Build/Intermediates/PianoLounge.build/Debug/PianoLounge.build/PianoLounge-project-headers.hmap -I/Users/jordan/Library/Developer/Xcode/DerivedData/PianoLounge-ajgojrzszrergafgvyuliphwxcpg/Build/Products/Debug/include -I/usr/local/include -I/Users/jordan/Library/Developer/Xcode/DerivedData/PianoLounge-ajgojrzszrergafgvyuliphwxcpg/Build/Intermediates/PianoLounge.build/Debug/PianoLounge.build/DerivedSources/x86_64 -I/Users/jordan/Library/Developer/Xcode/DerivedData/PianoLounge-ajgojrzszrergafgvyuliphwxcpg/Build/Intermediates/PianoLounge.build/Debug/PianoLounge.build/DerivedSources -F/Users/jordan/Library/Developer/Xcode/DerivedData/PianoLounge-ajgojrzszrergafgvyuliphwxcpg/Build/Products/Debug -MMD -MT dependencies -MF /Users/jordan/Library/Developer/Xcode/DerivedData/PianoLounge-ajgojrzszrergafgvyuliphwxcpg/Build/Intermediates/PianoLounge.build/Debug/PianoLounge.build/Objects-normal/x86_64/mpih-add1-4D47DD99C77BE382.d --serialize-diagnostics /Users/jordan/Library/Developer/Xcode/DerivedData/PianoLounge-ajgojrzszrergafgvyuliphwxcpg/Build/Intermediates/PianoLounge.build/Debug/PianoLounge.build/Objects-normal/x86_64/mpih-add1-4D47DD99C77BE382.dia -c /Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S -o /Users/jordan/Library/Developer/Xcode/DerivedData/PianoLounge-ajgojrzszrergafgvyuliphwxcpg/Build/Intermediates/PianoLounge.build/Debug/PianoLounge.build/Objects-normal/x86_64/mpih-add1-4D47DD99C77BE382.o

/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:33:16: error: unexpected token in '.set'
 .set noreorder
               ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:34:11: error: unexpected token in '.set'
 .set noat
          ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:38:2: error: unknown directive
 .ent _gcry_mpih_add_n
 ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:40:2: error: unknown directive
 .frame $30,0,$26,0
 ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:42:11: error: unexpected token in memory operand
 ldq $3,0($17)
          ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:43:11: error: unexpected token in memory operand
 ldq $4,0($18)
          ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:45:13: error: invalid operand for instruction
 subq $19,1,$19
            ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:46:2: error: unknown use of instruction mnemonic without a size suffix
 and $19,4-1,$2 # number of limbs in first loop
 ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:47:2: error: invalid instruction mnemonic 'bis'
 bis $31,$31,$0
 ^~~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:48:2: error: invalid instruction mnemonic 'beq'
 beq $2,.L0 # if multiple of 4 limbs, skip first loop
 ^~~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:50:11: error: invalid operand for instruction
 subq $19,$2,$19
          ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:52:19: error: invalid operand for instruction
.Loop0: subq $2,1,$2
                  ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:53:11: error: unexpected token in memory operand
 ldq $5,8($17)
          ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:54:10: error: invalid operand for instruction
 addq $4,$0,$4
         ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:55:11: error: unexpected token in memory operand
 ldq $6,8($18)
          ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:56:2: error: invalid instruction mnemonic 'cmpult'
 cmpult $4,$0,$1
 ^~~~~~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:57:10: error: invalid operand for instruction
 addq $3,$4,$4
         ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:58:2: error: invalid instruction mnemonic 'cmpult'
 cmpult $4,$3,$0
 ^~~~~~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:59:11: error: unexpected token in memory operand
 stq $4,0($16)
          ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:60:2: error: unknown use of instruction mnemonic without a size suffix
 or $0,$1,$0
 ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:62:13: error: invalid operand for instruction
 addq $17,8,$17
            ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:63:13: error: invalid operand for instruction
 addq $18,8,$18
            ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:64:2: error: invalid instruction mnemonic 'bis'
 bis $5,$5,$3
 ^~~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:65:2: error: invalid instruction mnemonic 'bis'
 bis $6,$6,$4
 ^~~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:66:13: error: invalid operand for instruction
 addq $16,8,$16
            ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:67:2: error: invalid instruction mnemonic 'bne'
 bne $2,.Loop0
 ^~~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:69:6: error: invalid instruction mnemonic 'beq'
.L0: beq $19,.Lend
     ^~~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:72:19: error: invalid operand for instruction
.Loop: subq $19,4,$19
                  ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:74:11: error: unexpected token in memory operand
 ldq $5,8($17)
          ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:75:10: error: invalid operand for instruction
 addq $4,$0,$4
         ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:76:11: error: unexpected token in memory operand
 ldq $6,8($18)
          ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:77:2: error: invalid instruction mnemonic 'cmpult'
 cmpult $4,$0,$1
 ^~~~~~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:78:10: error: invalid operand for instruction
 addq $3,$4,$4
         ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:79:2: error: invalid instruction mnemonic 'cmpult'
 cmpult $4,$3,$0
 ^~~~~~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:80:11: error: unexpected token in memory operand
 stq $4,0($16)
          ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:81:2: error: unknown use of instruction mnemonic without a size suffix
 or $0,$1,$0
 ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:83:12: error: unexpected token in memory operand
 ldq $3,16($17)
           ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:84:10: error: invalid operand for instruction
 addq $6,$0,$6
         ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:85:12: error: unexpected token in memory operand
 ldq $4,16($18)
           ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:86:2: error: invalid instruction mnemonic 'cmpult'
 cmpult $6,$0,$1
 ^~~~~~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:87:10: error: invalid operand for instruction
 addq $5,$6,$6
         ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:88:2: error: invalid instruction mnemonic 'cmpult'
 cmpult $6,$5,$0
 ^~~~~~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:89:11: error: unexpected token in memory operand
 stq $6,8($16)
          ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:90:2: error: unknown use of instruction mnemonic without a size suffix
 or $0,$1,$0
 ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:92:12: error: unexpected token in memory operand
 ldq $5,24($17)
           ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:93:10: error: invalid operand for instruction
 addq $4,$0,$4
         ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:94:12: error: unexpected token in memory operand
 ldq $6,24($18)
           ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:95:2: error: invalid instruction mnemonic 'cmpult'
 cmpult $4,$0,$1
 ^~~~~~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:96:10: error: invalid operand for instruction
 addq $3,$4,$4
         ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:97:2: error: invalid instruction mnemonic 'cmpult'
 cmpult $4,$3,$0
 ^~~~~~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:98:12: error: unexpected token in memory operand
 stq $4,16($16)
           ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:99:2: error: unknown use of instruction mnemonic without a size suffix
 or $0,$1,$0
 ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:101:12: error: unexpected token in memory operand
 ldq $3,32($17)
           ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:102:10: error: invalid operand for instruction
 addq $6,$0,$6
         ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:103:12: error: unexpected token in memory operand
 ldq $4,32($18)
           ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:104:2: error: invalid instruction mnemonic 'cmpult'
 cmpult $6,$0,$1
 ^~~~~~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:105:10: error: invalid operand for instruction
 addq $5,$6,$6
         ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:106:2: error: invalid instruction mnemonic 'cmpult'
 cmpult $6,$5,$0
 ^~~~~~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:107:12: error: unexpected token in memory operand
 stq $6,24($16)
           ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:108:2: error: unknown use of instruction mnemonic without a size suffix
 or $0,$1,$0
 ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:110:14: error: invalid operand for instruction
 addq $17,32,$17
             ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:111:14: error: invalid operand for instruction
 addq $18,32,$18
             ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:112:14: error: invalid operand for instruction
 addq $16,32,$16
             ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:113:2: error: invalid instruction mnemonic 'bne'
 bne $19,.Loop
 ^~~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:115:16: error: invalid operand for instruction
.Lend: addq $4,$0,$4
               ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:116:2: error: invalid instruction mnemonic 'cmpult'
 cmpult $4,$0,$1
 ^~~~~~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:117:10: error: invalid operand for instruction
 addq $3,$4,$4
         ^~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:118:2: error: invalid instruction mnemonic 'cmpult'
 cmpult $4,$3,$0
 ^~~~~~
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:119:11: error: unexpected token in memory operand
 stq $4,0($16)
          ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:120:2: error: unknown use of instruction mnemonic without a size suffix
 or $0,$1,$0
 ^
/Users/jordan/Projects/Cocoa/PianoLounge/PianoLounge/libgcrypt/mpi/alpha/mpih-add1.S:123:2: error: unknown directive
 .end _gcry_mpih_add_n
 ^
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

I made sure to only include the needed files (.h and .c) and it cleared up the errors I was receiving, but now I am back to receiving the linker errors.
http://pastebin.com/VM0aBU1m

A: in the previous question you asked (an hour ago?) you said you copied the whole libgcrypt folder wholesale (i.e. entirely) into your current project.  From what I can tell up there, Xcode is spewing errors on a file that ends with the suffix ".S". Xcode doesn't know what to do with them. And I don't know what they are.
Really, all you need is to include into your project are the files from libgcrypt that are appropriate for what you are trying to do.
That likely being... "include" or "import" header files that end with the suffix ".h", the actual ".framework" or ".a" or ".dylib" library files.
That's it.
If my answer doesn't get you to your solution, please edit your question to show a screenshot of what your project looks like in Xcode, and especially how those included files look in the File Inspector.

A: Wow, I'm an idiot. I don't know why I felt the need to add these libraries in manually. I ended up using MacPorts to get the required libraries and it worked great.


text:
Q: How to record video in ProRes codec on iOS? I would like to capture video from device's back camera directly to ProRes codec, now that .proRes422 and .proRes4444 are available as AVVideoCodecType options in iOS 11.
But I receive an error that recording is:

unsupported given the current configuration

On both iPhone X and second generation iPad Pro, when trying to capture video with the following code:
movieFileOutput.setOutputSettings([AVVideoCodecKey: AVVideoCodecType.proRes422],
                                  for: movieFileOutputConnection!)

If this approach is wrong, can the captured video be encoded by using AVCaptureVideoDataOutput alongside AVAssetWriter?

A: I received a response from Brad Ford, an engineer from camera software team at Apple:

The AVVideoCodecType (string) is available, meaning you can compile
  code that references this constant without a compile error. But
  AVCaptureMovieFileOutput is telling you the truth. ProRes is not
  supported on iOS.


text:
Q: WPF Expander - when GridSplitter used to manually resize row, row does not properly collapse This is what I have
   <Grid.RowDefinitions>
      <RowDefinition Height="Auto" MinHeight="25"/>
      <RowDefinition Height="Auto"/>
      <RowDefinition />
  </Grid.RowDefinitions>

<Expander IsExpanded="False" Grid.Row="0" >
     <DataGrid name="FirstGrid" />
</Expander>
<GridSplitter Grid.Row="1" HorizontalAlignment="Stretch"  Height="5" />
<DataGrid Grid.Row="2" name="SecondGrid" />

When I click the expand button on the expander it correctly expands row 0 to the size of the DataGrid FirstGrid and it properly collapses the row as well. This does not work however if I expand the FirstGrid then manually resize that row by dragging the GridSplitter up or down and then pressing collapse button on the expander. What happens is that FirstGrid collapses but the row itself the FirstGrid is in does not. Any suggestions?
Thanks

A: Rob is right, once you move the gridsplitter, the Height of the first Row will not be Auto anymore, so it will not respond to the change in the expander size
In order for this to work you would need to add a behavior to the expander which will listen to the expander.expanded and collapsed event and update the grid row to be auto again. something like this:
public class GridColumnWidthReseterBehaviour : Behavior<Expander>
{
    private Grid _parentGrid;
    public int TargetGridRowIndex { get; set; }
    protected override void OnAttached()
    {
        AssociatedObject.Expanded += AssociatedObject_Expanded;
        AssociatedObject.Collapsed += AssociatedObject_Collapsed;
        FindParentGrid();
    }

    private void FindParentGrid()
    {
        DependencyObject parent = LogicalTreeHelper.GetParent(AssociatedObject);
        while (parent != null)
        {
            if (parent is Grid)
            {
                _parentGrid = parent as Grid;
                return;
            }
            parent = LogicalTreeHelper.GetParent(AssociatedObject);
        }
    }

    void AssociatedObject_Collapsed(object sender, System.Windows.RoutedEventArgs e)
    {
        _parentGrid.RowDefinitions[TargetGridRowIndex].Height= GridLength.Auto;
    }

    void AssociatedObject_Expanded(object sender, System.Windows.RoutedEventArgs e)
    {
        _parentGrid.RowDefinitions[TargetGridRowIndex].Height= GridLength.Auto;
    }
}

And you use it like this:
 <Expander ...>
    <interactivity:Interaction.Behaviors>
                <behaviors:GridColumnWidthReseterBehaviour TargetGridRowIndex="0"></behaviors:GridColumnWidthReseterBehaviour>
            </interactivity:Interaction.Behaviors>

...

A: As soon as you move the gridsplitter, the Height of the first Row will not be Auto anymore, but a certain value, like 70. After that it doesn't matter if some child in that row changes its height.
Combining a splitter with some auto-sized child/row is very difficult; you can take a look at the side expander in Microsoft Outlook; i suspect that this is what you want. If so, you shouldn't use an expander, because a regular expander contains a StackPanel so its children are always auto-sizing in the expand direction. I'm not sure what you want, but i think going for a custom control is your best option.


text:
Q: Automatically sort class items in PlantUML Sometimes it is very tiresome to sort keys alphabetically, especially in larger tables, which grow over time.
Let's look at this diagram:

@startuml
!define Table(name,desc) class name as "desc" << (T,white) >>
!define primary_key(x) <color:b8861b><&key></color> x
!define column(x) <color:black><&media-record></color> x

Table(testTable, "demoTable") {
column(zzz)
column(aaaa)
column(gggg)
}
@enduml

Is there any option for PlantUML that would sort my column entries based on their names?
I want to display the diagram as if I'd have written it as

@startuml
!define Table(name,desc) class name as "desc" << (T,white) >>
!define primary_key(x) <color:b8861b><&key></color> x
!define column(x) <color:black><&media-record></color> x

Table(testTable, "demoTable") {
column(aaaa)
column(gggg)
column(zzz)
}
@enduml

Is it possible with built-in tools, or do you have any idea how to accomplish this?

A: You could suggest the feature to the PlantUML Q&A Forum.
In the mean time, why not use an !include and sort the items in your operating system. Here's a sample:
@startuml
!define Table(name,desc) class name as "desc" << (T,white) >>
!define primary_key(x) <color:b8861b><&key></color> x
!define column(x) <color:black><&media-record></color> x

Table(testTable, "demoTable") {
!include items.include
}

Table(testTableSorted, "demoTable(sorted)") {
!include sorted_items.include
}
@enduml

You could always keep the file sorted, or sort a copy of it:
sort items.include > sorted_items.include


text:
Q: Writing and deploying Android app So I want to make an app to scrape random inspirational quotes from a website, then show me them on my Android phone.  What steps do I need to do this?  Preferably I'd be able to do it in Clojure... if not that, then Ruby, if all else fails Java.
What do I need to do to write the app and importantly, to deploy it?

A: Hm, that's a very general questions with not a lot of info, but here are some random pointers for different parts of our question:

*

*Enlinve: Scraping with Clojure

*An Enlive tutorial

*Screen Scraping with ScrAPI: A screencast on scraping in Ruby

*Mechanize for scraping in Ruby (Nokogiri and Hpricot could also work)

*Rhodes for Android development with Ruby

A: An Android application is developed in Java. You can also solely use C++ in the most recent version, but I think that's not what you're looking for. There are, however, a few hacks you can use to write less Java.
Are you familiar with Mirah? Mirah looks a lot like Ruby but it's statically typed. You can use Mirah to develop Android applications. Have a look.
You can also use Ruby, by taking advantage of the JVM (JRuby). Daniel Jackoway developed Ruboto in last years' Ruby Summer of Code. Ruboto allows you to develop Android applications in Ruby. Have a look.
Concerning site scrapping, one option is to use Nokogiri as Michael mentioned. It'll work in both Ruby and Java, but in the latter you'll have to hack a bit — not everything is currently working. There are a lot of HTML parsers for Java as well, namely HTMLparser or JerichoHTML.
Android applications are officially developed in Java/C++ but, as you can see, there are other options. Don't forget to take into consideration that by choosing these other options you won't be able to take advantage of the Android SDK.

A: The path of least resistance on Android would be Java.  The app works basically like any other "screen scraper": pull the page, parse it, and display the information.  How easily it is to parse will depend on how well structured the content is on the original site.  If it happens to have an RSS feed you can probably use one of the many open-source Java RSS Parsers.

A: If you already have a server side program to acheive this, you can create a webview activity in android to show the same. So you can create your server side program in a language of your choice.

A: For me phase 1 would be to write a web app and access it using the Android web browser. You can use a JavaScript library such as jqTouch to make the web app look just like a native Android app, and you can access the geolocation api from the browser using HTML5.
I've built an iPhone app demo using this approach with compojure on the server and deployed to google app engine. It worked well.
Cheers,
  Colin


text:
Q: strtotime not adding date correctly I'm trying to add a calculated number of days to today's date.  I am creating a string '+93 days' for strtodate using a calculation to get the 93.  When i type the string out it in strtotime, I get the correct date.  When I use the calculation to build a string (see below), I get a drastically wrong date.  Is there a better way to format my string or another option?
  function debtPayoffDate($mPay, $balance, $irr) {
        $days = 365/12*(log($mPay) - log($mPay-$balance*$irr/12))/log(1+$irr/12);
        $days = round($days, 0);
        $daysString = "'+" . $days . " days'";
        echo $daysString;
        $payoffDate = date("m/d/y", strtotime($dayString));
        echo $payoffDate;
    }
    debtPayoffDate($mPay, $balance, $irr);

The output I get for this is '+93 days'12/31/69, rather than the correct result which is '+93 days'11/16/16

A: *

*Wrong formatting in $daysString, ditch the single quotes.

*wrong variable name in strtotime($dayString), it should be$daysString


text:
Q: Python creating/ formatting CSV files for columns and rows I have a web scraper that saves the scrapes data into a CSV file. The data looks like this:

random text
Johm May
1234 Big Street
Atlanta, GA 30331
acre .14  small
random text
Jane Jones
4321 Little Street
Atlanta, GA 30322
acre .07 small
random text

I would like to:
(1) Add in the columns Name,Street,,Address  <--- Note that this sample is delimited by a comma.
(2) I would like to add commas to the address results I posted above. An example would be:

jane jones
,4321 Little Street
,,Atlanta, GA 30344
,,,acre .07 small
,,,random text

Note how the commas are used to push each line to the desired column with the unneeded data acre .07 small and random text being pushed away from the named columns.
How do I do this in python? I can do it by hand, but I'm dealing with thousands of address and I need a simple way to do this in python.
Is it possible to pull all the data into a list after if has been scraped, and to assign a variable for the commas like a = , b = ,, c = ,,,  and then to join the variable to a specific line in the list, and then to save it again?
Also, I need to add the column info as well: columns Name,Street,,Address

A: I'm just guessing what you mean on a lot of this, since your question seems to be missing some details, but this should get you something similar to what you want:
import csv

with open('data.txt', 'r') as f:
    with open('data.csv', 'wb') as csv_out:
        line_iter = iter(l.rstrip('\n') for l in f)
        writer = csv.writer(csv_out)
        writer.writerow(['Name', 'Street', '', 'Address'])
        try:
            line_iter.next()    # discard 'random text' (?)
            while True:
                writer.writerow([line_iter.next(), '', '', ''])
                writer.writerow(['', line_iter.next(), '', ''])
                writer.writerow(['', '', line_iter.next(), ''])
                writer.writerow(['', '', '', line_iter.next()])
                writer.writerow(['', '', '', line_iter.next()])
        except StopIteration:
            pass        # reached end of file

It gives this output for your example data above:

Name,Street,,Address
Johm May,,,
,1234 Big Street,,
,,"Atlanta, GA 30331",
,,,acre .14 small
,,,random text
Jane Jones,,,
,4321 Little Street,,
,,"Atlanta, GA 30322",
,,,acre .07 small
,,,random text


text:
Q: Create array from string containing parent and child separators I am trying to figure out how to convert this string to an array, while also not repeating "parent" keys. The parent seperater is | while child seperator is >.
Example string: Progressivism and World War 1>Gender and Equality|Progressivism and World War 1>Social Change and Reform|The Great Depression and the New Deal
In the above example "Progressivism and World War 1" has two children, namely: "Gender and Equality" and "Social Change and Reform".
End result should be:
[0] => [
  'name'   => 'Progressivism and World War 1'
  'parent' => false
],
[1] => [
  'name' => 'Gender and Equality'
  'parent' => 'Progressivism and World War 1'
],
[2] => [
  'name' => 'Social Change and Reform'
  'parent' => 'Progressivism and World War 1'
],
[3] => [
  'name' => 'The Great Depression and the New Deal'
  'parent' => false
],

A: First, you have to split your string into multiple parts to get the different parts you need to build the array. You can do this in PHP with explode(string delemiter, string input).
Then, loop through them and do the same again. Before adding to the array, check if there is a parent, if not set parent to false.
That's the solution i came up with:
<?php

$input = "Progressivism and World War 1>Gender and Equality|Progressivism and World War 1>Social Change and Reform|The Great Depression and the New Deal";
$result = [];

$parents = explode('|', $input);

foreach($parents as $parent) {
    $childs = explode(">", $parent);
    if(count($childs) === 1) {
        $result [] = [
            'name' => $childs[0],
            'parent' => false
        ];
    } else {
        $result [] = [
            'name' => $childs[1],
            'parent' => $childs[0]
        ];
    }
}

A: Why not break the lines up based on the parent separator and build an associative array with the children nested inside?
Example string: Progressivism and World War 1>Gender and Equality|Progressivism and World War 1>Social Change and Reform|The Great Depression and the New Deal
Would become
['Progressivism and World War 1'] => ['Gender Equality', 'Social Change and Reform']
['The Great Depression and the New Deal'] => [...]

The parents are the outer keys and the children are associated to the parents automatically.  Should make looping and referencing the data easier.


text:
Q: Runtime Type casting without generics This code works. But noticing the similarity between the 6th & 10th line,
void someThing_Click(object sender, RoutedEventArgs e)
{
    President pres;
    if (e.GetType() == typeof(MouseButtonEventArgs))
    {
         pres = (sender as SomeUserControl ).DataContext as President;
    }
    else
    {
         pres = (sender as MenuItem ).DataContext as President;
    }
}

is there a way to shorten the code like,
Type t = (e.GetType() == typeof(MouseButtonEventArgs)) ? SomeUserControl : MenuItem;
pres = (sender as t).DataContext as President;

the code above doesn't work, just for illustration.

A: I think no need of checking type of event args and all, this should be enough
President pres = ((FrameworkElement)sender).DataContext as President;

A: DataContext property is of class FrameworkElement i.e. your SomeUserControl and MenuItem  inherit from FrameworkElement. So you can type cast it to FrameworkElement directly:
pres = ((FrameworkElement)sender).DataContext as President;

A: Directly use DataContext from FrameworkElement
var fe = sender as FrameworkElement
if(fe != null)
{
    President pres = fe.DataContext as President;
}


text:
Q: What the curvature $2$-form really represents? Let $(E,\pi,B)$ be a principal bundle with structure group $G$. The connection $1$-form can be thought of as a projection on the vertical part. It allows us to characterize the horizontal subspaces as $H_p E = \ker \omega_p$ then.
Apart from that, there's the curvature $2$-form. This object is defined as follows: let $\operatorname{hor}$ mean the projection operator taking a vector field to its horizontal part. Then, if $\eta$ is a $k$-form on $E$ its exterior covariant derivative is the $k+1$ form $D\eta$ defined by
$$D\eta(X_1,\dots,X_{k+1}) = d\eta(\operatorname{hor}X_1,\dots,\operatorname{hor}X_{k+1}).$$
We call the curvature $2$-form then the differential form $\Omega = D\omega$ where $\omega$ is the connection $1$-form.
Although the definition is perfectly clear I can't understand what this object really represents. I mean, when we define curvature for curves on space, the curvature is meant to represent how much the curve deviates from a straight line. On the other hand, when reading books about General Relativity some time ago, I read that the curvature of the Levi-Civita connection is intended to encode the information of the difference between a paralel transported vector around a loop and the starting vector. Those two ideas are more geometric. This curvature $2$-form, on the other hand, I can't understand what it really represents.
So, what the curvature $2$-form really represents? How it relates to those other ideas of curvature? And how this intuition is captured by the rigorous definition?

A: Remember we are working with principal bundles. Thus, contrary to what other people seem to think, a curvature $2$-form is not the same thing as a Riemann curvature tensor. However, we can get a Riemann curvature tensor from it, in specific cases. We shall discuss that construction momentarily.
Let $P$ be a principal $G$-bundle with projection $\pi:P\to B$. Fixing a connection form $\omega$ on $P$ and a projection $h:TP\to HP$, we define the curvature $2$-form $\Omega$ by $\Omega(X\wedge Y)=\mathrm{d}\omega(hX\wedge hY)$. Expanding this a little further, we get $$\Omega(X\wedge Y)=hX(\omega(hY))-hY(\omega(hX))-\omega([hX,hY])=-\omega([hX,hY]).$$
How might we interpret that? Well, I like to think of it as a measure of how vertical the bracket of the horizontal projections is.
Now, if we consider the frame bundle $F_{GL}M$ of a smooth manifold $M$, then we can get a connection on $F_{GL}M$ and pass that information down to $M$. However, in order to do this, we need to talk in terms of specific frames to get specific projections, leading to la méthode du repère mobile or, roughly translated, "the method of moving frames." Using this, we can essentially interpret $R$ as the "passed-down version of $\Omega$ on $M$".


text:
Q: If $\big\{n(k);k\in \mathbb{N}\big\}$ be set of all natural numbers none of whose digits is $6$, does $\frac1{n(1)}+\frac1{n(2)}+\ldots$ converge?
If $\big\{n(k);k\in \mathbb{N}\big\}$ be set of all natural numbers none of whose digits is $6$, does $$\frac1{n(1)}+\frac1{n(2)}+\ldots+\frac1{n(k)}+\ldots$$ converge?

Actually,  I have tried of using comparison test to show that it does converge or diverge, but I don't even know it converges or not, and as it is a sub-series of  $$1+\frac 12+ \frac 13+\frac14+....$$  which diverges very slowly, hence calculators are not helpful to determine it's nature.

A: There are only $9^k$ such numbers with $k$ digits; they together contribute at most $9^k\cdot \frac1{10^{k-1}}$.


text:
Q: Determining How a Document Was Matched in Elasticsearch I would like to make an or search between two different condition trees-
{
  "query": {
    "bool": {
      "should": [
        { "bool": { ... } },
        { "bool": { ... } }
      ]
    }
  }
}

And it would be helpful to know of the found documents, which of the two conditions (or both) were matched that resulted in this document match.
Is this possible?

A: You can use the explain parameter to show how the score was computed. This shows the score for each hit, so it will give the fields that matched and the score.
{
  "explain": true,
  "query": {
    "bool": {
      "should": [
        { "bool": { ... } },
        { "bool": { ... } }
      ]
    }
  }
}

A: Thank you @Tim and @Val. I was looking for named_queries.
{
  "query": {
    "bool": {
      "should": [
        { "bool": { "_name": "x", "must": [ ... ] } },
        { "bool": { "_name": "y", "must": [ ... ] } },
      ]
    }
  }
}


text:
Q: Starting a multisite Symfony CMF Instance I am checking to see if there are any recommendations on creating a multisite instance of the Symfony CMF.
My initial thoughts are to launch with Symfony 2.2 and would like to rapidly adopt the CMF once it becomes stable. If there are any known best practices to allow this, please let me know.

A: The CMF for now has no special support for multisite. The route document however does map the hostname field so multi-domain routing should already work.
Unless you want to mix the routes from all domains, you would want to separate the routes tree by domain and build something into the route provider to handle the domain name. A pull request on the cmf RoutingBundle would definitely be appreciated.


text:
Q: Node.js: How to set npm start? I tried to use npm start to start my application. So I added the following line in my package.json file:
  "scripts": {
    "start": "node app.js"
  }

however, when I used npm start, I met with this problem:

but when I used node app.js, it worked. So what's the problem?

A: Use the command npm run start instead of npm start.


text:
Q: Can't get rid of trash while overloading operator << in C++ class point //declaration of class
{
    private:
    int x, y;
    friend std::ostream &operator << (std::ostream &input, point &p);
    public:
    //constructors and some other methods
};

//definition of overloading <<
std::ostream &operator << (std::ostream &input, point &p)
{
    input << std::cout << "x = " << p.x << " y = " << p.y << " ";
    return input;
}

And it works but when I use it
std::cout << object;

it shows some trash before my text:
062ACC3E8x = 1 y = 22

So 062ACC3E8X is something that always appears. It is defferent if I restart Visual Studio which I'm working on, so I suppose It's some memory adress. How to get rid of it? Is it something missing or wrong in my code?

A: You output some adress, since std::ostream has implicit void* conversion operator.

1) Returns a null pointer if fail() returns true, otherwise returns a
  non-null pointer. This pointer is implicitly convertible to bool and
  may be used in boolean contexts.

Should be just
input << "x = " << p.x << " y = " << p.y << " ";

A: You are passing std::cout into your output stream. Change your code to:
//definition of overloading <<
std::ostream &operator << (std::ostream &input, point &p)
{
    input << "x = " << p.x << " y = " << p.y << " ";
    return input;
}


text:
Q: Defined a character with \DeclareUnicodeCharacter - "Undefined control sequence" when I use it I'm trying to define some unicode characters to add a halloween theme to my upcoming homework, but I'm getting "Undefined control sequence" when I try to use a character that I've declared.
Here is my LaTeX file:
\Documentclass[24pt,a4paper,margin=1in]{report}

\usepackage[utf8]{inputenc}

\DeclareUnicodeCharacter{00E4}{\pumpkin}

\begin{document}

\pumpkin

\end{document}

And here is the console output up through the error when I build it with pdflatex:
$ pdflatex.exe hw5.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7140 64-bit)
entering extended mode
(hw5.tex
LaTeX2e <2018-12-01>
("D:\MiKTeX 2.9\tex/latex/base\report.cls"
Document Class: report 2018/09/03 v1.4i Standard LaTeX document class
("D:\MiKTeX 2.9\tex/latex/base\size10.clo"))
("D:\MiKTeX 2.9\tex/latex/base\inputenc.sty")

LaTeX Warning: Unused global option(s):
    [24pt,margin=1in].

(hw5.aux)
! Undefined control sequence.
l.11 \pumpkin

Any help would be appreciated.


text:
Q: django custom file storage path i would like to dynamically set the file storage path from the view regardless of the actual media_root path. is this possible. i have looked into custom storage objects and i am aware of the custom upload_to method call. currently i have a method that is called when my ImageField model upload_to is specified. this lets me change the directory within media_root. i have tried to do something similar with an overriden FileSystemStorage class but whatever it is set to i think it is bound before i can modify it within a view. if fileupload handler is the way to go i would be curious as to how to implement one.

A: If path that you specified in upload_to starts with / then it will be considered as absolute path.  Through this you can set any path that you want regardless of MEDIA_ROOT.

A: you can do this in your view path = default_storage.save(filePath, ContentFile(file))
where filePath is file path where you need to store, and file is the file which is uploaded by user. this function will return you the path by storing file.
file = request.FILES['filee']
filePath = '%s/%s' % ('path/to/directory', file.name)
file = file.read()
path = default_storage.save(filePath, ContentFile(file))


text:
Q: Is the span of a subspace and its sympletic complement the entire space? So for a finite-dimensional symplectic vector space $V$, the symplectic complement of a subspace $W$ is defined as:
$$
W^\omega=\{x \in V \mid \omega(x, y)=0 \text { for all } y \in W\}
$$
I was just wondering, does the span of $W$ and $W^\omega$ equal the entire space $V$? If not are there any counterexamples? We know the sum of the dimensions is, in fact, $V$ but I can't prove that the span is the entire space so I suspect it is not true.

A: This is one of the most elementary differences between symplectic linear algebra and the study of inner product spaces. An inner product $g$ on a vector space $V$ has the positive definite property: $g(v,v)\ge 0$ for $v\in V$, with $g(v,v)=0$ if and only if $v=0$. Completely in the opposite direction, for a symplectic form $\omega(v,v)=0$ for all $v\in V$.
Nondegeneracy of the alternating $2$-form $\omega$ implies $\dim W + \dim W^\omega = \dim V$ just as nondegeneracy of $g$ implies $\dim W +\dim W^\perp = \dim V$. However, the positive definiteness condition of $g$ guarantees $W \cap W^\perp = 0$. Therefore, $W \oplus W^\perp = V$.
In the symplectic case, $W\cap W^\omega = 0$ is not necessarily the case. As Yi Li points out - take any Lagrangian subspace of $V$. More generally, take an isotropic subspace : one so that $W\subset W^\omega$. A dimension count shows $W+W^\omega \ne V$.


text:
Q: Open localhost:3000 in kiosk mode after the Node.js server has finished spinning up I'm working on a raspberry pi project that involves running a node server in kiosk mode.
I'm using BROWSER=none to suppress the default opening of the localhost upon the server being run.
I'm thinking I should be able to use wait-on to force the bash script that runs the kiosk mode to wait until the server is fully up. Would I use something like this?
"scripts": {
    ...
    "kiosk": "concurrently -n \"npm start\" \"wait-on http://localhost:3000 & /home/pi/kiosk.sh\""
  },

It gives me the following error(s) which I'm not quite able to decipher:
[npm start] server does not have extension for -dpms option
[npm start] libEGL warning: DRI2: failed to authenticate
[npm start] [1498:1498:1125/180040.467781:ERROR:gpu_init.cc(441)] Passthrough is not supported, GL is egl
[npm start] [1498:1498:1125/180040.786918:ERROR:viz_main_impl.cc(162)] Exiting GPU process due to errors during initialization
[npm start] [1558:1558:1125/180041.392714:ERROR:gpu_init.cc(441)] Passthrough is not supported, GL is swiftshader
[npm start] [1443:1590:1125/180042.359030:ERROR:object_proxy.cc(622)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[npm start] [1443:1590:1125/180042.364570:ERROR:object_proxy.cc(622)] Failed to call method: org.freedesktop.UPower.GetDisplayDevice: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[npm start] [1443:1590:1125/180042.367155:ERROR:object_proxy.cc(622)] Failed to call method: org.freedesktop.UPower.EnumerateDevices: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[npm start] Fontconfig error: Cannot load default config file: No such file: (null)

I'm now realizing the error in my code has more to do with kiosk.sh than it does with the npm commands. Here's the code to kiosk.sh:
#!/bin/bash

xset s noblank
xset s off
xset -dpms

unclutter -root &

sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/pi/.config/chromium/Default/Preferences
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /home/pi/.config/chromium/Default/Preferences

/usr/bin/chromium-browser --noerrdialogs --disable-infobars --kiosk http://localhost:3000/ &

A: & and && mean different things, && means AND, & means background process, run that service in the background and continue with the next.
I think what you're trying to do is wait-on service && example, not wait-on service & example.
What will happen with what you've done is it will run the wait-on, then immediately background process it, then immediately run the shell script without waiting for anything.  Your script will run before the server is up.
That's not really your issue though, I believe your issue is with chromium itself.  There's an open issue for it here: https://bugs.chromium.org/p/chromium/issues/detail?id=1221905&q=Passthrough%20is%20not%20supported%2C%20GL%20is%20swiftshader&can=1.  That issue was last updated earlier this year and seems to still be unresolved.
There was also another answer for it here: Passthrough is not supported, GL is disabled.
I've seen quite a few people suggest that you use --headless and --disable-gpu and --disable-software-rasterizer.  People have mentioned that some of those options are only required on windows and some have already been fixed, I don't know which of those are actually required.
This answer here: Force headless chromium/chrome to use actual gpu instead of Google SwiftShader, mentioned that you can force webgl using --enable-webgl to prevent it from loading swiftshader and use the gpu.  You can do this if you need to force it in headless mode.
It seems to have something to do with webgl or hardware acceleration.  Apparently it happens if you've disabled gpu acceleration and then it's forced to fallback on swiftloader.
I don't know which one of those is actually going to help you, you'll have to play around with it.  However I have seen over 10 different chromium and other related issues all made during 2021 because of this bug in chromium.
What's more is that I'm not sure it's actually a critical error, some people mention it's just showing the error but can be just ignored.  I don't know if that's the case.

A: I assume that you are using the package "wait-on" (https://www.npmjs.com/package/wait-on). The wait-on command is used without npm in front of it.
Try to use
wait-on http://localhost:3000 && /home/pi/kiosk.sh

A: You could use the "child_process" npm package to execute your bash script once the server is ready. Assuming you use Express.js in your backend, this should work with little modification
const exec = require('child_process');
//all your other codes and whatevers
app.listen(3000, () => {
    var kiosk = exec('sh kiosk.sh',
        (error, stdout, stderr) => {
            if (error) {
                console.log(`exec error: ${error}`);
            }
     });
});

A: wait-on waits until the process is closed. You are not closing chromium so it never continues. If you want to wait until the server is running. You can log the server's status to a text file and have your bash script read it in a loop until it contains the ready text you specify.
If you want to confirm beyond a reasonable doubt that the server is running as needed.
You can install the npm package puppetter. Then use the create and run a node script from bash using page.goto command to load the web page in an instance of chromium and use waitForSelector to check if the DOM element of your web page exists.
Then you use call process.exit() with whatever error codes you want to use to confirm that the page is live and running.


text:
Q: What happens under the hood when running testng.xml to trigger testng? I know what to write inside the testng.xml file. I also know several ways to trigger testng. What I want to understand is what happens when running the xml file. What underlying code are there that support us to trigger Testng by just running the file? Is it the same as running java org.testng.TestNG testng.xml command line?

A: xml file is a good way to arrange data, especially data with complex meanings or structures. If you want to feed in the same amount of data to program with input arguments or command line, it can very long and tedious. The Testng runner parses the xml file in the way you implemented and use the input values to do corresponding operations.


text:
Q: How to get data from another AWS db I am new in AWS. I created default Blog scheme. Now I would like to create new Blog post.
Snippet for creating Post:
import { API } from "aws-amplify";
import { createPost,createBlog } from './graphql/mutations';

const newPost = await API.graphql({
    query: createPost,
    variables: {
        input: {
        "title": "Lorem ipsum dolor sit amet",
        "blog": /* Provide a Blog instance here */,
        "comments": [],
        "author": "Lorem ipsum dolor sit amet"
    }
    }
});

Snippet for Creating Blog:
const newBlog = await API.graphql({
    query: createBlog,
    variables: {
        input: {
        "name": "Lorem ipsum dolor sit amet",
        "posts": []
    }
    }
});

My code:
How can I add Blog value in createPost?
 try {
      await API.graphql({
        query: createPost,
        variables: {
          input: {
            title: "Lorem ipsum dolor sit amet",
          **  "blog": /* Provide a Blog instance here */,**
            author: "Lorem ipsum dolor sit amet",
          },
        },
      });
    } catch (error) {}

A: type Blog @model @auth(rules: [{allow: public}]) {
  id: ID!
  name: String!
  posts: [Post] @hasMany
}

type Post @model @auth(rules: [{allow: public}]) {
  id: ID!
  title: String!
  blog: Blog @belongsTo
  comments: [Comment] @hasMany
  author: String!
}

type Comment @model @auth(rules: [{allow: public}]) {
  id: ID!
  post: Post @belongsTo
  content: String!
}


text:
Q: P tag is not displayed in html editor (TinyMCE) for WordPress I am developing site with WordPress and I'm newbie for WordPress. WP adds <p> tag in editor while adding any post or pages. But I can't see the <p> tag in HTML mode. Can anyone suggest me what might be the problem?
Thanks in advance

A: It's not difficult to do this. To display the p and br tag we just need to install plugin which is "tinymce-advanced" and do some setting change. To change the setting just click check box for "Stop removing the p and br tags when saving and show them in HTML editor" and save. Now we can see the p and br tags in HTML mode.
:)

A: Try adding the following line just before the_content() tag in your template:
<?php remove_filter ('the_content', 'wpautop'); ?>

Source

A: When you retrieve the stored data from the database, you need to run a filter on it to add the p and br tags back in. This is how wordpress handles content. When you use the_content(), for example, it is already running a filter on it, so when you have a custom loop, you may need to run the filter manually.
<?php echo apply_filters('the_content', $your_retrieved_data); ?>

reference: http://codex.wordpress.org/Function_Reference/apply_filters
You definitely don't need a plugin, and I would recommend not using the method described by user75472. Your data won't be as clean and future-proof.


text:
Q: Are there any plans for celebrating the 10th anniversary of Meta Stack Exchange? Is there any plan for Meta Stack Exchange's 10th anniversary?
The first question was posted on Meta Stack Exchange on June 28, 2009.
A few months before, Stack Overflow celebrated their 10th year anniversary by creating the anniversary page. Is there any similar plan for MSE, or any Swag Contest?


text:
Q: Create table using cqlsh does not return to prompt I am trying to create a table using cqlsh with composite primary key but it doesn't return to the cqlsh prompt. The cqlsh and cassandra versions are cqlsh 3.1.7 | Cassandra 1.2.13.2. Can we not create composite primary key using cqlsh? Have tried Dbeaver but that also fails reporting mismatched input ',' expecting EOF. Are there any other clients that allow to create?
Any suggestions would be helpful.

A: I tried your CREATE TABLE command on the same version of Cassandra using cql 3 and it just worked. It failed using cql 2.
If you're still using cql 2, that's likely the source of your problem.


text:
Q: Where can I get NPM package information from a Github Repository? I want to be able to get a few information about NPM packages in a Javascript based repository on Github.
I want to believe I can see them from the package.json file the repositories.
Please any help or guideline on this?.
I will like to extract the needed information using powershell from the file.

A: *

*Determine the URL for the raw content of the package.json file of interest:

*

*E.g., for the json5 package, click on the Repository link to go to the associated GitHub repository, navigate to the package.json file and click on the Raw button to get the raw URL.

*Then use Invoke-RestMethod with the raw URL to retrieve and parse the content of the package's package.json file into an object whose properties you can access (the for-display output below shows the properties in the left column, and their values to the right - note the dependencies / devDependencies properties denoting what other packages the package at hand depends on at runtime / design time):
PS> Invoke-RestMethod https://raw.githubusercontent.com/json5/json5/master/package.json

name            : json5
version         : 2.2.0
description     : JSON for humans.
main            : lib/index.js
module          : dist/index.mjs
bin             : lib/cli.js
browser         : dist/index.js
types           : lib/index.d.ts
files           : {lib/, dist/}
engines         : @{node=>=6}
scripts         : @{build=rollup -c; build-package=node build/package.js; build-unicode=node build/unicode.js; coverage=tap --coverage-report html test; lint=eslint --fix .; prepublishOnly=npm run production; preversion=npm run production; production=npm run lint && npm test && npm run build; test=tap -Rspec --100 test; version=npm run build-package && git add package.json5}
repository      : @{type=git; url=git+https://github.com/json5/json5.git}
keywords        : {json, json5, es5, es2015…}
author          : Aseem Kishore <aseem.kishore@gmail.com>
contributors    : {Max Nanasy <max.nanasy@gmail.com>, Andrew Eisenberg <andrew@eisenberg.as>, Jordan Tucker <jordanbtucker@gmail.com>}
license         : MIT
bugs            : @{url=https://github.com/json5/json5/issues}
homepage        : http://json5.org/
dependencies    : @{minimist=^1.2.5}
devDependencies : @{core-js=^2.6.5; eslint=^5.15.3; eslint-config-standard=^12.0.0; eslint-plugin-import=^2.16.0; eslint-plugin-node=^8.0.1; eslint-plugin-promise=^4.0.1; eslint-plugin-standard=^4.0.0; regenerate=^1.4.0; rollup=^0.64.1; rollup-plugin-buble=^0.19.6; rollup-plugin-commonjs=^9.2.1; rollup-plugin-node-resolve=^3.4.0; rollup-plugin-terser=^1.0.1; sinon=^6.3.5; tap=^12.6.0; unicode-10.0.0=^0.7.5}

Deriving the URLs programmatically:
# Package name.
$npmPackageName = 'json5'

# Derive the package's npm registry URL
$npmUrl = "https://www.npmjs.com/package/$npmPackageName"

# Derive the associated API URL
$npmApiUrl = $npmUrl -replace '(?<=/)www(?=.)', 'replicate' -replace '/package'

# Derive the source-code repository URL
$repoUrl = Invoke-RestMethod $npmApiUrl |
  ForEach-Object { $_.repository.url.Substring($_.repository.type.Length+1) }

# Assuming the source-code repository is a GitHub URL,
# derive the *raw* URL from it, from which files can be downloaded
# as-is.
$rawGitHubUrl= 'https://raw.githubusercontent.com/' + ($repoUrl -replace '\.git$' -replace '^https://github\.com/')

# Derive the raw URL for the package.json file.
$rawPackageJsonUrl = "$rawGitHubUrl/master/package.json"

# Parse the package.json file's JSON content into an object
$objectFromPackageJson = Invoke-RestMethod $rawPackageJsonUrl

# Output an example property.
$objectFromPackageJson.dependencies


text:
Q: Computable Group Copies without Computable Isomorphism What's an explicit example of isomorphic and computable groups without computable isomorphisms? Just from reading through theorems on the internet I know they must exist, but I can't quite think of an example myself.

A: First, we show the following:

Let $G$ be the usual copy of the group $\mathbb{Z}$. We can find, computably in $e$, a computable copy $H_e$ of $\mathbb{Z}$ such that $\Phi_e$ is not an isomorphism from $G$ to $H$.

This is a direct "wait-and-break": $H_e$ will look like $G$ until we see $\Phi_e(1)\downarrow=k$ for some $k$ (if this never happens then $G=H$ but $\Phi_e$ is not total, so that's not a problem). When we do, if $k\not=1$ we just keep building $H=G$; if $k=1$ we treat what we've built as part of $2\mathbb{Z}$ as opposed to $\mathbb{Z}$ and "stick new points in" accordingly.

Next, we view the above observation as the $e$th "atomic module" and combine the constructions above to satisfy all of our atomic modules at once:

Let $G$ be the usual copy of the group $\bigoplus_{e\in\mathbb{N}}\mathbb{Z}.$ There is a computable copy $H$ of $G$ which is not computably isomorphic to $G$.

This is more subtle than it may look at first glance - keep in mind that a putative isomorphism need not "respect axes," so we can't just literally "copy-and-paste" the observation above infinitely many times. But it's ultimately the same idea, just messier. (And we do need to "go up to infinite dimensions" - for each finite $n$ the group $\mathbb{Z}^n$ is computably categorical, as is $\mathbb{Q}$.)


text:
Q: Adding an OpenID selector into an ASP.NET content page I would like to use the OpenID selector found here The problem is that i would like to use it in a content page, which is child of a master page.
So what modifications should i make?
I mean my master page contains the form already
<form id="form1" runat="server">
...
</form>

but so does the OpenID selector page
<form class="openid" method="post" action="/Login.xhtml?ReturnUrl=">

</form>

together with post and ReturnUrl... which is something that i need only in the login page... Right?
So what modifications should i make and have that lovely ID selector as content in a master page?

A: Asp.Net only allows you to have a single runat=server form on your page. You can add additional forms, but it can't be nested inside the main Asp.Net form. If there is a way to structure your login page so that the OpenID form is not inside your asp.net form, then everything should work fine. If you can't, you can trick it by using an iframe, but this might make other processing that you need to do difficult. For example, posting back the OpenID form is going to affect the iframe, and not the content of the whole window by default, you will need to set the target of the frame form to _parent.

A: @NerdFury is correct in how webforms utilizes the runat=server attribute on forms.
You might want to check out http://www.dotnetopenauth.net/ for a selector that works well with .net.


text:
Q: Is it possible to write a file in a web-application? I want to make an entirely client-side text editor. Unfortunately, dart:io doesn't work client-side. I want to save text the user has typed to a file on the his machine. He can have full control of where it saves or whatever hoops I have to jump through for it to be considered safe. Is it possible to write a file to his machine?

A: You can use HTML5 and LocalStorage. It's a persistent storage, but can only be accessed by the browser.
If you want the user to be able to open the file outside the browser, just make the "save" button a download action.

A: See this equivalent answer for JavaScript:
Write local file with jQuery or Javascript

The web platform is specifically designed to prevent sites from writing arbitrary data to client machines.

This is to protect your machine.
One way that I have seen this worked around is to use something like dropbox or google drive api, so that your app "edits" a file on dropbox or gdrive, which is then synced onto your local disk by the dropbox or gdrive client.   Eg: SourceKit


text:
Q: What happens when 2 servers disconnect from each other and then reconnect? We have 2 servers with a peer, orderer and kafka each. They are connected in the same channel, both have a chaincode installed and instantiated and the policy is one organization or the other.
Imagine that the internet goes down and they disconnect:

*

*Would both work individually?

*Can the write new transactions to the ledger?

*What would happen with the new submited blocks in the ledger when the internet goes up and running? How do this new blocks synchronize?

Thanks
EDIT1:
See image for clarification:

How would the network syncrhonize If during the disconnection both write to the ledger, how are those new generated blocks react? One gets invalidated? Or both are valid?

A: The peers once disconnected won't receive keep alive from the channel peers and will keep throwing the same if you have debug logging enabled.
The peer won't lose any config even though it got disconnected from network. The discovery service in fabric takes care of finding the peers configured in the channel. So, Once the connection resumes it will automatically re-synchronize with the peers with gossip messages.
The peers can then write and read from ledger as usual.

A: There are multiple things to consider here:
1) When you use a Kafka-based orderer, you will have to cluster the Kafka brokers if you expect them to be part of the same ordering service.  Kafka is used to distribute the messages to the ordering nodes.  If your Kafka brokers are not in a cluster, then you will have separate ordering services.  Recall that Kafka also requires Zookeeper as well.   Zookeeper has a 2f+1 fault tolerance model, so if you want to tolerate failure of a single node (failure includes communication issues), you will need at least 3 Zookeeper nodes and they should be deployed on separate hosts.  For Kafka, you will want at least 2 brokers and would need to set the minimum ISRs (in sync replicas) to 2.  Ideally you'd have 4 Kafka brokers.
2) In order for transactions to be processed, enough peers to satisfy the endorsement policy as well as the ordering service must be available / accessible.   Peers which cannot connect to the ordering service will catch up once they can reestablish connectivity.


text:
Q: "What have you tried" evasions So apparently "What have you tried" comments are now disallowed:

Comments can't contain that content.

But this comment:

And what have you tried?

is accepted by the system – and has two upvotes.
What's the proper thing to do in this situation? Should I flag as "not constructive / off-topic" or just let it go? I'm assuming this type of evasion is against the spirit of the comment ban.

A: As a conclusion of a related question where I asked how are we expected to behave after this ban, I think that just asking variants of "What have you tried" is not constructive (and then a flag is deserved). It is not wrong to ask OP about their effort in understanding their problem, but that should be done with the intention of educating them. If one doesn't agree, the action should not be commenting but downvoting, voting to close, or taking a break.
Tim Post♦ said that (emphasis mine)

Boilerplate well worded comments can be used, but it's generally good to tailor them a little so they engage specific parts of the question. Otherwise, it looks like someone, well, left a boilerplate comment. While somewhat helpful, that's not very engaging. The more specific you are when you point out issues, the more likely the user is going to be to understand and fix them. If you want to help the user, you need to engage them, not just type at them.
Finally, you can still link to whathaveyoutried.com, provided that you've given some additional context with the link.
If you don't have the time, inclination or patience to help the person, then avoid commenting altogether (...) Remember, leaving a comment to help a new user is supposed to be just that - help, not a whitewashed way to show your dislike for the question that they asked.

And Shog9♦ added that:

If the question needs code, say that; if the asker should read the docs, say that. If you're just upset 'cause he's lazy, down-vote.
If you're just looking for some small indication that the author had done a bit of reading on XML serialization before asking, a comment such as "Have you read up on Java's support for XML serialization?" would probably get your point across.

A: I was not aware of the "what have you tried"-policy, and I left a comment with "so what have you tried so far", so the system accepts my answer.
I got this message: Auto change radio selection on another form to read a post on Meta regarding "what have you tried"
and it works for me :-)

A: Officially

What's the proper thing to do in this situation? Should I flag as "not constructive / off-topic" or just let it go?

According to the post which states that "what have you tried" is no longer proper:

… comments that consist of little more than "what have you tried" can be deleted with a single flag.
     – Shog9

What have I tried
I answer a question every once in a while on StackOverflow. I would say that I am well aware of the comments including "what have you tried" or with the same intention, and the situations involved in them.
I usually ask for an edit by stating what I feel others would need to know to be able to properly answer the question, a helpful hint, a generally accepted standard or guideline, or what I feel is lacking.
In my opinion, at the heart of the "what have you tried" issue is what is known as a "help vampire".  It seems to me, "what have you tried" usually stems from a reluctance of users to blatantly do the work of others. This is where it is important to provide guidance on how the OP can share more details or more requirements to narrow down what is usually a rather vague question.
Unfortunately, sometimes the OP really is trying to just get some very specific work done for them here without trying themselves, and in that case I feel a vote to close as "Too Localized" is appropriate if it is unlikely to help anyone else out (for common situations I believe it can be understandable to show a simple implementation that others can edit and re-use).
As stated in the linked material, if the question is beyond saving it can always been downvoted and closed. Ideally, it would be improved so that someone can answer it.


text:
Q: Create vhost-file from mysql via shell script I would like to create a configuration with a script from a database. The configuration is stored as:

<VirtualHost *:80>
  ServerName example.com
  ProxyRequests Off
  ProxyPreserveHost On
  <Proxy *>
    Require all granted
  </Proxy>
  ProxyPass / http://10.20.30.50:81/ retry=1 timeout=30
  ProxyPassReverse / http://10.20.30.50:81/
  <Location />
    Require all granted
  </Location>
</VirtualHost>

Apache gives me the following error message:

apache2: Syntax error on line 219 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/sites-enabled/example.com.conf: /etc/apache2/sites-enabled/example.com.conf:1:  was not closed.

My script look likes:

sql="SELECT domain, vhost from v_create_proxy_vhost where domain = 'example.com'"

while read vhost
do
        echo "${vhost}"
        printf "${vhost}" > "$vhostconfavailable/$domain.conf"

done < <(echo "$sql" |mysql -h $dbHost -u $dbUser -p$dbPassword --skip-column-names -s)

How can I read this and save it as a configuration file? Apache
I've been using Ubuntu 04.14, MySQL and Apache2.

A: *

*the line number (219) on the error suggests how you are trying to append an existing apache conf file, in which case I might be able to better serve by getting a look at the entire conf file - which is likely to point an unclosed directive tag somewhere
OR

*instead of appending an existing conf file to set up vhosts, how about setting up individual conf files for each vhost, thus reducing any risk of modifying any existing vhost directives ?


text:
Q: Is it possible to use Bitmap as the data source of ILNumerics ILPanel? 1) Is it possible to use Bitmap as the data source of ILNumerics ILPanel?
2) How to make the axis of ILNumerics ILPanel invisible?
Thank you

A: Yes. Convert the bitmap data to an 'ILArray' and use that for plotting the common way.
ILPanel does not have axes. You probably mean ILPlotCube? You can control the axes via the ILPlotCube.Axes property.
The line properties for the edges of the plot cube are controlled by the ILPlotCube.Lines property.
Link to the class API reference docu for the ILPlotCube class:
http://ilnumerics.net/apidoc/?topic=html/AllMembers_T_ILNumerics_Drawing_Plotting_ILPlotCube.htm


text:
Q: Meaning of $\phi_h$ in outer semidirect product In the definition of the outer semidirect product it is usually said that there is a group homomorphism $\phi: H \to Aut(N)$ from the elements of $H$ to the automorphism group of $N$. I get that. I also get that $\phi_h$ is the specific automorphism of $N$ defined by some specific element of $H$. What I'm unclear on is how to interpret $\phi_h(n)$.
I think it means that it means we should map $n$ to $m$, where $m$ is the element mapped to $n$ by that automorphism but I'm not confident of that.

A: I believe it is worth starting with the interior direct product, that is, you have a group $G$, and two subgroups $H, N$ such that $N$ is normal in $G$ and $G = H N$.
Then $$\phi_h(n) = h n h^{-1}.$$
Once you have defined the product in the exterior semidirect product you are considering, the same formula will hold in there.


text:
Q: Constructor injection with @EJB(beanName = "myBean") is this possible ?
I want to do this :
@EJB(beanName = "MyStratImpl")
public DateTimeReadImpl(MyStrategy<MyBean> myStrategy) {
  this.strategy = myStrategy;
}

I have an no args constructor, I want to use constructor injection instead of doing field injection :
@EJB(beanName = "MyStratImpl")
private MyStrategy<MyBean> myStrategy strategy;

How do I use an ejb reference as a constructor parameter ?
(I can use setter injection, or reflection to inject, but I'd rather not)

A: I don't think EJB supports constructor injection, but you can use CDI:
@Inject
public DateTimeReadImpl(MyStrategy<MyBean> myStrategy) {
    this.strategy = myStrategy;
}

You'll need to enable CDI for this to work. Also if you have more than one bean implementing MyStrategy<MyBean>, you can use qualifiers.


text:
Q: Android studio, LinearLayout "match parent - constant" my question is :
how can i set a Linear layout height -> match parent -50 dp for exemple? i need my linear layout to let me some place under him to put a button
I dynamically generate buttons in a scroll view in this LinearLayout so i can't use
<ScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginBottom="100dp">
because the marginBottom  will push my button under the LinearLayout who "matchParent"
so can i do a matchParent -50 dp or something like that?

A: You can actually try to put your linear layout inside a constraint layout, that gives you the ability to choose 50dp as a bottom margin.
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
    android:id="@+id/linearLayout"
    android:layout_marginBottom="50dp">

<ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginBottom="100dp">

</LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>