text:
Q: Save Capture Image in SD card android I call camera intent and try to save capture image in sd card.but camera intent give me null data.what is the problem i can't understood.my code is as follow
imgBtnPicture.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {

            String fileName="ashraful.jpg";

            String root = Environment.getExternalStorageDirectory().toString();
            new File(root + "/photofolder").mkdirs();
            File outputfile=new File(root+"/photofolder/", fileName);
            Uri outputFileUri = Uri.fromFile(outputfile);
            Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
            cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
            startActivityForResult(cameraIntent, CAMERA_REQUEST);
        }
    });

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == CAMERA_REQUEST && resultCode == RESULT_OK) {

        if(data!=null)
        {
            Bitmap photo = (Bitmap) data.getExtras().get("data");
            Bitmap icon1=ResizeBitmap(photo,200,200);
            imgBtnPicture.setImageBitmap(icon1);
        }
    }
}

but i get null data? how to solve my problem?plz help

A: private void takeNewPicture() {

    Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    ContentValues values = new ContentValues(3);

    values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg");
    cameraImagePath = getContentResolver().insert(
            MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
    takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, cameraImagePath);
    startActivityForResult(takePictureIntent, CAMERA_REQUEST);
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == CAMERA_REQUEST && resultCode == RESULT_OK) {

    String[] filePathColumn = { MediaStore.Images.Media.DATA };
    Uri imageFilePathUri = null;
    if (cameraImagePath != null) {
        Cursor imageCursor = getContentResolver().query(
            cameraImagePath, filePathColumn, null, null, null);
    if (imageCursor != null && imageCursor.moveToFirst()) {
        int columnIndex = imageCursor.getColumnIndex(filePathColumn[0]);
        String filePath = imageCursor.getString(columnIndex);
        imageCursor.close();
        imageFilePathUri = filePath != null ? Uri
                .parse(filePath) : null;
    }

   }

    }
}

cameraImagePath is a Uri object

A: Read this Android Training post carefully to figure things out. As the post says,

The Android Camera application saves a full-size photo if you give it a file to save into.

so if you did pass the Uri of a file, you should access the image using this Uri.


text:
Q: How to stop replacing single quote ' in apex with space I am trying to replace all characters expect below mention characters with space in Apex
[A-Z a-z 0-9-,.&/'@()+# $: ]
String customerName = jo&hn<>ji'o;
String AccName = customerName.replaceAll('[^0-9a-zA-Z\\&.,'-/@+():$#]',' ');
system.debug('AccName' + AccName);

But when I am trying to add single quote ' in the regex I am getting error.
can anyone help me on this issue.
Thanks In Advance!!

A: Since Apex uses single quotes for string literals, anywhere that you need to use a single quote you need to escape it.
In many other languages, you'd just use a single backslash (i.e. \')
In Apex though, you need to use two backslashes (\\').
Apex treats a single backslash as the start of an "escape sequence". \n is the most common one, which tells Apex to replace those two characters with a line break. It's used to print ASCII characters that are "unprintable".
Since \' is not a valid escape sequence, we need to tell Apex to not treat it as an escape sequence. That's the function of the second backslash.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Extend people search with custom contacts list I'm trying to extend the default people search (that crawls the user profiles) with contacts I've put in a custom SharePoint list (a kind of external contacts list).
My goal is that when people search for a name, results from the people search (my user profiles) and from the external contacts list appear in the search results.
I know you have to create query rules and/or results sources but this sound confusing for me. Ofcourse i've searched on it on the internet, but a lot of solutions are for SP2010 and since search in 2013 is changed a lot, I'm looking for a clear solution for this.
Anyone who has any information about this?

A: Assuming you use SP2013
The search you do on "people" is basically a standard search with an extra filter parameter that indicates only to return people results. Create a custom content type and make the search return: people results or items with your custom contenttype.
The difficulty will be mapping the properties correctly (reuse existig columns!).
Then create a custom display template (start with a copy of an existing one)
Then configure the search page (or create a new one, copy an existing one).
In the properties of the core results webpart, edit the query to the correct filters and set your custom display template.
This tool might come in handy to test your query results
http://sp2013searchtool.codeplex.com/


text:
Q: error when trying to create import / export in oracle CREATE DIRECTORY BASED ON AN EXISTING LIBRARY:

CREATE DIRECTORY hr_imp_dir as '/u02/oradata/hr_imp_dir/' ;

For example: export 2 EMPLOYEES and DEPARTMENTS tables using the datapump tool:
expdp hr/hr@orcl tables=EMPLOYEES,DEPARTMENTS directory=hr_imp_dir dumpfile =EMP_DEPT.dmp logfile=expEMP_DEPT.log create directory hr_imp_dir as '/u02/oradata/hr_imp_dir/' ;

A: The error ORA-01034 means that the Oracle Service is not available or is not started. Please look at here or here for more information.
Best regards

A: *

*It appears that you executed the create directory command without first logging in to an active instance. You should have used the connect command, like connect username/password@service_name.

*expdp is an operating system command, not a SQL or SQL*Plus command.

See here:

*

*SQL*Plus Quick Reference

*Oracle Data Pump (expdp, impdp) in Oracle Database 10g, 11g, 12c, 18c, 19c

*Oracle Data Pump Export


text:
Q: Why does boost include two different versions of strong_typedef.hpp? As I was building a project recently, I noticed that I got a compiler warning (turned to error) about the BOOST_STRONG_TYPEDEF macro being redefined. Upon further investigation I noticed that there are two different versions of strong_typedef.hpp included in boost: One at the top level, and one within serialization/.
There is actually a difference between the two versions as well, not just a duplicate version of the macro. The top level version doesn't explicitly value-init its T while the serialization version does:
Code snips:
boost/strong_typedef.hpp:
    T t;                                                        \
    explicit D(const T t_) : t(t_) {};                          \
    D(){};                                                      \
    D(const D & t_) : t(t_.t){}                                 \

boost/serialization/strong_typedef.hpp:
    T t;                                                        \
    explicit D(const T t_) : t(t_) {};                          \
    D(): t() {};                                                \
    D(const D & t_) : t(t_.t){}                                 \

Why are there two different versions of the macro, and which one makes more sense as the implementation? The one that will force builtin types to be initialized, or the one that doesn't (as closely as possible mimicing the underlying type being strongly typedeffed)?

A: I am the author of both versions of boost/strong_typedef.hpp.
Because of strident objections to inclusion to in the boost base header directly, I moved to the serialization library.  In order to maintain backward compatibility, I left it in the boost base header directory.  I forgot to merge this file into the release branch so the warning would appear.  I also forgot to change the name to BOOST_SERIALIZATION_STRONG_TYPEDEF. And since then I added the initialization to the base class.  I guess since I made the split, I included a correction in version in the serialization library.
I just looked at the serialization library and usage of strong_typedef is now minimal.  I guess I'll get around to removing it entirely. So then it would be disappear entirely.
It really should be a separate utility.  But I can't really deal with all that boost requires (tests, docs, build, review).  And boost doesn't have a really good place for these small header only utilities.  I had one day hoped that these small utilities that I needed for the serialization library would migrate to the the boost base.  But I came to be discouraged from that idea.

A: It looks like boost/strong_typedef.hpp directory is a historical artifact.
The lack of explicit initialization of the t member was a bug fixed in boost/serialization/strong_typedef.hpp a couple years ago in svn revision 71183. See the bug ticket.
In Boost's Subversion trunk, boost/strong_typedef.hpp is a largely empty file that says:
#error "This header is deprecated. Please use: boost/serialization/strong_typedef.hpp"

That change, r48575, was made back in 2008 - I don't know why it has never been merged into a release. Maybe because it would break users without a lot of upside or maybe it's an oversight. That same change (r48575) was what created boost/serialization/strong_typedef.hpp in trunk.
If they don't want to break existing users, then maybe the deprecated file should just include the file in boost/serialization so there's a single, canonical implementation. In any case, it would appear that if you can avoid using boost/strong_typedef.hpp in favor of using the one in serialization, that's what I'd suggest.
As a side note, keep in mind that a year ago the author of Boost Serialization (and strong_typedef.hpp), Bob Ramey, posted a comment in another bug ticket about strong_typedef.hpp that you might find interesting:

I don't think the serialization library uses this any more. Of course it's still in there. I have no idea if anyone uses it.


text:
Q: Loop in Thread is delayed how can I fix that /**
* intervals of loop
*/
private final long HEART_BEAT_DELAY = 1000L;
private long lastTime = 0;
/**
* whether user is chatting with other(true:isChatting; false: not chatting)
*/
private boolean mIsChatting = false;
/**
* mainThread
*/
private Thread mThread = new Thread() {
  @Override
  public void run() {
    mThread.setPriority(Thread.MAX_PRIORITY);
    Process.setThreadPriority(Process.THREAD_PRIORITY_URGENT_AUDIO);
    //if user is chatting and activity is not finishing, keep cycling
    while (mIsChatting && !VideoChatViewActivity.this.isFinishing()) {
      try {
        sleep(HEART_BEAT_DELAY);
        //get current time
        long thisTime = System.currentTimeMillis();
        //get interval between current time and last request time
        long duration = thisTime - lastTime;
        //every 60 seconds do network request
        if (mIsChatting && duration >= 60 * 1000) {
          //set last heartbeat time to current time
          lastTime = thisTime;
          //network request
          mModel.sendHeartBeat(mUserId, mCallId);
        }
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
};

        /**
         * start heartbeat thread
         */
        public void startHearBeat() {
            if (!mIsChatting) {
                mIsChatting = true;
                lastTime = System.currentTimeMillis();
                mThread.start();
            } else {
                LogUtil.e("ralph", "start second time, ignore it");
            }
        }

        /**
         * stop heartbeat thread
         */
        public void endHeartBeat() {
            mIsChatting = false;
        }

I've got this code and heartbeat should request network for every 60s, but sometimes it will wait to 90s to the next requet.
To fix that i've set processPriority and threadPriority,but they didn't work anyway.
How can i fix that make request on time?

A: If you are setting threadPriority to the highest, it means that you want this thread to run before anything else.
Try using mThread.join() in startHearBeat() method.


text:
Q: MySQL: how to select the record with the most recent update date How do I select the records with the most recent update dates?  Sample data:
id, update_date, data_point
1, 2013-03-01, AAA
1, 2013-03-02, AAB
1, 2013-03-03, AAC
2, 2013-04-02, BAS
2, 2013-04-05, SOR
3, 2013-01-01, AAW
3, 2013-02-02, AJS

What query can I write to select rows 3, 5, and 7- the latest record for each id?

A: One option is to join the table on itself, using MAX and GROUP BY:
SELECT t.id, t.update_date, t.data_point
FROM yourtable t
   JOIN (
       SELECT id, MAX(update_date) max_update_date
       FROM Yourtable
       GROUP BY id
   ) t2 on t.id = t2.id AND t.update_date = t2.max_update_date

*

*SQL Fiddle Demo

Returned Results:
ID   UPDATE_DATE          DATA_POINT
-------------------------------------
1    March, 03 2013       AAC
2    April, 05 2013       SOR
3    February, 02 2013    AJS


text:
Q: Send a tweet from an iPhone app What is the best way to tweet from an iPhone app?
I know there are some libraries to integrate twitter in an iPhone app like MGTwitterEngine, do I really need it just to sent a tweet?
And what is OAuth? is MGTwitterEngine already include OAuth??
Can someone tell me what are the steps I need to do from start?
The app is for ios 4, so using the new twitter framework in ios 5 is not good for me..

A: If you are using iOS 5 there is a whole Twitter Framework built in. Otherwise you will have to use a third party library to do this.
https://developer.apple.com/library/ios/#documentation/Twitter/Reference/TwitterFrameworkReference/_index.html#//apple_ref/doc/uid/TP40011014
UPDATE
Please also do note that Apple will no longer accept anything that can not run on iPhone 5, so you will have to be use iOS 6 SDK or later anyway


text:
Q: expressjs layout with angularjs I want to use expressjs to serve an angularjs app, right now I set up the connection between express and angular using :
app.use(express.static(path.join(__dirname, 'public')));
but I would like to draw the layout of index.ejs in expressjs and then have my angularjs site inside this layout.. so the default page is not in frontend but in express.
How can I achieve this if you can provide some tips or a simple example. Thanks

A: What you need is a function in express that serves the Index. For example:
var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index');
});

module.exports = router;

In this case, when you access localhost:3000 you reach this action and are returned the index which has the angular app.
I recommend you take a look at express-generator. It sets up a base application where everything in place so it gets a lot easier to understand and move onwards.


text:
Q: C++ program has syntax errors, using modules for first time // Function displays course information
// instructor defaults to Staff
// enrollment defualts to 30
// main() demonstrates function can be called three ways
#include<iostream>
using namespace std;

int main()
{
   void displayCourseInfo(char, char* = "Staff", int = 30);
displayCourseInfo("ENG101");
displayCourseInfo("PSY151", "Bossert");
displayCourseInfo("CIS200", "Edwards", 24);
return 0;
 }
 void displayCourseInfo(char course, char* instructor, int enrollment)
 {  cout << course <<  " taught by "  << instructor <<
  " enrollment " << enrollment << endl;
}

When I try to run this code I get
     this error message. It says that I cannot convert *const char to char.
Thank you for your time and help.

A: String literals in C++ (opposite to C) have types of constant character arrays. For example the string literal "Staff" has the type const char [6].
Used in expressions array designators with rare exceptions are converted to pointers to their first elements. So the string literal "Staff" used as an argument is converted to a pointer of the type const char *.
The first parameter of the function displayCourseInfo is declared as having the type char while you are trying to pass a string literal as an argument.
A valid program can look the following way
// Function displays course information
// instructor defaults to Staff
// enrollment defualts to 30
// main() demonstrates function can be called three ways
#include<iostream>
using namespace std;

int main()
{
    void displayCourseInfo( const char *, const char * = "Staff", int = 30 );

    displayCourseInfo("ENG101");
    displayCourseInfo("PSY151", "Bossert");
    displayCourseInfo("CIS200", "Edwards", 24);

    return 0;
}

void displayCourseInfo( const char *course, const char *instructor, int enrollment)
{
    cout << course <<  " taught by "  << instructor
         << " enrollment " << enrollment << endl;
}

Its output is
ENG101 taught by Staff enrollment 30
PSY151 taught by Bossert enrollment 30
CIS200 taught by Edwards enrollment 24

A: This happens because "test in quotes" is by default const char*.
Values with const in their declaration cannot be changed.
You can't pass const variable to function that takes non-const parameters.
You could just make function's parameters const:
#include<iostream>

using namespace std;

void displayCourseInfo(const char *);
void displayCourseInfo(const char *, const char *);
void displayCourseInfo(const char *, const char *, const int);

int main() {
    displayCourseInfo("ENG101");
    displayCourseInfo("PSY151", "Bossert");
    displayCourseInfo("CIS200", "Edwards", 24);
    return 0;
}

void displayCourseInfo(const char *course, const char *instructor) {
    cout << course << " taught by " << instructor <<
         " enrollment " << 30 << endl;
}

void displayCourseInfo(const char *course) {
    cout << course << " taught by " << "Staff" <<
         " enrollment " << 30 << endl;
}

void displayCourseInfo(const char *course, const char *instructor, const int enrollment) {

    cout << course << " taught by " << instructor <<
         " enrollment " << enrollment << endl;
}


text:
Q: node mongoose update two collections I have two schemas, a "projects" schema, and an "applications" schema.
What is the most efficient way of creating a new entry in a collection and updating an existing entry in another collection based on data inside the new entry? Can I avoid making multiple API requests and somehow run a "stored procedure" on the mongoDB end to handle updating the Projects collection when there is a change in the Applications collection?
In this scenario, ideally when an application for a project is created, a new entry is created in the Applications collection and the Project in the Projects collection is updated to reflect the information in the Application.
Can I do this without making multiple api requests?
Project Schema:
// models product.js

const mongoose = require('mongoose');
const { ObjectId } = mongoose.Schema;

const projectSchema = new mongoose.Schema({
      name: {
        type: String,
        trim: true,
        required: true,
        maxlength: 32
      },
      applications: {
        type: Number,
        default: 0
      },
      created_by: {
        type: ObjectId,
        ref: 'User'
      },
      applicants: {
        type: Array,
        default: []
      }
       }, {timestamps: true}
);

module.exports = mongoose.model("Project", projectSchema);

Application Schema:

const mongoose = require('mongoose');

const applicationSchema = new mongoose.Schema({
  applicantId: {
    type: ObjectId,
    ref: 'User'
  },
  ownerId: {
    type: ObjectId,
    ref: 'User'
  },
  projectId: {
    type: ObjectId,
    ref: 'Project'
  }
}, {timestamps: true});

module.exports = mongoose.model("Application", applicationSchema);

Note that these are separate schemas because they each carry around 15 fields, i've trimmed them down to post this question.

A: I suggest to use hooks for mongoose model, there is a post save hook which you can use on Application model to update Project and increment application count.
EDIT - Added Pseudo Code

*

*Project Model

// models -> project.js

const mongoose = require('mongoose');
const {
    ObjectId
} = mongoose.Schema;

const projectSchema = new mongoose.Schema({
    name: {
        type: String,
        trim: true,
        required: true,
        maxlength: 32
    },
    applications: {
        type: Number,
        default: 0
    },
    created_by: {
        type: ObjectId,
        ref: 'User'
    },
    applicants: {
        type: Array,
        default: []
    }
}, {
    timestamps: true
});

projectSchema.statics = {
    /**
     * Find project by _id
     *
     * @param {ObjectId} _id
     * @api private
     */

    get: function (_id) {
        return this.findOne({
                _id
            })
            .exec();
    }
}

module.exports = mongoose.model("Project", projectSchema);

*Application Model

const mongoose = require('mongoose');
const projectModel = require("./project")

const applicationSchema = new mongoose.Schema({
    applicantId: {
        type: ObjectId,
        ref: 'User'
    },
    ownerId: {
        type: ObjectId,
        ref: 'User'
    },
    projectId: {
        type: ObjectId,
        ref: 'Project'
    }
}, {
    timestamps: true
});

// Async hook
applicationSchema.post('save', function (doc, next) {
    const relatedProject = projectModel.get(doc.projectId);
    relatedProject.applications++;
    relatedProject.save();
    next();
});

module.exports = mongoose.model("Application", applicationSchema);


text:
Q: Проблема с программой Программа выдаёт ошибку: SyntaxError: invalid character in identifier
m = input()
d = input()
while True:
    d += 7
    if m % 2 == 0 and d > 31:
        d -= 31
        m += 1
    elif m % 2 != 0 and d > 30:
        d -= 30
        m += 1
    if m > 12:
        break
    print(m, d)

A: вы вводите строку, чтоб ее перевести в число надо преобразовать int()
m = int(input())
d = int(input())
m = int(input())
d = int(input())
while True:
    d += 7
    if m % 2 == 0 and d > 31:
        d -= 31
        m += 1
    elif m % 2 != 0 and d > 30:
        d -= 30
        m += 1
    if m > 12:
        break
    print(m, d)


text:
Q: Create a Drupal 8 profile installer with a config export I want to create a Drupal 8 profile installer with a config export, to export regulary my config to push data modifications in git.
I tried this tutorial: https://www.valuebound.com/resources/blog/how-to-create-installation-profile-in-Drupal8
but it dont worked.
And i exported the configuration with drupal config:export –remove-uuid --remove-config-hash

A: see drush drush config-export and Sync
https://www.drupal.org/docs/8/configuration-management/changing-the-storage-location-of-the-sync-directory
then when you make config changes run drush cex for commit the changes.
when updated form git you need to run drush cmi for imports the config
to watch out for you want to make sure your site uuids match: aka
drush cget system.site uuid
drush cset system.site uuid


text:
Q: Second ViewController in Xcode project is not the same width as my main ViewController? I've created a new project in Xcode for iOS. I then created a second ViewController in my project, name "TriviaViewController". However, I'm noticing that the width of my new view controller is not the same as the width of the main view controller that was created by Xcode by default.
The width for the main view controller (ViewController.swift) prints as 414.0
The width of the new view controller (TriviaViewController) I've created prints as 375.0
So when I add a UILabel to the view, and center it, the UILabel does not center.

The code seems pretty straight-forward:
let gameTitle : UILabel = {
    let label = UILabel(frame: CGRect(x: 0, y: 150, width: 300, height: 40))
    label.contentMode = UIView.ContentMode.scaleAspectFit
    label.center.x = self.view.center.x
    label.text = "Trivia"
    label.textAlignment = NSTextAlignment.center
    label.textColor = UIColor.black
    label.backgroundColor = UIColor.white
    label.numberOfLines = 1
    label.lineBreakMode = NSLineBreakMode.byWordWrapping
    label.font = UIFont.systemFont(ofSize: 14, weight: UIFont.Weight.bold)
    return label
}()
self.view.addSubview(gameTitle)

If I put this same code in the main ViewController, it centers just fine.

A: For iPhone 11 the Width of 375.0 is when you have display zoom set for "zoomed" . Width of 414.0 is when you have display zoom set for "standard". Try checking which display zoom you have set, you can check it in settings -> general -> display & brightness -> Display zoom. Maybe you somehow managed to accidentally set display zoom for your project. You can verify this in simulator by manually setting (in simulator) Settings -> Developer -> View -> Zoomed (tap Set) You can also refer to this SO Post.

A: I discovered the problem: since I'm presenting "TriviaViewController" from the main view controller: "ViewController", the Trivia view controller doesn't know the actual frame width until viewDidAppear is called, and I was setting everything in viewDidLoad.
So in TriviaViewController.swift, moving everything from viewDidLoad() to viewDidAppear() fixed the problem.


text:
Q: Android Bluetooth Server Checked so far : this stack post, this one and official docs
I am not really familiarised with the Bluetooth api, yet I couldn't find something to clarify based on my need.
What I am trying to achieve is: Using my android device (as server in this bluetooth connection) to push data to the other device (which can be on any platform)
Seems simple, and I might think about it in a complicate way (was thinking I might provide some interfaces / callbacks to the client part)
Also, my implementation should not affect the client side.. I am a bit stuck into this, if anyone could clarify it a bit, or come up with a decent sample where the code is described a bit,
Thanks in advance, and Happy Coding !

A: your phone can act as a master(host) device Here is a example you can implement
https://github.com/bauerjj/Android-Simple-Bluetooth-Example
this example uses Bluetooth to connect with HC-06 module but you can use it with other devices


text:
Q: Making a click-through Activity I'm trying to adjust the brightness of my phone programmatically. I've got an Activity in my app which is translucent to do this, however users can't click through it to the activity/window beneath it. I kill this activity as soon as the brightness is set, however I want to do more work in this activity (such as gradual brightness adjustment) which requires some time, and I don't want the user tapping at their phone wondering why their actions aren't being registered.
So basically, I need to either create a mock Window which will successfully allow me to adjust screen brightness without being displayed, or work out how to make an Activity click-through. I'm not sure how to do either.
BTW, this is the code making the brightness adjustments in the Activity:
android.provider.Settings.System.putInt(getContentResolver(),
            android.provider.Settings.System.SCREEN_BRIGHTNESS, Math.round(SOME_BRIGHTNESS * 255f));

Window window = getWindow();
window.getAttributes().screenBrightness = SOME_BRIGHTNESS;
window.setAttributes(window.getAttributes());

float sysBrightPer = getSystemBrightness(getApplicationContext());

new Thread() {
    public void run() {
         try {
             sleep(BRIGHT_TIMEOUT);
         } catch (InterruptedException e) {
             e.printStackTrace();
         }
         finish();
    }
}.start();

Any advice?
P.S. I found this app on the market. I wonder if the way this has been achieved would help me? https://market.android.com/details?id=com.haxor

A: Hah! That app did help me, if only because it led me to this solution!
Brightness Screen Filter
For the click lazy, use this:
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);

A: I'm afraid this no longer works in 4.0+, if applied to the window itself (presumably to the prevent use of activity class methods like onkey from a transparent overlay). However one can still use windowmanager.addview or layoutinflater.inflate to add a custom view class which extends viewgroup, and if you use layoutparams.FLAG_NOT_TOUCHABLE in adding or inflating this view, it will be click-through, and remain on top even when the activity that called it goes into onpause.

A: getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
If you want to intercept touches on specific views you can use the window manager to add a view with different flags:
e.g.
WindowManager.LayoutParams params = new WindowManager.LayoutParams(...);
getWindowManager().addView(myButton,params);


text:
Q: How can I solve 404 error while executing docker ps command I'm setting a docker to run a application on my custom board,i have made a custom build environment to run docker on my board,and it was successfull.But when i execute docker ps command it shows error
ERROR:Error response from daemon: 404 page not found.

ERROR Message
docker ps
Error response from daemon: 404 page not found
root@salvator-x:~# [  143.758164] audit_printk_skb: 6 callbacks suppressed
[  143.763172] audit: type=1325 audit(1553864701.319:13): table=nat family=2 entries=8
[  143.770891] audit: type=1300 audit(1553864701.319:13): arch=c00000b7 syscall=208 success=yes exit=0 a0=4 a1=0 a2=40 a3=3d8e0a90 items=0 ppid=3345 pid=3374 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="iptables" exe="/usr/sbin/xtables-multi" key=(null)
[  143.798210] audit: type=1327 audit(1553864701.319:13): proctitle=2F7573722F7362696E2F69707461626C6573002D2D77616974002D74006E6174002D4600444F434B4552
[  143.815500] audit: type=1325 audit(1553864701.375:14): table=nat family=2 entries=8

A: at first, check if you have any proxy in your envirement with this command:
env | grep -i proxy

now remove content of this below path:
/var/lib/docker/network/

if it's still not working, reinstall docker.


text:
Q: Jacobian in Tensorflow I see many people asking this question here but I didn't see a code that I can execute. I am trying to make two operations, to get dOuput/dInput and to get dOutput/dParameters. I tried
    # gradient method 1
    jac_Action_wrt_Param = tf.pack([tf.concat(1, [tf.reshape(tf.gradients(action_output[:, idx], param)[0], [1, -1])
                                                  for param in learnable_param_list]) for idx in range(action_dim)],
                                   axis=1, name='jac_Action_wrt_Param')
    jac_Action_wrt_State = tf.pack(
        [tf.gradients(action_output[:, idx], state_input)[0] for idx in range(action_dim)], axis=1,
        name='jac_Action_wrt_State')

here state is input and action is output. Both methods give None... What did I do wrong?


text:
Q: Using the same setup.py for developing and installing a non-cythonized as well as a cythonized package? Given is a (set of) Python3 packages that is to be deployed in different scenarios either cythonized or as original scripts; the source are pure Python3 sources. Preferably, I would like to use the same setup.py, if possible.

use case
in-place
include .py modules
cythonized .so modules

1. development pip3 install -e .
yes
yes

2. "unoptimized" install pip3 install .

yes

3. cythonized install pip3 install . --install-option="cythonize"

no (except __init__.py)
yes

4. build (binary) wheel python3 setup.py bdist_wheel

no (except __init__.py)
yes

So far, I succeeded in building a binary distribution wheel with only the cythonized .so shared library and without the original .py module files, following Package only binary compiled .so files of a python library compiled with Cython
. This covers use case #4 and is handled by class build_py.
However, I would also cover #1, #2 and maybe #3; #3 might be better tackled by separately building the bdist_wheel and then installing this, of not otherwise possible in a single step.
# https://stackoverflow.com/a/56043918
from setuptools.command.build_py import build_py as build_py_orig
try:
    from Cython.Build import cythonize
except:
    cythonize = None

from setuptools.command.install import install as install_orig

# https://stackoverflow.com/a/56043918
extensions = [
    Extension('spam.*', ['spam/**/*.py'],
              extra_compile_args=["-O3", "-Wall"]),
]

cython_excludes = ['spam/**/__init__.py']

def not_cythonized(tup):
    (package, module, filepath) = tup
    return any(
        fnmatch.fnmatchcase(filepath, pat=pattern) for pattern in cython_excludes
    ) or not any(
        fnmatch.fnmatchcase(filepath, pat=pattern)
        for ext in extensions
        for pattern in ext.sources
    )

class build_py(build_py_orig):
    def find_modules(self):
        modules = super().find_modules()
        return list(filter(not_cythonized, modules))

    def find_package_modules(self, package, package_dir):
        modules = super().find_package_modules(package, package_dir)
        return list(filter(not_cythonized, modules))

class install(install_orig):
    def finalize_options(self):
        super().finalize_options()
        self.distribution.ext_modules = None

setup(
    name='spam',
    packages=find_packages(),
    ext_modules=cythonize(
        extensions,
        exclude=cython_excludes,
        compiler_directives={
            "language_level": 3,
            "always_allow_keywords": True,
        },
        build_dir="build",  # needs to be explicitly set, otherwise pollutes package sources
    ) if cythonize is not None else [],
    cmdclass={
        'build_py': build_py,
        'install': install,
    },
    include_package_data=True,
    install_requires=[...]
)

The problems I'm facing here:

*

*for use cases #1 and #2 I don't want to cythonize, so ext_modules= should not be specified/set.

*

*What is a sensible way to handle ext_modules= in this situation? I find it hard to detect the requested operation (install, install -e, develop) before calling setup(), so would it be better to inherit and override the install and develop classes?

*If the latter, is it possible and allowed to clear the ext_modules and how do I avoid prematurely evaluating cythonize(...)?

*in use case #2 with the above code pip3 decides to build an egg which unfortunately includes the .so's. Might this be due to cythonize(...) getting evaluated in any case? can I avoid building the egg or how do I prevent the egg build process from including the shared libs?

*this currently includes both the sources (which I don't want to be include) as well as the cythonized modules: how can I prevent the install class from installing most of the source modules, yet installing the __init__.pys?


text:
Q: Fresh but invalid id_token I request an openid id_token from Google or Microsoft and after going through the motions and consenting to my app's request for a scope of openid, an id_token is duly returned. I can split it on the dots and the first two parts I can decode as valid JSON so it's a JWT, no doubt about that.
But when I try to use it as a bearer token in the authorization header of a request to an aspnetcore WebApi method that's annotated with [Authorize], I get 401 Unauth, with this header:
WWW-Authenticate: Bearer error=invalid_token, error_description="The signature is invalid"

It seems unlikely to me that both Microsoft and Google are issuing dud JWTs. So now I need to know what can cause this reaction from the middleware, which is current and is set up like this:
app.UseJwtBearerAuthentication(new JwtBearerOptions { SaveToken = true });

In case it matters, here's my redacted params for the token request.
  "uri": "https://accounts.google.com/o/oauth2/auth",
  "parameters": {
    "request_type": "token",
    "response_type": "id_token",
    "client_id": "REDACTED.apps.googleusercontent.com",
    "redirect_uri": "https://REDACTED/",
    "scope": "openid",
    "state": "STATE",
    "nonce": "wibble",
    "allow_signup": "true"
  }

Obviously state and nonce are stable dummy values while I figure this out.
So, invalid? WTF? I tried using http://jwt.io to check token as captured by my code and it didn't seem unhappy. The header and the payload decoded but I wasn't really clear how to validate the signature, they wanted more values and I'm not clear on where one would obtain them. Guidance on that might be helpful.
Here's a token as I extracted it.
eyJhbGciOiJSUzI1NiIsImtpZCI6IjJiMmU0ZDZmMTgyMWFkNGQ3NmQ0NTUzYzk1MWI3NTYyMmFjYjY1MzkifQ.eyJhenAiOiI3ODg4NTA3NTgwMTItdTUwbnVkMDU0aDJsNDIxOXRlaXYxbzU4Mzg5am1iNnAuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJhdWQiOiI3ODg4NTA3NTgwMTItdTUwbnVkMDU0aDJsNDIxOXRlaXYxbzU4Mzg5am1iNnAuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJzdWIiOiIxMTU2NTI3NjAwMDUzMDY1MDIxNTAiLCJub25jZSI6IndpYmJsZSIsImlzcyI6ImFjY291bnRzLmdvb2dsZS5jb20iLCJpYXQiOjE0OTUyNTA0MzcsImV4cCI6MTQ5NTI1NDAzN30.Mb3E32cVeJ4dvPw-Fpj5j1GwXIFzwTaa0fvSEh7YjvR3d18hC8_G0avWYGNb6CoJzasZnsSGDLDi_s0Cfpiov0ZBoJVap69udkR1RiTbOc-WxcgtimflG80LwpPpNepEjuJfF1i1OwIFSputpXKbFQOsTP5fN4Xe7cE-EjTrHVX8zzR2v31pqrjh1o5HSK2QEQXM7eEYYvJrDMpgjtL5r22DoQdPHCZgt1Wi3XnTRn_MCD8zWX99Z6n11TpD6IWxlgzBCItlrr6nXRv1Np9ti2Mvw7p0-gCmpFiJKD60J34aqB1AJUpPFXuZWpV--KTTA3T55rC2lRg6vSueeK6QoQ

And for your convenience here it is again but split on the dots.
eyJhbGciOiJSUzI1NiIsImtpZCI6IjJiMmU0ZDZmMTgyMWFkNGQ3NmQ0NTUzYzk1MWI3NTYyMmFjYjY1MzkifQ

eyJhenAiOiI3ODg4NTA3NTgwMTItdTUwbnVkMDU0aDJsNDIxOXRlaXYxbzU4Mzg5am1iNnAuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJhdWQiOiI3ODg4NTA3NTgwMTItdTUwbnVkMDU0aDJsNDIxOXRlaXYxbzU4Mzg5am1iNnAuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJzdWIiOiIxMTU2NTI3NjAwMDUzMDY1MDIxNTAiLCJub25jZSI6IndpYmJsZSIsImlzcyI6ImFjY291bnRzLmdvb2dsZS5jb20iLCJpYXQiOjE0OTUyNTA0MzcsImV4cCI6MTQ5NTI1NDAzN30

Mb3E32cVeJ4dvPw-Fpj5j1GwXIFzwTaa0fvSEh7YjvR3d18hC8_G0avWYGNb6CoJzasZnsSGDLDi_s0Cfpiov0ZBoJVap69udkR1RiTbOc-WxcgtimflG80LwpPpNepEjuJfF1i1OwIFSputpXKbFQOsTP5fN4Xe7cE-EjTrHVX8zzR2v31pqrjh1o5HSK2QEQXM7eEYYvJrDMpgjtL5r22DoQdPHCZgt1Wi3XnTRn_MCD8zWX99Z6n11TpD6IWxlgzBCItlrr6nXRv1Np9ti2Mvw7p0-gCmpFiJKD60J34aqB1AJUpPFXuZWpV--KTTA3T55rC2lRg6vSueeK6QoQ

This one is expired now, obviously, but if you know how to validate the signature it might be handy for checking whether I damaged the token extracting it.
Can anyone help me understand what's wrong and how to deal with it?
Hans's answer below seemed likely but reality didn't seem to match the documentation. Then I found this question Microsoft Account OpenID authentication token request returns id_token but not access_token with an answer from a MSFT person. It seems you only get an auth token when you have requested scopes. This makes sense; an auth token authorises access to one or more resources as specified in the token request. The only scope specified in my request is openid which is a request for an id_token as received.
But I'm not trying to get permission to work with provider scopes like the user's address-book or email. I'm trying to delegate authentication to the provider. Not authorization. I want the user's identity established - which as I understand things is the point of an id_token and I want to do my own authorisation using my own database of user roles that essentially define application specific scopes.
I think this is still an answerable question, even if the answer is a thumbnail sketch of how one goes about this using aspnetcore web api, supported by links to pertinent documentation.
OAuth 2 access_token vs OpenId Connect id_token makes it clear that this is a supported scenario. The key phrase here is SSO or single-sign-on. I'm starting to think this is more a question of how to go about SSO for a SPA that uses aspcorenet webapi.
But the original question stands: why do these tokens appear to have invalid
signatures?

A: In the OpenID Connect flow that Google and Microsoft support you'll get both an id_token and an access_token in the response to an authorization request. The id_token is used to authenticate the user to the Client (i.e. your application) and the access_token can be used to access APIs.
So you should be presenting the access_token in the Authorization: bearer <token> header on your API calls rather than the id_token.


text:
Q: `chalk` library does not print colored text after bundle using webpack I use chalk to write a simple script, and bundle the code using webpack.
The code print colored text before bundle, but print text without color after bundle
using webpack.
The test code is:
const chalk = require('chalk')

function main() {
  console.log(chalk.blue('chalk'))
}

main()

The webpack.config.js:
const path = require('path')

module.exports = {
  mode: 'production',
  entry: path.resolve(__dirname, 'src/main.js'),
  output: {
    filename: 'bundle.js',
  },

  resolve: {
    extensions: ['.js'],
  },
}

What happened ?

A: For me was in the webpack configuration, I was compiling for web target instead of node target =]

A: It could be a problem with your individual computer or terminal. I had a similar situation, where a simple use of chalk wasn't working. Once I stopped using Solarized themes in my terminal preferences, chalk worked as expected.
(In my searching for solutions, there were a few other solutions out there for weird behavior, solved by such things as uninstalling iTerm2.)


text:
Q: Como juntar dois vetores em outro que não tenha valores repetidos? Eu preciso fazer um programa que leia os valores de dois vetores R e S, e armazene os seus valores em um terceiro vetor chamado V. O detalhe é que não pode conter nenhum elemento repetido no vetor V.
Consegui fazer o programa mostrar o vetor V inteiro resultante da união de R e S, mas ainda não consegui bolar um jeito de não colocar elementos repetidos em V.
Segue o algoritmo que eu fiz:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Exercício6Testes
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] R = new int[10];
            int[] S = new int[10];
            int[] V = new int[20];

            Console.WriteLine("Este programa lê dois vetores e mostra a união dos dois sem valores repetidos");
            Console.WriteLine("Digite os 10 valores do vetor R: ");
            Console.WriteLine("\n");

            for (int i = 0; i < 10; i++)
            {

                Console.Write("Digite o valor de  R{0}: ", i + 1);   //LÊ O 1° VETOR
                R[i] = int.Parse(Console.ReadLine());

            }

            Console.Clear();
            Console.WriteLine("Agora digite os valores do vetor S: ");

            for (int j = 0; j < 10; j++)
            {
                Console.Write("Digite o valor de S{0}: ", j + 1); //LÊ O SEGUNDO VETOR
                S[j] = int.Parse(Console.ReadLine());

            }

            for (int k = 0; k < 10; k++)
            {
                V[k] = R[k];     //AQUI COLOCA TODOS OS VALORES DO VETOR R NAS
                                 //10 PRIMEIRAS POSIÇÕES DO VETOR V
            }

            int kw = 10;
            for (int L = 0; L < 10; L++)
            {
                V[kw] = S[L];  //AQUI COLOCA TODOS OS VALORES DO VETOR S NA
                kw++;          //SEGUNDA METADO DO VETOR V
            }

            Console.Clear();
            Console.WriteLine("União dos dois vetores: ");
            for(int mostra = 0; mostra < 20; mostra++)
            {
                Console.Write(V[mostra] + "\t");      //AQUI MOSTRA A UNIÃO DOS DOIS VETORES R e S DENTRO
                                                      //DO VETOR V.
                                                      //MOSTRA TUDO, ATÉ OS REPETIDOS!+......
            }

            Console.ReadKey();

        }
    }
}

A: Tem várias maneiras de fazer isto e de forma mais fácil, mas seguindo o algoritmo pedido, fazendo de forma mais inteligente e simples, sem mudar muito muito seria isto:
using static System.Console;

namespace Exercício6Testes {
    public class Program {
        public static void Main() {
            int[] r = new int[10];
            int[] s = new int[10];
            int[] v = new int[20];
            WriteLine("Este programa lê dois vetores e mostra a união dos dois sem valores repetidos");
            WriteLine("Digite os 10 valores do vetor R:\n");
            var j = 0;
            for (var i = 0; i < 10; i++) {
                Write($"Digite o valor de  R{i + 1}: ");
                if (!int.TryParse(ReadLine(), out r[i])) {
                    i--;
                    continue;
                }
                if (!EhRepetido(v, r[i], j)) v[j++] = r[i];
            }
            WriteLine("Agora digite os valores do vetor S: ");
            for (var i = 0; i < 10; i++) {
                Write($"Digite o valor de S{i + 1}: ");
                if (!int.TryParse(ReadLine(), out s[i])) {
                    i--;
                    continue;
                }
                if (!EhRepetido(v, s[i], j)) v[j++] = s[i];
            }
            WriteLine("União dos dois vetores: ");
            for (int i = 0; i < j; i++) Write($"{v[i]}\t");
        }
        public static bool EhRepetido(int[] vetor, int item, int posicao) {
            for (int i = 0; i < posicao; i++) if (vetor[i] == item) return true;
            return false;
        }
    }
}

Veja funcionando no ideone. E no .NET Fiddle. Também coloquei no GitHub para referência futura.
Modernizei o código. Não entendo porque as pessoas continuam programando em C# como era em 2002.
Fiz validação da digitação, do jeito que estava se a pessoa digitasse algo errado quebraria a aplicação, pode colocar ali uma mensagem de erro ou fazer alguma outra coisa para deixar mais claro que precisa digitar de novo. Decrementa o contador porque a contagem só pode ir pra frente com dado válido, e não executa mais nada abaixo.
Fiz uma rotina para identificar o repetido (não é a melhor performance, mas é como estava fazendo). Além de ser mais fácil por evitar uso de flags, evita repetição. Na verdade até a entrada de dados poderia evitar repetição. E já verifiquei direto na entrada de dados que é mais fácil e mais rápido.
No algoritmo postado fazia nada de filtro. Para filtrar repetido tem que varrer todo o array até a posição atual para ver se tem repetido, se tem encerra a busca, e só se nenhum for repetido é garantido de não ser repetido.
Por fim, só mando imprimir a quantidade de itens que tem validade no V. Como não usa R e S para nada, nem deveria ter criado essas variáveis.


text:
Q: Angular 2 FormBuilder Error During Instantiation (Code has been updated with fix)
I am trying to build a form and add validation to a controlgroup so that I can check to see if the combination of two controls exist in an array of objects. I have the following code, but when I try to run my page, it gives me an error.

EXCEPTION: Error during instantiation of ClientFormComponent!.
  ORIGINAL EXCEPTION: TypeError: Cannot read property 'length' of undefined

I am unsure of why it is unable to access the length property of my array. The "getClients()" method of my service works perfectly fine elsewhere in my app.Any thoughts would be great.

@Component({
    selector: 'client-form',
    templateUrl: './Scripts/typescript/client-form.component.html',
    directives: [FORM_DIRECTIVES],
    providers: [ClientService]
})

export class ClientFormComponent
{
    clientForm: ControlGroup;
    npi: AbstractControl;
    name: AbstractControl;

    constructor(private _clientService: ClientService, _fb: FormBuilder) {
        this.clientForm = _fb.group({ 'name': ['', Validators.compose([Validators.required])], 'npi': ['', Validators.compose([Validators.required, npiNumValidator, Validators.maxLength(10), Validators.minLength(10)])] }, { asyncValidator: this.npiNameDupValidator.bind(this) });
        this.name = this.clientForm.controls['name'];
        this.npi = this.clientForm.controls['npi'];
    }

    clientList: Client[];
    active = true;

    onSubmit(value: Client) {
        this._clientService.addDeleteClient(value, true)
            .subscribe(
            client => this.clientList.push(client));
    }

    npiNameDupValidator(group: ControlGroup) {
        return new Promise((resolve, reject) => {
            let name = group.controls['name'];
            let npi = group.controls['npi'];
            var found = false;

            this._clientService.getClients().subscribe(clients => {
                for (var i = 0; i < clients.length; i++) {
                    alert(clients[i].name + ':' + name.value);
                    alert(clients[i].npi + ':' + npi.value);

                    if (clients[i].name == name.value && clients[i].npi == npi.value) {
                        found = true;
                        break;
                    }
                }

                if (found) {
                    alert('Found!');
                    resolve({ npiNameDupe: true });
                }
                else {
                    resolve(null);
                }
            });
        });
    }
}

function npiNumValidator(control: Control): { [s: string]: boolean } {
    if (isNaN(control.value)) {
        return { npiNAN: true };
    }
}

My template HTML:

    <form *ngIf="active" (ngSubmit)="onSubmit(clientForm.value)" [ngFormModel]="clientForm">

            Client Id:
            <input placeholder="QDX"id="clientid" type="text" class="form-control"  [ngFormControl]="clientForm.controls['name']">

Client ID is required

NPI must be a number

            NPI:
            <input placeholder="0123456789" maxlength="10" id="npi" type="text" class="form-control" [ngFormControl]="clientForm.controls['npi']">

NPI is required

NPI must be a number

NPI must be 10 characters

            <button type="submit" class="btn btn-default" [disabled]="!clientForm.valid">Add</button>

NPI & Name Combo Already Exist

    </form>

A: Since getClients() is an observable, you'd need to set the length inside of the subscribe callback.
var clis: Client[];
var length = 0;
this._clientService.getClients().subscribe(clients => {
    clis = clients;
    length = clis.length;
});

This ensures that length is properly set once data is returned to your subscribe.
As for WHY you are getting the error in the first place, you have not initialized your array.  You'd need to actually provide a default value since currently it is undefined which throws an error when you try to check length.
var clis: Client[] = [];

A: I think that you try to implement an asynchronous validator. You should use the asyncValidator attribute instead on the validator one:
_fb.group({
  'name': ['', Validators.compose([Validators.required])],
  'npi': ['', Validators.compose([Validators.required, (...)])]
}, { asyncValidator: this.npiNameDupValidator.bind(this) });

I would refactor your validator this way:
npiNameDupValidator(group: ControlGroup) {
  return new Promise((resolve, reject) => {
    let name = group.controls['name'];
    let npi = group.controls['npi'];

    this._clientService.getClients().subscribe(clients => {
      var clis = clients;
      var length = clis.length;
      var found = (...); // your processing here

      if (found) {
        resolve({ npiNameDupe: true });
      } else {
        resolve(null);
      }
  });
}


text:
Q: Get email body text without reply details - ActionMailbox I'm implementing ActionMailbox with Rails 6. In my process function, I grab the details of the email and save them for future reference. ActionMailbox allows me to reference the email body text like this:
mail.text_part.body.decoded

This works fine, but when a user is replying to an email, the function returns their message reply plus the message text they were replying to which looks something like this:
Hello, this is a response. On Jan 4th, 2021 example@example.com said Please respond to this message.

I'm looking to grab just the text "Hello, this is a response.".
I want to retrieve just the text from their reply without the text from the email the user was replying to. Is there any way to accomplish this?


text:
Q: setup customized pagelayout for my graduation work Hi this question is a follow up on a question regarding \leftskip that let me rethink my latex usage. David Carlisle says my usage of leftskip is wrong and i wold like to correct that...
So here is a mwe of my doc, wich in real is separated in different files, but that doesn't mater now. What i need is an advice how to clean up the file to work smoother.
    \documentclass{article}
    \usepackage[
    left={\dimexpr 10mm + 55pt},
    right=20mm,
    top=20mm,
    bottom=18mm,
    footskip=2em,
    headheight=2em,
    headsep=0.8em,
    showframe
    ]{geometry}
    \usepackage[utf8]{inputenc}
    \usepackage{graphicx}
    \usepackage{lipsum}
    \usepackage{fancyhdr}
    \pagestyle{fancy} % --- new header
      \renewcommand{\headrulewidth}{0.1pt}
      \renewcommand{\footrulewidth}{0.1pt}
      \setlength{\headheight}{16pt}  % --- new header end
    \usepackage{tocloft}            %is alpha but it solves the indent on sectons
    \tocloftpagestyle{empty}
    \renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
      \makeatletter             %---------- start of @ sequencecontrollers ----------
        \renewcommand{\@tocrmarg}{15mm}                         %right margin
        \renewcommand{\@pnumwidth} {10mm}
        \renewcommand{\@dotsep}{4}
      \makeatother          %---------- end of @ sequencecontrollers ----------
    \renewcommand{\cftaftertoctitle}{\\[\baselineskip]\mbox{}\hfill{\footnotesize\scshape Seite}} %sets the word "page" upon the pagenumbers
    \setlength{\parskip}{0pt}
    \setlength{\parindent}{0pt}
    \usepackage{titlesec}
    \titleformat{\section}
       {\normalfont\fontsize{17pt}{18pt}
       \selectfont\scshape}{\rlap{\thesection}}{55pt}{}
    \titlespacing{\section}{-55pt}{3.5ex plus 1ex minus .2ex}%
                                          {2.3ex plus.2ex}%
    \titleformat{\subsection}
       {\normalfont\fontsize{16pt}{17pt}
       \selectfont\scshape}{\rlap{\thesubsection}}{55pt}{}
    \titlespacing{\subsection}{-55pt}{3.25ex plus 1ex minus .2ex}%
                                                {1.5ex plus .2ex}%
    \titleformat{\subsubsection}
       {\normalfont\fontsize{15pt}{16pt}
       \selectfont\scshape}{\rlap{\thesubsubsection}}{55pt}{}
    \titlespacing{\subsubsection}{-55pt}{3.25ex plus 1ex minus .2ex}%
                                                      {1.5ex plus .2ex}%
    \titleformat{\paragraph}
       {\normalfont\fontsize{14pt}{15pt}
       \selectfont\scshape}{\rlap{\theparagraph}}{55pt}{}
    \titlespacing{\paragraph}{-55pt}{3.25ex plus 1ex minus .2ex}%
                                                {1em}%
    \titleformat{\subparagraph}
       {\normalfont\fontsize{13pt}{14pt}
       \selectfont\scshape}{\rlap{\thesubparagraph}}{55pt}{}
    \titlespacing{\subparagraph}{-55pt}{3.25ex plus 1ex minus .2ex}%
                                                    {1em}%
    \setcounter{secnumdepth}{5}
    \begin{document}
    \newgeometry{   % ------------- reset for centering -------------
    left=15mm,
    right=20mm,
    top=20mm,
    bottom=18mm,
    footskip=2em,
    headheight=2em,
    headsep=0.8em
    }
    \tableofcontents
    \thispagestyle{empty}
    \clearpage
    \restoregeometry        % ------------- back to document setting (left+55pt)  -------------
    \setcounter{page}{1}
    \section{One}
    \lipsum[1]
    \subsection{SubOne}
    \lipsum[2]
      \begin{figure}[!ht]
        \begin{flushright}
          \includegraphics[width=\linewidth]{example-image}
        \end{flushright}
      \end{figure}
    \section{two}
    \lipsum[3]
    \subsection{SubTwo}
      \begin{figure}[!ht]
        \begin{flushright}
          \includegraphics[width=\textwidth]{example-image}
        \end{flushright}
      \end{figure}
    \lipsum[4]
    \subsubsection{SubSubOne}
    \lipsum[5]
    \paragraph{ParOne}
    \lipsum[6]
    \subparagraph{SubParOne}
    \lipsum[7]
    \end{document}

David says "it doesn't make a lot of sense to load geometry to set the page size and margins in a consistent way, then change settings such as \textwidth "by hand" just set the page format you want using geometry"
How can i make a page as in the MWE without seting these values by hand?
edit: The leftskip is solved with the help of John Kormylo (big thanks!) now only the Header need to go over the full width again...

Let me add the wonderfull solution of John Kormylo here and ask two new questions regarding the new sample MWE:
        \documentclass{article}
    \usepackage[
    left=20mm,
    right=20mm,
    top=20mm,
    bottom=18mm,
    footskip=2em,
    headheight=2em,
    headsep=0.8em
    ]{geometry}
    \usepackage{filecontents}  %----------- i am adding a bibliography file -----------
    \begin{filecontents*}{main.bib}
    @Book{Goossens,
      author    = {Goossens, Michel and Mittelbach, Frank and
                   Samarin, Alexander},
      title     = {The LaTeX Companion},
      edition   = {1},
      publisher = {Addison-Wesley},
      location  = {Reading, Mass.},
      year      = {1994},
    }
    @Book{adams,
      title     = {The Restaurant at the End of the Universe},
      author    = {Douglas Adams},
      series    = {The Hitchhiker's Guide to the Galaxy},
      publisher = {Pan Macmillan},
      year      = {1980},
    }
    \end{filecontents*}
    \usepackage[utf8]{inputenc}
    \usepackage{graphicx}
    \usepackage{lipsum}
    \usepackage{paracol}
    \setlength{\columnsep}{0pt}
    \setcolumnwidth{55pt,{\dimexpr \textwidth-55pt}}
    \usepackage{fancyhdr}
    \pagestyle{fancy} % --- new header
      \renewcommand{\headrulewidth}{0.1pt}
      \renewcommand{\footrulewidth}{0.1pt}
      \setlength{\headheight}{16pt}  % --- new header end
    \usepackage{tocloft}            %is alpha but it solves the indent on sectons
    \tocloftpagestyle{empty}
    \renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
      \makeatletter             %---------- start of @ sequencecontrollers ----------
        \renewcommand{\@tocrmarg}{15mm}                         %right margin
        \renewcommand{\@pnumwidth} {10mm}
        \renewcommand{\@dotsep}{4}
      \makeatother          %---------- end of @ sequencecontrollers ----------
    \renewcommand{\cftaftertoctitle}{\\[\baselineskip]\mbox{}\hfill{\footnotesize\scshape Seite}} %sets the word "page" upon the pagenumbers
    \setlength{\parskip}{0pt}
    \setlength{\parindent}{0pt}
    \usepackage{titlesec}
    \titleformat{\section}
       {\normalfont\fontsize{17pt}{18pt}
       \selectfont\scshape}{\rlap{\thesection}}{55pt}{}
    \titlespacing{\section}{-55pt}{3.5ex plus 1ex minus .2ex}%
                                          {2.3ex plus.2ex}%
    \titleformat{\subsection}
       {\normalfont\fontsize{16pt}{17pt}
       \selectfont\scshape}{\rlap{\thesubsection}}{55pt}{}
    \titlespacing{\subsection}{-55pt}{3.25ex plus 1ex minus .2ex}%
                                                {1.5ex plus .2ex}%
    \titleformat{\subsubsection}
       {\normalfont\fontsize{15pt}{16pt}
       \selectfont\scshape}{\rlap{\thesubsubsection}}{55pt}{}
    \titlespacing{\subsubsection}{-55pt}{3.25ex plus 1ex minus .2ex}%
                                                      {1.5ex plus .2ex}%
    \titleformat{\paragraph}
       {\normalfont\fontsize{14pt}{15pt}
       \selectfont\scshape}{\rlap{\theparagraph}}{55pt}{}
    \titlespacing{\paragraph}{-55pt}{3.25ex plus 1ex minus .2ex}%
                                                {1em}%
    \titleformat{\subparagraph}
       {\normalfont\fontsize{13pt}{14pt}
       \selectfont\scshape}{\rlap{\thesubparagraph}}{55pt}{}
    \titlespacing{\subparagraph}{-55pt}{3.25ex plus 1ex minus .2ex}%
                                                    {1em}%
    \setcounter{secnumdepth}{5}
     %----------- i am adding a bibliography here -----------
    \usepackage[backend=bibtex, style=numeric, defernumbers]{biblatex}
    \DeclareBibliographyCategory{skipbibliography}
    \DeclareCiteCommand{\cite}[\mkbibfootnote]
      {\usebibmacro{prenote}}
      {\addtocategory{skipbibliography}{\thefield{entrykey}}%
       \usedriver
         {\DeclareNameAlias{sortname}{default}}
         {\thefield{entrytype}}}
      {\multicitedelim}
      {\usebibmacro{postnote}}
    \usepackage{csquotes}
    \appto{\bibsetup}{\emergencystretch=1em}
    \addbibresource{main.bib}
     %----------- i am adding a index here-----------
    \usepackage{imakeidx}
    \makeindex[
    columns=3,
    title=Alphabetischer Index,
    options= -s latexfiles/style-index.tex]
     %----------- i am adding a glosssary here -----------
    \usepackage{glossaries}
    \makeglossaries

    \newglossaryentry{latex}
    {
        name=latex,
        description={Is a mark up language specially suited
        for scientific documents}
    }

    \newglossaryentry{maths}
    {
        name=mathematics,
        description={Mathematics is what mathematicians do}
    }

    \begin{document}  %----------- the document starts -----------
      \tableofcontents
      \thispagestyle{empty}
      \clearpage
      \setcounter{page}{1}
      \begin{paracol}{2}
        \switchcolumn
        \section{One}
          \lipsum[1]
        \subsection{SubOne}
          \lipsum[2]
          \cite{adams}   %----------- bib -----------
          \index{keyword}    %----------- index -----------
          \Gls{latex}       %----------- glosssary-----------
          \begin{figure}[!ht]
              \includegraphics[width=\linewidth]{example-image}
              \caption{Image SubOne}
          \end{figure}
        \section{two}
          \lipsum[3]
        \subsection{SubTwo}
          \begin{figure}[!ht]
              \includegraphics[width=\linewidth]{example-image}
              \caption{Image SubTwo}
          \end{figure}
          \lipsum[4]
          \cite{Goossens}   %----------- bib -----------
          \index{key}       %----------- index -----------
          \gls{maths}       %----------- glosssary-----------
        \subsubsection{SubSubOne}
          \lipsum[5]
           \begin{table}[htp]
              \centering
              \begin{tabular}{|l|p{9cm}|l|l|}\hline
                Nr & desc & kriteria & priority \\ \hline
                1 & A1 & T1 & M \\ \hline
                2 & A2 & F2 & K1 \\ \hline
                3 & A3 & T1 & M \\ \hline
                \multicolumn{4}{l}{* Legend: M = must, K1 = high, K2 = mid, K3 = low}
              \end{tabular}
            \caption{Targets}
          \end{table}
        \paragraph{ParOne}
        \lipsum[6]
        \subparagraph{SubParOne}
        \lipsum[7]
        \newpage
          \section{References}  %----------- the document starts -----------
            \switchcolumn*
            \begin{column}
              \printbibliography%------------------ BIBLIOGRAPHY --------------------------------
              \listoffigures%------------------------- FIGURES ------------------------------------
              \listoftables%-------------------------- TABLES --------------------------------------
              \printindex%--------------------------- INDEX --------------------------------------
              \printglossaries%--------------------- GLOSSARY -----------------------------------
            \end{column}
      \end{paracol}
    \end{document}

A: Here is a way to achieve the same effect without using \leftskip.  I tried to get the default vertical spacing from article class, but was confused by the use of negative values.  (This would have been SO much easier without using titlesec!)
\documentclass{article}
\usepackage[
left={\dimexpr 20mm + 55pt},
right=20mm,
top=20mm,
bottom=18mm,
footskip=2em,
headheight=2em,
headsep=0.8em,
showframe
]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{lipsum}
%\leftskip=55pt
\setlength{\parskip}{\baselineskip}
\setlength{\parindent}{0pt}
  \setlength{\parskip}{0pt}
  %\setlength{\textwidth}{483pt}
\usepackage{titlesec}
\titleformat{\section}
   {\normalfont\fontsize{17pt}{18pt}
   \selectfont\scshape}{\rlap{\thesection}}{55pt}{}
\titlespacing{\section}{-55pt}{3.5ex plus 1ex minus .2ex}%
                              {2.3ex plus.2ex}%
\titleformat{\subsection}
   {\normalfont\fontsize{16pt}{17pt}
   \selectfont\scshape}{\rlap{\thesubsection}}{55pt}{}
\titlespacing{\subsection}{-55pt}{3.25ex plus 1ex minus .2ex}%
                                 {1.5ex plus .2ex}%
\titleformat{\subsubsection}
   {\normalfont\fontsize{15pt}{16pt}
   \selectfont\scshape}{\rlap{\thesubsubsection}}{55pt}{}
\titlespacing{\subsubsection}{-55pt}{3.25ex plus 1ex minus .2ex}%
                                    {1.5ex plus .2ex}%
\titleformat{\paragraph}
   {\normalfont\fontsize{14pt}{15pt}
   \selectfont\scshape}{\rlap{\theparagraph}}{55pt}{}
\titlespacing{\paragraph}{-55pt}{3.25ex plus 1ex minus .2ex}%
                                {1em}%
\titleformat{\subparagraph}
   {\normalfont\fontsize{13pt}{14pt}
   \selectfont\scshape}{\rlap{\thesubparagraph}}{55pt}{}
\titlespacing{\subparagraph}{-55pt}{3.25ex plus 1ex minus .2ex}%
                                {1em}%
\setcounter{secnumdepth}{5}
\begin{document}
\section{One}
\lipsum[1]
\subsection{SubOne}
\lipsum[2]
  \begin{figure}[!ht]
      \includegraphics[width=\textwidth]{example-image}
  \end{figure}
\section{two}
\lipsum[3]
\subsection{SubTwo}
  \begin{figure}[!ht]
      \includegraphics[width=\textwidth]{example-image}
  \end{figure}
\lipsum[4]
\subsubsection{SubSubOne}
\lipsum[5]
\paragraph{ParOne}
\lipsum[6]
\subparagraph{SubParOne}
\lipsum[7]
\end{document}

Here is the version not using titlesec.  It may not look easier, but about I had to do was copy and paste.
I also had to change \@seccntformat to create the constant 55pt width section number.
\documentclass{article}
\usepackage[
left={\dimexpr 20mm + 55pt},
right=20mm,
top=20mm,
bottom=18mm,
footskip=2em,
headheight=2em,
headsep=0.8em,
showframe
]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{lipsum}

%\setlength{\parskip}{\baselineskip}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}

\makeatletter
\renewcommand\section{\@startsection {section}{1}{-55pt}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\normalfont\fontsize{17pt}{18pt}\selectfont\scshape}}
\renewcommand\subsection{\@startsection{subsection}{2}{-55pt}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\fontsize{16pt}{17pt}\selectfont\scshape}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{-55pt}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\fontsize{15pt}{16pt}\selectfont\scshape}}
\renewcommand\paragraph{\@startsection{paragraph}{4}{-55pt}%
                                    {3.25ex \@plus1ex \@minus.2ex}%
                                    {-1em}%
                                    {\normalfont\fontsize{14pt}{15pt}\selectfont\scshape}}
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{-55pt}%
                                       {3.25ex \@plus1ex \@minus .2ex}%
                                       {-1em}%
                                      {\normalfont\fontsize{13pt}{14pt}\selectfont\scshape}}
\def\@seccntformat#1{\hbox to 55pt{\csname the#1\endcsname\hfil}}
\makeatother

\setcounter{secnumdepth}{5}
\begin{document}
\section{One}
\lipsum[1]
\subsection{SubOne}
\lipsum[2]
  \begin{figure}[!ht]
      \includegraphics[width=\textwidth]{example-image}
  \end{figure}
\section{two}
\lipsum[3]
\subsection{SubTwo}
  \begin{figure}[!ht]
      \includegraphics[width=\textwidth]{example-image}
  \end{figure}
\lipsum[4]
\subsubsection{SubSubOne}
\lipsum[5]
\paragraph{ParOne}
\lipsum[6]
\subparagraph{SubParOne}
\lipsum[7]
\end{document}

In this solution (based on the revised question), I use paracol to reduce the width by only using the right column.  \textwidth refers to the whole page, while \columnwidth and \linewidth can be used for the reduced space.
\documentclass{article}
\usepackage[
left=20mm,
right=20mm,
top=20mm,
bottom=18mm,
footskip=2em,
headheight=2em,
headsep=0.8em
]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{paracol}
\setlength{\columnsep}{0pt}
\setcolumnwidth{55pt,{\dimexpr \textwidth-55pt}}
\usepackage{fancyhdr}
\pagestyle{fancy} % --- new header
  \renewcommand{\headrulewidth}{0.1pt}
  \renewcommand{\footrulewidth}{0.1pt}
  \setlength{\headheight}{16pt}  % --- new header end
\usepackage{tocloft}            %is alpha but it solves the indent on sectons
\tocloftpagestyle{empty}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
  \makeatletter             %---------- start of @ sequencecontrollers ----------
    \renewcommand{\@tocrmarg}{15mm}                         %right margin
    \renewcommand{\@pnumwidth} {10mm}
    \renewcommand{\@dotsep}{4}
  \makeatother          %---------- end of @ sequencecontrollers ----------
\renewcommand{\cftaftertoctitle}{\\[\baselineskip]\mbox{}\hfill{\footnotesize\scshape Seite}} %sets the word "page" upon the pagenumbers
\setlength{\parskip}{0pt}
\setlength{\parindent}{0pt}
\usepackage{titlesec}
\titleformat{\section}
   {\normalfont\fontsize{17pt}{18pt}
   \selectfont\scshape}{\rlap{\thesection}}{55pt}{}
\titlespacing{\section}{-55pt}{3.5ex plus 1ex minus .2ex}%
                                      {2.3ex plus.2ex}%
\titleformat{\subsection}
   {\normalfont\fontsize{16pt}{17pt}
   \selectfont\scshape}{\rlap{\thesubsection}}{55pt}{}
\titlespacing{\subsection}{-55pt}{3.25ex plus 1ex minus .2ex}%
                                            {1.5ex plus .2ex}%
\titleformat{\subsubsection}
   {\normalfont\fontsize{15pt}{16pt}
   \selectfont\scshape}{\rlap{\thesubsubsection}}{55pt}{}
\titlespacing{\subsubsection}{-55pt}{3.25ex plus 1ex minus .2ex}%
                                                  {1.5ex plus .2ex}%
\titleformat{\paragraph}
   {\normalfont\fontsize{14pt}{15pt}
   \selectfont\scshape}{\rlap{\theparagraph}}{55pt}{}
\titlespacing{\paragraph}{-55pt}{3.25ex plus 1ex minus .2ex}%
                                            {1em}%
\titleformat{\subparagraph}
   {\normalfont\fontsize{13pt}{14pt}
   \selectfont\scshape}{\rlap{\thesubparagraph}}{55pt}{}
\titlespacing{\subparagraph}{-55pt}{3.25ex plus 1ex minus .2ex}%
                                                {1em}%
\setcounter{secnumdepth}{5}
\begin{document}
\tableofcontents
\thispagestyle{empty}
\clearpage
\setcounter{page}{1}
\begin{paracol}{2}
\switchcolumn
\section{One}
\lipsum[1]
\subsection{SubOne}
\lipsum[2]
  \begin{figure}[!ht]
      \includegraphics[width=\linewidth]{example-image}
  \end{figure}
\section{two}
\lipsum[3]
\subsection{SubTwo}
  \begin{figure}[!ht]
      \includegraphics[width=\linewidth]{example-image}
  \end{figure}
\lipsum[4]
\subsubsection{SubSubOne}
\lipsum[5]
\paragraph{ParOne}
\lipsum[6]
\subparagraph{SubParOne}
\lipsum[7]
\end{paracol}
\end{document}


text:
Q: How do we know which type of probability model to use? In our introduction to statistical inference, the lecturer said

In statistics we assume a certain type of probability model generates
  observed data and we use a collection of observations to estimate
  which particular model is most plausible, ...

This does not seem sensible to me. How can one just "assume" a certain type of probability model generates observed data? Surely there is a rigorous way of knowing which probability model fits the observed data rather than just assuming? Can someone please provide a better explanation of this?

A: *

*In some situations the characteristics of the situation will suggest a model.
For example, imagine you have a situation where events occurring in time have characteristics like - the rate at which events happen is close to constant; events occur independently, at constant average rate and the probability of at least one event in a small interval of time will be proportional to the length of the interval. Then the number of events per unit time will be close to Poisson-distributed, the time between events will be close to exponentially distributed, the distribution of events within a fixed interval of time will be uniform. There are a variety of other such simple models (for other circumstances) from which a number of distributions arise, and which may often be reasonable models in a number of real situations.
You might like to read, for example, about Bernoulli trials -- which are a kind of idealized situation with a sequence of outcomes of two kinds; from this a variety of distributions occur, depending on what things you look at (number of outcomes of one type in a fixed number of trials, or perhaps the number of trials until you see an outcome of a particular kind, for example).

*In other situations a distribution may have been found to work well in practice, or a distribution shape is suggested by observation (possibly from previous studies). This may happen without there necessarily being a model of a process that implies that distribution -- a distribution is used because it works fairly well in that situation. It seems like this is the case when the Weibull distribution is used for wind speeds, for example (at least I haven't seen a theoretical derivation of it).
Sometimes models arise as a mix of both -- an initial theoretical model is considered as an approximation, then a similar but more complex model is used which better approximates the actual circumstances.
Or it might happen that theoretical considerations narrow things down somewhat ("we need a family of right skewed continuous distributions with constant coefficient-of variation", for example) but doesn't of itself suggest a specific family, and it may be that a number of simple choices seem to describe the data sets we have reasonably well. Then the choice of distribution family may come down to what is easiest to fit, or convenient to perform particular kinds of calculations on or is most familiar to our audience, as long it also works well enough for our purposes.


text:
Q: how to get a single row based on my condition I have following rows in my user table as

Now I want to get user having all accesstype as view,edit and share. So I need to get two rows out of this as

How can I achieve this using postgresql statement.

A: To get the rows that have exactly those three access types, you can aggregate them into an array:
select id, name, age
from the_table
group by id, name, age
having array_agg(accesstype order by accesstype) = array['edit', 'share', 'view']

Note that the order of the elements in the array[...] expression matters for the = operator used because array['a', 'b'] is not equal to array['b', 'a'].
Alternatively you can use bool_and()
select id, name, age
from the_table
group by id, name, age
having bool_and(accesstype in ('edit', 'share', 'view'))
   and count(distinct accesstype) = 3

A: Something like:
SELECT id, name, age
FROM (
    SELECT id, name, age
         , count(distinct accesstype) over (partition by id) as cnt
    FROM T
    WHERE accesstype IN ('view','edit','share')
) AS U
WHERE cnt = 3

Assuming id, accesstype is unique you can change that to:
SELECT id, name, age
FROM (
    SELECT distinct id, name, age
         , count(accesstype) over (partition by id) as cnt
    FROM T
    WHERE accesstype IN ('view','edit','share')
) AS U
WHERE cnt = 3

Untested since you did not provide a Fiddle or similar. For future posts please include something that makes it easy to reproduce your scenario.
You may also consider normalizing your tables into a separate relation for access type. Also, age is something you should derive from for example birth date. As of now, you will have to update this attribute on a regular basis (not clear on how you know when raj becomes 17 years old)


text:
Q: How to search for a group where a meta field equals a specific string with bbPress? I'm going nuts over this... I need to make bbPress group search to find only those groups where a specific string is inside a meta field.
I tried what I found here: https://codex.buddypress.org/plugindev/group-meta-queries-usage-example/
I use a different meta field, but tried to implement this as it should be. I can update and read the meta value, but I cannot make the meta_query thing work.
I can see the filter_ajax_querystring function is being executed, because I placed a couple of echo's there to test, and the search term is also there, it only doesn't find the group with the meta key - and it is there.
Anyone who can shed some light? What am I missing?
This is my groups-loop:
    $params['meta_query'] = array(
        array(
            'key'     => 'bp_symbol_code',
            'value'   => $_REQUEST['s'],
            'compare' => '='
        )
    );

    if ( bp_has_groups( bp_ajax_querystring( 'groups' ) . '&' . http_build_query( $params ) ) ) {
        while ( bp_groups() ) {
            bp_the_group();
            // redirect after header definitions - cannot use wp_redirect( $location );
            ?>
               <script type="text/javascript">
               <!--
                  window.location= '<?php echo bp_group_permalink(); ?>';
               //-->
               </script>
            <?php
        }
    }

A: Ok, I feel stupid....
This was the problem:
if ( bp_has_groups( bp_ajax_querystring( 'groups' ) . '&' . http_build_query( $params ) ) )

bp_has_groups() was receiving both an array and a query string...
So the solution was just to change the above with this:
if ( bp_has_groups( array_merge( bp_ajax_querystring( 'groups' ), $params ) ) )

Thanks Gavin, your comments eventually made me realise that mistake :)


text:
Q: Azure - storing images in storage account and linking them to records in a table I've set up a table on Azure and I'm uploading a receiving data via a WP7 app. For each record in the table, I'd like to attach/link to one image which can be downloaded when I download the appropriate record.
I know that the image has to be stored in blob format in an Azure Data Account and there's plenty of tutorials on that but how do I link images to records in a table?
I.E I find the record I want and access it, how do I access the image at the same time?
Cheers!

A: One of the fileds in you table will contain the uri for the blob that is associated with it. You will not be able to pull from blob storage and table storage within a single transaction.
Depending on the client, the blobs for your images might be make publicly available and the client could pull them directly instead of putting the extra bandwidth load on your web role/web site


text:
Q: Asymptotics of exterior solution to perturbed Laplace equation Suppose we have an elliptic operator $\sum_{i,j=1}^na_{ij}(x)D_{ij}$ on $\mathbb R^n$ for $n\ge 3$ which is asymptotic to the Laplacian i.e. there exists $\beta>0$ so that $$|a_{ij}(x)-\delta_{ij}|\le C|x|^{-\beta}\quad\text{as }x\to\infty.$$ We assume $a_{ij}$ are smooth functions of $x$.
Suppose $u$ is a positive solution to $$a_{ij}(x)D_{ij}u=0$$ on $\mathbb R^n\backslash\{0\}$, can we conclude that $u$ is bounded at infinity? That is can we conclude there exists $C,R>0$ so that $$|u(x)|\le C\quad \text{for all }|x|\ge R?$$
This is heuristically true because it is true for the Laplacian and $a_{ij}D_{ij}$ is a small perturbation of $\Delta$. I can prove that $u$ has at most polynomial growth since Harnack inequality is true, but I have no idea how to proceed.
Update I found an answer for my question. The original conclusion is not correct and the best conclusion we can get is: for any $\epsilon>0$, there exists $R>0,c>0$ so that
$$u(x)\le c|x|^\epsilon\quad \forall |x|\ge R.$$